@ilife-tech/react-application-flow-renderer 1.2.99 → 1.2.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -99,5 +99,5 @@
99
99
  animation: ${eE} 1.4s linear infinite;
100
100
  `:null,rE="string"!=typeof tE?ny`
101
101
  animation: ${tE} 1.4s ease-in-out infinite;
102
- `:null,oE=Bv("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${dy(n.color)}`]]}})(cy(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:nE||{animation:`${eE} 1.4s linear infinite`}},...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),iE=Bv("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),aE=Bv("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${dy(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(cy(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink,style:rE||{animation:`${tE} 1.4s ease-in-out infinite`}}]}))),sE=e.forwardRef(function(e,t){const n=Mv({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:i=!1,size:a=40,style:s,thickness:l=3.6,value:u=0,variant:c="indeterminate",...d}=n,p={...n,color:o,disableShrink:i,size:a,thickness:l,value:u,variant:c},f=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Hd({root:["root",n,`color${dy(r)}`],svg:["svg"],circle:["circle",`circle${dy(n)}`,o&&"circleDisableShrink"]},Zk,t)})(p),m={},h={},v={};if("determinate"===c){const e=2*Math.PI*((44-l)/2);m.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,h.transform="rotate(-90deg)"}return(0,jv.jsx)(oE,{className:Wd(f.root,r),style:{width:a,height:a,...h,...s},ownerState:p,ref:t,role:"progressbar",...v,...d,children:(0,jv.jsx)(iE,{className:f.svg,ownerState:p,viewBox:"22 22 44 44",children:(0,jv.jsx)(aE,{className:f.circle,style:m,ownerState:p,cx:44,cy:44,r:(44-l)/2,fill:"none",strokeWidth:l})})})});function lE(e){return by("MuiIconButton",e)}const uE=Ay("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),cE=Bv(Jk,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,"default"!==n.color&&t[`color${dy(n.color)}`],n.edge&&t[`edge${dy(n.edge)}`],t[`size${dy(n.size)}`]]}})(cy(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:th(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),cy(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:th((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${uE.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${uE.loading}`]:{color:"transparent"}}))),dE=Bv("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),pE=e.forwardRef(function(e,t){const n=Mv({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:i,color:a="default",disabled:s=!1,disableFocusRipple:l=!1,size:u="medium",id:c,loading:d=null,loadingIndicator:p,...f}=n,m=kk(c),h=p??(0,jv.jsx)(sE,{"aria-labelledby":m,color:"inherit",size:16}),v={...n,edge:r,color:a,disabled:s,disableFocusRipple:l,loading:d,loadingIndicator:h,size:u},y=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:a}=e;return Hd({root:["root",a&&"loading",n&&"disabled","default"!==r&&`color${dy(r)}`,o&&`edge${dy(o)}`,`size${dy(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},lE,t)})(v);return(0,jv.jsxs)(cE,{id:d?m:c,className:Wd(y.root,i),centerRipple:!0,focusRipple:!l,disabled:s||d,ref:t,...f,ownerState:v,children:["boolean"==typeof d&&(0,jv.jsx)("span",{className:y.loadingWrapper,style:{display:"contents"},children:(0,jv.jsx)(dE,{className:y.loadingIndicator,ownerState:v,children:d&&h})}),o]})});function fE(e){return fE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fE(e)}function mE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mE(Object(n),!0).forEach(function(t){vE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vE(e,t,n){return(t=function(e){var t=function(e){if("object"!=fE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yE=function(e){var t=e.tooltip,r=e.placement,o=void 0===r?"top":r,i=e.sx,a=void 0===i?{}:i;return t?n().createElement(Bk,{title:t,arrow:!0,placement:o},n().createElement(pE,{size:"small",sx:hE({padding:"2px",marginLeft:"4px",verticalAlign:"middle",minWidth:"auto",width:"18px",height:"18px","&:hover":{backgroundColor:"transparent"}},a),"aria-label":t},n().createElement("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"10px",fontWeight:"bold",lineHeight:1}},"i"))):null};yE.propTypes={tooltip:o().string,placement:o().oneOf(["top","bottom","left","right"]),sx:o().object};const gE=yE;function bE(e){return bE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bE(e)}function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AE(Object(n),!0).forEach(function(t){kE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kE(e,t,n){return(t=function(e){var t=function(e){if("object"!=bE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EE=function(t){var r=t.questionId,o=t.label,i=t.defaultValue,a=t.validation,s=t.value,l=t.required,u=t.placeholder,c=t.onChange,d=t.type,p=void 0===d?"text":d,f=t.maskInput,m=t.format,h=t.helperText,v=(t._encrypted,t._maskingType,t._maskingLength,t._validationErrorMessages,t._showCheckBox,t._isEsignDoc,t._isOpenInNewTab,t._addAdditional,t._addMedication,t.header),y=t.maxLength,g=t.minLength,b=t.visible,A=t.inputProps,w=void 0===A?{}:A,k=t.styleName,E=t.customTheme,C=void 0===E?{}:E,x=(t._props,t.onSearch),S=t.onBlur,_=t.tooltip,O=void 0===_?"":_,I=t.showQuestionLabels,T=void 0===I||I,P=(0,e.useRef)(null),B=xc(),D=w["data-item-index"],j=w["data-parent-id"],R=GA({questionId:r,itemIndex:D,defaultValue:i,defaultVisible:!0,defaultDisabled:!1}),M=R.disabled,L=R.error,N=(0,e.useMemo)(function(){var e=B.textField||{};return ZA(e,C)},[B,C]),F=(0,e.useMemo)(function(){var e=wE(wE({},N.container),{},{width:"100%"}),t=tw(N.input,L&&N.error,M&&N.disabled);return{container:ew(e,N.responsive),input:t}},[N,L,M]);(0,e.useEffect)(function(){if(f&&P.current){var e=function(e){var t={placeholder:"",insertMode:!0,rightAlign:!1,clearMaskOnLostFocus:!1,showMaskOnHover:!1,showMaskOnFocus:!1,jitMasking:!0,greedy:!1};if("string"==typeof e){var n=e;return"#####-####"===e.replaceAll("9","#")&&(n="#####[-####]"),new(Ea())(fs(fs({},t),{},{mask:n.replaceAll("#","9")}))}var r=e.alias,o=e.inputFormat,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,us);return new(Ea())(fs(fs({},t),{},{alias:r,inputFormat:o},i))}(f);return e.mask(P.current),function(){e.remove()}}},[f,p]);var q=(0,e.useMemo)(function(){return hs(p)},[p]),V=(0,e.useMemo)(function(){return"number"!==p?{}:{onWheel:function(e){e.target.blur()},onKeyDown:function(e){var t=e.key;"ArrowUp"!==t&&"ArrowDown"!==t&&"PageUp"!==t&&"PageDown"!==t||e.preventDefault(),("e"===t||"E"===t||"+"===t||"="===t&&e.shiftKey)&&e.preventDefault()}}},[p]),Q=(0,e.useMemo)(function(){if("number"===p)return{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}},[p]);if(!b)return null;var z=p,U=y,W=void 0===D?r:"".concat(r,"-").concat(D);return n().createElement("div",{className:"form-field ".concat(k||""),style:F.container},v&&n().createElement("div",{className:"field-header",style:B.header},v),n().createElement("div",{style:{position:"relative"}},n().createElement(VA,{inputRef:P,value:s,onChange:function(e){var t=ls(e.target.value,p,f);x&&x(t),Fs({name:r,validation:a,required:l,type:p,format:m,questionType:p},e.target.value),c&&c(wE(wE({},e),{},{target:{value:t,name:r,type:p}}))},onBlur:S,sx:Q,disabled:M,required:l,placeholder:u,type:z,inputMode:q,error:!!L,helperText:L||h,label:T?o:"",id:String(W),name:String(W),slotProps:{input:wE(wE({},w),{},{inputProps:wE({maxLength:U,minLength:g},V),inputMode:hs(p)}),inputLabel:{style:B.label,required:T&&l},formHelperText:{style:L?B.error:B.helperText}},"data-item-index":D,"data-parent-id":j,fullWidth:!0}),T&&O&&o&&n().createElement("div",{style:{position:"absolute",top:"8px",right:"8px"}},n().createElement(gE,{tooltip:O}))))};EE.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,defaultValue:o().string,validation:o().object,value:o().oneOfType([o().string,o().number]),required:o().bool,placeholder:o().string,onChange:o().func,type:o().oneOf(["text","email","tel","password","url","number"]),maskInput:o().oneOfType([o().string,o().object,o().func]),format:o().string,helperText:o().string,_encrypted:o().any,_maskingType:o().any,_maskingLength:o().oneOfType([o().string,o().number]),_validationErrorMessages:o().any,_showCheckBox:o().any,_isEsignDoc:o().any,_isOpenInNewTab:o().any,_addAdditional:o().any,_addMedication:o().any,header:o().string,maxLength:o().number,minLength:o().number,visible:o().bool,inputProps:o().object,styleName:o().string,tooltip:o().string,customTheme:o().object,_props:o().object,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})}),onSearch:o().func,onBlur:o().func,showQuestionLabels:o().bool};const CE=EE;var xE=["name","addressGroup","label","required","disabled","className","apiConfig","inputProps"];function SE(){return SE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SE.apply(null,arguments)}function _E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=IE(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function OE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||IE(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IE(e,t){if(e){if("string"==typeof e)return TE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TE(e,t):void 0}}function TE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var PE=function(t){function r(r){var o,i=r.apiConfig,a=r.onAddressSelect,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,Bd),l=(null==i||null===(o=i.googlePlaces)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.debounceTime)||ud.debounceTime,u=Vd((0,e.useState)(null),2),c=u[0],d=u[1],p=Vd((0,e.useState)([]),2),f=p[0],m=p[1],h=Vd((0,e.useState)(!1),2),v=h[0],y=h[1],g=Vd((0,e.useState)(null),2),b=g[0],A=g[1],w=Vd((0,e.useState)(!1),2),k=w[0],E=w[1];(0,e.useEffect)(function(){function e(){return(e=qd(jd().m(function e(){var t,n,r,o;return jd().w(function(e){for(;;)switch(e.n){case 0:if(null==i||null===(t=i.googlePlaces)||void 0===t||!t.apiKey){e.n=4;break}return e.p=1,n=Td.getInstance(i.googlePlaces.apiKey,Ld(Ld({},ud),i.googlePlaces.options)),e.n=2,n.initialize();case 2:d(n),e.n=4;break;case 3:e.p=3,o=e.v,r=gd(o),A(r.message);case 4:return e.a(2)}},e,null,[[1,3]])}))).apply(this,arguments)}!function(){e.apply(this,arguments)}()},[i]);var C=(0,e.useCallback)(function(){var e=qd(jd().m(function e(t){var n,r,o;return jd().w(function(e){for(;;)switch(e.n){case 0:if(!c||!t){e.n=6;break}return e.p=1,y(!0),A(null),e.n=2,c.searchAddress(t);case 2:n=e.v,m(n),E(!0),e.n=4;break;case 3:e.p=3,o=e.v,r=gd(o),A(r.message),m([]),E(!1);case 4:return e.p=4,y(!1),e.f(4);case 5:e.n=7;break;case 6:m([]),E(!1);case 7:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[c]),x=(0,e.useRef)();(0,e.useEffect)(function(){var e,t,n,r;return x.current=(e=C,t=l,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];clearTimeout(n),n=setTimeout(function(){clearTimeout(n),e.apply(void 0,o)},t)},r.cancel=function(){clearTimeout(n)},r),function(){var e;null!==(e=x.current)&&void 0!==e&&e.cancel&&x.current.cancel()}},[C,l]);var S=(0,e.useCallback)(function(e){x.current(e)},[x]),_=(0,e.useCallback)(function(){var e=qd(jd().m(function e(t){var n,r,o,i,s,l;return jd().w(function(e){for(;;)switch(e.n){case 0:if(!c||!t){e.n=5;break}return e.p=1,y(!0),e.n=2,c.getPlaceDetails(t.place_id);case 2:n=e.v,r=J(n),o=[r.street_number,r.street].filter(Boolean).join(" ").trim(),i={address:o,city:r.city,state:r.state_short||r.state,zipcode:r.zipcode},null==a||a(n,i),m([]),E(!1),e.n=4;break;case 3:e.p=3,l=e.v,s=gd(l),A(s.message);case 4:return e.p=4,y(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[c,a]);return(0,e.useEffect)(function(){return function(){m([]),E(!1)}},[]),n().createElement("div",{className:"address-autocomplete-container",style:{position:"relative"}},n().createElement(t,Dd({},s,{onSearch:S,loading:v,error:b})),k&&f.length>0&&n().createElement("div",{className:"address-predictions-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,backgroundColor:"#fff",border:"1px solid #ddd",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",maxHeight:"200px",overflowY:"auto"}},f.map(function(e){return n().createElement("button",{key:e.place_id,type:"button",onClick:function(){return _(e)},style:{padding:"8px 12px",cursor:"pointer",borderBottom:"1px solid #eee",width:"100%",textAlign:"left",background:"transparent",border:"none"},"aria-label":"Select ".concat(e.description)},e.description)})))}return r.propTypes={apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,debounceTime:o().number})})}).isRequired,onAddressSelect:o().func},r}(CE),BE=function(t){var r=t.name,o=t.addressGroup,i=t.label,a=t.required,s=t.disabled,l=t.className,u=t.apiConfig,c=t.inputProps,d=void 0===c?{}:c,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,xE),f=cc(),m=f.batchUpdate,h=f.validateAddressFields,v=f.formSchema,y=f.state,g=function(e,t,n){null!=e&&e.addressGroup&&!1!==n[e.questionId]&&(t[e.addressGroup]=e.questionId)},b=function(e,t,n){var r;if("cardlist"===e.questionType&&null!==(r=e.customQuestionValueList)&&void 0!==r&&r.editQuestions&&!1!==n[e.questionId]){var o,i=_E(e.customQuestionValueList.editQuestions);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.addressGroup&&(t[a.addressGroup]=a.questionId)}}catch(e){i.e(e)}finally{i.f()}}},A=(0,e.useMemo)(function(){return v&&Array.isArray(v)?function(e,t){var n={};try{var r,o=_E(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(null!=i&&i.questions){var a,s=_E(i.questions);try{for(s.s();!(a=s.n()).done;){var l=a.value;g(l,n,t),b(l,n,t)}}catch(e){s.e(e)}finally{s.f()}}}}catch(e){o.e(e)}finally{o.f()}}catch(e){console.error("Error creating addressGroup mapping:",e)}return n}(v,y.visibility):{}},[v,y.visibility]),w=(0,e.useCallback)(function(e,t){if(e&&o){var n=function(e){return e?e.split("_address")[0]:""}(o),r=function(e){return{address:"".concat(e,"_address"),city:"".concat(e,"_city"),state:"".concat(e,"_state"),zipcode:"".concat(e,"_zipcode")}}(n),i=function(e,t,n){for(var r={},o=0,i=Object.entries(e);o<i.length;o++){var a=OE(i[o],2),s=a[0],l=a[1];n[s]&&t[l]&&(r[t[l]]=n[s])}return r}(r,A,t),a=function(e){return Boolean(e["data-parent-id"]&&void 0!==e["data-item-index"])}(d);!function(e,t,n,r){e?r(t,n["data-parent-id"],n["data-item-index"],!0):r(t,null,-1,!0)}(a,i,d,m),h(o)}},[o,m,h,A,d]);return n().createElement(PE,SE({},p,{name:r,label:i,required:a,disabled:s,className:l,apiConfig:u,onAddressSelect:w,addressGroup:o,inputProps:d}))};function DE(e){return DE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DE(e)}function jE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jE(Object(n),!0).forEach(function(t){ME(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ME(e,t,n){return(t=function(e){var t=function(e){if("object"!=DE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=DE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==DE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}BE.propTypes={name:o().string.isRequired,addressGroup:o().string.isRequired,label:o().string,required:o().bool,disabled:o().bool,className:o().string,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})})}).isRequired,inputProps:o().object};var NE=function(t){var r,o=t.name,i=t.label,a=t.value,s=t.validation,l=void 0===s?{}:s,u=t.className,c=void 0===u?"":u,d=t.renderInput,p=t.renderLabel,f=t.formState,m=t.skipValidation,h=void 0!==m&&m,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,A=t.apiConfig,w=cc(),k=xc(),E=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return LE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LE(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(null),2),C=E[0],x=E[1],S=f||(null==w?void 0:w.state)||w,_=String(o);if((0,e.useEffect)(function(){if(S){var e=S.serverValidationErrors,t=void 0===e?{}:e,n=S.errors,r=void 0===n?{}:n,o=t[_]||r[_];x(o)}else console.warn("BaseField: formState is undefined. Make sure the component is wrapped in a FormProvider or receives formState as a prop.")},[S,_]),S){var O=S.disabled,I=void 0===O?{}:O,T=S.required,P=void 0===T?{}:T,B=S.editable,D=void 0===B?{}:B,j=S.onChange,R=I[_]||!1,M=P[_]||!1,L=!1!==D[_],N=RE(RE({},k),b);return r=d({name:_,value:a,onChange:function(e){var t,n=(t=e,h?null:l.required&&(!t||Array.isArray(t)&&0===t.length)?l.requiredMessage||"This field is required":l.custom?l.custom(t,h):null);x(n),j&&!R&&L&&j(_,e)},disabled:R,required:M,_editable:L,_error:C,_theme:N,_apiConfig:A}),n().createElement("div",{className:"form-field ".concat(c," ").concat(y||""),style:N.field},v&&n().createElement("div",{className:"field-header",style:N.header},v),null==p?void 0:p({label:i,isRequired:M,theme:N}),r)}return null};NE.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().any,validation:o().object,className:o().string,renderInput:o().func.isRequired,renderLabel:o().func,formState:o().object,skipValidation:o().bool,header:o().node,styleName:o().string,customTheme:o().object,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})})};const FE=NE;var qE=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/ButtonField.css"),VE={};function QE(e){return QE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QE(e)}function zE(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return UE(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(UE(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,UE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,UE(d,"constructor",u),UE(u,"constructor",l),l.displayName="GeneratorFunction",UE(u,o,"GeneratorFunction"),UE(d),UE(d,o,"Generator"),UE(d,r,function(){return this}),UE(d,"toString",function(){return"[object Generator]"}),(zE=function(){return{w:i,m:p}})()}function UE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}UE=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){UE(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},UE(e,t,n,r)}function WE(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function HE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HE(Object(n),!0).forEach(function(t){GE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GE(e,t,n){return(t=function(e){var t=function(e){if("object"!=QE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=QE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==QE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}VE.styleTagTransform=nl(),VE.setAttributes=Js(),VE.insert=Ks().bind(null,"head"),VE.domAPI=Gs(),VE.insertStyleElement=el(),Hs()(qE.A,VE),qE.A&&qE.A.locals&&qE.A.locals;var YE=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.onChange,c=t.onClick,d=t.customTheme,p=void 0===d?{}:d,f=t.variant,m=void 0===f?"primary":f,h=t.size,v=void 0===h?"medium":h,y=t.icon,g=t.fullWidth,b=void 0!==g&&g,A=t.styleName,w=cc().setValue,k=xc(),E=(0,e.useMemo)(function(){var e=k.buttonField||{};return ZA(e,p)},[k,p]),C=(0,e.useMemo)(function(){var e=$E($E({},E.container),b&&{width:"100%"}),t=tw(E.button,E[m],E[v],b&&E.fullWidth,s&&E.disabled);return{container:ew(e,E.responsive),button:t,icon:E.icon}},[E,m,v,b,s]),x=o,S=function(){var e,t=(e=zE().m(function e(t){return zE().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),w(r,x),!c){e.n=1;break}return e.n=1,c(t);case 1:null==u||u({target:{name:r,value:x}});case 2:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){WE(i,r,o,a,s,"next",e)}function s(e){WE(i,r,o,a,s,"throw",e)}a(void 0)})});return function(e){return t.apply(this,arguments)}}();return n().createElement(NE,{name:r,label:"",value:i,validation:a,className:"button-field ".concat(A||""," ").concat(l||""),customTheme:E,renderInput:function(){return n().createElement("button",{type:"button",onClick:S,disabled:s,style:C.button},y&&n().createElement("span",{style:C.icon},y),x)}})};function KE(e){return KE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KE(e)}function XE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZE(e,t,n){return(t=function(e){var t=function(e){if("object"!=KE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=KE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==KE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}YE.propTypes={name:o().string.isRequired,label:o().string,value:o().string,validation:o().object,disabled:o().bool,className:o().string,onChange:o().func,onClick:o().func,customTheme:o().object,variant:o().oneOf(["primary","secondary","success","danger","warning","outline","text"]),size:o().oneOf(["small","medium","large"]),icon:o().node,fullWidth:o().bool,styleName:o().string};var eC=function(e){return e.map(function(e){return e?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JE(Object(n),!0).forEach(function(t){ZE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){var t;return{property:e.property,value:e.value,editQuestionId:e.editQuestionId,renderMode:null!==(t=e.renderMode)&&void 0!==t?t:null}}):[]},void 0!==e.__isPending__&&{__isPending__:e.__isPending__}):null})},tC=function(e){return!!(Array.isArray(e)&&e.length>0)&&e.every(function(e){return!e||!Array.isArray(e.properties)||0===e.properties.length})},nC=function(e){return(Array.isArray(e.customQuestionValuesList)?e.customQuestionValuesList:[e.customQuestionValuesList]).map(function(t){return function(e,t){return null!=e&&e.properties?{name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){var t;return{property:e.property,value:e.value,editQuestionId:e.editQuestionId,renderMode:null!==(t=e.renderMode)&&void 0!==t?t:null}}):[]}:{name:"".concat(null==e?void 0:e.name," - 1"),properties:Object.entries(e||{}).map(function(e){var n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return XE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XE(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),o=r[0],i=r[1];return{property:o,value:i,editQuestionId:null===(n=t.editQuestions)||void 0===n||null===(n=n.find(function(e){return e.name===o}))||void 0===n?void 0:n.questionId,renderMode:null}})}}(t,e)})},rC=function(e,t){var n;return{name:"".concat(e," - 1"),properties:(null==t||null===(n=t.editQuestions)||void 0===n?void 0:n.map(function(e){return{property:e.name,value:e.value||"",editQuestionId:e.questionId,renderMode:null}}))||[]}};function oC(e){return oC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oC(e)}var iC=["name","label","questionId","customQuestionValueList","onChange","validation","max","min","className","disabled","readOnly","questionRuleDetails","apiConfig","customTheme","visible","isCardlistModal"];function aC(e){return function(e){if(Array.isArray(e))return fC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pC(e)||function(){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 sC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sC(Object(n),!0).forEach(function(t){uC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uC(e,t,n){return(t=function(e){var t=function(e){if("object"!=oC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cC(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=pC(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function dC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||pC(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pC(e,t){if(e){if("string"==typeof e)return fC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fC(e,t):void 0}}function fC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var mC=a("./node_modules/css-loader/dist/cjs.js!./src/components/common/Modal.css"),hC={};hC.styleTagTransform=nl(),hC.setAttributes=Js(),hC.insert=Ks().bind(null,"head"),hC.domAPI=Gs(),hC.insertStyleElement=el(),Hs()(mC.A,hC),mC.A&&mC.A.locals&&mC.A.locals;var vC=function(t){var r=t.isOpen,o=t.onClose,i=t.title,a=t.children,s=t.size,l=void 0===s?"medium":s,u=t.showCloseButton,c=void 0===u||u,d=t.closeOnOverlayClick,p=void 0===d||d,f=t.className,m=void 0===f?"":f,h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onKeyDown,r=(t._onFocus,t._onBlur,t.focusFirst),o=void 0!==r&&r,i=t.trapFocus,a=void 0!==i&&i,s=t.autoFocus,l=void 0!==s&&s,u=t.disabled,c=void 0!==u&&u,d=t.returnFocus,p=void 0===d||d,f=(0,e.useRef)(null),m=(0,e.useRef)(null),h=(0,e.useCallback)(function(){return f.current?Array.from(f.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(function(e){return!e.hasAttribute("disabled")&&null!==e.offsetParent}):[]},[]),v=(0,e.useCallback)(function(e){if(null==n||n(e),a&&f.current){var t=h();if(0!==t.length){var r=t[0],o=t.at(-1);"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(o.focus(),e.preventDefault()):document.activeElement===o&&(r.focus(),e.preventDefault()))}}},[a,n,h]);return(0,e.useEffect)(function(){if(!c){if(m.current=document.activeElement,l||o){var e=h();e.length>0&&e[0].focus()}return function(){p&&m.current&&m.current.focus()}}},[l,o,c,p,h]),(0,e.useEffect)(function(){var e=f.current;if(e)return e.addEventListener("keydown",v),function(){e.removeEventListener("keydown",v)}},[v]),{containerRef:f,getFocusableElements:h,focusFirst:function(){var e=h();e.length>0&&e[0].focus()},focusLast:function(){var e=h();e.length>0&&e.at(-1).focus()},focusNext:function(){var e=h(),t=e.indexOf(document.activeElement);t>-1&&t<e.length-1&&e[t+1].focus()},focusPrevious:function(){var e=h(),t=e.indexOf(document.activeElement);t>0&&e[t-1].focus()}}}({trapFocus:!0,focusFirst:!0,returnFocus:!0,onKeyDown:function(e){"Escape"===e.key&&o()}}),v=h.containerRef,y=h.getFocusableElements,g=h.focusFirst;if((0,e.useEffect)(function(){return r?(document.body.style.overflow="hidden",y().length>0&&document.activeElement===document.body&&setTimeout(function(){g()},100)):document.body.style.overflow="",function(){document.body.style.overflow=""}},[r]),!r)return null;var b="modal-".concat(l);return n().createElement("div",{className:"modal-overlay",onClick:function(e){p&&e.target===e.currentTarget&&o()},onKeyDown:function(e){!p||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o())},role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",tabIndex:-1},n().createElement("div",{ref:v,className:"modal-container ".concat(b," ").concat(m),onClick:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()},role:"document"},n().createElement("div",{className:"modal-header"},i&&n().createElement("h2",{id:"modal-title",className:"modal-title"},i),c&&n().createElement("button",{type:"button",className:"modal-close-button",onClick:o,"aria-label":"Close modal"},"×")),n().createElement("div",{className:"modal-content"},a)))};vC.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,title:o().string,children:o().node.isRequired,size:o().oneOf(["small","medium","large","fullscreen"]),showCloseButton:o().bool,closeOnOverlayClick:o().bool,className:o().string};const yC=vC;function gC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bC(e){return bC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bC(e)}function AC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AC(Object(n),!0).forEach(function(t){kC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kC(e,t,n){return(t=function(e){var t=function(e){if("object"!=bC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EC(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=CC(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function CC(e,t){if(e){if("string"==typeof e)return xC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xC(e,t):void 0}}function xC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var SC=function(t){var r,o=t.isOpen,i=t.onClose,a=t.onSave,s=t.cardItem,l=t.itemIndex,u=t.cardListId,c=t.cardListName,d=t.customQuestionValueList,p=t.questionRuleDetails,f=t.apiConfig,m=t.disabled,h=void 0!==m&&m,v=t.readOnly,y=void 0!==v&&v,g=cc(),b=g.state,A=g.setValue,w=g.setNestedState,k=g.rulesEngine,E=g.updateCardList,C=(0,e.useRef)(null),x=(0,e.useRef)(!1),S=(0,e.useRef)(!1),_=(0,e.useRef)(null),O=(0,e.useRef)(null),I=(0,e.useRef)(!1),T=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||CC(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(new Map),2),P=T[0],B=T[1],D=(0,e.useCallback)(function(){if(k&&null!=d&&d.editQuestions&&!(l<0)){var e={cardListId:u,instanceIndex:l};B(function(t){var n,r,o=new Map(t),i=!1,a=null===(n=b.values)||void 0===n?void 0:n[u],s=Array.isArray(a)&&a[l]?a[l]:null,c=EC(d.editQuestions);try{var p=function(){var n,a=r.value,c=a.questionId||a.name,d=ee(c),p=null==s||null===(n=s.properties)||void 0===n?void 0:n.find(function(e){return ee(e.editQuestionId)===ee(c)}),f=null==p?void 0:p.value,m=null!=f,h=k.getCardListInstanceState(u,l,d),v=k.getQuestionValueWithCardListContext(c,e),y="",g=void 0!==(null==h?void 0:h.value)&&null!==(null==h?void 0:h.value),b=null!=v;y=m?g&&""!==h.value&&h.value!==f?h.value:f:g?h.value:b?v:t.has(c)?t.get(c):a.value||a.defaultValue||"",h&&""===h.value&&t.has(c)&&""!==t.get(c)&&(y=""),t.get(c)!==y&&(o.set(c,y),i=!0)};for(c.s();!(r=c.n()).done;)p()}catch(e){c.e(e)}finally{c.f()}return i?o:t})}},[k,u,l,d,b.values]);(0,e.useEffect)(function(){if(o){var e=_.current!==l;if(!S.current||e){var t;S.current=!0,_.current=l,C.current=s?JSON.stringify(s):null,x.current=!1;var n=new Map;if(null!=d&&d.editQuestions){var r,i={cardListId:u,instanceIndex:l},a=EC(d.editQuestions);try{var p=function(){var e=r.value,t=e.questionId||e.name,o="",a=!1;if(null!=s&&s.properties){var c=s.properties.find(function(e){return ee(e.editQuestionId)===ee(t)});void 0!==(null==c?void 0:c.value)&&null!==(null==c?void 0:c.value)&&(o=c.value,a=!0)}if(!a&&k){var p=k.getQuestionValueWithCardListContext(t,i);null!=p&&""!==p&&(o=p)}if(a||""!==o&&null!=o||(o=e.value||e.defaultValue||""),n.set(t,o),k&&l>=0){var f=ee(t),m=k.getCardListInstanceState(u,l,f);!m&&d.editQuestions&&(k.initializeCardListChildStates(u,l,d.editQuestions),m=k.getCardListInstanceState(u,l,f)),m&&(a||void 0===m.value||null===m.value||""===m.value?(m.value=o,k.setCardListInstanceState(u,l,f,m)):n.set(t,m.value))}};for(a.s();!(r=a.n()).done;)p()}catch(e){a.e(e)}finally{a.f()}}if(B(n),k&&l>=0){var f,m=(null==d?void 0:d.editQuestions)||[],h="".concat(u,"_").concat(l),v=null===(f=k.cardListInstanceStates)||void 0===f?void 0:f.has(h);if(!v&&m.length>0)k.executeRulesForNewCardListInstance(u,l,m),setTimeout(function(){D()},0);else if(v&&m.length>0)if(k.reExecutePageLoadRulesForInstance)k.reExecutePageLoadRulesForInstance(u,l,m),setTimeout(function(){D()},0);else{var y,g,A={cardListId:u,instanceIndex:l},O=new Set(m.map(function(e){return e.questionId||e.name})),T=(null===(y=k.questionRuleDetails)||void 0===y?void 0:y.filter(function(e){return("PAGE_LOAD"===e.ruleExecutionType||"REFLEXIVE_LOAD"===e.ruleExecutionType)&&(O.has(e.triggerQuestionId)||O.has(e.targetQuestionId))}))||[],P=EC(T);try{for(P.s();!(g=P.n()).done;){var j=g.value;try{var R,M,L,N="".concat(j.conditionId,"_").concat(j.triggerQuestionId,"_").concat(u,"_").concat(l);null!==(R=k.evaluationQueue)&&void 0!==R&&R.has(N)||(null===(M=k.evaluationQueue)||void 0===M||M.add(N),k.evaluateRule(j,j.triggerQuestionId,A,!1),null===(L=k.evaluationQueue)||void 0===L||L.delete(N))}catch(e){console.warn("Error re-evaluating rule for CardList instance:",e)}}}catch(e){P.e(e)}finally{P.f()}setTimeout(function(){D()},0)}}var F="".concat(u,"_").concat(l),q=null===(t=b.nestedStates)||void 0===t?void 0:t[F];if(w(u,l,q?{errors:{}}:{visibility:{},disabled:{},required:{},errors:{},ruleValidationErrors:{}}),!s&&null!=d&&d.editQuestions&&l>=0){var V,Q=(null===(V=b.values)||void 0===V?void 0:V[u])||[];if(!Array.isArray(Q)||Q.length<=l){I.current=!0;for(var z=function(e,t,n){return Array.isArray(n)?{name:"".concat(e," - ").concat(t+1),properties:n.map(function(e){return{property:e.name||e.label,value:e.value||e.defaultValue||"",editQuestionId:ee(e.questionId||e.name),renderMode:null}}),__isPending__:!0}:{name:"".concat(e," - ").concat(t+1),properties:[],__isPending__:!0}}(c,l,d.editQuestions),U=function(e){return function(e){if(Array.isArray(e))return xC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||CC(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Q);U.length<=l;)U.push({name:"",properties:[]});U[l]=z,E(u,U,"add","",l)}else I.current=!1,B(function(e){var t,n=new Map(e),r=EC(d.editQuestions);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=o.questionId||o.name;if(!n.has(i)){var a=o.value||o.defaultValue||"";if(n.set(i,a),k&&l>=0){var s=ee(i),c=k.getCardListInstanceState(u,l,s);c||(k.initializeCardListChildStates(u,l,d.editQuestions),c=k.getCardListInstanceState(u,l,s)),c&&(c.value=a,k.setCardListInstanceState(u,l,s,c))}}}}catch(e){r.e(e)}finally{r.f()}return n})}else I.current=!1}}else o||(S.current=!1,_.current=null,I.current=!1,B(new Map),x.current=!1)},[o,l,u,D]),(0,e.useEffect)(function(){if(!o||!k||l<0||null==d||!d.editQuestions||!S.current)return function(){};var e=setTimeout(function(){S.current&&D()},100);return function(){clearTimeout(e)}},[o,k,l,u,d,D,b.values]);var j=(0,e.useCallback)(function(e,t){x.current=!0,B(function(n){var r=new Map(n);return r.set(e,t),r});var n={cardListId:u,instanceIndex:l};if(k){var r=ee(e),o=k.getCardListInstanceState(u,l,r);if(!o&&null!=d&&d.editQuestions&&(k.initializeCardListChildStates(u,l,d.editQuestions),o=k.getCardListInstanceState(u,l,r)),o){o.value=t,k.setCardListInstanceState(u,l,r,o),k.processFieldChange(e,t,n,!0,!1,null);var i=k.getAllFieldStates().nestedStates,a="".concat(u,"_").concat(l),s=null==i?void 0:i[a];w(u,l,s?{visibility:s.visibility||{},disabled:s.disabled||{},required:s.required||{},ruleValidationErrors:s.ruleValidationErrors||{},errors:kC({},e,null)}:{errors:kC({},e,null)}),setTimeout(function(){D()},0)}}else w(u,l,{errors:kC({},e,null)})},[u,l,w,k,d,D]),R=n().useMemo(function(){return null!=d&&d.editQuestions?[{groupName:"",questions:d.editQuestions.map(function(e){var t=e.questionId||e.name,n=P.has(t)?P.get(t):void 0;return wC(wC({},e),{},{parentId:u,questionId:t,questionType:e.questionType||"text",value:n,onChange:function(e){var n="object"===bC(e)&&null!=e&&e.target?e.target.value:e;j(t,n)},validation:wC(wC({},e.validation),{},{required:e.required}),inputProps:{"data-item-index":l,"data-parent-id":u}})})}]:[]},[u,l,d,P,j]),M=(0,e.useCallback)(function(e){var t,n,r={cardListId:u,instanceIndex:l};if(P.has(e)){var o=P.get(e);return null!=o?o:""}if(k){var i=k.getCardListInstanceState(u,l,ee(e));if(void 0!==(null==i?void 0:i.value)&&null!==(null==i?void 0:i.value)){var a=i.value;return P.has(e)&&P.get(e)===a||B(function(t){var n=new Map(t);return n.set(e,a),n}),a}var s=k.getQuestionValueWithCardListContext(e,r);if(null!=s&&""!==s)return P.has(e)&&P.get(e)===s||B(function(t){var n=new Map(t);return n.set(e,s),n}),s}var c=null===(t=b.values)||void 0===t?void 0:t[u];if(Array.isArray(c)&&c[l]){var d=c[l];if(Array.isArray(null==d?void 0:d.properties)){var p=d.properties.find(function(t){return ee(t.editQuestionId)===ee(e)});if(void 0!==(null==p?void 0:p.value)&&null!==(null==p?void 0:p.value))return p.value}}var f=null===(n=b.values)||void 0===n?void 0:n[e];return null!=f?f:""},[P,k,b.values,u,l]),L=(0,e.useCallback)(function(){var e={},t=R;if(t.length>0&&t[0].questions){var n,r=EC(t[0].questions);try{for(r.s();!(n=r.n()).done;){var o,i,a,s,c=n.value,d=c.questionId,p=ee(d),f="".concat(u,"_").concat(l),m=null===(o=b.nestedStates)||void 0===o?void 0:o[f],h=void 0!==(null==m||null===(i=m.visibility)||void 0===i?void 0:i[d])?m.visibility[d]:!1!==c.visible;if(h){var v=c.required||!1;if(void 0!==(null==m||null===(a=m.required)||void 0===a?void 0:a[d]))v=m.required[d];else if(k){var y=k.getFieldState(p,l);void 0!==(null==y?void 0:y.required)&&(v=y.required)}var g=M(d);if(v&&(!g||"string"==typeof g&&""===g.trim())&&(e[d]="".concat(c.label||c.name," is required")),null!=g&&""!==g){var A,w,E,C,x=wC(wC({},c),{},{visible:h,required:v,disabled:null!==(A=null!==(w=null==m||null===(E=m.disabled)||void 0===E?void 0:E[d])&&void 0!==w?w:c.disabled)&&void 0!==A&&A}),S=wC({},b.values),_=null!==(C=b.serverValidationErrors)&&void 0!==C&&C[d]?[{questionId:d,message:b.serverValidationErrors[d]}]:[],O=Fs(x,g,S,_,b.nestedStates);O&&"string"==typeof O&&""!==O.trim()&&(e[d]||(e[d]=O))}var I=null==m||null===(s=m.ruleValidationErrors)||void 0===s?void 0:s[d];I&&"string"==typeof I&&""!==I.trim()&&(e[d]||(e[d]=I))}}}catch(e){r.e(e)}finally{r.f()}}return e},[R,u,l,b.nestedStates,k,M]),N=(0,e.useCallback)(function(){var e;if(k&&null!=d&&d.editQuestions){var t={cardListId:u,instanceIndex:l};B(function(e){var n,r=new Map(e),o=!1,i=EC(d.editQuestions);try{for(i.s();!(n=i.n()).done;){var a=n.value,s=a.questionId||a.name,c=ee(s),p=k.getCardListInstanceState(u,l,c),f=k.getQuestionValueWithCardListContext(s,t),m="";void 0!==(null==p?void 0:p.value)&&null!==(null==p?void 0:p.value)&&""!==(null==p?void 0:p.value)?m=p.value:null!=f&&""!==f?m=f:e.has(s)&&(m=e.get(s)),e.get(s)!==m&&(r.set(s,m),o=!0)}}catch(e){i.e(e)}finally{i.f()}return o?r:e})}var n=L();w(u,l,{errors:n});var r="".concat(u,"_").concat(l),o=null===(e=b.nestedStates)||void 0===e?void 0:e[r],s=(null==o?void 0:o.ruleValidationErrors)||{},p=Object.values(s).some(function(e){return e&&"string"==typeof e&&""!==e.trim()});if(!p&&k&&null!=d&&d.editQuestions){var f,m=EC(d.editQuestions);try{for(m.s();!(f=m.n()).done;){var h,v=f.value,y=v.questionId||v.name,g=ee(y),E=null===(h=k.validationMessages)||void 0===h?void 0:h.get(g);if(E&&"string"==typeof E&&""!==E.trim()){p=!0;break}}}catch(e){m.e(e)}finally{m.f()}}var C=[".error_message_display_text",".error-message"],S=O.current,_=S?Je(C,S):Je(C);if(Object.keys(n).length>0||p||_)id(C,S?{root:S}:{});else{var T={cardListId:u,instanceIndex:l};P.forEach(function(e,t){A(t,e,null,T)});var D=function(e,t,n,r){var o={name:"".concat(e," - ").concat(t+1),properties:[]};if(!Array.isArray(r))return o;var i,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return gC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gC(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(r);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=s.questionId||s.name,u=n instanceof Map?n.get(l):n[l];null==u&&(u=""),o.properties.push({property:s.name||s.label,value:u,editQuestionId:ee(l),renderMode:null})}}catch(e){a.e(e)}finally{a.f()}return o}(c,l,P,null==d?void 0:d.editQuestions);a&&a(D,l),I.current=!1,B(new Map),x.current=!1,i()}},[L,w,b.nestedStates,u,l,c,d,a,i,k,P,A]),F=(0,e.useCallback)(function(){if(I.current&&l>=0){var e,t=(null===(e=b.values)||void 0===e?void 0:e[u])||[];if(Array.isArray(t)&&t.length>l){var n=t.filter(function(e,t){return t!==l});E(u,n,"remove","",l)}k&&k.removeCardListInstance(u,l),I.current=!1}else{if(x.current&&C.current)try{var r=JSON.parse(C.current);if(null!=r&&r.properties){var o,a={cardListId:u,instanceIndex:l},s=EC(r.properties);try{for(s.s();!(o=s.n()).done;){var c=o.value;c.editQuestionId&&A(c.editQuestionId,c.value,null,a)}}catch(e){s.e(e)}finally{s.f()}}}catch(e){console.warn("Error restoring initial values:",e)}if(k&&l>=0&&C.current)try{var p=JSON.parse(C.current);if(null!=p&&p.properties&&null!=d&&d.editQuestions){var f,m=EC(d.editQuestions);try{var h=function(){var e=f.value,t=e.questionId||e.name,n=ee(t),r="",o=p.properties.find(function(e){return ee(e.editQuestionId)===ee(t)});void 0!==(null==o?void 0:o.value)&&null!==(null==o?void 0:o.value)&&(r=o.value);var i=k.getCardListInstanceState(u,l,n);i&&(i.value=r,k.setCardListInstanceState(u,l,n,i))};for(m.s();!(f=m.n()).done;)h()}catch(e){m.e(e)}finally{m.f()}}}catch(e){console.warn("Error restoring initial values in rules engine:",e)}}B(new Map),w(u,l,{errors:{}}),x.current=!1,i()},[u,l,A,w,i,k,d,b.values,E]),q=n().useMemo(function(){return{isCardList:!0,itemIndex:l,parentId:u,parentValue:s}},[l,u,s]),V=l>=0?l+1:((null===(r=b.values)||void 0===r||null===(r=r[u])||void 0===r?void 0:r.length)||0)+1,Q=s?"".concat(c," - ").concat(V):"Add ".concat(c);return{modalContentRef:O,cardSchema:R,handleSave:N,handleCancel:F,parentContext:q,displayIndex:V,modalTitle:Q,disabled:h,readOnly:y,questionRuleDetails:p,apiConfig:f}},_C=function(e){var t=e.onCancel,r=e.onSave,o=e.disabled,i=e.readOnly,a=o||i;return n().createElement("div",{className:"cardlist-modal-actions"},n().createElement("button",{type:"button",className:"btn btn-secondary",onClick:t,disabled:a,"aria-label":"Cancel"},"Cancel"),n().createElement("button",{type:"button",className:"btn btn-primary",onClick:r,disabled:a,"aria-label":"Save"},"Save"))};_C.propTypes={onCancel:o().func.isRequired,onSave:o().func.isRequired,disabled:o().bool,readOnly:o().bool};const OC=_C;var IC=function(e){var t=e.isOpen,r=e.onClose,o=e.onSave,i=e.cardItem,a=e.itemIndex,s=e.cardListId,l=e.cardListName,u=e.customQuestionValueList,c=e.questionRuleDetails,d=e.apiConfig,p=e.disabled,f=void 0!==p&&p,m=e.readOnly,h=SC({isOpen:t,onClose:r,onSave:o,cardItem:i,itemIndex:a,cardListId:s,cardListName:l,customQuestionValueList:u,questionRuleDetails:c,apiConfig:d,disabled:f,readOnly:void 0!==m&&m}),v=h.modalContentRef,y=h.cardSchema,g=h.handleSave,b=h.handleCancel,A=h.parentContext,w=h.modalTitle,k=h.disabled,E=h.readOnly,C=h.questionRuleDetails,x=h.apiConfig;return t?n().createElement(yC,{isOpen:t,onClose:b,title:w,size:"large",className:"cardlist-modal",closeOnOverlayClick:!1},n().createElement("div",{className:"cardlist-modal-wrapper"},n().createElement("div",{ref:v,className:"cardlist-modal-content"},n().createElement(BM,{questionGroups:y,disabled:k,readOnly:E,isNested:!0,questionRuleDetails:C,parentContext:A,apiConfig:x,skipFormProvider:!0})),n().createElement(OC,{onCancel:b,onSave:g,disabled:k,readOnly:E}))):null};IC.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,onSave:o().func.isRequired,cardItem:o().object,itemIndex:o().number.isRequired,cardListId:o().oneOfType([o().string,o().number]).isRequired,cardListName:o().string.isRequired,customQuestionValueList:o().object,questionRuleDetails:o().array,apiConfig:o().object,disabled:o().bool,readOnly:o().bool};const TC=IC;var PC=function(e){var t=e.isOpen,r=e.onClose,o=e.onConfirm;return n().createElement(yC,{isOpen:t,onClose:r,title:"Confirm Delete",size:"small",closeOnOverlayClick:!0,className:"cardlist-delete-confirm-modal"},n().createElement("div",{className:"cardlist-delete-confirm-content"},n().createElement("p",{className:"cardlist-delete-confirm-message"},"Are you sure you want to delete this entry? This action cannot be undone."),n().createElement("div",{className:"cardlist-delete-confirm-actions"},n().createElement("button",{type:"button",onClick:r,className:"cardlist-delete-confirm-btn cardlist-delete-confirm-btn-cancel","aria-label":"Cancel"},"Cancel"),n().createElement("button",{type:"button",onClick:o,className:"cardlist-delete-confirm-btn cardlist-delete-confirm-btn-delete","aria-label":"Delete"},"Delete"))))};PC.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,onConfirm:o().func.isRequired};const BC=PC;var DC=function(e){var t=e.items,r=e.questionId,o=e.name,i=e.onEdit,a=e.onDeleteClick,s=e.onAddMore,l=e.disabled,u=e.readOnly,c=e.maxItems,d=!l&&!u&&(!c||t.length<c),p=!l&&!u;return 0===t.length?n().createElement("div",{className:"cardlist-empty-state"},n().createElement("p",null,"No items added yet."),d&&n().createElement("button",{type:"button",className:"cardlist-add-button",onClick:s,disabled:l||u,"aria-label":"Add New"},"Add New")):n().createElement("div",{className:"cardlist-table-container"},n().createElement("table",{className:"cardlist-table"},n().createElement("thead",null,n().createElement("tr",null,n().createElement("th",null,"S.No."),n().createElement("th",null,"Details"),n().createElement("th",null,"Actions"))),n().createElement("tbody",null,t.map(function(e,t){return n().createElement("tr",{key:"".concat(r,"_").concat(t)},n().createElement("td",null,t+1),n().createElement("td",null,(null==e?void 0:e.name)||"".concat(o," - ").concat(t+1)),n().createElement("td",null,n().createElement("div",{className:"cardlist-table-actions"},p&&n().createElement(n().Fragment,null,n().createElement("button",{type:"button",className:"btn-edit",onClick:function(){return i(e,t)},disabled:l||u,"aria-label":"Edit",title:"Edit"},n().createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n().createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),n().createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))),n().createElement("button",{type:"button",className:"btn-delete",onClick:function(){return a(t)},disabled:l||u,"aria-label":"Delete",title:"Delete"},n().createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n().createElement("polyline",{points:"3 6 5 6 21 6"}),n().createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),n().createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),n().createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"})))))))}))),d&&n().createElement("button",{type:"button",className:"cardlist-add-button",onClick:s,disabled:l||u,"aria-label":"Add New"},"Add New"))};DC.propTypes={items:o().array.isRequired,questionId:o().oneOfType([o().string,o().number]).isRequired,name:o().string,onEdit:o().func.isRequired,onDeleteClick:o().func.isRequired,onAddMore:o().func.isRequired,disabled:o().bool,readOnly:o().bool,maxItems:o().number};const jC=DC;var RC=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/CardListModal.css"),MC={};function LC(e){return LC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LC(e)}function NC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NC(Object(n),!0).forEach(function(t){qC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qC(e,t,n){return(t=function(e){var t=function(e){if("object"!=LC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=LC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}MC.styleTagTransform=nl(),MC.setAttributes=Js(),MC.insert=Ks().bind(null,"head"),MC.domAPI=Gs(),MC.insertStyleElement=el(),Hs()(RC.A,MC),RC.A&&RC.A.locals&&RC.A.locals;var VC=function(t){var r=t.name,o=t.label,i=void 0===o?"":o,a=t.questionId,s=t.customQuestionValueList,l=void 0===s?null:s,u=t.validation,c=void 0===u?{}:u,d=t.max,p=void 0===d?null:d,f=t.min,m=void 0===f?0:f,h=t.className,v=void 0===h?"":h,y=t.disabled,g=void 0!==y&&y,b=t.readOnly,A=void 0!==b&&b,w=t.isCardlistModal,k=void 0!==w&&w,E=function(t){var r,o,i,a,s=t.name,l=t.label,u=void 0===l?"":l,c=t.questionId,d=t.customQuestionValueList,p=void 0===d?null:d,f=t.onChange,m=void 0===f?null:f,h=(t.validation,t.max),v=void 0===h?null:h,y=t.min,g=void 0===y?0:y,b=(t.className,t.disabled),A=void 0!==b&&b,w=t.readOnly,k=void 0!==w&&w,E=t.questionRuleDetails,C=void 0===E?[]:E,x=t.apiConfig,S=void 0===x?{}:x,_=t.customTheme,O=void 0===_?{}:_,I=t.visible,T=void 0===I||I,P=(t.isCardlistModal,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,iC)),B=cc(),D=B.state,j=B.updateCardList,R=xc(),M=dC((0,e.useState)([]),2),L=M[0],N=M[1],F=dC((0,e.useState)({}),2),q=F[0],V=F[1],Q=dC((0,e.useState)(!0),2),z=Q[0],U=Q[1],W=(0,e.useRef)(!1),H=(0,e.useRef)(!1),$=(0,e.useRef)(new Map),G=dC((0,e.useState)(!1),2),Y=G[0],K=G[1],X=dC((0,e.useState)(null),2),J=X[0],Z=X[1],te=dC((0,e.useState)(-1),2),ne=te[0],re=te[1],oe=dC((0,e.useState)(!1),2),ie=(oe[0],oe[1]),ae=dC((0,e.useState)(!1),2),se=ae[0],le=ae[1],ue=dC((0,e.useState)(-1),2),ce=ue[0],de=ue[1],pe=ZA(R.cardListField||{},O),fe=(null==D||null===(r=D.required)||void 0===r?void 0:r[c])||!1,me=(0,e.useCallback)(function(e){if(!Array.isArray(e))return!1;try{var t=e.filter(function(e){return!(null!=e&&e.__isPending__)}),n=eC(t);N(n),W.current=!0;var r=e.length>0,o=tC(e),i=e.length,a=function(e,t,n){var r=new Set(Object.keys(n||{}).filter(function(t){return String(t||"").startsWith("".concat(e,"_"))}));return Array.from({length:t},function(t,n){return"".concat(e,"_").concat(n)}).filter(function(e){return!r.has(e)})}(c,i,null==D?void 0:D.nestedStates);return r?(o||a.length>0)&&(H.current=!0,j(c,e,"init",null,-1,!0)):H.current=!0,!0}catch(e){return console.error("CardListField: failed to seed from context",e),!1}},[c,null==D?void 0:D.nestedStates,j]);(0,e.useEffect)(function(){var e;if(!W.current){var t=null==D||null===(e=D.values)||void 0===e?void 0:e[c];me(t)||function(e){if(void 0===e&&null!=p&&p.customQuestionValuesList){var t=nC(p),n=JSON.stringify(L);JSON.stringify(t)!==n&&(j(c,t,"init",null,-1,!0),N(t),W.current=!0)}}(t)}},[c,null==D||null===(o=D.values)||void 0===o?void 0:o[c],null==p?void 0:p.customQuestionValuesList]);var he=(0,e.useCallback)(function(e,t){var n=$.current.get(e);return $.current.set(e,t),{isHiddenToVisible:!1===n&&!0===t,isFirstMountVisible:void 0===n&&!0===t}},[]),ve=(0,e.useCallback)(function(e){var t,n=null==D||null===(t=D.values)||void 0===t?void 0:t[c],r=Array.isArray(n),o=r&&n.length>0,i=tC(n);if(r&&o)(i||o)&&(H.current=!0,j(c,n,"init",null,-1,!0));else{var a=[rC(s,p)];e&&(N(a),H.current=!0,j(c,a,"add","",0))}},[s,p,c,null==D?void 0:D.values,j]);(0,e.useEffect)(function(){var e,t=void 0===(null==D||null===(e=D.visibility)||void 0===e?void 0:e[c])?T:D.visibility[c],n=he(c,t),r=n.isHiddenToVisible,o=n.isFirstMountVisible;if(r||o)try{ve(r)}catch(e){console.error("CardListField: failed to reinitialize nested states",e)}},[null==D||null===(i=D.visibility)||void 0===i?void 0:i[c]]),(0,e.useEffect)(function(){if(H.current){var e,t=null==D||null===(e=D.values)||void 0===e?void 0:e[c];if(Array.isArray(t))try{var n=t.filter(function(e){return!(null!=e&&e.__isPending__)}),r=eC(n);N(function(e){return JSON.stringify(e)!==JSON.stringify(r)?r:e})}finally{H.current=!1}else H.current=!1}},[null==D||null===(a=D.values)||void 0===a?void 0:a[c]]);var ye=(0,e.useCallback)(function(e,t){V(function(n){var r=lC({},n);return t&&Object.keys(t).length>0?r[e]=t:delete r[e],r})},[]),ge=(0,e.useCallback)(function(){var e;if(!(v&&L.length>=v)){var t={name:"".concat(s," - ").concat(L.length+1),properties:(null==p||null===(e=p.editQuestions)||void 0===e?void 0:e.map(function(e){return{property:e.name,value:e.value||"",editQuestionId:e.questionId,renderMode:null}}))||[]},n=[].concat(aC(L),[t]);N(n),j(c,n,"add","",L.length)}},[v,L,null==p?void 0:p.editQuestions,c,s,j]),be=(0,e.useCallback)(function(e){var t=L.filter(function(t,n){return n!==e});V(function(t){var n=lC({},t);return delete n[e],n}),N(t),j(c,t,"remove","",e),null==m||m(null,!0)},[L,c,j,m]),Ae=(0,e.useCallback)(function(e){de(e),le(!0)},[]),we=(0,e.useCallback)(function(){ce>=0&&(be(ce),le(!1),de(-1))},[ce,be]),ke=(0,e.useCallback)(function(){le(!1),de(-1)},[]),Ee=(0,e.useCallback)(function(){var e;Z(null);var t=(null==D||null===(e=D.values)||void 0===e?void 0:e[c])||[],n=Array.isArray(t)?t.length:L.length;re(n),ie(!1),K(!0)},[L.length,null==D?void 0:D.values,c]),Ce=(0,e.useCallback)(function(e,t){Z(e),re(t),ie(!0),K(!0)},[]),xe=(0,e.useCallback)(function(e,t){var n,r=lC({},e);delete r.__isPending__;var o=(null==D||null===(n=D.values)||void 0===n?void 0:n[c])||[],i=(Array.isArray(o)?aC(o):[]).map(function(e){if(null!=e&&e.__isPending__){var t=lC({},e);return delete t.__isPending__,t}return e}),a=t>=i.length||-1===t;a?i.push(r):i[t]=r;var s=i.filter(function(e){return!(null!=e&&e.__isPending__)});N(s),j(c,i,a?"add":"update","",a?i.length-1:t),null==m||m(null,!0)},[c,j,m,null==D?void 0:D.values]),Se=(0,e.useCallback)(function(){K(!1),Z(null),re(-1),ie(!1)},[]),_e=(0,e.useCallback)(function(){U(function(e){return!e})},[]),Oe=(0,e.useCallback)(function(e,t){var n,r="".concat(e,"_").concat(t);return null==D||null===(n=D.nestedStates)||void 0===n||null===(n=n[r])||void 0===n||null===(n=n.visibility)||void 0===n?void 0:n[e]},[null==D?void 0:D.nestedStates]),Ie=(0,e.useCallback)(function(e,t){var n,r=e.questionId||e.name,o=Oe(r,t);return void 0!==o?o:void 0!==(null==D||null===(n=D.visibility)||void 0===n?void 0:n[r])?D.visibility[r]:e.visible},[Oe,null==D?void 0:D.visibility]),Te=(0,e.useCallback)(function(e,t,n){if(Ie(e,n)){var r=function(e,t){var n;return null===(n=e.properties)||void 0===n||null===(n=n.find(function(e){return e.property===t}))||void 0===n?void 0:n.value}(t,e.name),o=Fs(e,r);if(o)return{fieldName:e.name,message:o}}return null},[Ie]),Pe=(0,e.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.length-1;return null!=p&&p.editQuestions?p.editQuestions.reduce(function(n,r){var o=Te(r,e,t);return o&&(n[o.fieldName]=o.message),n},{}):{}},[null==p?void 0:p.editQuestions,L.length,Te]),Be=(0,e.useCallback)(function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=aC(L),i=null===(n=D.values)||void 0===n||null===(n=n[c])||void 0===n?void 0:n[e],a=function(e,t,n,r){if(e)return e;var o,i=null,a=cC(r||[]);try{var s=function(){var e,r=o.value,a=null===(e=n.properties)||void 0===e||null===(e=e.find(function(e){return e.editQuestionId===r.questionId}))||void 0===e?void 0:e.value,s="__id__".concat(r.questionId);if(void 0!==t[s]&&t[s]!==a)return i=r.questionId,1;null===i&&t[r.name]!==a&&(i=r.questionId)};for(a.s();!(o=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return i}(r,t,i,null==p?void 0:p.editQuestions),l=function(e,t,n){return(null==e?void 0:e.map(function(e){var r,o,i=null===(r=t.properties)||void 0===r?void 0:r.find(function(t){return ee(t.editQuestionId)===ee(e.questionId)}),a=n[e.name],s=void 0!==a&&""!==(null==i?void 0:i.value)?a:null==i?void 0:i.value;return{property:e.name,value:s,editQuestionId:e.questionId,renderMode:null!==(o=null==i?void 0:i.renderMode)&&void 0!==o?o:null}}))||[]}(null==p?void 0:p.editQuestions,i,t);o[e]=lC(lC({},i),{},{name:t.name||(null==i?void 0:i.name)||"".concat(s," - ").concat(e+1),properties:l});var u=Pe(o[e],e);ye(e,u),N(o),j(c,o,"update",a,e)},[L,D.values,c,s,null==p?void 0:p.editQuestions,Pe,ye,j]),De=(0,e.useCallback)(function(e){var t=rC(s,p);return lC(lC({},t),{},{name:"".concat(s," - ").concat(e+1),properties:t.properties.map(function(e){return lC(lC({},e),{},{value:""})})})},[s,p]),je=(0,e.useCallback)(function(e,t){return function(n){var r,o,i,a=null!==(r=null==n||null===(o=n.target)||void 0===o?void 0:o.value)&&void 0!==r?r:n,s=void 0===(null==n||null===(i=n.target)||void 0===i||null===(i=i.dataset)||void 0===i?void 0:i.itemIndex)?t:Number.parseInt(n.target.dataset.itemIndex,10),l=lC(lC({},function(e){var t,n={},r=cC(e.properties);try{for(r.s();!(t=r.n()).done;){var o=t.value;n[o.property]=o.value,o.editQuestionId&&(n["__id__".concat(o.editQuestionId)]=o.value)}}catch(e){r.e(e)}finally{r.f()}return n}(L[s]||De(s))),{},uC(uC({},e.name,a),"__id__".concat(e.questionId),a));Be(s,l,e.questionId)}},[L,De,Be]),Re=(0,e.useCallback)(function(e,t){var n,r,o,i=e.questionId||e.name,a=(n=L[t],r=e.questionId,null==n||null===(o=n.properties)||void 0===o||null===(o=o.find(function(e){return e.editQuestionId===r}))||void 0===o?void 0:o.value),s=Ie(e,t);return lC(lC({},e),{},{parentId:P.id,questionId:i,questionType:e.questionType||"text",validation:lC(lC({},e.validation),{},{required:e.required}),visible:s,value:a,onChange:je(e,t),inputProps:{"data-item-index":t,"data-parent-id":P.id}})},[L,Ie,je,P.id]),Me=(0,e.useCallback)(function(e){return null!=p&&p.editQuestions?[lC(lC({},P),{},{groupName:"",questions:p.editQuestions.map(function(t){return Re(t,e)})})]:[]},[null==p?void 0:p.editQuestions,Re,P]),Le=(0,e.useCallback)(function(){return L.map(function(e,t){var r,o=(null===(r=e.properties)||void 0===r?void 0:r.length)>0?"".concat(c,"_").concat(t,"_").concat(e.properties[0].editQuestionId):"".concat(c,"_").concat(t);return n().createElement("div",{key:o,style:pe.cardListItem},n().createElement("div",{style:pe.cardListItemHeader},n().createElement("h4",{style:pe.cardListItemTitle},"Card - ".concat(t+1)),!A&&!k&&L.length>g&&n().createElement("button",{type:"button",onClick:function(){return be(t)},style:pe.removeButton},"Remove")),n().createElement(BM,{questionGroups:Me(t),disabled:A,readOnly:k,isNested:!0,questionRuleDetails:C,parentContext:{isCardList:!0,itemIndex:t,parentId:c,parentValue:L[t]},apiConfig:S}))})},[L,c,pe,A,k,g,be,Me,C,S]),Ne=u?"".concat(z?"Collapse":"Expand"," ").concat(u):void 0;return{items:L,errors:q,isExpanded:z,showModal:Y,selectedCardItem:J,selectedItemIndex:ne,showDeleteConfirm:se,itemToDeleteIndex:ce,mergedTheme:pe,isRequired:fe,minItems:g,maxItems:v,handleAddItem:ge,handleRemoveItem:be,handleDeleteClick:Ae,handleConfirmDelete:we,handleCancelDelete:ke,handleAddMoreCardlist:Ee,handleEditCardList:Ce,handleSaveCardList:xe,handleModalClose:Se,handleToggleExpand:_e,generateCardSchemaForItem:Me,renderCardListItems:Le,toggleButtonAriaLabel:Ne}}(t),C=E.items,x=E.isExpanded,S=E.showModal,_=E.selectedCardItem,O=E.selectedItemIndex,I=E.showDeleteConfirm,T=E.mergedTheme,P=E.isRequired,B=E.maxItems,D=E.handleAddItem,j=E.handleDeleteClick,R=E.handleConfirmDelete,M=E.handleCancelDelete,L=E.handleAddMoreCardlist,N=E.handleEditCardList,F=E.handleSaveCardList,q=E.handleModalClose,V=E.handleToggleExpand,Q=E.renderCardListItems,z=E.toggleButtonAriaLabel,U=function(){return function(e,t){if(t)return null;var n=Array.isArray(e)?e:[];return m&&n.length<m?"Minimum ".concat(m," items required"):p&&n.length>p?"Maximum ".concat(p," items allowed"):null}};return k?n().createElement(n().Fragment,null,n().createElement(NE,{name:r,label:i,value:Array.isArray(C)?C:[],validation:FC(FC({},c),{},{custom:U()}),className:v,renderInput:function(){return n().createElement(jC,{items:C,questionId:a,name:r||i,onEdit:N,onDeleteClick:j,onAddMore:L,disabled:g,readOnly:A,maxItems:p})}}),n().createElement(TC,{isOpen:S,onClose:q,onSave:F,cardItem:_,itemIndex:O,cardListId:a,cardListName:r||i,customQuestionValueList:l,questionRuleDetails:t.questionRuleDetails,apiConfig:t.apiConfig,disabled:g,readOnly:A}),n().createElement(BC,{isOpen:I,onClose:M,onConfirm:R})):n().createElement(NE,{name:r,label:i,value:Array.isArray(C)?C:[],validation:FC(FC({},c),{},{custom:U()}),className:v,renderInput:function(){return n().createElement("div",{style:T.container},n().createElement("button",{type:"button",style:FC(FC({},T.header),{},{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",background:"transparent",border:"none"}),onClick:V,"aria-expanded":x,"aria-label":z},n().createElement("span",{style:T.title},i,P&&n().createElement("span",{className:"required-mark"},"*")),n().createElement("span",{style:FC(FC({},T.toggleButton),x&&T.toggleExpanded),"aria-hidden":"true"},"▼")),x&&n().createElement(n().Fragment,null,n().createElement("div",{style:T.itemsContainer},Q()),!g&&!A&&(!B||C.length<B)&&n().createElement("button",{type:"button",onClick:D,style:FC(FC(FC(FC({},T.actionButton),T.addButton),g&&T.disabled),B&&C.length>=B&&T.maxItemsReached),"aria-label":"Add New"},"Add New")))}})};VC.propTypes={id:o().oneOfType([o().string,o().number]),name:o().string.isRequired,label:o().string,questionId:o().oneOfType([o().string,o().number]),customQuestionValueList:o().oneOfType([o().array,o().object]),onChange:o().func,validation:o().object,max:o().number,min:o().number,className:o().string,disabled:o().bool,readOnly:o().bool,questionRuleDetails:o().array,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})}),customTheme:o().object,visible:o().bool,isCardlistModal:o().bool};const{entries:QC,setPrototypeOf:zC,isFrozen:UC,getPrototypeOf:WC,getOwnPropertyDescriptor:HC}=Object;let{freeze:$C,seal:GC,create:YC}=Object,{apply:KC,construct:XC}="undefined"!=typeof Reflect&&Reflect;$C||($C=function(e){return e}),GC||(GC=function(e){return e}),KC||(KC=function(e,t,n){return e.apply(t,n)}),XC||(XC=function(e,t){return new e(...t)});const JC=fx(Array.prototype.forEach),ZC=fx(Array.prototype.lastIndexOf),ex=fx(Array.prototype.pop),tx=fx(Array.prototype.push),nx=fx(Array.prototype.splice),rx=fx(String.prototype.toLowerCase),ox=fx(String.prototype.toString),ix=fx(String.prototype.match),ax=fx(String.prototype.replace),sx=fx(String.prototype.indexOf),lx=fx(String.prototype.trim),ux=fx(Object.prototype.hasOwnProperty),cx=fx(RegExp.prototype.test),dx=(px=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return XC(px,t)});var px;function fx(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return KC(e,t,r)}}function mx(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rx;zC&&zC(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(UC(t)||(t[r]=e),o=e)}e[o]=!0}return e}function hx(e){for(let t=0;t<e.length;t++)ux(e,t)||(e[t]=null);return e}function vx(e){const t=YC(null);for(const[n,r]of QC(e))ux(e,n)&&(Array.isArray(r)?t[n]=hx(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=vx(r):t[n]=r);return t}function yx(e,t){for(;null!==e;){const n=HC(e,t);if(n){if(n.get)return fx(n.get);if("function"==typeof n.value)return fx(n.value)}e=WC(e)}return function(){return null}}const gx=$C(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bx=$C(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ax=$C(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),wx=$C(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),kx=$C(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ex=$C(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cx=$C(["#text"]),xx=$C(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Sx=$C(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_x=$C(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ox=$C(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ix=GC(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Tx=GC(/<%[\w\W]*|[\w\W]*%>/gm),Px=GC(/\$\{[\w\W]*/gm),Bx=GC(/^data-[\-\w.\u00B7-\uFFFF]+$/),Dx=GC(/^aria-[\-\w]+$/),jx=GC(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Rx=GC(/^(?:\w+script|data):/i),Mx=GC(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lx=GC(/^html$/i),Nx=GC(/^[a-z][.\w]*(-[.\w]+)+$/i);var Fx=Object.freeze({__proto__:null,ARIA_ATTR:Dx,ATTR_WHITESPACE:Mx,CUSTOM_ELEMENT:Nx,DATA_ATTR:Bx,DOCTYPE_NAME:Lx,ERB_EXPR:Tx,IS_ALLOWED_URI:jx,IS_SCRIPT_OR_DATA:Rx,MUSTACHE_EXPR:Ix,TMPLIT_EXPR:Px});const qx=function(){return"undefined"==typeof window?null:window};var Vx,Qx=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qx();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,h=u.prototype,v=yx(h,"cloneNode"),y=yx(h,"remove"),g=yx(h,"nextSibling"),b=yx(h,"childNodes"),A=yx(h,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,k="";const{implementation:E,createNodeIterator:C,createDocumentFragment:x,getElementsByTagName:S}=r,{importNode:_}=o;let O={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof QC&&"function"==typeof A&&E&&void 0!==E.createHTMLDocument;const{MUSTACHE_EXPR:I,ERB_EXPR:T,TMPLIT_EXPR:P,DATA_ATTR:B,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:j,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:M}=Fx;let{IS_ALLOWED_URI:L}=Fx,N=null;const F=mx({},[...gx,...bx,...Ax,...kx,...Cx]);let q=null;const V=mx({},[...xx,...Sx,..._x,...Ox]);let Q=Object.seal(YC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,U=null,W=!0,H=!0,$=!1,G=!0,Y=!1,K=!0,X=!1,J=!1,Z=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie=!0,ae=!1,se={},le=null;const ue=mx({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const de=mx({},["audio","video","img","source","image","track"]);let pe=null;const fe=mx({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml";let ye=ve,ge=!1,be=null;const Ae=mx({},[me,he,ve],ox);let we=mx({},["mi","mo","mn","ms","mtext"]),ke=mx({},["annotation-xml"]);const Ee=mx({},["title","style","font","a","script"]);let Ce=null;const xe=["application/xhtml+xml","text/html"];let Se=null,_e=null;const Oe=r.createElement("form"),Ie=function(e){return e instanceof RegExp||e instanceof Function},Te=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!_e||_e!==e){if(e&&"object"==typeof e||(e={}),e=vx(e),Ce=-1===xe.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Se="application/xhtml+xml"===Ce?ox:rx,N=ux(e,"ALLOWED_TAGS")?mx({},e.ALLOWED_TAGS,Se):F,q=ux(e,"ALLOWED_ATTR")?mx({},e.ALLOWED_ATTR,Se):V,be=ux(e,"ALLOWED_NAMESPACES")?mx({},e.ALLOWED_NAMESPACES,ox):Ae,pe=ux(e,"ADD_URI_SAFE_ATTR")?mx(vx(fe),e.ADD_URI_SAFE_ATTR,Se):fe,ce=ux(e,"ADD_DATA_URI_TAGS")?mx(vx(de),e.ADD_DATA_URI_TAGS,Se):de,le=ux(e,"FORBID_CONTENTS")?mx({},e.FORBID_CONTENTS,Se):ue,z=ux(e,"FORBID_TAGS")?mx({},e.FORBID_TAGS,Se):vx({}),U=ux(e,"FORBID_ATTR")?mx({},e.FORBID_ATTR,Se):vx({}),se=!!ux(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,H=!1!==e.ALLOW_DATA_ATTR,$=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||jx,ye=e.NAMESPACE||ve,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,ke=e.HTML_INTEGRATION_POINTS||ke,Q=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Q.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(H=!1),te&&(ee=!0),se&&(N=mx({},Cx),q=[],!0===se.html&&(mx(N,gx),mx(q,xx)),!0===se.svg&&(mx(N,bx),mx(q,Sx),mx(q,Ox)),!0===se.svgFilters&&(mx(N,Ax),mx(q,Sx),mx(q,Ox)),!0===se.mathMl&&(mx(N,kx),mx(q,_x),mx(q,Ox))),e.ADD_TAGS&&(N===F&&(N=vx(N)),mx(N,e.ADD_TAGS,Se)),e.ADD_ATTR&&(q===V&&(q=vx(q)),mx(q,e.ADD_ATTR,Se)),e.ADD_URI_SAFE_ATTR&&mx(pe,e.ADD_URI_SAFE_ATTR,Se),e.FORBID_CONTENTS&&(le===ue&&(le=vx(le)),mx(le,e.FORBID_CONTENTS,Se)),ie&&(N["#text"]=!0),X&&mx(N,["html","head","body"]),N.table&&(mx(N,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw dx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw dx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));$C&&$C(e),_e=e}},Pe=mx({},[...bx,...Ax,...wx]),Be=mx({},[...kx,...Ex]),De=function(e){tx(n.removed,{element:e});try{A(e).removeChild(e)}catch(t){y(e)}},je=function(e,t){try{tx(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){tx(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{De(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Re=function(e){let t=null,n=null;if(Z)e="<remove></remove>"+e;else{const t=ix(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ce&&ye===ve&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=w?w.createHTML(e):e;if(ye===ve)try{t=(new f).parseFromString(o,Ce)}catch(e){}if(!t||!t.documentElement){t=E.createDocument(ye,"template",null);try{t.documentElement.innerHTML=ge?k:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ye===ve?S.call(t,X?"html":"body")[0]:X?t.documentElement:i},Me=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ne=function(e){return"function"==typeof l&&e instanceof l};function Fe(e,t,r){JC(e,e=>{e.call(n,t,r,_e)})}const qe=function(e){let t=null;if(Fe(O.beforeSanitizeElements,e,null),Le(e))return De(e),!0;const r=Se(e.nodeName);if(Fe(O.uponSanitizeElement,e,{tagName:r,allowedTags:N}),K&&e.hasChildNodes()&&!Ne(e.firstElementChild)&&cx(/<[/\w!]/g,e.innerHTML)&&cx(/<[/\w!]/g,e.textContent))return De(e),!0;if(7===e.nodeType)return De(e),!0;if(K&&8===e.nodeType&&cx(/<[/\w]/g,e.data))return De(e),!0;if(!N[r]||z[r]){if(!z[r]&&Qe(r)){if(Q.tagNameCheck instanceof RegExp&&cx(Q.tagNameCheck,r))return!1;if(Q.tagNameCheck instanceof Function&&Q.tagNameCheck(r))return!1}if(ie&&!le[r]){const t=A(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const o=v(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,g(e))}}return De(e),!0}return e instanceof u&&!function(e){let t=A(e);t&&t.tagName||(t={namespaceURI:ye,tagName:"template"});const n=rx(e.tagName),r=rx(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===he?t.namespaceURI===ve?"svg"===n:t.namespaceURI===me?"svg"===n&&("annotation-xml"===r||we[r]):Boolean(Pe[n]):e.namespaceURI===me?t.namespaceURI===ve?"math"===n:t.namespaceURI===he?"math"===n&&ke[r]:Boolean(Be[n]):e.namespaceURI===ve?!(t.namespaceURI===he&&!ke[r])&&!(t.namespaceURI===me&&!we[r])&&!Be[n]&&(Ee[n]||!Pe[n]):!("application/xhtml+xml"!==Ce||!be[e.namespaceURI]))}(e)?(De(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!cx(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,JC([I,T,P],e=>{t=ax(t,e," ")}),e.textContent!==t&&(tx(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe(O.afterSanitizeElements,e,null),!1):(De(e),!0)},Ve=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in r||n in Oe))return!1;if(H&&!U[t]&&cx(B,t));else if(W&&cx(D,t));else if(!q[t]||U[t]){if(!(Qe(e)&&(Q.tagNameCheck instanceof RegExp&&cx(Q.tagNameCheck,e)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(e))&&(Q.attributeNameCheck instanceof RegExp&&cx(Q.attributeNameCheck,t)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(t))||"is"===t&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&cx(Q.tagNameCheck,n)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(n))))return!1}else if(pe[t]);else if(cx(L,ax(n,R,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==sx(n,"data:")||!ce[e])if($&&!cx(j,ax(n,R,"")));else if(n)return!1;return!0},Qe=function(e){return"annotation-xml"!==e&&ix(e,M)},ze=function(e){Fe(O.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,u=Se(a),c=l;let d="value"===a?c:lx(c);if(r.attrName=u,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Fe(O.uponSanitizeAttribute,e,r),d=r.attrValue,!oe||"id"!==u&&"name"!==u||(je(a,e),d="user-content-"+d),K&&cx(/((--!?|])>)|<\/(style|title)/i,d)){je(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){je(a,e);continue}if(!G&&cx(/\/>/i,d)){je(a,e);continue}Y&&JC([I,T,P],e=>{d=ax(d,e," ")});const p=Se(e.nodeName);if(Ve(p,u,d)){if(w&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(p,u)){case"TrustedHTML":d=w.createHTML(d);break;case"TrustedScriptURL":d=w.createScriptURL(d)}if(d!==c)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),Le(e)?De(e):ex(n.removed)}catch(t){je(a,e)}}else je(a,e)}Fe(O.afterSanitizeAttributes,e,null)},Ue=function e(t){let n=null;const r=Me(t);for(Fe(O.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Fe(O.uponSanitizeShadowNode,n,null),qe(n),ze(n),n.content instanceof a&&e(n.content);Fe(O.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,u=null;if(ge=!e,ge&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw dx("toString is not a function");if("string"!=typeof(e=e.toString()))throw dx("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||Te(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Se(e.nodeName);if(!N[t]||z[t])throw dx("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Re("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!ee&&!Y&&!X&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(r=Re(e),!r)return ee?null:ne?k:""}r&&Z&&De(r.firstChild);const c=Me(ae?e:r);for(;s=c.nextNode();)qe(s),ze(s),s.content instanceof a&&Ue(s.content);if(ae)return e;if(ee){if(te)for(u=x.call(r.ownerDocument);r.firstChild;)u.appendChild(r.firstChild);else u=r;return(q.shadowroot||q.shadowrootmode)&&(u=_.call(o,u,!0)),u}let d=X?r.outerHTML:r.innerHTML;return X&&N["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&cx(Lx,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Y&&JC([I,T,P],e=>{d=ax(d,e," ")}),w&&ne?w.createHTML(d):d},n.setConfig=function(){Te(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){_e=null,J=!1},n.isValidAttribute=function(e,t,n){_e||Te({});const r=Se(e),o=Se(t);return Ve(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&tx(O[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=ZC(O[e],t);return-1===n?void 0:nx(O[e],n,1)[0]}return ex(O[e])},n.removeHooks=function(e){O[e]=[]},n.removeAllHooks=function(){O={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function zx(e){return zx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zx(e)}var Ux=["name","questionId","label","value","validation","disabled","required","className","options","header","styleName","customTheme","error","helperText","onChange","inputProps","tooltip","apiConfig"],Wx=["_editable","_error","_theme","_apiConfig"],Hx=["apiConfig","questionId","maskInput","maskingType","maskingLength","questionRuleDetails","visible","dependsOn","formData","customQuestionValueList","fileUploads","allowedFileType","fileSizeLimit","numberOfFiles","includeExtraDropDowns","additionalDropDowns","errorMessage","addressGroup","isopeninnewtab"];function $x(){return $x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$x.apply(null,arguments)}function Gx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yx(Object(n),!0).forEach(function(t){Xx(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xx(e,t,n){return(t=function(e){var t=function(e){if("object"!=zx(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zx(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jx(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Zx=function(t){var r,o,i,a=t.name,s=t.questionId,l=t.label,u=t.value,c=t.validation,d=t.disabled,p=t.required,f=void 0!==p&&p,m=t.className,h=t.options,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,A=t.error,w=t.helperText,k=t.onChange,E=t.inputProps,C=void 0===E?{}:E,x=t.tooltip,S=void 0===x?"":x,_=(t.apiConfig,Jx(t,Ux)),O=xc(),I=cc(),T=I.setValue,P=I.state,B=C["data-item-index"],D=C["data-parent-id"],j=(0,e.useMemo)(function(){var e,t;if(!h||!Array.isArray(h))return h;var n=null===(e=P.optionVisibility)||void 0===e?void 0:e[s];return null!=D&&void 0!==B&&null!==(t=P.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[D])&&void 0!==t&&null!==(t=t[Number(B)])&&void 0!==t&&t[s]&&(n=P.optionVisibilityByInstance[D][Number(B)][s]),n?h.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):h},[h,P.optionVisibility,P.optionVisibilityByInstance,s,D,B]),R=null!==(r=null==l?void 0:l.replaceAll(String.raw(Vx||(o=["\n"],i=["\\n"],i||(i=o.slice(0)),Vx=Object.freeze(Object.defineProperties(o,{raw:{value:Object.freeze(i)}}))))," ").trim())&&void 0!==r?r:"",M=R?Qx.sanitize(R,{ADD_ATTR:["target","rel"],ALLOWED_TAGS:["a","p","br","span","strong","em"],ALLOWED_ATTR:["href","target","rel"]}):"",L=void 0===B?String(a):"".concat(String(a),"-").concat(B),N=!0===u||"string"==typeof u&&"false"!==u.trim().toLowerCase()&&""!==u.trim(),F=(0,e.useMemo)(function(){return!(h&&Array.isArray(h)&&h.length>0)||j&&j.length>0},[h,j]),q=(0,e.useMemo)(function(){var e=O.checkboxField||{};return ZA(e,b)},[O,b]),V=(0,e.useMemo)(function(){var e=Kx(Kx({},q.container),{},{width:"100%"}),t=tw(q.checkbox,A&&q.error,d&&q.disabled,N&&q.checked);return{container:ew(e,q.responsive),checkbox:t,label:q.label}},[q,A,d,N]);return F?n().createElement("div",{className:"form-field ".concat(y||""),"data-theme":q.name,"data-field-type":"checkbox",style:V.container},v&&n().createElement("div",{className:"field-header",style:O.header},v),n().createElement(NE,{name:L,label:M,value:u,validation:c,className:"checkbox-field ".concat(m||""),customTheme:q,error:A,helperText:w,renderInput:function(e){e._editable,e._error,e._theme,e._apiConfig;var t=Jx(e,Wx),r=Object.entries(_).reduce(function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Gx(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gx(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=n[0],o=n[1];return"boolean"==typeof o?!0===o&&(e[r]="true"):null!=o&&(e[r]=o),e},{}),o=(r.apiConfig,r.questionId,r.maskInput,r.maskingType,r.maskingLength,r.questionRuleDetails,r.visible,r.dependsOn,r.formData,r.customQuestionValueList,r.fileUploads,r.allowedFileType,r.fileSizeLimit,r.numberOfFiles,r.includeExtraDropDowns,r.additionalDropDowns,r.errorMessage,r.addressGroup,r.isopeninnewtab,Jx(r,Hx));return n().createElement("div",{className:"checkbox-wrapper",style:V.container},n().createElement("input",$x({},t,{type:"checkbox",checked:N,disabled:d,className:"form-field__checkbox",onChange:function(e){var t,n=e.target.checked?(null==j||null===(t=j[0])||void 0===t?void 0:t.value)||"true":"";null==k||k(Kx(Kx({},e),{},{target:Kx(Kx({},e.target),{},{value:n})})),T(L,n)},style:V.checkbox},o,{"data-item-index":B,"data-parent-id":D})),M&&n().createElement("label",{htmlFor:L,style:V.label},n().createElement("span",{dangerouslySetInnerHTML:{__html:M}})," ",f&&n().createElement("span",{className:"required-mark",style:q.required},"*"),S&&n().createElement(gE,{tooltip:S})))}}),w&&n().createElement("div",{className:"helper-text",style:O.helperText},w)):null};function eS(e){return by("MuiFormGroup",e)}Zx.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,questionId:o().string,label:o().string,value:o().oneOfType([o().string,o().bool]),validation:o().object,disabled:o().bool,required:o().bool,className:o().string,options:o().arrayOf(o().shape({value:o().oneOfType([o().string,o().bool]).isRequired,label:o().string.isRequired})),header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,onChange:o().func,inputProps:o().object,tooltip:o().string,apiConfig:o().object},Ay("MuiFormGroup",["root","row","error"]);const tS=Bv("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),nS=e.forwardRef(function(e,t){const n=Mv({props:e,name:"MuiFormGroup"}),{className:r,row:o=!1,...i}=n,a=Yv({props:n,muiFormControl:Xv(),states:["error"]}),s={...n,row:o,error:a.error},l=(e=>{const{classes:t,row:n,error:r}=e;return Hd({root:["root",n&&"row",r&&"error"]},eS,t)})(s);return(0,jv.jsx)(tS,{className:Wd(l.root,r),ownerState:s,ref:t,...i})});function rS(e){return by("MuiTypography",e)}Ay("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const oS={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},iS=function(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=(e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Lm;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t})(n);let i;return i=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return jf(n)?{...r,...n}:r}:{...r,...t},{...o,sx:i}},aS=Bv("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${dy(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(cy(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([e,t])=>"inherit"!==e&&t&&"object"==typeof t).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>"string"==typeof e).map(([t])=>({props:{color:`text${dy(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>"inherit"!==e.align,style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:e})=>e.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}))),sS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},lS=e.forwardRef(function(e,t){const{color:n,...r}=Mv({props:e,name:"MuiTypography"}),o=iS({...r,...!oS[n]&&{color:n}}),{align:i="inherit",className:a,component:s,gutterBottom:l=!1,noWrap:u=!1,paragraph:c=!1,variant:d="body1",variantMapping:p=sS,...f}=o,m={...o,align:i,color:n,className:a,component:s,gutterBottom:l,noWrap:u,paragraph:c,variant:d,variantMapping:p},h=s||(c?"p":p[d]||sS[d])||"span",v=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:a}=e;return Hd({root:["root",i,"inherit"!==e.align&&`align${dy(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]},rS,a)})(m);return(0,jv.jsx)(aS,{as:h,ref:t,className:Wd(v.root,a),...f,ownerState:m,style:{..."inherit"!==i&&{"--Typography-textAlign":i},...f.style}})}),uS=lS;function cS(e){return by("MuiFormControlLabel",e)}const dS=Ay("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),pS=Bv("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${dS.label}`]:t.label},t.root,t[`labelPlacement${dy(n.labelPlacement)}`]]}})(cy(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${dS.disabled}`]:{cursor:"default"},[`& .${dS.label}`]:{[`&.${dS.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>"start"===e||"top"===e||"bottom"===e,style:{marginLeft:16}}]}))),fS=Bv("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(cy(({theme:e})=>({[`&.${dS.error}`]:{color:(e.vars||e).palette.error.main}}))),mS=e.forwardRef(function(t,n){const r=Mv({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:a={},control:s,disabled:l,disableTypography:u,inputRef:c,label:d,labelPlacement:p="end",name:f,onChange:m,required:h,slots:v={},slotProps:y={},value:g,...b}=r,A=Xv(),w=l??s.props.disabled??A?.disabled,k=h??s.props.required,E={disabled:w,required:k};["checked","name","onChange","value","inputRef"].forEach(e=>{void 0===s.props[e]&&void 0!==r[e]&&(E[e]=r[e])});const C=Yv({props:r,muiFormControl:A,states:["error"]}),x={...r,disabled:w,labelPlacement:p,required:k,error:C.error},S=(e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e;return Hd({root:["root",n&&"disabled",`labelPlacement${dy(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]},cS,t)})(x),_={slots:v,slotProps:{...a,...y}},[O,I]=tg("typography",{elementType:uS,externalForwardedProps:_,ownerState:x});let T=d;return null==T||T.type===uS||u||(T=(0,jv.jsx)(O,{component:"span",...I,className:Wd(S.label,I?.className),children:T})),(0,jv.jsxs)(pS,{className:Wd(S.root,i),ownerState:x,ref:n,...b,children:[e.cloneElement(s,E),k?(0,jv.jsxs)("div",{children:[T,(0,jv.jsxs)(fS,{ownerState:x,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):T]})});function hS(e){return by("PrivateSwitchBase",e)}Ay("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const vS=Bv(Jk)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),yS=Bv("input",{shouldForwardProp:Tv})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),gS=e.forwardRef(function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,defaultChecked:i,disabled:a,disableFocusRipple:s=!1,edge:l=!1,icon:u,id:c,inputProps:d,inputRef:p,name:f,onBlur:m,onChange:h,onFocus:v,readOnly:y,required:g=!1,tabIndex:b,type:A,value:w,slots:k={},slotProps:E={},...C}=e,[x,S]=hA({controlled:r,default:Boolean(i),name:"SwitchBase",state:"checked"}),_=Xv();let O=a;_&&void 0===O&&(O=_.disabled);const I="checkbox"===A||"radio"===A,T={...e,checked:x,disabled:O,disableFocusRipple:s,edge:l},P=(e=>{const{classes:t,checked:n,disabled:r,edge:o}=e;return Hd({root:["root",n&&"checked",r&&"disabled",o&&`edge${dy(o)}`],input:["input"]},hS,t)})(T),B={slots:k,slotProps:{input:d,...E}},[D,j]=tg("root",{ref:t,elementType:vS,className:P.root,shouldForwardComponentProp:!0,externalForwardedProps:{...B,component:"span",...C},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{v&&v(e),_&&_.onFocus&&_.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{m&&m(e),_&&_.onBlur&&_.onBlur(e)})(t)}}),ownerState:T,additionalProps:{centerRipple:!0,focusRipple:!s,disabled:O,role:void 0,tabIndex:null}}),[R,M]=tg("input",{ref:p,elementType:yS,className:P.input,externalForwardedProps:B,getSlotProps:e=>({onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;S(t),h&&h(e,t)})(t)}}),ownerState:T,additionalProps:{autoFocus:n,checked:r,defaultChecked:i,disabled:O,id:I?c:void 0,name:f,readOnly:y,required:g,tabIndex:b,type:A,..."checkbox"===A&&void 0===w?{}:{value:w}}});return(0,jv.jsxs)(D,{...j,children:[(0,jv.jsx)(R,{...M}),x?o:u]})}),bS=TA((0,jv.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),AS=TA((0,jv.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),wS=TA((0,jv.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function kS(e){return by("MuiCheckbox",e)}const ES=Ay("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),CS=Bv(gS,{shouldForwardProp:e=>Tv(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${dy(n.size)}`],"default"!==n.color&&t[`color${dy(n.color)}`]]}})(cy(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:th(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:th(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{[`&.${ES.checked}, &.${ES.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${ES.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),xS=(0,jv.jsx)(AS,{}),SS=(0,jv.jsx)(bS,{}),_S=(0,jv.jsx)(wS,{}),OS=e.forwardRef(function(t,n){const r=Mv({props:t,name:"MuiCheckbox"}),{checkedIcon:o=xS,color:i="primary",icon:a=SS,indeterminate:s=!1,indeterminateIcon:l=_S,inputProps:u,size:c="medium",disableRipple:d=!1,className:p,slots:f={},slotProps:m={},...h}=r,v=s?l:a,y=s?l:o,g={...r,disableRipple:d,color:i,indeterminate:s,size:c},b=(e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i=Hd({root:["root",n&&"indeterminate",`color${dy(r)}`,`size${dy(o)}`]},kS,t);return{...t,...i}})(g),A=m.input??u,[w,k]=tg("root",{ref:n,elementType:CS,className:Wd(b.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:f,slotProps:m,...h},ownerState:g,additionalProps:{type:"checkbox",icon:e.cloneElement(v,{fontSize:v.props.fontSize??c}),checkedIcon:e.cloneElement(y,{fontSize:y.props.fontSize??c}),disableRipple:d,slots:f,slotProps:{input:Wb("function"==typeof A?A(g):A,{"data-indeterminate":s})}}});return(0,jv.jsx)(w,{...k,classes:b})});function IS(e){return IS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},IS(e)}var TS=["questionId","label","options","defaultValue","helperText","required","onChange","_showcheckbox","_isesigndoc","_isopeninnewtab","_addadditional","_addmedication","questionRuleDetails","formData","apiBaseUrl","dependsOn","error","customTheme","inputProps","styleName","tooltip","showQuestionLabels"],PS=["apiConfig","maskInput","maskingType","maskingLength","customQuestionValueList","fileUploads","allowedFileType","fileSizeLimit","numberOfFiles","includeExtraDropDowns","additionalDropDowns","errorMessage","addressGroup"];function BS(){return BS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BS.apply(null,arguments)}function DS(e,t){if(e){if("string"==typeof e)return jS(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jS(e,t):void 0}}function jS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RS(Object(n),!0).forEach(function(t){LS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LS(e,t,n){return(t=function(e){var t=function(e){if("object"!=IS(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=IS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==IS(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NS(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var FS=function(t){var r=t.questionId,o=t.label,i=t.options,a=void 0===i?[]:i,s=t.defaultValue,l=void 0===s?[]:s,u=t.helperText,c=t.required,d=void 0!==c&&c,p=t.onChange,f=(t._showcheckbox,t._isesigndoc,t._isopeninnewtab,t._addadditional,t._addmedication,t.questionRuleDetails,t.formData,t.apiBaseUrl,t.dependsOn,t.error),m=t.customTheme,h=void 0===m?{}:m,v=t.inputProps,y=void 0===v?{}:v,g=t.styleName,b=t.tooltip,A=void 0===b?"":b,w=t.showQuestionLabels,k=void 0===w||w,E=NS(t,TS),C=y["data-item-index"],x=y["data-parent-id"],S=xc(),_=cc(),O=_.setValue,I=_.state,T=GA({questionId:r,itemIndex:C,defaultValue:l,defaultVisible:!0,defaultDisabled:!1}),P=T.value,B=T.visible,D=T.disabled,j=T.handleChange,R=(0,e.useMemo)(function(){var e,t,n=null===(e=I.optionVisibility)||void 0===e?void 0:e[r];return null!=x&&void 0!==C&&null!==(t=I.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[x])&&void 0!==t&&null!==(t=t[Number(C)])&&void 0!==t&&t[r]&&(n=I.optionVisibilityByInstance[x][Number(C)][r]),n?a.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):a},[a,I.optionVisibility,I.optionVisibilityByInstance,r,x,C]),M=void 0===C?String(r):"".concat(String(r),"-").concat(C),L=(0,e.useMemo)(function(){var e=S.checkboxGroupField||S.checkboxField||{};return ZA(e,h)},[S,h]),N=(0,e.useMemo)(function(){var e=MS(MS({},L.container),{},{width:"100%"}),t=tw(L.label,d&&L.required,D&&L.disabled),n=tw(L.checkbox,f&&L.error,D&&L.disabled);return{container:ew(e,L.responsive),label:t,checkbox:n,group:L.group||{},helperText:tw(L.helperText,f&&L.error)}},[L,d,D,f]),F=Array.isArray(P)?P:Array.isArray(l)?l:[],q=function(e,t){var n=e.target.checked?[].concat(function(e){return function(e){if(Array.isArray(e))return jS(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||DS(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(F||[]),[t]):(F||[]).filter(function(e){return e!==t});O(r,n),j(n),p&&p(MS(MS({},e),{},{target:MS(MS({},e.target),{},{name:M,value:n})}))};if(!B)return null;var V=Object.entries(E).reduce(function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||DS(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=n[0],o=n[1];return e[r]="boolean"==typeof o?o?o.toString():void 0:o,e},{}),Q=(V.apiConfig,V.maskInput,V.maskingType,V.maskingLength,V.customQuestionValueList,V.fileUploads,V.allowedFileType,V.fileSizeLimit,V.numberOfFiles,V.includeExtraDropDowns,V.additionalDropDowns,V.errorMessage,V.addressGroup,NS(V,PS));return n().createElement("div",{className:"checkbox-group-field ".concat(g||""),"data-theme":L.name,"data-field-type":"checkbox-group",style:N.container},n().createElement(nS,{style:N.group},k&&o&&n().createElement("div",{className:"question_label",style:N.label},o,d&&n().createElement("span",{style:L.required},"*"),A&&n().createElement(gE,{tooltip:A})),n().createElement("div",{className:"checkbox-group-wrapper",style:N.group},R.map(function(e){var t=Array.isArray(F)?F.includes(e.value):!0===e.selected;return n().createElement(mS,{key:e.value,name:M,"data-item-index":C,"data-parent-id":x,control:n().createElement(OS,BS({checked:t,onChange:function(t){return q(t,e.value)},disabled:D,required:d,style:N.checkbox},Q)),label:e.label,style:N.label})}),u&&n().createElement("div",{style:N.helperText},u))))};FS.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().oneOfType([o().string,o().number]).isRequired})),defaultValue:o().array,helperText:o().string,required:o().bool,onChange:o().func,_showcheckbox:o().bool,_isesigndoc:o().bool,_isopeninnewtab:o().bool,_addadditional:o().bool,_addmedication:o().bool,_questionRuleDetails:o().array,questionRuleDetails:o().array,formData:o().object,apiBaseUrl:o().string,dependsOn:o().oneOfType([o().string,o().array]),error:o().string,customTheme:o().object,tooltip:o().string,styleName:o().string,inputProps:o().object,showQuestionLabels:o().bool};var qS=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/CurrencyField.css"),VS={};function QS(e){return QS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QS(e)}function zS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function US(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zS(Object(n),!0).forEach(function(t){WS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WS(e,t,n){return(t=function(e){var t=function(e){if("object"!=QS(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=QS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==QS(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}VS.styleTagTransform=nl(),VS.setAttributes=Js(),VS.insert=Ks().bind(null,"head"),VS.domAPI=Gs(),VS.insertStyleElement=el(),Hs()(qS.A,VS),qS.A&&qS.A.locals&&qS.A.locals;var $S=function(e){if(e){var t=e.replace(re,""),n=Number.parseFloat(t);return Number.isNaN(n)?"":new Intl.NumberFormat("en-US",{style:"decimal"}).format(n)}return""},GS=n().memo(function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.currency,c=void 0===u?"$":u,d=t.onChange,p=t.formState,f=t.error,m=t.customTheme,h=void 0===m?{}:m,v=t.styleName,y=t.maxLength,g=t.placeholder,b=t.onBlur,A=t.tooltip,w=void 0===A?"":A,k=t.showQuestionLabels,E=void 0===k||k,C=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return HS(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HS(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(i?$S(i):""),2),x=C[0],S=C[1],_=xc(),O=(0,e.useMemo)(function(){var e=_.currencyField||_.textField||{};return ZA(e,h)},[_,h]),I=(0,e.useMemo)(function(){var e=US(US({},O.container),{},{width:"100%"}),t=tw(O.input,f&&O.error,s&&O.disabled,{borderTopLeftRadius:"0",borderBottomLeftRadius:"0",borderWidth:"1px",borderStyle:"solid",borderColor:"#e2e8f0",borderLeftWidth:"0"});return{container:ew(e,O.responsive),input:t,currencySymbol:US(US({},O.currencySymbol),{},{padding:"0.5rem 1rem",backgroundColor:"#fff",borderWidth:"1px",borderStyle:"solid",borderColor:"#e2e8f0",borderRightWidth:"0",borderTopLeftRadius:"0.375rem",borderBottomLeftRadius:"0.375rem",color:"#64748b",display:"flex",alignItems:"center",justifyContent:"center"}),wrapper:US(US({},O.wrapper),{},{position:"relative",display:"flex",alignItems:"stretch",width:"100%"})}},[O,f,s]),T=function(e){var t=e.target.value.replace(/[^0-9.]/g,"");y&&t.length>y&&(t=t.slice(0,y));var n=t?$S(t):"";S(n),d&&d({target:{name:r,value:t}})};(0,e.useEffect)(function(){void 0!==i&&S(i?$S(i):"")},[i]);var P=String(r);return n().createElement(NE,{name:P,label:E?o:"",value:$S(i),validation:a,className:"currency-field ".concat(l||""," ").concat(v||""),customTheme:O,error:f,formState:p,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:O.label||{}},t,r&&n().createElement("span",{style:O.required||{}},"*"),w&&n().createElement(gE,{tooltip:w})):null},renderInput:function(){return n().createElement("div",{style:I.wrapper},n().createElement("span",{className:"currency-symbol",style:I.currencySymbol},c),n().createElement("input",{type:"text",name:P,value:x,onChange:T,disabled:s,className:"currency-input",style:I.input,placeholder:g||"Enter amount","aria-label":"Currency input in ".concat(c),onBlur:b}))}})});GS.displayName="CurrencyField",GS.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),validation:o().object,disabled:o().bool,className:o().string,currency:o().string,onChange:o().func,formState:o().object,error:o().string,customTheme:o().object,styleName:o().string,placeholder:o().string,maxLength:o().number,onBlur:o().func,tooltip:o().string,showQuestionLabels:o().bool};const YS={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},KS=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,XS=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,JS=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ZS(e){return e?parseInt(e):1}function e_(e){return e&&parseFloat(e.replace(",","."))||0}const t_=[31,null,31,30,31,30,31,31,30,31,30,31];function n_(e){return e%400==0||e%4==0&&e%100!=0}function r_(e,t){return+Bo(e)<+Bo(t)}function o_(e,t,n){const r=Bo(e,n?.in);return r.setHours(t),r}function i_(e,t,n){const r=Bo(e,n?.in);return r.setMinutes(t),r}function a_(e,t,n){const r=Bo(e,n?.in);return r.setSeconds(t),r}function s_(e,t){const n=Bo(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function l_(e,t){const n=Bo(e,t?.in),r=n.getMonth(),o=r-r%3;return n.setMonth(o,1),n.setHours(0,0,0,0),n}function u_(e,t){const n=Bo(e,t?.in);return n.setHours(23,59,59,999),n}function c_(e,t){const n=Bo(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function d_(e,t,n){const r=+Bo(e,n?.in),[o,i]=[+Bo(t.start,n?.in),+Bo(t.end,n?.in)].sort((e,t)=>e-t);return r>=o&&r<=i}function p_(e,t,n){const r=Bo(e,n?.in),o=r.getFullYear(),i=r.getDate(),a=Po(n?.in||e,0);a.setFullYear(o,t,15),a.setHours(0,0,0,0);const s=function(e,t){const n=Bo(e,t?.in),r=n.getFullYear(),o=n.getMonth(),i=Po(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}(a);return r.setMonth(t,Math.min(i,s)),r}function f_(e,t,n){const r=Bo(e,n?.in),o=t-(Math.trunc(r.getMonth()/3)+1);return p_(r,r.getMonth()+3*o)}function m_(e,t){return Bo(e,t?.in).getFullYear()}function h_(e,t){return Bo(e,t?.in).getMonth()}function v_(e,t){const n=Bo(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function y_(e,t){const n=Bo(e,t?.in);return Math.trunc(n.getMonth()/3)+1}function g_(e,t){return Bo(e,t?.in).getHours()}function b_(e,t){return Bo(e,t?.in).getMinutes()}function A_(e){return Bo(e).getSeconds()}function w_(e,t,n){const r=Bo(e,n?.in);if(isNaN(t))return Po(n?.in||e,NaN);if(!t)return r;const o=r.getDate(),i=Po(n?.in||e,r.getTime());return i.setMonth(r.getMonth()+t+1,0),o>=i.getDate()?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}function k_(e,t,n){return w_(e,-t,n)}function E_(e,t,n){const[r,o]=ia(n?.in,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}function C_(e,t,n){return w_(e,3*t,n)}function x_(e,t,n){return C_(e,-t,n)}function S_(e,t,n){const[r,o]=ia(n?.in,e,t);return 4*(r.getFullYear()-o.getFullYear())+(y_(r)-y_(o))}function __(e,t,n){return w_(e,12*t,n)}function O_(e,t,n){return __(e,-t,n)}function I_(e,t,n){const[r,o]=ia(n?.in,e,t);return r.getFullYear()-o.getFullYear()}function T_(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Po.bind(null,e));const t=Bo(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),Po(r,n||NaN)}function P_(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Po.bind(null,e));const t=Bo(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),Po(r,n||NaN)}function B_(e,t,n){return Po(n?.in||e,+Bo(e)+t)}function D_(e,t,n){return B_(e,t*Io,n)}function j_(e,t,n){const r=Bo(e,n?.in);return r.setTime(r.getTime()+t*Oo),r}function R_(e,t,n){return B_(e,1e3*t,n)}function M_(e,t){return+Bo(e)>+Bo(t)}function L_(e,t){return Bo(e,t?.in).getDate()}function N_(e,t,n){return Hi(e,7*t,n)}function F_(e){return+Bo(e)}function q_(e,t,n){const r=Bo(e,n?.in);return isNaN(+r)?Po(n?.in||e,NaN):(r.setFullYear(t),r)}function V_(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Q_(e,t,n){return N_(e,-t,n)}var z_="undefined"!=typeof document?e.useLayoutEffect:function(){};const U_={...t}.useInsertionEffect||(e=>e());function W_(){return"undefined"!=typeof window}function H_(e){return Y_(e)?(e.nodeName||"").toLowerCase():"#document"}function $_(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function G_(e){var t;return null==(t=(Y_(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Y_(e){return!!W_()&&(e instanceof Node||e instanceof $_(e).Node)}function K_(e){return!!W_()&&(e instanceof Element||e instanceof $_(e).Element)}function X_(e){return!!W_()&&(e instanceof HTMLElement||e instanceof $_(e).HTMLElement)}function J_(e){return!(!W_()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof $_(e).ShadowRoot)}const Z_=new Set(["inline","contents"]);function eO(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=pO(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Z_.has(o)}const tO=new Set(["table","td","th"]);function nO(e){return tO.has(H_(e))}const rO=[":popover-open",":modal"];function oO(e){return rO.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const iO=["transform","translate","scale","rotate","perspective"],aO=["transform","translate","scale","rotate","perspective","filter"],sO=["paint","layout","strict","content"];function lO(e){const t=uO(),n=K_(e)?pO(e):e;return iO.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||aO.some(e=>(n.willChange||"").includes(e))||sO.some(e=>(n.contain||"").includes(e))}function uO(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const cO=new Set(["html","body","#document"]);function dO(e){return cO.has(H_(e))}function pO(e){return $_(e).getComputedStyle(e)}function fO(e){return K_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mO(e){if("html"===H_(e))return e;const t=e.assignedSlot||e.parentNode||J_(e)&&e.host||G_(e);return J_(t)?t.host:t}function hO(e){const t=mO(e);return dO(t)?e.ownerDocument?e.ownerDocument.body:e.body:X_(t)&&eO(t)?t:hO(t)}function vO(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=hO(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=$_(o);if(i){const e=yO(a);return t.concat(a,a.visualViewport||[],eO(o)?o:[],e&&n?vO(e):[])}return t.concat(o,vO(o,[],n))}function yO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const gO=Math.min,bO=Math.max,AO=Math.round,wO=Math.floor,kO=e=>({x:e,y:e}),EO={left:"right",right:"left",bottom:"top",top:"bottom"},CO={start:"end",end:"start"};function xO(e,t){return"function"==typeof e?e(t):e}function SO(e){return e.split("-")[0]}function _O(e){return e.split("-")[1]}function OO(e){return"y"===e?"height":"width"}const IO=new Set(["top","bottom"]);function TO(e){return IO.has(SO(e))?"y":"x"}function PO(e){return"x"===TO(e)?"y":"x"}function BO(e){return e.replace(/start|end/g,e=>CO[e])}const DO=["left","right"],jO=["right","left"],RO=["top","bottom"],MO=["bottom","top"];function LO(e){return e.replace(/left|right|bottom|top/g,e=>EO[e])}function NO(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function FO(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function qO(e,t,n){let{reference:r,floating:o}=e;const i=TO(t),a=PO(t),s=OO(a),l=SO(t),u="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(_O(t)){case"start":f[a]-=p*(n&&u?-1:1);break;case"end":f[a]+=p*(n&&u?-1:1)}return f}const VO=new Set(["left","top"]);function QO(e){const t=pO(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=X_(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=AO(n)!==i||AO(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function zO(e){return K_(e)?e:e.contextElement}function UO(e){const t=zO(e);if(!X_(t))return kO(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=QO(t);let a=(i?AO(n.width):n.width)/r,s=(i?AO(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const WO=kO(0);function HO(e){const t=$_(e);return uO()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:WO}function $O(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=zO(e);let a=kO(1);t&&(r?K_(r)&&(a=UO(r)):a=UO(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==$_(e))&&t}(i,n,r)?HO(i):kO(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=$_(i),t=r&&K_(r)?$_(r):r;let n=e,o=yO(n);for(;o&&r&&t!==n;){const e=UO(o),t=o.getBoundingClientRect(),r=pO(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=$_(o),o=yO(n)}}return FO({width:c,height:d,x:l,y:u})}function GO(e,t){const n=fO(e).scrollLeft;return t?t.left+n:$O(G_(e)).left+n}function YO(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:GO(e,r)),y:r.top+t.scrollTop}}const KO=new Set(["absolute","fixed"]);function XO(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=$_(e),r=G_(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=uO();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=G_(e),n=fO(e),r=e.ownerDocument.body,o=bO(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=bO(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+GO(e);const s=-n.scrollTop;return"rtl"===pO(r).direction&&(a+=bO(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(G_(e));else if(K_(t))r=function(e,t){const n=$O(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=X_(e)?UO(e):kO(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=HO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return FO(r)}function JO(e,t){const n=mO(e);return!(n===t||!K_(n)||dO(n))&&("fixed"===pO(n).position||JO(n,t))}function ZO(e,t,n){const r=X_(t),o=G_(t),i="fixed"===n,a=$O(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=kO(0);function u(){l.x=GO(o)}if(r||!r&&!i)if(("body"!==H_(t)||eO(o))&&(s=fO(t)),r){const e=$O(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=!o||r||i?kO(0):YO(o,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function eI(e){return"static"===pO(e).position}function tI(e,t){if(!X_(e)||"fixed"===pO(e).position)return null;if(t)return t(e);let n=e.offsetParent;return G_(e)===n&&(n=n.ownerDocument.body),n}function nI(e,t){const n=$_(e);if(oO(e))return n;if(!X_(e)){let t=mO(e);for(;t&&!dO(t);){if(K_(t)&&!eI(t))return t;t=mO(t)}return n}let r=tI(e,t);for(;r&&nO(r)&&eI(r);)r=tI(r,t);return r&&dO(r)&&eI(r)&&!lO(r)?n:r||function(e){let t=mO(e);for(;X_(t)&&!dO(t);){if(lO(t))return t;if(oO(t))return null;t=mO(t)}return null}(e)||n}const rI={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=G_(r),s=!!t&&oO(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=kO(1);const c=kO(0),d=X_(r);if((d||!d&&!i)&&(("body"!==H_(r)||eO(a))&&(l=fO(r)),X_(r))){const e=$O(r);u=UO(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const p=!a||d||i?kO(0):YO(a,l,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}},getDocumentElement:G_,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?oO(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=vO(e,[],!1).filter(e=>K_(e)&&"body"!==H_(e)),o=null;const i="fixed"===pO(e).position;let a=i?mO(e):e;for(;K_(a)&&!dO(a);){const t=pO(a),n=lO(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&KO.has(o.position)||eO(a)&&!n&&JO(e,a))?r=r.filter(e=>e!==a):o=t,a=mO(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=XO(t,n,o);return e.top=bO(r.top,e.top),e.right=gO(r.right,e.right),e.bottom=gO(r.bottom,e.bottom),e.left=bO(r.left,e.left),e},XO(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:nI,getElementRects:async function(e){const t=this.getOffsetParent||nI,n=this.getDimensions,r=await n(e.floating);return{reference:ZO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=QO(e);return{width:t,height:n}},getScale:UO,isElement:K_,isRTL:function(e){return"rtl"===pO(e).direction}};function oI(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iI(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=zO(e),c=o||i?[...u?vO(u):[],...vO(t)]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=G_(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=u;if(s||t(),!p||!f)return;const m={rootMargin:-wO(d)+"px "+-wO(o.clientWidth-(c+p))+"px "+-wO(o.clientHeight-(d+f))+"px "+-wO(c)+"px",threshold:bO(0,gO(1,l))||1};let h=!0;function v(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||oI(u,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(v,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,m)}r.observe(e)}(!0),i}(u,n):null;let p,f=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let h=l?$O(e):null;return l&&function t(){const r=$O(e);h&&!oI(h,r)&&n(),h=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const aI=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=SO(n),s=_O(n),l="y"===TO(n),u=VO.has(a)?-1:1,c=i&&l?-1:1,d=xO(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(f="end"===s?-1*m:m),l?{x:f*c,y:p*u}:{x:p*u,y:f*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},sI=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=xO(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=SO(o),g=TO(s),b=SO(s)===s,A=await(null==l.isRTL?void 0:l.isRTL(u.floating)),w=p||(b||!h?[LO(s)]:function(e){const t=LO(e);return[BO(e),t,BO(t)]}(s)),k="none"!==m;!p&&k&&w.push(...function(e,t,n,r){const o=_O(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?jO:DO:t?DO:jO;case"left":case"right":return t?RO:MO;default:return[]}}(SO(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(BO)))),i}(s,h,m,A));const E=[s,...w],C=await async function(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=xO(t,e),m=NO(f),h=s[p?"floating"===d?"reference":"floating":d],v=FO(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},A=FO(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-A.top+m.top)/b.y,bottom:(A.bottom-v.bottom+m.bottom)/b.y,left:(v.left-A.left+m.left)/b.x,right:(A.right-v.right+m.right)/b.x}}(t,v),x=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&x.push(C[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=_O(e),o=PO(e),i=OO(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=LO(a)),[a,LO(a)]}(o,a,A);x.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:x}],!x.every(e=>e<=0)){var _,O;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=E[e];if(t&&("alignment"!==d||g===TO(t)||S.every(e=>e.overflows[0]>0&&TO(e.placement)===g)))return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(O=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!n)switch(f){case"bestFit":{var I;const e=null==(I=S.filter(e=>{if(k){const t=TO(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},lI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=xO(e,t)||{};if(null==u)return{};const d=NO(c),p={x:n,y:r},f=PO(o),m=OO(f),h=await a.getDimensions(u),v="y"===f,y=v?"top":"left",g=v?"bottom":"right",b=v?"clientHeight":"clientWidth",A=i.reference[m]+i.reference[f]-p[f]-i.floating[m],w=p[f]-i.reference[f],k=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let E=k?k[b]:0;E&&await(null==a.isElement?void 0:a.isElement(k))||(E=s.floating[b]||i.floating[m]);const C=A/2-w/2,x=E/2-h[m]/2-1,S=gO(d[y],x),_=gO(d[g],x),O=S,I=E-h[m]-_,T=E/2-h[m]/2+C,P=function(e,t,n){return bO(e,gO(t,n))}(O,T,I),B=!l.arrow&&null!=_O(o)&&T!==P&&i.reference[m]/2-(T<O?S:_)-h[m]/2<0,D=B?T<O?T-O:T-I:0;return{[f]:p[f]+D,data:{[f]:P,centerOffset:T-P-D,...B&&{alignmentOffset:D}},reset:B}}}),uI=(e,t,n)=>{const r=new Map,o={platform:rI,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=qO(u,r,l),p=r,f={},m=0;for(let n=0;n<s.length;n++){const{name:i,fn:h}=s[n],{x:v,y,data:g,reset:b}=await h({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:a,elements:{reference:e,floating:t}});c=null!=v?v:c,d=null!=y?y:d,f={...f,[i]:{...f[i],...g}},b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:d}=qO(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};var cI="undefined"!=typeof document?e.useLayoutEffect:function(){};function dI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!dI(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||dI(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function pI(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fI(e,t){const n=pI(e);return Math.round(t*n)/n}function mI(t){const n=e.useRef(t);return cI(()=>{n.current=t}),n}const hI=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?lI({element:n.current,padding:r}).fn(t):{}:n?lI({element:n,padding:r}).fn(t):{};var o}}),vI=(e,t)=>({...aI(e),options:[e,t]}),yI=(e,t)=>({...hI(e),options:[e,t]}),gI={...t};let bI=!1,AI=0;const wI=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+AI++,kI=gI.useId||function(){const[t,n]=e.useState(()=>bI?wI():void 0);return z_(()=>{null==t&&n(wI())},[]),e.useEffect(()=>{bI=!0},[]),t},EI=e.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:a}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:d,stroke:p,d:f,style:{transform:m,...h}={},...v}=t,y=kI(),[g,b]=e.useState(!1);if(z_(()=>{o&&"rtl"===pO(o).direction&&b(!0)},[o]),!o)return null;const[A,w]=r.split("-"),k="top"===A||"bottom"===A;let E=d;(k&&null!=a&&a.x||!k&&null!=a&&a.y)&&(E=null);const C=2*c,x=C/2,S=s/2*(u/-8+1),_=l/2*u/4,O=!!f,I=E&&"end"===w?"bottom":"top";let T=E&&"end"===w?"right":"left";E&&g&&(T="end"===w?"left":"right");const P=null!=(null==i?void 0:i.x)?E||i.x:"",B=null!=(null==i?void 0:i.y)?E||i.y:"",D=f||"M0,0 H"+s+" L"+(s-S)+","+(l-_)+" Q"+s/2+","+l+" "+S+","+(l-_)+" Z",j={top:O?"rotate(180deg)":"",left:O?"rotate(90deg)":"rotate(-90deg)",bottom:O?"":"rotate(180deg)",right:O?"rotate(-90deg)":"rotate(90deg)"}[A];return(0,jv.jsxs)("svg",{...v,"aria-hidden":!0,ref:n,width:O?s:s+C,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[T]:P,[I]:B,[A]:k||O?"100%":"calc(100% - "+C/2+"px)",transform:[j,m].filter(e=>!!e).join(" "),...h},children:[C>0&&(0,jv.jsx)("path",{clipPath:"url(#"+y+")",fill:"none",stroke:p,strokeWidth:C+(f?0:1),d:D}),(0,jv.jsx)("path",{stroke:C&&!f?v.fill:"none",d:D}),(0,jv.jsx)("clipPath",{id:y,children:(0,jv.jsx)("rect",{x:-x,y:x*(O?-1:1),width:s+C,height:s})})]})});const CI=e.createContext(null),xI=e.createContext(null);function SI(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=kI(),a=e.useRef({}),[s]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}()),l=null!=((null==(u=e.useContext(CI))?void 0:u.id)||null);var u;const[c,d]=e.useState(o.reference),p=function(t){const n=e.useRef(()=>{});return U_(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)},[])}((e,t,n)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==r||r(e,t,n)}),f=e.useMemo(()=>({setPositionReference:d}),[]),m=e.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return e.useMemo(()=>({dataRef:a,open:n,onOpenChange:p,elements:m,events:s,floatingId:i,refs:f}),[n,p,m,s,i,f])}function _I(t){void 0===t&&(t={});const{nodeId:n}=t,r=SI({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[a,s]=e.useState(null),[l,u]=e.useState(null),c=(null==i?void 0:i.domReference)||a,d=e.useRef(null),p=e.useContext(xI);z_(()=>{c&&(d.current=c)},[c]);const f=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:c}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,m]=e.useState(o);dI(f,o)||m(o);const[h,v]=e.useState(null),[y,g]=e.useState(null),b=e.useCallback(e=>{e!==E.current&&(E.current=e,v(e))},[]),A=e.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),w=a||h,k=s||y,E=e.useRef(null),C=e.useRef(null),x=e.useRef(d),S=null!=u,_=mI(u),O=mI(i),I=mI(c),T=e.useCallback(()=>{if(!E.current||!C.current)return;const e={placement:n,strategy:r,middleware:f};O.current&&(e.platform=O.current),uI(E.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==I.current};P.current&&!dI(x.current,t)&&(x.current=t,Jg.flushSync(()=>{p(t)}))})},[f,n,r,O,I]);cI(()=>{!1===c&&x.current.isPositioned&&(x.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[c]);const P=e.useRef(!1);cI(()=>(P.current=!0,()=>{P.current=!1}),[]),cI(()=>{if(w&&(E.current=w),k&&(C.current=k),w&&k){if(_.current)return _.current(w,k,T);T()}},[w,k,T,_,S]);const B=e.useMemo(()=>({reference:E,floating:C,setReference:b,setFloating:A}),[b,A]),D=e.useMemo(()=>({reference:w,floating:k}),[w,k]),j=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=fI(D.floating,d.x),n=fI(D.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...pI(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,D.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:T,refs:B,elements:D,floatingStyles:j}),[d,T,B,D,j])}({...t,elements:{...i,...l&&{reference:l}}}),m=e.useCallback(e=>{const t=K_(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),f.refs.setReference(t)},[f.refs]),h=e.useCallback(e=>{(K_(e)||null===e)&&(d.current=e,s(e)),(K_(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!K_(e))&&f.refs.setReference(e)},[f.refs]),v=e.useMemo(()=>({...f.refs,setReference:h,setPositionReference:m,domReference:d}),[f.refs,h,m]),y=e.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),g=e.useMemo(()=>({...f,...o,refs:v,elements:y,nodeId:n}),[f,v,y,n,o]);return z_(()=>{o.dataRef.current.floatingContext=g;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===n);e&&(e.context=g)}),e.useMemo(()=>({...f,context:g,refs:v,elements:y}),[f,v,y,g])}var OI=function(e,t){return OI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},OI(e,t)};function II(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}OI(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var TI=function(){return TI=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},TI.apply(this,arguments)};function PI(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var BI,DI=function(e){var t=e.showTimeSelectOnly,r=void 0!==t&&t,o=e.showTime,i=void 0!==o&&o,a=e.className,s=e.children,l=r?"Choose Time":"Choose Date".concat(i?" and Time":"");return n().createElement("div",{className:a,role:"dialog","aria-label":l,"aria-modal":"true"},s)},jI=function(t){var r=t.children,o=t.onClickOutside,i=t.className,a=t.containerRef,s=t.style,l=function(t,n){var r=(0,e.useRef)(null),o=(0,e.useRef)(t);o.current=t;var i=(0,e.useCallback)(function(e){var t,i=e.composed&&e.composedPath&&e.composedPath().find(function(e){return e instanceof Node})||e.target;r.current&&!r.current.contains(i)&&(n&&i instanceof HTMLElement&&i.classList.contains(n)||null===(t=o.current)||void 0===t||t.call(o,e))},[n]);return(0,e.useEffect)(function(){return document.addEventListener("mousedown",i),function(){document.removeEventListener("mousedown",i)}},[i]),r}(o,t.ignoreClass);return n().createElement("div",{className:i,style:s,ref:function(e){l.current=e,a&&(a.current=e)}},r)};function RI(){return"undefined"!=typeof window?window:globalThis}function MI(e){if(null==e)return new Date;var t="string"==typeof e?function(e,t){const n=()=>Po(t?.in,NaN),r=t?.additionalDigits??2,o=function(e){const t={},n=e.split(YS.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],YS.timeZoneDelimiter.test(t.date)&&(t.date=e.split(YS.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const e=YS.timezone.exec(r);e?(t.time=r.replace(e[1],""),t.timezone=e[1]):t.time=r}return t}(e);let i;if(o.date){const e=function(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(o.date,r);i=function(e,t){if(null===t)return new Date(NaN);const n=e.match(KS);if(!n)return new Date(NaN);const r=!!n[4],o=ZS(n[1]),i=ZS(n[2])-1,a=ZS(n[3]),s=ZS(n[4]),l=ZS(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=7*(t-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}(t,s,l):new Date(NaN);{const e=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(t_[t]||(n_(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(n_(e)?366:365)}(t,o)?(e.setUTCFullYear(t,i,Math.max(o,a)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!i||isNaN(+i))return n();const a=+i;let s,l=0;if(o.time&&(l=function(e){const t=e.match(XS);if(!t)return NaN;const n=e_(t[1]),r=e_(t[2]),o=e_(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?n*Io+r*Oo+1e3*o:NaN}(o.time),isNaN(l)))return n();if(!o.timezone){const e=new Date(a+l),n=Bo(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return s=function(e){if("Z"===e)return 0;const t=e.match(JS);if(!t)return 0;const n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(r*Io+o*Oo):NaN}(o.timezone),isNaN(s)?n():Bo(a+l+s,t?.in)}(e):Bo(e);return NI(t)?t:new Date}function LI(e,t,n,r,o){void 0===o&&(o=MI());for(var i=nT(n)||nT(tT()),a=0,s=Array.isArray(t)?t:[t];a<s.length;a++){var l=s[a],u=ra(e,l,o,{locale:i,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});if(NI(u)&&(!r||e===FI(u,l,n)))return u}return null}function NI(e,t){return Do(e)&&!r_(e,new Date("1/1/1800"))}function FI(e,t,n){if("en"===n)return Aa(e,t,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var r=n?nT(n):void 0;return n&&!r&&console.warn('A locale object was not found for the provided string ["'.concat(n,'"].')),Aa(e,t,{locale:r=r||nT(tT()),useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function qI(e,t){var n=t.dateFormat,r=t.locale,o=Array.isArray(n)&&n.length>0?n[0]:n;return e&&FI(e,o,r)||""}function VI(e,t){var n=t.hour,r=void 0===n?0:n,o=t.minute,i=void 0===o?0:o,a=t.second;return o_(i_(a_(e,void 0===a?0:a),i),r)}function QI(e){return aa(e)}function zI(e,t,n){return Ni(e,{locale:nT(t||tT()),weekStartsOn:n})}function UI(e){return s_(e)}function WI(e){return la(e)}function HI(e){return l_(e)}function $I(){return aa(MI())}function GI(e){return u_(e)}function YI(e,t){return e&&t?function(e,t,n){const[r,o]=ia(n?.in,e,t);return r.getFullYear()===o.getFullYear()}(e,t):!e&&!t}function KI(e,t){return e&&t?function(e,t,n){const[r,o]=ia(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}(e,t):!e&&!t}function XI(e,t){return e&&t?function(e,t,n){const[r,o]=ia(n?.in,e,t);return+l_(r)===+l_(o)}(e,t):!e&&!t}function JI(e,t){return e&&t?function(e,t,n){const[r,o]=ia(n?.in,e,t);return+aa(r)===+aa(o)}(e,t):!e&&!t}function ZI(e,t){return e&&t?(n=t,+Bo(e)===+Bo(n)):!e&&!t;var n}function eT(e,t,n){var r,o=aa(t),i=u_(n);try{r=d_(e,{start:o,end:i})}catch(e){r=!1}return r}function tT(){return RI().__localeId__}function nT(e){if("string"==typeof e){var t=RI();return t.__localeData__?t.__localeData__[e]:void 0}return e}function rT(e,t){return FI(p_(MI(),e),"LLLL",t)}function oT(e,t){return FI(p_(MI(),e),"LLL",t)}function iT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.excludeDateIntervals,s=n.includeDates,l=n.includeDateIntervals,u=n.filterDate;return mT(e,{minDate:r,maxDate:o})||i&&i.some(function(t){return t instanceof Date?JI(e,t):JI(e,t.date)})||a&&a.some(function(t){var n=t.start,r=t.end;return d_(e,{start:n,end:r})})||s&&!s.some(function(t){return JI(e,t)})||l&&!l.some(function(t){var n=t.start,r=t.end;return d_(e,{start:n,end:r})})||u&&!u(MI(e))||!1}function aT(e,t){var n=void 0===t?{}:t,r=n.excludeDates,o=n.excludeDateIntervals;return o&&o.length>0?o.some(function(t){var n=t.start,r=t.end;return d_(e,{start:n,end:r})}):r&&r.some(function(t){var n;return t instanceof Date?JI(e,t):JI(e,null!==(n=t.date)&&void 0!==n?n:new Date)})||!1}function sT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;return mT(e,{minDate:r?s_(r):void 0,maxDate:o?c_(o):void 0})||(null==i?void 0:i.some(function(t){return KI(e,t instanceof Date?t:t.date)}))||a&&!a.some(function(t){return KI(e,t)})||s&&!s(MI(e))||!1}function lT(e,t,n,r){var o=m_(e),i=h_(e),a=m_(t),s=h_(t),l=m_(r);return o===a&&o===l?i<=n&&n<=s:o<a&&(l===o&&i<=n||l===a&&s>=n||l<a&&l>o)}function uT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates;return mT(e,{minDate:r,maxDate:o})||i&&i.some(function(t){return KI(t instanceof Date?t:t.date,e)})||a&&!a.some(function(t){return KI(t,e)})||!1}function cT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;return mT(e,{minDate:r,maxDate:o})||(null==i?void 0:i.some(function(t){return XI(e,t instanceof Date?t:t.date)}))||a&&!a.some(function(t){return XI(e,t)})||s&&!s(MI(e))||!1}function dT(e,t,n){if(!t||!n)return!1;if(!Do(t)||!Do(n))return!1;var r=m_(t),o=m_(n);return r<=e&&o>=e}function pT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate,l=new Date(e,0,1);return mT(l,{minDate:r?la(r):void 0,maxDate:o?v_(o):void 0})||(null==i?void 0:i.some(function(e){return YI(l,e instanceof Date?e:e.date)}))||a&&!a.some(function(e){return YI(l,e)})||s&&!s(MI(l))||!1}function fT(e,t,n,r){var o=m_(e),i=y_(e),a=m_(t),s=y_(t),l=m_(r);return o===a&&o===l?i<=n&&n<=s:o<a&&(l===o&&i<=n||l===a&&s>=n||l<a&&l>o)}function mT(e,t){var n,r=void 0===t?{}:t,o=r.minDate,i=r.maxDate;return null!==(n=o&&sa(e,o)<0||i&&sa(e,i)>0)&&void 0!==n&&n}function hT(e,t){return t.some(function(t){return g_(t)===g_(e)&&b_(t)===b_(e)&&A_(t)===A_(e)})}function vT(e,t){var n=void 0===t?{}:t,r=n.excludeTimes,o=n.includeTimes,i=n.filterTime;return r&&hT(e,r)||o&&!hT(e,o)||i&&!i(e)||!1}function yT(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var o=MI();o=a_(o=i_(o=o_(o,g_(e)),b_(e)),A_(e));var i=MI();i=a_(i=i_(i=o_(i,g_(n)),b_(n)),A_(n));var a,s=MI();s=a_(s=i_(s=o_(s,g_(r)),b_(r)),A_(r));try{a=!d_(o,{start:i,end:s})}catch(e){a=!1}return a}function gT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=k_(e,1);return r&&E_(r,i)>0||o&&o.every(function(e){return E_(e,i)>0})||!1}function bT(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=w_(e,1);return r&&E_(i,r)>0||o&&o.every(function(e){return E_(i,e)>0})||!1}function AT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=O_(e,1);return r&&I_(r,i)>0||o&&o.every(function(e){return I_(e,i)>0})||!1}function wT(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=__(e,1);return r&&I_(i,r)>0||o&&o.every(function(e){return I_(i,e)>0})||!1}function kT(e){var t=e.minDate,n=e.includeDates;return n&&t?T_(n.filter(function(e){return sa(e,t)>=0})):n?T_(n):t}function ET(e){var t=e.maxDate,n=e.includeDates;return n&&t?P_(n.filter(function(e){return sa(e,t)<=0})):n?P_(n):t}function CT(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t="react-datepicker__day--highlighted");for(var r=new Map,o=0,i=e.length;o<i;o++){var a=e[o];if(So(a)){var s=FI(a,"MM.dd.yyyy");(p=r.get(s)||[]).includes(t)||(p.push(t),r.set(s,p))}else if("object"==typeof a){var l=null!==(n=Object.keys(a)[0])&&void 0!==n?n:"",u=a[l];if("string"==typeof l&&Array.isArray(u))for(var c=0,d=u.length;c<d;c++){var p,f=u[c];if(f)s=FI(f,"MM.dd.yyyy"),(p=r.get(s)||[]).includes(l)||(p.push(l),r.set(s,p))}}}return r}function xT(e,t){void 0===e&&(e=[]),void 0===t&&(t="react-datepicker__day--holidays");var n=new Map;return e.forEach(function(e){var r=e.date,o=e.holidayName;if(So(r)){var i=FI(r,"MM.dd.yyyy"),a=n.get(i)||{className:"",holidayNames:[]};if(!("className"in a)||a.className!==t||(s=a.holidayNames,l=[o],s.length!==l.length||!s.every(function(e,t){return e===l[t]}))){var s,l;a.className=t;var u=a.holidayNames;a.holidayNames=u?PI(PI([],u,!0),[o],!1):[o],n.set(i,a)}}}),n}function ST(e,t,n,r,o){for(var i=o.length,a=[],s=0;s<i;s++){var l=e,u=o[s];u&&(l=R_(l=j_(l=D_(l,g_(u)),b_(u)),A_(u)));var c=j_(e,(n+1)*r);M_(l,t)&&r_(l,c)&&null!=u&&a.push(u)}return a}function _T(e){return e<10?"0".concat(e):"".concat(e)}function OT(e,t){void 0===t&&(t=12);var n=Math.ceil(m_(e)/t)*t;return{startPeriod:n-(t-1),endPeriod:n}}function IT(e){var t=e.getSeconds(),n=e.getMilliseconds();return Bo(e.getTime()-1e3*t-n)}function TT(e){if(!So(e))throw new Error("Invalid date");var t=new Date(e);return t.setHours(0,0,0,0),t}function PT(e,t){if(!So(e)||!So(t))throw new Error("Invalid date received");return r_(TT(e),TT(t))}function BT(e){return e.key===BI.Space}!function(e){e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.PageUp="PageUp",e.PageDown="PageDown",e.Home="Home",e.End="End",e.Enter="Enter",e.Space=" ",e.Tab="Tab",e.Escape="Escape",e.Backspace="Backspace",e.X="x"}(BI||(BI={}));var DT,jT=function(t){function r(r){var o=t.call(this,r)||this;return o.inputRef=n().createRef(),o.onTimeChange=function(e){var t,n;o.setState({time:e});var r=o.props.date,i=r instanceof Date&&!isNaN(+r)?r:new Date;if(null==e?void 0:e.includes(":")){var a=e.split(":"),s=a[0],l=a[1];i.setHours(Number(s)),i.setMinutes(Number(l))}null===(n=(t=o.props).onChange)||void 0===n||n.call(t,i)},o.renderTimeInput=function(){var t=o.state.time,r=o.props,i=r.date,a=r.timeString,s=r.customTimeInput;return s?(0,e.cloneElement)(s,{date:i,value:t,onChange:o.onTimeChange}):n().createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:o.inputRef,onClick:function(){var e;null===(e=o.inputRef.current)||void 0===e||e.focus()},required:!0,value:t,onChange:function(e){o.onTimeChange(e.target.value||a)}})},o.state={time:o.props.timeString},o}return II(r,t),r.getDerivedStateFromProps=function(e,t){return e.timeString!==t.time?{time:e.timeString}:null},r.prototype.render=function(){return n().createElement("div",{className:"react-datepicker__input-time-container"},n().createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),n().createElement("div",{className:"react-datepicker-time__input-container"},n().createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},r}(e.Component),RT=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.dayEl=(0,e.createRef)(),r.handleClick=function(e){!r.isDisabled()&&r.props.onClick&&r.props.onClick(e)},r.handleMouseEnter=function(e){!r.isDisabled()&&r.props.onMouseEnter&&r.props.onMouseEnter(e)},r.handleOnKeyDown=function(e){var t,n;e.key===BI.Space&&(e.preventDefault(),e.key=BI.Enter),null===(n=(t=r.props).handleOnKeyDown)||void 0===n||n.call(t,e)},r.isSameDay=function(e){return JI(r.props.day,e)},r.isKeyboardSelected=function(){var e;if(r.props.disabledKeyboardNavigation)return!1;var t=r.props.selectsMultiple?null===(e=r.props.selectedDates)||void 0===e?void 0:e.some(function(e){return r.isSameDayOrWeek(e)}):r.isSameDayOrWeek(r.props.selected),n=r.props.preSelection&&r.isDisabled(r.props.preSelection);return!t&&r.isSameDayOrWeek(r.props.preSelection)&&!n},r.isDisabled=function(e){return void 0===e&&(e=r.props.day),iT(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(){return aT(r.props.day,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.isStartOfWeek=function(){return JI(r.props.day,zI(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameWeek=function(e){return r.props.showWeekPicker&&JI(e,zI(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameDayOrWeek=function(e){return r.isSameDay(e)||r.isSameWeek(e)},r.getHighLightedClass=function(){var e=r.props,t=e.day,n=e.highlightDates;if(!n)return!1;var o=FI(t,"MM.dd.yyyy");return n.get(o)},r.getHolidaysClass=function(){var e,t=r.props,n=t.day,o=t.holidays;if(!o)return[void 0];var i=FI(n,"MM.dd.yyyy");return o.has(i)?[null===(e=o.get(i))||void 0===e?void 0:e.className]:[void 0]},r.isInRange=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&eT(t,n,o)},r.isInSelectingRange=function(){var e,t=r.props,n=t.day,o=t.selectsStart,i=t.selectsEnd,a=t.selectsRange,s=t.selectsDisabledDaysInRange,l=t.startDate,u=t.endDate,c=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return!(!(o||i||a)||!c||!s&&r.isDisabled())&&(o&&u&&(r_(c,u)||ZI(c,u))?eT(n,c,u):(i&&l&&(M_(c,l)||ZI(c,l))||!(!a||!l||u||!M_(c,l)&&!ZI(c,l)))&&eT(n,l,c))},r.isSelectingRangeStart=function(){var e;if(!r.isInSelectingRange())return!1;var t=r.props,n=t.day,o=t.startDate,i=t.selectsStart,a=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return JI(n,i?a:o)},r.isSelectingRangeEnd=function(){var e;if(!r.isInSelectingRange())return!1;var t=r.props,n=t.day,o=t.endDate,i=t.selectsEnd,a=t.selectsRange,s=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return JI(n,i||a?s:o)},r.isRangeStart=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&JI(n,t)},r.isRangeEnd=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&JI(o,t)},r.isWeekend=function(){var e,t=Bo(r.props.day,e?.in).getDay();return 0===t||6===t},r.isAfterMonth=function(){return void 0!==r.props.month&&(r.props.month+1)%12===h_(r.props.day)},r.isBeforeMonth=function(){return void 0!==r.props.month&&(h_(r.props.day)+1)%12===r.props.month},r.isCurrentDay=function(){return r.isSameDay(MI())},r.isSelected=function(){var e;return r.props.selectsMultiple?null===(e=r.props.selectedDates)||void 0===e?void 0:e.some(function(e){return r.isSameDayOrWeek(e)}):r.isSameDayOrWeek(r.props.selected)},r.getClassNames=function(e){return Ud("react-datepicker__day",r.props.dayClassName?r.props.dayClassName(e):void 0,"react-datepicker__day--"+FI(r.props.day,"ddd",undefined),{"react-datepicker__day--disabled":r.isDisabled(),"react-datepicker__day--excluded":r.isExcluded(),"react-datepicker__day--selected":r.isSelected(),"react-datepicker__day--keyboard-selected":r.isKeyboardSelected(),"react-datepicker__day--range-start":r.isRangeStart(),"react-datepicker__day--range-end":r.isRangeEnd(),"react-datepicker__day--in-range":r.isInRange(),"react-datepicker__day--in-selecting-range":r.isInSelectingRange(),"react-datepicker__day--selecting-range-start":r.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":r.isSelectingRangeEnd(),"react-datepicker__day--today":r.isCurrentDay(),"react-datepicker__day--weekend":r.isWeekend(),"react-datepicker__day--outside-month":r.isAfterMonth()||r.isBeforeMonth()},r.getHighLightedClass(),r.getHolidaysClass())},r.getAriaLabel=function(){var e=r.props,t=e.day,n=e.ariaLabelPrefixWhenEnabled,o=void 0===n?"Choose":n,i=e.ariaLabelPrefixWhenDisabled,a=void 0===i?"Not available":i,s=r.isDisabled()||r.isExcluded()?a:o;return"".concat(s," ").concat(FI(t,"PPPP",r.props.locale))},r.getTitle=function(){var e=r.props,t=e.day,n=e.holidays,o=void 0===n?new Map:n,i=e.excludeDates,a=FI(t,"MM.dd.yyyy"),s=[];return o.has(a)&&s.push.apply(s,o.get(a).holidayNames),r.isExcluded()&&s.push(null==i?void 0:i.filter(function(e){return e instanceof Date?JI(e,t):JI(null==e?void 0:e.date,t)}).map(function(e){if(!(e instanceof Date))return null==e?void 0:e.message})),s.join(", ")},r.getTabIndex=function(){var e=r.props.selected,t=r.props.preSelection;return(!r.props.showWeekPicker||!r.props.showWeekNumber&&r.isStartOfWeek())&&(r.isKeyboardSelected()||r.isSameDay(e)&&JI(t,e))?0:-1},r.handleFocusDay=function(){var e;r.shouldFocusDay()&&(null===(e=r.dayEl.current)||void 0===e||e.focus({preventScroll:!0}))},r.renderDayContents=function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(L_(r.props.day),r.props.day):L_(r.props.day)},r.render=function(){return n().createElement("div",{ref:r.dayEl,className:r.getClassNames(r.props.day),onKeyDown:r.handleOnKeyDown,onClick:r.handleClick,onMouseEnter:r.props.usePointerEvent?void 0:r.handleMouseEnter,onPointerEnter:r.props.usePointerEvent?r.handleMouseEnter:void 0,tabIndex:r.getTabIndex(),"aria-label":r.getAriaLabel(),role:"option",title:r.getTitle(),"aria-disabled":r.isDisabled(),"aria-current":r.isCurrentDay()?"date":void 0,"aria-selected":r.isSelected()||r.isInRange()},r.renderDayContents(),""!==r.getTitle()&&n().createElement("span",{className:"overlay"},r.getTitle()))},r}return II(r,t),r.prototype.componentDidMount=function(){this.handleFocusDay()},r.prototype.componentDidUpdate=function(){this.handleFocusDay()},r.prototype.shouldFocusDay=function(){var e=!1;return 0===this.getTabIndex()&&this.isSameDay(this.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(e=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(e=!1),this.isDayActiveElement()&&(e=!0),this.isDuplicateDay()&&(e=!1)),e},r.prototype.isDayActiveElement=function(){var e,t,n;return(null===(t=null===(e=this.props.containerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.contains(document.activeElement))&&(null===(n=document.activeElement)||void 0===n?void 0:n.classList.contains("react-datepicker__day"))},r.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},r}(e.Component),MT=function(t){function r(){var n=null!==t&&t.apply(this,arguments)||this;return n.weekNumberEl=(0,e.createRef)(),n.handleClick=function(e){n.props.onClick&&n.props.onClick(e)},n.handleOnKeyDown=function(e){var t,r;e.key===BI.Space&&(e.preventDefault(),e.key=BI.Enter),null===(r=(t=n.props).handleOnKeyDown)||void 0===r||r.call(t,e)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!JI(n.props.date,n.props.selected)&&JI(n.props.date,n.props.preSelection)},n.getTabIndex=function(){return n.props.showWeekPicker&&n.props.showWeekNumber&&(n.isKeyboardSelected()||JI(n.props.date,n.props.selected)&&JI(n.props.preSelection,n.props.selected))?0:-1},n.handleFocusWeekNumber=function(e){var t=!1;0===n.getTabIndex()&&!(null==e?void 0:e.isInputFocused)&&JI(n.props.date,n.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(t=!0),n.props.inline&&!n.props.shouldFocusDayInline&&(t=!1),n.props.containerRef&&n.props.containerRef.current&&n.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(t=!0)),t&&n.weekNumberEl.current&&n.weekNumberEl.current.focus({preventScroll:!0})},n}return II(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},r.prototype.componentDidUpdate=function(e){this.handleFocusWeekNumber(e)},r.prototype.render=function(){var e=this.props,t=e.weekNumber,o=e.isWeekDisabled,i=e.ariaLabelPrefix,a=void 0===i?r.defaultProps.ariaLabelPrefix:i,s=e.onClick,l={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!s&&!o,"react-datepicker__week-number--selected":!!s&&JI(this.props.date,this.props.selected)};return n().createElement("div",{ref:this.weekNumberEl,className:Ud(l),"aria-label":"".concat(a," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex()},t)},r}(e.Component),LT=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.isDisabled=function(e){return iT(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.handleDayClick=function(e,t){r.props.onDayClick&&r.props.onDayClick(e,t)},r.handleDayMouseEnter=function(e){r.props.onDayMouseEnter&&r.props.onDayMouseEnter(e)},r.handleWeekClick=function(e,n,o){for(var i,a,s,l=new Date(e),u=0;u<7;u++){var c=new Date(e);if(c.setDate(c.getDate()+u),!r.isDisabled(c)){l=c;break}}"function"==typeof r.props.onWeekSelect&&r.props.onWeekSelect(l,n,o),r.props.showWeekPicker&&r.handleDayClick(l,o),(null!==(i=r.props.shouldCloseOnSelect)&&void 0!==i?i:t.defaultProps.shouldCloseOnSelect)&&(null===(s=(a=r.props).setOpen)||void 0===s||s.call(a,!1))},r.formatWeekNumber=function(e){return r.props.formatWeekNumber?r.props.formatWeekNumber(e):function(e){return zi(e)}(e)},r.isWeekDisabled=function(){for(var e=r.startOfWeek(),t=Hi(e,6),n=new Date(e);n<=t;){if(!r.isDisabled(n))return!1;n=Hi(n,1)}return!0},r.renderDays=function(){var e=r.startOfWeek(),o=[],i=r.formatWeekNumber(e);if(r.props.showWeekNumber){var a=r.props.onWeekSelect||r.props.showWeekPicker?r.handleWeekClick.bind(r,e,i):void 0;o.push(n().createElement(MT,TI({key:"W"},t.defaultProps,r.props,{weekNumber:i,isWeekDisabled:r.isWeekDisabled(),date:e,onClick:a})))}return o.concat([0,1,2,3,4,5,6].map(function(o){var i=Hi(e,o);return n().createElement(RT,TI({},t.defaultProps,r.props,{ariaLabelPrefixWhenEnabled:r.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:r.props.disabledDayAriaLabelPrefix,key:i.valueOf(),day:i,onClick:r.handleDayClick.bind(r,i),onMouseEnter:r.handleDayMouseEnter.bind(r,i)}))}))},r.startOfWeek=function(){return zI(r.props.day,r.props.locale,r.props.calendarStartDay)},r.isKeyboardSelected=function(){return!r.props.disabledKeyboardNavigation&&!JI(r.startOfWeek(),r.props.selected)&&JI(r.startOfWeek(),r.props.preSelection)},r}return II(t,e),Object.defineProperty(t,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e={"react-datepicker__week":!0,"react-datepicker__week--selected":JI(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()};return n().createElement("div",{className:Ud(e)},this.renderDays())},t}(e.Component),NT="two_columns",FT="three_columns",qT="four_columns",VT=((DT={})[NT]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},DT[FT]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},DT[qT]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},DT);function QT(e,t){return e?qT:t?NT:FT}var zT=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.MONTH_REFS=PI([],Array(12),!0).map(function(){return(0,e.createRef)()}),r.QUARTER_REFS=PI([],Array(4),!0).map(function(){return(0,e.createRef)()}),r.isDisabled=function(e){return iT(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(e){return aT(e,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.handleDayClick=function(e,t){var n,o;null===(o=(n=r.props).onDayClick)||void 0===o||o.call(n,e,t,r.props.orderInDisplay)},r.handleDayMouseEnter=function(e){var t,n;null===(n=(t=r.props).onDayMouseEnter)||void 0===n||n.call(t,e)},r.handleMouseLeave=function(){var e,t;null===(t=(e=r.props).onMouseLeave)||void 0===t||t.call(e)},r.isRangeStartMonth=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&KI(p_(n,e),o)},r.isRangeStartQuarter=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&XI(f_(n,e),o)},r.isRangeEndMonth=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&KI(p_(n,e),i)},r.isRangeEndQuarter=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&XI(f_(n,e),i)},r.isInSelectingRangeMonth=function(e){var t,n=r.props,o=n.day,i=n.selectsStart,a=n.selectsEnd,s=n.selectsRange,l=n.startDate,u=n.endDate,c=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return!(!(i||a||s)||!c)&&(i&&u?lT(c,u,e,o):(a&&l||!(!s||!l||u))&&lT(l,c,e,o))},r.isSelectingMonthRangeStart=function(e){var t;if(!r.isInSelectingRangeMonth(e))return!1;var n=r.props,o=n.day,i=n.startDate,a=n.selectsStart,s=p_(o,e),l=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return KI(s,a?l:i)},r.isSelectingMonthRangeEnd=function(e){var t;if(!r.isInSelectingRangeMonth(e))return!1;var n=r.props,o=n.day,i=n.endDate,a=n.selectsEnd,s=n.selectsRange,l=p_(o,e),u=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return KI(l,a||s?u:i)},r.isInSelectingRangeQuarter=function(e){var t,n=r.props,o=n.day,i=n.selectsStart,a=n.selectsEnd,s=n.selectsRange,l=n.startDate,u=n.endDate,c=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return!(!(i||a||s)||!c)&&(i&&u?fT(c,u,e,o):(a&&l||!(!s||!l||u))&&fT(l,c,e,o))},r.isWeekInMonth=function(e){var t=r.props.day,n=Hi(e,6);return KI(e,t)||KI(n,t)},r.isCurrentMonth=function(e,t){return m_(e)===m_(MI())&&t===h_(MI())},r.isCurrentQuarter=function(e,t){return m_(e)===m_(MI())&&t===y_(MI())},r.isSelectedMonth=function(e,t,n){return h_(n)===t&&m_(e)===m_(n)},r.isSelectMonthInList=function(e,t,n){return n.some(function(n){return r.isSelectedMonth(e,t,n)})},r.isSelectedQuarter=function(e,t,n){return y_(e)===t&&m_(e)===m_(n)},r.isMonthSelected=function(){var e=r.props,t=e.day,n=e.selected,o=e.selectedDates,i=e.selectsMultiple,a=h_(t);return i?null==o?void 0:o.some(function(e){return r.isSelectedMonth(t,a,e)}):!!n&&r.isSelectedMonth(t,a,n)},r.renderWeeks=function(){for(var e=[],t=r.props.fixedHeight,o=0,i=!1,a=zI(UI(r.props.day),r.props.locale,r.props.calendarStartDay),s=r.props.selected?function(e){return r.props.showWeekPicker?zI(e,r.props.locale,r.props.calendarStartDay):r.props.selected}(r.props.selected):void 0,l=r.props.preSelection?function(e){return r.props.showWeekPicker?zI(e,r.props.locale,r.props.calendarStartDay):r.props.preSelection}(r.props.preSelection):void 0;e.push(n().createElement(LT,TI({},r.props,{ariaLabelPrefix:r.props.weekAriaLabelPrefix,key:o,day:a,month:h_(r.props.day),onDayClick:r.handleDayClick,onDayMouseEnter:r.handleDayMouseEnter,selected:s,preSelection:l,showWeekNumber:r.props.showWeekNumbers}))),!i;){o++,a=N_(a,1);var u=t&&o>=6,c=!t&&!r.isWeekInMonth(a);if(u||c){if(!r.props.peekNextMonth)break;i=!0}}return e},r.onMonthClick=function(e,t){var n=r.isMonthDisabledForLabelDate(t),o=n.isDisabled,i=n.labelDate;o||r.handleDayClick(UI(i),e)},r.onMonthMouseEnter=function(e){var t=r.isMonthDisabledForLabelDate(e),n=t.isDisabled,o=t.labelDate;n||r.handleDayMouseEnter(UI(o))},r.handleMonthNavigation=function(e,t){var n,o,i,a;null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),null===(a=null===(i=r.MONTH_REFS[e])||void 0===i?void 0:i.current)||void 0===a||a.focus()},r.handleKeyboardNavigation=function(e,t,n){var o,i=r.props,a=i.selected,s=i.preSelection,l=i.setPreSelection,u=i.minDate,c=i.maxDate,d=i.showFourColumnMonthYearPicker,p=i.showTwoColumnMonthYearPicker;if(s){var f=QT(d,p),m=r.getVerticalOffset(f),h=null===(o=VT[f])||void 0===o?void 0:o.grid,v=function(e,t,n){var r,o,i=t,a=n;switch(e){case BI.ArrowRight:i=w_(t,1),a=11===n?0:n+1;break;case BI.ArrowLeft:i=k_(t,1),a=0===n?11:n-1;break;case BI.ArrowUp:i=k_(t,m),a=(null===(r=null==h?void 0:h[0])||void 0===r?void 0:r.includes(n))?n+12-m:n-m;break;case BI.ArrowDown:i=w_(t,m),a=(null===(o=null==h?void 0:h[h.length-1])||void 0===o?void 0:o.includes(n))?n-12+m:n+m}return{newCalculatedDate:i,newCalculatedMonth:a}};if(t!==BI.Enter){var y=function(e,t,n){for(var o=e,i=!1,a=0,s=v(o,t,n),l=s.newCalculatedDate,d=s.newCalculatedMonth;!i;){if(a>=40){l=t,d=n;break}var p;u&&l<u&&(o=BI.ArrowRight,l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth),c&&l>c&&(o=BI.ArrowLeft,l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth),uT(l,r.props)?(l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth):i=!0,a++}return{newCalculatedDate:l,newCalculatedMonth:d}}(t,s,n),g=y.newCalculatedDate,b=y.newCalculatedMonth;switch(t){case BI.ArrowRight:case BI.ArrowLeft:case BI.ArrowUp:case BI.ArrowDown:r.handleMonthNavigation(b,g)}}else r.isMonthDisabled(n)||(r.onMonthClick(e,n),null==l||l(a))}},r.getVerticalOffset=function(e){var t,n;return null!==(n=null===(t=VT[e])||void 0===t?void 0:t.verticalNavigationOffset)&&void 0!==n?n:0},r.onMonthKeyDown=function(e,t){var n=r.props,o=n.disabledKeyboardNavigation,i=n.handleOnMonthKeyDown,a=e.key;a!==BI.Tab&&e.preventDefault(),o||r.handleKeyboardNavigation(e,a,t),i&&i(e)},r.onQuarterClick=function(e,t){var n=f_(r.props.day,t);cT(n,r.props)||r.handleDayClick(HI(n),e)},r.onQuarterMouseEnter=function(e){var t=f_(r.props.day,e);cT(t,r.props)||r.handleDayMouseEnter(HI(t))},r.handleQuarterNavigation=function(e,t){var n,o,i,a;r.isDisabled(t)||r.isExcluded(t)||(null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),null===(a=null===(i=r.QUARTER_REFS[e-1])||void 0===i?void 0:i.current)||void 0===a||a.focus())},r.onQuarterKeyDown=function(e,t){var n,o,i=e.key;if(!r.props.disabledKeyboardNavigation)switch(i){case BI.Enter:r.onQuarterClick(e,t),null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,r.props.selected);break;case BI.ArrowRight:if(!r.props.preSelection)break;r.handleQuarterNavigation(4===t?1:t+1,C_(r.props.preSelection,1));break;case BI.ArrowLeft:if(!r.props.preSelection)break;r.handleQuarterNavigation(1===t?4:t-1,x_(r.props.preSelection,1))}},r.isMonthDisabledForLabelDate=function(e){var t,n=r.props,o=n.day,i=n.minDate,a=n.maxDate,s=n.excludeDates,l=n.includeDates,u=p_(o,e);return{isDisabled:null!==(t=(i||a||s||l)&&sT(u,r.props))&&void 0!==t&&t,labelDate:u}},r.isMonthDisabled=function(e){return r.isMonthDisabledForLabelDate(e).isDisabled},r.getMonthClassNames=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate,a=t.preSelection,s=t.monthClassName,l=s?s(p_(n,e)):void 0,u=r.getSelection();return Ud("react-datepicker__month-text","react-datepicker__month-".concat(e),l,{"react-datepicker__month-text--disabled":r.isMonthDisabled(e),"react-datepicker__month-text--selected":u?r.isSelectMonthInList(n,e,u):void 0,"react-datepicker__month-text--keyboard-selected":!r.props.disabledKeyboardNavigation&&a&&r.isSelectedMonth(n,e,a)&&!r.isMonthSelected()&&!r.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":r.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":o&&i?lT(o,i,e,n):void 0,"react-datepicker__month-text--range-start":r.isRangeStartMonth(e),"react-datepicker__month-text--range-end":r.isRangeEndMonth(e),"react-datepicker__month-text--selecting-range-start":r.isSelectingMonthRangeStart(e),"react-datepicker__month-text--selecting-range-end":r.isSelectingMonthRangeEnd(e),"react-datepicker__month-text--today":r.isCurrentMonth(n,e)})},r.getTabIndex=function(e){if(null==r.props.preSelection)return"-1";var t=h_(r.props.preSelection),n=r.isMonthDisabledForLabelDate(t).isDisabled;return e!==t||n||r.props.disabledKeyboardNavigation?"-1":"0"},r.getQuarterTabIndex=function(e){if(null==r.props.preSelection)return"-1";var t=y_(r.props.preSelection),n=cT(r.props.day,r.props);return e!==t||n||r.props.disabledKeyboardNavigation?"-1":"0"},r.getAriaLabel=function(e){var t=r.props,n=t.chooseDayAriaLabelPrefix,o=void 0===n?"Choose":n,i=t.disabledDayAriaLabelPrefix,a=void 0===i?"Not available":i,s=t.day,l=t.locale,u=p_(s,e),c=r.isDisabled(u)||r.isExcluded(u)?a:o;return"".concat(c," ").concat(FI(u,"MMMM yyyy",l))},r.getQuarterClassNames=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate,a=t.selected,s=t.minDate,l=t.maxDate,u=t.excludeDates,c=t.includeDates,d=t.filterDate,p=t.preSelection,f=t.disabledKeyboardNavigation,m=(s||l||u||c||d)&&cT(f_(n,e),r.props);return Ud("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":m,"react-datepicker__quarter-text--selected":a?r.isSelectedQuarter(n,e,a):void 0,"react-datepicker__quarter-text--keyboard-selected":!f&&p&&r.isSelectedQuarter(n,e,p)&&!m,"react-datepicker__quarter-text--in-selecting-range":r.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":o&&i?fT(o,i,e,n):void 0,"react-datepicker__quarter-text--range-start":r.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":r.isRangeEndQuarter(e),"react-datepicker__quarter-text--today":r.isCurrentQuarter(n,e)})},r.getMonthContent=function(e){var t=r.props,n=t.showFullMonthYearPicker,o=t.renderMonthContent,i=t.locale,a=t.day,s=oT(e,i),l=rT(e,i);return o?o(e,s,l,a):n?l:s},r.getQuarterContent=function(e){var t,n,o,i=r.props,a=i.renderQuarterContent,s=(n=e,o=i.locale,FI(f_(MI(),n),"QQQ",o));return null!==(t=null==a?void 0:a(e,s))&&void 0!==t?t:s},r.renderMonths=function(){var e,t=r.props,o=t.showTwoColumnMonthYearPicker,i=t.showFourColumnMonthYearPicker,a=t.day,s=t.selected,l=null===(e=VT[QT(i,o)])||void 0===e?void 0:e.grid;return null==l?void 0:l.map(function(e,t){return n().createElement("div",{className:"react-datepicker__month-wrapper",key:t},e.map(function(e,t){return n().createElement("div",{ref:r.MONTH_REFS[e],key:t,onClick:function(t){r.onMonthClick(t,e)},onKeyDown:function(t){BT(t)&&(t.preventDefault(),t.key=BI.Enter),r.onMonthKeyDown(t,e)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onMonthMouseEnter(e)},onPointerEnter:r.props.usePointerEvent?function(){return r.onMonthMouseEnter(e)}:void 0,tabIndex:Number(r.getTabIndex(e)),className:r.getMonthClassNames(e),"aria-disabled":r.isMonthDisabled(e),role:"option","aria-label":r.getAriaLabel(e),"aria-current":r.isCurrentMonth(a,e)?"date":void 0,"aria-selected":s?r.isSelectedMonth(a,e,s):void 0},r.getMonthContent(e))}))})},r.renderQuarters=function(){var e=r.props,t=e.day,o=e.selected;return n().createElement("div",{className:"react-datepicker__quarter-wrapper"},[1,2,3,4].map(function(e,i){return n().createElement("div",{key:i,ref:r.QUARTER_REFS[i],role:"option",onClick:function(t){r.onQuarterClick(t,e)},onKeyDown:function(t){r.onQuarterKeyDown(t,e)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onQuarterMouseEnter(e)},onPointerEnter:r.props.usePointerEvent?function(){return r.onQuarterMouseEnter(e)}:void 0,className:r.getQuarterClassNames(e),"aria-selected":o?r.isSelectedQuarter(t,e,o):void 0,tabIndex:Number(r.getQuarterTabIndex(e)),"aria-current":r.isCurrentQuarter(t,e)?"date":void 0},r.getQuarterContent(e))}))},r.getClassNames=function(){var e=r.props,t=e.selectingDate,n=e.selectsStart,o=e.selectsEnd;return Ud("react-datepicker__month",{"react-datepicker__month--selecting-range":t&&(n||o)},{"react-datepicker__monthPicker":e.showMonthYearPicker},{"react-datepicker__quarterPicker":e.showQuarterYearPicker},{"react-datepicker__weekPicker":e.showWeekPicker})},r}return II(r,t),r.prototype.getSelection=function(){var e=this.props,t=e.selected,n=e.selectedDates;return e.selectsMultiple?n:t?[t]:void 0},r.prototype.render=function(){var e=this.props,t=e.showMonthYearPicker,r=e.showQuarterYearPicker,o=e.day,i=e.ariaLabelPrefix,a=void 0===i?"Month ":i,s=a?a.trim()+" ":"";return n().createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(s).concat(FI(o,"MMMM, yyyy",this.props.locale)),role:"listbox"},t?this.renderMonths():r?this.renderQuarters():this.renderWeeks())},r}(e.Component),UT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSelectedMonth=function(e){return t.props.month===e},t.renderOptions=function(){return t.props.monthNames.map(function(e,r){return n().createElement("div",{className:t.isSelectedMonth(r)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:e,onClick:t.onChange.bind(t,r),"aria-selected":t.isSelectedMonth(r)?"true":void 0},t.isSelectedMonth(r)?n().createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",e)})},t.onChange=function(e){return t.props.onChange(e)},t.handleClickOutside=function(){return t.props.onCancel()},t}return II(t,e),t.prototype.render=function(){return n().createElement(jI,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},t}(e.Component),WT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(e,t){return n().createElement("option",{key:e,value:t},e)})},t.renderSelectMode=function(e){return n().createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(e){return t.onChange(parseInt(e.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,r){return n().createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__month-read-view--selected-month"},r[t.props.month]))},t.renderDropdown=function(e){return n().createElement(UT,TI({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,r=[t.renderReadView(!n,e)];return n&&r.unshift(t.renderDropdown(e)),r},t.onChange=function(e){t.toggleDropdown(),e!==t.props.month&&t.props.onChange(e)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return II(t,e),t.prototype.render=function(){var e,t=this,r=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(e){return oT(e,t.props.locale)}:function(e){return rT(e,t.props.locale)});switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode(r);break;case"select":e=this.renderSelectMode(r)}return n().createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component);function HT(e,t){for(var n=[],r=UI(e),o=UI(t);!M_(r,o);)n.push(MI(r)),r=w_(r,1);return n}var $T=function(e){function t(t){var r=e.call(this,t)||this;return r.renderOptions=function(){return r.state.monthYearsList.map(function(e){var t=F_(e),o=YI(r.props.date,e)&&KI(r.props.date,e);return n().createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:t,onClick:r.onChange.bind(r,t),"aria-selected":o?"true":void 0},o?n().createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",FI(e,r.props.dateFormat,r.props.locale))})},r.onChange=function(e){return r.props.onChange(e)},r.handleClickOutside=function(){r.props.onCancel()},r.state={monthYearsList:HT(r.props.minDate,r.props.maxDate)},r}return II(t,e),t.prototype.render=function(){var e=Ud({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return n().createElement(jI,{className:e,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(e.Component),GT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=UI(t.props.minDate),r=UI(t.props.maxDate),o=[];!M_(e,r);){var i=F_(e);o.push(n().createElement("option",{key:i,value:i},FI(e,t.props.dateFormat,t.props.locale))),e=w_(e,1)}return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return n().createElement("select",{value:F_(UI(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var r=FI(t.props.date,t.props.dateFormat,t.props.locale);return n().createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},r))},t.renderDropdown=function(){return n().createElement($T,TI({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown();var n=MI(e);YI(t.props.date,n)&&KI(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return II(t,e),t.prototype.render=function(){var e;switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode();break;case"select":e=this.renderSelectMode()}return n().createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component),YT=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.state={height:null},r.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,n,o;r.list&&(r.list.scrollTop=null!==(o=r.centerLi&&t.calcCenterPosition(r.props.monthRef?r.props.monthRef.clientHeight-(null!==(n=null===(e=r.header)||void 0===e?void 0:e.clientHeight)&&void 0!==n?n:0):r.list.clientHeight,r.centerLi))&&void 0!==o?o:0)})},r.handleClick=function(e){var t,n;(r.props.minTime||r.props.maxTime)&&yT(e,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&vT(e,r.props)||null===(n=(t=r.props).onChange)||void 0===n||n.call(t,e)},r.isSelectedTime=function(e){return r.props.selected&&(t=e,IT(r.props.selected).getTime()===IT(t).getTime());var t},r.isDisabledTime=function(e){return(r.props.minTime||r.props.maxTime)&&yT(e,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&vT(e,r.props)},r.liClasses=function(e){var n,o=["react-datepicker__time-list-item",r.props.timeClassName?r.props.timeClassName(e):void 0];return r.isSelectedTime(e)&&o.push("react-datepicker__time-list-item--selected"),r.isDisabledTime(e)&&o.push("react-datepicker__time-list-item--disabled"),r.props.injectTimes&&(3600*g_(e)+60*b_(e)+A_(e))%(60*(null!==(n=r.props.intervals)&&void 0!==n?n:t.defaultProps.intervals))!=0&&o.push("react-datepicker__time-list-item--injected"),o.join(" ")},r.handleOnKeyDown=function(e,t){var n,o;e.key===BI.Space&&(e.preventDefault(),e.key=BI.Enter),(e.key===BI.ArrowUp||e.key===BI.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===BI.ArrowDown||e.key===BI.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===BI.Enter&&r.handleClick(t),null===(o=(n=r.props).handleOnKeyDown)||void 0===o||o.call(n,e)},r.renderTimes=function(){for(var e,o=[],i="string"==typeof r.props.format?r.props.format:"p",a=null!==(e=r.props.intervals)&&void 0!==e?e:t.defaultProps.intervals,s=r.props.selected||r.props.openToDate||MI(),l=QI(s),u=r.props.injectTimes&&r.props.injectTimes.sort(function(e,t){return e.getTime()-t.getTime()}),c=60*function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),24);return Math.round((+n-+t)/36e5)}(s),d=c/a,p=0;p<d;p++){var f=j_(l,p*a);if(o.push(f),u){var m=ST(l,f,p,a,u);o=o.concat(m)}}var h=o.reduce(function(e,t){return t.getTime()<=s.getTime()?t:e},o[0]);return o.map(function(e){return n().createElement("li",{key:e.valueOf(),onClick:r.handleClick.bind(r,e),className:r.liClasses(e),ref:function(t){e===h&&(r.centerLi=t)},onKeyDown:function(t){r.handleOnKeyDown(t,e)},tabIndex:e===h?0:-1,role:"option","aria-selected":r.isSelectedTime(e)?"true":void 0,"aria-disabled":r.isDisabledTime(e)?"true":void 0},FI(e,i,r.props.locale))})},r.renderTimeCaption=function(){return!1===r.props.showTimeCaption?n().createElement(n().Fragment,null):n().createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(r.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(e){r.header=e}},n().createElement("div",{className:"react-datepicker-time__header"},r.props.timeCaption))},r}return II(t,e),Object.defineProperty(t,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},t.prototype.componentWillUnmount=function(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()},t.prototype.observeDatePickerHeightChanges=function(){var e=this,t=this.props.monthRef;this.updateContainerHeight(),t&&(this.resizeObserver=new ResizeObserver(function(){e.updateContainerHeight()}),this.resizeObserver.observe(t))},t.prototype.updateContainerHeight=function(){this.props.monthRef&&this.header&&this.setState({height:this.props.monthRef.clientHeight-this.header.clientHeight})},t.prototype.render=function(){var e,r=this,o=this.state.height;return n().createElement("div",{className:"react-datepicker__time-container ".concat((null!==(e=this.props.todayButton)&&void 0!==e?e:t.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),n().createElement("div",{className:"react-datepicker__time"},n().createElement("div",{className:"react-datepicker__time-box"},n().createElement("ul",{className:"react-datepicker__time-list",ref:function(e){r.list=e},style:o?{height:o}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},t.calcCenterPosition=function(e,t){return t.offsetTop-(e/2-t.clientHeight/2)},t}(e.Component),KT=function(t){function r(n){var r=t.call(this,n)||this;return r.YEAR_REFS=PI([],Array(r.props.yearItemNumber),!0).map(function(){return(0,e.createRef)()}),r.isDisabled=function(e){return iT(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(e){return aT(e,{excludeDates:r.props.excludeDates})},r.selectingDate=function(){var e;return null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection},r.updateFocusOnPaginate=function(e){window.requestAnimationFrame(function(){var t,n;null===(n=null===(t=r.YEAR_REFS[e])||void 0===t?void 0:t.current)||void 0===n||n.focus()})},r.handleYearClick=function(e,t){r.props.onDayClick&&r.props.onDayClick(e,t)},r.handleYearNavigation=function(e,t){var n,o,i,a,s=r.props,l=s.date,u=s.yearItemNumber;if(void 0!==l&&void 0!==u){var c=OT(l,u).startPeriod;r.isDisabled(t)||r.isExcluded(t)||(null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),e-c<0?r.updateFocusOnPaginate(u-(c-e)):e-c>=u?r.updateFocusOnPaginate(Math.abs(u-(e-c))):null===(a=null===(i=r.YEAR_REFS[e-c])||void 0===i?void 0:i.current)||void 0===a||a.focus())}},r.isSameDay=function(e,t){return JI(e,t)},r.isCurrentYear=function(e){return e===m_(MI())},r.isRangeStart=function(e){return r.props.startDate&&r.props.endDate&&YI(q_(MI(),e),r.props.startDate)},r.isRangeEnd=function(e){return r.props.startDate&&r.props.endDate&&YI(q_(MI(),e),r.props.endDate)},r.isInRange=function(e){return dT(e,r.props.startDate,r.props.endDate)},r.isInSelectingRange=function(e){var t=r.props,n=t.selectsStart,o=t.selectsEnd,i=t.selectsRange,a=t.startDate,s=t.endDate;return!(!(n||o||i)||!r.selectingDate())&&(n&&s?dT(e,r.selectingDate(),s):(o&&a||!(!i||!a||s))&&dT(e,a,r.selectingDate()))},r.isSelectingRangeStart=function(e){var t;if(!r.isInSelectingRange(e))return!1;var n=r.props,o=n.startDate,i=n.selectsStart;return YI(q_(MI(),e),i?null!==(t=r.selectingDate())&&void 0!==t?t:null:null!=o?o:null)},r.isSelectingRangeEnd=function(e){var t;if(!r.isInSelectingRange(e))return!1;var n=r.props,o=n.endDate,i=n.selectsEnd,a=n.selectsRange;return YI(q_(MI(),e),i||a?null!==(t=r.selectingDate())&&void 0!==t?t:null:null!=o?o:null)},r.isKeyboardSelected=function(e){if(void 0!==r.props.date&&null!=r.props.selected&&null!=r.props.preSelection){var t=r.props,n=t.minDate,o=t.maxDate,i=t.excludeDates,a=t.includeDates,s=t.filterDate,l=WI(q_(r.props.date,e)),u=(n||o||i||a||s)&&pT(e,r.props);return!r.props.disabledKeyboardNavigation&&!r.props.inline&&!JI(l,WI(r.props.selected))&&JI(l,WI(r.props.preSelection))&&!u}},r.isSelectedYear=function(e){var t=r.props,n=t.selectsMultiple,o=t.selected,i=t.selectedDates;return n?null==i?void 0:i.some(function(t){return e===m_(t)}):!!o&&e===m_(o)},r.onYearClick=function(e,t){var n=r.props.date;void 0!==n&&r.handleYearClick(WI(q_(n,t)),e)},r.onYearKeyDown=function(e,t){var n,o,i=e.key,a=r.props,s=a.date,l=a.yearItemNumber,u=a.handleOnKeyDown;if(i!==BI.Tab&&e.preventDefault(),!r.props.disabledKeyboardNavigation)switch(i){case BI.Enter:if(null==r.props.selected)break;r.onYearClick(e,t),null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,r.props.selected);break;case BI.ArrowRight:if(null==r.props.preSelection)break;r.handleYearNavigation(t+1,__(r.props.preSelection,1));break;case BI.ArrowLeft:if(null==r.props.preSelection)break;r.handleYearNavigation(t-1,O_(r.props.preSelection,1));break;case BI.ArrowUp:if(void 0===s||void 0===l||null==r.props.preSelection)break;var c=OT(s,l).startPeriod;if((f=t-(p=3))<c){var d=l%p;t>=c&&t<c+d?p=d:p+=d,f=t-p}r.handleYearNavigation(f,O_(r.props.preSelection,p));break;case BI.ArrowDown:if(void 0===s||void 0===l||null==r.props.preSelection)break;var p,f,m=OT(s,l).endPeriod;(f=t+(p=3))>m&&(d=l%p,t<=m&&t>m-d?p=d:p+=d,f=t+p),r.handleYearNavigation(f,__(r.props.preSelection,p))}u&&u(e)},r.getYearClassNames=function(e){var t=r.props,n=t.date,o=t.minDate,i=t.maxDate,a=t.excludeDates,s=t.includeDates,l=t.filterDate,u=t.yearClassName;return Ud("react-datepicker__year-text","react-datepicker__year-".concat(e),n?null==u?void 0:u(q_(n,e)):void 0,{"react-datepicker__year-text--selected":r.isSelectedYear(e),"react-datepicker__year-text--disabled":(o||i||a||s||l)&&pT(e,r.props),"react-datepicker__year-text--keyboard-selected":r.isKeyboardSelected(e),"react-datepicker__year-text--range-start":r.isRangeStart(e),"react-datepicker__year-text--range-end":r.isRangeEnd(e),"react-datepicker__year-text--in-range":r.isInRange(e),"react-datepicker__year-text--in-selecting-range":r.isInSelectingRange(e),"react-datepicker__year-text--selecting-range-start":r.isSelectingRangeStart(e),"react-datepicker__year-text--selecting-range-end":r.isSelectingRangeEnd(e),"react-datepicker__year-text--today":r.isCurrentYear(e)})},r.getYearTabIndex=function(e){if(r.props.disabledKeyboardNavigation||null==r.props.preSelection)return"-1";var t=m_(r.props.preSelection),n=pT(e,r.props);return e!==t||n?"-1":"0"},r.getYearContent=function(e){return r.props.renderYearContent?r.props.renderYearContent(e):e},r}return II(r,t),r.prototype.render=function(){var e=this,t=[],r=this.props,o=r.date,i=r.yearItemNumber,a=r.onYearMouseEnter,s=r.onYearMouseLeave;if(void 0===o)return null;for(var l=OT(o,i),u=l.startPeriod,c=l.endPeriod,d=function(r){t.push(n().createElement("div",{ref:p.YEAR_REFS[r-u],onClick:function(t){e.onYearClick(t,r)},onKeyDown:function(t){BT(t)&&(t.preventDefault(),t.key=BI.Enter),e.onYearKeyDown(t,r)},tabIndex:Number(p.getYearTabIndex(r)),className:p.getYearClassNames(r),onMouseEnter:p.props.usePointerEvent?void 0:function(e){return a(e,r)},onPointerEnter:p.props.usePointerEvent?function(e){return a(e,r)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(e){return s(e,r)},onPointerLeave:p.props.usePointerEvent?function(e){return s(e,r)}:void 0,key:r,"aria-current":p.isCurrentYear(r)?"date":void 0},p.getYearContent(r)))},p=this,f=u;f<=c;f++)d(f);return n().createElement("div",{className:"react-datepicker__year"},n().createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},t))},r}(e.Component);function XT(e,t,n,r){for(var o=[],i=0;i<2*t+1;i++){var a=e+t-i,s=!0;n&&(s=m_(n)<=a),r&&s&&(s=m_(r)>=a),s&&o.push(a)}return o}var JT,ZT=function(t){function r(r){var o=t.call(this,r)||this;o.renderOptions=function(){var e=o.props.year,t=o.state.yearsList.map(function(t){return n().createElement("div",{className:e===t?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:t,onClick:o.onChange.bind(o,t),"aria-selected":e===t?"true":void 0},e===t?n().createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",t)}),r=o.props.minDate?m_(o.props.minDate):null,i=o.props.maxDate?m_(o.props.maxDate):null;return i&&o.state.yearsList.find(function(e){return e===i})||t.unshift(n().createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:o.incrementYears},n().createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),r&&o.state.yearsList.find(function(e){return e===r})||t.push(n().createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:o.decrementYears},n().createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),t},o.onChange=function(e){o.props.onChange(e)},o.handleClickOutside=function(){o.props.onCancel()},o.shiftYears=function(e){var t=o.state.yearsList.map(function(t){return t+e});o.setState({yearsList:t})},o.incrementYears=function(){return o.shiftYears(1)},o.decrementYears=function(){return o.shiftYears(-1)};var i=r.yearDropdownItemNumber,a=r.scrollableYearDropdown,s=i||(a?10:5);return o.state={yearsList:XT(o.props.year,s,o.props.minDate,o.props.maxDate)},o.dropdownRef=(0,e.createRef)(),o}return II(r,t),r.prototype.componentDidMount=function(){var e=this.dropdownRef.current;if(e){var t=e.children?Array.from(e.children):null,n=t?t.find(function(e){return e.ariaSelected}):null;e.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-e.clientHeight)/2:(e.scrollHeight-e.clientHeight)/2}},r.prototype.render=function(){var e=Ud({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return n().createElement(jI,{className:e,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(e.Component),eP=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?m_(t.props.minDate):1900,r=t.props.maxDate?m_(t.props.maxDate):2100,o=[],i=e;i<=r;i++)o.push(n().createElement("option",{key:i,value:i},i));return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return n().createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return n().createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:function(e){return t.toggleDropdown(e)}},n().createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return n().createElement(ZT,TI({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown(),e!==t.props.year&&t.props.onChange(e)},t.toggleDropdown=function(e){t.setState({dropdownVisible:!t.state.dropdownVisible},function(){t.props.adjustDateOnChange&&t.handleYearChange(t.props.date,e)})},t.handleYearChange=function(e,n){var r;null===(r=t.onSelect)||void 0===r||r.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var r,o;null===(o=(r=t.props).onSelect)||void 0===o||o.call(r,e,n)},t.setOpen=function(){var e,n;null===(n=(e=t.props).setOpen)||void 0===n||n.call(e,!0)},t}return II(t,e),t.prototype.render=function(){var e;switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode();break;case"select":e=this.renderSelectMode()}return n().createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component),tP=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],nP=function(t){function r(o){var i=t.call(this,o)||this;return i.monthContainer=void 0,i.handleClickOutside=function(e){i.props.onClickOutside(e)},i.setClickOutsideRef=function(){return i.containerRef.current},i.handleDropdownFocus=function(e){var t,n,r,o;r=e.target,o=(r.className||"").split(/\s+/),tP.some(function(e){return o.indexOf(e)>=0})&&(null===(n=(t=i.props).onDropdownFocus)||void 0===n||n.call(t,e))},i.getDateInView=function(){var e=i.props,t=e.preSelection,n=e.selected,r=e.openToDate,o=kT(i.props),a=ET(i.props),s=MI();return r||n||t||(o&&r_(s,o)?o:a&&M_(s,a)?a:s)},i.increaseMonth=function(){i.setState(function(e){return{date:w_(e.date,1)}},function(){return i.handleMonthChange(i.state.date)})},i.decreaseMonth=function(){i.setState(function(e){return{date:k_(e.date,1)}},function(){return i.handleMonthChange(i.state.date)})},i.handleDayClick=function(e,t,n){i.props.onSelect(e,t,n),i.props.setPreSelection&&i.props.setPreSelection(e)},i.handleDayMouseEnter=function(e){i.setState({selectingDate:e}),i.props.onDayMouseEnter&&i.props.onDayMouseEnter(e)},i.handleMonthMouseLeave=function(){i.setState({selectingDate:void 0}),i.props.onMonthMouseLeave&&i.props.onMonthMouseLeave()},i.handleYearMouseEnter=function(e,t){i.setState({selectingDate:q_(MI(),t)}),i.props.onYearMouseEnter&&i.props.onYearMouseEnter(e,t)},i.handleYearMouseLeave=function(e,t){i.props.onYearMouseLeave&&i.props.onYearMouseLeave(e,t)},i.handleYearChange=function(e){var t,n,r,o;null===(n=(t=i.props).onYearChange)||void 0===n||n.call(t,e),i.setState({isRenderAriaLiveMessage:!0}),i.props.adjustDateOnChange&&(i.props.onSelect(e),null===(o=(r=i.props).setOpen)||void 0===o||o.call(r,!0)),i.props.setPreSelection&&i.props.setPreSelection(e)},i.getEnabledPreSelectionDateForMonth=function(e){if(!iT(e,i.props))return e;for(var t=UI(e),n=function(e,t,n){const[r,o]=ia(n?.in,e,t),i=V_(r,o),a=Math.abs(sa(r,o));r.setDate(r.getDate()-i*a);const s=i*(a-Number(V_(r,o)===-i));return 0===s?0:s}(function(e){return c_(e)}(e),t),r=null,o=0;o<=n;o++){var a=Hi(t,o);if(!iT(a,i.props)){r=a;break}}return r},i.handleMonthChange=function(e){var t,n,r,o=null!==(t=i.getEnabledPreSelectionDateForMonth(e))&&void 0!==t?t:e;i.handleCustomMonthChange(o),i.props.adjustDateOnChange&&(i.props.onSelect(o),null===(r=(n=i.props).setOpen)||void 0===r||r.call(n,!0)),i.props.setPreSelection&&i.props.setPreSelection(o)},i.handleCustomMonthChange=function(e){var t,n;null===(n=(t=i.props).onMonthChange)||void 0===n||n.call(t,e),i.setState({isRenderAriaLiveMessage:!0})},i.handleMonthYearChange=function(e){i.handleYearChange(e),i.handleMonthChange(e)},i.changeYear=function(e){i.setState(function(t){return{date:q_(t.date,Number(e))}},function(){return i.handleYearChange(i.state.date)})},i.changeMonth=function(e){i.setState(function(t){return{date:p_(t.date,Number(e))}},function(){return i.handleMonthChange(i.state.date)})},i.changeMonthYear=function(e){i.setState(function(t){return{date:q_(p_(t.date,h_(e)),m_(e))}},function(){return i.handleMonthYearChange(i.state.date)})},i.header=function(e){void 0===e&&(e=i.state.date);var t=zI(e,i.props.locale,i.props.calendarStartDay),r=[];return i.props.showWeekNumbers&&r.push(n().createElement("div",{key:"W",className:"react-datepicker__day-name"},i.props.weekLabel||"#")),r.concat([0,1,2,3,4,5,6].map(function(e){var r=Hi(t,e),o=i.formatWeekday(r,i.props.locale),a=i.props.weekDayClassName?i.props.weekDayClassName(r):void 0;return n().createElement("div",{key:e,"aria-label":FI(r,"EEEE",i.props.locale),className:Ud("react-datepicker__day-name",a)},o)}))},i.formatWeekday=function(e,t){return i.props.formatWeekDay?function(e,t,n){return t(FI(e,"EEEE",n))}(e,i.props.formatWeekDay,t):i.props.useWeekdaysShort?function(e,t){return FI(e,"EEE",t)}(e,t):function(e,t){return FI(e,"EEEEEE",t)}(e,t)},i.decreaseYear=function(){i.setState(function(e){var t;return{date:O_(e.date,i.props.showYearPicker?null!==(t=i.props.yearItemNumber)&&void 0!==t?t:r.defaultProps.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})},i.clearSelectingDate=function(){i.setState({selectingDate:void 0})},i.renderPreviousButton=function(){var e,t,o;if(!i.props.renderCustomHeader){var a,s=null!==(e=i.props.monthsShown)&&void 0!==e?e:r.defaultProps.monthsShown,l=i.props.showPreviousMonths?s-1:0,u=null!==(t=i.props.monthSelectedIn)&&void 0!==t?t:l,c=k_(i.state.date,u);switch(!0){case i.props.showMonthYearPicker:a=AT(i.state.date,i.props);break;case i.props.showYearPicker:a=function(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.yearItemNumber,i=void 0===o?12:o,a=OT(WI(O_(e,i)),i).endPeriod,s=r&&m_(r);return s&&s>a||!1}(i.state.date,i.props);break;case i.props.showQuarterYearPicker:a=function(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=x_(la(e),1);return r&&S_(r,i)>0||o&&o.every(function(e){return S_(e,i)>0})||!1}(i.state.date,i.props);break;default:a=gT(c,i.props)}if(((null!==(o=i.props.forceShowMonthNavigation)&&void 0!==o?o:r.defaultProps.forceShowMonthNavigation)||i.props.showDisabledMonthNavigation||!a)&&!i.props.showTimeSelectOnly){var d=["react-datepicker__navigation","react-datepicker__navigation--previous"],p=i.decreaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(p=i.decreaseYear),a&&i.props.showDisabledMonthNavigation&&(d.push("react-datepicker__navigation--previous--disabled"),p=void 0);var f=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,m=i.props,h=m.previousMonthButtonLabel,v=void 0===h?r.defaultProps.previousMonthButtonLabel:h,y=m.previousYearButtonLabel,g=void 0===y?r.defaultProps.previousYearButtonLabel:y,b=i.props,A=b.previousMonthAriaLabel,w=void 0===A?"string"==typeof v?v:"Previous Month":A,k=b.previousYearAriaLabel,E=void 0===k?"string"==typeof g?g:"Previous Year":k;return n().createElement("button",{type:"button",className:d.join(" "),onClick:p,onKeyDown:i.props.handleOnKeyDown,"aria-label":f?E:w},n().createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"].join(" ")},f?g:v))}}},i.increaseYear=function(){i.setState(function(e){var t;return{date:__(e.date,i.props.showYearPicker?null!==(t=i.props.yearItemNumber)&&void 0!==t?t:r.defaultProps.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})},i.renderNextButton=function(){var e;if(!i.props.renderCustomHeader){var t;switch(!0){case i.props.showMonthYearPicker:t=wT(i.state.date,i.props);break;case i.props.showYearPicker:t=function(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.yearItemNumber,i=void 0===o?12:o,a=OT(__(e,i),i).startPeriod,s=r&&m_(r);return s&&s<a||!1}(i.state.date,i.props);break;case i.props.showQuarterYearPicker:t=function(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=C_(v_(e),1);return r&&S_(i,r)>0||o&&o.every(function(e){return S_(i,e)>0})||!1}(i.state.date,i.props);break;default:t=bT(i.state.date,i.props)}if(((null!==(e=i.props.forceShowMonthNavigation)&&void 0!==e?e:r.defaultProps.forceShowMonthNavigation)||i.props.showDisabledMonthNavigation||!t)&&!i.props.showTimeSelectOnly){var o=["react-datepicker__navigation","react-datepicker__navigation--next"];i.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),i.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var a=i.increaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(a=i.increaseYear),t&&i.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),a=void 0);var s=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,l=i.props,u=l.nextMonthButtonLabel,c=void 0===u?r.defaultProps.nextMonthButtonLabel:u,d=l.nextYearButtonLabel,p=void 0===d?r.defaultProps.nextYearButtonLabel:d,f=i.props,m=f.nextMonthAriaLabel,h=void 0===m?"string"==typeof c?c:"Next Month":m,v=f.nextYearAriaLabel,y=void 0===v?"string"==typeof p?p:"Next Year":v;return n().createElement("button",{type:"button",className:o.join(" "),onClick:a,onKeyDown:i.props.handleOnKeyDown,"aria-label":s?y:h},n().createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"].join(" ")},s?p:c))}}},i.renderCurrentMonth=function(e){void 0===e&&(e=i.state.date);var t=["react-datepicker__current-month"];return i.props.showYearDropdown&&t.push("react-datepicker__current-month--hasYearDropdown"),i.props.showMonthDropdown&&t.push("react-datepicker__current-month--hasMonthDropdown"),i.props.showMonthYearDropdown&&t.push("react-datepicker__current-month--hasMonthYearDropdown"),n().createElement("h2",{className:t.join(" ")},FI(e,i.props.dateFormat,i.props.locale))},i.renderYearDropdown=function(e){if(void 0===e&&(e=!1),i.props.showYearDropdown&&!e)return n().createElement(eP,TI({},r.defaultProps,i.props,{date:i.state.date,onChange:i.changeYear,year:m_(i.state.date)}))},i.renderMonthDropdown=function(e){if(void 0===e&&(e=!1),i.props.showMonthDropdown&&!e)return n().createElement(WT,TI({},r.defaultProps,i.props,{month:h_(i.state.date),onChange:i.changeMonth}))},i.renderMonthYearDropdown=function(e){if(void 0===e&&(e=!1),i.props.showMonthYearDropdown&&!e)return n().createElement(GT,TI({},r.defaultProps,i.props,{date:i.state.date,onChange:i.changeMonthYear}))},i.handleTodayButtonClick=function(e){i.props.onSelect($I(),e),i.props.setPreSelection&&i.props.setPreSelection($I())},i.renderTodayButton=function(){if(i.props.todayButton&&!i.props.showTimeSelectOnly)return n().createElement("div",{className:"react-datepicker__today-button",onClick:i.handleTodayButtonClick},i.props.todayButton)},i.renderDefaultHeader=function(e){var t=e.monthDate,r=e.i;return n().createElement("div",{className:"react-datepicker__header ".concat(i.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},i.renderCurrentMonth(t),n().createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(i.props.dropdownMode),onFocus:i.handleDropdownFocus},i.renderMonthDropdown(0!==r),i.renderMonthYearDropdown(0!==r),i.renderYearDropdown(0!==r)),n().createElement("div",{className:"react-datepicker__day-names"},i.header(t)))},i.renderCustomHeader=function(e){var t,r,o=e.monthDate,a=e.i;if(i.props.showTimeSelect&&!i.state.monthContainer||i.props.showTimeSelectOnly)return null;var s=gT(i.state.date,i.props),l=bT(i.state.date,i.props),u=AT(i.state.date,i.props),c=wT(i.state.date,i.props),d=!i.props.showMonthYearPicker&&!i.props.showQuarterYearPicker&&!i.props.showYearPicker;return n().createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:i.props.onDropdownFocus},null===(r=(t=i.props).renderCustomHeader)||void 0===r?void 0:r.call(t,TI(TI({},i.state),{customHeaderCount:a,monthDate:o,changeMonth:i.changeMonth,changeYear:i.changeYear,decreaseMonth:i.decreaseMonth,increaseMonth:i.increaseMonth,decreaseYear:i.decreaseYear,increaseYear:i.increaseYear,prevMonthButtonDisabled:s,nextMonthButtonDisabled:l,prevYearButtonDisabled:u,nextYearButtonDisabled:c})),d&&n().createElement("div",{className:"react-datepicker__day-names"},i.header(o)))},i.renderYearHeader=function(e){var t=e.monthDate,o=i.props,a=o.showYearPicker,s=o.yearItemNumber,l=OT(t,void 0===s?r.defaultProps.yearItemNumber:s),u=l.startPeriod,c=l.endPeriod;return n().createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},a?"".concat(u," - ").concat(c):m_(t))},i.renderHeader=function(e){var t=e.monthDate,n=e.i,r={monthDate:t,i:void 0===n?0:n};switch(!0){case void 0!==i.props.renderCustomHeader:return i.renderCustomHeader(r);case i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker:return i.renderYearHeader(r);default:return i.renderDefaultHeader(r)}},i.renderMonths=function(){var e,t;if(!i.props.showTimeSelectOnly&&!i.props.showYearPicker){for(var o=[],a=null!==(e=i.props.monthsShown)&&void 0!==e?e:r.defaultProps.monthsShown,s=i.props.showPreviousMonths?a-1:0,l=i.props.showMonthYearPicker||i.props.showQuarterYearPicker?__(i.state.date,s):k_(i.state.date,s),u=null!==(t=i.props.monthSelectedIn)&&void 0!==t?t:s,c=0;c<a;++c){var d=c-u+s,p=i.props.showMonthYearPicker||i.props.showQuarterYearPicker?__(l,d):w_(l,d),f="month-".concat(c),m=c<a-1,h=c>0;o.push(n().createElement("div",{key:f,ref:function(e){i.monthContainer=null!=e?e:void 0},className:"react-datepicker__month-container"},i.renderHeader({monthDate:p,i:c}),n().createElement(zT,TI({},r.defaultProps,i.props,{containerRef:i.containerRef,ariaLabelPrefix:i.props.monthAriaLabelPrefix,day:p,onDayClick:i.handleDayClick,handleOnKeyDown:i.props.handleOnDayKeyDown,handleOnMonthKeyDown:i.props.handleOnKeyDown,onDayMouseEnter:i.handleDayMouseEnter,onMouseLeave:i.handleMonthMouseLeave,orderInDisplay:c,selectingDate:i.state.selectingDate,monthShowsDuplicateDaysEnd:m,monthShowsDuplicateDaysStart:h}))))}return o}},i.renderYears=function(){if(!i.props.showTimeSelectOnly)return i.props.showYearPicker?n().createElement("div",{className:"react-datepicker__year--container"},i.renderHeader({monthDate:i.state.date}),n().createElement(KT,TI({},r.defaultProps,i.props,{selectingDate:i.state.selectingDate,date:i.state.date,onDayClick:i.handleDayClick,clearSelectingDate:i.clearSelectingDate,onYearMouseEnter:i.handleYearMouseEnter,onYearMouseLeave:i.handleYearMouseLeave}))):void 0},i.renderTimeSection=function(){if(i.props.showTimeSelect&&(i.state.monthContainer||i.props.showTimeSelectOnly))return n().createElement(YT,TI({},r.defaultProps,i.props,{onChange:i.props.onTimeChange,format:i.props.timeFormat,intervals:i.props.timeIntervals,monthRef:i.state.monthContainer}))},i.renderInputTimeSection=function(){var e=i.props.selected?new Date(i.props.selected):void 0,t=e&&NI(e)&&Boolean(i.props.selected)?"".concat(_T(e.getHours()),":").concat(_T(e.getMinutes())):"";if(i.props.showTimeInput)return n().createElement(jT,TI({},r.defaultProps,i.props,{date:e,timeString:t,onChange:i.props.onTimeChange}))},i.renderAriaLiveRegion=function(){var e,t,o=OT(i.state.date,null!==(e=i.props.yearItemNumber)&&void 0!==e?e:r.defaultProps.yearItemNumber),a=o.startPeriod,s=o.endPeriod;return t=i.props.showYearPicker?"".concat(a," - ").concat(s):i.props.showMonthYearPicker||i.props.showQuarterYearPicker?m_(i.state.date):"".concat(rT(h_(i.state.date),i.props.locale)," ").concat(m_(i.state.date)),n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},i.state.isRenderAriaLiveMessage&&t)},i.renderChildren=function(){if(i.props.children)return n().createElement("div",{className:"react-datepicker__children-container"},i.props.children)},i.containerRef=(0,e.createRef)(),i.state={date:i.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},i}return II(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:12}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){this.props.showTimeSelect&&(this.assignMonthContainer=void this.setState({monthContainer:this.monthContainer}))},r.prototype.componentDidUpdate=function(e){var t=this;if(!this.props.preSelection||JI(this.props.preSelection,e.preSelection)&&this.props.monthSelectedIn===e.monthSelectedIn)this.props.openToDate&&!JI(this.props.openToDate,e.openToDate)&&this.setState({date:this.props.openToDate});else{var n=!KI(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&t.handleCustomMonthChange(t.state.date)})}},r.prototype.render=function(){var e=this.props.container||DI;return n().createElement(jI,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},n().createElement("div",{style:{display:"contents"},ref:this.containerRef},n().createElement(e,{className:Ud("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},r}(e.Component),rP=function(e){var t=e.icon,r=e.className,o=void 0===r?"":r,i=e.onClick,a="react-datepicker__calendar-icon";if("string"==typeof t)return n().createElement("i",{className:"".concat(a," ").concat(t," ").concat(o),"aria-hidden":"true",onClick:i});if(n().isValidElement(t)){var s=t;return n().cloneElement(s,{className:"".concat(s.props.className||""," ").concat(a," ").concat(o),onClick:function(e){"function"==typeof s.props.onClick&&s.props.onClick(e),"function"==typeof i&&i(e)}})}return n().createElement("svg",{className:"".concat(a," ").concat(o),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:i},n().createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},oP=function(e){function t(t){var n=e.call(this,t)||this;return n.portalRoot=null,n.el=document.createElement("div"),n}return II(t,e),t.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},t.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},t.prototype.render=function(){return Zg().createPortal(this.props.children,this.el)},t}(e.Component),iP=function(e){return(e instanceof HTMLAnchorElement||!e.disabled)&&-1!==e.tabIndex},aP=function(t){function r(n){var r=t.call(this,n)||this;return r.getTabChildren=function(){var e;return Array.prototype.slice.call(null===(e=r.tabLoopRef.current)||void 0===e?void 0:e.querySelectorAll("[tabindex], a, button, input, select, textarea"),1,-1).filter(iP)},r.handleFocusStart=function(){var e=r.getTabChildren();e&&e.length>1&&e[e.length-1].focus()},r.handleFocusEnd=function(){var e=r.getTabChildren();e&&e.length>1&&e[0].focus()},r.tabLoopRef=(0,e.createRef)(),r}return II(r,t),r.prototype.render=function(){var e;return(null!==(e=this.props.enableTabLoop)&&void 0!==e?e:r.defaultProps.enableTabLoop)?n().createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},n().createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,n().createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},r.defaultProps={enableTabLoop:!0},r}(e.Component),sP=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return II(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{hidePopper:!0}},enumerable:!1,configurable:!0}),r.prototype.render=function(){var t=this.props,o=t.className,i=t.wrapperClassName,a=t.hidePopper,s=void 0===a?r.defaultProps.hidePopper:a,l=t.popperComponent,u=t.targetComponent,c=t.enableTabLoop,d=t.popperOnKeyDown,p=t.portalId,f=t.portalHost,m=t.popperProps,h=t.showArrow,v=void 0;if(!s){var y=Ud("react-datepicker-popper",o);v=n().createElement(aP,{enableTabLoop:c},n().createElement("div",{ref:m.refs.setFloating,style:m.floatingStyles,className:y,"data-placement":m.placement,onKeyDown:d},l,h&&n().createElement(EI,{ref:m.arrowRef,context:m.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}this.props.popperContainer&&(v=(0,e.createElement)(this.props.popperContainer,{},v)),p&&!s&&(v=n().createElement(oP,{portalId:p,portalHost:f},v));var g=Ud("react-datepicker-wrapper",i);return n().createElement(n().Fragment,null,n().createElement("div",{ref:m.refs.setReference,className:g},u),v)},r}(e.Component),lP=(JT=sP,function(t){var r,o,i,a="boolean"!=typeof t.hidePopper||t.hidePopper,s=(0,e.useRef)(null),l=_I(TI({open:!a,whileElementsMounted:iI,placement:t.popperPlacement,middleware:PI([(o={padding:15},{...sI(o),options:[o,i]}),vI(10),yI({element:s})],null!==(r=t.popperModifiers)&&void 0!==r?r:[],!0)},t.popperProps)),u=TI(TI({},t),{hidePopper:a,popperProps:TI(TI({},l),{arrowRef:s})});return n().createElement(JT,TI({},u))}),uP="react-datepicker-ignore-onclickoutside",cP="Date input not valid.",dP=function(t){function r(o){var i=t.call(this,o)||this;return i.calendar=null,i.input=null,i.getPreSelection=function(){return i.props.openToDate?i.props.openToDate:i.props.selectsEnd&&i.props.startDate?i.props.startDate:i.props.selectsStart&&i.props.endDate?i.props.endDate:MI()},i.modifyHolidays=function(){var e;return null===(e=i.props.holidays)||void 0===e?void 0:e.reduce(function(e,t){var n=new Date(t.date);return NI(n)?PI(PI([],e,!0),[TI(TI({},t),{date:n})],!1):e},[])},i.calcInitialState=function(){var e,t=i.getPreSelection(),n=kT(i.props),r=ET(i.props),o=n&&r_(t,QI(n))?n:r&&M_(t,GI(r))?r:t;return{open:i.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:null!==(e=i.props.selectsRange?i.props.startDate:i.props.selected)&&void 0!==e?e:o,highlightDates:CT(i.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},i.resetHiddenStatus=function(){i.setState(TI(TI({},i.state),{wasHidden:!1}))},i.setHiddenStatus=function(){i.setState(TI(TI({},i.state),{wasHidden:!0}))},i.setHiddenStateOnVisibilityHidden=function(){"hidden"===document.visibilityState&&i.setHiddenStatus()},i.clearPreventFocusTimeout=function(){i.preventFocusTimeout&&clearTimeout(i.preventFocusTimeout)},i.setFocus=function(){var e,t;null===(t=null===(e=i.input)||void 0===e?void 0:e.focus)||void 0===t||t.call(e,{preventScroll:!0})},i.setBlur=function(){var e,t;null===(t=null===(e=i.input)||void 0===e?void 0:e.blur)||void 0===t||t.call(e),i.cancelFocusInput()},i.deferBlur=function(){requestAnimationFrame(function(){i.setBlur()})},i.setOpen=function(e,t){void 0===t&&(t=!1),i.setState({open:e,preSelection:e&&i.state.open?i.state.preSelection:i.calcInitialState().preSelection,lastPreSelectChange:fP},function(){e||i.setState(function(e){return{focused:!!t&&e.focused}},function(){!t&&i.deferBlur(),i.setState({inputValue:null})})})},i.inputOk=function(){return So(i.state.preSelection)},i.isCalendarOpen=function(){return void 0===i.props.open?i.state.open&&!i.props.disabled&&!i.props.readOnly:i.props.open},i.handleFocus=function(e){var t,n,r=i.state.wasHidden,o=!r||i.state.open;r&&i.resetHiddenStatus(),i.state.preventFocus||(null===(n=(t=i.props).onFocus)||void 0===n||n.call(t,e),!o||i.props.preventOpenOnFocus||i.props.readOnly||i.setOpen(!0)),i.setState({focused:!0})},i.sendFocusBackToInput=function(){i.preventFocusTimeout&&i.clearPreventFocusTimeout(),i.setState({preventFocus:!0},function(){i.preventFocusTimeout=setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})})},i.cancelFocusInput=function(){clearTimeout(i.inputFocusTimeout),i.inputFocusTimeout=void 0},i.deferFocusInput=function(){i.cancelFocusInput(),i.inputFocusTimeout=setTimeout(function(){return i.setFocus()},1)},i.handleDropdownFocus=function(){i.cancelFocusInput()},i.handleBlur=function(e){var t,n;(!i.state.open||i.props.withPortal||i.props.showTimeInput)&&(null===(n=(t=i.props).onBlur)||void 0===n||n.call(t,e)),i.state.open&&!1===i.props.open&&i.setOpen(!1),i.setState({focused:!1})},i.handleCalendarClickOutside=function(e){var t,n;i.props.inline||i.setOpen(!1),null===(n=(t=i.props).onClickOutside)||void 0===n||n.call(t,e),i.props.withPortal&&e.preventDefault()},i.handleChange=function(){for(var e,t,n,o,a,s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];var u=s[0];if(!i.props.onChangeRaw||(i.props.onChangeRaw.apply(i,s),u&&"function"==typeof u.isDefaultPrevented&&!u.isDefaultPrevented())){i.setState({inputValue:(null==u?void 0:u.target)instanceof HTMLInputElement?u.target.value:null,lastPreSelectChange:pP});var c=i.props,d=c.selectsRange,p=c.startDate,f=c.endDate,m=null!==(e=i.props.dateFormat)&&void 0!==e?e:r.defaultProps.dateFormat,h=null!==(t=i.props.strictParsing)&&void 0!==t?t:r.defaultProps.strictParsing,v=(null==u?void 0:u.target)instanceof HTMLInputElement?u.target.value:"";if(d){var y=v.split(m.includes("-")?" - ":"-",2).map(function(e){return e.trim()}),g=y[0],b=y[1],A=LI(null!=g?g:"",m,i.props.locale,h),w=LI(null!=b?b:"",m,i.props.locale,h),k=(null==p?void 0:p.getTime())!==(null==A?void 0:A.getTime()),E=(null==f?void 0:f.getTime())!==(null==w?void 0:w.getTime());if(!k&&!E)return;if(A&&iT(A,i.props))return;if(w&&iT(w,i.props))return;null===(o=(n=i.props).onChange)||void 0===o||o.call(n,[A,w],u)}else{var C=LI(v,m,i.props.locale,h,null!==(a=i.props.selected)&&void 0!==a?a:void 0);!C&&v||i.setSelected(C,u,!0)}}},i.handleSelect=function(e,t,n){if(!i.props.readOnly)if(i.props.shouldCloseOnSelect&&!i.props.showTimeSelect&&i.sendFocusBackToInput(),i.props.onChangeRaw&&i.props.onChangeRaw(t),i.setSelected(e,t,!1,n),i.props.showDateSelect&&i.setState({isRenderAriaLiveMessage:!0}),!i.props.shouldCloseOnSelect||i.props.showTimeSelect)i.setPreSelection(e);else if(!i.props.inline){i.props.selectsRange||i.setOpen(!1);var r=i.props,o=r.startDate,a=r.endDate;!o||a||!i.props.swapRange&&PT(e,o)||i.setOpen(!1)}},i.setSelected=function(e,t,n,r){var o,a,s=e;if(i.props.showYearPicker){if(null!==s&&pT(m_(s),i.props))return}else if(i.props.showMonthYearPicker){if(null!==s&&sT(s,i.props))return}else if(null!==s&&iT(s,i.props))return;var l=i.props,u=l.onChange,c=l.selectsRange,d=l.startDate,p=l.endDate,f=l.selectsMultiple,m=l.selectedDates,h=l.minTime,v=l.swapRange;if(!ZI(i.props.selected,s)||i.props.allowSameDay||c||f)if(null!==s&&(!i.props.selected||n&&(i.props.showTimeSelect||i.props.showTimeSelectOnly||i.props.showTimeInput)||(s=VI(s,{hour:g_(i.props.selected),minute:b_(i.props.selected),second:A_(i.props.selected)})),n||!i.props.showTimeSelect&&!i.props.showTimeSelectOnly||h&&(s=VI(s,{hour:h.getHours(),minute:h.getMinutes(),second:h.getSeconds()})),i.props.inline||i.setState({preSelection:s}),i.props.focusSelectedMonth||i.setState({monthSelectedIn:r})),c){var y=d&&p;d||p?d&&!p&&(null===s?null==u||u([null,null],t):PT(s,d)?v?null==u||u([s,d],t):null==u||u([s,null],t):null==u||u([d,s],t)):null==u||u([s,null],t),y&&(null==u||u([s,null],t))}else if(f){if(null!==s)if(null==m?void 0:m.length)if(m.some(function(e){return JI(e,s)})){var g=m.filter(function(e){return!JI(e,s)});null==u||u(g,t)}else null==u||u(PI(PI([],m,!0),[s],!1),t);else null==u||u([s],t)}else null==u||u(s,t);n||(null===(a=(o=i.props).onSelect)||void 0===a||a.call(o,s,t),i.setState({inputValue:null}))},i.setPreSelection=function(e){if(!i.props.readOnly){var t=So(i.props.minDate),n=So(i.props.maxDate),r=!0;if(e){var o=QI(e);if(t&&n)r=eT(e,i.props.minDate,i.props.maxDate);else if(t){var a=QI(i.props.minDate);r=M_(e,a)||ZI(o,a)}else if(n){var s=GI(i.props.maxDate);r=r_(e,s)||ZI(o,s)}}r&&i.setState({preSelection:e})}},i.toggleCalendar=function(){i.setOpen(!i.state.open)},i.handleTimeChange=function(e){var t,n;if(!i.props.selectsRange&&!i.props.selectsMultiple){var r=i.props.selected?i.props.selected:i.getPreSelection(),o=i.props.selected?e:VI(r,{hour:g_(e),minute:b_(e)});i.setState({preSelection:o}),null===(n=(t=i.props).onChange)||void 0===n||n.call(t,o),i.props.shouldCloseOnSelect&&!i.props.showTimeInput&&(i.sendFocusBackToInput(),i.setOpen(!1)),i.props.showTimeInput&&i.setOpen(!0),(i.props.showTimeSelectOnly||i.props.showTimeSelect)&&i.setState({isRenderAriaLiveMessage:!0}),i.setState({inputValue:null})}},i.onInputClick=function(){var e,t;i.props.disabled||i.props.readOnly||i.setOpen(!0),null===(t=(e=i.props).onInputClick)||void 0===t||t.call(e)},i.onInputKeyDown=function(e){var t,n,r,o,a,s;null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e);var l=e.key;if(i.state.open||i.props.inline||i.props.preventOpenOnFocus){if(i.state.open){if(l===BI.ArrowDown||l===BI.ArrowUp){e.preventDefault();var u=i.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":i.props.showWeekPicker&&i.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':i.props.showFullMonthYearPicker||i.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',c=(null===(o=i.calendar)||void 0===o?void 0:o.containerRef.current)instanceof Element&&i.calendar.containerRef.current.querySelector(u);return void(c instanceof HTMLElement&&c.focus({preventScroll:!0}))}var d=MI(i.state.preSelection);l===BI.Enter?(e.preventDefault(),e.target.blur(),i.inputOk()&&i.state.lastPreSelectChange===fP?(i.handleSelect(d,e),!i.props.shouldCloseOnSelect&&i.setPreSelection(d)):i.setOpen(!1)):l===BI.Escape?(e.preventDefault(),e.target.blur(),i.sendFocusBackToInput(),i.setOpen(!1)):l===BI.Tab&&i.setOpen(!1),i.inputOk()||null===(s=(a=i.props).onInputError)||void 0===s||s.call(a,{code:1,msg:cP})}}else l!==BI.ArrowDown&&l!==BI.ArrowUp&&l!==BI.Enter||null===(r=i.onInputClick)||void 0===r||r.call(i)},i.onPortalKeyDown=function(e){e.key===BI.Escape&&(e.preventDefault(),i.setState({preventFocus:!0},function(){i.setOpen(!1),setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})}))},i.onDayKeyDown=function(e){var t,n,r,o,a,s,l=i.props,u=l.minDate,c=l.maxDate,d=l.disabledKeyboardNavigation,p=l.showWeekPicker,f=l.shouldCloseOnSelect,m=l.locale,h=l.calendarStartDay,v=l.adjustDateOnChange,y=l.inline;if(null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e),!d){var g=e.key,b=e.shiftKey,A=MI(i.state.preSelection),w=function(e,t){var n=t;switch(e){case BI.ArrowRight:n=p?N_(t,1):Hi(t,1);break;case BI.ArrowLeft:n=p?Q_(t,1):function(e,t,n){return Hi(e,-t,n)}(t,1);break;case BI.ArrowUp:n=Q_(t,1);break;case BI.ArrowDown:n=N_(t,1);break;case BI.PageUp:n=b?O_(t,1):k_(t,1);break;case BI.PageDown:n=b?__(t,1):w_(t,1);break;case BI.Home:n=zI(t,m,h);break;case BI.End:n=function(e){return function(e,t){const n=ei(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Bo(e,t?.in),i=o.getDay(),a=6+(i<r?-7:0)-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}(e)}(t)}return n};if(g===BI.Enter)return e.preventDefault(),i.handleSelect(A,e),void(!f&&i.setPreSelection(A));if(g===BI.Escape)return e.preventDefault(),i.setOpen(!1),void(i.inputOk()||null===(o=(r=i.props).onInputError)||void 0===o||o.call(r,{code:1,msg:cP}));var k=null;switch(g){case BI.ArrowLeft:case BI.ArrowRight:case BI.ArrowUp:case BI.ArrowDown:case BI.PageUp:case BI.PageDown:case BI.Home:case BI.End:k=function(e,t){for(var n=e,r=!1,o=0,a=w(e,t);!r;){if(o>=40){a=t;break}u&&a<u&&(n=BI.ArrowRight,a=iT(u,i.props)?w(n,a):u),c&&a>c&&(n=BI.ArrowLeft,a=iT(c,i.props)?w(n,a):c),iT(a,i.props)?(n!==BI.PageUp&&n!==BI.Home||(n=BI.ArrowRight),n!==BI.PageDown&&n!==BI.End||(n=BI.ArrowLeft),a=w(n,a)):r=!0,o++}return a}(g,A)}if(k){if(e.preventDefault(),i.setState({lastPreSelectChange:fP}),v&&i.setSelected(k),i.setPreSelection(k),y){var E=h_(A),C=h_(k),x=m_(A),S=m_(k);E!==C||x!==S?i.setState({shouldFocusDayInline:!0}):i.setState({shouldFocusDayInline:!1})}}else null===(s=(a=i.props).onInputError)||void 0===s||s.call(a,{code:1,msg:cP})}},i.onPopperKeyDown=function(e){e.key===BI.Escape&&(e.preventDefault(),i.sendFocusBackToInput(),i.setOpen(!1))},i.onClearClick=function(e){e&&e.preventDefault&&e.preventDefault(),i.sendFocusBackToInput();var t=i.props,n=t.selectsRange,r=t.onChange;n?null==r||r([null,null],e):null==r||r(null,e),i.setState({inputValue:null})},i.clear=function(){i.onClearClick()},i.onScroll=function(e){"boolean"==typeof i.props.closeOnScroll&&i.props.closeOnScroll?e.target!==document&&e.target!==document.documentElement&&e.target!==document.body||i.setOpen(!1):"function"==typeof i.props.closeOnScroll&&i.props.closeOnScroll(e)&&i.setOpen(!1)},i.renderCalendar=function(){var e,t;return i.props.inline||i.isCalendarOpen()?n().createElement(nP,TI({showMonthYearDropdown:void 0,ref:function(e){i.calendar=e}},i.props,i.state,{setOpen:i.setOpen,dateFormat:null!==(e=i.props.dateFormatCalendar)&&void 0!==e?e:r.defaultProps.dateFormatCalendar,onSelect:i.handleSelect,onClickOutside:i.handleCalendarClickOutside,holidays:xT(i.modifyHolidays()),outsideClickIgnoreClass:uP,onDropdownFocus:i.handleDropdownFocus,onTimeChange:i.handleTimeChange,className:i.props.calendarClassName,container:i.props.calendarContainer,handleOnKeyDown:i.props.onKeyDown,handleOnDayKeyDown:i.onDayKeyDown,setPreSelection:i.setPreSelection,dropdownMode:null!==(t=i.props.dropdownMode)&&void 0!==t?t:r.defaultProps.dropdownMode}),i.props.children):null},i.renderAriaLiveRegion=function(){var e,t=i.props,o=t.dateFormat,a=void 0===o?r.defaultProps.dateFormat:o,s=t.locale,l=i.props.showTimeInput||i.props.showTimeSelect?"PPPPp":"PPPP";return e=i.props.selectsRange?"Selected start date: ".concat(qI(i.props.startDate,{dateFormat:l,locale:s}),". ").concat(i.props.endDate?"End date: "+qI(i.props.endDate,{dateFormat:l,locale:s}):""):i.props.showTimeSelectOnly?"Selected time: ".concat(qI(i.props.selected,{dateFormat:a,locale:s})):i.props.showYearPicker?"Selected year: ".concat(qI(i.props.selected,{dateFormat:"yyyy",locale:s})):i.props.showMonthYearPicker?"Selected month: ".concat(qI(i.props.selected,{dateFormat:"MMMM yyyy",locale:s})):i.props.showQuarterYearPicker?"Selected quarter: ".concat(qI(i.props.selected,{dateFormat:"yyyy, QQQ",locale:s})):"Selected date: ".concat(qI(i.props.selected,{dateFormat:l,locale:s})),n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},e)},i.renderDateInput=function(){var t,o,a,s=Ud(i.props.className,((t={})[uP]=i.state.open,t)),l=i.props.customInput||n().createElement("input",{type:"text"}),u=i.props.customInputRef||"ref",c=i.props,d=c.dateFormat,p=void 0===d?r.defaultProps.dateFormat:d,f=c.locale,m="string"==typeof i.props.value?i.props.value:"string"==typeof i.state.inputValue?i.state.inputValue:i.props.selectsRange?function(e,t,n){if(!e)return"";var r=qI(e,n),o=t?qI(t,n):"";return"".concat(r).concat(" - ").concat(o)}(i.props.startDate,i.props.endDate,{dateFormat:p,locale:f}):i.props.selectsMultiple?function(e,t){if(!(null==e?void 0:e.length))return"";var n=e[0]?qI(e[0],t):"";if(1===e.length)return n;if(2===e.length&&e[1]){var r=qI(e[1],t);return"".concat(n,", ").concat(r)}var o=e.length-1;return"".concat(n," (+").concat(o,")")}(null!==(a=i.props.selectedDates)&&void 0!==a?a:[],{dateFormat:p,locale:f}):qI(i.props.selected,{dateFormat:p,locale:f});return(0,e.cloneElement)(l,((o={})[u]=function(e){i.input=e},o.value=m,o.onBlur=i.handleBlur,o.onChange=i.handleChange,o.onClick=i.onInputClick,o.onFocus=i.handleFocus,o.onKeyDown=i.onInputKeyDown,o.id=i.props.id,o.name=i.props.name,o.form=i.props.form,o.autoFocus=i.props.autoFocus,o.placeholder=i.props.placeholderText,o.disabled=i.props.disabled,o.autoComplete=i.props.autoComplete,o.className=Ud(l.props.className,s),o.title=i.props.title,o.readOnly=i.props.readOnly,o.required=i.props.required,o.tabIndex=i.props.tabIndex,o["aria-describedby"]=i.props.ariaDescribedBy,o["aria-invalid"]=i.props.ariaInvalid,o["aria-labelledby"]=i.props.ariaLabelledBy,o["aria-required"]=i.props.ariaRequired,o))},i.renderClearButton=function(){var e=i.props,t=e.isClearable,r=e.disabled,o=e.selected,a=e.startDate,s=e.endDate,l=e.clearButtonTitle,u=e.clearButtonClassName,c=void 0===u?"":u,d=e.ariaLabelClose,p=void 0===d?"Close":d,f=e.selectedDates,m=e.readOnly;return!t||m||null==o&&null==a&&null==s&&!(null==f?void 0:f.length)?null:n().createElement("button",{type:"button",className:Ud("react-datepicker__close-icon",c,{"react-datepicker__close-icon--disabled":r}),disabled:r,"aria-label":p,onClick:i.onClearClick,title:l,tabIndex:-1})},i.state=i.calcInitialState(),i.preventFocusTimeout=void 0,i}return II(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,readOnly:!1,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:12,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.componentDidUpdate=function(e,t){var n,r,o,i,a,s;e.inline&&(a=e.selected,s=this.props.selected,a&&s?h_(a)!==h_(s)||m_(a)!==m_(s):a!==s)&&this.setPreSelection(this.props.selected),void 0!==this.state.monthSelectedIn&&e.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),e.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:CT(this.props.highlightDates)}),t.focused||ZI(e.selected,this.props.selected)||this.setState({inputValue:null}),t.open!==this.state.open&&(!1===t.open&&!0===this.state.open&&(null===(r=(n=this.props).onCalendarOpen)||void 0===r||r.call(n)),!0===t.open&&!1===this.state.open&&(null===(i=(o=this.props).onCalendarClose)||void 0===i||i.call(o)))},r.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.renderInputContainer=function(){var e=this.props,t=e.showIcon,r=e.icon,o=e.calendarIconClassname,i=e.calendarIconClassName,a=e.toggleCalendarOnIconClick,s=this.state.open;return o&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),n().createElement("div",{className:"react-datepicker__input-container".concat(t?" react-datepicker__view-calendar-icon":"")},t&&n().createElement(rP,TI({icon:r,className:Ud(i,!i&&o,s&&"react-datepicker-ignore-onclickoutside")},a?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},r.prototype.render=function(){var e=this.renderCalendar();if(this.props.inline)return e;if(this.props.withPortal){var t=this.state.open?n().createElement(aP,{enableTabLoop:this.props.enableTabLoop},n().createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},e)):null;return this.state.open&&this.props.portalId&&(t=n().createElement(oP,TI({portalId:this.props.portalId},this.props),t)),n().createElement("div",null,this.renderInputContainer(),t)}return n().createElement(lP,TI({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:e,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},r}(e.Component),pP="input",fP="navigate",mP=a("./node_modules/css-loader/dist/cjs.js!./node_modules/react-datepicker/dist/react-datepicker.css"),hP={};hP.styleTagTransform=nl(),hP.setAttributes=Js(),hP.insert=Ks().bind(null,"head"),hP.domAPI=Gs(),hP.insertStyleElement=el(),Hs()(mP.A,hP),mP.A&&mP.A.locals&&mP.A.locals;var vP=["width","height","color"];function yP(){return yP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yP.apply(null,arguments)}var gP=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,vP);return n().createElement("svg",yP({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},l),n().createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:s}))};gP.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const bP=gP;var AP=["width","height","color"];function wP(){return wP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wP.apply(null,arguments)}var kP=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,AP);return n().createElement("svg",wP({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},l),n().createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03 .65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",fill:s}))};kP.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const EP=kP;var CP=function(e,t,n,r){return e.length===t.length&&n&&r?{original:e,masked:Qe(e,n,r,t)}:{original:e,masked:e}},xP=["selectedDate","onChange","label","required","placeholder","dateFormat","styleName","header","cardListContext","questionId","disabled","startDate","endDate","value","maskingType","maskingLength","inputProps","tooltip","showQuestionLabels"];function SP(){return SP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SP.apply(null,arguments)}function _P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return OP(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OP(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var IP=function(t){var r=t.selectedDate,o=t.onChange,i=t.label,a=t.required,s=t.placeholder,l=t.dateFormat,u=void 0===l?"MM/dd/yyyy":l,c=t.styleName,d=t.header,p=t.cardListContext,f=t.questionId,m=t.disabled,h=t.startDate,v=t.endDate,y=t.value,g=t.maskingType,b=t.maskingLength,A=t.inputProps,w=void 0===A?{}:A,k=t.tooltip,E=void 0===k?"":k,C=t.showQuestionLabels,x=void 0===C||C,S=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,xP),_=xc(),O=ZA(_,S.theme),I=(0,e.useRef)(""),T=(0,e.useRef)(y),P=(0,e.useRef)(""),B=w["data-item-index"],D=w["data-parent-id"],j=g&&b,R=_P((0,e.useState)(!1),2),M=R[0],L=R[1],N=_P((0,e.useState)({original:"",masked:""}),2),F=N[0],q=N[1],V=(0,e.useMemo)(function(){if(void 0!==y&&""!==y){if(y.length===u.length)try{var e=ra(y,u,new Date);if(e&&!Number.isNaN(e.getTime()))return e}catch(e){return null}return null}return r instanceof Date&&!Number.isNaN(r.getTime())?r:null},[y,r,u]),Q=void 0!==y&&""!==y?qe(y,u):"",z=_P((0,e.useState)(V),2),U=z[0],W=z[1],H=_P((0,e.useState)(Q),2),$=H[0],G=H[1],Y=_P((0,e.useState)(!1),2),K=Y[0],X=Y[1],J=(0,e.useRef)(!1);(0,e.useEffect)(function(){!J.current&&Q&&(q(CP(Q,u,j?g:void 0,j?b:void 0)),I.current=Q,P.current=Q,J.current=!0)},[]);var Z=(0,e.useMemo)(function(){return j?M?F.original:F.masked:F.original||$||(y?qe(y,u):"")},[F,M,j,$,y,u]),ee=function(e){if("string"!=typeof e||!e)return!1;var t=/M/.test(e),n=/y/.test(e),r=/[dD]/.test(e);return t&&n&&!r}(u),te=function(e,t){G(e),I.current=e,P.current=e,q(CP(e,u,j?g:void 0,j?b:void 0)),void 0!==t&&W(t)};(0,e.useEffect)(function(){var e=y!==T.current;T.current=y,function(e,t,n){if(void 0===e||""===e)return!1;var r=qe(e,u);return function(e,t){return K?P.current===e&&(X(!1),!0):!t}(r,t)||(t||P.current!==r?(X(!1),te(r,n)):n&&W(n)),!0}(y,e,V)||function(e,t){if(e&&!t){if(K)return!0;var n=Aa(e,u);return P.current===n?W(e):te(n,e),!0}return!1}(V,y)||function(e,t){!e&&!t&&(K||""!==P.current&&(G(""),P.current="",q({original:"",masked:""}),W(null)))}(y,V)},[y,V,u,K,j,g,b]);var re=void 0===B?f:"".concat(f,"-").concat(B);return n().createElement("div",{className:"form-field ".concat(c||""),style:tw(O.container)},d&&n().createElement("div",{className:"field-header",style:O.header},d),x&&i&&n().createElement("div",{className:"question_label",style:O.label},i,a&&n().createElement("span",{className:"required-mark",style:O.requiredMark},"*"),E&&n().createElement(gE,{tooltip:E})),n().createElement("div",{style:{position:"relative",display:"inline-block",width:"100%"}},n().createElement(dP,SP({selected:U,onChange:function(e){X(!1);var t=e?Aa(e,u):"";o&&t!==I.current&&o({target:{value:t,name:f,type:"date","data-item-index":B,"data-parent-id":D},cardListContext:p}),W(e),G(t),I.current=t,P.current=t,q(CP(t,u,j?g:void 0,j?b:void 0))},onChangeRaw:function(e){var t;if(null!=(null===(t=e.target)||void 0===t?void 0:t.value)){X(!0);var n=e.target.value||"",r=j&&!M&&(null==F?void 0:F.original)?function(e,t,n,r){return function(e,t,n,r,o){var i,a,s=(null==t||null===(i=t.nativeEvent)||void 0===i?void 0:i.inputType)||"",l=((null==t||null===(a=t.nativeEvent)||void 0===a?void 0:a.data)||"").replace(ne,""),u=n.replace(ne,"");if("insertText"===s&&l){var c="".concat(u).concat(l);return Ve(c,r,u)}if("deleteContentBackward"===s||"deleteContentForward"===s){var d=u.slice(0,Math.max(0,u.length-1));return Ve(d,r,u)}var p=e.replace(ne,"");return Ve(p,r,o)}(e,t,n.original,r,I.current)}(n,e,F,u):Ve(n,u,I.current);r!==I.current&&(e.target.value=r,G(r),I.current=r,P.current=r,j?function(e,t,n,r){q(CP(e,t,n,r))}(r,u,g,b):q({original:r,masked:r}),null==o||o({target:{value:r,name:f,type:"date","data-item-index":B,"data-parent-id":D},cardListContext:p}),function(e,t){e.length===t.length?W(function(e,t){if(e.length===t.length){try{var n=ra(e,t,new Date);if(n&&!Number.isNaN(n.getTime()))return n}catch(e){}return null}return e.length>0&&(e.length,t.length),null}(e,t)):(e.length>0&&e.length<t.length||""===e)&&W(null)}(r,u))}},onBlur:function(e){X(!1);var t=j?F.original:$;t&&t!==I.current&&o&&o({target:{value:t,name:f,type:"date","data-item-index":B,"data-parent-id":D},cardListContext:p})},onKeyDown:function(e){"Backspace"===e.key&&j&&L(!0)},dateFormat:u,placeholderText:s||"Enter date (".concat(u,")"),value:j?Z:$},S,{style:tw(O.input),name:re,showMonthYearPicker:ee,peekNextMonth:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",dateFormatCalendar:"MMMM",autoComplete:"off",disabled:m,minDate:h,maxDate:v,allowSameDay:!0,strictParsing:!1})),j&&n().createElement("button",{type:"button",name:"passwordEye",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-eye-icon",onClick:function(){return L(!M)},title:M?"Hide value":"Show value","aria-label":M?"Hide sensitive information":"Show sensitive information",style:{position:"absolute",right:"12px",top:"40%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#666",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1}},M?n().createElement(EP,null):n().createElement(bP,null))))};IP.propTypes={selectedDate:o().instanceOf(Date),onChange:o().func,label:o().string,required:o().bool,placeholder:o().string,dateFormat:o().string,styleName:o().string,header:o().string,cardListContext:o().object,questionId:o().string,disabled:o().bool,startDate:o().oneOfType([o().string,o().instanceOf(Date)]),endDate:o().oneOfType([o().string,o().instanceOf(Date)]),value:o().string,theme:o().object,maskingType:o().oneOf(["prefix","suffix"]),maskingLength:o().number,inputProps:o().object,tooltip:o().string,showQuestionLabels:o().bool};const TP=IP;function PP(e){return PP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},PP(e)}function BP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BP(Object(n),!0).forEach(function(t){jP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jP(e,t,n){return(t=function(e){var t=function(e){if("object"!=PP(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=PP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==PP(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var RP=function(t){var r,o=t.name,i=t.value,a=void 0===i?"":i,s=t.label,l=void 0===s?"":s,u=t.className,c=void 0===u?"":u,d=t.customTheme,p=void 0===d?{}:d,f=t.styleName,m=void 0===f?"":f,h=t.parentContext,v=void 0===h?{}:h,y=t.tooltip,g=void 0===y?"":y,b=t.showQuestionLabels,A=void 0===b||b,w=cc(),k=w.state,E=w.formSchema,C=k.values,x=void 0===C?{}:C,S=k.nestedStates,_=void 0===S?{}:S,O=xc(),I=null!==(r=null!=a?a:x[o])&&void 0!==r?r:"",T=(0,e.useMemo)(function(){return l?zn(l,x,_,v,E||[]):l},[l,x,_,v,E]),P=(0,e.useMemo)(function(){return zn(I,x,_,v,E||[])},[I,x,_,v,E]),B=(0,e.useMemo)(function(){var e=O.displayTextField||O.textField||{};return ZA(e,p)},[O,p]),D=(0,e.useMemo)(function(){var e=DP(DP({},B.container),{},{width:"100%"});return{container:ew(e,B.responsive),label:tw(B.label),content:tw(B.content)}},[B]);return n().createElement("div",{className:"display-text-field-container",style:D.container},A&&T&&n().createElement("div",{className:"question_label ".concat(c," ").concat(m||""),style:D.label},T,g&&n().createElement(gE,{tooltip:g})),P&&n().createElement("div",{className:"display-text-field__content ".concat(c," ").concat(m||""),style:D.content,dangerouslySetInnerHTML:"string"!=typeof P?{__html:Qx.sanitize(String(P),{ALLOWED_TAGS:["a","p","br","span","strong","em"],ALLOWED_ATTR:["href","target","rel"]})}:{__html:Qx.sanitize(P,{ALLOWED_TAGS:["a","p","br","span","strong","em"],ALLOWED_ATTR:["href","target","rel"]})}}))};RP.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,value:o().oneOfType([o().string,o().number,o().bool]),label:o().string,className:o().string,customTheme:o().object,styleName:o().string,parentContext:o().object,tooltip:o().string,showQuestionLabels:o().bool};const MP=RP;function LP(e){return LP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LP(e)}function NP(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return FP(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(FP(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,FP(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,FP(d,"constructor",u),FP(u,"constructor",l),l.displayName="GeneratorFunction",FP(u,o,"GeneratorFunction"),FP(d),FP(d,o,"Generator"),FP(d,r,function(){return this}),FP(d,"toString",function(){return"[object Generator]"}),(NP=function(){return{w:i,m:p}})()}function FP(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}FP=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){FP(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},FP(e,t,n,r)}function qP(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function VP(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){qP(i,r,o,a,s,"next",e)}function s(e){qP(i,r,o,a,s,"throw",e)}a(void 0)})}}function QP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?QP(Object(n),!0).forEach(function(t){UP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UP(e,t,n){return(t=function(e){var t=function(e){if("object"!=LP(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=LP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LP(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return HP(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HP(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $P=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.placeholder,l=t.disabled,u=t.className,c=t.loadOptions,d=t.apiUrl,p=t.apiBaseUrl,f=t.dependsOn,m=t.formData,h=t.customTheme,v=void 0===h?{}:h,y=t.inputProps,g=void 0===y?{}:y,b=t.styleName,A=t.onChange,w=xc(),k=WP((0,e.useState)([]),2),E=k[0],C=k[1],x=WP((0,e.useState)(!1),2),S=x[0],_=x[1],O=WP((0,e.useState)(""),2),I=O[0],T=O[1],P=g["data-item-index"],B=g["data-parent-id"],D=(0,e.useMemo)(function(){var e=w.dynamicDropdownField||w.selectField||{};return ZA(e,v)},[w,v]),j=(0,e.useMemo)(function(){var e=zP(zP({},D.container),{},{width:"100%"}),t=tw(D.select,l&&D.disabled,S&&D.loading,I&&D.error);return{container:ew(e,D.responsive),select:t,placeholder:D.placeholder,loadingIndicator:D.loadingIndicator,errorMessage:D.errorMessage}},[D,l,S,I]);(0,e.useEffect)(function(){var e=function(){var e=VP(NP().m(function e(t,n){var r,o,i;return NP().w(function(e){for(;;)switch(e.n){case 0:return r=p?"".concat(p.replace(/\/$/,""),"/").concat(t.replace(/^\//,"")):t,e.n=1,fetch(r);case 1:if((o=e.v).ok){e.n=2;break}throw new Error("Failed to fetch options");case 2:return e.n=3,o.json();case 3:return i=e.v,e.a(2,i.users.map(function(e){return{value:e.value||e.id,label:e.label||e.name}}))}},e)}));return function(t,n){return e.apply(this,arguments)}}(),t=function(){var t=VP(NP().m(function t(){var n,r,o;return NP().w(function(t){for(;;)switch(t.n){case 0:if(c||d){t.n=1;break}return t.a(2);case 1:if(t.p=1,_(!0),T(""),n=null==f?void 0:f.reduce(function(e,t){return e[t]=m[t],e},{}),!c){t.n=3;break}return t.n=2,c(n);case 2:r=t.v,t.n=5;break;case 3:if(!d){t.n=5;break}return t.n=4,e(d,n);case 4:r=t.v;case 5:C(r||[]),t.n=7;break;case 6:t.p=6,o=t.v,T("Failed to load options"),console.error("Error loading options:",o);case 7:return t.p=7,_(!1),t.f(7);case 8:return t.a(2)}},t,null,[[1,6,7,8]])}));return function(){return t.apply(this,arguments)}}();(!f||f.every(function(e){return m[e]}))&&t()},[c,d,p,f,m]);var R=function(e){A&&(null==A||A(e))};return n().createElement(NE,{name:r,label:o,validation:a,className:"dynamic-dropdown-field ".concat(b||""," ").concat(u||""),customTheme:D,error:I,value:i,renderInput:function(e){var t=e.value,o=e.disabled;return S?n().createElement("div",{style:j.loadingIndicator},"Loading options..."):n().createElement("select",{name:void 0===P?r:"".concat(r,"-").concat(P),value:t||"",onChange:R,disabled:o||S,style:j.select,"data-item-index":P,"data-parent-id":B},s&&n().createElement("option",{value:"",style:j.placeholder},s),E.map(function(e){return n().createElement("option",{key:e.value,value:e.value},e.label)}))}},I&&n().createElement("div",{style:j.errorMessage},I))};function GP(e){return GP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GP(e)}function YP(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(GP(e)+" is not iterable")}function KP(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return XP(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(XP(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,XP(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,XP(d,"constructor",u),XP(u,"constructor",l),l.displayName="GeneratorFunction",XP(u,o,"GeneratorFunction"),XP(d),XP(d,o,"Generator"),XP(d,r,function(){return this}),XP(d,"toString",function(){return"[object Generator]"}),(KP=function(){return{w:i,m:p}})()}function XP(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}XP=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){XP(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},XP(e,t,n,r)}function JP(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function ZP(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){JP(i,r,o,a,s,"next",e)}function s(e){JP(i,r,o,a,s,"throw",e)}a(void 0)})}}function eB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eB(Object(n),!0).forEach(function(t){nB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nB(e,t,n){return(t=function(e){var t=function(e){if("object"!=GP(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=GP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==GP(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}$P.propTypes={name:o().string.isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),validation:o().object,placeholder:o().string,disabled:o().bool,className:o().string,loadOptions:o().func,apiUrl:o().string,apiBaseUrl:o().string,dependsOn:o().arrayOf(o().string),formData:o().object,customTheme:o().object,inputProps:o().object,styleName:o().string,onChange:o().func};var rB=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t){if(t.startsWith("http://")||t.startsWith("https://"))return t;var n=e||"",r=t.startsWith("/")?"":"/";return"".concat(n).concat(r).concat(t)}return e||""},oB=function(e){var t,n={Accept:"application/json"},r=(null==e||null===(t=e.customApi)||void 0===t?void 0:t.headers)||{};r.Authorization&&(n.Authorization=r.Authorization);var o=r["Carrier-Auth"]||r.carrierauthorization||r.Carrierauthorization||r.CarrierAuthorization||r.Carrierauthorization||r.CarrierAuth||r["carrier-authorization"]||null;return o&&(n.carrierauthorization=o,n["Carrier-Auth"]=o,n.CarrierAuthorization=o),n},iB=function(e,t){return e?t:tB({"Content-Type":"application/json"},t)},aB=function(e,t){return e?t:null!=t?JSON.stringify(t):void 0},sB=function(){var e=ZP(KP().m(function e(t){var n;return KP().w(function(e){for(;;)switch(e.n){case 0:if(!(t.headers.get("Content-Type")||"").includes("application/json")){e.n=2;break}return e.n=1,t.json();case 1:n=e.v,e.n=4;break;case 2:return e.n=3,t.text();case 3:n=e.v;case 4:return e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),lB=function(e,t){var n=new Error((null==e?void 0:e.message)||t.statusText);return n.status=t.status,n.data=e,n},uB=function(e,t,n){return(null==e||e>=500||429===e)&&t<n},cB=function(){var e=ZP(KP().m(function e(t){var n,r,o,i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,A,w,k;return KP().w(function(e){for(;;)switch(e.n){case 0:n=t.url,r=t.method,o=void 0===r?"GET":r,i=t.headers,a=void 0===i?{}:i,s=t.body,l=void 0===s?void 0:s,u=t.isFormData,c=void 0!==u&&u,d=t.timeoutMs,p=void 0===d?3e4:d,f=t.apiConfig,m=void 0===f?{}:f,h=Number((null==m?void 0:m.MAX_API_ATTEMPTS)||3),v=tB(tB({},oB(m)),a),y=new AbortController,g=setTimeout(function(){return y.abort()},p),A=KP().m(function e(){var t,r,i,a,s,u,d,p,f;return KP().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,r=iB(c,v),i=aB(c,l),a=(null==m||null===(t=m.customApi)||void 0===t?void 0:t.credentials)||(null==m?void 0:m.credentials)||"omit",e.n=1,fetch(n,{method:o,headers:r,body:i,credentials:a,mode:"cors",signal:y.signal});case 1:return s=e.v,e.n=2,sB(s);case 2:if(u=e.v,!s.ok){e.n=3;break}return clearTimeout(g),e.a(2,{v:u});case 3:throw lB(u,s);case 4:case 6:e.n=8;break;case 5:if(e.p=5,f=e.v,b=f,d=null==f?void 0:f.status,!uB(d,k,h)){e.n=7;break}return p=300*Math.pow(2,k-1),e.n=6,new Promise(function(e){return setTimeout(e,p)});case 7:return e.a(2,0);case 8:return e.a(2)}},e,null,[[0,5]])}),k=1;case 1:if(!(k<=h)){e.n=5;break}return e.d(YP(A()),2);case 2:if(0!==(w=e.v)){e.n=3;break}return e.a(3,5);case 3:if(!w){e.n=4;break}return e.a(2,w.v);case 4:k++,e.n=1;break;case 5:throw b||new Error("Request failed");case 6:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),dB=function(){var e=ZP(KP().m(function e(t){var n,r,o,i,a,s,l,u=arguments;return KP().w(function(e){for(;;)if(0===e.n)return o=u.length>1&&void 0!==u[1]?u[1]:{},(i=new FormData).append("file",t),a=(null==o||null===(n=o.customApi)||void 0===n?void 0:n.baseUrl)||"",s=(null==o||null===(r=o.customApi)||void 0===r?void 0:r.convertToPdfUrl)||"",l=rB(a,s),e.a(2,cB({url:l,method:"POST",body:i,isFormData:!0,apiConfig:o}))},e)}));return function(t){return e.apply(this,arguments)}}(),pB=function(){var e=ZP(KP().m(function e(t,n){var r,o,i,a,s,l,u=arguments;return KP().w(function(e){for(;;)if(0===e.n)return a=(null==(i=u.length>2&&void 0!==u[2]?u[2]:{})||null===(r=i.customApi)||void 0===r?void 0:r.baseUrl)||"",s=(null==i||null===(o=i.customApi)||void 0===o?void 0:o.uploadUrl)||"",l="".concat(rB(a,s),"?caseId=").concat(encodeURIComponent(n||""),"&user=agent"),e.a(2,cB({url:l,method:"POST",body:t,apiConfig:i}))},e)}));return function(t,n){return e.apply(this,arguments)}}(),fB=function(){var e=ZP(KP().m(function e(t,n,r){var o,i,a,s,l,u,c=arguments;return KP().w(function(e){for(;;)if(0===e.n)return s=(null==(a=c.length>3&&void 0!==c[3]?c[3]:{})||null===(o=a.customApi)||void 0===o?void 0:o.baseUrl)||"",l=(null==a||null===(i=a.customApi)||void 0===i?void 0:i.deleteUrl)||"",u="".concat(rB(s,l),"?caseId=").concat(encodeURIComponent(n||""),"&documentId=").concat(encodeURIComponent(t||""),"&questionId=").concat(encodeURIComponent(r||"")),e.a(2,cB({url:u,method:"DELETE",apiConfig:a}))},e)}));return function(t,n,r){return e.apply(this,arguments)}}();function mB(e){return mB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mB(e)}function hB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hB(Object(n),!0).forEach(function(t){yB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yB(e,t,n){return(t=function(e){var t=function(e){if("object"!=mB(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gB=function(e){var t,r,o,i,a,s=e.file,l=e.index,u=e.fileStyles,c=e.includeExtraDropDowns,d=e.uploadQuestionAdditionalDropDown,p=e.allowDelete,f=e.disabled,m=e.fieldError,h=e.onDocumentTypeChange,v=e.onView,y=e.onDelete,g=s.fileName||s.name||"",b=(null==d||null===(t=d[0])||void 0===t?void 0:t.title)||(null==d||null===(r=d[0])||void 0===r?void 0:r.label)||"Attachment Type",A=null!==(o=null==d||null===(i=d[0])||void 0===i?void 0:i.options)&&void 0!==o?o:[],w=void 0===s.dropDownOptionSelection||null===s.dropDownOptionSelection||""===String(s.dropDownOptionSelection||"").trim();return n().createElement("tr",null,n().createElement("td",{style:vB(vB({},u.tableCell),u.documentNameCell),title:g},g),c&&(null==d?void 0:d.length)>0&&n().createElement("td",{style:vB(vB({},u.tableCell),u.documentTypeCell)},n().createElement("select",{value:null!==(a=s.dropDownOptionSelection)&&void 0!==a?a:"",onChange:function(e){return h(l,e.target.value)},disabled:f,style:u.documentTypeSelect,"aria-label":"Document type for ".concat(g||"file")},n().createElement("option",{value:"",disabled:!0},"Select Attachment"),A.map(function(e){var t="object"===mB(e)&&null!==e?e.value:e,r="object"===mB(e)&&null!==e?e.label:e;return n().createElement("option",{key:null!=t?t:r,value:null!=t?t:r},null!=r?r:t)})),w&&n().createElement("span",{style:u.errorItem},m?Array.isArray(m)?m[0]:"string"==typeof m&&m.split(", ").filter(Boolean)[0]||m:"Provide ".concat(b.toLowerCase()))),n().createElement("td",{style:u.tableCell},s.fileType||(s.fileName?s.fileName.split(".").pop().toUpperCase():"")),n().createElement("td",{style:u.tableCell},null!=s.fileSize?Cs(ks(s.fileSize)):"0 Bytes"),n().createElement("td",{style:u.tableCell},n().createElement("div",{style:u.actionButtonGroup},n().createElement("button",{type:"button",onClick:function(){return v(s)},style:vB(vB({},u.actionButton),u.viewButton),"aria-label":"Preview ".concat(g||"document")},"View"),p&&n().createElement("button",{type:"button",onClick:function(){return y(l)},style:vB(vB({},u.actionButton),u.removeButton),"aria-label":"Delete ".concat(g||"document")},"Delete"))))};gB.propTypes={file:o().shape({id:o().oneOfType([o().string,o().number]),value:o().string,fileName:o().string,name:o().string,fileType:o().string,fileSize:o().oneOfType([o().number,o().string]),dropDownOptionSelection:o().string}).isRequired,index:o().number.isRequired,fileStyles:o().object.isRequired,includeExtraDropDowns:o().bool.isRequired,uploadQuestionAdditionalDropDown:o().array,allowDelete:o().bool.isRequired,disabled:o().bool.isRequired,fieldError:o().oneOfType([o().string,o().arrayOf(o().string),o().oneOf([null])]),onDocumentTypeChange:o().func.isRequired,onView:o().func.isRequired,onDelete:o().func.isRequired};const bB=gB;function AB(e){return AB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AB(e)}function wB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wB(Object(n),!0).forEach(function(t){EB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function EB(e,t,n){return(t=function(e){var t=function(e){if("object"!=AB(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=AB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==AB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CB(e){return CB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CB(e)}function xB(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=IB(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function SB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return _B(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(_B(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_B(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,_B(d,"constructor",u),_B(u,"constructor",l),l.displayName="GeneratorFunction",_B(u,o,"GeneratorFunction"),_B(d),_B(d,o,"Generator"),_B(d,r,function(){return this}),_B(d,"toString",function(){return"[object Generator]"}),(SB=function(){return{w:i,m:p}})()}function _B(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}_B=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){_B(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},_B(e,t,n,r)}function OB(e){return function(e){if(Array.isArray(e))return TB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||IB(e)||function(){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 IB(e,t){if(e){if("string"==typeof e)return TB(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TB(e,t):void 0}}function TB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function PB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PB(Object(n),!0).forEach(function(t){DB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DB(e,t,n){return(t=function(e){var t=function(e){if("object"!=CB(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=CB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==CB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jB(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function RB(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){jB(i,r,o,a,s,"next",e)}function s(e){jB(i,r,o,a,s,"throw",e)}a(void 0)})}}function MB(e){return((null==e?void 0:e.name)||"").toLowerCase().endsWith(".pdf")||"application/pdf"===((null==e?void 0:e.type)||"").toLowerCase()}function LB(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){var e=r.result||"",n=e.includes(",")?e.slice(e.indexOf(",")+1):e;t(n)},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)})}function NB(e,t){return FB.apply(this,arguments)}function FB(){return(FB=RB(SB().m(function e(t,n){var r,o,i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,A,w,k,E,C,x,S,_,O,I,T,P;return SB().w(function(e){for(;;)switch(e.n){case 0:if(s=n.questionId,l=n.apiConfig,u=n.uploadQuestionAdditionalDropDown,c=void 0===u?[]:u,d=n.currentFiles,p=void 0===d?[]:d,f={dropDownTitle:(null==c||null===(r=c[0])||void 0===r?void 0:r.label)||(null==c||null===(o=c[0])||void 0===o?void 0:o.title)||"Attachment Type",dropDownOptionSelection:""},!MB(t)){e.n=2;break}return e.n=1,LB(t);case 1:v=e.v,m={questionId:s,fileUploads:BB({fileName:t.name||"document.pdf",base64Response:"data:application/pdf;base64,".concat(v),fileSize:t.size,fileType:"pdf"},f)},h=BB({id:void 0,value:void 0,fileName:t.name||"document.pdf",base64Response:m.fileUploads.base64Response,fileType:"pdf",fileSize:t.size},f),e.n=4;break;case 2:return e.n=3,dB(t,l);case 3:k=e.v,E=null==k||null===(y=k.data)||void 0===y?void 0:y.fileData,C=(null==k||null===(g=k.data)||void 0===g?void 0:g.fileName)||(null==t?void 0:t.name)||"document.pdf",x=null!==(b=null!==(A=null==k||null===(w=k.data)||void 0===w?void 0:w.fileSize)&&void 0!==A?A:null==t?void 0:t.size)&&void 0!==b?b:0,m={questionId:s,fileUploads:BB({fileName:C,base64Response:"data:application/pdf;base64,".concat(E),fileSize:x,fileType:"pdf"},f)},h=BB({id:void 0,value:void 0,fileName:m.fileUploads.fileName,base64Response:m.fileUploads.base64Response,fileType:"pdf",fileSize:x},f);case 4:return S=[].concat(OB(p),[h]),_=(null==l||null===(i=l.customApi)||void 0===i||null===(i=i.headers)||void 0===i?void 0:i.caseId)||(null==l?void 0:l.caseId),e.n=5,pB(m,_,l);case 5:return O=e.v,I=(null==O?void 0:O.data)||{},T=OB(S),P=T.length-1,T[P]=BB(BB({},T[P]),{},{id:I.id,value:I.value,fileName:I.actualFileName||T[P].fileName,fileType:I.fileType||"pdf",fileSize:null!==(a=I.fileSize)&&void 0!==a?a:T[P].fileSize,base64Response:null}),e.a(2,T)}},e)}))).apply(this,arguments)}function qB(e){return VB.apply(this,arguments)}function VB(){return(VB=RB(SB().m(function e(t){var n,r,o,i,a;return SB().w(function(e){for(;;)if(0===e.n){n=[],r=xB(t);try{for(r.s();!(o=r.n()).done;){i=o.value;try{(i instanceof File?i.type:i.type||"").startsWith("image/")||(i.fileName||"").match(Ee)?i instanceof File?(a=URL.createObjectURL(i),n.push(a)):i.base64Response?n.push(i.base64Response):n.push(null):n.push(null)}catch(e){console.error("Preview generation error:",e),n.push(null)}}}catch(e){r.e(e)}finally{r.f()}return e.a(2,n)}},e)}))).apply(this,arguments)}var QB=a("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/FileField.scss"),zB={};function UB(e){return UB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UB(e)}zB.styleTagTransform=nl(),zB.setAttributes=Js(),zB.insert=Ks().bind(null,"head"),zB.domAPI=Gs(),zB.insertStyleElement=el(),Hs()(QB.A,zB),QB.A&&QB.A.locals&&QB.A.locals;var WB=["questionId","label","value","validation","multiple","disabled","className","maxFileSize","maxFiles","showPreview","allowDelete","onError","customTheme","styleName","includeExtraDropDowns","uploadQuestionAdditionalDropDown","allowedFileType","fileSizeLimit","numberOfFiles","errorMessage","apiConfig","fileUploads"];function HB(){return HB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HB.apply(null,arguments)}function $B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$B(Object(n),!0).forEach(function(t){YB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YB(e,t,n){return(t=function(e){var t=function(e){if("object"!=UB(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=UB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KB(e){return function(e){if(Array.isArray(e))return rD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nD(e)||function(){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 XB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return JB(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(JB(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,JB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,JB(d,"constructor",u),JB(u,"constructor",l),l.displayName="GeneratorFunction",JB(u,o,"GeneratorFunction"),JB(d),JB(d,o,"Generator"),JB(d,r,function(){return this}),JB(d,"toString",function(){return"[object Generator]"}),(XB=function(){return{w:i,m:p}})()}function JB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}JB=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){JB(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},JB(e,t,n,r)}function ZB(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function eD(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ZB(i,r,o,a,s,"next",e)}function s(e){ZB(i,r,o,a,s,"throw",e)}a(void 0)})}}function tD(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||nD(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nD(e,t){if(e){if("string"==typeof e)return rD(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rD(e,t):void 0}}function rD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var oD=function(t){var r,o=t.questionId,i=t.label,a=t.value,s=void 0===a?null:a,l=t.validation,u=void 0===l?{}:l,c=t.multiple,d=void 0!==c&&c,p=t.disabled,f=void 0!==p&&p,m=t.className,h=void 0===m?"":m,v=t.maxFileSize,y=void 0===v?5242880:v,g=t.maxFiles,b=void 0===g?5:g,A=t.showPreview,w=void 0===A||A,k=t.allowDelete,E=void 0===k||k,C=t.onError,x=t.customTheme,S=void 0===x?{}:x,_=t.styleName,O=t.includeExtraDropDowns,I=void 0!==O&&O,T=t.uploadQuestionAdditionalDropDown,P=void 0===T?[]:T,B=t.allowedFileType,D=t.fileSizeLimit,j=t.numberOfFiles,R=(t.errorMessage,t.apiConfig),M=t.fileUploads,L=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,WB),N=cc(),F=N.state,q=N.setValue,V=xc(),Q=(0,e.useRef)(null),z=tD((0,e.useState)(M||[]),2),U=z[0],W=z[1],H=tD((0,e.useState)([]),2),$=H[0],G=H[1],Y=tD((0,e.useState)([]),2),K=Y[0],X=Y[1],J=tD((0,e.useState)(!1),2),Z=J[0],ee=J[1],te=tD((0,e.useState)(!1),2),ne=te[0],re=te[1],oe=tD((0,e.useState)(function(){var e=M;return null!=e&&e.length?null==e?void 0:e.map(function(){var e;return(null===(e=P[0])||void 0===e||null===(e=e.options[0])||void 0===e?void 0:e.value)||""}):[]}),2),ie=oe[0],ae=oe[1],se=(null==F||null===(r=F.errors)||void 0===r?void 0:r[o])||null,le=(0,e.useMemo)(function(){var e=V.fileField||{};return ZA(e,S)},[V,S]),ue=(0,e.useMemo)(function(){return function(e,t,n){var r=kB(kB({},e.container),{},{width:"100%"}),o=kB(kB({},tw(e.dropzone,t&&e.dropzoneActive,n&&e.dropzoneDisabled)),{},{borderWidth:"1px",borderStyle:"solid",borderColor:t?"#2563EB":n?"#D1D5DB":"#9CA3AF"});return{container:ew(r,e.responsive),dropzone:o,input:e.input,previewContainer:e.previewContainer,previewItem:e.previewItem,previewImage:e.previewImage,previewIcon:e.previewIcon,deleteBtn:e.deleteButton,error:e.error,errorList:e.errorList,errorItem:e.errorItem,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse",marginTop:"20px"},tableHeader:{backgroundColor:"#f5f5f5",padding:"12px",textAlign:"left",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"#ddd"},tableCell:{padding:"12px",verticalAlign:"middle",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"#ddd"},documentNameHeader:{width:"35%"},documentNameCell:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},documentTypeHeader:{width:"28%"},documentTypeCell:{minWidth:"180px"},documentTypeSelect:{width:"100%",minWidth:"160px",maxWidth:"100%",boxSizing:"border-box"},actionButtonGroup:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},actionButton:{padding:"6px 12px",marginRight:"0",borderWidth:"0",borderRadius:"4px",cursor:"pointer"},viewButton:{backgroundColor:"#4CAF50",color:"white"},removeButton:{backgroundColor:"#f44336",color:"white"},uploadOverlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.85)",borderRadius:"4px",zIndex:10,gap:"12px"},uploadSpinner:{width:"32px",height:"32px",border:"3px solid #e9ecef",borderTopColor:"#2563EB",borderRadius:"50%"},uploadLabel:{fontSize:"14px",color:"#374151",fontWeight:500}}}(le,Z,f)},[le,Z,f]);(0,e.useEffect)(function(){try{var e,t,n=(null==P||null===(e=P[0])||void 0===e?void 0:e.label)||(null==P||null===(t=P[0])||void 0===t?void 0:t.title)||"Attachment Type",r=ws({value:s,fileUploads:M,dropdownTitle:n});Array.isArray(r)&&r.length>0&&(W(r),qB(r).then(G))}catch(e){console.error("Error initializing file field:",e)}},[]);var ce=GA({questionId:o,defaultValue:s,defaultVisible:!0,defaultDisabled:f}).handleChange,de=(0,e.useCallback)(function(e){e._contextValue;var t=e.onChange,r=e.disabled,i=function(){var e=eD(XB().m(function e(t){var n;return XB().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),t.stopPropagation(),!r){e.n=1;break}return e.a(2);case 1:return ee(!1),n=Array.from(t.dataTransfer.files),e.n=2,l(n);case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),a=function(){var e=eD(XB().m(function e(t){var n;return XB().w(function(e){for(;;)switch(e.n){case 0:if(!r){e.n=1;break}return e.a(2);case 1:return n=Array.from(t.target.files),e.n=2,l(n);case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),s=function(){var e=eD(XB().m(function e(n){var i,a,s,l,u,c;return XB().w(function(e){for(;;)switch(e.n){case 0:if(!r){e.n=1;break}return e.a(2);case 1:if(i=U[n],e.p=2,null==i||!i.id){e.n=3;break}return s=(null==R||null===(a=R.customApi)||void 0===a||null===(a=a.headers)||void 0===a?void 0:a.caseId)||(null==R?void 0:R.caseId),e.n=3,fB(i.id,s,o,R);case 3:e.n=5;break;case 4:e.p=4,c=e.v,console.warn("Failed to delete document from server, removing locally:",c);case 5:l=U.filter(function(e,t){return t!==n}),u=$.filter(function(e,t){return t!==n}),W(l),G(u),t({value:l,fileUploads:l}),q(o,l);case 6:return e.a(2)}},e,null,[[2,4]])}));return function(t){return e.apply(this,arguments)}}(),l=function(){var e=eD(XB().m(function e(n){var r,i,a,s,l,u;return XB().w(function(e){for(;;)switch(e.n){case 0:if(n.length){e.n=1;break}return e.a(2);case 1:if(r=KB(U),i=n[0],a=Es([i],{allowedFileType:B,fileSizeLimit:D,numberOfFiles:j},r,null),!(s=a.error)){e.n=2;break}return X([]),il(s,"error"),null==C||C(s),e.a(2);case 2:return re(!0),e.p=3,e.n=4,NB(i,{questionId:o,apiConfig:R,uploadQuestionAdditionalDropDown:P,currentFiles:r});case 4:l=e.v,W(l),t({value:l,fileUploads:l}),q(o,l),qB(l).then(G),e.n=6;break;case 5:e.p=5,u=e.v,console.error("Upload error:",u),il((null==u?void 0:u.message)||"Upload failed","error"),null==C||C((null==u?void 0:u.message)||"Upload failed");case 6:return e.p=6,re(!1),e.f(6);case 7:return e.a(2)}},e,null,[[3,5,6,7]])}));return function(t){return e.apply(this,arguments)}}(),u=function(e,n){var r=KB(U);r[e]=GB(GB({},r[e]),{},{dropDownOptionSelection:n}),t({value:r.map(function(e){return{fileName:e.fileName,base64Response:e.base64Response,fileSize:e.fileSize,fileType:e.fileType,dropDownTitle:e.dropDownTitle,dropDownOptionSelection:e.dropDownOptionSelection}}),fileUploads:r}),q(o,r),ce(r),W(r)},c=function(e){return function(e,t){var n,r=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null==t||null===(e=t.customApi)||void 0===e?void 0:e.s3BucketUrl)||""}(t);if(null!=e&&e.value&&r)null===(n=ml.open)||void 0===n||n.call(ml,"".concat(r,"/").concat(e.value),"_blank");else if(null!=e&&e.base64Response){var o=ml.open?ml.open():null;o&&(o.document.write('\n <!DOCTYPE html>\n <html>\n <head>\n <title>Preview</title>\n <style>\n body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; }\n iframe { width: 100%; height: 100%; border: none; }\n </style>\n </head>\n <body>\n <iframe src="'.concat(e.base64Response,'"></iframe>\n </body>\n </html>\n ')),o.document.close())}}(e,R)},d=!j||!Array.isArray(U)||U.length<j,p=B?B.split(",").map(function(e){return e.trim().startsWith(".")?e.trim().toLowerCase():".".concat(e.trim().toLowerCase())}).join(","):void 0;return n().createElement("section",{onDragOver:function(e){e.preventDefault(),e.stopPropagation(),r||ee(!0)},onDragLeave:function(e){e.preventDefault(),e.stopPropagation(),ee(!1)},onDrop:i,style:ue.container,"aria-label":"File upload area"},d&&n().createElement("div",{style:{position:"relative",minHeight:"100px"}},n().createElement("input",{ref:Q,type:"file",accept:p,multiple:!1,onChange:a,disabled:r||ne,style:ue.input}),n().createElement("button",{type:"button",style:GB(GB({},ue.dropzone),{},{cursor:r||ne?"not-allowed":"pointer",width:"100%",textAlign:"left"}),onClick:function(){Q.current&&!r&&Q.current.click()},"aria-label":"Click to upload or drag and drop a file",disabled:r||ne,"aria-disabled":r||ne},n().createElement("p",null,"Click to Upload or Drag and Drop"),n().createElement("p",null,"Allowed file types: ",(B||"").toUpperCase())),ne&&n().createElement("div",{style:ue.uploadOverlay,role:"status","aria-live":"polite"},n().createElement("div",{className:"file-field-upload-spinner",style:ue.uploadSpinner}),n().createElement("span",{style:ue.uploadLabel},"Uploading..."))),U.length>0&&n().createElement("table",{style:ue.table},n().createElement("thead",null,n().createElement("tr",null,n().createElement("th",{style:GB(GB({},ue.tableHeader),ue.documentNameHeader)},"Document Name"),I&&P.length>0&&n().createElement("th",{style:GB(GB({},ue.tableHeader),ue.documentTypeHeader)},"Document Type"),n().createElement("th",{style:ue.tableHeader},"File Type"),n().createElement("th",{style:ue.tableHeader},"Size"),n().createElement("th",{style:ue.tableHeader},"Action"))),n().createElement("tbody",null,U.map(function(e,t){var o,i;return n().createElement(bB,{key:null!==(o=null!==(i=e.id)&&void 0!==i?i:e.value)&&void 0!==o?o:"file-".concat(t),file:e,index:t,fileStyles:ue,includeExtraDropDowns:I,uploadQuestionAdditionalDropDown:P,allowDelete:E,disabled:r,fieldError:se,onDocumentTypeChange:u,onView:c,onDelete:s})}))),K.length>0&&n().createElement("ul",{style:ue.errorList},K.map(function(e,t){return n().createElement("li",{key:"error-".concat(e,"-").concat(t),style:ue.errorItem},e)})))},[U,$,K,Z,ne,ie,ae,d,b,y,w,C]);return n().createElement(FE,HB({label:i,value:s,validation:u,disabled:f,className:h,renderInput:de,styleName:_,customTheme:S},L,{name:o}))},iD=n().memo(oD);oD.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().array,o().object,o().string,o().oneOf([null])]),validation:o().object,multiple:o().bool,disabled:o().bool,className:o().string,maxFileSize:o().number,maxFiles:o().number,showPreview:o().bool,allowDelete:o().bool,onError:o().func,customTheme:o().object,styleName:o().string,includeExtraDropDowns:o().bool,uploadQuestionAdditionalDropDown:o().arrayOf(o().shape({options:o().array})),allowedFileType:o().string,fileSizeLimit:o().number,numberOfFiles:o().number,errorMessage:o().string,apiConfig:o().shape({caseId:o().string,customApi:o().shape({headers:o().shape({caseId:o().string})})}),fileUploads:o().oneOfType([o().arrayOf(o().shape({id:o().oneOfType([o().string,o().number]),value:o().string,fileName:o().string,fileType:o().string,fileSize:o().oneOfType([o().number,o().string]),base64Response:o().string,dropDownTitle:o().string,dropDownOptionSelection:o().string})),o().oneOf([null])])},iD.propTypes=oD.propTypes;const aD=iD;var sD=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/HyperlinkField.css"),lD={};lD.styleTagTransform=nl(),lD.setAttributes=Js(),lD.insert=Ks().bind(null,"head"),lD.domAPI=Gs(),lD.insertStyleElement=el(),Hs()(sD.A,lD),sD.A&&sD.A.locals&&sD.A.locals;var uD=function(e){var t=e.name,r=e.label,o=e.value,i=e.validation,a=e.className,s=e.customTheme,l=void 0===s?{}:s,u=e.tooltip,c=void 0===u?"":u,d=xc(),p=ZA(d.hyperlinkField||{},l);return n().createElement(NE,{name:String(t),label:r,value:o,validation:i,className:"hyperlink-field ".concat(a||""),customTheme:p,renderLabel:function(e){var t=e.label,r=e.isRequired;return n().createElement("div",{style:p.container},n().createElement("div",{style:p.label,dangerouslySetInnerHTML:{__html:Qx.sanitize(t,{ADD_ATTR:["target","rel"],ALLOWED_TAGS:["a","p","br","span","strong","em"],ALLOWED_ATTR:["href","target","rel"]})}}),r&&n().createElement("span",{style:p.required},"*"),c&&n().createElement(gE,{tooltip:c}))},renderInput:function(){return null}})};uD.displayName="HyperlinkField",uD.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,validation:o().object,className:o().string,customTheme:o().object,tooltip:o().string};var cD=n().memo(uD);function dD(e){return dD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dD(e)}function pD(){return pD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pD.apply(null,arguments)}function fD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fD(Object(n),!0).forEach(function(t){hD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hD(e,t,n){return(t=function(e){var t=function(e){if("object"!=dD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=dD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}cD.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,target:o().string,validation:o().object,disabled:o().bool,className:o().string,customTheme:o().object,tooltip:o().string};var yD=function(e){if(e){var t=e.replace(/\D/g,"");return 9!==t.length?"SSN must be 9 digits":De.test(t)?"":"Invalid SSN format"}return""},gD=function(e){if(e){var t=e.replace(/\D/g,"");return 9!==t.length?"ITIN must be 9 digits":je.test(t)?"":"ITIN must start with 9"}return""},bD=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.type,l=void 0===s?"ssn":s,u=t.masked,c=void 0===u||u,d=t.disabled,p=t.className,f=t.customTheme,m=void 0===f?{}:f,h=xc(),v=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return vD(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vD(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(c),2),y=v[0],g=v[1],b=ZA(h.identificationField||{},m),A=function(){g(!y)},w=function(e){if(!e||!y)return e;var t=e.split("-");return 3===t.length?"XXX-XX-".concat(t[2]):"XXX-XX-"+e.slice(-4)};return n().createElement(NE,{name:r,label:o,value:i,validation:mD(mD({},a),{},{custom:"ssn"===l?yD:gD}),className:"identification-field ".concat(p||""),customTheme:b,renderInput:function(e){return n().createElement("div",{style:b.container},n().createElement("div",{style:b.fieldGroup},n().createElement("div",{style:b.row},n().createElement("div",{style:b.field},n().createElement("input",pD({},e,{type:"text",maxLength:11,disabled:d,style:mD(mD({},b.input),d&&b.disabled),value:w(e.value),onChange:function(t){return function(e,t){t(function(e){if(e){var t=e.replace(ne,""),n=t.match(Be);return n?"".concat(n[1],"-").concat(n[2],"-").concat(n[3]):t}return""}(e.target.value))}(t,e.onChange)}})),i&&n().createElement("button",{type:"button",onClick:A,style:mD(mD({},b.actionButton),{},{marginLeft:"8px"}),disabled:d},y?"Show":"Hide"))),n().createElement("div",{style:b.hint},"ssn"===l?"Format: XXX-XX-XXXX":"Format: 9XX-XX-XXXX")))}})};bD.propTypes={name:o().string.isRequired,label:o().string,value:o().string,validation:o().object,type:o().oneOf(["ssn","itin"]),masked:o().bool,disabled:o().bool,className:o().string,customTheme:o().object};var AD=function(e,t){if(t)return"text";switch(null==e?void 0:e.toLowerCase()){case"ssn":case"itin":case"tin":case"currency":case"percentage":default:return"text";case"phonenumber":case"phone":case"mobile":return"tel";case"number":return"number"}};function wD(e){return wD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wD(e)}var kD=["questionId","questionType","maskInput","maskingType","maskingLength","minLength","maxLength","value","onChange","type"];function ED(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ED(Object(n),!0).forEach(function(t){xD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ED(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xD(e,t,n){return(t=function(e){var t=function(e){if("object"!=wD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=wD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SD(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _D(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var OD=function(t){var r=t.questionId,o=t.questionType,i=void 0===o?"number":o,a=t.maskInput,s=t.maskingType,l=t.maskingLength,u=t.minLength,c=t.maxLength,d=t.value,p=t.onChange,f=t.type,m=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,kD),h=cc().setValue,v=(0,e.useMemo)(function(){var e=a?vs(a):c||0;return{maskInput:a||null,maskingType:s||null,maskingLength:l||0,minLength:u||0,maxLength:e}},[a,s,l,u,c]),y=SD((0,e.useState)(!1),2),g=y[0],b=y[1],A=SD((0,e.useState)({original:"",masked:""}),2),w=A[0],k=A[1],E=(0,e.useRef)(null),C=(0,e.useMemo)(function(){return v.maskingType&&v.maskingLength?g?w.original:w.masked:w.original||d},[w,g,v,d]);(0,e.useEffect)(function(){if(d||w.original||w.masked){var e=d||"";if(v.maskingType&&v.maskingLength){var t=gs(e,{maskInput:v.maskInput,maskingType:v.maskingType,maskingLength:v.maskingLength,questionType:i});k(t),Ze(r,h,t.original,e,E,m)}else if(v.maskInput){var n=ys(e,v.maskInput,i);k({original:n,masked:n}),Ze(r,h,n,e,E,m)}else k({original:e,masked:e})}},[d,v,i]);var x=(0,e.useMemo)(function(){return"numeric"},[]),S=(0,e.useMemo)(function(){return function(e){return["ssn","itin","phonenumber","currency","number","percentage","phone","tel","mobile","tin"].includes(null==e?void 0:e.toLowerCase())?"[0-9]*":void 0}(i)},[i]),_=CD(CD({questionId:r},m),{},{type:v.maskInput?"text":AD(f||i,v.maskingType),value:C,onChange:function(e){var t,n,r,o=function(e,t,n,r,o,i,a){if(r.maskingType&&r.maskingLength&&!o){var s=ls((null==i?void 0:i.original)||"",a,r.maskInput)||"";return"insertText"===t&&n?"".concat(s).concat(n):"deleteContentBackward"===t||"deleteContentForward"===t?s.slice(0,Math.max(0,s.length-1)):ls(e,a,r.maskInput)}return ls(e,a,r.maskInput)}((null===(t=e.target.value)||void 0===t?void 0:t.toString())||"",(null==e||null===(n=e.nativeEvent)||void 0===n?void 0:n.inputType)||"",((null==e||null===(r=e.nativeEvent)||void 0===r?void 0:r.data)||"").replace(ne,""),v,g,w,i);o=function(e,t){if("percentage"!==t)return e;var n=e.replace(re,""),r=Number.parseFloat(n);return Number.isNaN(r)||r<=100?n:"100"}(o,i);var a=(o||"").replace(ne,"").length;v.maxLength&&a>v.maxLength||function(e,t,n,r){if(n.maskingType&&n.maskingLength){var o=gs(t,{maskInput:n.maskInput,maskingType:n.maskingType,maskingLength:n.maskingLength,questionType:r});k(o),p&&p(CD(CD({},e),{},{target:CD(CD({},e.target),{},{value:o.original})}))}else if(n.maskInput){var i=ys(t,n.maskInput,r);k({original:i,masked:i}),p&&p(CD(CD({},e),{},{target:CD(CD({},e.target),{},{value:i})}))}else k({original:t,masked:t}),p&&p(CD(CD({},e),{},{target:CD(CD({},e.target),{},{value:t})}))}(e,o,v,i)},maskInput:null,inputMode:x,inputProps:CD(CD({},m.inputProps),{},{maxLength:c,pattern:S,inputMode:x}),minLength:u,maxLength:a?a.length:c});v.maskingType&&(_._maskingType=v.maskingType),v.maskingLength&&(_._maskingLength=v.maskingLength);var O=Boolean(v.maskingType&&v.maskingLength),I=g?"Hide":"Show",T=g?n().createElement(EP,null):n().createElement(bP,null);return n().createElement("div",{style:{position:"relative",display:"inline-block",width:"100%"}},n().createElement(CE,_),O&&n().createElement("button",{type:"button",name:"passwordEye",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-eye-icon",onClick:function(){return b(function(e){return!e})},title:"".concat(I," value"),"aria-label":"".concat(I," sensitive information"),style:{position:"absolute",right:"12px",top:"40%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#666",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1}},T))};OD.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,questionType:o().oneOf(["ssn","itin","phonenumber","currency","number","percentage","phone","tel","mobile","tin"]),value:o().oneOfType([o().string,o().number]),maskInput:o().string,maskingType:o().oneOfType([o().oneOf(["prefix","suffix"]),o().oneOf([null,void 0])]),maskingLength:o().oneOfType([o().number,o().oneOf([null])]),minLength:o().number,maxLength:o().number,onChange:o().func,type:o().string,validation:o().object,required:o().bool,placeholder:o().string,helperText:o().string,disabled:o().bool,inputProps:o().object,tooltip:o().string};const ID=OD;var TD=a("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/PasswordField.scss"),PD={};function BD(e){return BD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BD(e)}PD.styleTagTransform=nl(),PD.setAttributes=Js(),PD.insert=Ks().bind(null,"head"),PD.domAPI=Gs(),PD.insertStyleElement=el(),Hs()(TD.A,PD),TD.A&&TD.A.locals&&TD.A.locals;var DD=["name","label","required","disabled","defaultValue","placeholder","showPasswordStrength","showPasswordRequirements","passwordRequirements","validationErrorMessages","onChange","error","type","customTheme","styleName","tooltip"];function jD(){return jD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jD.apply(null,arguments)}function RD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RD(Object(n),!0).forEach(function(t){LD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LD(e,t,n){return(t=function(e){var t=function(e){if("object"!=BD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=BD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==BD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ND(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return FD(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FD(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function FD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var qD=function(t){var r=t.name,o=t.label,i=t.required,a=t.disabled,s=t.defaultValue,l=void 0===s?"":s,u=t.placeholder,c=t.showPasswordStrength,d=void 0!==c&&c,p=t.showPasswordRequirements,f=void 0!==p&&p,m=t.passwordRequirements,h=void 0===m?["At least 8 characters","At least one uppercase letter","At least one lowercase letter","At least one number","At least one special character"]:m,v=t.validationErrorMessages,y=t.onChange,g=t.error,b=t.type,A=void 0===b?"password":b,w=t.customTheme,k=void 0===w?{}:w,E=t.styleName,C=t.tooltip,x=void 0===C?"":C,S=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,DD),_=xc(),O=ND((0,e.useState)(!1),2),I=O[0],T=O[1],P=ND((0,e.useState)(l),2),B=P[0],D=P[1],j=ND((0,e.useState)(0),2),R=j[0],M=j[1],L=(0,e.useMemo)(function(){var e=_.passwordField||_.textField||{};return ZA(e,k)},[_,k]),N=(0,e.useMemo)(function(){var e=MD(MD({},L.container),{},{width:"100%"});return{container:ew(e,L.responsive),input:tw(L.input,g&&L.error,a&&L.disabled),strengthBar:L.strengthBar||{},strengthLabel:L.strengthLabel||{},requirements:L.requirements||{},requirementMet:L.requirementMet||{},toggleButton:L.toggleButton||{}}},[L,g,a]),F=function(e){var t,n,o=e.target.value;if(D(o),d){var i=(n=0,(t=o).length>=8&&(n+=20),t.length>=12&&(n+=10),/[A-Z]/.test(t)&&(n+=20),/[a-z]/.test(t)&&(n+=20),/\d/.test(t)&&(n+=20),/[^A-Za-z0-9]/.test(t)&&(n+=20),n);M(i)}y&&y({target:{name:r,value:o}})},q=function(e){e.preventDefault(),T(!I)};return n().createElement(FE,{name:String(r),label:o,value:B,required:i,validationErrorMessages:v,error:g,customTheme:L,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:L.label||{}},t,r&&n().createElement("span",{style:L.required||{}},"*"),x&&n().createElement(gE,{tooltip:x})):null},renderInput:function(){return n().createElement("div",{className:"password-field-container ".concat(E||""),style:N.container},n().createElement("div",{className:"password-input-wrapper"},n().createElement("input",jD({type:I?"text":A,id:String(r),name:String(r),value:B,onChange:F,disabled:a,placeholder:u,className:"password-input",style:N.input},S.inputProps)),n().createElement("button",{type:"button",className:"toggle-password-button",onClick:q,tabIndex:"-1","aria-label":I?"Hide password":"Show password",style:N.toggleButton},I?"👁️":"🔒")),d&&B&&n().createElement("div",{className:"password-strength"},n().createElement("div",{className:"strength-bar-container"},n().createElement("div",{className:"strength-bar",style:MD(MD({},N.strengthBar),{},{width:"".concat(R,"%"),backgroundColor:VD(R)})})),n().createElement("span",{className:"strength-label",style:MD(MD({},N.strengthLabel),{},{color:VD(R)})},(e=R)>=90?"Very Strong":e>=70?"Strong":e>=40?"Medium":e>=20?"Weak":"Very Weak")),f&&n().createElement("ul",{className:"password-requirements",style:N.requirements},h.map(function(e,t){var r=function(e){switch(e){case"At least 8 characters":return B.length>=8;case"At least one uppercase letter":return/[A-Z]/.test(B);case"At least one lowercase letter":return/[a-z]/.test(B);case"At least one number":return/\d/.test(B);case"At least one special character":return/[^A-Za-z0-9]/.test(B);default:return!1}}(e);return n().createElement("li",{key:"requirement-".concat(e,"-").concat(t),className:"requirement ".concat(r?"met":""),style:r?N.requirementMet:{}},r?"✓":"○"," ",e)})));var e}})};qD.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,required:o().bool,disabled:o().bool,defaultValue:o().string,placeholder:o().string,showPasswordStrength:o().bool,showPasswordRequirements:o().bool,passwordRequirements:o().arrayOf(o().string),validationErrorMessages:o().object,onChange:o().func,error:o().string,type:o().string,customTheme:o().object,styleName:o().string,tooltip:o().string,inputProps:o().object};var VD=function(e){return e>=90?"#4caf50":e>=70?"#8bc34a":e>=40?"#ffc107":e>=20?"#ff9800":"#f44336"};const QD=qD;function zD(e){return zD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zD(e)}function UD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UD(Object(n),!0).forEach(function(t){HD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function HD(e,t,n){return(t=function(e){var t=function(e){if("object"!=zD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $D=function(e){var t=e.label,r=e.value,o=e.disabled,i=e.className,a=e.customTheme,s=void 0===a?{}:a,l=xc(),u=ZA(l.pdfField||{},s);return r?n().createElement("div",{style:u.container},n().createElement("button",{type:"button",style:WD(WD({},u.button),o&&u.disabled),onClick:function(){try{for(var e,t=atob(r.split(",")[1]||r),n=new Array(t.length),o=0;o<t.length;o++)n[o]=t.codePointAt(o);var i=new Uint8Array(n),a=new Blob([i],{type:"application/pdf"}),s=URL.createObjectURL(a);null===(e=ml.open)||void 0===e||e.call(ml,s,"_blank"),setTimeout(function(){URL.revokeObjectURL(s)},1e3)}catch(e){console.error("Error opening PDF:",e)}},disabled:o,className:i},t)):null};$D.propTypes={value:o().oneOfType([o().string,o().number,o().bool]),label:o().string,disabled:o().bool,className:o().string,customTheme:o().object};const GD=$D;function YD(e){return YD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},YD(e)}function KD(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return XD(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(XD(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,XD(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,XD(d,"constructor",u),XD(u,"constructor",l),l.displayName="GeneratorFunction",XD(u,o,"GeneratorFunction"),XD(d),XD(d,o,"Generator"),XD(d,r,function(){return this}),XD(d,"toString",function(){return"[object Generator]"}),(KD=function(){return{w:i,m:p}})()}function XD(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}XD=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){XD(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},XD(e,t,n,r)}function JD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JD(Object(n),!0).forEach(function(t){ej(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ej(e,t,n){return(t=function(e){var t=function(e){if("object"!=YD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=YD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==YD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tj(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function nj(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){tj(i,r,o,a,s,"next",e)}function s(e){tj(i,r,o,a,s,"throw",e)}a(void 0)})}}function rj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||oj(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oj(e,t){if(e){if("string"==typeof e)return ij(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ij(e,t):void 0}}function ij(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var aj,sj=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.documents,c=t.onDownload,d=t.onPreview,p=t.customTheme,f=void 0===p?{}:p,m=xc(),h=ZA(m.pdfPackageField||{},f),v=rj((0,e.useState)(i||[]),2),y=v[0],g=v[1],b=rj((0,e.useState)({}),2),A=b[0],w=b[1],k=function(){var e=nj(KD().m(function e(t){return KD().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,w(function(e){return ZD(ZD({},e),{},ej({},t,!0))}),e.n=1,c(t);case 1:return e.p=1,w(function(e){return ZD(ZD({},e),{},ej({},t,!1))}),e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=nj(KD().m(function e(t){return KD().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,w(function(e){return ZD(ZD({},e),{},ej({},t,!0))}),e.n=1,d(t);case 1:return e.p=1,w(function(e){return ZD(ZD({},e),{},ej({},t,!1))}),e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}));return function(t){return e.apply(this,arguments)}}();return n().createElement(NE,{name:r,label:o,value:y,validation:a,className:l,customTheme:h,renderInput:function(){return n().createElement("div",{style:h.container},u.map(function(e){return n().createElement("div",{key:e.id,style:h.item},n().createElement("div",{style:h.itemHeader},n().createElement("input",{type:"checkbox",id:"doc-".concat(e.id),checked:y.includes(e.id),onChange:function(){return t=e.id,void g(function(e){return e.includes(t)?e.filter(function(e){return e!==t}):[].concat(function(e){return function(e){if(Array.isArray(e))return ij(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||oj(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),[t])});var t},disabled:s,style:ZD(ZD({},h.checkbox),s&&h.disabled)}),n().createElement("label",{htmlFor:"doc-".concat(e.id),style:h.label},e.name)),n().createElement("div",{style:h.description},e.description),n().createElement("div",{style:h.actions},n().createElement("button",{type:"button",onClick:function(){return E(e.id)},disabled:s||A[e.id],style:ZD(ZD(ZD({},h.button),h.previewButton),s&&h.disabled)},A[e.id]?"Loading...":"Preview"),n().createElement("button",{type:"button",onClick:function(){return k(e.id)},disabled:s||A[e.id],style:ZD(ZD(ZD({},h.button),h.downloadButton),s&&h.disabled)},A[e.id]?"Loading...":"Download")))}))}})};function lj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function uj(){}function cj(e){return!!(e||"").match(/\d/)}function dj(e){return null==e}function pj(e){return dj(e)||function(e){return"number"==typeof e&&isNaN(e)}(e)||"number"==typeof e&&!isFinite(e)}function fj(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function mj(e,t){void 0===t&&(t=!0);var n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split(".");return{beforeDecimal:o[0],afterDecimal:o[1]||"",hasNegation:n,addNegation:r}}function hj(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function vj(e,t){return Array(t+1).join(e)}function yj(e){var t=e+"",n="-"===t[0]?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],i=r[1];if(!(i=Number(i)))return n+o;var a=1+i,s=(o=o.replace(".","")).length;return a<0?o="0."+vj("0",Math.abs(a))+o:a>=s?o+=vj("0",a-s):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function gj(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=(-1!==e.indexOf(".")||n)&&t,o=mj(e),i=o.beforeDecimal,a=o.afterDecimal,s=o.hasNegation,l=parseFloat("0."+(a||"0")),u=(a.length<=t?"0."+a:l.toFixed(t)).split("."),c=i;return i&&Number(u[0])&&(c=i.split("").reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},u[0])),(s?"-":"")+c+(r?".":"")+hj(u[1]||"",t,n)}function bj(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}sj.propTypes={name:o().string.isRequired,label:o().string,value:o().arrayOf(o().string),validation:o().object,disabled:o().bool,className:o().string,documents:o().arrayOf(o().shape({id:o().string.isRequired,name:o().string.isRequired,description:o().string})).isRequired,onDownload:o().func.isRequired,onPreview:o().func.isRequired,customTheme:o().object},function(e){e.event="event",e.props="prop"}(aj||(aj={}));var Aj,wj,kj,Ej=(Aj=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:i-r}}},kj=void 0,function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return wj&&e.length===wj.length&&e.every(function(e,t){return e===wj[t]})?kj:(wj=e,kj=Aj.apply(void 0,e))});function Cj(e){return Math.max(e.selectionStart,e.selectionEnd)}function xj(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function Sj(e,t,n,r){var o,i,a=e.length;if(o=t,i=a,t=Math.min(Math.max(o,0),i),"left"===r){for(;t>=0&&!n[t];)t--;-1===t&&(t=n.indexOf(!0))}else{for(;t<=a&&!n[t];)t++;t>a&&(t=n.lastIndexOf(!0))}return-1===t&&(t=a),t}function _j(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=Boolean(cj(e[n])||cj(e[n-1]));return t}function Oj(t,n,r,o,i,a){void 0===a&&(a=uj);var s=function(t){var n=(0,e.useRef)(t);n.current=t;var r=(0,e.useRef)(function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return n.current.apply(n,e)});return r.current}(function(e,t){var n,r;return pj(e)?(r="",n=""):"number"==typeof e||t?(r="number"==typeof e?yj(e):e,n=o(r)):(r=i(e,void 0),n=o(r)),{formattedValue:n,numAsString:r}}),l=(0,e.useState)(function(){return s(dj(t)?n:t,r)}),u=l[0],c=l[1],d=t,p=r;dj(t)&&(d=u.numAsString,p=!0);var f=s(d,p);return(0,e.useMemo)(function(){c(f)},[f.formattedValue]),[u,function(e,t){e.formattedValue!==u.formattedValue&&c({formattedValue:e.formattedValue,numAsString:e.value}),a(e,t)}]}function Ij(e){return e.replace(/[^0-9]/g,"")}function Tj(e){return e}function Pj(t){var r=t.type;void 0===r&&(r="text");var o=t.displayType;void 0===o&&(o="input");var i=t.customInput,a=t.renderText,s=t.getInputRef,l=t.format;void 0===l&&(l=Tj);var u=t.removeFormatting;void 0===u&&(u=Ij);var c=t.defaultValue,d=t.valueIsNumericString,p=t.onValueChange,f=t.isAllowed,m=t.onChange;void 0===m&&(m=uj);var h=t.onKeyDown;void 0===h&&(h=uj);var v=t.onMouseUp;void 0===v&&(v=uj);var y=t.onFocus;void 0===y&&(y=uj);var g=t.onBlur;void 0===g&&(g=uj);var b=t.value,A=t.getCaretBoundary;void 0===A&&(A=_j);var w=t.isValidInputCharacter;void 0===w&&(w=cj);var k=t.isCharacterSame,E=lj(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),C=Oj(b,c,Boolean(d),l,u,p),x=C[0],S=x.formattedValue,_=x.numAsString,O=C[1],I=(0,e.useRef)(),T=(0,e.useRef)({formattedValue:S,numAsString:_}),P=function(e,t){T.current={formattedValue:e.formattedValue,numAsString:e.value},O(e,t)},B=(0,e.useState)(!1),D=B[0],j=B[1],R=(0,e.useRef)(null),M=(0,e.useRef)({setCaretTimeout:null,focusTimeout:null});(0,e.useEffect)(function(){return j(!0),function(){clearTimeout(M.current.setCaretTimeout),clearTimeout(M.current.focusTimeout)}},[]);var L=l,N=function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}},F=function(e,t,n){0===e.selectionStart&&e.selectionEnd===e.value.length||(bj(e,t),M.current.setCaretTimeout=setTimeout(function(){e.value===n&&e.selectionStart!==t&&bj(e,t)},0))},q=function(e,t,n){return Sj(e,t,A(e),n)},V=function(e,t,n){var r=A(t),o=function(e,t,n,r,o,i,a){void 0===a&&(a=xj);var s=o.findIndex(function(e){return e}),l=e.slice(0,s);t||n.startsWith(l)||(t=l,n=l+n,r+=l.length);for(var u=n.length,c=e.length,d={},p=new Array(u),f=0;f<u;f++){p[f]=-1;for(var m=0,h=c;m<h;m++)if(a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:f,formattedValueIndex:m})&&!0!==d[m]){p[f]=m,d[m]=!0;break}}for(var v=r;v<u&&(-1===p[v]||!i(n[v]));)v++;var y=v===u||-1===p[v]?c:p[v];for(v=r-1;v>0&&-1===p[v];)v--;var g=-1===v||-1===p[v]?0:p[v]+1;return g>y?y:r-g<y-r?g:y}(t,S,e,n,r,w,k);return Sj(t,o,r)};(0,e.useEffect)(function(){var e=T.current,t=e.formattedValue,n=e.numAsString;S===t&&_===n||P(N(S,_),{event:void 0,source:aj.props})},[S,_]);var Q=R.current?Cj(R.current):void 0;("undefined"!=typeof window?e.useLayoutEffect:e.useEffect)(function(){var e=R.current;if(S!==T.current.formattedValue&&e){var t=V(T.current.formattedValue,S,Q);e.value=S,F(e,t,S)}},[S]);var z=function(e,t){void 0===t&&(t=0);var n=e.selectionStart,r=e.selectionEnd;I.current={selectionStart:n,selectionEnd:r+t}},U=!D||"undefined"==typeof navigator||navigator.platform&&/iPhone|iPod/.test(navigator.platform)?void 0:"numeric",W=Object.assign({inputMode:U},E,{type:r,value:S,onChange:function(e){(function(e,t,n){var r=t.target,o=I.current?function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}}(I.current,r.selectionEnd):Ej(S,e),i=Object.assign(Object.assign({},o),{lastValue:S}),a=u(e,i),s=L(a);if(a=u(s,void 0),f&&!f(N(s,a))){var l=t.target,c=Cj(l),d=V(e,S,c);return l.value=S,F(l,d,S),!1}return function(e){var t=e.formattedValue;void 0===t&&(t="");var n,r=e.input,o=e.source,i=e.event,a=e.numAsString;if(r){var s=e.inputValue||r.value,l=Cj(r);r.value=t,void 0!==(n=V(s,t,l))&&F(r,n,t)}t!==S&&P(N(t,a),{event:i,source:o})}({formattedValue:s,numAsString:a,inputValue:e,event:t,source:n,input:t.target}),!0})(e.target.value,e,aj.event)&&m(e),I.current=void 0},onKeyDown:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,i=n.selectionEnd,a=n.value;void 0===a&&(a=""),"ArrowLeft"===r||"Backspace"===r?t=Math.max(o-1,0):"ArrowRight"===r?t=Math.min(o+1,a.length):"Delete"===r&&(t=o);var s=0;"Delete"===r&&o===i&&(s=1);var l="ArrowLeft"===r||"ArrowRight"===r;if(void 0===t||o!==i&&!l)return h(e),void z(n,s);var u=t;l?(u=q(a,t,"ArrowLeft"===r?"left":"right"))!==t&&e.preventDefault():"Delete"!==r||w(a[t])?"Backspace"!==r||w(a[t])||(u=q(a,t,"left")):u=q(a,t,"right"),u!==t&&F(n,u,a),h(e),z(n,s)},onMouseUp:function(e){var t=e.target,n=function(){var e=t.selectionStart,n=t.selectionEnd,r=t.value;if(void 0===r&&(r=""),e===n){var o=q(r,e);o!==e&&F(t,o,r)}};n(),requestAnimationFrame(function(){n()}),v(e),z(t)},onFocus:function(e){e.persist&&e.persist();var t=e.target,n=e.currentTarget;R.current=t,M.current.focusTimeout=setTimeout(function(){var r=t.selectionStart,o=t.selectionEnd,i=t.value;void 0===i&&(i="");var a=q(i,r);a===r||0===r&&o===i.length||F(t,a,i),y(Object.assign(Object.assign({},e),{currentTarget:n}))},0)},onBlur:function(e){R.current=null,clearTimeout(M.current.focusTimeout),clearTimeout(M.current.setCaretTimeout),g(e)}});if("text"===o)return a?n().createElement(n().Fragment,null,a(S,E)||null):n().createElement("span",Object.assign({},E,{ref:s}),S);if(i){var H=i;return n().createElement(H,Object.assign({},W,{ref:s}))}return n().createElement("input",Object.assign({},W,{ref:s}))}function Bj(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;void 0===o&&(o="");var i=t.suffix;void 0===i&&(i="");var a=t.allowNegative,s=t.thousandsGroupStyle;if(void 0===s&&(s="thousand"),""===e||"-"===e)return e;var l=Dj(t),u=l.thousandSeparator,c=l.decimalSeparator,d=0!==n&&-1!==e.indexOf(".")||n&&r,p=mj(e,a),f=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=hj(m,n,!!r)),u&&(f=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(f,u,s)),o&&(f=o+f),i&&(m+=i),h&&(f="-"+f),f+(d&&c||"")+m}function Dj(e){var t=e.decimalSeparator;void 0===t&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function jj(e){e=function(e){var t=Dj(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;void 0===o&&(o="");var i=e.allowNegative;if(void 0===i&&(i=!0),n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+n+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+r+" (default value for decimalSeparator is .)\n ");return o.startsWith("-")&&i&&(console.error("\n Prefix can't start with '-' when allowNegative is true.\n prefix: "+o+"\n allowNegative: "+i+"\n "),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;void 0===o&&(o=uj);var i=e.onBlur;void 0===i&&(i=uj);var a=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,u=e.prefix;void 0===u&&(u="");var c=e.defaultValue,d=e.value,p=e.valueIsNumericString,f=e.onValueChange,m=lj(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),h=Dj(e),v=h.decimalSeparator,y=h.allowedDecimalSeparators,g=function(t){return Bj(t,e)},b=function(t,n){return function(e,t,n){var r;void 0===t&&(t=function(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}(e));var o=n.allowNegative,i=n.prefix;void 0===i&&(i="");var a=n.suffix;void 0===a&&(a="");var s=n.decimalScale,l=t.from,u=t.to,c=u.start,d=u.end,p=Dj(n),f=p.allowedDecimalSeparators,m=p.decimalSeparator,h=e[d]===m;if(cj(e)&&(e===i||e===a)&&""===t.lastValue)return e;if(d-c===1&&-1!==f.indexOf(e[c])){var v=0===s?"":m;e=e.substring(0,c)+v+e.substring(c+1,e.length)}var y=function(e,t,n){var r=!1,o=!1;i.startsWith("-")?r=!1:e.startsWith("--")?(r=!1,o=!0):a.startsWith("-")&&e.length===a.length?r=!1:"-"===e[0]&&(r=!0);var s=r?1:0;return o&&(s=2),s&&(e=e.substring(s),t-=s,n-=s),{value:e,start:t,end:n,hasNegation:r}},g=y(e,c,d),b=g.hasNegation;e=(r=g).value,c=r.start,d=r.end;var A=y(t.lastValue,l.start,l.end),w=A.start,k=A.end,E=A.value,C=e.substring(c,d);!(e.length&&E.length&&(w>E.length-a.length||k<i.length))||C&&a.startsWith(C)||(e=E);var x=0;e.startsWith(i)?x+=i.length:c<i.length&&(x=c),d-=x;var S=(e=e.substring(x)).length,_=e.length-a.length;e.endsWith(a)?S=_:(d>_||d>e.length-a.length)&&(S=d),e=e.substring(0,S),e=function(e,t){void 0===e&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}(b?"-"+e:e,o),e=(e.match(function(e){return new RegExp("(^-)|[0-9]|"+fj(e),"g")}(m))||[]).join("");var O=e.indexOf(m);e=e.replace(new RegExp(fj(m),"g"),function(e,t){return t===O?".":""});var I=mj(e,o),T=I.beforeDecimal,P=I.afterDecimal,B=I.addNegation;return u.end-u.start<l.end-l.start&&""===T&&h&&!parseFloat(P)&&(e=B?"-":""),e}(t,n,e)},A=dj(d)?c:d,w=null!=p?p:function(e,t,n){return""===e||!(null==t?void 0:t.match(/\d/))&&!(null==n?void 0:n.match(/\d/))&&"string"==typeof e&&!isNaN(Number(e))}(A,u,t);dj(d)?dj(c)||(w=w||"number"==typeof c):w=w||"number"==typeof d;var k=function(e){return pj(e)?e:("number"==typeof e&&(e=yj(e)),w&&"number"==typeof s?gj(e,s,Boolean(l)):e)},E=Oj(k(d),k(c),Boolean(w),g,b,f),C=E[0],x=C.numAsString,S=C.formattedValue,_=E[1];return Object.assign(Object.assign({},m),{value:S,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===v||cj(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,o=e.currentValueIndex,i=e.formattedValueIndex,a=t[o],c=r[i],p=Ej(n,t).to,f=function(e){return b(e).indexOf(".")+u.length};return!(0===d&&l&&s&&t[p.start]===v&&f(t)<o&&f(r)>i||!(o>=p.start&&o<p.end&&y&&y.includes(a)&&c===v)&&a!==c)},onValueChange:_,format:g,removeFormatting:b,getCaretBoundary:function(t){return function(e,t){var n=t.prefix;void 0===n&&(n="");var r=t.suffix;void 0===r&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),i="-"===e[0];o.fill(!1,0,n.length+(i?1:0));var a=e.length;return o.fill(!1,a-r.length+1,a+1),o}(t,e)},onKeyDown:function(e){var t=e.target,r=e.key,i=t.selectionStart,c=t.selectionEnd,d=t.value;if(void 0===d&&(d=""),("Backspace"===r||"Delete"===r)&&c<u.length)e.preventDefault();else if(i===c){"Backspace"===r&&"-"===d[0]&&i===u.length+1&&n&&bj(t,1),s&&l&&("Backspace"===r&&d[i-1]===v?(bj(t,i-1),e.preventDefault()):"Delete"===r&&d[i]===v&&e.preventDefault()),(null==y?void 0:y.includes(r))&&d[i]===v&&bj(t,i+1);var p=!0===a?",":a;"Backspace"===r&&d[i-1]===p&&bj(t,i-1),"Delete"===r&&d[i]===p&&bj(t,i+1),o(e)}else o(e)},onBlur:function(t){var n=x;if(n.match(/\d/g)||(n=""),r||(n=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}(n)),l&&s&&(n=gj(n,s,l)),n!==x){var o=Bj(n,e);_({formattedValue:o,value:n,floatValue:parseFloat(n)},{event:t,source:aj.event})}i(t)}})}function Rj(e){var t=jj(e);return n().createElement(Pj,Object.assign({},t))}function Mj(e){return Mj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mj(e)}var Lj=["questionId","label","value","onChange","minValue","maxValue","decimalScale","required","disabled","placeholder","helperText","tooltip","error","validationErrorMessages","className","hideLabel","visible","defaultValue","inputProps","styleName","customTheme","header","onBlur","showQuestionLabels"];function Nj(){return Nj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nj.apply(null,arguments)}function Fj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fj(Object(n),!0).forEach(function(t){Vj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vj(e,t,n){return(t=function(e){var t=function(e){if("object"!=Mj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qj=function(t){var r,o=t.questionId,i=t.label,a=t.value,s=t.onChange,l=t.minValue,u=t.maxValue,c=t.decimalScale,d=t.required,p=t.disabled,f=t.placeholder,m=(t.helperText,t.tooltip,t.error),h=(t.validationErrorMessages,t.className),v=(t.hideLabel,t.visible),y=void 0===v||v,g=t.defaultValue,b=t.inputProps,A=void 0===b?{}:b,w=t.styleName,k=t.customTheme,E=void 0===k?{}:k,C=t.header,x=t.onBlur,S=t.showQuestionLabels,_=void 0===S||S,O=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,Lj),I=cc(),T=I.state,P=I.setValue,B=xc(),D=A["data-item-index"],j=A["data-parent-id"],R=GA({questionId:o,itemIndex:D,defaultValue:g,defaultVisible:!0,defaultDisabled:!1}),M=R.disabled,L=R.handleChange,N=null!=a?a:T.values[o],F=null!=l?l:0,q=null!=u?u:100,V=m||(null===(r=T.errors)||void 0===r?void 0:r[o]),Q=(0,e.useMemo)(function(){var e=B.textField||B.percentageField||{};return ZA(e,E)},[B,E]),z=(0,e.useMemo)(function(){var e=qj(qj({},Q.container),{},{width:"100%"}),t=tw(Q.input,V&&Q.error,(M||p)&&Q.disabled);return{container:ew(e,Q.responsive),input:t}},[Q,V,M,p]);if(y){var U=f||"Enter percentage (".concat(F,"-").concat(q,")"),W=D?"".concat(o,"-").concat(D):o,H=null!=M&&""!==M?M:p;return n().createElement("div",{className:"form-field ".concat(w||""," ").concat(h||""),style:z.container},C&&n().createElement("div",{className:"field-header",style:B.header},C),n().createElement(Rj,Nj({customInput:VA,suffix:"%",disabled:H},null!=c&&{decimalScale:c},{allowNegative:!1,min:F,max:q,isAllowed:function(e){var t=e.floatValue;return void 0===t||t>=F&&t<=q},onValueChange:function(e){var t=e.value;L&&L(t,void 0!==D&&void 0!==j?{cardListId:j,instanceIndex:D}:{}),P&&P(o,t),s&&s({target:{name:o,value:t}})},value:N||"",placeholder:U,autoComplete:"off",required:d,label:_?i:"",id:String(W),name:String(W),onBlur:x,fullWidth:!0,"data-item-index":D,"data-parent-id":j},O)))}return null};Qj.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),defaultValue:o().oneOfType([o().string,o().number]),onChange:o().func,minValue:o().number,maxValue:o().number,decimalScale:o().number,required:o().bool,disabled:o().bool,placeholder:o().string,helperText:o().string,tooltip:o().string,error:o().string,validationErrorMessages:o().object,className:o().string,hideLabel:o().bool,visible:o().bool,inputProps:o().object,styleName:o().string,customTheme:o().object,header:o().string,onBlur:o().func,showQuestionLabels:o().bool},Qj.defaultProps={minValue:0,maxValue:100,decimalScale:null,required:!1,disabled:!1,visible:!0,hideLabel:!1,inputProps:{}};const zj=Qj;function Uj(e){return Uj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uj(e)}function Wj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wj(Object(n),!0).forEach(function(t){$j(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $j(e,t,n){return(t=function(e){var t=function(e){if("object"!=Uj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Uj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Uj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gj=function(t){var r=t.questionId,o=t.label,i=t.value,a=void 0===i?"":i,s=t.options,l=void 0===s?[]:s,u=t.disabled,c=void 0!==u&&u,d=t.required,p=void 0!==d&&d,f=t.onChange,m=t.inputProps,h=void 0===m?{}:m,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,A=t.error,w=t.helperText,k=t.tooltip,E=void 0===k?"":k,C=t.showQuestionLabels,x=void 0===C||C,S=xc(),_=cc().state,O=h["data-parent-id"],I=h["data-item-index"],T=(0,e.useMemo)(function(){var e,t,n=null===(e=_.optionVisibility)||void 0===e?void 0:e[r];return null!=O&&void 0!==I&&null!==(t=_.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[O])&&void 0!==t&&null!==(t=t[Number(I)])&&void 0!==t&&t[r]&&(n=_.optionVisibilityByInstance[O][Number(I)][r]),n?l.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):l},[l,_.optionVisibility,_.optionVisibilityByInstance,r,O,I]),P=function(e){null==f||f(e)},B=(0,e.useMemo)(function(){var e=S.radioField||{};return ZA(e,b)},[S,b]),D=(0,e.useMemo)(function(){var e=Hj(Hj({},B.container),{},{width:"100%"}),t=tw(B.radioGroup,A&&B.error,c&&B.disabled),n=tw(B.radioOption,c&&B.disabled);return{container:ew(e,B.responsive),radioGroup:t,radioOption:n,radio:B.radio,label:B.optionLabel}},[B,A,c]);return n().createElement("div",{className:"form-field ".concat(y||""),style:D.container},v&&n().createElement("div",{className:"field-header",style:S.header},v),x&&o&&n().createElement("div",{className:"question_label",style:S.label},o,p&&n().createElement("span",{className:"required-mark",style:S.requiredMark},"*"),E&&n().createElement(gE,{tooltip:E})),n().createElement("div",{className:"radio-group",style:D.radioGroup},T.map(function(e,t){var o,i,s=null!==(o=e.value)&&void 0!==o?o:e,l=null!==(i=e.label)&&void 0!==i?i:e,u=void 0===I?"":"-".concat(I),d="".concat(r,"-").concat(O||"","-").concat(t).concat(u),f=String(a)===String(s);return n().createElement("div",{key:d,className:"radio-option",style:D.radioOption},n().createElement("input",{type:"radio",id:d,name:void 0===I?r:"".concat(r,"-").concat(I),value:s,checked:f,onChange:P,disabled:c,required:p,"data-item-index":I,"data-parent-id":O,style:D.radio}),n().createElement("label",{htmlFor:d,style:D.label},l))})),w&&n().createElement("div",{className:"helper-text",style:S.helperText},w))};Gj.propTypes={questionId:o().string,label:o().string,value:o().oneOfType([o().string,o().number,o().bool]),options:o().arrayOf(o().oneOfType([o().string,o().number,o().shape({label:o().string.isRequired,value:o().oneOfType([o().string,o().number,o().bool]).isRequired})])),disabled:o().bool,required:o().bool,onChange:o().func,inputProps:o().object,header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,tooltip:o().string,showQuestionLabels:o().bool};const Yj=Gj;var Kj=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/RadioTabButtonsField.css"),Xj={};function Jj(e){return Jj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jj(e)}Xj.styleTagTransform=nl(),Xj.setAttributes=Js(),Xj.insert=Ks().bind(null,"head"),Xj.domAPI=Gs(),Xj.insertStyleElement=el(),Hs()(Kj.A,Xj),Kj.A&&Kj.A.locals&&Kj.A.locals;var Zj=["name","label","value","onChange","options","disabled","required","error","_validation","header","styleName","customTheme","_questionId","_encrypted","_maskingType","_maskingLength","tooltip","showQuestionLabels"];function eR(){return eR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eR.apply(null,arguments)}function tR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tR(Object(n),!0).forEach(function(t){rR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rR(e,t,n){return(t=function(e){var t=function(e){if("object"!=Jj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Jj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oR=function(t){var r=t.name,o=t.label,i=t.value,a=void 0===i?"":i,s=t.onChange,l=t.options,u=void 0===l?[]:l,c=t.disabled,d=t.required,p=t.error,f=(t._validation,t.header),m=t.styleName,h=t.customTheme,v=void 0===h?{}:h,y=(t._questionId,t._encrypted,t._maskingType,t._maskingLength,t.tooltip),g=void 0===y?"":y,b=t.showQuestionLabels,A=void 0===b||b,w=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,Zj),k=xc(),E=(0,e.useMemo)(function(){var e=k.radioTabButtonsField||k.radioField||{};return ZA(e,v)},[k,v]),C=(0,e.useMemo)(function(){var e=nR(nR({},E.container),{},{width:"100%"}),t=tw(E.tabGroup),n=tw(E.tab,c&&E.disabled),r=tw(E.selectedTab),o=tw(E.disabledTab),i=tw(E.label,d&&E.required,c&&E.disabled);return{container:ew(e,E.responsive),tabGroup:t,tab:n,selectedTab:r,disabledTab:o,label:i,header:tw(E.header),error:tw(E.error)}},[E,d,c]);return n().createElement("div",{className:"radio-tab-buttons-field ".concat(m||""),style:C.container},f&&n().createElement("div",{className:"field-header",style:C.header},f),A&&o&&n().createElement("div",{className:"question_label",style:C.label},o,d&&n().createElement("span",{style:E.required},"*"),g&&n().createElement(gE,{tooltip:g})),n().createElement("div",{className:"radio-tab-buttons-wrapper",style:C.tabGroup},u.map(function(e){var t=String(a).toLowerCase()===String(e.value).toLowerCase();return n().createElement("button",eR({key:e.value,type:"button",onClick:function(){return t=e.value,void(c||!s||s({target:{name:r,value:t}}));var t},disabled:c,style:nR(nR(nR({},C.tab),t?C.selectedTab:{}),c?C.disabledTab:{})},w),e.label)})),p&&n().createElement("div",{style:C.error},p))};oR.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().any,onChange:o().func,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().any.isRequired,name:o().string,text:o().string,selected:o().bool,optionId:o().number,sortOrder:o().number,uncheckOthers:o().bool})),disabled:o().bool,required:o().bool,error:o().string,_validation:o().object,header:o().node,styleName:o().string,customTheme:o().object,_questionId:o().oneOfType([o().string,o().number]),_encrypted:o().bool,_maskingType:o().string,_maskingLength:o().oneOfType([o().string,o().number]),tooltip:o().string,showQuestionLabels:o().bool};const iR=Ay("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),aR=Ay("MuiListItemIcon",["root","alignItemsFlexStart"]),sR=Ay("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function lR(e){return by("MuiMenuItem",e)}const uR=Ay("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),cR=Bv(Jk,{shouldForwardProp:e=>Tv(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})(cy(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${uR.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:th(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${uR.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:th(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${uR.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:th(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:th(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${uR.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${uR.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${iR.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${iR.inset}`]:{marginLeft:52},[`& .${sR.root}`]:{marginTop:0,marginBottom:0},[`& .${sR.inset}`]:{paddingLeft:36},[`& .${aR.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${aR.root} svg`]:{fontSize:"1.25rem"}}}]}))),dR=e.forwardRef(function(t,n){const r=Mv({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:d,className:p,...f}=r,m=e.useContext(Tg),h=e.useMemo(()=>({dense:a||m.dense||!1,disableGutters:l}),[m.dense,a,l]),v=e.useRef(null);fy(()=>{o&&v.current&&v.current.focus()},[o]);const y={...r,dense:h.dense,divider:s,disableGutters:l},g=(e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:a}=e,s=Hd({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},lR,a);return{...a,...s}})(r),b=py(v,n);let A;return r.disabled||(A=void 0!==d?d:-1),(0,jv.jsx)(Tg.Provider,{value:h,children:(0,jv.jsx)(cR,{ref:b,role:c,tabIndex:A,component:i,focusVisibleClassName:Wd(g.focusVisible,u),className:Wd(g.root,p),...f,ownerState:y,classes:g})})});function pR(e){return pR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pR(e)}function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fR(Object(n),!0).forEach(function(t){hR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hR(e,t,n){return(t=function(e){var t=function(e){if("object"!=pR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vR=function(t){var r=t.questionId,o=t.label,i=t.options,a=void 0===i?[]:i,s=t.defaultValue,l=void 0===s?"":s,u=t.helperText,c=t.required,d=void 0!==c&&c,p=t.onChange,f=t.inputProps,m=void 0===f?{}:f,h=t.header,v=t.styleName,y=t.customTheme,g=void 0===y?{}:y,b=t.tooltip,A=void 0===b?"":b,w=t.showQuestionLabels,k=void 0===w||w,E=xc(),C=cc().state,x=m["data-item-index"],S=m["data-parent-id"],_=GA({questionId:r,itemIndex:x,defaultValue:l,defaultVisible:!0,defaultDisabled:!1}),O=_.visible,I=_.disabled,T=_.error,P=_.handleChange,B=_.value,D=(0,e.useMemo)(function(){var e,t,n=S,o=x,i=null===(e=C.optionVisibility)||void 0===e?void 0:e[r];return null!=n&&void 0!==o&&null!==(t=C.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[n])&&void 0!==t&&null!==(t=t[Number(o)])&&void 0!==t&&t[r]&&(i=C.optionVisibilityByInstance[n][Number(o)][r]),i?a.filter(function(e){var t=e.optionId||e.id;return!1!==i[t]}):a},[a,C.optionVisibility,C.optionVisibilityByInstance,r,S,x]),j=(0,e.useMemo)(function(){return function(e,t){if(!(e&&t&&t.length>0))return e;if(t.find(function(t){return t.value===e}))return e;var n=t.find(function(t){return t.label===e});return n?n.value:e}(B,a)},[B,a]),R=(0,e.useMemo)(function(){var e=E.selectField||{};return ZA(e,g)},[E,g]),M=(0,e.useMemo)(function(){var e=mR(mR({},R.container),{},{width:"100%"}),t=tw(R.select,T&&R.error,I&&R.disabled);return{container:ew(e,R.responsive),select:t,menu:R.menu,menuItem:R.menuItem}},[R,T,I]);if(!O)return null;var L=void 0===x?r:"".concat(r,"-").concat(x);return n().createElement("div",{className:"form-field ".concat(v||""),style:M.container},h&&n().createElement("div",{className:"field-header",style:E.header},h),n().createElement(bg,{fullWidth:!0,error:!!T,required:k&&d,style:R.formControl},k&&o&&n().createElement(mg,{id:"label-".concat(String(r)),style:E.label},o,A&&n().createElement(gE,{tooltip:A})),n().createElement(LA,{value:j||"",onChange:function(e){var t=e.target.value;P(t,{cardListId:S,instanceIndex:x}),p&&p(e)},label:k?o:"",disabled:I,id:String(L),name:String(L),labelId:"label-".concat(String(L)),"data-item-index":x,"data-parent-id":S,style:M.select,MenuProps:{PaperProps:{style:M.menu}}},D.map(function(e,t){return n().createElement(dR,{key:"".concat(L,"-").concat(t),value:e.value,disabled:e.disabled,style:M.menuItem},e.label)})),(T||u)&&n().createElement(Cg,{style:T?E.error:E.helperText},T||u)))};function yR(e){return yR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yR(e)}function gR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gR(Object(n),!0).forEach(function(t){AR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AR(e,t,n){return(t=function(e){var t=function(e){if("object"!=yR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=yR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}vR.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,options:o().arrayOf(o().shape({value:o().oneOfType([o().string,o().number,o().bool]).isRequired,label:o().string.isRequired,disabled:o().bool})).isRequired,defaultValue:o().string,helperText:o().string,required:o().bool,onChange:o().func,inputProps:o().object,header:o().node,styleName:o().string,customTheme:o().object,tooltip:o().string,showQuestionLabels:o().bool,addressGroup:o().shape({includes:o().func})};var wR=function(t){var r=t.name,o=t.label,i=t.value,a=t.onChange,s=t.disabled,l=t.required,u=t.error,c=t.validation,d=void 0===c?{}:c,p=t.header,f=t.styleName,m=t.customTheme,h=void 0===m?{}:m,v=t.tooltip,y=void 0===v?"":v,g=t.showQuestionLabels,b=void 0===g||g,A=xc(),w=d.min,k=d.max,E=d.step,C=void 0===E?1:E,x=(0,e.useMemo)(function(){var e=A.spinnerField||{};return ZA(e,h)},[A,h]),S=(0,e.useMemo)(function(){var e=bR(bR({},x.container),{},{width:"100%"}),t=tw(x.input,s&&x.disabled,u&&x.error),n=tw(x.button,s&&x.disabled);return{container:ew(e,x.responsive),wrapper:x.wrapper,input:t,button:n,header:tw(x.header),label:tw(x.label,l&&x.required,s&&x.disabled),error:tw(x.error)}},[x,s,u,l]);return n().createElement("div",{className:"spinner-field ".concat(f||""),style:S.container},p&&n().createElement("div",{className:"field-header",style:S.header},p),b&&o&&n().createElement("div",{className:"question_label",style:S.label},o,l&&n().createElement("span",{style:x.required},"*"),y&&n().createElement(gE,{tooltip:y})),n().createElement("div",{style:S.wrapper},n().createElement("button",{type:"button",onClick:function(){if(!s){var e=(Number(i)||0)-C;(void 0===w||e>=w)&&a({target:{name:r,value:e}})}},disabled:s||void 0!==w&&(Number(i)||0)<=w,style:S.button,"aria-label":"Decrease value"},"-"),n().createElement("input",{type:"number",name:r,value:i||"",onChange:function(e){if(!s){var t=Number(e.target.value);Number.isNaN(t)||(void 0===w||t>=w)&&(void 0===k||t<=k)&&a({target:{name:r,value:t}})}},disabled:s,style:S.input,min:w,max:k,step:C}),n().createElement("button",{type:"button",onClick:function(){if(!s){var e=(Number(i)||0)+C;(void 0===k||e<=k)&&a({target:{name:r,value:e}})}},disabled:s||void 0!==k&&(Number(i)||0)>=k,style:S.button,"aria-label":"Increase value"},"+")),u&&n().createElement("div",{style:S.error},u))};wR.propTypes={name:o().string.isRequired,label:o().string,value:o().oneOfType([o().number,o().string]),onChange:o().func.isRequired,disabled:o().bool,required:o().bool,error:o().string,validation:o().shape({min:o().number,max:o().number,step:o().number}),header:o().node,styleName:o().string,customTheme:o().object,tooltip:o().string,showQuestionLabels:o().bool};var kR=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/TextAreaField.css"),ER={};ER.styleTagTransform=nl(),ER.setAttributes=Js(),ER.insert=Ks().bind(null,"head"),ER.domAPI=Gs(),ER.insertStyleElement=el(),Hs()(kR.A,ER),kR.A&&kR.A.locals&&kR.A.locals;var CR=["value","_onChange","disabled","_editable"];function xR(e){return xR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xR(e)}function SR(){return SR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SR.apply(null,arguments)}function _R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_R(Object(n),!0).forEach(function(t){IR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_R(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IR(e,t,n){return(t=function(e){var t=function(e){if("object"!=xR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var TR=function(t){t._id;var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.placeholder,l=t.rows,u=void 0===l?3:l,c=t.disabled,d=t.className,p=t.onChange,f=t.header,m=t.styleName,h=t.customTheme,v=void 0===h?{}:h,y=t.error,g=t.helperText,b=t.maxLength,A=t.tooltip,w=void 0===A?"":A,k=t.showQuestionLabels,E=void 0===k||k,C=xc(),x=(0,e.useMemo)(function(){var e=C.textAreaField||{};return ZA(e,v)},[C,v]),S=(0,e.useMemo)(function(){var e=OR(OR({},x.container),{},{width:"100%"}),t=tw(x.textarea,y&&x.error,c&&x.disabled);return{container:ew(e,x.responsive),textarea:t}},[x,y,c]),_=function(e){p&&p(e)};return n().createElement("div",{className:"form-field ".concat(m||""),style:S.container},f&&n().createElement("div",{className:"field-header",style:C.header},f),n().createElement(NE,{name:r,label:E?o:"",value:i,validation:a,className:d,customTheme:x,error:y,helperText:g,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:x.label||{}},t,r&&n().createElement("span",{style:x.required||{}},"*"),w&&n().createElement(gE,{tooltip:w})):null},renderInput:function(e){var t=e.value,r=(e._onChange,e.disabled),o=(e._editable,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,CR)),i=SR({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(o),o));return n().createElement("textarea",SR({},i,{value:t||"",onChange:_,rows:u,placeholder:s,disabled:r,className:"form-field__textarea",style:S.textarea,maxLength:b}))}}))};function PR(){return PR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PR.apply(null,arguments)}TR.propTypes={_id:o().oneOfType([o().string,o().number]),name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,validation:o().object,placeholder:o().string,rows:o().number,disabled:o().bool,className:o().string,onChange:o().func,header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,maxLength:o().number,tooltip:o().string,showQuestionLabels:o().bool};var BR=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.map(function(e){if("string"==typeof e)return{value:e,label:e};var t=e.optionId,n=e.text,r=e.name,o=e.value;return{value:o||r||t||"",label:n||r||o||"",id:t||o||r,selected:e.selected||!1,sortOrder:e.sortOrder||0}}).sort(function(e,t){return e.sortOrder-t.sortOrder}):(console.warn("Invalid options:",e),[])},DR={text:function(e){return n().createElement(ID,PR({},e,{type:"text"}))},textbox:CE,email:function(e){return n().createElement(CE,PR({},e,{type:"email"}))},password:QD,url:function(e){return n().createElement(CE,PR({},e,{type:"url"}))},number:function(e){return n().createElement(ID,PR({},e,{type:"number"}))},ssn:function(e){return n().createElement(ID,PR({},e,{type:"ssn"}))},itin:function(e){return n().createElement(ID,PR({},e,{type:"itin"}))},tin:function(e){return n().createElement(ID,PR({},e,{type:"tin"}))},tel:function(e){return n().createElement(ID,PR({},e,{type:"phone"}))},phone:function(e){return n().createElement(ID,PR({},e,{type:"phone"}))},phonenumber:function(e){return n().createElement(ID,PR({},e,{type:"phone"}))},mobile:function(e){return n().createElement(ID,PR({},e,{type:"phone"}))},percentage:function(e){var t,r,o,i,a;return n().createElement(zj,PR({},e,{minValue:null!==(t=null!==(r=e.minValue)&&void 0!==r?r:e.minvalue)&&void 0!==t?t:0,maxValue:null!==(o=null!==(i=e.maxValue)&&void 0!==i?i:e.maxvalue)&&void 0!==o?o:100,decimalScale:null!==(a=e.decimalScale)&&void 0!==a?a:2,placeholder:e.placeholder}))},currency:GS,textarea:TR,button:YE,radio:Yj,radiobutton:Yj,radiotabbuttons:oR,radioswitch:Yj,select:vR,dropdown:vR,dynamicdropdown:$P,checkbox:Zx,checkboxgroup:FS,address:BE,identification:bD,grid:function(e){return n().createElement(VC,PR({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},beneficiary:function(e){return n().createElement(VC,PR({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},cardlist:function(e){return n().createElement(VC,PR({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},spinner:wR,file:aD,upload:aD,pdf:GD,pdfpackage:sj,date:TP,datetime:TP,month:TP,time:TP,week:TP,displaytext:MP,hyperlink:cD,link:cD,default:function(e){return console.warn("No component found for field type: ".concat(e.type,", falling back to text input")),n().createElement(CE,PR({},e,{type:"text"}))}},jR=function(e){return e?DR[e.toLowerCase()]||(console.warn("No component found for field type: ".concat(e,", using default text input")),DR.default):(console.warn("No field type provided, using default text input"),DR.default)};function RR(e){return RR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},RR(e)}var MR=["showQuestionLabels"];function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(t){FR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FR(e,t,n){return(t=function(e){var t=function(e){if("object"!=RR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=RR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==RR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return VR(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(VR(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,VR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,VR(d,"constructor",u),VR(u,"constructor",l),l.displayName="GeneratorFunction",VR(u,o,"GeneratorFunction"),VR(d),VR(d,o,"Generator"),VR(d,r,function(){return this}),VR(d,"toString",function(){return"[object Generator]"}),(qR=function(){return{w:i,m:p}})()}function VR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}VR=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){VR(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},VR(e,t,n,r)}function QR(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function zR(e){return UR.apply(this,arguments)}function UR(){return e=qR().m(function e(t){var n,r,o,i,a,s,l,u=arguments;return qR().w(function(e){for(;;)switch(e.n){case 0:i=null!==(n=(o=u.length>1&&void 0!==u[1]?u[1]:{}).pollIntervalMs)&&void 0!==n?n:100,a=null!==(r=o.timeoutMs)&&void 0!==r?r:8e3,s=Date.now();case 1:if(!(Date.now()-s<a)){e.n=5;break}if(l="function"==typeof t?t():{},!Object.values(l||{}).some(Boolean)){e.n=3;break}return e.n=2,new Promise(function(e){return setTimeout(e,i)});case 2:e.n=4;break;case 3:return e.a(2,!0);case 4:e.n=1;break;case 5:return e.a(2,!1)}},e)}),UR=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){QR(i,r,o,a,s,"next",e)}function s(e){QR(i,r,o,a,s,"throw",e)}a(void 0)})},UR.apply(this,arguments);var e}function WR(e){return WR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},WR(e)}function HR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(t){GR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GR(e,t,n){return(t=function(e){var t=function(e){if("object"!=WR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=WR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==WR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return KR(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(KR(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,KR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,KR(d,"constructor",u),KR(u,"constructor",l),l.displayName="GeneratorFunction",KR(u,o,"GeneratorFunction"),KR(d),KR(d,o,"Generator"),KR(d,r,function(){return this}),KR(d,"toString",function(){return"[object Generator]"}),(YR=function(){return{w:i,m:p}})()}function KR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}KR=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){KR(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},KR(e,t,n,r)}function XR(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function JR(e){return JR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},JR(e)}function ZR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ZR(Object(n),!0).forEach(function(t){tM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tM(e,t,n){return(t=function(e){var t=function(e){if("object"!=JR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=JR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==JR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nM=function(e,t,n,r,o){return Yc(e,t,{values:n.values,visibility:n.visibility,disabled:n.disabled,required:n.required},o,{formSchema:r})};function rM(e){return rM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rM(e)}function oM(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return iM(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(iM(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,iM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,iM(d,"constructor",u),iM(u,"constructor",l),l.displayName="GeneratorFunction",iM(u,o,"GeneratorFunction"),iM(d),iM(d,o,"Generator"),iM(d,r,function(){return this}),iM(d,"toString",function(){return"[object Generator]"}),(oM=function(){return{w:i,m:p}})()}function iM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}iM=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){iM(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},iM(e,t,n,r)}function aM(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function sM(e,t,n){return(t=function(e){var t=function(e){if("object"!=rM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lM=function(t){var r=t.question,o=t.isVisible,i=t.isDisabled,a=t.isRequired,s=t.value,l=t.parentContext,u=t.apiConfig,c=t.showQuestionLabels,d=void 0===c||c,p=t.isCardlistModal,f=void 0!==p&&p,m=cc(),h=m.state,v=m.setValue,y=m.setSubmitted,g=m.questionRuleDetails,b=m.formSchema,A=m.validateForm,w=m.setRequired,k=m.setNestedState,E=m.rulesEngine,C=(0,e.useRef)(o),x=(0,e.useRef)(!1),S=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,e.useContext)(oc),r=n.state,o=n.formState,i=n.onApiTrigger,a=n.handleApiTrigger,s=(0,e.useCallback)(function(){var e,n=(e=YR().m(function e(n){var s,l;return YR().w(function(e){for(;;)switch(e.n){case 0:if(!(s=a||(i&&"function"==typeof i?function(e){return i(e,r)}:null))){e.n=2;break}return l=$R($R({},n),{},{toastConfigOverride:t,contextStateSnapshot:{values:(null==o?void 0:o.values)||{},visibility:(null==o?void 0:o.visibility)||{},disabled:(null==o?void 0:o.disabled)||{},required:(null==o?void 0:o.required)||{},errors:(null==o?void 0:o.errors)||{},apiErrors:(null==o?void 0:o.apiErrors)||{},isSubmitted:(null==o?void 0:o.isSubmitted)||!1}}),e.n=1,s(l);case 1:return e.a(2,e.v);case 2:return e.a(2,null)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){XR(i,r,o,a,s,"next",e)}function s(e){XR(i,r,o,a,s,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}(),[o,a,i,r,t]);return{triggerApi:s,formState:o}}(),_=S.triggerApi;if((0,e.useEffect)(function(){if(o&&!C.current&&!x.current&&(null==r?void 0:r.apiUrl)&&"function"==typeof _&&function(e){var t,n;return!(null==e||!e.apiUrl||"dropdown"!==(null===(t=e.questionType)||void 0===t?void 0:t.toLowerCase())&&!0!==(null===(n=e.proxyConfig)||void 0===n?void 0:n.callOnMount))}(r)&&function(e,t){if(e){var n=Gc(e);return 0===n.length||n.every(function(e){var n=t[e];return null!=n&&""!==n})}return!1}(r,h.values)){x.current=!0;var e=nM(r,h.values[null==r?void 0:r.questionId],h,b,"pageLoad");_(e)}o||(x.current=!1),C.current=o},[o,r,_,h,b]),(0,e.useEffect)(function(){var e;if(null!=r&&r.questionId&&o){var t=r.questionId,n=r.apiUrl,i=r.questionType,a=r.addressGroup,s=null==h||null===(e=h.optionsByQuestionId)||void 0===e?void 0:e[t];if(n&&"text"===(null==i?void 0:i.toLowerCase())&&(null==a?void 0:a.toLowerCase().includes("owner_info_dropdown"))&&(null==s?void 0:s.length)>0){var u=ee(t);if(void 0!==(null==l?void 0:l.itemIndex)&&(null==l?void 0:l.parentId)&&k){var c=ee(l.parentId);k(c,l.itemIndex,{required:sM({},t,!0)}),null!=E&&E.requiredState&&E.requiredState.set(u,!0),null!=E&&E.updateAllInstanceStates&&E.updateAllInstanceStates(c,u,"required",!0)}else w&&w(u,!0)}}},[null==r?void 0:r.questionId,null==r?void 0:r.apiUrl,null==r?void 0:r.questionType,null==r?void 0:r.addressGroup,null==h?void 0:h.optionsByQuestionId,o,null==l?void 0:l.itemIndex,null==l?void 0:l.parentId,w,k,E]),null!=r&&r.questionId&&o){var O,I=r.questionId,T=r.name,P=r.label,B=r.questionType,D=r.options,j=void 0===D?[]:D,R=r.header,M=void 0===R?"":R,L=r.placeholder,N=void 0===L?"":L,F=r.hintText,q=r.defaultValue,V=r.format,Q=void 0===V?"":V,z=r.minLength,U=r.maxLength,W=r.min,H=r.max,$=r.encrypted,G=void 0!==$&&$,Y=r.maskInput,K=r.maskingType,X=void 0===K?"":K,J=r.maskingLength,Z=void 0===J?"":J,te=r.target,ne=void 0===te?"":te,re=r.validationErrorMessages,oe=void 0===re?{}:re,ie=r.showCheckBox,ae=void 0!==ie&&ie,se=r.isEsignDoc,le=void 0!==se&&se,ue=r.isOpenInNewTab,ce=void 0!==ue&&ue,de=r.addAdditional,pe=void 0!==de&&de,fe=r.addMedication,me=void 0!==fe&&fe,he=r.styleName,ve=void 0===he?"":he,ye=r.customQuestionValueList,ge=r.inputProps,be=r.dependency,Ae=r.fileUploads,we=r.allowedFileType,ke=r.fileSizeLimit,Ee=r.numberOfFiles,Ce=r.includeExtraDropDowns,xe=r.additionalDropDowns,Se=r.uploadQuestionAdditionalDropDown,_e=r.errorMessage,Oe=r.addressGroup,Ie=r.startDate,Te=r.endDate,Pe=r.dateFormat,Be=r.apiUrl,De=r.tooltip,je=void 0===De?"":De,Re=null==h||null===(O=h.optionsByQuestionId)||void 0===O?void 0:O[I];if(function(e,t,n,r){return e&&"text"===(null==t?void 0:t.toLowerCase())&&(null==n?void 0:n.toLowerCase().includes("owner_info_dropdown"))&&!(null!=r&&r.length)}(Be,B,Oe,Re))return null;var Me=function(e,t){var n=null==e?void 0:e.toLowerCase();return"text"===n&&null!=t&&t.toLowerCase().includes("address")?"address":"text"===n&&null!=t&&t.toLowerCase().includes("owner_info_dropdown")?"dropdown":n}(B,Oe),Le=jR(Me);if(Le){var Ne=function(e,t,n,r,o){return"text"===(null==t?void 0:t.toLowerCase())&&(null==n?void 0:n.toLowerCase().includes("address"))&&r&&Object.keys(r).length>0?eM(eM({},e),{},{"data-parent-id":r.parentId||o,"data-item-index":void 0===r.itemIndex?-1:r.itemIndex}):e}(ge,B,Oe,l,I),Fe=BR(Re||j),qe=d&&function(e){return!["radio","radiobutton","checkbox","link","button","cardlist","beneficiary","grid","submit","reset","hidden","checkboxgroup","displaytext"].includes(null==e?void 0:e.toLowerCase())}(B),Ve=function(e,t,n){var r,o,i,a=(null==n||null===(r=n.ruleValidationErrors)||void 0===r?void 0:r[e])||(null==n||null===(o=n.apiErrors)||void 0===o?void 0:o[e])||(null==n||null===(i=n.errors)||void 0===i?void 0:i[e])||null,s=JR(a);if(null!=t&&t.isCardList&&void 0!==(null==t?void 0:t.itemIndex)){var l,u,c,d,p="".concat(t.parentId,"_").concat(t.itemIndex),f=null===(l=n.nestedStates)||void 0===l?void 0:l[p];s=JR(a=(null==f||null===(u=f.ruleValidationErrors)||void 0===u?void 0:u[e])||(null==f||null===(c=f.apiErrors)||void 0===c?void 0:c[e])||(null==f||null===(d=f.errors)||void 0===d?void 0:d[e])||null)}return a&&"object"===JR(a)&&(a=Object.values(a).filter(Boolean).join(", ")),{fieldError:a,fieldErrorType:s}}(I,l,h),Qe=Ve.fieldError,ze=Ve.fieldErrorType,Ue=function(){var e,t=(e=oM().m(function e(){var t,n,o,i,a,s;return oM().w(function(e){for(;;)switch(e.n){case 0:if(t=null==B?void 0:B.toLowerCase(),n="button"===t,o=r.apiUrl,i=r.actionName&&"function"==typeof _,!n||!o&&!i){e.n=4;break}if("string"==typeof(null==r?void 0:r.apiUrl)&&0!==r.apiUrl.trim().length){e.n=3;break}return e.n=1,A();case 1:if(a=e.v,!(Object.keys(a).length>0)){e.n=2;break}return y(!0),e.a(2);case 2:if(!Je([".error_message_display_text",".error-message"])){e.n=3;break}return y(!0),e.a(2);case 3:s=nM(r,null,h,b,"buttonClick"),_(s);case 4:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){aM(i,r,o,a,s,"next",e)}function s(e){aM(i,r,o,a,s,"throw",e)}a(void 0)})});return function(){return t.apply(this,arguments)}}(),We=null!=N&&""!==String(N).trim()?N:F||q||P||"",He=function(e){var t=e.question,n=e.questionId,r=e.name,o=e.label,i=e.shouldShowLabel,a=e.value,s=e.formattedOptions,l=e.handleChange,u=e.handleBlur,c=e.handleButtonClick,d=e.isDisabled,p=e.isRequired,f=e.computedPlaceholder,m=e.fieldError,h=e.minLength,v=e.maxLength,y=e.min,g=e.max,b=e.header,A=e.format,w=e.encrypted,k=e.maskInput,E=e.maskingType,C=e.maskingLength,x=e.target,S=e.validationErrorMessages,_=e.showCheckBox,O=e.isEsignDoc,I=e.isOpenInNewTab,T=e.addAdditional,P=e.addMedication,B=e.questionRuleDetails,D=e.fieldInputProps,j=e.isVisible,R=e.apiConfig,M=e.dependency,L=e.state,N=e.styleName,F=e.customQuestionValueList,q=e.fileUploads,V=e.allowedFileType,Q=e.fileSizeLimit,z=e.numberOfFiles,U=e.includeExtraDropDowns,W=e.additionalDropDowns,H=e.uploadQuestionAdditionalDropDown,$=e.errorMessage,G=e.addressGroup,Y=e.startDate,K=e.endDate,X=e.dateFormat,J=e.questionType,Z=e.parentContext,ee=e.showQuestionLabels,te=e.isCardlistModal,ne=eM({id:String(n),questionId:String(n),name:r,label:i?"":o,value:void 0===a?"":a,options:s,onChange:l,onBlur:u,onClick:"button"===(null==J?void 0:J.toLowerCase())?c:void 0,disabled:d,required:p,placeholder:f,error:m,maxLength:v,minLength:h,min:y,max:g,header:b,format:A,encrypted:w,maskInput:k,maskingType:E,maskingLength:C,target:x,validationerrormessages:S,showcheckbox:_,isesigndoc:O,isopeninnewtab:I,addadditional:T,addmedication:P,questionRuleDetails:B,inputProps:D,visible:j,apiConfig:R,dependsOn:null==M?void 0:M.split(","),formData:L.values,styleName:N,customQuestionValueList:F,fileUploads:q,allowedFileType:V,fileSizeLimit:Q,numberOfFiles:z,includeExtraDropDowns:U,additionalDropDowns:W,uploadQuestionAdditionalDropDown:H,errorMessage:$,addressGroup:G,tooltip:t.tooltip||"",showQuestionLabels:ee},D);t.fieldProps&&Object.assign(ne,t.fieldProps);var re=w?{encrypted:!0}:{},oe=eM(eM({},ne),re);return G&&Object.assign(oe,{addressGroup:G}),"upload"===(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{allowedFileType:V,fileSizeLimit:Q,numberOfFiles:z,includeExtraDropDowns:U,additionalDropDowns:W,uploadQuestionAdditionalDropDown:H,errorMessage:$}),["text","tel","email","password","number","phonenumber","mobile","phone","ssn","tin"].includes(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{maskInput:k,maskingType:E,maskingLength:C}),["cardlist","beneficiary","grid"].includes(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{customQuestionValueList:F,questionType:"cardlist",min:y,max:g,isCardlistModal:te}),["date","datetime","month","time","week"].includes(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{startDate:Y,endDate:K,dateFormat:X}),"displaytext"===(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{value:t.value,parentContext:Z}),oe}({question:r,questionId:I,name:T,label:P,shouldShowLabel:qe,value:s,formattedOptions:Fe,handleChange:function(e){var t=null==B?void 0:B.toLowerCase();("cardlist"===t||r.onChange)&&"function"==typeof r.onChange&&r.onChange(e);var n=function(e,t,n){var r,o;if("upload"===(null==t?void 0:t.toLowerCase())){var i=e.value,a=e.fileUploads;return n.fileUploads=a,i}return null!==(r=null==e||null===(o=e.target)||void 0===o?void 0:o.value)&&void 0!==r?r:e}(e,t,r);if(e&&"cardlist"!==t&&"button"!==t){var o=null!=l&&l.isCardList?{cardListId:l.parentId,instanceIndex:l.itemIndex}:null;v(I,n,null,o)}if(("dropdown"===t||"text"===t)&&r.apiUrl&&"function"==typeof _){var i=nM(r,n,h,b,"onChange");_(i)}},handleBlur:function(e){var t=null==B?void 0:B.toLowerCase();if(("text"===t||"currency"===t)&&r.apiUrl&&"function"==typeof _){var n,o=void 0===(null==e||null===(n=e.target)||void 0===n?void 0:n.value)?e:e.target.value,i=nM(r,o,h,b,"onBlur");_(i)}},handleButtonClick:Ue,isDisabled:i,isRequired:a,computedPlaceholder:We,fieldError:Qe,minLength:z,maxLength:U,min:W,max:H,header:M,format:Q,encrypted:G,maskInput:Y,maskingType:X,maskingLength:Z,target:ne,validationErrorMessages:oe,showCheckBox:ae,isEsignDoc:le,isOpenInNewTab:ce,addAdditional:pe,addMedication:me,questionRuleDetails:g,fieldInputProps:Ne,isVisible:o,apiConfig:u,dependency:be,state:h,styleName:ve,customQuestionValueList:ye,fileUploads:Ae,allowedFileType:we,fileSizeLimit:ke,numberOfFiles:Ee,includeExtraDropDowns:Ce,additionalDropDowns:xe,uploadQuestionAdditionalDropDown:Se,errorMessage:_e,addressGroup:Oe,startDate:Ie,endDate:Te,dateFormat:Pe,questionType:B,parentContext:l,showQuestionLabels:d,isCardlistModal:f}),$e=null!=(null==l?void 0:l.parentId)&&void 0!==(null==l?void 0:l.itemIndex)?"".concat(I,"_").concat(l.itemIndex):I;return n().createElement("div",{id:"question_".concat($e),className:"form-field-container ".concat(Qe?"has-error":""," ").concat(ve)},qe&&P&&n().createElement("div",{className:"field-label"},n().createElement("div",{className:"question_label"},P,d&&a&&n().createElement("span",{className:"required-mark"},"*"),d&&je&&n().createElement(gE,{tooltip:je})),M&&n().createElement("div",{className:"field-header"},M)),n().createElement(Le,He),Qe&&"string"===ze&&"upload"!==(null==B?void 0:B.toLowerCase())&&n().createElement("div",{className:"error-message"},Qe))}}return null};lM.propTypes={question:ad,isVisible:o().bool,isDisabled:o().bool,isRequired:o().bool,value:o().any,parentContext:o().object,apiConfig:o().object,showQuestionLabels:o().bool,isCardlistModal:o().bool};const uM=lM;var cM=function(e){return void 0!==(null==e?void 0:e.itemIndex)&&(null==e?void 0:e.parentId)},dM=function(e){return"".concat(e.parentId,"_").concat(e.itemIndex)},pM=function(e){var t=e.group,r=e.parentContext,o=void 0===r?null:r,i=e.apiConfig,a=e.defaultGroupClass,s=void 0===a?"":a,l=e.showQuestionLabels,u=void 0===l||l,c=e.isCardlistModal,d=void 0!==c&&c,p=cc().state;if(t&&Array.isArray(t.questions)){var f,m;if(!t.groupId||null===(f=null==p||null===(m=p.groupVisibility)||void 0===m?void 0:m[t.groupId])||void 0===f||f){var h=t.questions.some(function(e){var t,n,r,o=null==e?void 0:e.questionId;return!!o&&(null===(t=null!==(n=null==p||null===(r=p.visibility)||void 0===r?void 0:r[o])&&void 0!==n?n:e.visible)||void 0===t||t)}),v=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=ee(null==e?void 0:e.questionId),o=null==e||null===(t=e.questionType)||void 0===t?void 0:t.toLowerCase();return cM(n)?function(e,t,n,r){var o,i,a=null==r||null===(o=r.values)||void 0===o?void 0:o[n.parentId];if(Array.isArray(a)&&a[n.itemIndex]){var s=a[n.itemIndex];if(Array.isArray(null==s?void 0:s.properties)){var l,u,c=s.properties.find(function(e){return ee(e.editQuestionId)===t});if(c)return null!==(l=null!==(u=c.value)&&void 0!==u?u:e.defaultValue)&&void 0!==l?l:""}if(void 0!==s[t])return s[t]}return null!==(i=e.defaultValue)&&void 0!==i?i:""}(e,r,n,p):"cardlist"===o?function(e,t){var n,r=null==t||null===(n=t.values)||void 0===n?void 0:n[e];return Array.isArray(r)?r.map(function(e){return e?{name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){return{editQuestionId:ee(e.editQuestionId),property:e.property,renderMode:e.renderMode,value:e.value}}):[]}:{}}):[]}(r,p):function(e,t,n){var r,o,i,a;return null!==(r=null!==(o=null!==(i=null==n||null===(a=n.values)||void 0===a?void 0:a[t])&&void 0!==i?i:e.value)&&void 0!==o?o:e.defaultValue)&&void 0!==r?r:""}(e,r,p)},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.map(function(e,r){var o=ee(null==e?void 0:e.questionId);if(o){var a=function(e,t,n){return cM(n)?"".concat(e,"-").concat(t,"-").concat(n.itemIndex):"".concat(e,"-").concat(t)}(o,r,t),s=function(e,t,n,r){var o,i,a;if(cM(t)){var s,l,u,c=dM(t);return null===(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.visibility)||void 0===u?void 0:u[e])&&void 0!==l?l:r)||void 0===s||s}return null===(o=null!==(i=null==n||null===(a=n.visibility)||void 0===a?void 0:a[e])&&void 0!==i?i:r)||void 0===o||o}(o,t,p,e.visible),l=function(e,t,n,r){var o,i,a;if(cM(t)){var s,l,u,c=dM(t);return null!==(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.disabled)||void 0===u?void 0:u[e])&&void 0!==l?l:r)&&void 0!==s&&s}return null!==(o=null!==(i=null==n||null===(a=n.disabled)||void 0===a?void 0:a[e])&&void 0!==i?i:r)&&void 0!==o&&o}(o,t,p,e.disabled),c=function(e,t,n,r){var o,i,a;if(cM(t)){var s,l,u,c=dM(t);return null!==(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.required)||void 0===u?void 0:u[e])&&void 0!==l?l:r)&&void 0!==s&&s}return null!==(o=null!==(i=null==n||null===(a=n.required)||void 0===a?void 0:a[e])&&void 0!==i?i:r)&&void 0!==o&&o}(o,t,p,e.required);return n().createElement(uM,{key:a,question:e,isVisible:s,isDisabled:l,isRequired:c,value:v(e,t),parentContext:t,apiConfig:i,showQuestionLabels:u,isCardlistModal:d})}return null})},g="question-group ".concat(cM(o)?"card-list-question":""," ").concat(s||"").trim(),b=t.groupName&&!t.groupName.startsWith("--");return h?n().createElement("div",{className:g,key:"question-group-".concat((null==o?void 0:o.itemIndex)||"")},b&&n().createElement("h3",{className:"group-name"},t.groupName),y(t.questions,o)):y(t.questions,o)}return null}return null};pM.propTypes={group:sd,parentContext:o().object,apiConfig:o().object,defaultGroupClass:o().string,showQuestionLabels:o().bool,isCardlistModal:o().bool};const fM=pM;function mM(e){return mM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mM(e)}function hM(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return vM(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(vM(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,vM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,vM(d,"constructor",u),vM(u,"constructor",l),l.displayName="GeneratorFunction",vM(u,o,"GeneratorFunction"),vM(d),vM(d,o,"Generator"),vM(d,r,function(){return this}),vM(d,"toString",function(){return"[object Generator]"}),(hM=function(){return{w:i,m:p}})()}function vM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}vM=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){vM(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},vM(e,t,n,r)}function yM(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function gM(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){yM(i,r,o,a,s,"next",e)}function s(e){yM(i,r,o,a,s,"throw",e)}a(void 0)})}}function bM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bM(Object(n),!0).forEach(function(t){wM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wM(e,t,n){return(t=function(e){var t=function(e){if("object"!=mM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=CM(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function EM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||CM(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CM(e,t){if(e){if("string"==typeof e)return xM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xM(e,t):void 0}}function xM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var SM=function(t){var r,o=t.schema,i=void 0===o?[]:o,a=t.actionSchema,s=void 0===a?[]:a,l=t.onSubmit,u=t.isNested,c=void 0!==u&&u,d=t.parentContext,p=void 0===d?{}:d,f=t.apiConfig,m=t.onApiTrigger,h=t.toastConfig,v=void 0===h?{}:h,y=t.defaultGroupClass,g=void 0===y?"":y,b=t.rerunPageRulesOnNext,A=void 0===b||b,w=t.pageRenderers,k=void 0===w?{}:w,E=t.pageType,C=t.showQuestionLabels,x=void 0===C||C,S=t.isCardlistModal,_=void 0!==S&&S,O=cc(),I=O.state,T=O.setSubmitted,P=O.validateForm,B=O.onApiTrigger,D=O.handleApiTrigger,j=O.batchUpdateFields,R=O.updateFieldOptions,M=O.processPageLoadRules,L=O.clearApiError,N=O.setApiError,F=O.setError,q=(0,e.useRef)(I),V=(0,e.useRef)((null==I?void 0:I.required)||{});if((0,e.useEffect)(function(){q.current=I},[I]),(0,e.useEffect)(function(){if(null!=I&&I.required&&null!=I&&I.errors){for(var e=I.required,t=V.current,n=[],r=0,o=Object.entries(I.errors);r<o.length;r++){var i=EM(o[r],2),a=i[0];if(i[1]){var s=!1!==t[a],l=!1===e[a];s&&l&&n.push(a)}}if(n.length>0&&F){var u,c=kM(n);try{for(c.s();!(u=c.n()).done;){var d=u.value;F(d,null)}}catch(e){c.e(e)}finally{c.f()}}V.current=AM({},e)}else V.current=(null==I?void 0:I.required)||{}},[null==I?void 0:I.required,null==I?void 0:I.errors,F]),!Array.isArray(i))throw new TypeError("Invalid form schema provided");var Q=(0,e.useMemo)(function(){return function(e){if(Array.isArray(e)){var t,n=[],r=Qc(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(Array.isArray(null==o?void 0:o.questions)){var i,a=Qc(o.questions);try{for(a.s();!(i=a.n()).done;){var s=i.value;Uc(s,n)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}return[]}(i)},[i]),z=function(){var e=gM(hM().m(function e(t,n,r){var o,a,s,l,u,c;return hM().w(function(e){for(;;)switch(e.n){case 0:if(o=t.questionId,a=Kc(I),s=Yc(t,n,a,r,{formSchema:i}),!D){e.n=1;break}return e.a(2,D(AM(AM({},s),{},{questionId:o,contextStateSnapshot:a})));case 1:if(!(l=m||B)){e.n=5;break}return e.p=2,e.n=3,l(s,I);case 3:return u=e.v,e.a(2,fl(u,{questionId:o,applyUpdates:j,applyOptions:R,setApiError:N,clearApiError:L,showSuccessToast:function(e){return il(e,"success",v)},showErrorToast:function(e){return il(e,"error",v)}}));case 4:return e.p=4,c=e.v,il(c.message||"An error occurred during API operation","error",v),e.a(2,{errors:{error:c.message||"Unknown error occurred"}});case 5:return e.a(2,null)}},e,null,[[2,4]])}));return function(t,n,r){return e.apply(this,arguments)}}(),U=(0,e.useRef)(new Set);(0,e.useEffect)(function(){if(Q.length&&I){var e,t=kM(Q);try{for(t.s();!(e=t.n()).done;){var n,r,o=e.value,i=null===(n=null===(r=I.visibility)||void 0===r?void 0:r[o.questionId])||void 0===n||n,a="".concat(o.questionId,"_").concat(o.triggerType);if("pageLoad"===o.triggerType&&i&&!Mc(I,o.questionId)&&!U.current.has(a)){U.current.add(a);var s={questionId:o.questionId,questionType:o.questionType,addressGroup:o.addressGroup,apiUrl:o.apiUrl,proxyConfig:o.proxyConfig},l=I.values[o.questionId];z(s,l,"pageLoad")}}}catch(e){t.e(e)}finally{t.f()}}},[Q,null==I?void 0:I.visibility,null==I?void 0:I.values]);var W=function(){var e=gM(hM().m(function e(t,n){var r,o,i,a,s;return hM().w(function(e){for(;;)switch(e.n){case 0:if(n.preventDefault(),"back"!==(null==t?void 0:t.toLowerCase())){e.n=1;break}return l&&l(q.current,t),e.a(2);case 1:return e.n=2,P();case 2:if(s=e.v,!(Object.keys(s).length>0)){e.n=3;break}return T(!0),id(),e.a(2);case 3:return e.n=4,zR(function(){var e;return null===(e=q.current)||void 0===e?void 0:e.apiLoading});case 4:if(!e.v){e.n=5;break}e.n=6;break;case 5:return il("Still waiting for the latest server response. Please try again in a moment.","warning",v),e.a(2);case 6:if("next"!==(null==t?void 0:t.toLowerCase())||!A||!M){e.n=7;break}return e.n=7,M();case 7:if(!od(null===(r=q.current)||void 0===r?void 0:r.errors,null===(o=q.current)||void 0===o?void 0:o.apiErrors,null===(i=q.current)||void 0===i?void 0:i.ruleValidationErrors,null===(a=q.current)||void 0===a?void 0:a.nestedStates)){e.n=8;break}return T(!0),id(),e.a(2);case 8:if(!Je([".error_message_display_text",".error-message"])){e.n=9;break}return T(!0),id(),e.a(2);case 9:l&&l(q.current,t);case 10:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),H=c?"div":"form",$=E?String(E):null!==(r=i[0])&&void 0!==r&&r.groupId?String(i[0].groupId):null,G=$&&k[$]?k[$]:null,Y=function(e,t,r){var o=function(o){var i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,A,w,k,E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!o||!o.questionId)return console.warn("createFieldRenderer: Invalid question provided"),null;var C=e.state,x=o.questionId,S=null===(i=o.questionType)||void 0===i?void 0:i.toLowerCase(),_=t(S);if(!_)return console.warn("createFieldRenderer: No component found for type: ".concat(S)),null;var O=void 0!==E.value?E.value:null!==(a=null!==(s=null!==(l=null==C||null===(u=C.values)||void 0===u?void 0:u[x])&&void 0!==l?l:o.value)&&void 0!==s?s:o.defaultValue)&&void 0!==a?a:"",I=null===(c=null!==(d=null==C||null===(p=C.visibility)||void 0===p?void 0:p[x])&&void 0!==d?d:o.visible)||void 0===c||c,T=null!==(f=null!==(m=null==C||null===(h=C.disabled)||void 0===h?void 0:h[x])&&void 0!==m?m:o.disabled)&&void 0!==f&&f,P=null!==(v=null!==(y=null==C||null===(g=C.required)||void 0===g?void 0:g[x])&&void 0!==y?y:o.required)&&void 0!==v&&v,B=(null==C||null===(b=C.errors)||void 0===b?void 0:b[x])||(null==C||null===(A=C.ruleValidationErrors)||void 0===A?void 0:A[x])||(null==C||null===(w=C.apiErrors)||void 0===w?void 0:w[x])||null,D=(null==C||null===(k=C.optionsByQuestionId)||void 0===k?void 0:k[x])||o.options||[],j=r(D),R=E.showQuestionLabels,M=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(E,MR),L=void 0===R||R,N=NR(NR({id:String(x),questionId:String(x),name:o.name||x,label:o.label||"",value:void 0===O?"":O,options:j,disabled:T||M.disabled,required:P,placeholder:o.placeholder||o.hintText||o.defaultValue||"",error:B,maxLength:o.maxLength,minLength:o.minLength,min:o.min,max:o.max,header:o.header,format:o.format,encrypted:o.encrypted,maskInput:o.maskInput,maskingType:o.maskingType,maskingLength:o.maskingLength,target:o.target,validationerrormessages:o.validationErrorMessages,showcheckbox:o.showCheckBox,isesigndoc:o.isEsignDoc,isopeninnewtab:o.isOpenInNewTab,addadditional:o.addAdditional,addmedication:o.addMedication,visible:I,styleName:o.styleName||"",tooltip:o.tooltip||"",showQuestionLabels:L},o.fieldProps),M);return"upload"===S&&Object.assign(N,{allowedFileType:o.allowedFileType,fileSizeLimit:o.fileSizeLimit,numberOfFiles:o.numberOfFiles,includeExtraDropDowns:o.includeExtraDropDowns,additionalDropDowns:o.additionalDropDowns,uploadQuestionAdditionalDropDown:o.uploadQuestionAdditionalDropDown,errorMessage:o.errorMessage}),["text","tel","email","password","number","phonenumber","mobile","phone","ssn","tin"].includes(S)&&Object.assign(N,{maskInput:o.maskInput,maskingType:o.maskingType,maskingLength:o.maskingLength}),["cardlist","beneficiary","grid"].includes(S)&&Object.assign(N,{customQuestionValueList:o.customQuestionValueList,questionType:"cardlist",min:o.min,max:o.max}),["date","datetime","month","time","week"].includes(S)&&Object.assign(N,{startDate:o.startDate,endDate:o.endDate,dateFormat:o.dateFormat}),!N.onChange&&e.setValue&&(N.onChange=function(t){var n,r,o,i="upload"===S?null!==(n=null==t?void 0:t.value)&&void 0!==n?n:t:null!==(r=null==t||null===(o=t.target)||void 0===o?void 0:o.value)&&void 0!==r?r:t;e.setValue(x,i),M.onChange&&M.onChange(t)}),!N.onBlur&&e.setValue&&(N.onBlur=function(e){M.onBlur&&M.onBlur(e)}),n().createElement(_,N)};return o.displayName="FieldRenderer",o}(O,jR,BR),K=function(){return s&&0!==s.length?n().createElement("div",{className:"form-actions"},s.map(function(e,t){if(e&&"object"===mM(e)){var r,o=e.text,i=e.action,a=e.disabled,s=void 0!==a&&a,l=e.actionButtonId,u="action_".concat(i,"_").concat(t),c="btn ".concat("next"===i?"btn-primary":"btn-secondary"),d=(null===(r=I.actionButtonDisabled)||void 0===r?void 0:r[l])||!1,p=s||d,f=p?{cursor:"not-allowed"}:{};return n().createElement("button",{key:u,type:"button",disabled:p,className:c,style:f,onClick:function(e){return W(i,e)}},o)}return null})):null};return G?n().createElement(H,{onSubmit:c?void 0:function(e){return e.preventDefault()},className:"dynamic-form ".concat(void 0===(null==p?void 0:p.itemIndex)?"":"card-list-form")},n().createElement(G,{pageType:$,schema:i,state:I,formContext:O,renderField:Y,getFieldComponent:jR,formatOptions:BR,actionSchema:s,handleActionClick:W,parentContext:p,apiConfig:f,defaultGroupClass:g,isNested:c,showQuestionLabels:x}),K()):n().createElement(H,{onSubmit:c?void 0:function(e){return e.preventDefault()},className:"dynamic-form ".concat(void 0===(null==p?void 0:p.itemIndex)?"":"card-list-form")},i.map(function(e,t){var r=null!=e&&e.groupId?String(e.groupId):"group_".concat(t),o=k[r];if(o)return n().createElement(o,{key:r,groupId:r,group:e,schema:i,state:I,formContext:O,renderField:Y,getFieldComponent:jR,formatOptions:BR,actionSchema:s,handleActionClick:W,parentContext:p,apiConfig:f,defaultGroupClass:g,isNested:c,showQuestionLabels:x,isCardlistModal:_});var a=(null==e?void 0:e.groupId)||"group_".concat(t);return n().createElement(fM,{key:a,group:e,parentContext:p,apiConfig:f,defaultGroupClass:g,showQuestionLabels:x,isCardlistModal:_})}),K())};SM.propTypes={schema:ld.questionGroups,actionSchema:o().array,onSubmit:o().func,isNested:o().bool,parentContext:o().object,apiConfig:o().object,onApiTrigger:o().func,toastConfig:o().shape({disableToasts:o().bool,useHostToastify:o().bool}),defaultGroupClass:o().string,rerunPageRulesOnNext:o().bool,pageRenderers:o().objectOf(o().elementType),pageType:o().oneOfType([o().string,o().number]),showQuestionLabels:o().bool,isCardlistModal:o().bool};const _M=SM;function OM(e){return OM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OM(e)}function IM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?IM(Object(n),!0).forEach(function(t){PM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PM(e,t,n){return(t=function(e){var t=function(e){if("object"!=OM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=OM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==OM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var BM=function(t){var r=t.questionGroups,o=t.actionButtons,i=t.questionRuleDetails,a=void 0===i?[]:i,s=t.questionRules,l=void 0===s?[]:s,u=t.groupRuleDetails,c=void 0===u?[]:u,d=t.groupRules,p=void 0===d?[]:d,f=t.optionRuleDetails,m=void 0===f?[]:f,h=t.optionRules,v=void 0===h?[]:h,y=t.buttonRules,g=void 0===y?[]:y,b=t.buttonRuleDetails,A=void 0===b?[]:b,w=t.theme,k=void 0===w?{}:w,E=t.debug,C=void 0!==E&&E,x=t.onSubmit,S=t.validationErrors,_=void 0===S?[]:S,I=t.isNested,T=void 0!==I&&I,P=t.parentContext,B=void 0===P?{}:P,D=t.skipFormProvider,j=void 0!==D&&D,R=t.apiConfig,M=t.onApiTrigger,L=t.formApiRef,N=t.handleIncompleteChange,F=t.toastConfig,V=void 0===F?{}:F,Q=t.performanceConfig,z=t.engineOptions,U=t.defaultGroupClass,W=void 0===U?"":U,H=t.rerunPageRulesOnNext,$=void 0===H||H,G=t.pageRenderers,Y=void 0===G?{}:G,K=t.pageType,X=t.showQuestionLabels,J=void 0===X||X,Z=t.isCardlistModal,ee=void 0!==Z&&Z;C&&"undefined"!=typeof console&&"function"==typeof console.log&&console.log("Package Version:","1.2.99");var te=(0,e.useMemo)(function(){return TM(TM({},gc),k)},[k]),ne=n().createElement(Cc,{theme:te},n().createElement(_M,{schema:Array.isArray(r)?r.map(function(e){return e&&"object"===OM(e)&&!Array.isArray(e.questions)?TM(TM({},e),{},{questions:Array.isArray(e.questions)?e.questions:[]}):e}):[],actionSchema:o,onSubmit:x,isNested:T,parentContext:B,apiConfig:R,onApiTrigger:M,toastConfig:V,defaultGroupClass:W,rerunPageRulesOnNext:$,pageRenderers:Y,pageType:K,showQuestionLabels:J,isCardlistModal:ee})),re=ne;if(T||j||(re=n().createElement(uc,{formSchema:r,questionRuleDetails:a,questionRules:l,groupRuleDetails:c,groupRules:p,optionRuleDetails:m,optionRules:v,buttonRules:g,buttonRuleDetails:A,validationSchema:_,debug:C,onApiTrigger:M,formApiRef:L,handleIncompleteChange:N,toastConfig:V,performanceConfig:Q,engineOptions:z},ne)),R){var oe,ie,ae={baseURL:R.baseURL||(null===(oe=R.customApi)||void 0===oe?void 0:oe.baseUrl)||"",headers:(null===(ie=R.customApi)||void 0===ie?void 0:ie.headers)||{}};R.customApi&&Object.assign(ae,R.customApi),re=n().createElement(q,{config:ae},re)}return null!=V&&V.disableToasts||null!=V&&V.useHostToastify||(re=n().createElement(n().Fragment,null,re,n().createElement(O,{position:"top-right",autoClose:5e3}))),re};BM.propTypes={questionGroups:o().arrayOf(o().shape({groupName:o().string,questions:o().arrayOf(o().object)})),actionButtons:o().arrayOf(o().object),questionRuleDetails:o().arrayOf(o().object),questionRules:o().arrayOf(o().shape({targetQuestionId:o().oneOfType([o().string,o().number]).isRequired,expressionToEvaluateForTheAction:o().object.isRequired})),groupRuleDetails:o().arrayOf(o().object),groupRules:o().arrayOf(o().object),optionRuleDetails:o().arrayOf(o().object),optionRules:o().arrayOf(o().object),buttonRules:o().arrayOf(o().object),buttonRuleDetails:o().arrayOf(o().object),theme:o().object,debug:o().bool,onSubmit:o().func,validationErrors:o().arrayOf(o().shape({questionid:o().oneOfType([o().string,o().number]).isRequired,message:o().string.isRequired,groupId:o().oneOfType([o().string,o().number])})),isNested:o().bool,parentContext:o().object,skipFormProvider:o().bool,apiConfig:o().object,parentAddressGroup:o().string,onApiTrigger:o().func,formApiRef:o().shape({current:o().object}),handleIncompleteChange:o().func,toastConfig:o().shape({disableToasts:o().bool,useHostToastify:o().bool}),performanceConfig:o().shape({debounceDelayMs:o().number}),engineOptions:o().shape({enablePerActionGating:o().bool,maxEvaluationDepth:o().number}),rerunPageRulesOnNext:o().bool,pageRenderers:o().objectOf(o().elementType),pageType:o().oneOfType([o().string,o().number]),showQuestionLabels:o().bool,isCardlistModal:o().bool};const DM=((RM=function(e){return n().createElement(Dc,{fallback:Rc},n().createElement(jM,e))}).displayName="WithErrorBoundary(".concat((jM=BM).displayName||jM.name||"Component",")"),RM);var jM,RM;function MM(){var t=cc(),n=t.formData,r=t.errors,o=t.touched,i=t.isSubmitting,a=t.handleChange,s=t.handleSubmit,l=t.setFieldError,u=t.setFieldTouched,c=t.setIsSubmitting,d=t.resetForm,p=(0,e.useCallback)(function(e,t){var n=Fs(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]);return n&&l(e.questionId,n),n},[l]);return{formData:n,errors:r,touched:o,isSubmitting:i,handleChange:a,handleSubmit:s,validateField:p,setFieldTouched:u,setIsSubmitting:c,resetForm:d}}})(),s})());
102
+ `:null,oE=Bv("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${dy(n.color)}`]]}})(cy(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:nE||{animation:`${eE} 1.4s linear infinite`}},...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),iE=Bv("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),aE=Bv("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${dy(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(cy(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink,style:rE||{animation:`${tE} 1.4s ease-in-out infinite`}}]}))),sE=e.forwardRef(function(e,t){const n=Mv({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:i=!1,size:a=40,style:s,thickness:l=3.6,value:u=0,variant:c="indeterminate",...d}=n,p={...n,color:o,disableShrink:i,size:a,thickness:l,value:u,variant:c},f=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Hd({root:["root",n,`color${dy(r)}`],svg:["svg"],circle:["circle",`circle${dy(n)}`,o&&"circleDisableShrink"]},Zk,t)})(p),m={},h={},v={};if("determinate"===c){const e=2*Math.PI*((44-l)/2);m.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,h.transform="rotate(-90deg)"}return(0,jv.jsx)(oE,{className:Wd(f.root,r),style:{width:a,height:a,...h,...s},ownerState:p,ref:t,role:"progressbar",...v,...d,children:(0,jv.jsx)(iE,{className:f.svg,ownerState:p,viewBox:"22 22 44 44",children:(0,jv.jsx)(aE,{className:f.circle,style:m,ownerState:p,cx:44,cy:44,r:(44-l)/2,fill:"none",strokeWidth:l})})})});function lE(e){return by("MuiIconButton",e)}const uE=Ay("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),cE=Bv(Jk,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,"default"!==n.color&&t[`color${dy(n.color)}`],n.edge&&t[`edge${dy(n.edge)}`],t[`size${dy(n.size)}`]]}})(cy(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:th(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),cy(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:th((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${uE.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${uE.loading}`]:{color:"transparent"}}))),dE=Bv("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),pE=e.forwardRef(function(e,t){const n=Mv({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:i,color:a="default",disabled:s=!1,disableFocusRipple:l=!1,size:u="medium",id:c,loading:d=null,loadingIndicator:p,...f}=n,m=kk(c),h=p??(0,jv.jsx)(sE,{"aria-labelledby":m,color:"inherit",size:16}),v={...n,edge:r,color:a,disabled:s,disableFocusRipple:l,loading:d,loadingIndicator:h,size:u},y=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:a}=e;return Hd({root:["root",a&&"loading",n&&"disabled","default"!==r&&`color${dy(r)}`,o&&`edge${dy(o)}`,`size${dy(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},lE,t)})(v);return(0,jv.jsxs)(cE,{id:d?m:c,className:Wd(y.root,i),centerRipple:!0,focusRipple:!l,disabled:s||d,ref:t,...f,ownerState:v,children:["boolean"==typeof d&&(0,jv.jsx)("span",{className:y.loadingWrapper,style:{display:"contents"},children:(0,jv.jsx)(dE,{className:y.loadingIndicator,ownerState:v,children:d&&h})}),o]})});function fE(e){return fE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fE(e)}function mE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mE(Object(n),!0).forEach(function(t){vE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vE(e,t,n){return(t=function(e){var t=function(e){if("object"!=fE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yE=function(e){var t=e.tooltip,r=e.placement,o=void 0===r?"top":r,i=e.sx,a=void 0===i?{}:i;return t?n().createElement(Bk,{title:t,arrow:!0,placement:o},n().createElement(pE,{size:"small",sx:hE({padding:"2px",marginLeft:"4px",verticalAlign:"middle",minWidth:"auto",width:"18px",height:"18px","&:hover":{backgroundColor:"transparent"}},a),"aria-label":t},n().createElement("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"10px",fontWeight:"bold",lineHeight:1}},"i"))):null};yE.propTypes={tooltip:o().string,placement:o().oneOf(["top","bottom","left","right"]),sx:o().object};const gE=yE;function bE(e){return bE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bE(e)}function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AE(Object(n),!0).forEach(function(t){kE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kE(e,t,n){return(t=function(e){var t=function(e){if("object"!=bE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EE=function(t){var r=t.questionId,o=t.label,i=t.defaultValue,a=t.validation,s=t.value,l=t.required,u=t.placeholder,c=t.onChange,d=t.type,p=void 0===d?"text":d,f=t.maskInput,m=t.format,h=t.helperText,v=(t._encrypted,t._maskingType,t._maskingLength,t._validationErrorMessages,t._showCheckBox,t._isEsignDoc,t._isOpenInNewTab,t._addAdditional,t._addMedication,t.header),y=t.maxLength,g=t.minLength,b=t.visible,A=t.inputProps,w=void 0===A?{}:A,k=t.styleName,E=t.customTheme,C=void 0===E?{}:E,x=(t._props,t.onSearch),S=t.onBlur,_=t.tooltip,O=void 0===_?"":_,I=t.showQuestionLabels,T=void 0===I||I,P=(0,e.useRef)(null),B=xc(),D=w["data-item-index"],j=w["data-parent-id"],R=GA({questionId:r,itemIndex:D,defaultValue:i,defaultVisible:!0,defaultDisabled:!1}),M=R.disabled,L=R.error,N=(0,e.useMemo)(function(){var e=B.textField||{};return ZA(e,C)},[B,C]),F=(0,e.useMemo)(function(){var e=wE(wE({},N.container),{},{width:"100%"}),t=tw(N.input,L&&N.error,M&&N.disabled);return{container:ew(e,N.responsive),input:t}},[N,L,M]);(0,e.useEffect)(function(){if(f&&P.current){var e=function(e){var t={placeholder:"",insertMode:!0,rightAlign:!1,clearMaskOnLostFocus:!1,showMaskOnHover:!1,showMaskOnFocus:!1,jitMasking:!0,greedy:!1};if("string"==typeof e){var n=e;return"#####-####"===e.replaceAll("9","#")&&(n="#####[-####]"),new(Ea())(fs(fs({},t),{},{mask:n.replaceAll("#","9")}))}var r=e.alias,o=e.inputFormat,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,us);return new(Ea())(fs(fs({},t),{},{alias:r,inputFormat:o},i))}(f);return e.mask(P.current),function(){e.remove()}}},[f,p]);var q=(0,e.useMemo)(function(){return hs(p)},[p]),V=(0,e.useMemo)(function(){return"number"!==p?{}:{onWheel:function(e){e.target.blur()},onKeyDown:function(e){var t=e.key;"ArrowUp"!==t&&"ArrowDown"!==t&&"PageUp"!==t&&"PageDown"!==t||e.preventDefault(),("e"===t||"E"===t||"+"===t||"="===t&&e.shiftKey)&&e.preventDefault()}}},[p]),Q=(0,e.useMemo)(function(){if("number"===p)return{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}},[p]);if(!b)return null;var z=p,U=y,W=void 0===D?r:"".concat(r,"-").concat(D);return n().createElement("div",{className:"form-field ".concat(k||""),style:F.container},v&&n().createElement("div",{className:"field-header",style:B.header},v),n().createElement("div",{style:{position:"relative"}},n().createElement(VA,{inputRef:P,value:s,onChange:function(e){var t=ls(e.target.value,p,f);x&&x(t),Fs({name:r,validation:a,required:l,type:p,format:m,questionType:p},e.target.value),c&&c(wE(wE({},e),{},{target:{value:t,name:r,type:p}}))},onBlur:S,sx:Q,disabled:M,required:l,placeholder:u,type:z,inputMode:q,error:!!L,helperText:L||h,label:T?o:"",id:String(W),name:String(W),slotProps:{input:wE(wE({},w),{},{inputProps:wE({maxLength:U,minLength:g},V),inputMode:hs(p)}),inputLabel:{style:B.label,required:T&&l},formHelperText:{style:L?B.error:B.helperText}},"data-item-index":D,"data-parent-id":j,fullWidth:!0}),T&&O&&o&&n().createElement("div",{style:{position:"absolute",top:"8px",right:"8px"}},n().createElement(gE,{tooltip:O}))))};EE.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,defaultValue:o().string,validation:o().object,value:o().oneOfType([o().string,o().number]),required:o().bool,placeholder:o().string,onChange:o().func,type:o().oneOf(["text","email","tel","password","url","number"]),maskInput:o().oneOfType([o().string,o().object,o().func]),format:o().string,helperText:o().string,_encrypted:o().any,_maskingType:o().any,_maskingLength:o().oneOfType([o().string,o().number]),_validationErrorMessages:o().any,_showCheckBox:o().any,_isEsignDoc:o().any,_isOpenInNewTab:o().any,_addAdditional:o().any,_addMedication:o().any,header:o().string,maxLength:o().number,minLength:o().number,visible:o().bool,inputProps:o().object,styleName:o().string,tooltip:o().string,customTheme:o().object,_props:o().object,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})}),onSearch:o().func,onBlur:o().func,showQuestionLabels:o().bool};const CE=EE;var xE=["name","addressGroup","label","required","disabled","className","apiConfig","inputProps"];function SE(){return SE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SE.apply(null,arguments)}function _E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=IE(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function OE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||IE(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IE(e,t){if(e){if("string"==typeof e)return TE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TE(e,t):void 0}}function TE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var PE=function(t){function r(r){var o,i=r.apiConfig,a=r.onAddressSelect,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,Bd),l=(null==i||null===(o=i.googlePlaces)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.debounceTime)||ud.debounceTime,u=Vd((0,e.useState)(null),2),c=u[0],d=u[1],p=Vd((0,e.useState)([]),2),f=p[0],m=p[1],h=Vd((0,e.useState)(!1),2),v=h[0],y=h[1],g=Vd((0,e.useState)(null),2),b=g[0],A=g[1],w=Vd((0,e.useState)(!1),2),k=w[0],E=w[1];(0,e.useEffect)(function(){function e(){return(e=qd(jd().m(function e(){var t,n,r,o;return jd().w(function(e){for(;;)switch(e.n){case 0:if(null==i||null===(t=i.googlePlaces)||void 0===t||!t.apiKey){e.n=4;break}return e.p=1,n=Td.getInstance(i.googlePlaces.apiKey,Ld(Ld({},ud),i.googlePlaces.options)),e.n=2,n.initialize();case 2:d(n),e.n=4;break;case 3:e.p=3,o=e.v,r=gd(o),A(r.message);case 4:return e.a(2)}},e,null,[[1,3]])}))).apply(this,arguments)}!function(){e.apply(this,arguments)}()},[i]);var C=(0,e.useCallback)(function(){var e=qd(jd().m(function e(t){var n,r,o;return jd().w(function(e){for(;;)switch(e.n){case 0:if(!c||!t){e.n=6;break}return e.p=1,y(!0),A(null),e.n=2,c.searchAddress(t);case 2:n=e.v,m(n),E(!0),e.n=4;break;case 3:e.p=3,o=e.v,r=gd(o),A(r.message),m([]),E(!1);case 4:return e.p=4,y(!1),e.f(4);case 5:e.n=7;break;case 6:m([]),E(!1);case 7:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[c]),x=(0,e.useRef)();(0,e.useEffect)(function(){var e,t,n,r;return x.current=(e=C,t=l,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];clearTimeout(n),n=setTimeout(function(){clearTimeout(n),e.apply(void 0,o)},t)},r.cancel=function(){clearTimeout(n)},r),function(){var e;null!==(e=x.current)&&void 0!==e&&e.cancel&&x.current.cancel()}},[C,l]);var S=(0,e.useCallback)(function(e){x.current(e)},[x]),_=(0,e.useCallback)(function(){var e=qd(jd().m(function e(t){var n,r,o,i,s,l;return jd().w(function(e){for(;;)switch(e.n){case 0:if(!c||!t){e.n=5;break}return e.p=1,y(!0),e.n=2,c.getPlaceDetails(t.place_id);case 2:n=e.v,r=J(n),o=[r.street_number,r.street].filter(Boolean).join(" ").trim(),i={address:o,city:r.city,state:r.state_short||r.state,zipcode:r.zipcode},null==a||a(n,i),m([]),E(!1),e.n=4;break;case 3:e.p=3,l=e.v,s=gd(l),A(s.message);case 4:return e.p=4,y(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[c,a]);return(0,e.useEffect)(function(){return function(){m([]),E(!1)}},[]),n().createElement("div",{className:"address-autocomplete-container",style:{position:"relative"}},n().createElement(t,Dd({},s,{onSearch:S,loading:v,error:b})),k&&f.length>0&&n().createElement("div",{className:"address-predictions-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,backgroundColor:"#fff",border:"1px solid #ddd",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",maxHeight:"200px",overflowY:"auto"}},f.map(function(e){return n().createElement("button",{key:e.place_id,type:"button",onClick:function(){return _(e)},style:{padding:"8px 12px",cursor:"pointer",borderBottom:"1px solid #eee",width:"100%",textAlign:"left",background:"transparent",border:"none"},"aria-label":"Select ".concat(e.description)},e.description)})))}return r.propTypes={apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,debounceTime:o().number})})}).isRequired,onAddressSelect:o().func},r}(CE),BE=function(t){var r=t.name,o=t.addressGroup,i=t.label,a=t.required,s=t.disabled,l=t.className,u=t.apiConfig,c=t.inputProps,d=void 0===c?{}:c,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,xE),f=cc(),m=f.batchUpdate,h=f.validateAddressFields,v=f.formSchema,y=f.state,g=function(e,t,n){null!=e&&e.addressGroup&&!1!==n[e.questionId]&&(t[e.addressGroup]=e.questionId)},b=function(e,t,n){var r;if("cardlist"===e.questionType&&null!==(r=e.customQuestionValueList)&&void 0!==r&&r.editQuestions&&!1!==n[e.questionId]){var o,i=_E(e.customQuestionValueList.editQuestions);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.addressGroup&&(t[a.addressGroup]=a.questionId)}}catch(e){i.e(e)}finally{i.f()}}},A=(0,e.useMemo)(function(){return v&&Array.isArray(v)?function(e,t){var n={};try{var r,o=_E(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(null!=i&&i.questions){var a,s=_E(i.questions);try{for(s.s();!(a=s.n()).done;){var l=a.value;g(l,n,t),b(l,n,t)}}catch(e){s.e(e)}finally{s.f()}}}}catch(e){o.e(e)}finally{o.f()}}catch(e){console.error("Error creating addressGroup mapping:",e)}return n}(v,y.visibility):{}},[v,y.visibility]),w=(0,e.useCallback)(function(e,t){if(e&&o){var n=function(e){return e?e.split("_address")[0]:""}(o),r=function(e){return{address:"".concat(e,"_address"),city:"".concat(e,"_city"),state:"".concat(e,"_state"),zipcode:"".concat(e,"_zipcode")}}(n),i=function(e,t,n){for(var r={},o=0,i=Object.entries(e);o<i.length;o++){var a=OE(i[o],2),s=a[0],l=a[1];n[s]&&t[l]&&(r[t[l]]=n[s])}return r}(r,A,t),a=function(e){return Boolean(e["data-parent-id"]&&void 0!==e["data-item-index"])}(d);!function(e,t,n,r){e?r(t,n["data-parent-id"],n["data-item-index"],!0):r(t,null,-1,!0)}(a,i,d,m),h(o)}},[o,m,h,A,d]);return n().createElement(PE,SE({},p,{name:r,label:i,required:a,disabled:s,className:l,apiConfig:u,onAddressSelect:w,addressGroup:o,inputProps:d}))};function DE(e){return DE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DE(e)}function jE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jE(Object(n),!0).forEach(function(t){ME(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ME(e,t,n){return(t=function(e){var t=function(e){if("object"!=DE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=DE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==DE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}BE.propTypes={name:o().string.isRequired,addressGroup:o().string.isRequired,label:o().string,required:o().bool,disabled:o().bool,className:o().string,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})})}).isRequired,inputProps:o().object};var NE=function(t){var r,o=t.name,i=t.label,a=t.value,s=t.validation,l=void 0===s?{}:s,u=t.className,c=void 0===u?"":u,d=t.renderInput,p=t.renderLabel,f=t.formState,m=t.skipValidation,h=void 0!==m&&m,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,A=t.apiConfig,w=cc(),k=xc(),E=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return LE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LE(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(null),2),C=E[0],x=E[1],S=f||(null==w?void 0:w.state)||w,_=String(o);if((0,e.useEffect)(function(){if(S){var e=S.serverValidationErrors,t=void 0===e?{}:e,n=S.errors,r=void 0===n?{}:n,o=t[_]||r[_];x(o)}else console.warn("BaseField: formState is undefined. Make sure the component is wrapped in a FormProvider or receives formState as a prop.")},[S,_]),S){var O=S.disabled,I=void 0===O?{}:O,T=S.required,P=void 0===T?{}:T,B=S.editable,D=void 0===B?{}:B,j=S.onChange,R=I[_]||!1,M=P[_]||!1,L=!1!==D[_],N=RE(RE({},k),b);return r=d({name:_,value:a,onChange:function(e){var t,n=(t=e,h?null:l.required&&(!t||Array.isArray(t)&&0===t.length)?l.requiredMessage||"This field is required":l.custom?l.custom(t,h):null);x(n),j&&!R&&L&&j(_,e)},disabled:R,required:M,_editable:L,_error:C,_theme:N,_apiConfig:A}),n().createElement("div",{className:"form-field ".concat(c," ").concat(y||""),style:N.field},v&&n().createElement("div",{className:"field-header",style:N.header},v),null==p?void 0:p({label:i,isRequired:M,theme:N}),r)}return null};NE.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().any,validation:o().object,className:o().string,renderInput:o().func.isRequired,renderLabel:o().func,formState:o().object,skipValidation:o().bool,header:o().node,styleName:o().string,customTheme:o().object,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})})};const FE=NE;var qE=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/ButtonField.css"),VE={};function QE(e){return QE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QE(e)}function zE(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return UE(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(UE(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,UE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,UE(d,"constructor",u),UE(u,"constructor",l),l.displayName="GeneratorFunction",UE(u,o,"GeneratorFunction"),UE(d),UE(d,o,"Generator"),UE(d,r,function(){return this}),UE(d,"toString",function(){return"[object Generator]"}),(zE=function(){return{w:i,m:p}})()}function UE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}UE=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){UE(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},UE(e,t,n,r)}function WE(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function HE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HE(Object(n),!0).forEach(function(t){GE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GE(e,t,n){return(t=function(e){var t=function(e){if("object"!=QE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=QE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==QE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}VE.styleTagTransform=nl(),VE.setAttributes=Js(),VE.insert=Ks().bind(null,"head"),VE.domAPI=Gs(),VE.insertStyleElement=el(),Hs()(qE.A,VE),qE.A&&qE.A.locals&&qE.A.locals;var YE=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.onChange,c=t.onClick,d=t.customTheme,p=void 0===d?{}:d,f=t.variant,m=void 0===f?"primary":f,h=t.size,v=void 0===h?"medium":h,y=t.icon,g=t.fullWidth,b=void 0!==g&&g,A=t.styleName,w=cc().setValue,k=xc(),E=(0,e.useMemo)(function(){var e=k.buttonField||{};return ZA(e,p)},[k,p]),C=(0,e.useMemo)(function(){var e=$E($E({},E.container),b&&{width:"100%"}),t=tw(E.button,E[m],E[v],b&&E.fullWidth,s&&E.disabled);return{container:ew(e,E.responsive),button:t,icon:E.icon}},[E,m,v,b,s]),x=o,S=function(){var e,t=(e=zE().m(function e(t){return zE().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),w(r,x),!c){e.n=1;break}return e.n=1,c(t);case 1:null==u||u({target:{name:r,value:x}});case 2:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){WE(i,r,o,a,s,"next",e)}function s(e){WE(i,r,o,a,s,"throw",e)}a(void 0)})});return function(e){return t.apply(this,arguments)}}();return n().createElement(NE,{name:r,label:"",value:i,validation:a,className:"button-field ".concat(A||""," ").concat(l||""),customTheme:E,renderInput:function(){return n().createElement("button",{type:"button",onClick:S,disabled:s,style:C.button},y&&n().createElement("span",{style:C.icon},y),x)}})};function KE(e){return KE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KE(e)}function XE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZE(e,t,n){return(t=function(e){var t=function(e){if("object"!=KE(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=KE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==KE(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}YE.propTypes={name:o().string.isRequired,label:o().string,value:o().string,validation:o().object,disabled:o().bool,className:o().string,onChange:o().func,onClick:o().func,customTheme:o().object,variant:o().oneOf(["primary","secondary","success","danger","warning","outline","text"]),size:o().oneOf(["small","medium","large"]),icon:o().node,fullWidth:o().bool,styleName:o().string};var eC=function(e){return e.map(function(e){return e?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JE(Object(n),!0).forEach(function(t){ZE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){var t;return{property:e.property,value:e.value,editQuestionId:e.editQuestionId,renderMode:null!==(t=e.renderMode)&&void 0!==t?t:null}}):[]},void 0!==e.__isPending__&&{__isPending__:e.__isPending__}):null})},tC=function(e){return!!(Array.isArray(e)&&e.length>0)&&e.every(function(e){return!e||!Array.isArray(e.properties)||0===e.properties.length})},nC=function(e){return(Array.isArray(e.customQuestionValuesList)?e.customQuestionValuesList:[e.customQuestionValuesList]).map(function(t){return function(e,t){return null!=e&&e.properties?{name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){var t;return{property:e.property,value:e.value,editQuestionId:e.editQuestionId,renderMode:null!==(t=e.renderMode)&&void 0!==t?t:null}}):[]}:{name:"".concat(null==e?void 0:e.name," - 1"),properties:Object.entries(e||{}).map(function(e){var n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return XE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XE(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),o=r[0],i=r[1];return{property:o,value:i,editQuestionId:null===(n=t.editQuestions)||void 0===n||null===(n=n.find(function(e){return e.name===o}))||void 0===n?void 0:n.questionId,renderMode:null}})}}(t,e)})},rC=function(e,t){var n;return{name:"".concat(e," - 1"),properties:(null==t||null===(n=t.editQuestions)||void 0===n?void 0:n.map(function(e){return{property:e.name,value:e.value||"",editQuestionId:e.questionId,renderMode:null}}))||[]}};function oC(e){return oC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oC(e)}var iC=["name","label","questionId","customQuestionValueList","onChange","validation","max","min","className","disabled","readOnly","questionRuleDetails","apiConfig","customTheme","visible","isCardlistModal"];function aC(e){return function(e){if(Array.isArray(e))return fC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pC(e)||function(){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 sC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sC(Object(n),!0).forEach(function(t){uC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uC(e,t,n){return(t=function(e){var t=function(e){if("object"!=oC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cC(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=pC(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function dC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||pC(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pC(e,t){if(e){if("string"==typeof e)return fC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fC(e,t):void 0}}function fC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var mC=a("./node_modules/css-loader/dist/cjs.js!./src/components/common/Modal.css"),hC={};hC.styleTagTransform=nl(),hC.setAttributes=Js(),hC.insert=Ks().bind(null,"head"),hC.domAPI=Gs(),hC.insertStyleElement=el(),Hs()(mC.A,hC),mC.A&&mC.A.locals&&mC.A.locals;var vC=function(t){var r=t.isOpen,o=t.onClose,i=t.title,a=t.children,s=t.size,l=void 0===s?"medium":s,u=t.showCloseButton,c=void 0===u||u,d=t.closeOnOverlayClick,p=void 0===d||d,f=t.className,m=void 0===f?"":f,h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onKeyDown,r=(t._onFocus,t._onBlur,t.focusFirst),o=void 0!==r&&r,i=t.trapFocus,a=void 0!==i&&i,s=t.autoFocus,l=void 0!==s&&s,u=t.disabled,c=void 0!==u&&u,d=t.returnFocus,p=void 0===d||d,f=(0,e.useRef)(null),m=(0,e.useRef)(null),h=(0,e.useCallback)(function(){return f.current?Array.from(f.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(function(e){return!e.hasAttribute("disabled")&&null!==e.offsetParent}):[]},[]),v=(0,e.useCallback)(function(e){if(null==n||n(e),a&&f.current){var t=h();if(0!==t.length){var r=t[0],o=t.at(-1);"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(o.focus(),e.preventDefault()):document.activeElement===o&&(r.focus(),e.preventDefault()))}}},[a,n,h]);return(0,e.useEffect)(function(){if(!c){if(m.current=document.activeElement,l||o){var e=h();e.length>0&&e[0].focus()}return function(){p&&m.current&&m.current.focus()}}},[l,o,c,p,h]),(0,e.useEffect)(function(){var e=f.current;if(e)return e.addEventListener("keydown",v),function(){e.removeEventListener("keydown",v)}},[v]),{containerRef:f,getFocusableElements:h,focusFirst:function(){var e=h();e.length>0&&e[0].focus()},focusLast:function(){var e=h();e.length>0&&e.at(-1).focus()},focusNext:function(){var e=h(),t=e.indexOf(document.activeElement);t>-1&&t<e.length-1&&e[t+1].focus()},focusPrevious:function(){var e=h(),t=e.indexOf(document.activeElement);t>0&&e[t-1].focus()}}}({trapFocus:!0,focusFirst:!0,returnFocus:!0,onKeyDown:function(e){"Escape"===e.key&&o()}}),v=h.containerRef,y=h.getFocusableElements,g=h.focusFirst;if((0,e.useEffect)(function(){return r?(document.body.style.overflow="hidden",y().length>0&&document.activeElement===document.body&&setTimeout(function(){g()},100)):document.body.style.overflow="",function(){document.body.style.overflow=""}},[r]),!r)return null;var b="modal-".concat(l);return n().createElement("div",{className:"modal-overlay",onClick:function(e){p&&e.target===e.currentTarget&&o()},onKeyDown:function(e){!p||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o())},role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",tabIndex:-1},n().createElement("div",{ref:v,className:"modal-container ".concat(b," ").concat(m),onClick:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()},role:"document"},n().createElement("div",{className:"modal-header"},i&&n().createElement("h2",{id:"modal-title",className:"modal-title"},i),c&&n().createElement("button",{type:"button",className:"modal-close-button",onClick:o,"aria-label":"Close modal"},"×")),n().createElement("div",{className:"modal-content"},a)))};vC.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,title:o().string,children:o().node.isRequired,size:o().oneOf(["small","medium","large","fullscreen"]),showCloseButton:o().bool,closeOnOverlayClick:o().bool,className:o().string};const yC=vC;function gC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bC(e){return bC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bC(e)}function AC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AC(Object(n),!0).forEach(function(t){kC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kC(e,t,n){return(t=function(e){var t=function(e){if("object"!=bC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EC(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=CC(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function CC(e,t){if(e){if("string"==typeof e)return xC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xC(e,t):void 0}}function xC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var SC=function(t){var r,o=t.isOpen,i=t.onClose,a=t.onSave,s=t.cardItem,l=t.itemIndex,u=t.cardListId,c=t.cardListName,d=t.customQuestionValueList,p=t.questionRuleDetails,f=t.apiConfig,m=t.disabled,h=void 0!==m&&m,v=t.readOnly,y=void 0!==v&&v,g=cc(),b=g.state,A=g.setValue,w=g.setNestedState,k=g.rulesEngine,E=g.updateCardList,C=(0,e.useRef)(null),x=(0,e.useRef)(!1),S=(0,e.useRef)(!1),_=(0,e.useRef)(null),O=(0,e.useRef)(null),I=(0,e.useRef)(!1),T=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||CC(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(new Map),2),P=T[0],B=T[1],D=(0,e.useCallback)(function(){if(k&&null!=d&&d.editQuestions&&!(l<0)){var e={cardListId:u,instanceIndex:l};B(function(t){var n,r,o=new Map(t),i=!1,a=null===(n=b.values)||void 0===n?void 0:n[u],s=Array.isArray(a)&&a[l]?a[l]:null,c=EC(d.editQuestions);try{var p=function(){var n,a=r.value,c=a.questionId||a.name,d=ee(c),p=null==s||null===(n=s.properties)||void 0===n?void 0:n.find(function(e){return ee(e.editQuestionId)===ee(c)}),f=null==p?void 0:p.value,m=null!=f,h=k.getCardListInstanceState(u,l,d),v=k.getQuestionValueWithCardListContext(c,e),y="",g=void 0!==(null==h?void 0:h.value)&&null!==(null==h?void 0:h.value),b=null!=v;y=m?g&&""!==h.value&&h.value!==f?h.value:f:g?h.value:b?v:t.has(c)?t.get(c):a.value||a.defaultValue||"",h&&""===h.value&&t.has(c)&&""!==t.get(c)&&(y=""),t.get(c)!==y&&(o.set(c,y),i=!0)};for(c.s();!(r=c.n()).done;)p()}catch(e){c.e(e)}finally{c.f()}return i?o:t})}},[k,u,l,d,b.values]);(0,e.useEffect)(function(){if(o){var e=_.current!==l;if(!S.current||e){var t;S.current=!0,_.current=l,C.current=s?JSON.stringify(s):null,x.current=!1;var n=new Map;if(null!=d&&d.editQuestions){var r,i={cardListId:u,instanceIndex:l},a=EC(d.editQuestions);try{var p=function(){var e=r.value,t=e.questionId||e.name,o="",a=!1;if(null!=s&&s.properties){var c=s.properties.find(function(e){return ee(e.editQuestionId)===ee(t)});void 0!==(null==c?void 0:c.value)&&null!==(null==c?void 0:c.value)&&(o=c.value,a=!0)}if(!a&&k){var p=k.getQuestionValueWithCardListContext(t,i);null!=p&&""!==p&&(o=p)}if(a||""!==o&&null!=o||(o=e.value||e.defaultValue||""),n.set(t,o),k&&l>=0){var f=ee(t),m=k.getCardListInstanceState(u,l,f);!m&&d.editQuestions&&(k.initializeCardListChildStates(u,l,d.editQuestions),m=k.getCardListInstanceState(u,l,f)),m&&(a||void 0===m.value||null===m.value||""===m.value?(m.value=o,k.setCardListInstanceState(u,l,f,m)):n.set(t,m.value))}};for(a.s();!(r=a.n()).done;)p()}catch(e){a.e(e)}finally{a.f()}}if(B(n),k&&l>=0){var f,m=(null==d?void 0:d.editQuestions)||[],h="".concat(u,"_").concat(l),v=null===(f=k.cardListInstanceStates)||void 0===f?void 0:f.has(h);if(!v&&m.length>0)k.executeRulesForNewCardListInstance(u,l,m),setTimeout(function(){D()},0);else if(v&&m.length>0)if(k.reExecutePageLoadRulesForInstance)k.reExecutePageLoadRulesForInstance(u,l,m),setTimeout(function(){D()},0);else{var y,g,A={cardListId:u,instanceIndex:l},O=new Set(m.map(function(e){return e.questionId||e.name})),T=(null===(y=k.questionRuleDetails)||void 0===y?void 0:y.filter(function(e){return("PAGE_LOAD"===e.ruleExecutionType||"REFLEXIVE_LOAD"===e.ruleExecutionType)&&(O.has(e.triggerQuestionId)||O.has(e.targetQuestionId))}))||[],P=EC(T);try{for(P.s();!(g=P.n()).done;){var j=g.value;try{var R,M,L,N="".concat(j.conditionId,"_").concat(j.triggerQuestionId,"_").concat(u,"_").concat(l);null!==(R=k.evaluationQueue)&&void 0!==R&&R.has(N)||(null===(M=k.evaluationQueue)||void 0===M||M.add(N),k.evaluateRule(j,j.triggerQuestionId,A,!1),null===(L=k.evaluationQueue)||void 0===L||L.delete(N))}catch(e){console.warn("Error re-evaluating rule for CardList instance:",e)}}}catch(e){P.e(e)}finally{P.f()}setTimeout(function(){D()},0)}}var F="".concat(u,"_").concat(l),q=null===(t=b.nestedStates)||void 0===t?void 0:t[F];if(w(u,l,q?{errors:{}}:{visibility:{},disabled:{},required:{},errors:{},ruleValidationErrors:{}}),!s&&null!=d&&d.editQuestions&&l>=0){var V,Q=(null===(V=b.values)||void 0===V?void 0:V[u])||[];if(!Array.isArray(Q)||Q.length<=l){I.current=!0;for(var z=function(e,t,n){return Array.isArray(n)?{name:"".concat(e," - ").concat(t+1),properties:n.map(function(e){return{property:e.name||e.label,value:e.value||e.defaultValue||"",editQuestionId:ee(e.questionId||e.name),renderMode:null}}),__isPending__:!0}:{name:"".concat(e," - ").concat(t+1),properties:[],__isPending__:!0}}(c,l,d.editQuestions),U=function(e){return function(e){if(Array.isArray(e))return xC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||CC(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Q);U.length<=l;)U.push({name:"",properties:[]});U[l]=z,E(u,U,"add","",l)}else I.current=!1,B(function(e){var t,n=new Map(e),r=EC(d.editQuestions);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=o.questionId||o.name;if(!n.has(i)){var a=o.value||o.defaultValue||"";if(n.set(i,a),k&&l>=0){var s=ee(i),c=k.getCardListInstanceState(u,l,s);c||(k.initializeCardListChildStates(u,l,d.editQuestions),c=k.getCardListInstanceState(u,l,s)),c&&(c.value=a,k.setCardListInstanceState(u,l,s,c))}}}}catch(e){r.e(e)}finally{r.f()}return n})}else I.current=!1}}else o||(S.current=!1,_.current=null,I.current=!1,B(new Map),x.current=!1)},[o,l,u,D]),(0,e.useEffect)(function(){if(!o||!k||l<0||null==d||!d.editQuestions||!S.current)return function(){};var e=setTimeout(function(){S.current&&D()},100);return function(){clearTimeout(e)}},[o,k,l,u,d,D,b.values]);var j=(0,e.useCallback)(function(e,t){x.current=!0,B(function(n){var r=new Map(n);return r.set(e,t),r});var n={cardListId:u,instanceIndex:l};if(k){var r=ee(e),o=k.getCardListInstanceState(u,l,r);if(!o&&null!=d&&d.editQuestions&&(k.initializeCardListChildStates(u,l,d.editQuestions),o=k.getCardListInstanceState(u,l,r)),o){o.value=t,k.setCardListInstanceState(u,l,r,o),k.processFieldChange(e,t,n,!0,!1,null);var i=k.getAllFieldStates().nestedStates,a="".concat(u,"_").concat(l),s=null==i?void 0:i[a];w(u,l,s?{visibility:s.visibility||{},disabled:s.disabled||{},required:s.required||{},ruleValidationErrors:s.ruleValidationErrors||{},errors:kC({},e,null)}:{errors:kC({},e,null)}),setTimeout(function(){D()},0)}}else w(u,l,{errors:kC({},e,null)})},[u,l,w,k,d,D]),R=n().useMemo(function(){return null!=d&&d.editQuestions?[{groupName:"",questions:d.editQuestions.map(function(e){var t=e.questionId||e.name,n=P.has(t)?P.get(t):void 0;return wC(wC({},e),{},{parentId:u,questionId:t,questionType:e.questionType||"text",value:n,onChange:function(e){var n="object"===bC(e)&&null!=e&&e.target?e.target.value:e;j(t,n)},validation:wC(wC({},e.validation),{},{required:e.required}),inputProps:{"data-item-index":l,"data-parent-id":u}})})}]:[]},[u,l,d,P,j]),M=(0,e.useCallback)(function(e){var t,n,r={cardListId:u,instanceIndex:l};if(P.has(e)){var o=P.get(e);return null!=o?o:""}if(k){var i=k.getCardListInstanceState(u,l,ee(e));if(void 0!==(null==i?void 0:i.value)&&null!==(null==i?void 0:i.value)){var a=i.value;return P.has(e)&&P.get(e)===a||B(function(t){var n=new Map(t);return n.set(e,a),n}),a}var s=k.getQuestionValueWithCardListContext(e,r);if(null!=s&&""!==s)return P.has(e)&&P.get(e)===s||B(function(t){var n=new Map(t);return n.set(e,s),n}),s}var c=null===(t=b.values)||void 0===t?void 0:t[u];if(Array.isArray(c)&&c[l]){var d=c[l];if(Array.isArray(null==d?void 0:d.properties)){var p=d.properties.find(function(t){return ee(t.editQuestionId)===ee(e)});if(void 0!==(null==p?void 0:p.value)&&null!==(null==p?void 0:p.value))return p.value}}var f=null===(n=b.values)||void 0===n?void 0:n[e];return null!=f?f:""},[P,k,b.values,u,l]),L=(0,e.useCallback)(function(){var e={},t=R;if(t.length>0&&t[0].questions){var n,r=EC(t[0].questions);try{for(r.s();!(n=r.n()).done;){var o,i,a,s,c=n.value,d=c.questionId,p=ee(d),f="".concat(u,"_").concat(l),m=null===(o=b.nestedStates)||void 0===o?void 0:o[f],h=void 0!==(null==m||null===(i=m.visibility)||void 0===i?void 0:i[d])?m.visibility[d]:!1!==c.visible;if(h){var v=c.required||!1;if(void 0!==(null==m||null===(a=m.required)||void 0===a?void 0:a[d]))v=m.required[d];else if(k){var y=k.getFieldState(p,l);void 0!==(null==y?void 0:y.required)&&(v=y.required)}var g=M(d);if(v&&(!g||"string"==typeof g&&""===g.trim())&&(e[d]="".concat(c.label||c.name," is required")),null!=g&&""!==g){var A,w,E,C,x=wC(wC({},c),{},{visible:h,required:v,disabled:null!==(A=null!==(w=null==m||null===(E=m.disabled)||void 0===E?void 0:E[d])&&void 0!==w?w:c.disabled)&&void 0!==A&&A}),S=wC({},b.values),_=null!==(C=b.serverValidationErrors)&&void 0!==C&&C[d]?[{questionId:d,message:b.serverValidationErrors[d]}]:[],O=Fs(x,g,S,_,b.nestedStates);O&&"string"==typeof O&&""!==O.trim()&&(e[d]||(e[d]=O))}var I=null==m||null===(s=m.ruleValidationErrors)||void 0===s?void 0:s[d];I&&"string"==typeof I&&""!==I.trim()&&(e[d]||(e[d]=I))}}}catch(e){r.e(e)}finally{r.f()}}return e},[R,u,l,b.nestedStates,k,M]),N=(0,e.useCallback)(function(){var e;if(k&&null!=d&&d.editQuestions){var t={cardListId:u,instanceIndex:l};B(function(e){var n,r=new Map(e),o=!1,i=EC(d.editQuestions);try{for(i.s();!(n=i.n()).done;){var a=n.value,s=a.questionId||a.name,c=ee(s),p=k.getCardListInstanceState(u,l,c),f=k.getQuestionValueWithCardListContext(s,t),m="";void 0!==(null==p?void 0:p.value)&&null!==(null==p?void 0:p.value)&&""!==(null==p?void 0:p.value)?m=p.value:null!=f&&""!==f?m=f:e.has(s)&&(m=e.get(s)),e.get(s)!==m&&(r.set(s,m),o=!0)}}catch(e){i.e(e)}finally{i.f()}return o?r:e})}var n=L();w(u,l,{errors:n});var r="".concat(u,"_").concat(l),o=null===(e=b.nestedStates)||void 0===e?void 0:e[r],s=(null==o?void 0:o.ruleValidationErrors)||{},p=Object.values(s).some(function(e){return e&&"string"==typeof e&&""!==e.trim()});if(!p&&k&&null!=d&&d.editQuestions){var f,m=EC(d.editQuestions);try{for(m.s();!(f=m.n()).done;){var h,v=f.value,y=v.questionId||v.name,g=ee(y),E=null===(h=k.validationMessages)||void 0===h?void 0:h.get(g);if(E&&"string"==typeof E&&""!==E.trim()){p=!0;break}}}catch(e){m.e(e)}finally{m.f()}}var C=[".error_message_display_text",".error-message"],S=O.current,_=S?Je(C,S):Je(C);if(Object.keys(n).length>0||p||_)id(C,S?{root:S}:{});else{var T={cardListId:u,instanceIndex:l};P.forEach(function(e,t){A(t,e,null,T)});var D=function(e,t,n,r){var o={name:"".concat(e," - ").concat(t+1),properties:[]};if(!Array.isArray(r))return o;var i,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return gC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gC(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(r);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=s.questionId||s.name,u=n instanceof Map?n.get(l):n[l];null==u&&(u=""),o.properties.push({property:s.name||s.label,value:u,editQuestionId:ee(l),renderMode:null})}}catch(e){a.e(e)}finally{a.f()}return o}(c,l,P,null==d?void 0:d.editQuestions);a&&a(D,l),I.current=!1,B(new Map),x.current=!1,i()}},[L,w,b.nestedStates,u,l,c,d,a,i,k,P,A]),F=(0,e.useCallback)(function(){if(I.current&&l>=0){var e,t=(null===(e=b.values)||void 0===e?void 0:e[u])||[];if(Array.isArray(t)&&t.length>l){var n=t.filter(function(e,t){return t!==l});E(u,n,"remove","",l)}k&&k.removeCardListInstance(u,l),I.current=!1}else{if(x.current&&C.current)try{var r=JSON.parse(C.current);if(null!=r&&r.properties){var o,a={cardListId:u,instanceIndex:l},s=EC(r.properties);try{for(s.s();!(o=s.n()).done;){var c=o.value;c.editQuestionId&&A(c.editQuestionId,c.value,null,a)}}catch(e){s.e(e)}finally{s.f()}}}catch(e){console.warn("Error restoring initial values:",e)}if(k&&l>=0&&C.current)try{var p=JSON.parse(C.current);if(null!=p&&p.properties&&null!=d&&d.editQuestions){var f,m=EC(d.editQuestions);try{var h=function(){var e=f.value,t=e.questionId||e.name,n=ee(t),r="",o=p.properties.find(function(e){return ee(e.editQuestionId)===ee(t)});void 0!==(null==o?void 0:o.value)&&null!==(null==o?void 0:o.value)&&(r=o.value);var i=k.getCardListInstanceState(u,l,n);i&&(i.value=r,k.setCardListInstanceState(u,l,n,i))};for(m.s();!(f=m.n()).done;)h()}catch(e){m.e(e)}finally{m.f()}}}catch(e){console.warn("Error restoring initial values in rules engine:",e)}}B(new Map),w(u,l,{errors:{}}),x.current=!1,i()},[u,l,A,w,i,k,d,b.values,E]),q=n().useMemo(function(){return{isCardList:!0,itemIndex:l,parentId:u,parentValue:s}},[l,u,s]),V=l>=0?l+1:((null===(r=b.values)||void 0===r||null===(r=r[u])||void 0===r?void 0:r.length)||0)+1,Q=s?"".concat(c," - ").concat(V):"Add ".concat(c);return{modalContentRef:O,cardSchema:R,handleSave:N,handleCancel:F,parentContext:q,displayIndex:V,modalTitle:Q,disabled:h,readOnly:y,questionRuleDetails:p,apiConfig:f}},_C=function(e){var t=e.onCancel,r=e.onSave,o=e.disabled,i=e.readOnly,a=o||i;return n().createElement("div",{className:"cardlist-modal-actions"},n().createElement("button",{type:"button",className:"btn btn-secondary",onClick:t,disabled:a,"aria-label":"Cancel"},"Cancel"),n().createElement("button",{type:"button",className:"btn btn-primary",onClick:r,disabled:a,"aria-label":"Save"},"Save"))};_C.propTypes={onCancel:o().func.isRequired,onSave:o().func.isRequired,disabled:o().bool,readOnly:o().bool};const OC=_C;var IC=function(e){var t=e.isOpen,r=e.onClose,o=e.onSave,i=e.cardItem,a=e.itemIndex,s=e.cardListId,l=e.cardListName,u=e.customQuestionValueList,c=e.questionRuleDetails,d=e.apiConfig,p=e.disabled,f=void 0!==p&&p,m=e.readOnly,h=SC({isOpen:t,onClose:r,onSave:o,cardItem:i,itemIndex:a,cardListId:s,cardListName:l,customQuestionValueList:u,questionRuleDetails:c,apiConfig:d,disabled:f,readOnly:void 0!==m&&m}),v=h.modalContentRef,y=h.cardSchema,g=h.handleSave,b=h.handleCancel,A=h.parentContext,w=h.modalTitle,k=h.disabled,E=h.readOnly,C=h.questionRuleDetails,x=h.apiConfig;return t?n().createElement(yC,{isOpen:t,onClose:b,title:w,size:"large",className:"cardlist-modal",closeOnOverlayClick:!1},n().createElement("div",{className:"cardlist-modal-wrapper"},n().createElement("div",{ref:v,className:"cardlist-modal-content"},n().createElement(BM,{questionGroups:y,disabled:k,readOnly:E,isNested:!0,questionRuleDetails:C,parentContext:A,apiConfig:x,skipFormProvider:!0})),n().createElement(OC,{onCancel:b,onSave:g,disabled:k,readOnly:E}))):null};IC.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,onSave:o().func.isRequired,cardItem:o().object,itemIndex:o().number.isRequired,cardListId:o().oneOfType([o().string,o().number]).isRequired,cardListName:o().string.isRequired,customQuestionValueList:o().object,questionRuleDetails:o().array,apiConfig:o().object,disabled:o().bool,readOnly:o().bool};const TC=IC;var PC=function(e){var t=e.isOpen,r=e.onClose,o=e.onConfirm;return n().createElement(yC,{isOpen:t,onClose:r,title:"Confirm Delete",size:"small",closeOnOverlayClick:!0,className:"cardlist-delete-confirm-modal"},n().createElement("div",{className:"cardlist-delete-confirm-content"},n().createElement("p",{className:"cardlist-delete-confirm-message"},"Are you sure you want to delete this entry? This action cannot be undone."),n().createElement("div",{className:"cardlist-delete-confirm-actions"},n().createElement("button",{type:"button",onClick:r,className:"cardlist-delete-confirm-btn cardlist-delete-confirm-btn-cancel","aria-label":"Cancel"},"Cancel"),n().createElement("button",{type:"button",onClick:o,className:"cardlist-delete-confirm-btn cardlist-delete-confirm-btn-delete","aria-label":"Delete"},"Delete"))))};PC.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,onConfirm:o().func.isRequired};const BC=PC;var DC=function(e){var t=e.items,r=e.questionId,o=e.name,i=e.onEdit,a=e.onDeleteClick,s=e.onAddMore,l=e.disabled,u=e.readOnly,c=e.maxItems,d=!l&&!u&&(!c||t.length<c),p=!l&&!u;return 0===t.length?n().createElement("div",{className:"cardlist-empty-state"},n().createElement("p",null,"No items added yet."),d&&n().createElement("button",{type:"button",className:"cardlist-add-button",onClick:s,disabled:l||u,"aria-label":"Add New"},"Add New")):n().createElement("div",{className:"cardlist-table-container"},n().createElement("table",{className:"cardlist-table"},n().createElement("thead",null,n().createElement("tr",null,n().createElement("th",null,"S.No."),n().createElement("th",null,"Details"),n().createElement("th",null,"Actions"))),n().createElement("tbody",null,t.map(function(e,t){return n().createElement("tr",{key:"".concat(r,"_").concat(t)},n().createElement("td",null,t+1),n().createElement("td",null,(null==e?void 0:e.name)||"".concat(o," - ").concat(t+1)),n().createElement("td",null,n().createElement("div",{className:"cardlist-table-actions"},p&&n().createElement(n().Fragment,null,n().createElement("button",{type:"button",className:"btn-edit",onClick:function(){return i(e,t)},disabled:l||u,"aria-label":"Edit",title:"Edit"},n().createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n().createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),n().createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))),n().createElement("button",{type:"button",className:"btn-delete",onClick:function(){return a(t)},disabled:l||u,"aria-label":"Delete",title:"Delete"},n().createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n().createElement("polyline",{points:"3 6 5 6 21 6"}),n().createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),n().createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),n().createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"})))))))}))),d&&n().createElement("button",{type:"button",className:"cardlist-add-button",onClick:s,disabled:l||u,"aria-label":"Add New"},"Add New"))};DC.propTypes={items:o().array.isRequired,questionId:o().oneOfType([o().string,o().number]).isRequired,name:o().string,onEdit:o().func.isRequired,onDeleteClick:o().func.isRequired,onAddMore:o().func.isRequired,disabled:o().bool,readOnly:o().bool,maxItems:o().number};const jC=DC;var RC=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/CardListModal.css"),MC={};function LC(e){return LC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LC(e)}function NC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NC(Object(n),!0).forEach(function(t){qC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qC(e,t,n){return(t=function(e){var t=function(e){if("object"!=LC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=LC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}MC.styleTagTransform=nl(),MC.setAttributes=Js(),MC.insert=Ks().bind(null,"head"),MC.domAPI=Gs(),MC.insertStyleElement=el(),Hs()(RC.A,MC),RC.A&&RC.A.locals&&RC.A.locals;var VC=function(t){var r=t.name,o=t.label,i=void 0===o?"":o,a=t.questionId,s=t.customQuestionValueList,l=void 0===s?null:s,u=t.validation,c=void 0===u?{}:u,d=t.max,p=void 0===d?null:d,f=t.min,m=void 0===f?0:f,h=t.className,v=void 0===h?"":h,y=t.disabled,g=void 0!==y&&y,b=t.readOnly,A=void 0!==b&&b,w=t.isCardlistModal,k=void 0!==w&&w,E=function(t){var r,o,i,a,s=t.name,l=t.label,u=void 0===l?"":l,c=t.questionId,d=t.customQuestionValueList,p=void 0===d?null:d,f=t.onChange,m=void 0===f?null:f,h=(t.validation,t.max),v=void 0===h?null:h,y=t.min,g=void 0===y?0:y,b=(t.className,t.disabled),A=void 0!==b&&b,w=t.readOnly,k=void 0!==w&&w,E=t.questionRuleDetails,C=void 0===E?[]:E,x=t.apiConfig,S=void 0===x?{}:x,_=t.customTheme,O=void 0===_?{}:_,I=t.visible,T=void 0===I||I,P=(t.isCardlistModal,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,iC)),B=cc(),D=B.state,j=B.updateCardList,R=xc(),M=dC((0,e.useState)([]),2),L=M[0],N=M[1],F=dC((0,e.useState)({}),2),q=F[0],V=F[1],Q=dC((0,e.useState)(!0),2),z=Q[0],U=Q[1],W=(0,e.useRef)(!1),H=(0,e.useRef)(!1),$=(0,e.useRef)(new Map),G=dC((0,e.useState)(!1),2),Y=G[0],K=G[1],X=dC((0,e.useState)(null),2),J=X[0],Z=X[1],te=dC((0,e.useState)(-1),2),ne=te[0],re=te[1],oe=dC((0,e.useState)(!1),2),ie=(oe[0],oe[1]),ae=dC((0,e.useState)(!1),2),se=ae[0],le=ae[1],ue=dC((0,e.useState)(-1),2),ce=ue[0],de=ue[1],pe=ZA(R.cardListField||{},O),fe=(null==D||null===(r=D.required)||void 0===r?void 0:r[c])||!1,me=(0,e.useCallback)(function(e){if(!Array.isArray(e))return!1;try{var t=e.filter(function(e){return!(null!=e&&e.__isPending__)}),n=eC(t);N(n),W.current=!0;var r=e.length>0,o=tC(e),i=e.length,a=function(e,t,n){var r=new Set(Object.keys(n||{}).filter(function(t){return String(t||"").startsWith("".concat(e,"_"))}));return Array.from({length:t},function(t,n){return"".concat(e,"_").concat(n)}).filter(function(e){return!r.has(e)})}(c,i,null==D?void 0:D.nestedStates);return r?(o||a.length>0)&&(H.current=!0,j(c,e,"init",null,-1,!0)):H.current=!0,!0}catch(e){return console.error("CardListField: failed to seed from context",e),!1}},[c,null==D?void 0:D.nestedStates,j]);(0,e.useEffect)(function(){var e;if(!W.current){var t=null==D||null===(e=D.values)||void 0===e?void 0:e[c];me(t)||function(e){if(void 0===e&&null!=p&&p.customQuestionValuesList){var t=nC(p),n=JSON.stringify(L);JSON.stringify(t)!==n&&(j(c,t,"init",null,-1,!0),N(t),W.current=!0)}}(t)}},[c,null==D||null===(o=D.values)||void 0===o?void 0:o[c],null==p?void 0:p.customQuestionValuesList]);var he=(0,e.useCallback)(function(e,t){var n=$.current.get(e);return $.current.set(e,t),{isHiddenToVisible:!1===n&&!0===t,isFirstMountVisible:void 0===n&&!0===t}},[]),ve=(0,e.useCallback)(function(e){var t,n=null==D||null===(t=D.values)||void 0===t?void 0:t[c],r=Array.isArray(n),o=r&&n.length>0,i=tC(n);if(r&&o)(i||o)&&(H.current=!0,j(c,n,"init",null,-1,!0));else{var a=[rC(s,p)];e&&(N(a),H.current=!0,j(c,a,"add","",0))}},[s,p,c,null==D?void 0:D.values,j]);(0,e.useEffect)(function(){var e,t=void 0===(null==D||null===(e=D.visibility)||void 0===e?void 0:e[c])?T:D.visibility[c],n=he(c,t),r=n.isHiddenToVisible,o=n.isFirstMountVisible;if(r||o)try{ve(r)}catch(e){console.error("CardListField: failed to reinitialize nested states",e)}},[null==D||null===(i=D.visibility)||void 0===i?void 0:i[c]]),(0,e.useEffect)(function(){if(H.current){var e,t=null==D||null===(e=D.values)||void 0===e?void 0:e[c];if(Array.isArray(t))try{var n=t.filter(function(e){return!(null!=e&&e.__isPending__)}),r=eC(n);N(function(e){return JSON.stringify(e)!==JSON.stringify(r)?r:e})}finally{H.current=!1}else H.current=!1}},[null==D||null===(a=D.values)||void 0===a?void 0:a[c]]);var ye=(0,e.useCallback)(function(e,t){V(function(n){var r=lC({},n);return t&&Object.keys(t).length>0?r[e]=t:delete r[e],r})},[]),ge=(0,e.useCallback)(function(){var e;if(!(v&&L.length>=v)){var t={name:"".concat(s," - ").concat(L.length+1),properties:(null==p||null===(e=p.editQuestions)||void 0===e?void 0:e.map(function(e){return{property:e.name,value:e.value||"",editQuestionId:e.questionId,renderMode:null}}))||[]},n=[].concat(aC(L),[t]);N(n),j(c,n,"add","",L.length)}},[v,L,null==p?void 0:p.editQuestions,c,s,j]),be=(0,e.useCallback)(function(e){var t=L.filter(function(t,n){return n!==e});V(function(t){var n=lC({},t);return delete n[e],n}),N(t),j(c,t,"remove","",e),null==m||m(null,!0)},[L,c,j,m]),Ae=(0,e.useCallback)(function(e){de(e),le(!0)},[]),we=(0,e.useCallback)(function(){ce>=0&&(be(ce),le(!1),de(-1))},[ce,be]),ke=(0,e.useCallback)(function(){le(!1),de(-1)},[]),Ee=(0,e.useCallback)(function(){var e;Z(null);var t=(null==D||null===(e=D.values)||void 0===e?void 0:e[c])||[],n=Array.isArray(t)?t.length:L.length;re(n),ie(!1),K(!0)},[L.length,null==D?void 0:D.values,c]),Ce=(0,e.useCallback)(function(e,t){Z(e),re(t),ie(!0),K(!0)},[]),xe=(0,e.useCallback)(function(e,t){var n,r=lC({},e);delete r.__isPending__;var o=(null==D||null===(n=D.values)||void 0===n?void 0:n[c])||[],i=(Array.isArray(o)?aC(o):[]).map(function(e){if(null!=e&&e.__isPending__){var t=lC({},e);return delete t.__isPending__,t}return e}),a=t>=i.length||-1===t;a?i.push(r):i[t]=r;var s=i.filter(function(e){return!(null!=e&&e.__isPending__)});N(s),j(c,i,a?"add":"update","",a?i.length-1:t),null==m||m(null,!0)},[c,j,m,null==D?void 0:D.values]),Se=(0,e.useCallback)(function(){K(!1),Z(null),re(-1),ie(!1)},[]),_e=(0,e.useCallback)(function(){U(function(e){return!e})},[]),Oe=(0,e.useCallback)(function(e,t){var n,r="".concat(e,"_").concat(t);return null==D||null===(n=D.nestedStates)||void 0===n||null===(n=n[r])||void 0===n||null===(n=n.visibility)||void 0===n?void 0:n[e]},[null==D?void 0:D.nestedStates]),Ie=(0,e.useCallback)(function(e,t){var n,r=e.questionId||e.name,o=Oe(r,t);return void 0!==o?o:void 0!==(null==D||null===(n=D.visibility)||void 0===n?void 0:n[r])?D.visibility[r]:e.visible},[Oe,null==D?void 0:D.visibility]),Te=(0,e.useCallback)(function(e,t,n){if(Ie(e,n)){var r=function(e,t){var n;return null===(n=e.properties)||void 0===n||null===(n=n.find(function(e){return e.property===t}))||void 0===n?void 0:n.value}(t,e.name),o=Fs(e,r);if(o)return{fieldName:e.name,message:o}}return null},[Ie]),Pe=(0,e.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.length-1;return null!=p&&p.editQuestions?p.editQuestions.reduce(function(n,r){var o=Te(r,e,t);return o&&(n[o.fieldName]=o.message),n},{}):{}},[null==p?void 0:p.editQuestions,L.length,Te]),Be=(0,e.useCallback)(function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=aC(L),i=null===(n=D.values)||void 0===n||null===(n=n[c])||void 0===n?void 0:n[e],a=function(e,t,n,r){if(e)return e;var o,i=null,a=cC(r||[]);try{var s=function(){var e,r=o.value,a=null===(e=n.properties)||void 0===e||null===(e=e.find(function(e){return e.editQuestionId===r.questionId}))||void 0===e?void 0:e.value,s="__id__".concat(r.questionId);if(void 0!==t[s]&&t[s]!==a)return i=r.questionId,1;null===i&&t[r.name]!==a&&(i=r.questionId)};for(a.s();!(o=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return i}(r,t,i,null==p?void 0:p.editQuestions),l=function(e,t,n){return(null==e?void 0:e.map(function(e){var r,o,i=null===(r=t.properties)||void 0===r?void 0:r.find(function(t){return ee(t.editQuestionId)===ee(e.questionId)}),a=n[e.name],s=void 0!==a&&""!==(null==i?void 0:i.value)?a:null==i?void 0:i.value;return{property:e.name,value:s,editQuestionId:e.questionId,renderMode:null!==(o=null==i?void 0:i.renderMode)&&void 0!==o?o:null}}))||[]}(null==p?void 0:p.editQuestions,i,t);o[e]=lC(lC({},i),{},{name:t.name||(null==i?void 0:i.name)||"".concat(s," - ").concat(e+1),properties:l});var u=Pe(o[e],e);ye(e,u),N(o),j(c,o,"update",a,e)},[L,D.values,c,s,null==p?void 0:p.editQuestions,Pe,ye,j]),De=(0,e.useCallback)(function(e){var t=rC(s,p);return lC(lC({},t),{},{name:"".concat(s," - ").concat(e+1),properties:t.properties.map(function(e){return lC(lC({},e),{},{value:""})})})},[s,p]),je=(0,e.useCallback)(function(e,t){return function(n){var r,o,i,a=null!==(r=null==n||null===(o=n.target)||void 0===o?void 0:o.value)&&void 0!==r?r:n,s=void 0===(null==n||null===(i=n.target)||void 0===i||null===(i=i.dataset)||void 0===i?void 0:i.itemIndex)?t:Number.parseInt(n.target.dataset.itemIndex,10),l=lC(lC({},function(e){var t,n={},r=cC(e.properties);try{for(r.s();!(t=r.n()).done;){var o=t.value;n[o.property]=o.value,o.editQuestionId&&(n["__id__".concat(o.editQuestionId)]=o.value)}}catch(e){r.e(e)}finally{r.f()}return n}(L[s]||De(s))),{},uC(uC({},e.name,a),"__id__".concat(e.questionId),a));Be(s,l,e.questionId)}},[L,De,Be]),Re=(0,e.useCallback)(function(e,t){var n,r,o,i=e.questionId||e.name,a=(n=L[t],r=e.questionId,null==n||null===(o=n.properties)||void 0===o||null===(o=o.find(function(e){return e.editQuestionId===r}))||void 0===o?void 0:o.value),s=Ie(e,t);return lC(lC({},e),{},{parentId:P.id,questionId:i,questionType:e.questionType||"text",validation:lC(lC({},e.validation),{},{required:e.required}),visible:s,value:a,onChange:je(e,t),inputProps:{"data-item-index":t,"data-parent-id":P.id}})},[L,Ie,je,P.id]),Me=(0,e.useCallback)(function(e){return null!=p&&p.editQuestions?[lC(lC({},P),{},{groupName:"",questions:p.editQuestions.map(function(t){return Re(t,e)})})]:[]},[null==p?void 0:p.editQuestions,Re,P]),Le=(0,e.useCallback)(function(){return L.map(function(e,t){var r,o=(null===(r=e.properties)||void 0===r?void 0:r.length)>0?"".concat(c,"_").concat(t,"_").concat(e.properties[0].editQuestionId):"".concat(c,"_").concat(t);return n().createElement("div",{key:o,style:pe.cardListItem},n().createElement("div",{style:pe.cardListItemHeader},n().createElement("h4",{style:pe.cardListItemTitle},"Card - ".concat(t+1)),!A&&!k&&L.length>g&&n().createElement("button",{type:"button",onClick:function(){return be(t)},style:pe.removeButton},"Remove")),n().createElement(BM,{questionGroups:Me(t),disabled:A,readOnly:k,isNested:!0,questionRuleDetails:C,parentContext:{isCardList:!0,itemIndex:t,parentId:c,parentValue:L[t]},apiConfig:S}))})},[L,c,pe,A,k,g,be,Me,C,S]),Ne=u?"".concat(z?"Collapse":"Expand"," ").concat(u):void 0;return{items:L,errors:q,isExpanded:z,showModal:Y,selectedCardItem:J,selectedItemIndex:ne,showDeleteConfirm:se,itemToDeleteIndex:ce,mergedTheme:pe,isRequired:fe,minItems:g,maxItems:v,handleAddItem:ge,handleRemoveItem:be,handleDeleteClick:Ae,handleConfirmDelete:we,handleCancelDelete:ke,handleAddMoreCardlist:Ee,handleEditCardList:Ce,handleSaveCardList:xe,handleModalClose:Se,handleToggleExpand:_e,generateCardSchemaForItem:Me,renderCardListItems:Le,toggleButtonAriaLabel:Ne}}(t),C=E.items,x=E.isExpanded,S=E.showModal,_=E.selectedCardItem,O=E.selectedItemIndex,I=E.showDeleteConfirm,T=E.mergedTheme,P=E.isRequired,B=E.maxItems,D=E.handleAddItem,j=E.handleDeleteClick,R=E.handleConfirmDelete,M=E.handleCancelDelete,L=E.handleAddMoreCardlist,N=E.handleEditCardList,F=E.handleSaveCardList,q=E.handleModalClose,V=E.handleToggleExpand,Q=E.renderCardListItems,z=E.toggleButtonAriaLabel,U=function(){return function(e,t){if(t)return null;var n=Array.isArray(e)?e:[];return m&&n.length<m?"Minimum ".concat(m," items required"):p&&n.length>p?"Maximum ".concat(p," items allowed"):null}};return k?n().createElement(n().Fragment,null,n().createElement(NE,{name:r,label:i,value:Array.isArray(C)?C:[],validation:FC(FC({},c),{},{custom:U()}),className:v,renderInput:function(){return n().createElement(jC,{items:C,questionId:a,name:r||i,onEdit:N,onDeleteClick:j,onAddMore:L,disabled:g,readOnly:A,maxItems:p})}}),n().createElement(TC,{isOpen:S,onClose:q,onSave:F,cardItem:_,itemIndex:O,cardListId:a,cardListName:r||i,customQuestionValueList:l,questionRuleDetails:t.questionRuleDetails,apiConfig:t.apiConfig,disabled:g,readOnly:A}),n().createElement(BC,{isOpen:I,onClose:M,onConfirm:R})):n().createElement(NE,{name:r,label:i,value:Array.isArray(C)?C:[],validation:FC(FC({},c),{},{custom:U()}),className:v,renderInput:function(){return n().createElement("div",{style:T.container},n().createElement("button",{type:"button",style:FC(FC({},T.header),{},{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",background:"transparent",border:"none"}),onClick:V,"aria-expanded":x,"aria-label":z},n().createElement("span",{style:T.title},i,P&&n().createElement("span",{className:"required-mark"},"*")),n().createElement("span",{style:FC(FC({},T.toggleButton),x&&T.toggleExpanded),"aria-hidden":"true"},"▼")),x&&n().createElement(n().Fragment,null,n().createElement("div",{style:T.itemsContainer},Q()),!g&&!A&&(!B||C.length<B)&&n().createElement("button",{type:"button",onClick:D,style:FC(FC(FC(FC({},T.actionButton),T.addButton),g&&T.disabled),B&&C.length>=B&&T.maxItemsReached),"aria-label":"Add New"},"Add New")))}})};VC.propTypes={id:o().oneOfType([o().string,o().number]),name:o().string.isRequired,label:o().string,questionId:o().oneOfType([o().string,o().number]),customQuestionValueList:o().oneOfType([o().array,o().object]),onChange:o().func,validation:o().object,max:o().number,min:o().number,className:o().string,disabled:o().bool,readOnly:o().bool,questionRuleDetails:o().array,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})}),customTheme:o().object,visible:o().bool,isCardlistModal:o().bool};const{entries:QC,setPrototypeOf:zC,isFrozen:UC,getPrototypeOf:WC,getOwnPropertyDescriptor:HC}=Object;let{freeze:$C,seal:GC,create:YC}=Object,{apply:KC,construct:XC}="undefined"!=typeof Reflect&&Reflect;$C||($C=function(e){return e}),GC||(GC=function(e){return e}),KC||(KC=function(e,t,n){return e.apply(t,n)}),XC||(XC=function(e,t){return new e(...t)});const JC=fx(Array.prototype.forEach),ZC=fx(Array.prototype.lastIndexOf),ex=fx(Array.prototype.pop),tx=fx(Array.prototype.push),nx=fx(Array.prototype.splice),rx=fx(String.prototype.toLowerCase),ox=fx(String.prototype.toString),ix=fx(String.prototype.match),ax=fx(String.prototype.replace),sx=fx(String.prototype.indexOf),lx=fx(String.prototype.trim),ux=fx(Object.prototype.hasOwnProperty),cx=fx(RegExp.prototype.test),dx=(px=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return XC(px,t)});var px;function fx(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return KC(e,t,r)}}function mx(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rx;zC&&zC(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(UC(t)||(t[r]=e),o=e)}e[o]=!0}return e}function hx(e){for(let t=0;t<e.length;t++)ux(e,t)||(e[t]=null);return e}function vx(e){const t=YC(null);for(const[n,r]of QC(e))ux(e,n)&&(Array.isArray(r)?t[n]=hx(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=vx(r):t[n]=r);return t}function yx(e,t){for(;null!==e;){const n=HC(e,t);if(n){if(n.get)return fx(n.get);if("function"==typeof n.value)return fx(n.value)}e=WC(e)}return function(){return null}}const gx=$C(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bx=$C(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ax=$C(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),wx=$C(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),kx=$C(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ex=$C(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cx=$C(["#text"]),xx=$C(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Sx=$C(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_x=$C(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ox=$C(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ix=GC(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Tx=GC(/<%[\w\W]*|[\w\W]*%>/gm),Px=GC(/\$\{[\w\W]*/gm),Bx=GC(/^data-[\-\w.\u00B7-\uFFFF]+$/),Dx=GC(/^aria-[\-\w]+$/),jx=GC(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Rx=GC(/^(?:\w+script|data):/i),Mx=GC(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lx=GC(/^html$/i),Nx=GC(/^[a-z][.\w]*(-[.\w]+)+$/i);var Fx=Object.freeze({__proto__:null,ARIA_ATTR:Dx,ATTR_WHITESPACE:Mx,CUSTOM_ELEMENT:Nx,DATA_ATTR:Bx,DOCTYPE_NAME:Lx,ERB_EXPR:Tx,IS_ALLOWED_URI:jx,IS_SCRIPT_OR_DATA:Rx,MUSTACHE_EXPR:Ix,TMPLIT_EXPR:Px});const qx=function(){return"undefined"==typeof window?null:window};var Vx,Qx=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qx();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,h=u.prototype,v=yx(h,"cloneNode"),y=yx(h,"remove"),g=yx(h,"nextSibling"),b=yx(h,"childNodes"),A=yx(h,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,k="";const{implementation:E,createNodeIterator:C,createDocumentFragment:x,getElementsByTagName:S}=r,{importNode:_}=o;let O={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof QC&&"function"==typeof A&&E&&void 0!==E.createHTMLDocument;const{MUSTACHE_EXPR:I,ERB_EXPR:T,TMPLIT_EXPR:P,DATA_ATTR:B,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:j,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:M}=Fx;let{IS_ALLOWED_URI:L}=Fx,N=null;const F=mx({},[...gx,...bx,...Ax,...kx,...Cx]);let q=null;const V=mx({},[...xx,...Sx,..._x,...Ox]);let Q=Object.seal(YC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,U=null,W=!0,H=!0,$=!1,G=!0,Y=!1,K=!0,X=!1,J=!1,Z=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie=!0,ae=!1,se={},le=null;const ue=mx({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const de=mx({},["audio","video","img","source","image","track"]);let pe=null;const fe=mx({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml";let ye=ve,ge=!1,be=null;const Ae=mx({},[me,he,ve],ox);let we=mx({},["mi","mo","mn","ms","mtext"]),ke=mx({},["annotation-xml"]);const Ee=mx({},["title","style","font","a","script"]);let Ce=null;const xe=["application/xhtml+xml","text/html"];let Se=null,_e=null;const Oe=r.createElement("form"),Ie=function(e){return e instanceof RegExp||e instanceof Function},Te=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!_e||_e!==e){if(e&&"object"==typeof e||(e={}),e=vx(e),Ce=-1===xe.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Se="application/xhtml+xml"===Ce?ox:rx,N=ux(e,"ALLOWED_TAGS")?mx({},e.ALLOWED_TAGS,Se):F,q=ux(e,"ALLOWED_ATTR")?mx({},e.ALLOWED_ATTR,Se):V,be=ux(e,"ALLOWED_NAMESPACES")?mx({},e.ALLOWED_NAMESPACES,ox):Ae,pe=ux(e,"ADD_URI_SAFE_ATTR")?mx(vx(fe),e.ADD_URI_SAFE_ATTR,Se):fe,ce=ux(e,"ADD_DATA_URI_TAGS")?mx(vx(de),e.ADD_DATA_URI_TAGS,Se):de,le=ux(e,"FORBID_CONTENTS")?mx({},e.FORBID_CONTENTS,Se):ue,z=ux(e,"FORBID_TAGS")?mx({},e.FORBID_TAGS,Se):vx({}),U=ux(e,"FORBID_ATTR")?mx({},e.FORBID_ATTR,Se):vx({}),se=!!ux(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,H=!1!==e.ALLOW_DATA_ATTR,$=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||jx,ye=e.NAMESPACE||ve,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,ke=e.HTML_INTEGRATION_POINTS||ke,Q=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Q.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(H=!1),te&&(ee=!0),se&&(N=mx({},Cx),q=[],!0===se.html&&(mx(N,gx),mx(q,xx)),!0===se.svg&&(mx(N,bx),mx(q,Sx),mx(q,Ox)),!0===se.svgFilters&&(mx(N,Ax),mx(q,Sx),mx(q,Ox)),!0===se.mathMl&&(mx(N,kx),mx(q,_x),mx(q,Ox))),e.ADD_TAGS&&(N===F&&(N=vx(N)),mx(N,e.ADD_TAGS,Se)),e.ADD_ATTR&&(q===V&&(q=vx(q)),mx(q,e.ADD_ATTR,Se)),e.ADD_URI_SAFE_ATTR&&mx(pe,e.ADD_URI_SAFE_ATTR,Se),e.FORBID_CONTENTS&&(le===ue&&(le=vx(le)),mx(le,e.FORBID_CONTENTS,Se)),ie&&(N["#text"]=!0),X&&mx(N,["html","head","body"]),N.table&&(mx(N,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw dx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw dx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));$C&&$C(e),_e=e}},Pe=mx({},[...bx,...Ax,...wx]),Be=mx({},[...kx,...Ex]),De=function(e){tx(n.removed,{element:e});try{A(e).removeChild(e)}catch(t){y(e)}},je=function(e,t){try{tx(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){tx(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{De(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Re=function(e){let t=null,n=null;if(Z)e="<remove></remove>"+e;else{const t=ix(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ce&&ye===ve&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=w?w.createHTML(e):e;if(ye===ve)try{t=(new f).parseFromString(o,Ce)}catch(e){}if(!t||!t.documentElement){t=E.createDocument(ye,"template",null);try{t.documentElement.innerHTML=ge?k:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ye===ve?S.call(t,X?"html":"body")[0]:X?t.documentElement:i},Me=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ne=function(e){return"function"==typeof l&&e instanceof l};function Fe(e,t,r){JC(e,e=>{e.call(n,t,r,_e)})}const qe=function(e){let t=null;if(Fe(O.beforeSanitizeElements,e,null),Le(e))return De(e),!0;const r=Se(e.nodeName);if(Fe(O.uponSanitizeElement,e,{tagName:r,allowedTags:N}),K&&e.hasChildNodes()&&!Ne(e.firstElementChild)&&cx(/<[/\w!]/g,e.innerHTML)&&cx(/<[/\w!]/g,e.textContent))return De(e),!0;if(7===e.nodeType)return De(e),!0;if(K&&8===e.nodeType&&cx(/<[/\w]/g,e.data))return De(e),!0;if(!N[r]||z[r]){if(!z[r]&&Qe(r)){if(Q.tagNameCheck instanceof RegExp&&cx(Q.tagNameCheck,r))return!1;if(Q.tagNameCheck instanceof Function&&Q.tagNameCheck(r))return!1}if(ie&&!le[r]){const t=A(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const o=v(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,g(e))}}return De(e),!0}return e instanceof u&&!function(e){let t=A(e);t&&t.tagName||(t={namespaceURI:ye,tagName:"template"});const n=rx(e.tagName),r=rx(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===he?t.namespaceURI===ve?"svg"===n:t.namespaceURI===me?"svg"===n&&("annotation-xml"===r||we[r]):Boolean(Pe[n]):e.namespaceURI===me?t.namespaceURI===ve?"math"===n:t.namespaceURI===he?"math"===n&&ke[r]:Boolean(Be[n]):e.namespaceURI===ve?!(t.namespaceURI===he&&!ke[r])&&!(t.namespaceURI===me&&!we[r])&&!Be[n]&&(Ee[n]||!Pe[n]):!("application/xhtml+xml"!==Ce||!be[e.namespaceURI]))}(e)?(De(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!cx(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,JC([I,T,P],e=>{t=ax(t,e," ")}),e.textContent!==t&&(tx(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe(O.afterSanitizeElements,e,null),!1):(De(e),!0)},Ve=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in r||n in Oe))return!1;if(H&&!U[t]&&cx(B,t));else if(W&&cx(D,t));else if(!q[t]||U[t]){if(!(Qe(e)&&(Q.tagNameCheck instanceof RegExp&&cx(Q.tagNameCheck,e)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(e))&&(Q.attributeNameCheck instanceof RegExp&&cx(Q.attributeNameCheck,t)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(t))||"is"===t&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&cx(Q.tagNameCheck,n)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(n))))return!1}else if(pe[t]);else if(cx(L,ax(n,R,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==sx(n,"data:")||!ce[e])if($&&!cx(j,ax(n,R,"")));else if(n)return!1;return!0},Qe=function(e){return"annotation-xml"!==e&&ix(e,M)},ze=function(e){Fe(O.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,u=Se(a),c=l;let d="value"===a?c:lx(c);if(r.attrName=u,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Fe(O.uponSanitizeAttribute,e,r),d=r.attrValue,!oe||"id"!==u&&"name"!==u||(je(a,e),d="user-content-"+d),K&&cx(/((--!?|])>)|<\/(style|title)/i,d)){je(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){je(a,e);continue}if(!G&&cx(/\/>/i,d)){je(a,e);continue}Y&&JC([I,T,P],e=>{d=ax(d,e," ")});const p=Se(e.nodeName);if(Ve(p,u,d)){if(w&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(p,u)){case"TrustedHTML":d=w.createHTML(d);break;case"TrustedScriptURL":d=w.createScriptURL(d)}if(d!==c)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),Le(e)?De(e):ex(n.removed)}catch(t){je(a,e)}}else je(a,e)}Fe(O.afterSanitizeAttributes,e,null)},Ue=function e(t){let n=null;const r=Me(t);for(Fe(O.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Fe(O.uponSanitizeShadowNode,n,null),qe(n),ze(n),n.content instanceof a&&e(n.content);Fe(O.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,u=null;if(ge=!e,ge&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw dx("toString is not a function");if("string"!=typeof(e=e.toString()))throw dx("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||Te(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Se(e.nodeName);if(!N[t]||z[t])throw dx("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Re("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!ee&&!Y&&!X&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(r=Re(e),!r)return ee?null:ne?k:""}r&&Z&&De(r.firstChild);const c=Me(ae?e:r);for(;s=c.nextNode();)qe(s),ze(s),s.content instanceof a&&Ue(s.content);if(ae)return e;if(ee){if(te)for(u=x.call(r.ownerDocument);r.firstChild;)u.appendChild(r.firstChild);else u=r;return(q.shadowroot||q.shadowrootmode)&&(u=_.call(o,u,!0)),u}let d=X?r.outerHTML:r.innerHTML;return X&&N["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&cx(Lx,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Y&&JC([I,T,P],e=>{d=ax(d,e," ")}),w&&ne?w.createHTML(d):d},n.setConfig=function(){Te(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){_e=null,J=!1},n.isValidAttribute=function(e,t,n){_e||Te({});const r=Se(e),o=Se(t);return Ve(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&tx(O[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=ZC(O[e],t);return-1===n?void 0:nx(O[e],n,1)[0]}return ex(O[e])},n.removeHooks=function(e){O[e]=[]},n.removeAllHooks=function(){O={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function zx(e){return zx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zx(e)}var Ux=["name","questionId","label","value","validation","disabled","required","className","options","header","styleName","customTheme","error","helperText","onChange","inputProps","tooltip","apiConfig"],Wx=["_editable","_error","_theme","_apiConfig"],Hx=["apiConfig","questionId","maskInput","maskingType","maskingLength","questionRuleDetails","visible","dependsOn","formData","customQuestionValueList","fileUploads","allowedFileType","fileSizeLimit","numberOfFiles","includeExtraDropDowns","additionalDropDowns","errorMessage","addressGroup","isopeninnewtab"];function $x(){return $x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$x.apply(null,arguments)}function Gx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yx(Object(n),!0).forEach(function(t){Xx(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xx(e,t,n){return(t=function(e){var t=function(e){if("object"!=zx(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zx(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jx(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Zx=function(t){var r,o,i,a=t.name,s=t.questionId,l=t.label,u=t.value,c=t.validation,d=t.disabled,p=t.required,f=void 0!==p&&p,m=t.className,h=t.options,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,A=t.error,w=t.helperText,k=t.onChange,E=t.inputProps,C=void 0===E?{}:E,x=t.tooltip,S=void 0===x?"":x,_=(t.apiConfig,Jx(t,Ux)),O=xc(),I=cc(),T=I.setValue,P=I.state,B=C["data-item-index"],D=C["data-parent-id"],j=(0,e.useMemo)(function(){var e,t;if(!h||!Array.isArray(h))return h;var n=null===(e=P.optionVisibility)||void 0===e?void 0:e[s];return null!=D&&void 0!==B&&null!==(t=P.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[D])&&void 0!==t&&null!==(t=t[Number(B)])&&void 0!==t&&t[s]&&(n=P.optionVisibilityByInstance[D][Number(B)][s]),n?h.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):h},[h,P.optionVisibility,P.optionVisibilityByInstance,s,D,B]),R=null!==(r=null==l?void 0:l.replaceAll(String.raw(Vx||(o=["\n"],i=["\\n"],i||(i=o.slice(0)),Vx=Object.freeze(Object.defineProperties(o,{raw:{value:Object.freeze(i)}}))))," ").trim())&&void 0!==r?r:"",M=R?Qx.sanitize(R,{ADD_ATTR:["target","rel"],ALLOWED_TAGS:["a","p","br","span","strong","em"],ALLOWED_ATTR:["href","target","rel"]}):"",L=void 0===B?String(a):"".concat(String(a),"-").concat(B),N=!0===u||"string"==typeof u&&"false"!==u.trim().toLowerCase()&&""!==u.trim(),F=(0,e.useMemo)(function(){return!(h&&Array.isArray(h)&&h.length>0)||j&&j.length>0},[h,j]),q=(0,e.useMemo)(function(){var e=O.checkboxField||{};return ZA(e,b)},[O,b]),V=(0,e.useMemo)(function(){var e=Kx(Kx({},q.container),{},{width:"100%"}),t=tw(q.checkbox,A&&q.error,d&&q.disabled,N&&q.checked);return{container:ew(e,q.responsive),checkbox:t,label:q.label}},[q,A,d,N]);return F?n().createElement("div",{className:"form-field ".concat(y||""),"data-theme":q.name,"data-field-type":"checkbox",style:V.container},v&&n().createElement("div",{className:"field-header",style:O.header},v),n().createElement(NE,{name:L,label:M,value:u,validation:c,className:"checkbox-field ".concat(m||""),customTheme:q,error:A,helperText:w,renderInput:function(e){e._editable,e._error,e._theme,e._apiConfig;var t=Jx(e,Wx),r=Object.entries(_).reduce(function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Gx(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gx(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=n[0],o=n[1];return"boolean"==typeof o?!0===o&&(e[r]="true"):null!=o&&(e[r]=o),e},{}),o=(r.apiConfig,r.questionId,r.maskInput,r.maskingType,r.maskingLength,r.questionRuleDetails,r.visible,r.dependsOn,r.formData,r.customQuestionValueList,r.fileUploads,r.allowedFileType,r.fileSizeLimit,r.numberOfFiles,r.includeExtraDropDowns,r.additionalDropDowns,r.errorMessage,r.addressGroup,r.isopeninnewtab,Jx(r,Hx));return n().createElement("div",{className:"checkbox-wrapper",style:V.container},n().createElement("input",$x({},t,{type:"checkbox",checked:N,disabled:d,className:"form-field__checkbox",onChange:function(e){var t,n=e.target.checked?(null==j||null===(t=j[0])||void 0===t?void 0:t.value)||"true":"";null==k||k(Kx(Kx({},e),{},{target:Kx(Kx({},e.target),{},{value:n})})),T(L,n)},style:V.checkbox},o,{"data-item-index":B,"data-parent-id":D})),M&&n().createElement("label",{htmlFor:L,style:V.label},n().createElement("span",{dangerouslySetInnerHTML:{__html:M}})," ",f&&n().createElement("span",{className:"required-mark",style:q.required},"*"),S&&n().createElement(gE,{tooltip:S})))}}),w&&n().createElement("div",{className:"helper-text",style:O.helperText},w)):null};function eS(e){return by("MuiFormGroup",e)}Zx.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,questionId:o().string,label:o().string,value:o().oneOfType([o().string,o().bool]),validation:o().object,disabled:o().bool,required:o().bool,className:o().string,options:o().arrayOf(o().shape({value:o().oneOfType([o().string,o().bool]).isRequired,label:o().string.isRequired})),header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,onChange:o().func,inputProps:o().object,tooltip:o().string,apiConfig:o().object},Ay("MuiFormGroup",["root","row","error"]);const tS=Bv("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),nS=e.forwardRef(function(e,t){const n=Mv({props:e,name:"MuiFormGroup"}),{className:r,row:o=!1,...i}=n,a=Yv({props:n,muiFormControl:Xv(),states:["error"]}),s={...n,row:o,error:a.error},l=(e=>{const{classes:t,row:n,error:r}=e;return Hd({root:["root",n&&"row",r&&"error"]},eS,t)})(s);return(0,jv.jsx)(tS,{className:Wd(l.root,r),ownerState:s,ref:t,...i})});function rS(e){return by("MuiTypography",e)}Ay("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const oS={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},iS=function(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=(e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Lm;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t})(n);let i;return i=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return jf(n)?{...r,...n}:r}:{...r,...t},{...o,sx:i}},aS=Bv("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${dy(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(cy(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([e,t])=>"inherit"!==e&&t&&"object"==typeof t).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>"string"==typeof e).map(([t])=>({props:{color:`text${dy(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>"inherit"!==e.align,style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:e})=>e.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}))),sS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},lS=e.forwardRef(function(e,t){const{color:n,...r}=Mv({props:e,name:"MuiTypography"}),o=iS({...r,...!oS[n]&&{color:n}}),{align:i="inherit",className:a,component:s,gutterBottom:l=!1,noWrap:u=!1,paragraph:c=!1,variant:d="body1",variantMapping:p=sS,...f}=o,m={...o,align:i,color:n,className:a,component:s,gutterBottom:l,noWrap:u,paragraph:c,variant:d,variantMapping:p},h=s||(c?"p":p[d]||sS[d])||"span",v=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:a}=e;return Hd({root:["root",i,"inherit"!==e.align&&`align${dy(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]},rS,a)})(m);return(0,jv.jsx)(aS,{as:h,ref:t,className:Wd(v.root,a),...f,ownerState:m,style:{..."inherit"!==i&&{"--Typography-textAlign":i},...f.style}})}),uS=lS;function cS(e){return by("MuiFormControlLabel",e)}const dS=Ay("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),pS=Bv("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${dS.label}`]:t.label},t.root,t[`labelPlacement${dy(n.labelPlacement)}`]]}})(cy(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${dS.disabled}`]:{cursor:"default"},[`& .${dS.label}`]:{[`&.${dS.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>"start"===e||"top"===e||"bottom"===e,style:{marginLeft:16}}]}))),fS=Bv("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(cy(({theme:e})=>({[`&.${dS.error}`]:{color:(e.vars||e).palette.error.main}}))),mS=e.forwardRef(function(t,n){const r=Mv({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:a={},control:s,disabled:l,disableTypography:u,inputRef:c,label:d,labelPlacement:p="end",name:f,onChange:m,required:h,slots:v={},slotProps:y={},value:g,...b}=r,A=Xv(),w=l??s.props.disabled??A?.disabled,k=h??s.props.required,E={disabled:w,required:k};["checked","name","onChange","value","inputRef"].forEach(e=>{void 0===s.props[e]&&void 0!==r[e]&&(E[e]=r[e])});const C=Yv({props:r,muiFormControl:A,states:["error"]}),x={...r,disabled:w,labelPlacement:p,required:k,error:C.error},S=(e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e;return Hd({root:["root",n&&"disabled",`labelPlacement${dy(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]},cS,t)})(x),_={slots:v,slotProps:{...a,...y}},[O,I]=tg("typography",{elementType:uS,externalForwardedProps:_,ownerState:x});let T=d;return null==T||T.type===uS||u||(T=(0,jv.jsx)(O,{component:"span",...I,className:Wd(S.label,I?.className),children:T})),(0,jv.jsxs)(pS,{className:Wd(S.root,i),ownerState:x,ref:n,...b,children:[e.cloneElement(s,E),k?(0,jv.jsxs)("div",{children:[T,(0,jv.jsxs)(fS,{ownerState:x,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):T]})});function hS(e){return by("PrivateSwitchBase",e)}Ay("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const vS=Bv(Jk)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),yS=Bv("input",{shouldForwardProp:Tv})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),gS=e.forwardRef(function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,defaultChecked:i,disabled:a,disableFocusRipple:s=!1,edge:l=!1,icon:u,id:c,inputProps:d,inputRef:p,name:f,onBlur:m,onChange:h,onFocus:v,readOnly:y,required:g=!1,tabIndex:b,type:A,value:w,slots:k={},slotProps:E={},...C}=e,[x,S]=hA({controlled:r,default:Boolean(i),name:"SwitchBase",state:"checked"}),_=Xv();let O=a;_&&void 0===O&&(O=_.disabled);const I="checkbox"===A||"radio"===A,T={...e,checked:x,disabled:O,disableFocusRipple:s,edge:l},P=(e=>{const{classes:t,checked:n,disabled:r,edge:o}=e;return Hd({root:["root",n&&"checked",r&&"disabled",o&&`edge${dy(o)}`],input:["input"]},hS,t)})(T),B={slots:k,slotProps:{input:d,...E}},[D,j]=tg("root",{ref:t,elementType:vS,className:P.root,shouldForwardComponentProp:!0,externalForwardedProps:{...B,component:"span",...C},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{v&&v(e),_&&_.onFocus&&_.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{m&&m(e),_&&_.onBlur&&_.onBlur(e)})(t)}}),ownerState:T,additionalProps:{centerRipple:!0,focusRipple:!s,disabled:O,role:void 0,tabIndex:null}}),[R,M]=tg("input",{ref:p,elementType:yS,className:P.input,externalForwardedProps:B,getSlotProps:e=>({onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;S(t),h&&h(e,t)})(t)}}),ownerState:T,additionalProps:{autoFocus:n,checked:r,defaultChecked:i,disabled:O,id:I?c:void 0,name:f,readOnly:y,required:g,tabIndex:b,type:A,..."checkbox"===A&&void 0===w?{}:{value:w}}});return(0,jv.jsxs)(D,{...j,children:[(0,jv.jsx)(R,{...M}),x?o:u]})}),bS=TA((0,jv.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),AS=TA((0,jv.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),wS=TA((0,jv.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function kS(e){return by("MuiCheckbox",e)}const ES=Ay("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),CS=Bv(gS,{shouldForwardProp:e=>Tv(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${dy(n.size)}`],"default"!==n.color&&t[`color${dy(n.color)}`]]}})(cy(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:th(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:th(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(By()).map(([t])=>({props:{color:t},style:{[`&.${ES.checked}, &.${ES.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${ES.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),xS=(0,jv.jsx)(AS,{}),SS=(0,jv.jsx)(bS,{}),_S=(0,jv.jsx)(wS,{}),OS=e.forwardRef(function(t,n){const r=Mv({props:t,name:"MuiCheckbox"}),{checkedIcon:o=xS,color:i="primary",icon:a=SS,indeterminate:s=!1,indeterminateIcon:l=_S,inputProps:u,size:c="medium",disableRipple:d=!1,className:p,slots:f={},slotProps:m={},...h}=r,v=s?l:a,y=s?l:o,g={...r,disableRipple:d,color:i,indeterminate:s,size:c},b=(e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i=Hd({root:["root",n&&"indeterminate",`color${dy(r)}`,`size${dy(o)}`]},kS,t);return{...t,...i}})(g),A=m.input??u,[w,k]=tg("root",{ref:n,elementType:CS,className:Wd(b.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:f,slotProps:m,...h},ownerState:g,additionalProps:{type:"checkbox",icon:e.cloneElement(v,{fontSize:v.props.fontSize??c}),checkedIcon:e.cloneElement(y,{fontSize:y.props.fontSize??c}),disableRipple:d,slots:f,slotProps:{input:Wb("function"==typeof A?A(g):A,{"data-indeterminate":s})}}});return(0,jv.jsx)(w,{...k,classes:b})});function IS(e){return IS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},IS(e)}var TS=["questionId","label","options","defaultValue","helperText","required","onChange","_showcheckbox","_isesigndoc","_isopeninnewtab","_addadditional","_addmedication","questionRuleDetails","formData","apiBaseUrl","dependsOn","error","customTheme","inputProps","styleName","tooltip","showQuestionLabels"],PS=["apiConfig","maskInput","maskingType","maskingLength","customQuestionValueList","fileUploads","allowedFileType","fileSizeLimit","numberOfFiles","includeExtraDropDowns","additionalDropDowns","errorMessage","addressGroup"];function BS(){return BS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BS.apply(null,arguments)}function DS(e,t){if(e){if("string"==typeof e)return jS(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jS(e,t):void 0}}function jS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RS(Object(n),!0).forEach(function(t){LS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LS(e,t,n){return(t=function(e){var t=function(e){if("object"!=IS(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=IS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==IS(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NS(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var FS=function(t){var r=t.questionId,o=t.label,i=t.options,a=void 0===i?[]:i,s=t.defaultValue,l=void 0===s?[]:s,u=t.helperText,c=t.required,d=void 0!==c&&c,p=t.onChange,f=(t._showcheckbox,t._isesigndoc,t._isopeninnewtab,t._addadditional,t._addmedication,t.questionRuleDetails,t.formData,t.apiBaseUrl,t.dependsOn,t.error),m=t.customTheme,h=void 0===m?{}:m,v=t.inputProps,y=void 0===v?{}:v,g=t.styleName,b=t.tooltip,A=void 0===b?"":b,w=t.showQuestionLabels,k=void 0===w||w,E=NS(t,TS),C=y["data-item-index"],x=y["data-parent-id"],S=xc(),_=cc(),O=_.setValue,I=_.state,T=GA({questionId:r,itemIndex:C,defaultValue:l,defaultVisible:!0,defaultDisabled:!1}),P=T.value,B=T.visible,D=T.disabled,j=T.handleChange,R=(0,e.useMemo)(function(){var e,t,n=null===(e=I.optionVisibility)||void 0===e?void 0:e[r];return null!=x&&void 0!==C&&null!==(t=I.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[x])&&void 0!==t&&null!==(t=t[Number(C)])&&void 0!==t&&t[r]&&(n=I.optionVisibilityByInstance[x][Number(C)][r]),n?a.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):a},[a,I.optionVisibility,I.optionVisibilityByInstance,r,x,C]),M=void 0===C?String(r):"".concat(String(r),"-").concat(C),L=(0,e.useMemo)(function(){var e=S.checkboxGroupField||S.checkboxField||{};return ZA(e,h)},[S,h]),N=(0,e.useMemo)(function(){var e=MS(MS({},L.container),{},{width:"100%"}),t=tw(L.label,d&&L.required,D&&L.disabled),n=tw(L.checkbox,f&&L.error,D&&L.disabled);return{container:ew(e,L.responsive),label:t,checkbox:n,group:L.group||{},helperText:tw(L.helperText,f&&L.error)}},[L,d,D,f]),F=Array.isArray(P)?P:Array.isArray(l)?l:[],q=function(e,t){var n=e.target.checked?[].concat(function(e){return function(e){if(Array.isArray(e))return jS(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||DS(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(F||[]),[t]):(F||[]).filter(function(e){return e!==t});O(r,n),j(n),p&&p(MS(MS({},e),{},{target:MS(MS({},e.target),{},{name:M,value:n})}))};if(!B)return null;var V=Object.entries(E).reduce(function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||DS(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=n[0],o=n[1];return e[r]="boolean"==typeof o?o?o.toString():void 0:o,e},{}),Q=(V.apiConfig,V.maskInput,V.maskingType,V.maskingLength,V.customQuestionValueList,V.fileUploads,V.allowedFileType,V.fileSizeLimit,V.numberOfFiles,V.includeExtraDropDowns,V.additionalDropDowns,V.errorMessage,V.addressGroup,NS(V,PS));return n().createElement("div",{className:"checkbox-group-field ".concat(g||""),"data-theme":L.name,"data-field-type":"checkbox-group",style:N.container},n().createElement(nS,{style:N.group},k&&o&&n().createElement("div",{className:"question_label",style:N.label},o,d&&n().createElement("span",{style:L.required},"*"),A&&n().createElement(gE,{tooltip:A})),n().createElement("div",{className:"checkbox-group-wrapper",style:N.group},R.map(function(e){var t=Array.isArray(F)?F.includes(e.value):!0===e.selected;return n().createElement(mS,{key:e.value,name:M,"data-item-index":C,"data-parent-id":x,control:n().createElement(OS,BS({checked:t,onChange:function(t){return q(t,e.value)},disabled:D,required:d,style:N.checkbox},Q)),label:e.label,style:N.label})}),u&&n().createElement("div",{style:N.helperText},u))))};FS.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().oneOfType([o().string,o().number]).isRequired})),defaultValue:o().array,helperText:o().string,required:o().bool,onChange:o().func,_showcheckbox:o().bool,_isesigndoc:o().bool,_isopeninnewtab:o().bool,_addadditional:o().bool,_addmedication:o().bool,_questionRuleDetails:o().array,questionRuleDetails:o().array,formData:o().object,apiBaseUrl:o().string,dependsOn:o().oneOfType([o().string,o().array]),error:o().string,customTheme:o().object,tooltip:o().string,styleName:o().string,inputProps:o().object,showQuestionLabels:o().bool};var qS=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/CurrencyField.css"),VS={};function QS(e){return QS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QS(e)}function zS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function US(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zS(Object(n),!0).forEach(function(t){WS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WS(e,t,n){return(t=function(e){var t=function(e){if("object"!=QS(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=QS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==QS(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}VS.styleTagTransform=nl(),VS.setAttributes=Js(),VS.insert=Ks().bind(null,"head"),VS.domAPI=Gs(),VS.insertStyleElement=el(),Hs()(qS.A,VS),qS.A&&qS.A.locals&&qS.A.locals;var $S=function(e){if(e){var t=e.replace(re,""),n=Number.parseFloat(t);return Number.isNaN(n)?"":new Intl.NumberFormat("en-US",{style:"decimal"}).format(n)}return""},GS=n().memo(function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.currency,c=void 0===u?"$":u,d=t.onChange,p=t.formState,f=t.error,m=t.customTheme,h=void 0===m?{}:m,v=t.styleName,y=t.maxLength,g=t.placeholder,b=t.onBlur,A=t.tooltip,w=void 0===A?"":A,k=t.showQuestionLabels,E=void 0===k||k,C=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return HS(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HS(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(i?$S(i):""),2),x=C[0],S=C[1],_=xc(),O=(0,e.useMemo)(function(){var e=_.currencyField||_.textField||{};return ZA(e,h)},[_,h]),I=(0,e.useMemo)(function(){var e=US(US({},O.container),{},{width:"100%"}),t=tw(O.input,f&&O.error,s&&O.disabled,{borderTopLeftRadius:"0",borderBottomLeftRadius:"0",borderWidth:"1px",borderStyle:"solid",borderColor:"#e2e8f0",borderLeftWidth:"0"});return{container:ew(e,O.responsive),input:t,currencySymbol:US(US({},O.currencySymbol),{},{padding:"0.5rem 1rem",backgroundColor:"#fff",borderWidth:"1px",borderStyle:"solid",borderColor:"#e2e8f0",borderRightWidth:"0",borderTopLeftRadius:"0.375rem",borderBottomLeftRadius:"0.375rem",color:"#64748b",display:"flex",alignItems:"center",justifyContent:"center"}),wrapper:US(US({},O.wrapper),{},{position:"relative",display:"flex",alignItems:"stretch",width:"100%"})}},[O,f,s]),T=function(e){var t=e.target.value.replace(/[^0-9.]/g,"");y&&t.length>y&&(t=t.slice(0,y));var n=t?$S(t):"";S(n),d&&d({target:{name:r,value:t}})};(0,e.useEffect)(function(){void 0!==i&&S(i?$S(i):"")},[i]);var P=String(r);return n().createElement(NE,{name:P,label:E?o:"",value:$S(i),validation:a,className:"currency-field ".concat(l||""," ").concat(v||""),customTheme:O,error:f,formState:p,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:O.label||{}},t,r&&n().createElement("span",{style:O.required||{}},"*"),w&&n().createElement(gE,{tooltip:w})):null},renderInput:function(){return n().createElement("div",{style:I.wrapper},n().createElement("span",{className:"currency-symbol",style:I.currencySymbol},c),n().createElement("input",{type:"text",name:P,value:x,onChange:T,disabled:s,className:"currency-input",style:I.input,placeholder:g||"Enter amount","aria-label":"Currency input in ".concat(c),onBlur:b}))}})});GS.displayName="CurrencyField",GS.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),validation:o().object,disabled:o().bool,className:o().string,currency:o().string,onChange:o().func,formState:o().object,error:o().string,customTheme:o().object,styleName:o().string,placeholder:o().string,maxLength:o().number,onBlur:o().func,tooltip:o().string,showQuestionLabels:o().bool};const YS={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},KS=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,XS=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,JS=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ZS(e){return e?parseInt(e):1}function e_(e){return e&&parseFloat(e.replace(",","."))||0}const t_=[31,null,31,30,31,30,31,31,30,31,30,31];function n_(e){return e%400==0||e%4==0&&e%100!=0}function r_(e,t){return+Bo(e)<+Bo(t)}function o_(e,t,n){const r=Bo(e,n?.in);return r.setHours(t),r}function i_(e,t,n){const r=Bo(e,n?.in);return r.setMinutes(t),r}function a_(e,t,n){const r=Bo(e,n?.in);return r.setSeconds(t),r}function s_(e,t){const n=Bo(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function l_(e,t){const n=Bo(e,t?.in),r=n.getMonth(),o=r-r%3;return n.setMonth(o,1),n.setHours(0,0,0,0),n}function u_(e,t){const n=Bo(e,t?.in);return n.setHours(23,59,59,999),n}function c_(e,t){const n=Bo(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function d_(e,t,n){const r=+Bo(e,n?.in),[o,i]=[+Bo(t.start,n?.in),+Bo(t.end,n?.in)].sort((e,t)=>e-t);return r>=o&&r<=i}function p_(e,t,n){const r=Bo(e,n?.in),o=r.getFullYear(),i=r.getDate(),a=Po(n?.in||e,0);a.setFullYear(o,t,15),a.setHours(0,0,0,0);const s=function(e,t){const n=Bo(e,t?.in),r=n.getFullYear(),o=n.getMonth(),i=Po(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}(a);return r.setMonth(t,Math.min(i,s)),r}function f_(e,t,n){const r=Bo(e,n?.in),o=t-(Math.trunc(r.getMonth()/3)+1);return p_(r,r.getMonth()+3*o)}function m_(e,t){return Bo(e,t?.in).getFullYear()}function h_(e,t){return Bo(e,t?.in).getMonth()}function v_(e,t){const n=Bo(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function y_(e,t){const n=Bo(e,t?.in);return Math.trunc(n.getMonth()/3)+1}function g_(e,t){return Bo(e,t?.in).getHours()}function b_(e,t){return Bo(e,t?.in).getMinutes()}function A_(e){return Bo(e).getSeconds()}function w_(e,t,n){const r=Bo(e,n?.in);if(isNaN(t))return Po(n?.in||e,NaN);if(!t)return r;const o=r.getDate(),i=Po(n?.in||e,r.getTime());return i.setMonth(r.getMonth()+t+1,0),o>=i.getDate()?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}function k_(e,t,n){return w_(e,-t,n)}function E_(e,t,n){const[r,o]=ia(n?.in,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}function C_(e,t,n){return w_(e,3*t,n)}function x_(e,t,n){return C_(e,-t,n)}function S_(e,t,n){const[r,o]=ia(n?.in,e,t);return 4*(r.getFullYear()-o.getFullYear())+(y_(r)-y_(o))}function __(e,t,n){return w_(e,12*t,n)}function O_(e,t,n){return __(e,-t,n)}function I_(e,t,n){const[r,o]=ia(n?.in,e,t);return r.getFullYear()-o.getFullYear()}function T_(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Po.bind(null,e));const t=Bo(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),Po(r,n||NaN)}function P_(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Po.bind(null,e));const t=Bo(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),Po(r,n||NaN)}function B_(e,t,n){return Po(n?.in||e,+Bo(e)+t)}function D_(e,t,n){return B_(e,t*Io,n)}function j_(e,t,n){const r=Bo(e,n?.in);return r.setTime(r.getTime()+t*Oo),r}function R_(e,t,n){return B_(e,1e3*t,n)}function M_(e,t){return+Bo(e)>+Bo(t)}function L_(e,t){return Bo(e,t?.in).getDate()}function N_(e,t,n){return Hi(e,7*t,n)}function F_(e){return+Bo(e)}function q_(e,t,n){const r=Bo(e,n?.in);return isNaN(+r)?Po(n?.in||e,NaN):(r.setFullYear(t),r)}function V_(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Q_(e,t,n){return N_(e,-t,n)}var z_="undefined"!=typeof document?e.useLayoutEffect:function(){};const U_={...t}.useInsertionEffect||(e=>e());function W_(){return"undefined"!=typeof window}function H_(e){return Y_(e)?(e.nodeName||"").toLowerCase():"#document"}function $_(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function G_(e){var t;return null==(t=(Y_(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Y_(e){return!!W_()&&(e instanceof Node||e instanceof $_(e).Node)}function K_(e){return!!W_()&&(e instanceof Element||e instanceof $_(e).Element)}function X_(e){return!!W_()&&(e instanceof HTMLElement||e instanceof $_(e).HTMLElement)}function J_(e){return!(!W_()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof $_(e).ShadowRoot)}const Z_=new Set(["inline","contents"]);function eO(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=pO(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Z_.has(o)}const tO=new Set(["table","td","th"]);function nO(e){return tO.has(H_(e))}const rO=[":popover-open",":modal"];function oO(e){return rO.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const iO=["transform","translate","scale","rotate","perspective"],aO=["transform","translate","scale","rotate","perspective","filter"],sO=["paint","layout","strict","content"];function lO(e){const t=uO(),n=K_(e)?pO(e):e;return iO.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||aO.some(e=>(n.willChange||"").includes(e))||sO.some(e=>(n.contain||"").includes(e))}function uO(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const cO=new Set(["html","body","#document"]);function dO(e){return cO.has(H_(e))}function pO(e){return $_(e).getComputedStyle(e)}function fO(e){return K_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mO(e){if("html"===H_(e))return e;const t=e.assignedSlot||e.parentNode||J_(e)&&e.host||G_(e);return J_(t)?t.host:t}function hO(e){const t=mO(e);return dO(t)?e.ownerDocument?e.ownerDocument.body:e.body:X_(t)&&eO(t)?t:hO(t)}function vO(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=hO(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=$_(o);if(i){const e=yO(a);return t.concat(a,a.visualViewport||[],eO(o)?o:[],e&&n?vO(e):[])}return t.concat(o,vO(o,[],n))}function yO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const gO=Math.min,bO=Math.max,AO=Math.round,wO=Math.floor,kO=e=>({x:e,y:e}),EO={left:"right",right:"left",bottom:"top",top:"bottom"},CO={start:"end",end:"start"};function xO(e,t){return"function"==typeof e?e(t):e}function SO(e){return e.split("-")[0]}function _O(e){return e.split("-")[1]}function OO(e){return"y"===e?"height":"width"}const IO=new Set(["top","bottom"]);function TO(e){return IO.has(SO(e))?"y":"x"}function PO(e){return"x"===TO(e)?"y":"x"}function BO(e){return e.replace(/start|end/g,e=>CO[e])}const DO=["left","right"],jO=["right","left"],RO=["top","bottom"],MO=["bottom","top"];function LO(e){return e.replace(/left|right|bottom|top/g,e=>EO[e])}function NO(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function FO(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function qO(e,t,n){let{reference:r,floating:o}=e;const i=TO(t),a=PO(t),s=OO(a),l=SO(t),u="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(_O(t)){case"start":f[a]-=p*(n&&u?-1:1);break;case"end":f[a]+=p*(n&&u?-1:1)}return f}const VO=new Set(["left","top"]);function QO(e){const t=pO(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=X_(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=AO(n)!==i||AO(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function zO(e){return K_(e)?e:e.contextElement}function UO(e){const t=zO(e);if(!X_(t))return kO(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=QO(t);let a=(i?AO(n.width):n.width)/r,s=(i?AO(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const WO=kO(0);function HO(e){const t=$_(e);return uO()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:WO}function $O(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=zO(e);let a=kO(1);t&&(r?K_(r)&&(a=UO(r)):a=UO(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==$_(e))&&t}(i,n,r)?HO(i):kO(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=$_(i),t=r&&K_(r)?$_(r):r;let n=e,o=yO(n);for(;o&&r&&t!==n;){const e=UO(o),t=o.getBoundingClientRect(),r=pO(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=$_(o),o=yO(n)}}return FO({width:c,height:d,x:l,y:u})}function GO(e,t){const n=fO(e).scrollLeft;return t?t.left+n:$O(G_(e)).left+n}function YO(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:GO(e,r)),y:r.top+t.scrollTop}}const KO=new Set(["absolute","fixed"]);function XO(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=$_(e),r=G_(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=uO();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=G_(e),n=fO(e),r=e.ownerDocument.body,o=bO(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=bO(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+GO(e);const s=-n.scrollTop;return"rtl"===pO(r).direction&&(a+=bO(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(G_(e));else if(K_(t))r=function(e,t){const n=$O(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=X_(e)?UO(e):kO(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=HO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return FO(r)}function JO(e,t){const n=mO(e);return!(n===t||!K_(n)||dO(n))&&("fixed"===pO(n).position||JO(n,t))}function ZO(e,t,n){const r=X_(t),o=G_(t),i="fixed"===n,a=$O(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=kO(0);function u(){l.x=GO(o)}if(r||!r&&!i)if(("body"!==H_(t)||eO(o))&&(s=fO(t)),r){const e=$O(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=!o||r||i?kO(0):YO(o,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function eI(e){return"static"===pO(e).position}function tI(e,t){if(!X_(e)||"fixed"===pO(e).position)return null;if(t)return t(e);let n=e.offsetParent;return G_(e)===n&&(n=n.ownerDocument.body),n}function nI(e,t){const n=$_(e);if(oO(e))return n;if(!X_(e)){let t=mO(e);for(;t&&!dO(t);){if(K_(t)&&!eI(t))return t;t=mO(t)}return n}let r=tI(e,t);for(;r&&nO(r)&&eI(r);)r=tI(r,t);return r&&dO(r)&&eI(r)&&!lO(r)?n:r||function(e){let t=mO(e);for(;X_(t)&&!dO(t);){if(lO(t))return t;if(oO(t))return null;t=mO(t)}return null}(e)||n}const rI={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=G_(r),s=!!t&&oO(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=kO(1);const c=kO(0),d=X_(r);if((d||!d&&!i)&&(("body"!==H_(r)||eO(a))&&(l=fO(r)),X_(r))){const e=$O(r);u=UO(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const p=!a||d||i?kO(0):YO(a,l,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}},getDocumentElement:G_,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?oO(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=vO(e,[],!1).filter(e=>K_(e)&&"body"!==H_(e)),o=null;const i="fixed"===pO(e).position;let a=i?mO(e):e;for(;K_(a)&&!dO(a);){const t=pO(a),n=lO(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&KO.has(o.position)||eO(a)&&!n&&JO(e,a))?r=r.filter(e=>e!==a):o=t,a=mO(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=XO(t,n,o);return e.top=bO(r.top,e.top),e.right=gO(r.right,e.right),e.bottom=gO(r.bottom,e.bottom),e.left=bO(r.left,e.left),e},XO(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:nI,getElementRects:async function(e){const t=this.getOffsetParent||nI,n=this.getDimensions,r=await n(e.floating);return{reference:ZO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=QO(e);return{width:t,height:n}},getScale:UO,isElement:K_,isRTL:function(e){return"rtl"===pO(e).direction}};function oI(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iI(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=zO(e),c=o||i?[...u?vO(u):[],...vO(t)]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=G_(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=u;if(s||t(),!p||!f)return;const m={rootMargin:-wO(d)+"px "+-wO(o.clientWidth-(c+p))+"px "+-wO(o.clientHeight-(d+f))+"px "+-wO(c)+"px",threshold:bO(0,gO(1,l))||1};let h=!0;function v(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||oI(u,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(v,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,m)}r.observe(e)}(!0),i}(u,n):null;let p,f=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let h=l?$O(e):null;return l&&function t(){const r=$O(e);h&&!oI(h,r)&&n(),h=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const aI=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=SO(n),s=_O(n),l="y"===TO(n),u=VO.has(a)?-1:1,c=i&&l?-1:1,d=xO(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(f="end"===s?-1*m:m),l?{x:f*c,y:p*u}:{x:p*u,y:f*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},sI=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=xO(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=SO(o),g=TO(s),b=SO(s)===s,A=await(null==l.isRTL?void 0:l.isRTL(u.floating)),w=p||(b||!h?[LO(s)]:function(e){const t=LO(e);return[BO(e),t,BO(t)]}(s)),k="none"!==m;!p&&k&&w.push(...function(e,t,n,r){const o=_O(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?jO:DO:t?DO:jO;case"left":case"right":return t?RO:MO;default:return[]}}(SO(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(BO)))),i}(s,h,m,A));const E=[s,...w],C=await async function(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=xO(t,e),m=NO(f),h=s[p?"floating"===d?"reference":"floating":d],v=FO(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},A=FO(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-A.top+m.top)/b.y,bottom:(A.bottom-v.bottom+m.bottom)/b.y,left:(v.left-A.left+m.left)/b.x,right:(A.right-v.right+m.right)/b.x}}(t,v),x=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&x.push(C[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=_O(e),o=PO(e),i=OO(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=LO(a)),[a,LO(a)]}(o,a,A);x.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:x}],!x.every(e=>e<=0)){var _,O;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=E[e];if(t&&("alignment"!==d||g===TO(t)||S.every(e=>e.overflows[0]>0&&TO(e.placement)===g)))return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(O=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!n)switch(f){case"bestFit":{var I;const e=null==(I=S.filter(e=>{if(k){const t=TO(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},lI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=xO(e,t)||{};if(null==u)return{};const d=NO(c),p={x:n,y:r},f=PO(o),m=OO(f),h=await a.getDimensions(u),v="y"===f,y=v?"top":"left",g=v?"bottom":"right",b=v?"clientHeight":"clientWidth",A=i.reference[m]+i.reference[f]-p[f]-i.floating[m],w=p[f]-i.reference[f],k=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let E=k?k[b]:0;E&&await(null==a.isElement?void 0:a.isElement(k))||(E=s.floating[b]||i.floating[m]);const C=A/2-w/2,x=E/2-h[m]/2-1,S=gO(d[y],x),_=gO(d[g],x),O=S,I=E-h[m]-_,T=E/2-h[m]/2+C,P=function(e,t,n){return bO(e,gO(t,n))}(O,T,I),B=!l.arrow&&null!=_O(o)&&T!==P&&i.reference[m]/2-(T<O?S:_)-h[m]/2<0,D=B?T<O?T-O:T-I:0;return{[f]:p[f]+D,data:{[f]:P,centerOffset:T-P-D,...B&&{alignmentOffset:D}},reset:B}}}),uI=(e,t,n)=>{const r=new Map,o={platform:rI,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=qO(u,r,l),p=r,f={},m=0;for(let n=0;n<s.length;n++){const{name:i,fn:h}=s[n],{x:v,y,data:g,reset:b}=await h({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:a,elements:{reference:e,floating:t}});c=null!=v?v:c,d=null!=y?y:d,f={...f,[i]:{...f[i],...g}},b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:d}=qO(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};var cI="undefined"!=typeof document?e.useLayoutEffect:function(){};function dI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!dI(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||dI(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function pI(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fI(e,t){const n=pI(e);return Math.round(t*n)/n}function mI(t){const n=e.useRef(t);return cI(()=>{n.current=t}),n}const hI=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?lI({element:n.current,padding:r}).fn(t):{}:n?lI({element:n,padding:r}).fn(t):{};var o}}),vI=(e,t)=>({...aI(e),options:[e,t]}),yI=(e,t)=>({...hI(e),options:[e,t]}),gI={...t};let bI=!1,AI=0;const wI=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+AI++,kI=gI.useId||function(){const[t,n]=e.useState(()=>bI?wI():void 0);return z_(()=>{null==t&&n(wI())},[]),e.useEffect(()=>{bI=!0},[]),t},EI=e.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:a}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:d,stroke:p,d:f,style:{transform:m,...h}={},...v}=t,y=kI(),[g,b]=e.useState(!1);if(z_(()=>{o&&"rtl"===pO(o).direction&&b(!0)},[o]),!o)return null;const[A,w]=r.split("-"),k="top"===A||"bottom"===A;let E=d;(k&&null!=a&&a.x||!k&&null!=a&&a.y)&&(E=null);const C=2*c,x=C/2,S=s/2*(u/-8+1),_=l/2*u/4,O=!!f,I=E&&"end"===w?"bottom":"top";let T=E&&"end"===w?"right":"left";E&&g&&(T="end"===w?"left":"right");const P=null!=(null==i?void 0:i.x)?E||i.x:"",B=null!=(null==i?void 0:i.y)?E||i.y:"",D=f||"M0,0 H"+s+" L"+(s-S)+","+(l-_)+" Q"+s/2+","+l+" "+S+","+(l-_)+" Z",j={top:O?"rotate(180deg)":"",left:O?"rotate(90deg)":"rotate(-90deg)",bottom:O?"":"rotate(180deg)",right:O?"rotate(-90deg)":"rotate(90deg)"}[A];return(0,jv.jsxs)("svg",{...v,"aria-hidden":!0,ref:n,width:O?s:s+C,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[T]:P,[I]:B,[A]:k||O?"100%":"calc(100% - "+C/2+"px)",transform:[j,m].filter(e=>!!e).join(" "),...h},children:[C>0&&(0,jv.jsx)("path",{clipPath:"url(#"+y+")",fill:"none",stroke:p,strokeWidth:C+(f?0:1),d:D}),(0,jv.jsx)("path",{stroke:C&&!f?v.fill:"none",d:D}),(0,jv.jsx)("clipPath",{id:y,children:(0,jv.jsx)("rect",{x:-x,y:x*(O?-1:1),width:s+C,height:s})})]})});const CI=e.createContext(null),xI=e.createContext(null);function SI(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=kI(),a=e.useRef({}),[s]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}()),l=null!=((null==(u=e.useContext(CI))?void 0:u.id)||null);var u;const[c,d]=e.useState(o.reference),p=function(t){const n=e.useRef(()=>{});return U_(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)},[])}((e,t,n)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==r||r(e,t,n)}),f=e.useMemo(()=>({setPositionReference:d}),[]),m=e.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return e.useMemo(()=>({dataRef:a,open:n,onOpenChange:p,elements:m,events:s,floatingId:i,refs:f}),[n,p,m,s,i,f])}function _I(t){void 0===t&&(t={});const{nodeId:n}=t,r=SI({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[a,s]=e.useState(null),[l,u]=e.useState(null),c=(null==i?void 0:i.domReference)||a,d=e.useRef(null),p=e.useContext(xI);z_(()=>{c&&(d.current=c)},[c]);const f=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:c}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,m]=e.useState(o);dI(f,o)||m(o);const[h,v]=e.useState(null),[y,g]=e.useState(null),b=e.useCallback(e=>{e!==E.current&&(E.current=e,v(e))},[]),A=e.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),w=a||h,k=s||y,E=e.useRef(null),C=e.useRef(null),x=e.useRef(d),S=null!=u,_=mI(u),O=mI(i),I=mI(c),T=e.useCallback(()=>{if(!E.current||!C.current)return;const e={placement:n,strategy:r,middleware:f};O.current&&(e.platform=O.current),uI(E.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==I.current};P.current&&!dI(x.current,t)&&(x.current=t,Jg.flushSync(()=>{p(t)}))})},[f,n,r,O,I]);cI(()=>{!1===c&&x.current.isPositioned&&(x.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[c]);const P=e.useRef(!1);cI(()=>(P.current=!0,()=>{P.current=!1}),[]),cI(()=>{if(w&&(E.current=w),k&&(C.current=k),w&&k){if(_.current)return _.current(w,k,T);T()}},[w,k,T,_,S]);const B=e.useMemo(()=>({reference:E,floating:C,setReference:b,setFloating:A}),[b,A]),D=e.useMemo(()=>({reference:w,floating:k}),[w,k]),j=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=fI(D.floating,d.x),n=fI(D.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...pI(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,D.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:T,refs:B,elements:D,floatingStyles:j}),[d,T,B,D,j])}({...t,elements:{...i,...l&&{reference:l}}}),m=e.useCallback(e=>{const t=K_(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),f.refs.setReference(t)},[f.refs]),h=e.useCallback(e=>{(K_(e)||null===e)&&(d.current=e,s(e)),(K_(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!K_(e))&&f.refs.setReference(e)},[f.refs]),v=e.useMemo(()=>({...f.refs,setReference:h,setPositionReference:m,domReference:d}),[f.refs,h,m]),y=e.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),g=e.useMemo(()=>({...f,...o,refs:v,elements:y,nodeId:n}),[f,v,y,n,o]);return z_(()=>{o.dataRef.current.floatingContext=g;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===n);e&&(e.context=g)}),e.useMemo(()=>({...f,context:g,refs:v,elements:y}),[f,v,y,g])}var OI=function(e,t){return OI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},OI(e,t)};function II(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}OI(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var TI=function(){return TI=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},TI.apply(this,arguments)};function PI(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var BI,DI=function(e){var t=e.showTimeSelectOnly,r=void 0!==t&&t,o=e.showTime,i=void 0!==o&&o,a=e.className,s=e.children,l=r?"Choose Time":"Choose Date".concat(i?" and Time":"");return n().createElement("div",{className:a,role:"dialog","aria-label":l,"aria-modal":"true"},s)},jI=function(t){var r=t.children,o=t.onClickOutside,i=t.className,a=t.containerRef,s=t.style,l=function(t,n){var r=(0,e.useRef)(null),o=(0,e.useRef)(t);o.current=t;var i=(0,e.useCallback)(function(e){var t,i=e.composed&&e.composedPath&&e.composedPath().find(function(e){return e instanceof Node})||e.target;r.current&&!r.current.contains(i)&&(n&&i instanceof HTMLElement&&i.classList.contains(n)||null===(t=o.current)||void 0===t||t.call(o,e))},[n]);return(0,e.useEffect)(function(){return document.addEventListener("mousedown",i),function(){document.removeEventListener("mousedown",i)}},[i]),r}(o,t.ignoreClass);return n().createElement("div",{className:i,style:s,ref:function(e){l.current=e,a&&(a.current=e)}},r)};function RI(){return"undefined"!=typeof window?window:globalThis}function MI(e){if(null==e)return new Date;var t="string"==typeof e?function(e,t){const n=()=>Po(t?.in,NaN),r=t?.additionalDigits??2,o=function(e){const t={},n=e.split(YS.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],YS.timeZoneDelimiter.test(t.date)&&(t.date=e.split(YS.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const e=YS.timezone.exec(r);e?(t.time=r.replace(e[1],""),t.timezone=e[1]):t.time=r}return t}(e);let i;if(o.date){const e=function(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(o.date,r);i=function(e,t){if(null===t)return new Date(NaN);const n=e.match(KS);if(!n)return new Date(NaN);const r=!!n[4],o=ZS(n[1]),i=ZS(n[2])-1,a=ZS(n[3]),s=ZS(n[4]),l=ZS(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=7*(t-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}(t,s,l):new Date(NaN);{const e=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(t_[t]||(n_(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(n_(e)?366:365)}(t,o)?(e.setUTCFullYear(t,i,Math.max(o,a)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!i||isNaN(+i))return n();const a=+i;let s,l=0;if(o.time&&(l=function(e){const t=e.match(XS);if(!t)return NaN;const n=e_(t[1]),r=e_(t[2]),o=e_(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?n*Io+r*Oo+1e3*o:NaN}(o.time),isNaN(l)))return n();if(!o.timezone){const e=new Date(a+l),n=Bo(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return s=function(e){if("Z"===e)return 0;const t=e.match(JS);if(!t)return 0;const n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(r*Io+o*Oo):NaN}(o.timezone),isNaN(s)?n():Bo(a+l+s,t?.in)}(e):Bo(e);return NI(t)?t:new Date}function LI(e,t,n,r,o){void 0===o&&(o=MI());for(var i=nT(n)||nT(tT()),a=0,s=Array.isArray(t)?t:[t];a<s.length;a++){var l=s[a],u=ra(e,l,o,{locale:i,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});if(NI(u)&&(!r||e===FI(u,l,n)))return u}return null}function NI(e,t){return Do(e)&&!r_(e,new Date("1/1/1800"))}function FI(e,t,n){if("en"===n)return Aa(e,t,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var r=n?nT(n):void 0;return n&&!r&&console.warn('A locale object was not found for the provided string ["'.concat(n,'"].')),Aa(e,t,{locale:r=r||nT(tT()),useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function qI(e,t){var n=t.dateFormat,r=t.locale,o=Array.isArray(n)&&n.length>0?n[0]:n;return e&&FI(e,o,r)||""}function VI(e,t){var n=t.hour,r=void 0===n?0:n,o=t.minute,i=void 0===o?0:o,a=t.second;return o_(i_(a_(e,void 0===a?0:a),i),r)}function QI(e){return aa(e)}function zI(e,t,n){return Ni(e,{locale:nT(t||tT()),weekStartsOn:n})}function UI(e){return s_(e)}function WI(e){return la(e)}function HI(e){return l_(e)}function $I(){return aa(MI())}function GI(e){return u_(e)}function YI(e,t){return e&&t?function(e,t,n){const[r,o]=ia(n?.in,e,t);return r.getFullYear()===o.getFullYear()}(e,t):!e&&!t}function KI(e,t){return e&&t?function(e,t,n){const[r,o]=ia(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}(e,t):!e&&!t}function XI(e,t){return e&&t?function(e,t,n){const[r,o]=ia(n?.in,e,t);return+l_(r)===+l_(o)}(e,t):!e&&!t}function JI(e,t){return e&&t?function(e,t,n){const[r,o]=ia(n?.in,e,t);return+aa(r)===+aa(o)}(e,t):!e&&!t}function ZI(e,t){return e&&t?(n=t,+Bo(e)===+Bo(n)):!e&&!t;var n}function eT(e,t,n){var r,o=aa(t),i=u_(n);try{r=d_(e,{start:o,end:i})}catch(e){r=!1}return r}function tT(){return RI().__localeId__}function nT(e){if("string"==typeof e){var t=RI();return t.__localeData__?t.__localeData__[e]:void 0}return e}function rT(e,t){return FI(p_(MI(),e),"LLLL",t)}function oT(e,t){return FI(p_(MI(),e),"LLL",t)}function iT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.excludeDateIntervals,s=n.includeDates,l=n.includeDateIntervals,u=n.filterDate;return mT(e,{minDate:r,maxDate:o})||i&&i.some(function(t){return t instanceof Date?JI(e,t):JI(e,t.date)})||a&&a.some(function(t){var n=t.start,r=t.end;return d_(e,{start:n,end:r})})||s&&!s.some(function(t){return JI(e,t)})||l&&!l.some(function(t){var n=t.start,r=t.end;return d_(e,{start:n,end:r})})||u&&!u(MI(e))||!1}function aT(e,t){var n=void 0===t?{}:t,r=n.excludeDates,o=n.excludeDateIntervals;return o&&o.length>0?o.some(function(t){var n=t.start,r=t.end;return d_(e,{start:n,end:r})}):r&&r.some(function(t){var n;return t instanceof Date?JI(e,t):JI(e,null!==(n=t.date)&&void 0!==n?n:new Date)})||!1}function sT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;return mT(e,{minDate:r?s_(r):void 0,maxDate:o?c_(o):void 0})||(null==i?void 0:i.some(function(t){return KI(e,t instanceof Date?t:t.date)}))||a&&!a.some(function(t){return KI(e,t)})||s&&!s(MI(e))||!1}function lT(e,t,n,r){var o=m_(e),i=h_(e),a=m_(t),s=h_(t),l=m_(r);return o===a&&o===l?i<=n&&n<=s:o<a&&(l===o&&i<=n||l===a&&s>=n||l<a&&l>o)}function uT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates;return mT(e,{minDate:r,maxDate:o})||i&&i.some(function(t){return KI(t instanceof Date?t:t.date,e)})||a&&!a.some(function(t){return KI(t,e)})||!1}function cT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;return mT(e,{minDate:r,maxDate:o})||(null==i?void 0:i.some(function(t){return XI(e,t instanceof Date?t:t.date)}))||a&&!a.some(function(t){return XI(e,t)})||s&&!s(MI(e))||!1}function dT(e,t,n){if(!t||!n)return!1;if(!Do(t)||!Do(n))return!1;var r=m_(t),o=m_(n);return r<=e&&o>=e}function pT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate,l=new Date(e,0,1);return mT(l,{minDate:r?la(r):void 0,maxDate:o?v_(o):void 0})||(null==i?void 0:i.some(function(e){return YI(l,e instanceof Date?e:e.date)}))||a&&!a.some(function(e){return YI(l,e)})||s&&!s(MI(l))||!1}function fT(e,t,n,r){var o=m_(e),i=y_(e),a=m_(t),s=y_(t),l=m_(r);return o===a&&o===l?i<=n&&n<=s:o<a&&(l===o&&i<=n||l===a&&s>=n||l<a&&l>o)}function mT(e,t){var n,r=void 0===t?{}:t,o=r.minDate,i=r.maxDate;return null!==(n=o&&sa(e,o)<0||i&&sa(e,i)>0)&&void 0!==n&&n}function hT(e,t){return t.some(function(t){return g_(t)===g_(e)&&b_(t)===b_(e)&&A_(t)===A_(e)})}function vT(e,t){var n=void 0===t?{}:t,r=n.excludeTimes,o=n.includeTimes,i=n.filterTime;return r&&hT(e,r)||o&&!hT(e,o)||i&&!i(e)||!1}function yT(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var o=MI();o=a_(o=i_(o=o_(o,g_(e)),b_(e)),A_(e));var i=MI();i=a_(i=i_(i=o_(i,g_(n)),b_(n)),A_(n));var a,s=MI();s=a_(s=i_(s=o_(s,g_(r)),b_(r)),A_(r));try{a=!d_(o,{start:i,end:s})}catch(e){a=!1}return a}function gT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=k_(e,1);return r&&E_(r,i)>0||o&&o.every(function(e){return E_(e,i)>0})||!1}function bT(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=w_(e,1);return r&&E_(i,r)>0||o&&o.every(function(e){return E_(i,e)>0})||!1}function AT(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=O_(e,1);return r&&I_(r,i)>0||o&&o.every(function(e){return I_(e,i)>0})||!1}function wT(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=__(e,1);return r&&I_(i,r)>0||o&&o.every(function(e){return I_(i,e)>0})||!1}function kT(e){var t=e.minDate,n=e.includeDates;return n&&t?T_(n.filter(function(e){return sa(e,t)>=0})):n?T_(n):t}function ET(e){var t=e.maxDate,n=e.includeDates;return n&&t?P_(n.filter(function(e){return sa(e,t)<=0})):n?P_(n):t}function CT(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t="react-datepicker__day--highlighted");for(var r=new Map,o=0,i=e.length;o<i;o++){var a=e[o];if(So(a)){var s=FI(a,"MM.dd.yyyy");(p=r.get(s)||[]).includes(t)||(p.push(t),r.set(s,p))}else if("object"==typeof a){var l=null!==(n=Object.keys(a)[0])&&void 0!==n?n:"",u=a[l];if("string"==typeof l&&Array.isArray(u))for(var c=0,d=u.length;c<d;c++){var p,f=u[c];if(f)s=FI(f,"MM.dd.yyyy"),(p=r.get(s)||[]).includes(l)||(p.push(l),r.set(s,p))}}}return r}function xT(e,t){void 0===e&&(e=[]),void 0===t&&(t="react-datepicker__day--holidays");var n=new Map;return e.forEach(function(e){var r=e.date,o=e.holidayName;if(So(r)){var i=FI(r,"MM.dd.yyyy"),a=n.get(i)||{className:"",holidayNames:[]};if(!("className"in a)||a.className!==t||(s=a.holidayNames,l=[o],s.length!==l.length||!s.every(function(e,t){return e===l[t]}))){var s,l;a.className=t;var u=a.holidayNames;a.holidayNames=u?PI(PI([],u,!0),[o],!1):[o],n.set(i,a)}}}),n}function ST(e,t,n,r,o){for(var i=o.length,a=[],s=0;s<i;s++){var l=e,u=o[s];u&&(l=R_(l=j_(l=D_(l,g_(u)),b_(u)),A_(u)));var c=j_(e,(n+1)*r);M_(l,t)&&r_(l,c)&&null!=u&&a.push(u)}return a}function _T(e){return e<10?"0".concat(e):"".concat(e)}function OT(e,t){void 0===t&&(t=12);var n=Math.ceil(m_(e)/t)*t;return{startPeriod:n-(t-1),endPeriod:n}}function IT(e){var t=e.getSeconds(),n=e.getMilliseconds();return Bo(e.getTime()-1e3*t-n)}function TT(e){if(!So(e))throw new Error("Invalid date");var t=new Date(e);return t.setHours(0,0,0,0),t}function PT(e,t){if(!So(e)||!So(t))throw new Error("Invalid date received");return r_(TT(e),TT(t))}function BT(e){return e.key===BI.Space}!function(e){e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.PageUp="PageUp",e.PageDown="PageDown",e.Home="Home",e.End="End",e.Enter="Enter",e.Space=" ",e.Tab="Tab",e.Escape="Escape",e.Backspace="Backspace",e.X="x"}(BI||(BI={}));var DT,jT=function(t){function r(r){var o=t.call(this,r)||this;return o.inputRef=n().createRef(),o.onTimeChange=function(e){var t,n;o.setState({time:e});var r=o.props.date,i=r instanceof Date&&!isNaN(+r)?r:new Date;if(null==e?void 0:e.includes(":")){var a=e.split(":"),s=a[0],l=a[1];i.setHours(Number(s)),i.setMinutes(Number(l))}null===(n=(t=o.props).onChange)||void 0===n||n.call(t,i)},o.renderTimeInput=function(){var t=o.state.time,r=o.props,i=r.date,a=r.timeString,s=r.customTimeInput;return s?(0,e.cloneElement)(s,{date:i,value:t,onChange:o.onTimeChange}):n().createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:o.inputRef,onClick:function(){var e;null===(e=o.inputRef.current)||void 0===e||e.focus()},required:!0,value:t,onChange:function(e){o.onTimeChange(e.target.value||a)}})},o.state={time:o.props.timeString},o}return II(r,t),r.getDerivedStateFromProps=function(e,t){return e.timeString!==t.time?{time:e.timeString}:null},r.prototype.render=function(){return n().createElement("div",{className:"react-datepicker__input-time-container"},n().createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),n().createElement("div",{className:"react-datepicker-time__input-container"},n().createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},r}(e.Component),RT=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.dayEl=(0,e.createRef)(),r.handleClick=function(e){!r.isDisabled()&&r.props.onClick&&r.props.onClick(e)},r.handleMouseEnter=function(e){!r.isDisabled()&&r.props.onMouseEnter&&r.props.onMouseEnter(e)},r.handleOnKeyDown=function(e){var t,n;e.key===BI.Space&&(e.preventDefault(),e.key=BI.Enter),null===(n=(t=r.props).handleOnKeyDown)||void 0===n||n.call(t,e)},r.isSameDay=function(e){return JI(r.props.day,e)},r.isKeyboardSelected=function(){var e;if(r.props.disabledKeyboardNavigation)return!1;var t=r.props.selectsMultiple?null===(e=r.props.selectedDates)||void 0===e?void 0:e.some(function(e){return r.isSameDayOrWeek(e)}):r.isSameDayOrWeek(r.props.selected),n=r.props.preSelection&&r.isDisabled(r.props.preSelection);return!t&&r.isSameDayOrWeek(r.props.preSelection)&&!n},r.isDisabled=function(e){return void 0===e&&(e=r.props.day),iT(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(){return aT(r.props.day,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.isStartOfWeek=function(){return JI(r.props.day,zI(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameWeek=function(e){return r.props.showWeekPicker&&JI(e,zI(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameDayOrWeek=function(e){return r.isSameDay(e)||r.isSameWeek(e)},r.getHighLightedClass=function(){var e=r.props,t=e.day,n=e.highlightDates;if(!n)return!1;var o=FI(t,"MM.dd.yyyy");return n.get(o)},r.getHolidaysClass=function(){var e,t=r.props,n=t.day,o=t.holidays;if(!o)return[void 0];var i=FI(n,"MM.dd.yyyy");return o.has(i)?[null===(e=o.get(i))||void 0===e?void 0:e.className]:[void 0]},r.isInRange=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&eT(t,n,o)},r.isInSelectingRange=function(){var e,t=r.props,n=t.day,o=t.selectsStart,i=t.selectsEnd,a=t.selectsRange,s=t.selectsDisabledDaysInRange,l=t.startDate,u=t.endDate,c=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return!(!(o||i||a)||!c||!s&&r.isDisabled())&&(o&&u&&(r_(c,u)||ZI(c,u))?eT(n,c,u):(i&&l&&(M_(c,l)||ZI(c,l))||!(!a||!l||u||!M_(c,l)&&!ZI(c,l)))&&eT(n,l,c))},r.isSelectingRangeStart=function(){var e;if(!r.isInSelectingRange())return!1;var t=r.props,n=t.day,o=t.startDate,i=t.selectsStart,a=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return JI(n,i?a:o)},r.isSelectingRangeEnd=function(){var e;if(!r.isInSelectingRange())return!1;var t=r.props,n=t.day,o=t.endDate,i=t.selectsEnd,a=t.selectsRange,s=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return JI(n,i||a?s:o)},r.isRangeStart=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&JI(n,t)},r.isRangeEnd=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&JI(o,t)},r.isWeekend=function(){var e,t=Bo(r.props.day,e?.in).getDay();return 0===t||6===t},r.isAfterMonth=function(){return void 0!==r.props.month&&(r.props.month+1)%12===h_(r.props.day)},r.isBeforeMonth=function(){return void 0!==r.props.month&&(h_(r.props.day)+1)%12===r.props.month},r.isCurrentDay=function(){return r.isSameDay(MI())},r.isSelected=function(){var e;return r.props.selectsMultiple?null===(e=r.props.selectedDates)||void 0===e?void 0:e.some(function(e){return r.isSameDayOrWeek(e)}):r.isSameDayOrWeek(r.props.selected)},r.getClassNames=function(e){return Ud("react-datepicker__day",r.props.dayClassName?r.props.dayClassName(e):void 0,"react-datepicker__day--"+FI(r.props.day,"ddd",undefined),{"react-datepicker__day--disabled":r.isDisabled(),"react-datepicker__day--excluded":r.isExcluded(),"react-datepicker__day--selected":r.isSelected(),"react-datepicker__day--keyboard-selected":r.isKeyboardSelected(),"react-datepicker__day--range-start":r.isRangeStart(),"react-datepicker__day--range-end":r.isRangeEnd(),"react-datepicker__day--in-range":r.isInRange(),"react-datepicker__day--in-selecting-range":r.isInSelectingRange(),"react-datepicker__day--selecting-range-start":r.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":r.isSelectingRangeEnd(),"react-datepicker__day--today":r.isCurrentDay(),"react-datepicker__day--weekend":r.isWeekend(),"react-datepicker__day--outside-month":r.isAfterMonth()||r.isBeforeMonth()},r.getHighLightedClass(),r.getHolidaysClass())},r.getAriaLabel=function(){var e=r.props,t=e.day,n=e.ariaLabelPrefixWhenEnabled,o=void 0===n?"Choose":n,i=e.ariaLabelPrefixWhenDisabled,a=void 0===i?"Not available":i,s=r.isDisabled()||r.isExcluded()?a:o;return"".concat(s," ").concat(FI(t,"PPPP",r.props.locale))},r.getTitle=function(){var e=r.props,t=e.day,n=e.holidays,o=void 0===n?new Map:n,i=e.excludeDates,a=FI(t,"MM.dd.yyyy"),s=[];return o.has(a)&&s.push.apply(s,o.get(a).holidayNames),r.isExcluded()&&s.push(null==i?void 0:i.filter(function(e){return e instanceof Date?JI(e,t):JI(null==e?void 0:e.date,t)}).map(function(e){if(!(e instanceof Date))return null==e?void 0:e.message})),s.join(", ")},r.getTabIndex=function(){var e=r.props.selected,t=r.props.preSelection;return(!r.props.showWeekPicker||!r.props.showWeekNumber&&r.isStartOfWeek())&&(r.isKeyboardSelected()||r.isSameDay(e)&&JI(t,e))?0:-1},r.handleFocusDay=function(){var e;r.shouldFocusDay()&&(null===(e=r.dayEl.current)||void 0===e||e.focus({preventScroll:!0}))},r.renderDayContents=function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(L_(r.props.day),r.props.day):L_(r.props.day)},r.render=function(){return n().createElement("div",{ref:r.dayEl,className:r.getClassNames(r.props.day),onKeyDown:r.handleOnKeyDown,onClick:r.handleClick,onMouseEnter:r.props.usePointerEvent?void 0:r.handleMouseEnter,onPointerEnter:r.props.usePointerEvent?r.handleMouseEnter:void 0,tabIndex:r.getTabIndex(),"aria-label":r.getAriaLabel(),role:"option",title:r.getTitle(),"aria-disabled":r.isDisabled(),"aria-current":r.isCurrentDay()?"date":void 0,"aria-selected":r.isSelected()||r.isInRange()},r.renderDayContents(),""!==r.getTitle()&&n().createElement("span",{className:"overlay"},r.getTitle()))},r}return II(r,t),r.prototype.componentDidMount=function(){this.handleFocusDay()},r.prototype.componentDidUpdate=function(){this.handleFocusDay()},r.prototype.shouldFocusDay=function(){var e=!1;return 0===this.getTabIndex()&&this.isSameDay(this.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(e=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(e=!1),this.isDayActiveElement()&&(e=!0),this.isDuplicateDay()&&(e=!1)),e},r.prototype.isDayActiveElement=function(){var e,t,n;return(null===(t=null===(e=this.props.containerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.contains(document.activeElement))&&(null===(n=document.activeElement)||void 0===n?void 0:n.classList.contains("react-datepicker__day"))},r.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},r}(e.Component),MT=function(t){function r(){var n=null!==t&&t.apply(this,arguments)||this;return n.weekNumberEl=(0,e.createRef)(),n.handleClick=function(e){n.props.onClick&&n.props.onClick(e)},n.handleOnKeyDown=function(e){var t,r;e.key===BI.Space&&(e.preventDefault(),e.key=BI.Enter),null===(r=(t=n.props).handleOnKeyDown)||void 0===r||r.call(t,e)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!JI(n.props.date,n.props.selected)&&JI(n.props.date,n.props.preSelection)},n.getTabIndex=function(){return n.props.showWeekPicker&&n.props.showWeekNumber&&(n.isKeyboardSelected()||JI(n.props.date,n.props.selected)&&JI(n.props.preSelection,n.props.selected))?0:-1},n.handleFocusWeekNumber=function(e){var t=!1;0===n.getTabIndex()&&!(null==e?void 0:e.isInputFocused)&&JI(n.props.date,n.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(t=!0),n.props.inline&&!n.props.shouldFocusDayInline&&(t=!1),n.props.containerRef&&n.props.containerRef.current&&n.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(t=!0)),t&&n.weekNumberEl.current&&n.weekNumberEl.current.focus({preventScroll:!0})},n}return II(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},r.prototype.componentDidUpdate=function(e){this.handleFocusWeekNumber(e)},r.prototype.render=function(){var e=this.props,t=e.weekNumber,o=e.isWeekDisabled,i=e.ariaLabelPrefix,a=void 0===i?r.defaultProps.ariaLabelPrefix:i,s=e.onClick,l={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!s&&!o,"react-datepicker__week-number--selected":!!s&&JI(this.props.date,this.props.selected)};return n().createElement("div",{ref:this.weekNumberEl,className:Ud(l),"aria-label":"".concat(a," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex()},t)},r}(e.Component),LT=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.isDisabled=function(e){return iT(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.handleDayClick=function(e,t){r.props.onDayClick&&r.props.onDayClick(e,t)},r.handleDayMouseEnter=function(e){r.props.onDayMouseEnter&&r.props.onDayMouseEnter(e)},r.handleWeekClick=function(e,n,o){for(var i,a,s,l=new Date(e),u=0;u<7;u++){var c=new Date(e);if(c.setDate(c.getDate()+u),!r.isDisabled(c)){l=c;break}}"function"==typeof r.props.onWeekSelect&&r.props.onWeekSelect(l,n,o),r.props.showWeekPicker&&r.handleDayClick(l,o),(null!==(i=r.props.shouldCloseOnSelect)&&void 0!==i?i:t.defaultProps.shouldCloseOnSelect)&&(null===(s=(a=r.props).setOpen)||void 0===s||s.call(a,!1))},r.formatWeekNumber=function(e){return r.props.formatWeekNumber?r.props.formatWeekNumber(e):function(e){return zi(e)}(e)},r.isWeekDisabled=function(){for(var e=r.startOfWeek(),t=Hi(e,6),n=new Date(e);n<=t;){if(!r.isDisabled(n))return!1;n=Hi(n,1)}return!0},r.renderDays=function(){var e=r.startOfWeek(),o=[],i=r.formatWeekNumber(e);if(r.props.showWeekNumber){var a=r.props.onWeekSelect||r.props.showWeekPicker?r.handleWeekClick.bind(r,e,i):void 0;o.push(n().createElement(MT,TI({key:"W"},t.defaultProps,r.props,{weekNumber:i,isWeekDisabled:r.isWeekDisabled(),date:e,onClick:a})))}return o.concat([0,1,2,3,4,5,6].map(function(o){var i=Hi(e,o);return n().createElement(RT,TI({},t.defaultProps,r.props,{ariaLabelPrefixWhenEnabled:r.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:r.props.disabledDayAriaLabelPrefix,key:i.valueOf(),day:i,onClick:r.handleDayClick.bind(r,i),onMouseEnter:r.handleDayMouseEnter.bind(r,i)}))}))},r.startOfWeek=function(){return zI(r.props.day,r.props.locale,r.props.calendarStartDay)},r.isKeyboardSelected=function(){return!r.props.disabledKeyboardNavigation&&!JI(r.startOfWeek(),r.props.selected)&&JI(r.startOfWeek(),r.props.preSelection)},r}return II(t,e),Object.defineProperty(t,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e={"react-datepicker__week":!0,"react-datepicker__week--selected":JI(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()};return n().createElement("div",{className:Ud(e)},this.renderDays())},t}(e.Component),NT="two_columns",FT="three_columns",qT="four_columns",VT=((DT={})[NT]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},DT[FT]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},DT[qT]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},DT);function QT(e,t){return e?qT:t?NT:FT}var zT=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.MONTH_REFS=PI([],Array(12),!0).map(function(){return(0,e.createRef)()}),r.QUARTER_REFS=PI([],Array(4),!0).map(function(){return(0,e.createRef)()}),r.isDisabled=function(e){return iT(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(e){return aT(e,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.handleDayClick=function(e,t){var n,o;null===(o=(n=r.props).onDayClick)||void 0===o||o.call(n,e,t,r.props.orderInDisplay)},r.handleDayMouseEnter=function(e){var t,n;null===(n=(t=r.props).onDayMouseEnter)||void 0===n||n.call(t,e)},r.handleMouseLeave=function(){var e,t;null===(t=(e=r.props).onMouseLeave)||void 0===t||t.call(e)},r.isRangeStartMonth=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&KI(p_(n,e),o)},r.isRangeStartQuarter=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&XI(f_(n,e),o)},r.isRangeEndMonth=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&KI(p_(n,e),i)},r.isRangeEndQuarter=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&XI(f_(n,e),i)},r.isInSelectingRangeMonth=function(e){var t,n=r.props,o=n.day,i=n.selectsStart,a=n.selectsEnd,s=n.selectsRange,l=n.startDate,u=n.endDate,c=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return!(!(i||a||s)||!c)&&(i&&u?lT(c,u,e,o):(a&&l||!(!s||!l||u))&&lT(l,c,e,o))},r.isSelectingMonthRangeStart=function(e){var t;if(!r.isInSelectingRangeMonth(e))return!1;var n=r.props,o=n.day,i=n.startDate,a=n.selectsStart,s=p_(o,e),l=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return KI(s,a?l:i)},r.isSelectingMonthRangeEnd=function(e){var t;if(!r.isInSelectingRangeMonth(e))return!1;var n=r.props,o=n.day,i=n.endDate,a=n.selectsEnd,s=n.selectsRange,l=p_(o,e),u=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return KI(l,a||s?u:i)},r.isInSelectingRangeQuarter=function(e){var t,n=r.props,o=n.day,i=n.selectsStart,a=n.selectsEnd,s=n.selectsRange,l=n.startDate,u=n.endDate,c=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return!(!(i||a||s)||!c)&&(i&&u?fT(c,u,e,o):(a&&l||!(!s||!l||u))&&fT(l,c,e,o))},r.isWeekInMonth=function(e){var t=r.props.day,n=Hi(e,6);return KI(e,t)||KI(n,t)},r.isCurrentMonth=function(e,t){return m_(e)===m_(MI())&&t===h_(MI())},r.isCurrentQuarter=function(e,t){return m_(e)===m_(MI())&&t===y_(MI())},r.isSelectedMonth=function(e,t,n){return h_(n)===t&&m_(e)===m_(n)},r.isSelectMonthInList=function(e,t,n){return n.some(function(n){return r.isSelectedMonth(e,t,n)})},r.isSelectedQuarter=function(e,t,n){return y_(e)===t&&m_(e)===m_(n)},r.isMonthSelected=function(){var e=r.props,t=e.day,n=e.selected,o=e.selectedDates,i=e.selectsMultiple,a=h_(t);return i?null==o?void 0:o.some(function(e){return r.isSelectedMonth(t,a,e)}):!!n&&r.isSelectedMonth(t,a,n)},r.renderWeeks=function(){for(var e=[],t=r.props.fixedHeight,o=0,i=!1,a=zI(UI(r.props.day),r.props.locale,r.props.calendarStartDay),s=r.props.selected?function(e){return r.props.showWeekPicker?zI(e,r.props.locale,r.props.calendarStartDay):r.props.selected}(r.props.selected):void 0,l=r.props.preSelection?function(e){return r.props.showWeekPicker?zI(e,r.props.locale,r.props.calendarStartDay):r.props.preSelection}(r.props.preSelection):void 0;e.push(n().createElement(LT,TI({},r.props,{ariaLabelPrefix:r.props.weekAriaLabelPrefix,key:o,day:a,month:h_(r.props.day),onDayClick:r.handleDayClick,onDayMouseEnter:r.handleDayMouseEnter,selected:s,preSelection:l,showWeekNumber:r.props.showWeekNumbers}))),!i;){o++,a=N_(a,1);var u=t&&o>=6,c=!t&&!r.isWeekInMonth(a);if(u||c){if(!r.props.peekNextMonth)break;i=!0}}return e},r.onMonthClick=function(e,t){var n=r.isMonthDisabledForLabelDate(t),o=n.isDisabled,i=n.labelDate;o||r.handleDayClick(UI(i),e)},r.onMonthMouseEnter=function(e){var t=r.isMonthDisabledForLabelDate(e),n=t.isDisabled,o=t.labelDate;n||r.handleDayMouseEnter(UI(o))},r.handleMonthNavigation=function(e,t){var n,o,i,a;null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),null===(a=null===(i=r.MONTH_REFS[e])||void 0===i?void 0:i.current)||void 0===a||a.focus()},r.handleKeyboardNavigation=function(e,t,n){var o,i=r.props,a=i.selected,s=i.preSelection,l=i.setPreSelection,u=i.minDate,c=i.maxDate,d=i.showFourColumnMonthYearPicker,p=i.showTwoColumnMonthYearPicker;if(s){var f=QT(d,p),m=r.getVerticalOffset(f),h=null===(o=VT[f])||void 0===o?void 0:o.grid,v=function(e,t,n){var r,o,i=t,a=n;switch(e){case BI.ArrowRight:i=w_(t,1),a=11===n?0:n+1;break;case BI.ArrowLeft:i=k_(t,1),a=0===n?11:n-1;break;case BI.ArrowUp:i=k_(t,m),a=(null===(r=null==h?void 0:h[0])||void 0===r?void 0:r.includes(n))?n+12-m:n-m;break;case BI.ArrowDown:i=w_(t,m),a=(null===(o=null==h?void 0:h[h.length-1])||void 0===o?void 0:o.includes(n))?n-12+m:n+m}return{newCalculatedDate:i,newCalculatedMonth:a}};if(t!==BI.Enter){var y=function(e,t,n){for(var o=e,i=!1,a=0,s=v(o,t,n),l=s.newCalculatedDate,d=s.newCalculatedMonth;!i;){if(a>=40){l=t,d=n;break}var p;u&&l<u&&(o=BI.ArrowRight,l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth),c&&l>c&&(o=BI.ArrowLeft,l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth),uT(l,r.props)?(l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth):i=!0,a++}return{newCalculatedDate:l,newCalculatedMonth:d}}(t,s,n),g=y.newCalculatedDate,b=y.newCalculatedMonth;switch(t){case BI.ArrowRight:case BI.ArrowLeft:case BI.ArrowUp:case BI.ArrowDown:r.handleMonthNavigation(b,g)}}else r.isMonthDisabled(n)||(r.onMonthClick(e,n),null==l||l(a))}},r.getVerticalOffset=function(e){var t,n;return null!==(n=null===(t=VT[e])||void 0===t?void 0:t.verticalNavigationOffset)&&void 0!==n?n:0},r.onMonthKeyDown=function(e,t){var n=r.props,o=n.disabledKeyboardNavigation,i=n.handleOnMonthKeyDown,a=e.key;a!==BI.Tab&&e.preventDefault(),o||r.handleKeyboardNavigation(e,a,t),i&&i(e)},r.onQuarterClick=function(e,t){var n=f_(r.props.day,t);cT(n,r.props)||r.handleDayClick(HI(n),e)},r.onQuarterMouseEnter=function(e){var t=f_(r.props.day,e);cT(t,r.props)||r.handleDayMouseEnter(HI(t))},r.handleQuarterNavigation=function(e,t){var n,o,i,a;r.isDisabled(t)||r.isExcluded(t)||(null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),null===(a=null===(i=r.QUARTER_REFS[e-1])||void 0===i?void 0:i.current)||void 0===a||a.focus())},r.onQuarterKeyDown=function(e,t){var n,o,i=e.key;if(!r.props.disabledKeyboardNavigation)switch(i){case BI.Enter:r.onQuarterClick(e,t),null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,r.props.selected);break;case BI.ArrowRight:if(!r.props.preSelection)break;r.handleQuarterNavigation(4===t?1:t+1,C_(r.props.preSelection,1));break;case BI.ArrowLeft:if(!r.props.preSelection)break;r.handleQuarterNavigation(1===t?4:t-1,x_(r.props.preSelection,1))}},r.isMonthDisabledForLabelDate=function(e){var t,n=r.props,o=n.day,i=n.minDate,a=n.maxDate,s=n.excludeDates,l=n.includeDates,u=p_(o,e);return{isDisabled:null!==(t=(i||a||s||l)&&sT(u,r.props))&&void 0!==t&&t,labelDate:u}},r.isMonthDisabled=function(e){return r.isMonthDisabledForLabelDate(e).isDisabled},r.getMonthClassNames=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate,a=t.preSelection,s=t.monthClassName,l=s?s(p_(n,e)):void 0,u=r.getSelection();return Ud("react-datepicker__month-text","react-datepicker__month-".concat(e),l,{"react-datepicker__month-text--disabled":r.isMonthDisabled(e),"react-datepicker__month-text--selected":u?r.isSelectMonthInList(n,e,u):void 0,"react-datepicker__month-text--keyboard-selected":!r.props.disabledKeyboardNavigation&&a&&r.isSelectedMonth(n,e,a)&&!r.isMonthSelected()&&!r.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":r.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":o&&i?lT(o,i,e,n):void 0,"react-datepicker__month-text--range-start":r.isRangeStartMonth(e),"react-datepicker__month-text--range-end":r.isRangeEndMonth(e),"react-datepicker__month-text--selecting-range-start":r.isSelectingMonthRangeStart(e),"react-datepicker__month-text--selecting-range-end":r.isSelectingMonthRangeEnd(e),"react-datepicker__month-text--today":r.isCurrentMonth(n,e)})},r.getTabIndex=function(e){if(null==r.props.preSelection)return"-1";var t=h_(r.props.preSelection),n=r.isMonthDisabledForLabelDate(t).isDisabled;return e!==t||n||r.props.disabledKeyboardNavigation?"-1":"0"},r.getQuarterTabIndex=function(e){if(null==r.props.preSelection)return"-1";var t=y_(r.props.preSelection),n=cT(r.props.day,r.props);return e!==t||n||r.props.disabledKeyboardNavigation?"-1":"0"},r.getAriaLabel=function(e){var t=r.props,n=t.chooseDayAriaLabelPrefix,o=void 0===n?"Choose":n,i=t.disabledDayAriaLabelPrefix,a=void 0===i?"Not available":i,s=t.day,l=t.locale,u=p_(s,e),c=r.isDisabled(u)||r.isExcluded(u)?a:o;return"".concat(c," ").concat(FI(u,"MMMM yyyy",l))},r.getQuarterClassNames=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate,a=t.selected,s=t.minDate,l=t.maxDate,u=t.excludeDates,c=t.includeDates,d=t.filterDate,p=t.preSelection,f=t.disabledKeyboardNavigation,m=(s||l||u||c||d)&&cT(f_(n,e),r.props);return Ud("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":m,"react-datepicker__quarter-text--selected":a?r.isSelectedQuarter(n,e,a):void 0,"react-datepicker__quarter-text--keyboard-selected":!f&&p&&r.isSelectedQuarter(n,e,p)&&!m,"react-datepicker__quarter-text--in-selecting-range":r.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":o&&i?fT(o,i,e,n):void 0,"react-datepicker__quarter-text--range-start":r.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":r.isRangeEndQuarter(e),"react-datepicker__quarter-text--today":r.isCurrentQuarter(n,e)})},r.getMonthContent=function(e){var t=r.props,n=t.showFullMonthYearPicker,o=t.renderMonthContent,i=t.locale,a=t.day,s=oT(e,i),l=rT(e,i);return o?o(e,s,l,a):n?l:s},r.getQuarterContent=function(e){var t,n,o,i=r.props,a=i.renderQuarterContent,s=(n=e,o=i.locale,FI(f_(MI(),n),"QQQ",o));return null!==(t=null==a?void 0:a(e,s))&&void 0!==t?t:s},r.renderMonths=function(){var e,t=r.props,o=t.showTwoColumnMonthYearPicker,i=t.showFourColumnMonthYearPicker,a=t.day,s=t.selected,l=null===(e=VT[QT(i,o)])||void 0===e?void 0:e.grid;return null==l?void 0:l.map(function(e,t){return n().createElement("div",{className:"react-datepicker__month-wrapper",key:t},e.map(function(e,t){return n().createElement("div",{ref:r.MONTH_REFS[e],key:t,onClick:function(t){r.onMonthClick(t,e)},onKeyDown:function(t){BT(t)&&(t.preventDefault(),t.key=BI.Enter),r.onMonthKeyDown(t,e)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onMonthMouseEnter(e)},onPointerEnter:r.props.usePointerEvent?function(){return r.onMonthMouseEnter(e)}:void 0,tabIndex:Number(r.getTabIndex(e)),className:r.getMonthClassNames(e),"aria-disabled":r.isMonthDisabled(e),role:"option","aria-label":r.getAriaLabel(e),"aria-current":r.isCurrentMonth(a,e)?"date":void 0,"aria-selected":s?r.isSelectedMonth(a,e,s):void 0},r.getMonthContent(e))}))})},r.renderQuarters=function(){var e=r.props,t=e.day,o=e.selected;return n().createElement("div",{className:"react-datepicker__quarter-wrapper"},[1,2,3,4].map(function(e,i){return n().createElement("div",{key:i,ref:r.QUARTER_REFS[i],role:"option",onClick:function(t){r.onQuarterClick(t,e)},onKeyDown:function(t){r.onQuarterKeyDown(t,e)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onQuarterMouseEnter(e)},onPointerEnter:r.props.usePointerEvent?function(){return r.onQuarterMouseEnter(e)}:void 0,className:r.getQuarterClassNames(e),"aria-selected":o?r.isSelectedQuarter(t,e,o):void 0,tabIndex:Number(r.getQuarterTabIndex(e)),"aria-current":r.isCurrentQuarter(t,e)?"date":void 0},r.getQuarterContent(e))}))},r.getClassNames=function(){var e=r.props,t=e.selectingDate,n=e.selectsStart,o=e.selectsEnd;return Ud("react-datepicker__month",{"react-datepicker__month--selecting-range":t&&(n||o)},{"react-datepicker__monthPicker":e.showMonthYearPicker},{"react-datepicker__quarterPicker":e.showQuarterYearPicker},{"react-datepicker__weekPicker":e.showWeekPicker})},r}return II(r,t),r.prototype.getSelection=function(){var e=this.props,t=e.selected,n=e.selectedDates;return e.selectsMultiple?n:t?[t]:void 0},r.prototype.render=function(){var e=this.props,t=e.showMonthYearPicker,r=e.showQuarterYearPicker,o=e.day,i=e.ariaLabelPrefix,a=void 0===i?"Month ":i,s=a?a.trim()+" ":"";return n().createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(s).concat(FI(o,"MMMM, yyyy",this.props.locale)),role:"listbox"},t?this.renderMonths():r?this.renderQuarters():this.renderWeeks())},r}(e.Component),UT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSelectedMonth=function(e){return t.props.month===e},t.renderOptions=function(){return t.props.monthNames.map(function(e,r){return n().createElement("div",{className:t.isSelectedMonth(r)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:e,onClick:t.onChange.bind(t,r),"aria-selected":t.isSelectedMonth(r)?"true":void 0},t.isSelectedMonth(r)?n().createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",e)})},t.onChange=function(e){return t.props.onChange(e)},t.handleClickOutside=function(){return t.props.onCancel()},t}return II(t,e),t.prototype.render=function(){return n().createElement(jI,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},t}(e.Component),WT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(e,t){return n().createElement("option",{key:e,value:t},e)})},t.renderSelectMode=function(e){return n().createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(e){return t.onChange(parseInt(e.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,r){return n().createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__month-read-view--selected-month"},r[t.props.month]))},t.renderDropdown=function(e){return n().createElement(UT,TI({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,r=[t.renderReadView(!n,e)];return n&&r.unshift(t.renderDropdown(e)),r},t.onChange=function(e){t.toggleDropdown(),e!==t.props.month&&t.props.onChange(e)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return II(t,e),t.prototype.render=function(){var e,t=this,r=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(e){return oT(e,t.props.locale)}:function(e){return rT(e,t.props.locale)});switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode(r);break;case"select":e=this.renderSelectMode(r)}return n().createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component);function HT(e,t){for(var n=[],r=UI(e),o=UI(t);!M_(r,o);)n.push(MI(r)),r=w_(r,1);return n}var $T=function(e){function t(t){var r=e.call(this,t)||this;return r.renderOptions=function(){return r.state.monthYearsList.map(function(e){var t=F_(e),o=YI(r.props.date,e)&&KI(r.props.date,e);return n().createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:t,onClick:r.onChange.bind(r,t),"aria-selected":o?"true":void 0},o?n().createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",FI(e,r.props.dateFormat,r.props.locale))})},r.onChange=function(e){return r.props.onChange(e)},r.handleClickOutside=function(){r.props.onCancel()},r.state={monthYearsList:HT(r.props.minDate,r.props.maxDate)},r}return II(t,e),t.prototype.render=function(){var e=Ud({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return n().createElement(jI,{className:e,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(e.Component),GT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=UI(t.props.minDate),r=UI(t.props.maxDate),o=[];!M_(e,r);){var i=F_(e);o.push(n().createElement("option",{key:i,value:i},FI(e,t.props.dateFormat,t.props.locale))),e=w_(e,1)}return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return n().createElement("select",{value:F_(UI(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var r=FI(t.props.date,t.props.dateFormat,t.props.locale);return n().createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},r))},t.renderDropdown=function(){return n().createElement($T,TI({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown();var n=MI(e);YI(t.props.date,n)&&KI(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return II(t,e),t.prototype.render=function(){var e;switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode();break;case"select":e=this.renderSelectMode()}return n().createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component),YT=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.state={height:null},r.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,n,o;r.list&&(r.list.scrollTop=null!==(o=r.centerLi&&t.calcCenterPosition(r.props.monthRef?r.props.monthRef.clientHeight-(null!==(n=null===(e=r.header)||void 0===e?void 0:e.clientHeight)&&void 0!==n?n:0):r.list.clientHeight,r.centerLi))&&void 0!==o?o:0)})},r.handleClick=function(e){var t,n;(r.props.minTime||r.props.maxTime)&&yT(e,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&vT(e,r.props)||null===(n=(t=r.props).onChange)||void 0===n||n.call(t,e)},r.isSelectedTime=function(e){return r.props.selected&&(t=e,IT(r.props.selected).getTime()===IT(t).getTime());var t},r.isDisabledTime=function(e){return(r.props.minTime||r.props.maxTime)&&yT(e,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&vT(e,r.props)},r.liClasses=function(e){var n,o=["react-datepicker__time-list-item",r.props.timeClassName?r.props.timeClassName(e):void 0];return r.isSelectedTime(e)&&o.push("react-datepicker__time-list-item--selected"),r.isDisabledTime(e)&&o.push("react-datepicker__time-list-item--disabled"),r.props.injectTimes&&(3600*g_(e)+60*b_(e)+A_(e))%(60*(null!==(n=r.props.intervals)&&void 0!==n?n:t.defaultProps.intervals))!=0&&o.push("react-datepicker__time-list-item--injected"),o.join(" ")},r.handleOnKeyDown=function(e,t){var n,o;e.key===BI.Space&&(e.preventDefault(),e.key=BI.Enter),(e.key===BI.ArrowUp||e.key===BI.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===BI.ArrowDown||e.key===BI.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===BI.Enter&&r.handleClick(t),null===(o=(n=r.props).handleOnKeyDown)||void 0===o||o.call(n,e)},r.renderTimes=function(){for(var e,o=[],i="string"==typeof r.props.format?r.props.format:"p",a=null!==(e=r.props.intervals)&&void 0!==e?e:t.defaultProps.intervals,s=r.props.selected||r.props.openToDate||MI(),l=QI(s),u=r.props.injectTimes&&r.props.injectTimes.sort(function(e,t){return e.getTime()-t.getTime()}),c=60*function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),24);return Math.round((+n-+t)/36e5)}(s),d=c/a,p=0;p<d;p++){var f=j_(l,p*a);if(o.push(f),u){var m=ST(l,f,p,a,u);o=o.concat(m)}}var h=o.reduce(function(e,t){return t.getTime()<=s.getTime()?t:e},o[0]);return o.map(function(e){return n().createElement("li",{key:e.valueOf(),onClick:r.handleClick.bind(r,e),className:r.liClasses(e),ref:function(t){e===h&&(r.centerLi=t)},onKeyDown:function(t){r.handleOnKeyDown(t,e)},tabIndex:e===h?0:-1,role:"option","aria-selected":r.isSelectedTime(e)?"true":void 0,"aria-disabled":r.isDisabledTime(e)?"true":void 0},FI(e,i,r.props.locale))})},r.renderTimeCaption=function(){return!1===r.props.showTimeCaption?n().createElement(n().Fragment,null):n().createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(r.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(e){r.header=e}},n().createElement("div",{className:"react-datepicker-time__header"},r.props.timeCaption))},r}return II(t,e),Object.defineProperty(t,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},t.prototype.componentWillUnmount=function(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()},t.prototype.observeDatePickerHeightChanges=function(){var e=this,t=this.props.monthRef;this.updateContainerHeight(),t&&(this.resizeObserver=new ResizeObserver(function(){e.updateContainerHeight()}),this.resizeObserver.observe(t))},t.prototype.updateContainerHeight=function(){this.props.monthRef&&this.header&&this.setState({height:this.props.monthRef.clientHeight-this.header.clientHeight})},t.prototype.render=function(){var e,r=this,o=this.state.height;return n().createElement("div",{className:"react-datepicker__time-container ".concat((null!==(e=this.props.todayButton)&&void 0!==e?e:t.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),n().createElement("div",{className:"react-datepicker__time"},n().createElement("div",{className:"react-datepicker__time-box"},n().createElement("ul",{className:"react-datepicker__time-list",ref:function(e){r.list=e},style:o?{height:o}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},t.calcCenterPosition=function(e,t){return t.offsetTop-(e/2-t.clientHeight/2)},t}(e.Component),KT=function(t){function r(n){var r=t.call(this,n)||this;return r.YEAR_REFS=PI([],Array(r.props.yearItemNumber),!0).map(function(){return(0,e.createRef)()}),r.isDisabled=function(e){return iT(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(e){return aT(e,{excludeDates:r.props.excludeDates})},r.selectingDate=function(){var e;return null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection},r.updateFocusOnPaginate=function(e){window.requestAnimationFrame(function(){var t,n;null===(n=null===(t=r.YEAR_REFS[e])||void 0===t?void 0:t.current)||void 0===n||n.focus()})},r.handleYearClick=function(e,t){r.props.onDayClick&&r.props.onDayClick(e,t)},r.handleYearNavigation=function(e,t){var n,o,i,a,s=r.props,l=s.date,u=s.yearItemNumber;if(void 0!==l&&void 0!==u){var c=OT(l,u).startPeriod;r.isDisabled(t)||r.isExcluded(t)||(null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),e-c<0?r.updateFocusOnPaginate(u-(c-e)):e-c>=u?r.updateFocusOnPaginate(Math.abs(u-(e-c))):null===(a=null===(i=r.YEAR_REFS[e-c])||void 0===i?void 0:i.current)||void 0===a||a.focus())}},r.isSameDay=function(e,t){return JI(e,t)},r.isCurrentYear=function(e){return e===m_(MI())},r.isRangeStart=function(e){return r.props.startDate&&r.props.endDate&&YI(q_(MI(),e),r.props.startDate)},r.isRangeEnd=function(e){return r.props.startDate&&r.props.endDate&&YI(q_(MI(),e),r.props.endDate)},r.isInRange=function(e){return dT(e,r.props.startDate,r.props.endDate)},r.isInSelectingRange=function(e){var t=r.props,n=t.selectsStart,o=t.selectsEnd,i=t.selectsRange,a=t.startDate,s=t.endDate;return!(!(n||o||i)||!r.selectingDate())&&(n&&s?dT(e,r.selectingDate(),s):(o&&a||!(!i||!a||s))&&dT(e,a,r.selectingDate()))},r.isSelectingRangeStart=function(e){var t;if(!r.isInSelectingRange(e))return!1;var n=r.props,o=n.startDate,i=n.selectsStart;return YI(q_(MI(),e),i?null!==(t=r.selectingDate())&&void 0!==t?t:null:null!=o?o:null)},r.isSelectingRangeEnd=function(e){var t;if(!r.isInSelectingRange(e))return!1;var n=r.props,o=n.endDate,i=n.selectsEnd,a=n.selectsRange;return YI(q_(MI(),e),i||a?null!==(t=r.selectingDate())&&void 0!==t?t:null:null!=o?o:null)},r.isKeyboardSelected=function(e){if(void 0!==r.props.date&&null!=r.props.selected&&null!=r.props.preSelection){var t=r.props,n=t.minDate,o=t.maxDate,i=t.excludeDates,a=t.includeDates,s=t.filterDate,l=WI(q_(r.props.date,e)),u=(n||o||i||a||s)&&pT(e,r.props);return!r.props.disabledKeyboardNavigation&&!r.props.inline&&!JI(l,WI(r.props.selected))&&JI(l,WI(r.props.preSelection))&&!u}},r.isSelectedYear=function(e){var t=r.props,n=t.selectsMultiple,o=t.selected,i=t.selectedDates;return n?null==i?void 0:i.some(function(t){return e===m_(t)}):!!o&&e===m_(o)},r.onYearClick=function(e,t){var n=r.props.date;void 0!==n&&r.handleYearClick(WI(q_(n,t)),e)},r.onYearKeyDown=function(e,t){var n,o,i=e.key,a=r.props,s=a.date,l=a.yearItemNumber,u=a.handleOnKeyDown;if(i!==BI.Tab&&e.preventDefault(),!r.props.disabledKeyboardNavigation)switch(i){case BI.Enter:if(null==r.props.selected)break;r.onYearClick(e,t),null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,r.props.selected);break;case BI.ArrowRight:if(null==r.props.preSelection)break;r.handleYearNavigation(t+1,__(r.props.preSelection,1));break;case BI.ArrowLeft:if(null==r.props.preSelection)break;r.handleYearNavigation(t-1,O_(r.props.preSelection,1));break;case BI.ArrowUp:if(void 0===s||void 0===l||null==r.props.preSelection)break;var c=OT(s,l).startPeriod;if((f=t-(p=3))<c){var d=l%p;t>=c&&t<c+d?p=d:p+=d,f=t-p}r.handleYearNavigation(f,O_(r.props.preSelection,p));break;case BI.ArrowDown:if(void 0===s||void 0===l||null==r.props.preSelection)break;var p,f,m=OT(s,l).endPeriod;(f=t+(p=3))>m&&(d=l%p,t<=m&&t>m-d?p=d:p+=d,f=t+p),r.handleYearNavigation(f,__(r.props.preSelection,p))}u&&u(e)},r.getYearClassNames=function(e){var t=r.props,n=t.date,o=t.minDate,i=t.maxDate,a=t.excludeDates,s=t.includeDates,l=t.filterDate,u=t.yearClassName;return Ud("react-datepicker__year-text","react-datepicker__year-".concat(e),n?null==u?void 0:u(q_(n,e)):void 0,{"react-datepicker__year-text--selected":r.isSelectedYear(e),"react-datepicker__year-text--disabled":(o||i||a||s||l)&&pT(e,r.props),"react-datepicker__year-text--keyboard-selected":r.isKeyboardSelected(e),"react-datepicker__year-text--range-start":r.isRangeStart(e),"react-datepicker__year-text--range-end":r.isRangeEnd(e),"react-datepicker__year-text--in-range":r.isInRange(e),"react-datepicker__year-text--in-selecting-range":r.isInSelectingRange(e),"react-datepicker__year-text--selecting-range-start":r.isSelectingRangeStart(e),"react-datepicker__year-text--selecting-range-end":r.isSelectingRangeEnd(e),"react-datepicker__year-text--today":r.isCurrentYear(e)})},r.getYearTabIndex=function(e){if(r.props.disabledKeyboardNavigation||null==r.props.preSelection)return"-1";var t=m_(r.props.preSelection),n=pT(e,r.props);return e!==t||n?"-1":"0"},r.getYearContent=function(e){return r.props.renderYearContent?r.props.renderYearContent(e):e},r}return II(r,t),r.prototype.render=function(){var e=this,t=[],r=this.props,o=r.date,i=r.yearItemNumber,a=r.onYearMouseEnter,s=r.onYearMouseLeave;if(void 0===o)return null;for(var l=OT(o,i),u=l.startPeriod,c=l.endPeriod,d=function(r){t.push(n().createElement("div",{ref:p.YEAR_REFS[r-u],onClick:function(t){e.onYearClick(t,r)},onKeyDown:function(t){BT(t)&&(t.preventDefault(),t.key=BI.Enter),e.onYearKeyDown(t,r)},tabIndex:Number(p.getYearTabIndex(r)),className:p.getYearClassNames(r),onMouseEnter:p.props.usePointerEvent?void 0:function(e){return a(e,r)},onPointerEnter:p.props.usePointerEvent?function(e){return a(e,r)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(e){return s(e,r)},onPointerLeave:p.props.usePointerEvent?function(e){return s(e,r)}:void 0,key:r,"aria-current":p.isCurrentYear(r)?"date":void 0},p.getYearContent(r)))},p=this,f=u;f<=c;f++)d(f);return n().createElement("div",{className:"react-datepicker__year"},n().createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},t))},r}(e.Component);function XT(e,t,n,r){for(var o=[],i=0;i<2*t+1;i++){var a=e+t-i,s=!0;n&&(s=m_(n)<=a),r&&s&&(s=m_(r)>=a),s&&o.push(a)}return o}var JT,ZT=function(t){function r(r){var o=t.call(this,r)||this;o.renderOptions=function(){var e=o.props.year,t=o.state.yearsList.map(function(t){return n().createElement("div",{className:e===t?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:t,onClick:o.onChange.bind(o,t),"aria-selected":e===t?"true":void 0},e===t?n().createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",t)}),r=o.props.minDate?m_(o.props.minDate):null,i=o.props.maxDate?m_(o.props.maxDate):null;return i&&o.state.yearsList.find(function(e){return e===i})||t.unshift(n().createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:o.incrementYears},n().createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),r&&o.state.yearsList.find(function(e){return e===r})||t.push(n().createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:o.decrementYears},n().createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),t},o.onChange=function(e){o.props.onChange(e)},o.handleClickOutside=function(){o.props.onCancel()},o.shiftYears=function(e){var t=o.state.yearsList.map(function(t){return t+e});o.setState({yearsList:t})},o.incrementYears=function(){return o.shiftYears(1)},o.decrementYears=function(){return o.shiftYears(-1)};var i=r.yearDropdownItemNumber,a=r.scrollableYearDropdown,s=i||(a?10:5);return o.state={yearsList:XT(o.props.year,s,o.props.minDate,o.props.maxDate)},o.dropdownRef=(0,e.createRef)(),o}return II(r,t),r.prototype.componentDidMount=function(){var e=this.dropdownRef.current;if(e){var t=e.children?Array.from(e.children):null,n=t?t.find(function(e){return e.ariaSelected}):null;e.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-e.clientHeight)/2:(e.scrollHeight-e.clientHeight)/2}},r.prototype.render=function(){var e=Ud({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return n().createElement(jI,{className:e,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(e.Component),eP=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?m_(t.props.minDate):1900,r=t.props.maxDate?m_(t.props.maxDate):2100,o=[],i=e;i<=r;i++)o.push(n().createElement("option",{key:i,value:i},i));return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return n().createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return n().createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:function(e){return t.toggleDropdown(e)}},n().createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return n().createElement(ZT,TI({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown(),e!==t.props.year&&t.props.onChange(e)},t.toggleDropdown=function(e){t.setState({dropdownVisible:!t.state.dropdownVisible},function(){t.props.adjustDateOnChange&&t.handleYearChange(t.props.date,e)})},t.handleYearChange=function(e,n){var r;null===(r=t.onSelect)||void 0===r||r.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var r,o;null===(o=(r=t.props).onSelect)||void 0===o||o.call(r,e,n)},t.setOpen=function(){var e,n;null===(n=(e=t.props).setOpen)||void 0===n||n.call(e,!0)},t}return II(t,e),t.prototype.render=function(){var e;switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode();break;case"select":e=this.renderSelectMode()}return n().createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component),tP=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],nP=function(t){function r(o){var i=t.call(this,o)||this;return i.monthContainer=void 0,i.handleClickOutside=function(e){i.props.onClickOutside(e)},i.setClickOutsideRef=function(){return i.containerRef.current},i.handleDropdownFocus=function(e){var t,n,r,o;r=e.target,o=(r.className||"").split(/\s+/),tP.some(function(e){return o.indexOf(e)>=0})&&(null===(n=(t=i.props).onDropdownFocus)||void 0===n||n.call(t,e))},i.getDateInView=function(){var e=i.props,t=e.preSelection,n=e.selected,r=e.openToDate,o=kT(i.props),a=ET(i.props),s=MI();return r||n||t||(o&&r_(s,o)?o:a&&M_(s,a)?a:s)},i.increaseMonth=function(){i.setState(function(e){return{date:w_(e.date,1)}},function(){return i.handleMonthChange(i.state.date)})},i.decreaseMonth=function(){i.setState(function(e){return{date:k_(e.date,1)}},function(){return i.handleMonthChange(i.state.date)})},i.handleDayClick=function(e,t,n){i.props.onSelect(e,t,n),i.props.setPreSelection&&i.props.setPreSelection(e)},i.handleDayMouseEnter=function(e){i.setState({selectingDate:e}),i.props.onDayMouseEnter&&i.props.onDayMouseEnter(e)},i.handleMonthMouseLeave=function(){i.setState({selectingDate:void 0}),i.props.onMonthMouseLeave&&i.props.onMonthMouseLeave()},i.handleYearMouseEnter=function(e,t){i.setState({selectingDate:q_(MI(),t)}),i.props.onYearMouseEnter&&i.props.onYearMouseEnter(e,t)},i.handleYearMouseLeave=function(e,t){i.props.onYearMouseLeave&&i.props.onYearMouseLeave(e,t)},i.handleYearChange=function(e){var t,n,r,o;null===(n=(t=i.props).onYearChange)||void 0===n||n.call(t,e),i.setState({isRenderAriaLiveMessage:!0}),i.props.adjustDateOnChange&&(i.props.onSelect(e),null===(o=(r=i.props).setOpen)||void 0===o||o.call(r,!0)),i.props.setPreSelection&&i.props.setPreSelection(e)},i.getEnabledPreSelectionDateForMonth=function(e){if(!iT(e,i.props))return e;for(var t=UI(e),n=function(e,t,n){const[r,o]=ia(n?.in,e,t),i=V_(r,o),a=Math.abs(sa(r,o));r.setDate(r.getDate()-i*a);const s=i*(a-Number(V_(r,o)===-i));return 0===s?0:s}(function(e){return c_(e)}(e),t),r=null,o=0;o<=n;o++){var a=Hi(t,o);if(!iT(a,i.props)){r=a;break}}return r},i.handleMonthChange=function(e){var t,n,r,o=null!==(t=i.getEnabledPreSelectionDateForMonth(e))&&void 0!==t?t:e;i.handleCustomMonthChange(o),i.props.adjustDateOnChange&&(i.props.onSelect(o),null===(r=(n=i.props).setOpen)||void 0===r||r.call(n,!0)),i.props.setPreSelection&&i.props.setPreSelection(o)},i.handleCustomMonthChange=function(e){var t,n;null===(n=(t=i.props).onMonthChange)||void 0===n||n.call(t,e),i.setState({isRenderAriaLiveMessage:!0})},i.handleMonthYearChange=function(e){i.handleYearChange(e),i.handleMonthChange(e)},i.changeYear=function(e){i.setState(function(t){return{date:q_(t.date,Number(e))}},function(){return i.handleYearChange(i.state.date)})},i.changeMonth=function(e){i.setState(function(t){return{date:p_(t.date,Number(e))}},function(){return i.handleMonthChange(i.state.date)})},i.changeMonthYear=function(e){i.setState(function(t){return{date:q_(p_(t.date,h_(e)),m_(e))}},function(){return i.handleMonthYearChange(i.state.date)})},i.header=function(e){void 0===e&&(e=i.state.date);var t=zI(e,i.props.locale,i.props.calendarStartDay),r=[];return i.props.showWeekNumbers&&r.push(n().createElement("div",{key:"W",className:"react-datepicker__day-name"},i.props.weekLabel||"#")),r.concat([0,1,2,3,4,5,6].map(function(e){var r=Hi(t,e),o=i.formatWeekday(r,i.props.locale),a=i.props.weekDayClassName?i.props.weekDayClassName(r):void 0;return n().createElement("div",{key:e,"aria-label":FI(r,"EEEE",i.props.locale),className:Ud("react-datepicker__day-name",a)},o)}))},i.formatWeekday=function(e,t){return i.props.formatWeekDay?function(e,t,n){return t(FI(e,"EEEE",n))}(e,i.props.formatWeekDay,t):i.props.useWeekdaysShort?function(e,t){return FI(e,"EEE",t)}(e,t):function(e,t){return FI(e,"EEEEEE",t)}(e,t)},i.decreaseYear=function(){i.setState(function(e){var t;return{date:O_(e.date,i.props.showYearPicker?null!==(t=i.props.yearItemNumber)&&void 0!==t?t:r.defaultProps.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})},i.clearSelectingDate=function(){i.setState({selectingDate:void 0})},i.renderPreviousButton=function(){var e,t,o;if(!i.props.renderCustomHeader){var a,s=null!==(e=i.props.monthsShown)&&void 0!==e?e:r.defaultProps.monthsShown,l=i.props.showPreviousMonths?s-1:0,u=null!==(t=i.props.monthSelectedIn)&&void 0!==t?t:l,c=k_(i.state.date,u);switch(!0){case i.props.showMonthYearPicker:a=AT(i.state.date,i.props);break;case i.props.showYearPicker:a=function(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.yearItemNumber,i=void 0===o?12:o,a=OT(WI(O_(e,i)),i).endPeriod,s=r&&m_(r);return s&&s>a||!1}(i.state.date,i.props);break;case i.props.showQuarterYearPicker:a=function(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=x_(la(e),1);return r&&S_(r,i)>0||o&&o.every(function(e){return S_(e,i)>0})||!1}(i.state.date,i.props);break;default:a=gT(c,i.props)}if(((null!==(o=i.props.forceShowMonthNavigation)&&void 0!==o?o:r.defaultProps.forceShowMonthNavigation)||i.props.showDisabledMonthNavigation||!a)&&!i.props.showTimeSelectOnly){var d=["react-datepicker__navigation","react-datepicker__navigation--previous"],p=i.decreaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(p=i.decreaseYear),a&&i.props.showDisabledMonthNavigation&&(d.push("react-datepicker__navigation--previous--disabled"),p=void 0);var f=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,m=i.props,h=m.previousMonthButtonLabel,v=void 0===h?r.defaultProps.previousMonthButtonLabel:h,y=m.previousYearButtonLabel,g=void 0===y?r.defaultProps.previousYearButtonLabel:y,b=i.props,A=b.previousMonthAriaLabel,w=void 0===A?"string"==typeof v?v:"Previous Month":A,k=b.previousYearAriaLabel,E=void 0===k?"string"==typeof g?g:"Previous Year":k;return n().createElement("button",{type:"button",className:d.join(" "),onClick:p,onKeyDown:i.props.handleOnKeyDown,"aria-label":f?E:w},n().createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"].join(" ")},f?g:v))}}},i.increaseYear=function(){i.setState(function(e){var t;return{date:__(e.date,i.props.showYearPicker?null!==(t=i.props.yearItemNumber)&&void 0!==t?t:r.defaultProps.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})},i.renderNextButton=function(){var e;if(!i.props.renderCustomHeader){var t;switch(!0){case i.props.showMonthYearPicker:t=wT(i.state.date,i.props);break;case i.props.showYearPicker:t=function(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.yearItemNumber,i=void 0===o?12:o,a=OT(__(e,i),i).startPeriod,s=r&&m_(r);return s&&s<a||!1}(i.state.date,i.props);break;case i.props.showQuarterYearPicker:t=function(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=C_(v_(e),1);return r&&S_(i,r)>0||o&&o.every(function(e){return S_(i,e)>0})||!1}(i.state.date,i.props);break;default:t=bT(i.state.date,i.props)}if(((null!==(e=i.props.forceShowMonthNavigation)&&void 0!==e?e:r.defaultProps.forceShowMonthNavigation)||i.props.showDisabledMonthNavigation||!t)&&!i.props.showTimeSelectOnly){var o=["react-datepicker__navigation","react-datepicker__navigation--next"];i.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),i.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var a=i.increaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(a=i.increaseYear),t&&i.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),a=void 0);var s=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,l=i.props,u=l.nextMonthButtonLabel,c=void 0===u?r.defaultProps.nextMonthButtonLabel:u,d=l.nextYearButtonLabel,p=void 0===d?r.defaultProps.nextYearButtonLabel:d,f=i.props,m=f.nextMonthAriaLabel,h=void 0===m?"string"==typeof c?c:"Next Month":m,v=f.nextYearAriaLabel,y=void 0===v?"string"==typeof p?p:"Next Year":v;return n().createElement("button",{type:"button",className:o.join(" "),onClick:a,onKeyDown:i.props.handleOnKeyDown,"aria-label":s?y:h},n().createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"].join(" ")},s?p:c))}}},i.renderCurrentMonth=function(e){void 0===e&&(e=i.state.date);var t=["react-datepicker__current-month"];return i.props.showYearDropdown&&t.push("react-datepicker__current-month--hasYearDropdown"),i.props.showMonthDropdown&&t.push("react-datepicker__current-month--hasMonthDropdown"),i.props.showMonthYearDropdown&&t.push("react-datepicker__current-month--hasMonthYearDropdown"),n().createElement("h2",{className:t.join(" ")},FI(e,i.props.dateFormat,i.props.locale))},i.renderYearDropdown=function(e){if(void 0===e&&(e=!1),i.props.showYearDropdown&&!e)return n().createElement(eP,TI({},r.defaultProps,i.props,{date:i.state.date,onChange:i.changeYear,year:m_(i.state.date)}))},i.renderMonthDropdown=function(e){if(void 0===e&&(e=!1),i.props.showMonthDropdown&&!e)return n().createElement(WT,TI({},r.defaultProps,i.props,{month:h_(i.state.date),onChange:i.changeMonth}))},i.renderMonthYearDropdown=function(e){if(void 0===e&&(e=!1),i.props.showMonthYearDropdown&&!e)return n().createElement(GT,TI({},r.defaultProps,i.props,{date:i.state.date,onChange:i.changeMonthYear}))},i.handleTodayButtonClick=function(e){i.props.onSelect($I(),e),i.props.setPreSelection&&i.props.setPreSelection($I())},i.renderTodayButton=function(){if(i.props.todayButton&&!i.props.showTimeSelectOnly)return n().createElement("div",{className:"react-datepicker__today-button",onClick:i.handleTodayButtonClick},i.props.todayButton)},i.renderDefaultHeader=function(e){var t=e.monthDate,r=e.i;return n().createElement("div",{className:"react-datepicker__header ".concat(i.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},i.renderCurrentMonth(t),n().createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(i.props.dropdownMode),onFocus:i.handleDropdownFocus},i.renderMonthDropdown(0!==r),i.renderMonthYearDropdown(0!==r),i.renderYearDropdown(0!==r)),n().createElement("div",{className:"react-datepicker__day-names"},i.header(t)))},i.renderCustomHeader=function(e){var t,r,o=e.monthDate,a=e.i;if(i.props.showTimeSelect&&!i.state.monthContainer||i.props.showTimeSelectOnly)return null;var s=gT(i.state.date,i.props),l=bT(i.state.date,i.props),u=AT(i.state.date,i.props),c=wT(i.state.date,i.props),d=!i.props.showMonthYearPicker&&!i.props.showQuarterYearPicker&&!i.props.showYearPicker;return n().createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:i.props.onDropdownFocus},null===(r=(t=i.props).renderCustomHeader)||void 0===r?void 0:r.call(t,TI(TI({},i.state),{customHeaderCount:a,monthDate:o,changeMonth:i.changeMonth,changeYear:i.changeYear,decreaseMonth:i.decreaseMonth,increaseMonth:i.increaseMonth,decreaseYear:i.decreaseYear,increaseYear:i.increaseYear,prevMonthButtonDisabled:s,nextMonthButtonDisabled:l,prevYearButtonDisabled:u,nextYearButtonDisabled:c})),d&&n().createElement("div",{className:"react-datepicker__day-names"},i.header(o)))},i.renderYearHeader=function(e){var t=e.monthDate,o=i.props,a=o.showYearPicker,s=o.yearItemNumber,l=OT(t,void 0===s?r.defaultProps.yearItemNumber:s),u=l.startPeriod,c=l.endPeriod;return n().createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},a?"".concat(u," - ").concat(c):m_(t))},i.renderHeader=function(e){var t=e.monthDate,n=e.i,r={monthDate:t,i:void 0===n?0:n};switch(!0){case void 0!==i.props.renderCustomHeader:return i.renderCustomHeader(r);case i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker:return i.renderYearHeader(r);default:return i.renderDefaultHeader(r)}},i.renderMonths=function(){var e,t;if(!i.props.showTimeSelectOnly&&!i.props.showYearPicker){for(var o=[],a=null!==(e=i.props.monthsShown)&&void 0!==e?e:r.defaultProps.monthsShown,s=i.props.showPreviousMonths?a-1:0,l=i.props.showMonthYearPicker||i.props.showQuarterYearPicker?__(i.state.date,s):k_(i.state.date,s),u=null!==(t=i.props.monthSelectedIn)&&void 0!==t?t:s,c=0;c<a;++c){var d=c-u+s,p=i.props.showMonthYearPicker||i.props.showQuarterYearPicker?__(l,d):w_(l,d),f="month-".concat(c),m=c<a-1,h=c>0;o.push(n().createElement("div",{key:f,ref:function(e){i.monthContainer=null!=e?e:void 0},className:"react-datepicker__month-container"},i.renderHeader({monthDate:p,i:c}),n().createElement(zT,TI({},r.defaultProps,i.props,{containerRef:i.containerRef,ariaLabelPrefix:i.props.monthAriaLabelPrefix,day:p,onDayClick:i.handleDayClick,handleOnKeyDown:i.props.handleOnDayKeyDown,handleOnMonthKeyDown:i.props.handleOnKeyDown,onDayMouseEnter:i.handleDayMouseEnter,onMouseLeave:i.handleMonthMouseLeave,orderInDisplay:c,selectingDate:i.state.selectingDate,monthShowsDuplicateDaysEnd:m,monthShowsDuplicateDaysStart:h}))))}return o}},i.renderYears=function(){if(!i.props.showTimeSelectOnly)return i.props.showYearPicker?n().createElement("div",{className:"react-datepicker__year--container"},i.renderHeader({monthDate:i.state.date}),n().createElement(KT,TI({},r.defaultProps,i.props,{selectingDate:i.state.selectingDate,date:i.state.date,onDayClick:i.handleDayClick,clearSelectingDate:i.clearSelectingDate,onYearMouseEnter:i.handleYearMouseEnter,onYearMouseLeave:i.handleYearMouseLeave}))):void 0},i.renderTimeSection=function(){if(i.props.showTimeSelect&&(i.state.monthContainer||i.props.showTimeSelectOnly))return n().createElement(YT,TI({},r.defaultProps,i.props,{onChange:i.props.onTimeChange,format:i.props.timeFormat,intervals:i.props.timeIntervals,monthRef:i.state.monthContainer}))},i.renderInputTimeSection=function(){var e=i.props.selected?new Date(i.props.selected):void 0,t=e&&NI(e)&&Boolean(i.props.selected)?"".concat(_T(e.getHours()),":").concat(_T(e.getMinutes())):"";if(i.props.showTimeInput)return n().createElement(jT,TI({},r.defaultProps,i.props,{date:e,timeString:t,onChange:i.props.onTimeChange}))},i.renderAriaLiveRegion=function(){var e,t,o=OT(i.state.date,null!==(e=i.props.yearItemNumber)&&void 0!==e?e:r.defaultProps.yearItemNumber),a=o.startPeriod,s=o.endPeriod;return t=i.props.showYearPicker?"".concat(a," - ").concat(s):i.props.showMonthYearPicker||i.props.showQuarterYearPicker?m_(i.state.date):"".concat(rT(h_(i.state.date),i.props.locale)," ").concat(m_(i.state.date)),n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},i.state.isRenderAriaLiveMessage&&t)},i.renderChildren=function(){if(i.props.children)return n().createElement("div",{className:"react-datepicker__children-container"},i.props.children)},i.containerRef=(0,e.createRef)(),i.state={date:i.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},i}return II(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:12}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){this.props.showTimeSelect&&(this.assignMonthContainer=void this.setState({monthContainer:this.monthContainer}))},r.prototype.componentDidUpdate=function(e){var t=this;if(!this.props.preSelection||JI(this.props.preSelection,e.preSelection)&&this.props.monthSelectedIn===e.monthSelectedIn)this.props.openToDate&&!JI(this.props.openToDate,e.openToDate)&&this.setState({date:this.props.openToDate});else{var n=!KI(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&t.handleCustomMonthChange(t.state.date)})}},r.prototype.render=function(){var e=this.props.container||DI;return n().createElement(jI,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},n().createElement("div",{style:{display:"contents"},ref:this.containerRef},n().createElement(e,{className:Ud("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},r}(e.Component),rP=function(e){var t=e.icon,r=e.className,o=void 0===r?"":r,i=e.onClick,a="react-datepicker__calendar-icon";if("string"==typeof t)return n().createElement("i",{className:"".concat(a," ").concat(t," ").concat(o),"aria-hidden":"true",onClick:i});if(n().isValidElement(t)){var s=t;return n().cloneElement(s,{className:"".concat(s.props.className||""," ").concat(a," ").concat(o),onClick:function(e){"function"==typeof s.props.onClick&&s.props.onClick(e),"function"==typeof i&&i(e)}})}return n().createElement("svg",{className:"".concat(a," ").concat(o),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:i},n().createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},oP=function(e){function t(t){var n=e.call(this,t)||this;return n.portalRoot=null,n.el=document.createElement("div"),n}return II(t,e),t.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},t.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},t.prototype.render=function(){return Zg().createPortal(this.props.children,this.el)},t}(e.Component),iP=function(e){return(e instanceof HTMLAnchorElement||!e.disabled)&&-1!==e.tabIndex},aP=function(t){function r(n){var r=t.call(this,n)||this;return r.getTabChildren=function(){var e;return Array.prototype.slice.call(null===(e=r.tabLoopRef.current)||void 0===e?void 0:e.querySelectorAll("[tabindex], a, button, input, select, textarea"),1,-1).filter(iP)},r.handleFocusStart=function(){var e=r.getTabChildren();e&&e.length>1&&e[e.length-1].focus()},r.handleFocusEnd=function(){var e=r.getTabChildren();e&&e.length>1&&e[0].focus()},r.tabLoopRef=(0,e.createRef)(),r}return II(r,t),r.prototype.render=function(){var e;return(null!==(e=this.props.enableTabLoop)&&void 0!==e?e:r.defaultProps.enableTabLoop)?n().createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},n().createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,n().createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},r.defaultProps={enableTabLoop:!0},r}(e.Component),sP=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return II(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{hidePopper:!0}},enumerable:!1,configurable:!0}),r.prototype.render=function(){var t=this.props,o=t.className,i=t.wrapperClassName,a=t.hidePopper,s=void 0===a?r.defaultProps.hidePopper:a,l=t.popperComponent,u=t.targetComponent,c=t.enableTabLoop,d=t.popperOnKeyDown,p=t.portalId,f=t.portalHost,m=t.popperProps,h=t.showArrow,v=void 0;if(!s){var y=Ud("react-datepicker-popper",o);v=n().createElement(aP,{enableTabLoop:c},n().createElement("div",{ref:m.refs.setFloating,style:m.floatingStyles,className:y,"data-placement":m.placement,onKeyDown:d},l,h&&n().createElement(EI,{ref:m.arrowRef,context:m.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}this.props.popperContainer&&(v=(0,e.createElement)(this.props.popperContainer,{},v)),p&&!s&&(v=n().createElement(oP,{portalId:p,portalHost:f},v));var g=Ud("react-datepicker-wrapper",i);return n().createElement(n().Fragment,null,n().createElement("div",{ref:m.refs.setReference,className:g},u),v)},r}(e.Component),lP=(JT=sP,function(t){var r,o,i,a="boolean"!=typeof t.hidePopper||t.hidePopper,s=(0,e.useRef)(null),l=_I(TI({open:!a,whileElementsMounted:iI,placement:t.popperPlacement,middleware:PI([(o={padding:15},{...sI(o),options:[o,i]}),vI(10),yI({element:s})],null!==(r=t.popperModifiers)&&void 0!==r?r:[],!0)},t.popperProps)),u=TI(TI({},t),{hidePopper:a,popperProps:TI(TI({},l),{arrowRef:s})});return n().createElement(JT,TI({},u))}),uP="react-datepicker-ignore-onclickoutside",cP="Date input not valid.",dP=function(t){function r(o){var i=t.call(this,o)||this;return i.calendar=null,i.input=null,i.getPreSelection=function(){return i.props.openToDate?i.props.openToDate:i.props.selectsEnd&&i.props.startDate?i.props.startDate:i.props.selectsStart&&i.props.endDate?i.props.endDate:MI()},i.modifyHolidays=function(){var e;return null===(e=i.props.holidays)||void 0===e?void 0:e.reduce(function(e,t){var n=new Date(t.date);return NI(n)?PI(PI([],e,!0),[TI(TI({},t),{date:n})],!1):e},[])},i.calcInitialState=function(){var e,t=i.getPreSelection(),n=kT(i.props),r=ET(i.props),o=n&&r_(t,QI(n))?n:r&&M_(t,GI(r))?r:t;return{open:i.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:null!==(e=i.props.selectsRange?i.props.startDate:i.props.selected)&&void 0!==e?e:o,highlightDates:CT(i.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},i.resetHiddenStatus=function(){i.setState(TI(TI({},i.state),{wasHidden:!1}))},i.setHiddenStatus=function(){i.setState(TI(TI({},i.state),{wasHidden:!0}))},i.setHiddenStateOnVisibilityHidden=function(){"hidden"===document.visibilityState&&i.setHiddenStatus()},i.clearPreventFocusTimeout=function(){i.preventFocusTimeout&&clearTimeout(i.preventFocusTimeout)},i.setFocus=function(){var e,t;null===(t=null===(e=i.input)||void 0===e?void 0:e.focus)||void 0===t||t.call(e,{preventScroll:!0})},i.setBlur=function(){var e,t;null===(t=null===(e=i.input)||void 0===e?void 0:e.blur)||void 0===t||t.call(e),i.cancelFocusInput()},i.deferBlur=function(){requestAnimationFrame(function(){i.setBlur()})},i.setOpen=function(e,t){void 0===t&&(t=!1),i.setState({open:e,preSelection:e&&i.state.open?i.state.preSelection:i.calcInitialState().preSelection,lastPreSelectChange:fP},function(){e||i.setState(function(e){return{focused:!!t&&e.focused}},function(){!t&&i.deferBlur(),i.setState({inputValue:null})})})},i.inputOk=function(){return So(i.state.preSelection)},i.isCalendarOpen=function(){return void 0===i.props.open?i.state.open&&!i.props.disabled&&!i.props.readOnly:i.props.open},i.handleFocus=function(e){var t,n,r=i.state.wasHidden,o=!r||i.state.open;r&&i.resetHiddenStatus(),i.state.preventFocus||(null===(n=(t=i.props).onFocus)||void 0===n||n.call(t,e),!o||i.props.preventOpenOnFocus||i.props.readOnly||i.setOpen(!0)),i.setState({focused:!0})},i.sendFocusBackToInput=function(){i.preventFocusTimeout&&i.clearPreventFocusTimeout(),i.setState({preventFocus:!0},function(){i.preventFocusTimeout=setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})})},i.cancelFocusInput=function(){clearTimeout(i.inputFocusTimeout),i.inputFocusTimeout=void 0},i.deferFocusInput=function(){i.cancelFocusInput(),i.inputFocusTimeout=setTimeout(function(){return i.setFocus()},1)},i.handleDropdownFocus=function(){i.cancelFocusInput()},i.handleBlur=function(e){var t,n;(!i.state.open||i.props.withPortal||i.props.showTimeInput)&&(null===(n=(t=i.props).onBlur)||void 0===n||n.call(t,e)),i.state.open&&!1===i.props.open&&i.setOpen(!1),i.setState({focused:!1})},i.handleCalendarClickOutside=function(e){var t,n;i.props.inline||i.setOpen(!1),null===(n=(t=i.props).onClickOutside)||void 0===n||n.call(t,e),i.props.withPortal&&e.preventDefault()},i.handleChange=function(){for(var e,t,n,o,a,s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];var u=s[0];if(!i.props.onChangeRaw||(i.props.onChangeRaw.apply(i,s),u&&"function"==typeof u.isDefaultPrevented&&!u.isDefaultPrevented())){i.setState({inputValue:(null==u?void 0:u.target)instanceof HTMLInputElement?u.target.value:null,lastPreSelectChange:pP});var c=i.props,d=c.selectsRange,p=c.startDate,f=c.endDate,m=null!==(e=i.props.dateFormat)&&void 0!==e?e:r.defaultProps.dateFormat,h=null!==(t=i.props.strictParsing)&&void 0!==t?t:r.defaultProps.strictParsing,v=(null==u?void 0:u.target)instanceof HTMLInputElement?u.target.value:"";if(d){var y=v.split(m.includes("-")?" - ":"-",2).map(function(e){return e.trim()}),g=y[0],b=y[1],A=LI(null!=g?g:"",m,i.props.locale,h),w=LI(null!=b?b:"",m,i.props.locale,h),k=(null==p?void 0:p.getTime())!==(null==A?void 0:A.getTime()),E=(null==f?void 0:f.getTime())!==(null==w?void 0:w.getTime());if(!k&&!E)return;if(A&&iT(A,i.props))return;if(w&&iT(w,i.props))return;null===(o=(n=i.props).onChange)||void 0===o||o.call(n,[A,w],u)}else{var C=LI(v,m,i.props.locale,h,null!==(a=i.props.selected)&&void 0!==a?a:void 0);!C&&v||i.setSelected(C,u,!0)}}},i.handleSelect=function(e,t,n){if(!i.props.readOnly)if(i.props.shouldCloseOnSelect&&!i.props.showTimeSelect&&i.sendFocusBackToInput(),i.props.onChangeRaw&&i.props.onChangeRaw(t),i.setSelected(e,t,!1,n),i.props.showDateSelect&&i.setState({isRenderAriaLiveMessage:!0}),!i.props.shouldCloseOnSelect||i.props.showTimeSelect)i.setPreSelection(e);else if(!i.props.inline){i.props.selectsRange||i.setOpen(!1);var r=i.props,o=r.startDate,a=r.endDate;!o||a||!i.props.swapRange&&PT(e,o)||i.setOpen(!1)}},i.setSelected=function(e,t,n,r){var o,a,s=e;if(i.props.showYearPicker){if(null!==s&&pT(m_(s),i.props))return}else if(i.props.showMonthYearPicker){if(null!==s&&sT(s,i.props))return}else if(null!==s&&iT(s,i.props))return;var l=i.props,u=l.onChange,c=l.selectsRange,d=l.startDate,p=l.endDate,f=l.selectsMultiple,m=l.selectedDates,h=l.minTime,v=l.swapRange;if(!ZI(i.props.selected,s)||i.props.allowSameDay||c||f)if(null!==s&&(!i.props.selected||n&&(i.props.showTimeSelect||i.props.showTimeSelectOnly||i.props.showTimeInput)||(s=VI(s,{hour:g_(i.props.selected),minute:b_(i.props.selected),second:A_(i.props.selected)})),n||!i.props.showTimeSelect&&!i.props.showTimeSelectOnly||h&&(s=VI(s,{hour:h.getHours(),minute:h.getMinutes(),second:h.getSeconds()})),i.props.inline||i.setState({preSelection:s}),i.props.focusSelectedMonth||i.setState({monthSelectedIn:r})),c){var y=d&&p;d||p?d&&!p&&(null===s?null==u||u([null,null],t):PT(s,d)?v?null==u||u([s,d],t):null==u||u([s,null],t):null==u||u([d,s],t)):null==u||u([s,null],t),y&&(null==u||u([s,null],t))}else if(f){if(null!==s)if(null==m?void 0:m.length)if(m.some(function(e){return JI(e,s)})){var g=m.filter(function(e){return!JI(e,s)});null==u||u(g,t)}else null==u||u(PI(PI([],m,!0),[s],!1),t);else null==u||u([s],t)}else null==u||u(s,t);n||(null===(a=(o=i.props).onSelect)||void 0===a||a.call(o,s,t),i.setState({inputValue:null}))},i.setPreSelection=function(e){if(!i.props.readOnly){var t=So(i.props.minDate),n=So(i.props.maxDate),r=!0;if(e){var o=QI(e);if(t&&n)r=eT(e,i.props.minDate,i.props.maxDate);else if(t){var a=QI(i.props.minDate);r=M_(e,a)||ZI(o,a)}else if(n){var s=GI(i.props.maxDate);r=r_(e,s)||ZI(o,s)}}r&&i.setState({preSelection:e})}},i.toggleCalendar=function(){i.setOpen(!i.state.open)},i.handleTimeChange=function(e){var t,n;if(!i.props.selectsRange&&!i.props.selectsMultiple){var r=i.props.selected?i.props.selected:i.getPreSelection(),o=i.props.selected?e:VI(r,{hour:g_(e),minute:b_(e)});i.setState({preSelection:o}),null===(n=(t=i.props).onChange)||void 0===n||n.call(t,o),i.props.shouldCloseOnSelect&&!i.props.showTimeInput&&(i.sendFocusBackToInput(),i.setOpen(!1)),i.props.showTimeInput&&i.setOpen(!0),(i.props.showTimeSelectOnly||i.props.showTimeSelect)&&i.setState({isRenderAriaLiveMessage:!0}),i.setState({inputValue:null})}},i.onInputClick=function(){var e,t;i.props.disabled||i.props.readOnly||i.setOpen(!0),null===(t=(e=i.props).onInputClick)||void 0===t||t.call(e)},i.onInputKeyDown=function(e){var t,n,r,o,a,s;null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e);var l=e.key;if(i.state.open||i.props.inline||i.props.preventOpenOnFocus){if(i.state.open){if(l===BI.ArrowDown||l===BI.ArrowUp){e.preventDefault();var u=i.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":i.props.showWeekPicker&&i.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':i.props.showFullMonthYearPicker||i.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',c=(null===(o=i.calendar)||void 0===o?void 0:o.containerRef.current)instanceof Element&&i.calendar.containerRef.current.querySelector(u);return void(c instanceof HTMLElement&&c.focus({preventScroll:!0}))}var d=MI(i.state.preSelection);l===BI.Enter?(e.preventDefault(),e.target.blur(),i.inputOk()&&i.state.lastPreSelectChange===fP?(i.handleSelect(d,e),!i.props.shouldCloseOnSelect&&i.setPreSelection(d)):i.setOpen(!1)):l===BI.Escape?(e.preventDefault(),e.target.blur(),i.sendFocusBackToInput(),i.setOpen(!1)):l===BI.Tab&&i.setOpen(!1),i.inputOk()||null===(s=(a=i.props).onInputError)||void 0===s||s.call(a,{code:1,msg:cP})}}else l!==BI.ArrowDown&&l!==BI.ArrowUp&&l!==BI.Enter||null===(r=i.onInputClick)||void 0===r||r.call(i)},i.onPortalKeyDown=function(e){e.key===BI.Escape&&(e.preventDefault(),i.setState({preventFocus:!0},function(){i.setOpen(!1),setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})}))},i.onDayKeyDown=function(e){var t,n,r,o,a,s,l=i.props,u=l.minDate,c=l.maxDate,d=l.disabledKeyboardNavigation,p=l.showWeekPicker,f=l.shouldCloseOnSelect,m=l.locale,h=l.calendarStartDay,v=l.adjustDateOnChange,y=l.inline;if(null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e),!d){var g=e.key,b=e.shiftKey,A=MI(i.state.preSelection),w=function(e,t){var n=t;switch(e){case BI.ArrowRight:n=p?N_(t,1):Hi(t,1);break;case BI.ArrowLeft:n=p?Q_(t,1):function(e,t,n){return Hi(e,-t,n)}(t,1);break;case BI.ArrowUp:n=Q_(t,1);break;case BI.ArrowDown:n=N_(t,1);break;case BI.PageUp:n=b?O_(t,1):k_(t,1);break;case BI.PageDown:n=b?__(t,1):w_(t,1);break;case BI.Home:n=zI(t,m,h);break;case BI.End:n=function(e){return function(e,t){const n=ei(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Bo(e,t?.in),i=o.getDay(),a=6+(i<r?-7:0)-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}(e)}(t)}return n};if(g===BI.Enter)return e.preventDefault(),i.handleSelect(A,e),void(!f&&i.setPreSelection(A));if(g===BI.Escape)return e.preventDefault(),i.setOpen(!1),void(i.inputOk()||null===(o=(r=i.props).onInputError)||void 0===o||o.call(r,{code:1,msg:cP}));var k=null;switch(g){case BI.ArrowLeft:case BI.ArrowRight:case BI.ArrowUp:case BI.ArrowDown:case BI.PageUp:case BI.PageDown:case BI.Home:case BI.End:k=function(e,t){for(var n=e,r=!1,o=0,a=w(e,t);!r;){if(o>=40){a=t;break}u&&a<u&&(n=BI.ArrowRight,a=iT(u,i.props)?w(n,a):u),c&&a>c&&(n=BI.ArrowLeft,a=iT(c,i.props)?w(n,a):c),iT(a,i.props)?(n!==BI.PageUp&&n!==BI.Home||(n=BI.ArrowRight),n!==BI.PageDown&&n!==BI.End||(n=BI.ArrowLeft),a=w(n,a)):r=!0,o++}return a}(g,A)}if(k){if(e.preventDefault(),i.setState({lastPreSelectChange:fP}),v&&i.setSelected(k),i.setPreSelection(k),y){var E=h_(A),C=h_(k),x=m_(A),S=m_(k);E!==C||x!==S?i.setState({shouldFocusDayInline:!0}):i.setState({shouldFocusDayInline:!1})}}else null===(s=(a=i.props).onInputError)||void 0===s||s.call(a,{code:1,msg:cP})}},i.onPopperKeyDown=function(e){e.key===BI.Escape&&(e.preventDefault(),i.sendFocusBackToInput(),i.setOpen(!1))},i.onClearClick=function(e){e&&e.preventDefault&&e.preventDefault(),i.sendFocusBackToInput();var t=i.props,n=t.selectsRange,r=t.onChange;n?null==r||r([null,null],e):null==r||r(null,e),i.setState({inputValue:null})},i.clear=function(){i.onClearClick()},i.onScroll=function(e){"boolean"==typeof i.props.closeOnScroll&&i.props.closeOnScroll?e.target!==document&&e.target!==document.documentElement&&e.target!==document.body||i.setOpen(!1):"function"==typeof i.props.closeOnScroll&&i.props.closeOnScroll(e)&&i.setOpen(!1)},i.renderCalendar=function(){var e,t;return i.props.inline||i.isCalendarOpen()?n().createElement(nP,TI({showMonthYearDropdown:void 0,ref:function(e){i.calendar=e}},i.props,i.state,{setOpen:i.setOpen,dateFormat:null!==(e=i.props.dateFormatCalendar)&&void 0!==e?e:r.defaultProps.dateFormatCalendar,onSelect:i.handleSelect,onClickOutside:i.handleCalendarClickOutside,holidays:xT(i.modifyHolidays()),outsideClickIgnoreClass:uP,onDropdownFocus:i.handleDropdownFocus,onTimeChange:i.handleTimeChange,className:i.props.calendarClassName,container:i.props.calendarContainer,handleOnKeyDown:i.props.onKeyDown,handleOnDayKeyDown:i.onDayKeyDown,setPreSelection:i.setPreSelection,dropdownMode:null!==(t=i.props.dropdownMode)&&void 0!==t?t:r.defaultProps.dropdownMode}),i.props.children):null},i.renderAriaLiveRegion=function(){var e,t=i.props,o=t.dateFormat,a=void 0===o?r.defaultProps.dateFormat:o,s=t.locale,l=i.props.showTimeInput||i.props.showTimeSelect?"PPPPp":"PPPP";return e=i.props.selectsRange?"Selected start date: ".concat(qI(i.props.startDate,{dateFormat:l,locale:s}),". ").concat(i.props.endDate?"End date: "+qI(i.props.endDate,{dateFormat:l,locale:s}):""):i.props.showTimeSelectOnly?"Selected time: ".concat(qI(i.props.selected,{dateFormat:a,locale:s})):i.props.showYearPicker?"Selected year: ".concat(qI(i.props.selected,{dateFormat:"yyyy",locale:s})):i.props.showMonthYearPicker?"Selected month: ".concat(qI(i.props.selected,{dateFormat:"MMMM yyyy",locale:s})):i.props.showQuarterYearPicker?"Selected quarter: ".concat(qI(i.props.selected,{dateFormat:"yyyy, QQQ",locale:s})):"Selected date: ".concat(qI(i.props.selected,{dateFormat:l,locale:s})),n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},e)},i.renderDateInput=function(){var t,o,a,s=Ud(i.props.className,((t={})[uP]=i.state.open,t)),l=i.props.customInput||n().createElement("input",{type:"text"}),u=i.props.customInputRef||"ref",c=i.props,d=c.dateFormat,p=void 0===d?r.defaultProps.dateFormat:d,f=c.locale,m="string"==typeof i.props.value?i.props.value:"string"==typeof i.state.inputValue?i.state.inputValue:i.props.selectsRange?function(e,t,n){if(!e)return"";var r=qI(e,n),o=t?qI(t,n):"";return"".concat(r).concat(" - ").concat(o)}(i.props.startDate,i.props.endDate,{dateFormat:p,locale:f}):i.props.selectsMultiple?function(e,t){if(!(null==e?void 0:e.length))return"";var n=e[0]?qI(e[0],t):"";if(1===e.length)return n;if(2===e.length&&e[1]){var r=qI(e[1],t);return"".concat(n,", ").concat(r)}var o=e.length-1;return"".concat(n," (+").concat(o,")")}(null!==(a=i.props.selectedDates)&&void 0!==a?a:[],{dateFormat:p,locale:f}):qI(i.props.selected,{dateFormat:p,locale:f});return(0,e.cloneElement)(l,((o={})[u]=function(e){i.input=e},o.value=m,o.onBlur=i.handleBlur,o.onChange=i.handleChange,o.onClick=i.onInputClick,o.onFocus=i.handleFocus,o.onKeyDown=i.onInputKeyDown,o.id=i.props.id,o.name=i.props.name,o.form=i.props.form,o.autoFocus=i.props.autoFocus,o.placeholder=i.props.placeholderText,o.disabled=i.props.disabled,o.autoComplete=i.props.autoComplete,o.className=Ud(l.props.className,s),o.title=i.props.title,o.readOnly=i.props.readOnly,o.required=i.props.required,o.tabIndex=i.props.tabIndex,o["aria-describedby"]=i.props.ariaDescribedBy,o["aria-invalid"]=i.props.ariaInvalid,o["aria-labelledby"]=i.props.ariaLabelledBy,o["aria-required"]=i.props.ariaRequired,o))},i.renderClearButton=function(){var e=i.props,t=e.isClearable,r=e.disabled,o=e.selected,a=e.startDate,s=e.endDate,l=e.clearButtonTitle,u=e.clearButtonClassName,c=void 0===u?"":u,d=e.ariaLabelClose,p=void 0===d?"Close":d,f=e.selectedDates,m=e.readOnly;return!t||m||null==o&&null==a&&null==s&&!(null==f?void 0:f.length)?null:n().createElement("button",{type:"button",className:Ud("react-datepicker__close-icon",c,{"react-datepicker__close-icon--disabled":r}),disabled:r,"aria-label":p,onClick:i.onClearClick,title:l,tabIndex:-1})},i.state=i.calcInitialState(),i.preventFocusTimeout=void 0,i}return II(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,readOnly:!1,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:12,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.componentDidUpdate=function(e,t){var n,r,o,i,a,s;e.inline&&(a=e.selected,s=this.props.selected,a&&s?h_(a)!==h_(s)||m_(a)!==m_(s):a!==s)&&this.setPreSelection(this.props.selected),void 0!==this.state.monthSelectedIn&&e.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),e.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:CT(this.props.highlightDates)}),t.focused||ZI(e.selected,this.props.selected)||this.setState({inputValue:null}),t.open!==this.state.open&&(!1===t.open&&!0===this.state.open&&(null===(r=(n=this.props).onCalendarOpen)||void 0===r||r.call(n)),!0===t.open&&!1===this.state.open&&(null===(i=(o=this.props).onCalendarClose)||void 0===i||i.call(o)))},r.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.renderInputContainer=function(){var e=this.props,t=e.showIcon,r=e.icon,o=e.calendarIconClassname,i=e.calendarIconClassName,a=e.toggleCalendarOnIconClick,s=this.state.open;return o&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),n().createElement("div",{className:"react-datepicker__input-container".concat(t?" react-datepicker__view-calendar-icon":"")},t&&n().createElement(rP,TI({icon:r,className:Ud(i,!i&&o,s&&"react-datepicker-ignore-onclickoutside")},a?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},r.prototype.render=function(){var e=this.renderCalendar();if(this.props.inline)return e;if(this.props.withPortal){var t=this.state.open?n().createElement(aP,{enableTabLoop:this.props.enableTabLoop},n().createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},e)):null;return this.state.open&&this.props.portalId&&(t=n().createElement(oP,TI({portalId:this.props.portalId},this.props),t)),n().createElement("div",null,this.renderInputContainer(),t)}return n().createElement(lP,TI({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:e,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},r}(e.Component),pP="input",fP="navigate",mP=a("./node_modules/css-loader/dist/cjs.js!./node_modules/react-datepicker/dist/react-datepicker.css"),hP={};hP.styleTagTransform=nl(),hP.setAttributes=Js(),hP.insert=Ks().bind(null,"head"),hP.domAPI=Gs(),hP.insertStyleElement=el(),Hs()(mP.A,hP),mP.A&&mP.A.locals&&mP.A.locals;var vP=["width","height","color"];function yP(){return yP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yP.apply(null,arguments)}var gP=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,vP);return n().createElement("svg",yP({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},l),n().createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:s}))};gP.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const bP=gP;var AP=["width","height","color"];function wP(){return wP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wP.apply(null,arguments)}var kP=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,AP);return n().createElement("svg",wP({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},l),n().createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03 .65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",fill:s}))};kP.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const EP=kP;var CP=function(e,t,n,r){return e.length===t.length&&n&&r?{original:e,masked:Qe(e,n,r,t)}:{original:e,masked:e}},xP=["selectedDate","onChange","label","required","placeholder","dateFormat","styleName","header","cardListContext","questionId","disabled","startDate","endDate","value","maskingType","maskingLength","inputProps","tooltip","showQuestionLabels"];function SP(){return SP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SP.apply(null,arguments)}function _P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return OP(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OP(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var IP=function(t){var r=t.selectedDate,o=t.onChange,i=t.label,a=t.required,s=t.placeholder,l=t.dateFormat,u=void 0===l?"MM/dd/yyyy":l,c=t.styleName,d=t.header,p=t.cardListContext,f=t.questionId,m=t.disabled,h=t.startDate,v=t.endDate,y=t.value,g=t.maskingType,b=t.maskingLength,A=t.inputProps,w=void 0===A?{}:A,k=t.tooltip,E=void 0===k?"":k,C=t.showQuestionLabels,x=void 0===C||C,S=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,xP),_=xc(),O=ZA(_,S.theme),I=(0,e.useRef)(""),T=(0,e.useRef)(y),P=(0,e.useRef)(""),B=w["data-item-index"],D=w["data-parent-id"],j=g&&b,R=_P((0,e.useState)(!1),2),M=R[0],L=R[1],N=_P((0,e.useState)({original:"",masked:""}),2),F=N[0],q=N[1],V=(0,e.useMemo)(function(){if(void 0!==y&&""!==y){if(y.length===u.length)try{var e=ra(y,u,new Date);if(e&&!Number.isNaN(e.getTime()))return e}catch(e){return null}return null}return r instanceof Date&&!Number.isNaN(r.getTime())?r:null},[y,r,u]),Q=void 0!==y&&""!==y?qe(y,u):"",z=_P((0,e.useState)(V),2),U=z[0],W=z[1],H=_P((0,e.useState)(Q),2),$=H[0],G=H[1],Y=_P((0,e.useState)(!1),2),K=Y[0],X=Y[1],J=(0,e.useRef)(!1);(0,e.useEffect)(function(){!J.current&&Q&&(q(CP(Q,u,j?g:void 0,j?b:void 0)),I.current=Q,P.current=Q,J.current=!0)},[]);var Z=(0,e.useMemo)(function(){return j?M?F.original:F.masked:F.original||$||(y?qe(y,u):"")},[F,M,j,$,y,u]),ee=function(e){if("string"!=typeof e||!e)return!1;var t=/M/.test(e),n=/y/.test(e),r=/[dD]/.test(e);return t&&n&&!r}(u),te=function(e,t){G(e),I.current=e,P.current=e,q(CP(e,u,j?g:void 0,j?b:void 0)),void 0!==t&&W(t)};(0,e.useEffect)(function(){var e=y!==T.current;T.current=y,function(e,t,n){if(void 0===e||""===e)return!1;var r=qe(e,u);return function(e,t){return K?P.current===e&&(X(!1),!0):!t}(r,t)||(t||P.current!==r?(X(!1),te(r,n)):n&&W(n)),!0}(y,e,V)||function(e,t){if(e&&!t){if(K)return!0;var n=Aa(e,u);return P.current===n?W(e):te(n,e),!0}return!1}(V,y)||function(e,t){!e&&!t&&(K||""!==P.current&&(G(""),P.current="",q({original:"",masked:""}),W(null)))}(y,V)},[y,V,u,K,j,g,b]);var re=void 0===B?f:"".concat(f,"-").concat(B);return n().createElement("div",{className:"form-field ".concat(c||""),style:tw(O.container)},d&&n().createElement("div",{className:"field-header",style:O.header},d),x&&i&&n().createElement("div",{className:"question_label",style:O.label},i,a&&n().createElement("span",{className:"required-mark",style:O.requiredMark},"*"),E&&n().createElement(gE,{tooltip:E})),n().createElement("div",{style:{position:"relative",display:"inline-block",width:"100%"}},n().createElement(dP,SP({selected:U,onChange:function(e){X(!1);var t=e?Aa(e,u):"";o&&t!==I.current&&o({target:{value:t,name:f,type:"date","data-item-index":B,"data-parent-id":D},cardListContext:p}),W(e),G(t),I.current=t,P.current=t,q(CP(t,u,j?g:void 0,j?b:void 0))},onChangeRaw:function(e){var t;if(null!=(null===(t=e.target)||void 0===t?void 0:t.value)){X(!0);var n=e.target.value||"",r=j&&!M&&(null==F?void 0:F.original)?function(e,t,n,r){return function(e,t,n,r,o){var i,a,s=(null==t||null===(i=t.nativeEvent)||void 0===i?void 0:i.inputType)||"",l=((null==t||null===(a=t.nativeEvent)||void 0===a?void 0:a.data)||"").replace(ne,""),u=n.replace(ne,"");if("insertText"===s&&l){var c="".concat(u).concat(l);return Ve(c,r,u)}if("deleteContentBackward"===s||"deleteContentForward"===s){var d=u.slice(0,Math.max(0,u.length-1));return Ve(d,r,u)}var p=e.replace(ne,"");return Ve(p,r,o)}(e,t,n.original,r,I.current)}(n,e,F,u):Ve(n,u,I.current);r!==I.current&&(e.target.value=r,G(r),I.current=r,P.current=r,j?function(e,t,n,r){q(CP(e,t,n,r))}(r,u,g,b):q({original:r,masked:r}),null==o||o({target:{value:r,name:f,type:"date","data-item-index":B,"data-parent-id":D},cardListContext:p}),function(e,t){e.length===t.length?W(function(e,t){if(e.length===t.length){try{var n=ra(e,t,new Date);if(n&&!Number.isNaN(n.getTime()))return n}catch(e){}return null}return e.length>0&&(e.length,t.length),null}(e,t)):(e.length>0&&e.length<t.length||""===e)&&W(null)}(r,u))}},onBlur:function(e){X(!1);var t=j?F.original:$;t&&t!==I.current&&o&&o({target:{value:t,name:f,type:"date","data-item-index":B,"data-parent-id":D},cardListContext:p})},onKeyDown:function(e){"Backspace"===e.key&&j&&L(!0)},dateFormat:u,placeholderText:s||"Enter date (".concat(u,")"),value:j?Z:$},S,{style:tw(O.input),name:re,showMonthYearPicker:ee,peekNextMonth:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",dateFormatCalendar:"MMMM",autoComplete:"off",disabled:m,minDate:h,maxDate:v,allowSameDay:!0,strictParsing:!1})),j&&n().createElement("button",{type:"button",name:"passwordEye",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-eye-icon",onClick:function(){return L(!M)},title:M?"Hide value":"Show value","aria-label":M?"Hide sensitive information":"Show sensitive information",style:{position:"absolute",right:"12px",top:"40%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#666",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1}},M?n().createElement(EP,null):n().createElement(bP,null))))};IP.propTypes={selectedDate:o().instanceOf(Date),onChange:o().func,label:o().string,required:o().bool,placeholder:o().string,dateFormat:o().string,styleName:o().string,header:o().string,cardListContext:o().object,questionId:o().string,disabled:o().bool,startDate:o().oneOfType([o().string,o().instanceOf(Date)]),endDate:o().oneOfType([o().string,o().instanceOf(Date)]),value:o().string,theme:o().object,maskingType:o().oneOf(["prefix","suffix"]),maskingLength:o().number,inputProps:o().object,tooltip:o().string,showQuestionLabels:o().bool};const TP=IP;function PP(e){return PP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},PP(e)}function BP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BP(Object(n),!0).forEach(function(t){jP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jP(e,t,n){return(t=function(e){var t=function(e){if("object"!=PP(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=PP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==PP(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var RP=function(t){var r,o=t.name,i=t.value,a=void 0===i?"":i,s=t.label,l=void 0===s?"":s,u=t.className,c=void 0===u?"":u,d=t.customTheme,p=void 0===d?{}:d,f=t.styleName,m=void 0===f?"":f,h=t.parentContext,v=void 0===h?{}:h,y=t.tooltip,g=void 0===y?"":y,b=t.showQuestionLabels,A=void 0===b||b,w=cc(),k=w.state,E=w.formSchema,C=k.values,x=void 0===C?{}:C,S=k.nestedStates,_=void 0===S?{}:S,O=xc(),I=null!==(r=null!=a?a:x[o])&&void 0!==r?r:"",T=(0,e.useMemo)(function(){return l?zn(l,x,_,v,E||[]):l},[l,x,_,v,E]),P=(0,e.useMemo)(function(){return zn(I,x,_,v,E||[])},[I,x,_,v,E]),B=(0,e.useMemo)(function(){var e=O.displayTextField||O.textField||{};return ZA(e,p)},[O,p]),D=(0,e.useMemo)(function(){var e=DP(DP({},B.container),{},{width:"100%"});return{container:ew(e,B.responsive),label:tw(B.label),content:tw(B.content)}},[B]);return n().createElement("div",{className:"display-text-field-container",style:D.container},A&&T&&n().createElement("div",{className:"question_label ".concat(c," ").concat(m||""),style:D.label},T,g&&n().createElement(gE,{tooltip:g})),P&&n().createElement("div",{className:"display-text-field__content ".concat(c," ").concat(m||""),style:D.content,dangerouslySetInnerHTML:"string"!=typeof P?{__html:Qx.sanitize(String(P),{ALLOWED_TAGS:["a","p","br","span","strong","em"],ALLOWED_ATTR:["href","target","rel"]})}:{__html:Qx.sanitize(P,{ALLOWED_TAGS:["a","p","br","span","strong","em"],ALLOWED_ATTR:["href","target","rel"]})}}))};RP.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,value:o().oneOfType([o().string,o().number,o().bool]),label:o().string,className:o().string,customTheme:o().object,styleName:o().string,parentContext:o().object,tooltip:o().string,showQuestionLabels:o().bool};const MP=RP;function LP(e){return LP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LP(e)}function NP(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return FP(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(FP(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,FP(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,FP(d,"constructor",u),FP(u,"constructor",l),l.displayName="GeneratorFunction",FP(u,o,"GeneratorFunction"),FP(d),FP(d,o,"Generator"),FP(d,r,function(){return this}),FP(d,"toString",function(){return"[object Generator]"}),(NP=function(){return{w:i,m:p}})()}function FP(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}FP=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){FP(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},FP(e,t,n,r)}function qP(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function VP(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){qP(i,r,o,a,s,"next",e)}function s(e){qP(i,r,o,a,s,"throw",e)}a(void 0)})}}function QP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?QP(Object(n),!0).forEach(function(t){UP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UP(e,t,n){return(t=function(e){var t=function(e){if("object"!=LP(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=LP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LP(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return HP(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HP(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $P=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.placeholder,l=t.disabled,u=t.className,c=t.loadOptions,d=t.apiUrl,p=t.apiBaseUrl,f=t.dependsOn,m=t.formData,h=t.customTheme,v=void 0===h?{}:h,y=t.inputProps,g=void 0===y?{}:y,b=t.styleName,A=t.onChange,w=xc(),k=WP((0,e.useState)([]),2),E=k[0],C=k[1],x=WP((0,e.useState)(!1),2),S=x[0],_=x[1],O=WP((0,e.useState)(""),2),I=O[0],T=O[1],P=g["data-item-index"],B=g["data-parent-id"],D=(0,e.useMemo)(function(){var e=w.dynamicDropdownField||w.selectField||{};return ZA(e,v)},[w,v]),j=(0,e.useMemo)(function(){var e=zP(zP({},D.container),{},{width:"100%"}),t=tw(D.select,l&&D.disabled,S&&D.loading,I&&D.error);return{container:ew(e,D.responsive),select:t,placeholder:D.placeholder,loadingIndicator:D.loadingIndicator,errorMessage:D.errorMessage}},[D,l,S,I]);(0,e.useEffect)(function(){var e=function(){var e=VP(NP().m(function e(t,n){var r,o,i;return NP().w(function(e){for(;;)switch(e.n){case 0:return r=p?"".concat(p.replace(/\/$/,""),"/").concat(t.replace(/^\//,"")):t,e.n=1,fetch(r);case 1:if((o=e.v).ok){e.n=2;break}throw new Error("Failed to fetch options");case 2:return e.n=3,o.json();case 3:return i=e.v,e.a(2,i.users.map(function(e){return{value:e.value||e.id,label:e.label||e.name}}))}},e)}));return function(t,n){return e.apply(this,arguments)}}(),t=function(){var t=VP(NP().m(function t(){var n,r,o;return NP().w(function(t){for(;;)switch(t.n){case 0:if(c||d){t.n=1;break}return t.a(2);case 1:if(t.p=1,_(!0),T(""),n=null==f?void 0:f.reduce(function(e,t){return e[t]=m[t],e},{}),!c){t.n=3;break}return t.n=2,c(n);case 2:r=t.v,t.n=5;break;case 3:if(!d){t.n=5;break}return t.n=4,e(d,n);case 4:r=t.v;case 5:C(r||[]),t.n=7;break;case 6:t.p=6,o=t.v,T("Failed to load options"),console.error("Error loading options:",o);case 7:return t.p=7,_(!1),t.f(7);case 8:return t.a(2)}},t,null,[[1,6,7,8]])}));return function(){return t.apply(this,arguments)}}();(!f||f.every(function(e){return m[e]}))&&t()},[c,d,p,f,m]);var R=function(e){A&&(null==A||A(e))};return n().createElement(NE,{name:r,label:o,validation:a,className:"dynamic-dropdown-field ".concat(b||""," ").concat(u||""),customTheme:D,error:I,value:i,renderInput:function(e){var t=e.value,o=e.disabled;return S?n().createElement("div",{style:j.loadingIndicator},"Loading options..."):n().createElement("select",{name:void 0===P?r:"".concat(r,"-").concat(P),value:t||"",onChange:R,disabled:o||S,style:j.select,"data-item-index":P,"data-parent-id":B},s&&n().createElement("option",{value:"",style:j.placeholder},s),E.map(function(e){return n().createElement("option",{key:e.value,value:e.value},e.label)}))}},I&&n().createElement("div",{style:j.errorMessage},I))};function GP(e){return GP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GP(e)}function YP(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(GP(e)+" is not iterable")}function KP(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return XP(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(XP(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,XP(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,XP(d,"constructor",u),XP(u,"constructor",l),l.displayName="GeneratorFunction",XP(u,o,"GeneratorFunction"),XP(d),XP(d,o,"Generator"),XP(d,r,function(){return this}),XP(d,"toString",function(){return"[object Generator]"}),(KP=function(){return{w:i,m:p}})()}function XP(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}XP=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){XP(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},XP(e,t,n,r)}function JP(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function ZP(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){JP(i,r,o,a,s,"next",e)}function s(e){JP(i,r,o,a,s,"throw",e)}a(void 0)})}}function eB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eB(Object(n),!0).forEach(function(t){nB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nB(e,t,n){return(t=function(e){var t=function(e){if("object"!=GP(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=GP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==GP(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}$P.propTypes={name:o().string.isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),validation:o().object,placeholder:o().string,disabled:o().bool,className:o().string,loadOptions:o().func,apiUrl:o().string,apiBaseUrl:o().string,dependsOn:o().arrayOf(o().string),formData:o().object,customTheme:o().object,inputProps:o().object,styleName:o().string,onChange:o().func};var rB=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t){if(t.startsWith("http://")||t.startsWith("https://"))return t;var n=e||"",r=t.startsWith("/")?"":"/";return"".concat(n).concat(r).concat(t)}return e||""},oB=function(e){var t,n={Accept:"application/json"},r=(null==e||null===(t=e.customApi)||void 0===t?void 0:t.headers)||{};r.Authorization&&(n.Authorization=r.Authorization);var o=r["Carrier-Auth"]||r.carrierauthorization||r.Carrierauthorization||r.CarrierAuthorization||r.Carrierauthorization||r.CarrierAuth||r["carrier-authorization"]||null;return o&&(n.carrierauthorization=o,n["Carrier-Auth"]=o,n.CarrierAuthorization=o),n},iB=function(e,t){return e?t:tB({"Content-Type":"application/json"},t)},aB=function(e,t){return e?t:null!=t?JSON.stringify(t):void 0},sB=function(){var e=ZP(KP().m(function e(t){var n;return KP().w(function(e){for(;;)switch(e.n){case 0:if(!(t.headers.get("Content-Type")||"").includes("application/json")){e.n=2;break}return e.n=1,t.json();case 1:n=e.v,e.n=4;break;case 2:return e.n=3,t.text();case 3:n=e.v;case 4:return e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),lB=function(e,t){var n=new Error((null==e?void 0:e.message)||t.statusText);return n.status=t.status,n.data=e,n},uB=function(e,t,n){return(null==e||e>=500||429===e)&&t<n},cB=function(){var e=ZP(KP().m(function e(t){var n,r,o,i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,A,w,k;return KP().w(function(e){for(;;)switch(e.n){case 0:n=t.url,r=t.method,o=void 0===r?"GET":r,i=t.headers,a=void 0===i?{}:i,s=t.body,l=void 0===s?void 0:s,u=t.isFormData,c=void 0!==u&&u,d=t.timeoutMs,p=void 0===d?3e4:d,f=t.apiConfig,m=void 0===f?{}:f,h=Number((null==m?void 0:m.MAX_API_ATTEMPTS)||3),v=tB(tB({},oB(m)),a),y=new AbortController,g=setTimeout(function(){return y.abort()},p),A=KP().m(function e(){var t,r,i,a,s,u,d,p,f;return KP().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,r=iB(c,v),i=aB(c,l),a=(null==m||null===(t=m.customApi)||void 0===t?void 0:t.credentials)||(null==m?void 0:m.credentials)||"omit",e.n=1,fetch(n,{method:o,headers:r,body:i,credentials:a,mode:"cors",signal:y.signal});case 1:return s=e.v,e.n=2,sB(s);case 2:if(u=e.v,!s.ok){e.n=3;break}return clearTimeout(g),e.a(2,{v:u});case 3:throw lB(u,s);case 4:case 6:e.n=8;break;case 5:if(e.p=5,f=e.v,b=f,d=null==f?void 0:f.status,!uB(d,k,h)){e.n=7;break}return p=300*Math.pow(2,k-1),e.n=6,new Promise(function(e){return setTimeout(e,p)});case 7:return e.a(2,0);case 8:return e.a(2)}},e,null,[[0,5]])}),k=1;case 1:if(!(k<=h)){e.n=5;break}return e.d(YP(A()),2);case 2:if(0!==(w=e.v)){e.n=3;break}return e.a(3,5);case 3:if(!w){e.n=4;break}return e.a(2,w.v);case 4:k++,e.n=1;break;case 5:throw b||new Error("Request failed");case 6:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),dB=function(){var e=ZP(KP().m(function e(t){var n,r,o,i,a,s,l,u=arguments;return KP().w(function(e){for(;;)if(0===e.n)return o=u.length>1&&void 0!==u[1]?u[1]:{},(i=new FormData).append("file",t),a=(null==o||null===(n=o.customApi)||void 0===n?void 0:n.baseUrl)||"",s=(null==o||null===(r=o.customApi)||void 0===r?void 0:r.convertToPdfUrl)||"",l=rB(a,s),e.a(2,cB({url:l,method:"POST",body:i,isFormData:!0,apiConfig:o}))},e)}));return function(t){return e.apply(this,arguments)}}(),pB=function(){var e=ZP(KP().m(function e(t,n){var r,o,i,a,s,l,u=arguments;return KP().w(function(e){for(;;)if(0===e.n)return a=(null==(i=u.length>2&&void 0!==u[2]?u[2]:{})||null===(r=i.customApi)||void 0===r?void 0:r.baseUrl)||"",s=(null==i||null===(o=i.customApi)||void 0===o?void 0:o.uploadUrl)||"",l="".concat(rB(a,s),"?caseId=").concat(encodeURIComponent(n||""),"&user=agent"),e.a(2,cB({url:l,method:"POST",body:t,apiConfig:i}))},e)}));return function(t,n){return e.apply(this,arguments)}}(),fB=function(){var e=ZP(KP().m(function e(t,n,r){var o,i,a,s,l,u,c=arguments;return KP().w(function(e){for(;;)if(0===e.n)return s=(null==(a=c.length>3&&void 0!==c[3]?c[3]:{})||null===(o=a.customApi)||void 0===o?void 0:o.baseUrl)||"",l=(null==a||null===(i=a.customApi)||void 0===i?void 0:i.deleteUrl)||"",u="".concat(rB(s,l),"?caseId=").concat(encodeURIComponent(n||""),"&documentId=").concat(encodeURIComponent(t||""),"&questionId=").concat(encodeURIComponent(r||"")),e.a(2,cB({url:u,method:"DELETE",apiConfig:a}))},e)}));return function(t,n,r){return e.apply(this,arguments)}}();function mB(e){return mB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mB(e)}function hB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hB(Object(n),!0).forEach(function(t){yB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yB(e,t,n){return(t=function(e){var t=function(e){if("object"!=mB(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gB=function(e){var t,r,o,i,a,s=e.file,l=e.index,u=e.fileStyles,c=e.includeExtraDropDowns,d=e.uploadQuestionAdditionalDropDown,p=e.allowDelete,f=e.disabled,m=e.fieldError,h=e.onDocumentTypeChange,v=e.onView,y=e.onDelete,g=s.fileName||s.name||"",b=(null==d||null===(t=d[0])||void 0===t?void 0:t.title)||(null==d||null===(r=d[0])||void 0===r?void 0:r.label)||"Attachment Type",A=null!==(o=null==d||null===(i=d[0])||void 0===i?void 0:i.options)&&void 0!==o?o:[],w=void 0===s.dropDownOptionSelection||null===s.dropDownOptionSelection||""===String(s.dropDownOptionSelection||"").trim();return n().createElement("tr",null,n().createElement("td",{style:vB(vB({},u.tableCell),u.documentNameCell),title:g},g),c&&(null==d?void 0:d.length)>0&&n().createElement("td",{style:vB(vB({},u.tableCell),u.documentTypeCell)},n().createElement("select",{value:null!==(a=s.dropDownOptionSelection)&&void 0!==a?a:"",onChange:function(e){return h(l,e.target.value)},disabled:f,style:u.documentTypeSelect,"aria-label":"Document type for ".concat(g||"file")},n().createElement("option",{value:"",disabled:!0},"Select Attachment"),A.map(function(e){var t="object"===mB(e)&&null!==e?e.value:e,r="object"===mB(e)&&null!==e?e.label:e;return n().createElement("option",{key:null!=t?t:r,value:null!=t?t:r},null!=r?r:t)})),w&&n().createElement("span",{style:u.errorItem},m?Array.isArray(m)?m[0]:"string"==typeof m&&m.split(", ").filter(Boolean)[0]||m:"Provide ".concat(b.toLowerCase()))),n().createElement("td",{style:u.tableCell},s.fileType||(s.fileName?s.fileName.split(".").pop().toUpperCase():"")),n().createElement("td",{style:u.tableCell},null!=s.fileSize?Cs(ks(s.fileSize)):"0 Bytes"),n().createElement("td",{style:u.tableCell},n().createElement("div",{style:u.actionButtonGroup},n().createElement("button",{type:"button",onClick:function(){return v(s)},style:vB(vB({},u.actionButton),u.viewButton),"aria-label":"Preview ".concat(g||"document")},"View"),p&&n().createElement("button",{type:"button",onClick:function(){return y(l)},style:vB(vB({},u.actionButton),u.removeButton),"aria-label":"Delete ".concat(g||"document")},"Delete"))))};gB.propTypes={file:o().shape({id:o().oneOfType([o().string,o().number]),value:o().string,fileName:o().string,name:o().string,fileType:o().string,fileSize:o().oneOfType([o().number,o().string]),dropDownOptionSelection:o().string}).isRequired,index:o().number.isRequired,fileStyles:o().object.isRequired,includeExtraDropDowns:o().bool.isRequired,uploadQuestionAdditionalDropDown:o().array,allowDelete:o().bool.isRequired,disabled:o().bool.isRequired,fieldError:o().oneOfType([o().string,o().arrayOf(o().string),o().oneOf([null])]),onDocumentTypeChange:o().func.isRequired,onView:o().func.isRequired,onDelete:o().func.isRequired};const bB=gB;function AB(e){return AB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AB(e)}function wB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wB(Object(n),!0).forEach(function(t){EB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function EB(e,t,n){return(t=function(e){var t=function(e){if("object"!=AB(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=AB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==AB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CB(e){return CB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CB(e)}function xB(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=IB(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function SB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return _B(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(_B(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_B(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,_B(d,"constructor",u),_B(u,"constructor",l),l.displayName="GeneratorFunction",_B(u,o,"GeneratorFunction"),_B(d),_B(d,o,"Generator"),_B(d,r,function(){return this}),_B(d,"toString",function(){return"[object Generator]"}),(SB=function(){return{w:i,m:p}})()}function _B(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}_B=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){_B(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},_B(e,t,n,r)}function OB(e){return function(e){if(Array.isArray(e))return TB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||IB(e)||function(){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 IB(e,t){if(e){if("string"==typeof e)return TB(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TB(e,t):void 0}}function TB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function PB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PB(Object(n),!0).forEach(function(t){DB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DB(e,t,n){return(t=function(e){var t=function(e){if("object"!=CB(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=CB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==CB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jB(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function RB(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){jB(i,r,o,a,s,"next",e)}function s(e){jB(i,r,o,a,s,"throw",e)}a(void 0)})}}function MB(e){return((null==e?void 0:e.name)||"").toLowerCase().endsWith(".pdf")||"application/pdf"===((null==e?void 0:e.type)||"").toLowerCase()}function LB(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){var e=r.result||"",n=e.includes(",")?e.slice(e.indexOf(",")+1):e;t(n)},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)})}function NB(e,t){return FB.apply(this,arguments)}function FB(){return(FB=RB(SB().m(function e(t,n){var r,o,i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,A,w,k,E,C,x,S,_,O,I,T,P;return SB().w(function(e){for(;;)switch(e.n){case 0:if(s=n.questionId,l=n.apiConfig,u=n.uploadQuestionAdditionalDropDown,c=void 0===u?[]:u,d=n.currentFiles,p=void 0===d?[]:d,f={dropDownTitle:(null==c||null===(r=c[0])||void 0===r?void 0:r.label)||(null==c||null===(o=c[0])||void 0===o?void 0:o.title)||"Attachment Type",dropDownOptionSelection:""},!MB(t)){e.n=2;break}return e.n=1,LB(t);case 1:v=e.v,m={questionId:s,fileUploads:BB({fileName:t.name||"document.pdf",base64Response:"data:application/pdf;base64,".concat(v),fileSize:t.size,fileType:"pdf"},f)},h=BB({id:void 0,value:void 0,fileName:t.name||"document.pdf",base64Response:m.fileUploads.base64Response,fileType:"pdf",fileSize:t.size},f),e.n=4;break;case 2:return e.n=3,dB(t,l);case 3:k=e.v,E=null==k||null===(y=k.data)||void 0===y?void 0:y.fileData,C=(null==k||null===(g=k.data)||void 0===g?void 0:g.fileName)||(null==t?void 0:t.name)||"document.pdf",x=null!==(b=null!==(A=null==k||null===(w=k.data)||void 0===w?void 0:w.fileSize)&&void 0!==A?A:null==t?void 0:t.size)&&void 0!==b?b:0,m={questionId:s,fileUploads:BB({fileName:C,base64Response:"data:application/pdf;base64,".concat(E),fileSize:x,fileType:"pdf"},f)},h=BB({id:void 0,value:void 0,fileName:m.fileUploads.fileName,base64Response:m.fileUploads.base64Response,fileType:"pdf",fileSize:x},f);case 4:return S=[].concat(OB(p),[h]),_=(null==l||null===(i=l.customApi)||void 0===i||null===(i=i.headers)||void 0===i?void 0:i.caseId)||(null==l?void 0:l.caseId),e.n=5,pB(m,_,l);case 5:return O=e.v,I=(null==O?void 0:O.data)||{},T=OB(S),P=T.length-1,T[P]=BB(BB({},T[P]),{},{id:I.id,value:I.value,fileName:I.actualFileName||T[P].fileName,fileType:I.fileType||"pdf",fileSize:null!==(a=I.fileSize)&&void 0!==a?a:T[P].fileSize,base64Response:null}),e.a(2,T)}},e)}))).apply(this,arguments)}function qB(e){return VB.apply(this,arguments)}function VB(){return(VB=RB(SB().m(function e(t){var n,r,o,i,a;return SB().w(function(e){for(;;)if(0===e.n){n=[],r=xB(t);try{for(r.s();!(o=r.n()).done;){i=o.value;try{(i instanceof File?i.type:i.type||"").startsWith("image/")||(i.fileName||"").match(Ee)?i instanceof File?(a=URL.createObjectURL(i),n.push(a)):i.base64Response?n.push(i.base64Response):n.push(null):n.push(null)}catch(e){console.error("Preview generation error:",e),n.push(null)}}}catch(e){r.e(e)}finally{r.f()}return e.a(2,n)}},e)}))).apply(this,arguments)}var QB=a("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/FileField.scss"),zB={};function UB(e){return UB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UB(e)}zB.styleTagTransform=nl(),zB.setAttributes=Js(),zB.insert=Ks().bind(null,"head"),zB.domAPI=Gs(),zB.insertStyleElement=el(),Hs()(QB.A,zB),QB.A&&QB.A.locals&&QB.A.locals;var WB=["questionId","label","value","validation","multiple","disabled","className","maxFileSize","maxFiles","showPreview","allowDelete","onError","customTheme","styleName","includeExtraDropDowns","uploadQuestionAdditionalDropDown","allowedFileType","fileSizeLimit","numberOfFiles","errorMessage","apiConfig","fileUploads"];function HB(){return HB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HB.apply(null,arguments)}function $B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$B(Object(n),!0).forEach(function(t){YB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YB(e,t,n){return(t=function(e){var t=function(e){if("object"!=UB(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=UB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KB(e){return function(e){if(Array.isArray(e))return rD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nD(e)||function(){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 XB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return JB(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(JB(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,JB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,JB(d,"constructor",u),JB(u,"constructor",l),l.displayName="GeneratorFunction",JB(u,o,"GeneratorFunction"),JB(d),JB(d,o,"Generator"),JB(d,r,function(){return this}),JB(d,"toString",function(){return"[object Generator]"}),(XB=function(){return{w:i,m:p}})()}function JB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}JB=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){JB(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},JB(e,t,n,r)}function ZB(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function eD(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ZB(i,r,o,a,s,"next",e)}function s(e){ZB(i,r,o,a,s,"throw",e)}a(void 0)})}}function tD(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||nD(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nD(e,t){if(e){if("string"==typeof e)return rD(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rD(e,t):void 0}}function rD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var oD=function(t){var r,o=t.questionId,i=t.label,a=t.value,s=void 0===a?null:a,l=t.validation,u=void 0===l?{}:l,c=t.multiple,d=void 0!==c&&c,p=t.disabled,f=void 0!==p&&p,m=t.className,h=void 0===m?"":m,v=t.maxFileSize,y=void 0===v?5242880:v,g=t.maxFiles,b=void 0===g?5:g,A=t.showPreview,w=void 0===A||A,k=t.allowDelete,E=void 0===k||k,C=t.onError,x=t.customTheme,S=void 0===x?{}:x,_=t.styleName,O=t.includeExtraDropDowns,I=void 0!==O&&O,T=t.uploadQuestionAdditionalDropDown,P=void 0===T?[]:T,B=t.allowedFileType,D=t.fileSizeLimit,j=t.numberOfFiles,R=(t.errorMessage,t.apiConfig),M=t.fileUploads,L=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,WB),N=cc(),F=N.state,q=N.setValue,V=xc(),Q=(0,e.useRef)(null),z=tD((0,e.useState)(M||[]),2),U=z[0],W=z[1],H=tD((0,e.useState)([]),2),$=H[0],G=H[1],Y=tD((0,e.useState)([]),2),K=Y[0],X=Y[1],J=tD((0,e.useState)(!1),2),Z=J[0],ee=J[1],te=tD((0,e.useState)(!1),2),ne=te[0],re=te[1],oe=tD((0,e.useState)(function(){var e=M;return null!=e&&e.length?null==e?void 0:e.map(function(){var e;return(null===(e=P[0])||void 0===e||null===(e=e.options[0])||void 0===e?void 0:e.value)||""}):[]}),2),ie=oe[0],ae=oe[1],se=(null==F||null===(r=F.errors)||void 0===r?void 0:r[o])||null,le=(0,e.useMemo)(function(){var e=V.fileField||{};return ZA(e,S)},[V,S]),ue=(0,e.useMemo)(function(){return function(e,t,n){var r=kB(kB({},e.container),{},{width:"100%"}),o=kB(kB({},tw(e.dropzone,t&&e.dropzoneActive,n&&e.dropzoneDisabled)),{},{borderWidth:"1px",borderStyle:"solid",borderColor:t?"#2563EB":n?"#D1D5DB":"#9CA3AF"});return{container:ew(r,e.responsive),dropzone:o,input:e.input,previewContainer:e.previewContainer,previewItem:e.previewItem,previewImage:e.previewImage,previewIcon:e.previewIcon,deleteBtn:e.deleteButton,error:e.error,errorList:e.errorList,errorItem:e.errorItem,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse",marginTop:"20px"},tableHeader:{backgroundColor:"#f5f5f5",padding:"12px",textAlign:"left",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"#ddd"},tableCell:{padding:"12px",verticalAlign:"middle",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"#ddd"},documentNameHeader:{width:"35%"},documentNameCell:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},documentTypeHeader:{width:"28%"},documentTypeCell:{minWidth:"180px"},documentTypeSelect:{width:"100%",minWidth:"160px",maxWidth:"100%",boxSizing:"border-box"},actionButtonGroup:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},actionButton:{padding:"6px 12px",marginRight:"0",borderWidth:"0",borderRadius:"4px",cursor:"pointer"},viewButton:{backgroundColor:"#4CAF50",color:"white"},removeButton:{backgroundColor:"#f44336",color:"white"},uploadOverlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.85)",borderRadius:"4px",zIndex:10,gap:"12px"},uploadSpinner:{width:"32px",height:"32px",border:"3px solid #e9ecef",borderTopColor:"#2563EB",borderRadius:"50%"},uploadLabel:{fontSize:"14px",color:"#374151",fontWeight:500}}}(le,Z,f)},[le,Z,f]);(0,e.useEffect)(function(){try{var e,t,n=(null==P||null===(e=P[0])||void 0===e?void 0:e.label)||(null==P||null===(t=P[0])||void 0===t?void 0:t.title)||"Attachment Type",r=ws({value:s,fileUploads:M,dropdownTitle:n});Array.isArray(r)&&r.length>0&&(W(r),qB(r).then(G))}catch(e){console.error("Error initializing file field:",e)}},[]);var ce=GA({questionId:o,defaultValue:s,defaultVisible:!0,defaultDisabled:f}).handleChange,de=(0,e.useCallback)(function(e){e._contextValue;var t=e.onChange,r=e.disabled,i=function(){var e=eD(XB().m(function e(t){var n;return XB().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),t.stopPropagation(),!r){e.n=1;break}return e.a(2);case 1:return ee(!1),n=Array.from(t.dataTransfer.files),e.n=2,l(n);case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),a=function(){var e=eD(XB().m(function e(t){var n;return XB().w(function(e){for(;;)switch(e.n){case 0:if(!r){e.n=1;break}return e.a(2);case 1:return n=Array.from(t.target.files),e.n=2,l(n);case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),s=function(){var e=eD(XB().m(function e(n){var i,a,s,l,u,c;return XB().w(function(e){for(;;)switch(e.n){case 0:if(!r){e.n=1;break}return e.a(2);case 1:if(i=U[n],e.p=2,null==i||!i.id){e.n=3;break}return s=(null==R||null===(a=R.customApi)||void 0===a||null===(a=a.headers)||void 0===a?void 0:a.caseId)||(null==R?void 0:R.caseId),e.n=3,fB(i.id,s,o,R);case 3:e.n=5;break;case 4:e.p=4,c=e.v,console.warn("Failed to delete document from server, removing locally:",c);case 5:l=U.filter(function(e,t){return t!==n}),u=$.filter(function(e,t){return t!==n}),W(l),G(u),t({value:l,fileUploads:l}),q(o,l);case 6:return e.a(2)}},e,null,[[2,4]])}));return function(t){return e.apply(this,arguments)}}(),l=function(){var e=eD(XB().m(function e(n){var r,i,a,s,l,u;return XB().w(function(e){for(;;)switch(e.n){case 0:if(n.length){e.n=1;break}return e.a(2);case 1:if(r=KB(U),i=n[0],a=Es([i],{allowedFileType:B,fileSizeLimit:D,numberOfFiles:j},r,null),!(s=a.error)){e.n=2;break}return X([]),il(s,"error"),null==C||C(s),e.a(2);case 2:return re(!0),e.p=3,e.n=4,NB(i,{questionId:o,apiConfig:R,uploadQuestionAdditionalDropDown:P,currentFiles:r});case 4:l=e.v,W(l),t({value:l,fileUploads:l}),q(o,l),qB(l).then(G),e.n=6;break;case 5:e.p=5,u=e.v,console.error("Upload error:",u),il((null==u?void 0:u.message)||"Upload failed","error"),null==C||C((null==u?void 0:u.message)||"Upload failed");case 6:return e.p=6,re(!1),e.f(6);case 7:return e.a(2)}},e,null,[[3,5,6,7]])}));return function(t){return e.apply(this,arguments)}}(),u=function(e,n){var r=KB(U);r[e]=GB(GB({},r[e]),{},{dropDownOptionSelection:n}),t({value:r.map(function(e){return{fileName:e.fileName,base64Response:e.base64Response,fileSize:e.fileSize,fileType:e.fileType,dropDownTitle:e.dropDownTitle,dropDownOptionSelection:e.dropDownOptionSelection}}),fileUploads:r}),q(o,r),ce(r),W(r)},c=function(e){return function(e,t){var n,r=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null==t||null===(e=t.customApi)||void 0===e?void 0:e.s3BucketUrl)||""}(t);if(null!=e&&e.value&&r)null===(n=ml.open)||void 0===n||n.call(ml,"".concat(r,"/").concat(e.value),"_blank");else if(null!=e&&e.base64Response){var o=ml.open?ml.open():null;o&&(o.document.write('\n <!DOCTYPE html>\n <html>\n <head>\n <title>Preview</title>\n <style>\n body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; }\n iframe { width: 100%; height: 100%; border: none; }\n </style>\n </head>\n <body>\n <iframe src="'.concat(e.base64Response,'"></iframe>\n </body>\n </html>\n ')),o.document.close())}}(e,R)},d=!j||!Array.isArray(U)||U.length<j,p=B?B.split(",").map(function(e){return e.trim().startsWith(".")?e.trim().toLowerCase():".".concat(e.trim().toLowerCase())}).join(","):void 0;return n().createElement("section",{onDragOver:function(e){e.preventDefault(),e.stopPropagation(),r||ee(!0)},onDragLeave:function(e){e.preventDefault(),e.stopPropagation(),ee(!1)},onDrop:i,style:ue.container,"aria-label":"File upload area"},d&&n().createElement("div",{style:{position:"relative",minHeight:"100px"}},n().createElement("input",{ref:Q,type:"file",accept:p,multiple:!1,onChange:a,disabled:r||ne,style:ue.input}),n().createElement("button",{type:"button",style:GB(GB({},ue.dropzone),{},{cursor:r||ne?"not-allowed":"pointer",width:"100%",textAlign:"left"}),onClick:function(){Q.current&&!r&&Q.current.click()},"aria-label":"Click to upload or drag and drop a file",disabled:r||ne,"aria-disabled":r||ne},n().createElement("p",null,"Click to Upload or Drag and Drop"),n().createElement("p",null,"Allowed file types: ",(B||"").toUpperCase())),ne&&n().createElement("div",{style:ue.uploadOverlay,role:"status","aria-live":"polite"},n().createElement("div",{className:"file-field-upload-spinner",style:ue.uploadSpinner}),n().createElement("span",{style:ue.uploadLabel},"Uploading..."))),U.length>0&&n().createElement("table",{style:ue.table},n().createElement("thead",null,n().createElement("tr",null,n().createElement("th",{style:GB(GB({},ue.tableHeader),ue.documentNameHeader)},"Document Name"),I&&P.length>0&&n().createElement("th",{style:GB(GB({},ue.tableHeader),ue.documentTypeHeader)},"Document Type"),n().createElement("th",{style:ue.tableHeader},"File Type"),n().createElement("th",{style:ue.tableHeader},"Size"),n().createElement("th",{style:ue.tableHeader},"Action"))),n().createElement("tbody",null,U.map(function(e,t){var o,i;return n().createElement(bB,{key:null!==(o=null!==(i=e.id)&&void 0!==i?i:e.value)&&void 0!==o?o:"file-".concat(t),file:e,index:t,fileStyles:ue,includeExtraDropDowns:I,uploadQuestionAdditionalDropDown:P,allowDelete:E,disabled:r,fieldError:se,onDocumentTypeChange:u,onView:c,onDelete:s})}))),K.length>0&&n().createElement("ul",{style:ue.errorList},K.map(function(e,t){return n().createElement("li",{key:"error-".concat(e,"-").concat(t),style:ue.errorItem},e)})))},[U,$,K,Z,ne,ie,ae,d,b,y,w,C]);return n().createElement(FE,HB({label:i,value:s,validation:u,disabled:f,className:h,renderInput:de,styleName:_,customTheme:S},L,{name:o}))},iD=n().memo(oD);oD.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().array,o().object,o().string,o().oneOf([null])]),validation:o().object,multiple:o().bool,disabled:o().bool,className:o().string,maxFileSize:o().number,maxFiles:o().number,showPreview:o().bool,allowDelete:o().bool,onError:o().func,customTheme:o().object,styleName:o().string,includeExtraDropDowns:o().bool,uploadQuestionAdditionalDropDown:o().arrayOf(o().shape({options:o().array})),allowedFileType:o().string,fileSizeLimit:o().number,numberOfFiles:o().number,errorMessage:o().string,apiConfig:o().shape({caseId:o().string,customApi:o().shape({headers:o().shape({caseId:o().string})})}),fileUploads:o().oneOfType([o().arrayOf(o().shape({id:o().oneOfType([o().string,o().number]),value:o().string,fileName:o().string,fileType:o().string,fileSize:o().oneOfType([o().number,o().string]),base64Response:o().string,dropDownTitle:o().string,dropDownOptionSelection:o().string})),o().oneOf([null])])},iD.propTypes=oD.propTypes;const aD=iD;var sD=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/HyperlinkField.css"),lD={};lD.styleTagTransform=nl(),lD.setAttributes=Js(),lD.insert=Ks().bind(null,"head"),lD.domAPI=Gs(),lD.insertStyleElement=el(),Hs()(sD.A,lD),sD.A&&sD.A.locals&&sD.A.locals;var uD=function(e){var t=e.name,r=e.label,o=e.value,i=e.validation,a=e.className,s=e.customTheme,l=void 0===s?{}:s,u=e.tooltip,c=void 0===u?"":u,d=xc(),p=ZA(d.hyperlinkField||{},l);return n().createElement(NE,{name:String(t),label:r,value:o,validation:i,className:"hyperlink-field ".concat(a||""),customTheme:p,renderLabel:function(e){var t=e.label,r=e.isRequired;return n().createElement("div",{style:p.container},n().createElement("div",{style:p.label,dangerouslySetInnerHTML:{__html:Qx.sanitize(t,{ADD_ATTR:["target","rel"],ALLOWED_TAGS:["a","p","br","span","strong","em"],ALLOWED_ATTR:["href","target","rel"]})}}),r&&n().createElement("span",{style:p.required},"*"),c&&n().createElement(gE,{tooltip:c}))},renderInput:function(){return null}})};uD.displayName="HyperlinkField",uD.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,validation:o().object,className:o().string,customTheme:o().object,tooltip:o().string};var cD=n().memo(uD);function dD(e){return dD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dD(e)}function pD(){return pD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pD.apply(null,arguments)}function fD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fD(Object(n),!0).forEach(function(t){hD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hD(e,t,n){return(t=function(e){var t=function(e){if("object"!=dD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=dD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}cD.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,target:o().string,validation:o().object,disabled:o().bool,className:o().string,customTheme:o().object,tooltip:o().string};var yD=function(e){if(e){var t=e.replace(/\D/g,"");return 9!==t.length?"SSN must be 9 digits":De.test(t)?"":"Invalid SSN format"}return""},gD=function(e){if(e){var t=e.replace(/\D/g,"");return 9!==t.length?"ITIN must be 9 digits":je.test(t)?"":"ITIN must start with 9"}return""},bD=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.type,l=void 0===s?"ssn":s,u=t.masked,c=void 0===u||u,d=t.disabled,p=t.className,f=t.customTheme,m=void 0===f?{}:f,h=xc(),v=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return vD(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vD(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(c),2),y=v[0],g=v[1],b=ZA(h.identificationField||{},m),A=function(){g(!y)},w=function(e){if(!e||!y)return e;var t=e.split("-");return 3===t.length?"XXX-XX-".concat(t[2]):"XXX-XX-"+e.slice(-4)};return n().createElement(NE,{name:r,label:o,value:i,validation:mD(mD({},a),{},{custom:"ssn"===l?yD:gD}),className:"identification-field ".concat(p||""),customTheme:b,renderInput:function(e){return n().createElement("div",{style:b.container},n().createElement("div",{style:b.fieldGroup},n().createElement("div",{style:b.row},n().createElement("div",{style:b.field},n().createElement("input",pD({},e,{type:"text",maxLength:11,disabled:d,style:mD(mD({},b.input),d&&b.disabled),value:w(e.value),onChange:function(t){return function(e,t){t(function(e){if(e){var t=e.replace(ne,""),n=t.match(Be);return n?"".concat(n[1],"-").concat(n[2],"-").concat(n[3]):t}return""}(e.target.value))}(t,e.onChange)}})),i&&n().createElement("button",{type:"button",onClick:A,style:mD(mD({},b.actionButton),{},{marginLeft:"8px"}),disabled:d},y?"Show":"Hide"))),n().createElement("div",{style:b.hint},"ssn"===l?"Format: XXX-XX-XXXX":"Format: 9XX-XX-XXXX")))}})};bD.propTypes={name:o().string.isRequired,label:o().string,value:o().string,validation:o().object,type:o().oneOf(["ssn","itin"]),masked:o().bool,disabled:o().bool,className:o().string,customTheme:o().object};var AD=function(e,t){if(t)return"text";switch(null==e?void 0:e.toLowerCase()){case"ssn":case"itin":case"tin":case"currency":case"percentage":default:return"text";case"phonenumber":case"phone":case"mobile":return"tel";case"number":return"number"}};function wD(e){return wD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wD(e)}var kD=["questionId","questionType","maskInput","maskingType","maskingLength","minLength","maxLength","value","onChange","type"];function ED(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ED(Object(n),!0).forEach(function(t){xD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ED(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xD(e,t,n){return(t=function(e){var t=function(e){if("object"!=wD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=wD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SD(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _D(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var OD=function(t){var r=t.questionId,o=t.questionType,i=void 0===o?"number":o,a=t.maskInput,s=t.maskingType,l=t.maskingLength,u=t.minLength,c=t.maxLength,d=t.value,p=t.onChange,f=t.type,m=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,kD),h=cc().setValue,v=(0,e.useMemo)(function(){var e=a?vs(a):c||0;return{maskInput:a||null,maskingType:s||null,maskingLength:l||0,minLength:u||0,maxLength:e}},[a,s,l,u,c]),y=SD((0,e.useState)(!1),2),g=y[0],b=y[1],A=SD((0,e.useState)({original:"",masked:""}),2),w=A[0],k=A[1],E=(0,e.useRef)(null),C=(0,e.useMemo)(function(){return v.maskingType&&v.maskingLength?g?w.original:w.masked:w.original||d},[w,g,v,d]);(0,e.useEffect)(function(){if(d||w.original||w.masked){var e=d||"";if(v.maskingType&&v.maskingLength){var t=gs(e,{maskInput:v.maskInput,maskingType:v.maskingType,maskingLength:v.maskingLength,questionType:i});k(t),Ze(r,h,t.original,e,E,m)}else if(v.maskInput){var n=ys(e,v.maskInput,i);k({original:n,masked:n}),Ze(r,h,n,e,E,m)}else k({original:e,masked:e})}},[d,v,i]);var x=(0,e.useMemo)(function(){return"numeric"},[]),S=(0,e.useMemo)(function(){return function(e){return["ssn","itin","phonenumber","currency","number","percentage","phone","tel","mobile","tin"].includes(null==e?void 0:e.toLowerCase())?"[0-9]*":void 0}(i)},[i]),_=CD(CD({questionId:r},m),{},{type:v.maskInput?"text":AD(f||i,v.maskingType),value:C,onChange:function(e){var t,n,r,o=function(e,t,n,r,o,i,a){if(r.maskingType&&r.maskingLength&&!o){var s=ls((null==i?void 0:i.original)||"",a,r.maskInput)||"";return"insertText"===t&&n?"".concat(s).concat(n):"deleteContentBackward"===t||"deleteContentForward"===t?s.slice(0,Math.max(0,s.length-1)):ls(e,a,r.maskInput)}return ls(e,a,r.maskInput)}((null===(t=e.target.value)||void 0===t?void 0:t.toString())||"",(null==e||null===(n=e.nativeEvent)||void 0===n?void 0:n.inputType)||"",((null==e||null===(r=e.nativeEvent)||void 0===r?void 0:r.data)||"").replace(ne,""),v,g,w,i);o=function(e,t){if("percentage"!==t)return e;var n=e.replace(re,""),r=Number.parseFloat(n);return Number.isNaN(r)||r<=100?n:"100"}(o,i);var a=(o||"").replace(ne,"").length;v.maxLength&&a>v.maxLength||function(e,t,n,r){if(n.maskingType&&n.maskingLength){var o=gs(t,{maskInput:n.maskInput,maskingType:n.maskingType,maskingLength:n.maskingLength,questionType:r});k(o),p&&p(CD(CD({},e),{},{target:CD(CD({},e.target),{},{value:o.original})}))}else if(n.maskInput){var i=ys(t,n.maskInput,r);k({original:i,masked:i}),p&&p(CD(CD({},e),{},{target:CD(CD({},e.target),{},{value:i})}))}else k({original:t,masked:t}),p&&p(CD(CD({},e),{},{target:CD(CD({},e.target),{},{value:t})}))}(e,o,v,i)},maskInput:null,inputMode:x,inputProps:CD(CD({},m.inputProps),{},{maxLength:c,pattern:S,inputMode:x}),minLength:u,maxLength:a?a.length:c});v.maskingType&&(_._maskingType=v.maskingType),v.maskingLength&&(_._maskingLength=v.maskingLength);var O=Boolean(v.maskingType&&v.maskingLength),I=g?"Hide":"Show",T=g?n().createElement(EP,null):n().createElement(bP,null);return n().createElement("div",{style:{position:"relative",display:"inline-block",width:"100%"}},n().createElement(CE,_),O&&n().createElement("button",{type:"button",name:"passwordEye",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-eye-icon",onClick:function(){return b(function(e){return!e})},title:"".concat(I," value"),"aria-label":"".concat(I," sensitive information"),style:{position:"absolute",right:"12px",top:"40%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#666",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1}},T))};OD.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,questionType:o().oneOf(["ssn","itin","phonenumber","currency","number","percentage","phone","tel","mobile","tin"]),value:o().oneOfType([o().string,o().number]),maskInput:o().string,maskingType:o().oneOfType([o().oneOf(["prefix","suffix"]),o().oneOf([null,void 0])]),maskingLength:o().oneOfType([o().number,o().oneOf([null])]),minLength:o().number,maxLength:o().number,onChange:o().func,type:o().string,validation:o().object,required:o().bool,placeholder:o().string,helperText:o().string,disabled:o().bool,inputProps:o().object,tooltip:o().string};const ID=OD;var TD=a("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/PasswordField.scss"),PD={};function BD(e){return BD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BD(e)}PD.styleTagTransform=nl(),PD.setAttributes=Js(),PD.insert=Ks().bind(null,"head"),PD.domAPI=Gs(),PD.insertStyleElement=el(),Hs()(TD.A,PD),TD.A&&TD.A.locals&&TD.A.locals;var DD=["name","label","required","disabled","defaultValue","placeholder","showPasswordStrength","showPasswordRequirements","passwordRequirements","validationErrorMessages","onChange","error","type","customTheme","styleName","tooltip"];function jD(){return jD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jD.apply(null,arguments)}function RD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RD(Object(n),!0).forEach(function(t){LD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LD(e,t,n){return(t=function(e){var t=function(e){if("object"!=BD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=BD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==BD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ND(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return FD(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FD(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function FD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var qD=function(t){var r=t.name,o=t.label,i=t.required,a=t.disabled,s=t.defaultValue,l=void 0===s?"":s,u=t.placeholder,c=t.showPasswordStrength,d=void 0!==c&&c,p=t.showPasswordRequirements,f=void 0!==p&&p,m=t.passwordRequirements,h=void 0===m?["At least 8 characters","At least one uppercase letter","At least one lowercase letter","At least one number","At least one special character"]:m,v=t.validationErrorMessages,y=t.onChange,g=t.error,b=t.type,A=void 0===b?"password":b,w=t.customTheme,k=void 0===w?{}:w,E=t.styleName,C=t.tooltip,x=void 0===C?"":C,S=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,DD),_=xc(),O=ND((0,e.useState)(!1),2),I=O[0],T=O[1],P=ND((0,e.useState)(l),2),B=P[0],D=P[1],j=ND((0,e.useState)(0),2),R=j[0],M=j[1],L=(0,e.useMemo)(function(){var e=_.passwordField||_.textField||{};return ZA(e,k)},[_,k]),N=(0,e.useMemo)(function(){var e=MD(MD({},L.container),{},{width:"100%"});return{container:ew(e,L.responsive),input:tw(L.input,g&&L.error,a&&L.disabled),strengthBar:L.strengthBar||{},strengthLabel:L.strengthLabel||{},requirements:L.requirements||{},requirementMet:L.requirementMet||{},toggleButton:L.toggleButton||{}}},[L,g,a]),F=function(e){var t,n,o=e.target.value;if(D(o),d){var i=(n=0,(t=o).length>=8&&(n+=20),t.length>=12&&(n+=10),/[A-Z]/.test(t)&&(n+=20),/[a-z]/.test(t)&&(n+=20),/\d/.test(t)&&(n+=20),/[^A-Za-z0-9]/.test(t)&&(n+=20),n);M(i)}y&&y({target:{name:r,value:o}})},q=function(e){e.preventDefault(),T(!I)};return n().createElement(FE,{name:String(r),label:o,value:B,required:i,validationErrorMessages:v,error:g,customTheme:L,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:L.label||{}},t,r&&n().createElement("span",{style:L.required||{}},"*"),x&&n().createElement(gE,{tooltip:x})):null},renderInput:function(){return n().createElement("div",{className:"password-field-container ".concat(E||""),style:N.container},n().createElement("div",{className:"password-input-wrapper"},n().createElement("input",jD({type:I?"text":A,id:String(r),name:String(r),value:B,onChange:F,disabled:a,placeholder:u,className:"password-input",style:N.input},S.inputProps)),n().createElement("button",{type:"button",className:"toggle-password-button",onClick:q,tabIndex:"-1","aria-label":I?"Hide password":"Show password",style:N.toggleButton},I?"👁️":"🔒")),d&&B&&n().createElement("div",{className:"password-strength"},n().createElement("div",{className:"strength-bar-container"},n().createElement("div",{className:"strength-bar",style:MD(MD({},N.strengthBar),{},{width:"".concat(R,"%"),backgroundColor:VD(R)})})),n().createElement("span",{className:"strength-label",style:MD(MD({},N.strengthLabel),{},{color:VD(R)})},(e=R)>=90?"Very Strong":e>=70?"Strong":e>=40?"Medium":e>=20?"Weak":"Very Weak")),f&&n().createElement("ul",{className:"password-requirements",style:N.requirements},h.map(function(e,t){var r=function(e){switch(e){case"At least 8 characters":return B.length>=8;case"At least one uppercase letter":return/[A-Z]/.test(B);case"At least one lowercase letter":return/[a-z]/.test(B);case"At least one number":return/\d/.test(B);case"At least one special character":return/[^A-Za-z0-9]/.test(B);default:return!1}}(e);return n().createElement("li",{key:"requirement-".concat(e,"-").concat(t),className:"requirement ".concat(r?"met":""),style:r?N.requirementMet:{}},r?"✓":"○"," ",e)})));var e}})};qD.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,required:o().bool,disabled:o().bool,defaultValue:o().string,placeholder:o().string,showPasswordStrength:o().bool,showPasswordRequirements:o().bool,passwordRequirements:o().arrayOf(o().string),validationErrorMessages:o().object,onChange:o().func,error:o().string,type:o().string,customTheme:o().object,styleName:o().string,tooltip:o().string,inputProps:o().object};var VD=function(e){return e>=90?"#4caf50":e>=70?"#8bc34a":e>=40?"#ffc107":e>=20?"#ff9800":"#f44336"};const QD=qD;function zD(e){return zD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zD(e)}function UD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UD(Object(n),!0).forEach(function(t){HD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function HD(e,t,n){return(t=function(e){var t=function(e){if("object"!=zD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $D=function(e){var t=e.label,r=e.value,o=e.disabled,i=e.className,a=e.customTheme,s=void 0===a?{}:a,l=xc(),u=ZA(l.pdfField||{},s);return r?n().createElement("div",{style:u.container},n().createElement("button",{type:"button",style:WD(WD({},u.button),o&&u.disabled),onClick:function(){try{for(var e,t=atob(r.split(",")[1]||r),n=new Array(t.length),o=0;o<t.length;o++)n[o]=t.codePointAt(o);var i=new Uint8Array(n),a=new Blob([i],{type:"application/pdf"}),s=URL.createObjectURL(a);null===(e=ml.open)||void 0===e||e.call(ml,s,"_blank"),setTimeout(function(){URL.revokeObjectURL(s)},1e3)}catch(e){console.error("Error opening PDF:",e)}},disabled:o,className:i},t)):null};$D.propTypes={value:o().oneOfType([o().string,o().number,o().bool]),label:o().string,disabled:o().bool,className:o().string,customTheme:o().object};const GD=$D;function YD(e){return YD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},YD(e)}function KD(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return XD(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(XD(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,XD(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,XD(d,"constructor",u),XD(u,"constructor",l),l.displayName="GeneratorFunction",XD(u,o,"GeneratorFunction"),XD(d),XD(d,o,"Generator"),XD(d,r,function(){return this}),XD(d,"toString",function(){return"[object Generator]"}),(KD=function(){return{w:i,m:p}})()}function XD(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}XD=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){XD(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},XD(e,t,n,r)}function JD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JD(Object(n),!0).forEach(function(t){ej(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ej(e,t,n){return(t=function(e){var t=function(e){if("object"!=YD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=YD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==YD(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tj(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function nj(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){tj(i,r,o,a,s,"next",e)}function s(e){tj(i,r,o,a,s,"throw",e)}a(void 0)})}}function rj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||oj(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oj(e,t){if(e){if("string"==typeof e)return ij(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ij(e,t):void 0}}function ij(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var aj,sj=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.documents,c=t.onDownload,d=t.onPreview,p=t.customTheme,f=void 0===p?{}:p,m=xc(),h=ZA(m.pdfPackageField||{},f),v=rj((0,e.useState)(i||[]),2),y=v[0],g=v[1],b=rj((0,e.useState)({}),2),A=b[0],w=b[1],k=function(){var e=nj(KD().m(function e(t){return KD().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,w(function(e){return ZD(ZD({},e),{},ej({},t,!0))}),e.n=1,c(t);case 1:return e.p=1,w(function(e){return ZD(ZD({},e),{},ej({},t,!1))}),e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=nj(KD().m(function e(t){return KD().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,w(function(e){return ZD(ZD({},e),{},ej({},t,!0))}),e.n=1,d(t);case 1:return e.p=1,w(function(e){return ZD(ZD({},e),{},ej({},t,!1))}),e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}));return function(t){return e.apply(this,arguments)}}();return n().createElement(NE,{name:r,label:o,value:y,validation:a,className:l,customTheme:h,renderInput:function(){return n().createElement("div",{style:h.container},u.map(function(e){return n().createElement("div",{key:e.id,style:h.item},n().createElement("div",{style:h.itemHeader},n().createElement("input",{type:"checkbox",id:"doc-".concat(e.id),checked:y.includes(e.id),onChange:function(){return t=e.id,void g(function(e){return e.includes(t)?e.filter(function(e){return e!==t}):[].concat(function(e){return function(e){if(Array.isArray(e))return ij(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||oj(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),[t])});var t},disabled:s,style:ZD(ZD({},h.checkbox),s&&h.disabled)}),n().createElement("label",{htmlFor:"doc-".concat(e.id),style:h.label},e.name)),n().createElement("div",{style:h.description},e.description),n().createElement("div",{style:h.actions},n().createElement("button",{type:"button",onClick:function(){return E(e.id)},disabled:s||A[e.id],style:ZD(ZD(ZD({},h.button),h.previewButton),s&&h.disabled)},A[e.id]?"Loading...":"Preview"),n().createElement("button",{type:"button",onClick:function(){return k(e.id)},disabled:s||A[e.id],style:ZD(ZD(ZD({},h.button),h.downloadButton),s&&h.disabled)},A[e.id]?"Loading...":"Download")))}))}})};function lj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function uj(){}function cj(e){return!!(e||"").match(/\d/)}function dj(e){return null==e}function pj(e){return dj(e)||function(e){return"number"==typeof e&&isNaN(e)}(e)||"number"==typeof e&&!isFinite(e)}function fj(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function mj(e,t){void 0===t&&(t=!0);var n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split(".");return{beforeDecimal:o[0],afterDecimal:o[1]||"",hasNegation:n,addNegation:r}}function hj(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function vj(e,t){return Array(t+1).join(e)}function yj(e){var t=e+"",n="-"===t[0]?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],i=r[1];if(!(i=Number(i)))return n+o;var a=1+i,s=(o=o.replace(".","")).length;return a<0?o="0."+vj("0",Math.abs(a))+o:a>=s?o+=vj("0",a-s):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function gj(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=(-1!==e.indexOf(".")||n)&&t,o=mj(e),i=o.beforeDecimal,a=o.afterDecimal,s=o.hasNegation,l=parseFloat("0."+(a||"0")),u=(a.length<=t?"0."+a:l.toFixed(t)).split("."),c=i;return i&&Number(u[0])&&(c=i.split("").reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},u[0])),(s?"-":"")+c+(r?".":"")+hj(u[1]||"",t,n)}function bj(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}sj.propTypes={name:o().string.isRequired,label:o().string,value:o().arrayOf(o().string),validation:o().object,disabled:o().bool,className:o().string,documents:o().arrayOf(o().shape({id:o().string.isRequired,name:o().string.isRequired,description:o().string})).isRequired,onDownload:o().func.isRequired,onPreview:o().func.isRequired,customTheme:o().object},function(e){e.event="event",e.props="prop"}(aj||(aj={}));var Aj,wj,kj,Ej=(Aj=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:i-r}}},kj=void 0,function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return wj&&e.length===wj.length&&e.every(function(e,t){return e===wj[t]})?kj:(wj=e,kj=Aj.apply(void 0,e))});function Cj(e){return Math.max(e.selectionStart,e.selectionEnd)}function xj(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function Sj(e,t,n,r){var o,i,a=e.length;if(o=t,i=a,t=Math.min(Math.max(o,0),i),"left"===r){for(;t>=0&&!n[t];)t--;-1===t&&(t=n.indexOf(!0))}else{for(;t<=a&&!n[t];)t++;t>a&&(t=n.lastIndexOf(!0))}return-1===t&&(t=a),t}function _j(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=Boolean(cj(e[n])||cj(e[n-1]));return t}function Oj(t,n,r,o,i,a){void 0===a&&(a=uj);var s=function(t){var n=(0,e.useRef)(t);n.current=t;var r=(0,e.useRef)(function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return n.current.apply(n,e)});return r.current}(function(e,t){var n,r;return pj(e)?(r="",n=""):"number"==typeof e||t?(r="number"==typeof e?yj(e):e,n=o(r)):(r=i(e,void 0),n=o(r)),{formattedValue:n,numAsString:r}}),l=(0,e.useState)(function(){return s(dj(t)?n:t,r)}),u=l[0],c=l[1],d=t,p=r;dj(t)&&(d=u.numAsString,p=!0);var f=s(d,p);return(0,e.useMemo)(function(){c(f)},[f.formattedValue]),[u,function(e,t){e.formattedValue!==u.formattedValue&&c({formattedValue:e.formattedValue,numAsString:e.value}),a(e,t)}]}function Ij(e){return e.replace(/[^0-9]/g,"")}function Tj(e){return e}function Pj(t){var r=t.type;void 0===r&&(r="text");var o=t.displayType;void 0===o&&(o="input");var i=t.customInput,a=t.renderText,s=t.getInputRef,l=t.format;void 0===l&&(l=Tj);var u=t.removeFormatting;void 0===u&&(u=Ij);var c=t.defaultValue,d=t.valueIsNumericString,p=t.onValueChange,f=t.isAllowed,m=t.onChange;void 0===m&&(m=uj);var h=t.onKeyDown;void 0===h&&(h=uj);var v=t.onMouseUp;void 0===v&&(v=uj);var y=t.onFocus;void 0===y&&(y=uj);var g=t.onBlur;void 0===g&&(g=uj);var b=t.value,A=t.getCaretBoundary;void 0===A&&(A=_j);var w=t.isValidInputCharacter;void 0===w&&(w=cj);var k=t.isCharacterSame,E=lj(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),C=Oj(b,c,Boolean(d),l,u,p),x=C[0],S=x.formattedValue,_=x.numAsString,O=C[1],I=(0,e.useRef)(),T=(0,e.useRef)({formattedValue:S,numAsString:_}),P=function(e,t){T.current={formattedValue:e.formattedValue,numAsString:e.value},O(e,t)},B=(0,e.useState)(!1),D=B[0],j=B[1],R=(0,e.useRef)(null),M=(0,e.useRef)({setCaretTimeout:null,focusTimeout:null});(0,e.useEffect)(function(){return j(!0),function(){clearTimeout(M.current.setCaretTimeout),clearTimeout(M.current.focusTimeout)}},[]);var L=l,N=function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}},F=function(e,t,n){0===e.selectionStart&&e.selectionEnd===e.value.length||(bj(e,t),M.current.setCaretTimeout=setTimeout(function(){e.value===n&&e.selectionStart!==t&&bj(e,t)},0))},q=function(e,t,n){return Sj(e,t,A(e),n)},V=function(e,t,n){var r=A(t),o=function(e,t,n,r,o,i,a){void 0===a&&(a=xj);var s=o.findIndex(function(e){return e}),l=e.slice(0,s);t||n.startsWith(l)||(t=l,n=l+n,r+=l.length);for(var u=n.length,c=e.length,d={},p=new Array(u),f=0;f<u;f++){p[f]=-1;for(var m=0,h=c;m<h;m++)if(a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:f,formattedValueIndex:m})&&!0!==d[m]){p[f]=m,d[m]=!0;break}}for(var v=r;v<u&&(-1===p[v]||!i(n[v]));)v++;var y=v===u||-1===p[v]?c:p[v];for(v=r-1;v>0&&-1===p[v];)v--;var g=-1===v||-1===p[v]?0:p[v]+1;return g>y?y:r-g<y-r?g:y}(t,S,e,n,r,w,k);return Sj(t,o,r)};(0,e.useEffect)(function(){var e=T.current,t=e.formattedValue,n=e.numAsString;S===t&&_===n||P(N(S,_),{event:void 0,source:aj.props})},[S,_]);var Q=R.current?Cj(R.current):void 0;("undefined"!=typeof window?e.useLayoutEffect:e.useEffect)(function(){var e=R.current;if(S!==T.current.formattedValue&&e){var t=V(T.current.formattedValue,S,Q);e.value=S,F(e,t,S)}},[S]);var z=function(e,t){void 0===t&&(t=0);var n=e.selectionStart,r=e.selectionEnd;I.current={selectionStart:n,selectionEnd:r+t}},U=!D||"undefined"==typeof navigator||navigator.platform&&/iPhone|iPod/.test(navigator.platform)?void 0:"numeric",W=Object.assign({inputMode:U},E,{type:r,value:S,onChange:function(e){(function(e,t,n){var r=t.target,o=I.current?function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}}(I.current,r.selectionEnd):Ej(S,e),i=Object.assign(Object.assign({},o),{lastValue:S}),a=u(e,i),s=L(a);if(a=u(s,void 0),f&&!f(N(s,a))){var l=t.target,c=Cj(l),d=V(e,S,c);return l.value=S,F(l,d,S),!1}return function(e){var t=e.formattedValue;void 0===t&&(t="");var n,r=e.input,o=e.source,i=e.event,a=e.numAsString;if(r){var s=e.inputValue||r.value,l=Cj(r);r.value=t,void 0!==(n=V(s,t,l))&&F(r,n,t)}t!==S&&P(N(t,a),{event:i,source:o})}({formattedValue:s,numAsString:a,inputValue:e,event:t,source:n,input:t.target}),!0})(e.target.value,e,aj.event)&&m(e),I.current=void 0},onKeyDown:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,i=n.selectionEnd,a=n.value;void 0===a&&(a=""),"ArrowLeft"===r||"Backspace"===r?t=Math.max(o-1,0):"ArrowRight"===r?t=Math.min(o+1,a.length):"Delete"===r&&(t=o);var s=0;"Delete"===r&&o===i&&(s=1);var l="ArrowLeft"===r||"ArrowRight"===r;if(void 0===t||o!==i&&!l)return h(e),void z(n,s);var u=t;l?(u=q(a,t,"ArrowLeft"===r?"left":"right"))!==t&&e.preventDefault():"Delete"!==r||w(a[t])?"Backspace"!==r||w(a[t])||(u=q(a,t,"left")):u=q(a,t,"right"),u!==t&&F(n,u,a),h(e),z(n,s)},onMouseUp:function(e){var t=e.target,n=function(){var e=t.selectionStart,n=t.selectionEnd,r=t.value;if(void 0===r&&(r=""),e===n){var o=q(r,e);o!==e&&F(t,o,r)}};n(),requestAnimationFrame(function(){n()}),v(e),z(t)},onFocus:function(e){e.persist&&e.persist();var t=e.target,n=e.currentTarget;R.current=t,M.current.focusTimeout=setTimeout(function(){var r=t.selectionStart,o=t.selectionEnd,i=t.value;void 0===i&&(i="");var a=q(i,r);a===r||0===r&&o===i.length||F(t,a,i),y(Object.assign(Object.assign({},e),{currentTarget:n}))},0)},onBlur:function(e){R.current=null,clearTimeout(M.current.focusTimeout),clearTimeout(M.current.setCaretTimeout),g(e)}});if("text"===o)return a?n().createElement(n().Fragment,null,a(S,E)||null):n().createElement("span",Object.assign({},E,{ref:s}),S);if(i){var H=i;return n().createElement(H,Object.assign({},W,{ref:s}))}return n().createElement("input",Object.assign({},W,{ref:s}))}function Bj(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;void 0===o&&(o="");var i=t.suffix;void 0===i&&(i="");var a=t.allowNegative,s=t.thousandsGroupStyle;if(void 0===s&&(s="thousand"),""===e||"-"===e)return e;var l=Dj(t),u=l.thousandSeparator,c=l.decimalSeparator,d=0!==n&&-1!==e.indexOf(".")||n&&r,p=mj(e,a),f=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=hj(m,n,!!r)),u&&(f=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(f,u,s)),o&&(f=o+f),i&&(m+=i),h&&(f="-"+f),f+(d&&c||"")+m}function Dj(e){var t=e.decimalSeparator;void 0===t&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function jj(e){e=function(e){var t=Dj(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;void 0===o&&(o="");var i=e.allowNegative;if(void 0===i&&(i=!0),n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+n+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+r+" (default value for decimalSeparator is .)\n ");return o.startsWith("-")&&i&&(console.error("\n Prefix can't start with '-' when allowNegative is true.\n prefix: "+o+"\n allowNegative: "+i+"\n "),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;void 0===o&&(o=uj);var i=e.onBlur;void 0===i&&(i=uj);var a=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,u=e.prefix;void 0===u&&(u="");var c=e.defaultValue,d=e.value,p=e.valueIsNumericString,f=e.onValueChange,m=lj(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),h=Dj(e),v=h.decimalSeparator,y=h.allowedDecimalSeparators,g=function(t){return Bj(t,e)},b=function(t,n){return function(e,t,n){var r;void 0===t&&(t=function(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}(e));var o=n.allowNegative,i=n.prefix;void 0===i&&(i="");var a=n.suffix;void 0===a&&(a="");var s=n.decimalScale,l=t.from,u=t.to,c=u.start,d=u.end,p=Dj(n),f=p.allowedDecimalSeparators,m=p.decimalSeparator,h=e[d]===m;if(cj(e)&&(e===i||e===a)&&""===t.lastValue)return e;if(d-c===1&&-1!==f.indexOf(e[c])){var v=0===s?"":m;e=e.substring(0,c)+v+e.substring(c+1,e.length)}var y=function(e,t,n){var r=!1,o=!1;i.startsWith("-")?r=!1:e.startsWith("--")?(r=!1,o=!0):a.startsWith("-")&&e.length===a.length?r=!1:"-"===e[0]&&(r=!0);var s=r?1:0;return o&&(s=2),s&&(e=e.substring(s),t-=s,n-=s),{value:e,start:t,end:n,hasNegation:r}},g=y(e,c,d),b=g.hasNegation;e=(r=g).value,c=r.start,d=r.end;var A=y(t.lastValue,l.start,l.end),w=A.start,k=A.end,E=A.value,C=e.substring(c,d);!(e.length&&E.length&&(w>E.length-a.length||k<i.length))||C&&a.startsWith(C)||(e=E);var x=0;e.startsWith(i)?x+=i.length:c<i.length&&(x=c),d-=x;var S=(e=e.substring(x)).length,_=e.length-a.length;e.endsWith(a)?S=_:(d>_||d>e.length-a.length)&&(S=d),e=e.substring(0,S),e=function(e,t){void 0===e&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}(b?"-"+e:e,o),e=(e.match(function(e){return new RegExp("(^-)|[0-9]|"+fj(e),"g")}(m))||[]).join("");var O=e.indexOf(m);e=e.replace(new RegExp(fj(m),"g"),function(e,t){return t===O?".":""});var I=mj(e,o),T=I.beforeDecimal,P=I.afterDecimal,B=I.addNegation;return u.end-u.start<l.end-l.start&&""===T&&h&&!parseFloat(P)&&(e=B?"-":""),e}(t,n,e)},A=dj(d)?c:d,w=null!=p?p:function(e,t,n){return""===e||!(null==t?void 0:t.match(/\d/))&&!(null==n?void 0:n.match(/\d/))&&"string"==typeof e&&!isNaN(Number(e))}(A,u,t);dj(d)?dj(c)||(w=w||"number"==typeof c):w=w||"number"==typeof d;var k=function(e){return pj(e)?e:("number"==typeof e&&(e=yj(e)),w&&"number"==typeof s?gj(e,s,Boolean(l)):e)},E=Oj(k(d),k(c),Boolean(w),g,b,f),C=E[0],x=C.numAsString,S=C.formattedValue,_=E[1];return Object.assign(Object.assign({},m),{value:S,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===v||cj(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,o=e.currentValueIndex,i=e.formattedValueIndex,a=t[o],c=r[i],p=Ej(n,t).to,f=function(e){return b(e).indexOf(".")+u.length};return!(0===d&&l&&s&&t[p.start]===v&&f(t)<o&&f(r)>i||!(o>=p.start&&o<p.end&&y&&y.includes(a)&&c===v)&&a!==c)},onValueChange:_,format:g,removeFormatting:b,getCaretBoundary:function(t){return function(e,t){var n=t.prefix;void 0===n&&(n="");var r=t.suffix;void 0===r&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),i="-"===e[0];o.fill(!1,0,n.length+(i?1:0));var a=e.length;return o.fill(!1,a-r.length+1,a+1),o}(t,e)},onKeyDown:function(e){var t=e.target,r=e.key,i=t.selectionStart,c=t.selectionEnd,d=t.value;if(void 0===d&&(d=""),("Backspace"===r||"Delete"===r)&&c<u.length)e.preventDefault();else if(i===c){"Backspace"===r&&"-"===d[0]&&i===u.length+1&&n&&bj(t,1),s&&l&&("Backspace"===r&&d[i-1]===v?(bj(t,i-1),e.preventDefault()):"Delete"===r&&d[i]===v&&e.preventDefault()),(null==y?void 0:y.includes(r))&&d[i]===v&&bj(t,i+1);var p=!0===a?",":a;"Backspace"===r&&d[i-1]===p&&bj(t,i-1),"Delete"===r&&d[i]===p&&bj(t,i+1),o(e)}else o(e)},onBlur:function(t){var n=x;if(n.match(/\d/g)||(n=""),r||(n=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}(n)),l&&s&&(n=gj(n,s,l)),n!==x){var o=Bj(n,e);_({formattedValue:o,value:n,floatValue:parseFloat(n)},{event:t,source:aj.event})}i(t)}})}function Rj(e){var t=jj(e);return n().createElement(Pj,Object.assign({},t))}function Mj(e){return Mj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mj(e)}var Lj=["questionId","label","value","onChange","minValue","maxValue","decimalScale","required","disabled","placeholder","helperText","tooltip","error","validationErrorMessages","className","hideLabel","visible","defaultValue","inputProps","styleName","customTheme","header","onBlur","showQuestionLabels"];function Nj(){return Nj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nj.apply(null,arguments)}function Fj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fj(Object(n),!0).forEach(function(t){Vj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vj(e,t,n){return(t=function(e){var t=function(e){if("object"!=Mj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qj=function(t){var r,o=t.questionId,i=t.label,a=t.value,s=t.onChange,l=t.minValue,u=t.maxValue,c=t.decimalScale,d=t.required,p=t.disabled,f=t.placeholder,m=(t.helperText,t.tooltip,t.error),h=(t.validationErrorMessages,t.className),v=(t.hideLabel,t.visible),y=void 0===v||v,g=t.defaultValue,b=t.inputProps,A=void 0===b?{}:b,w=t.styleName,k=t.customTheme,E=void 0===k?{}:k,C=t.header,x=t.onBlur,S=t.showQuestionLabels,_=void 0===S||S,O=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,Lj),I=cc(),T=I.state,P=I.setValue,B=xc(),D=A["data-item-index"],j=A["data-parent-id"],R=GA({questionId:o,itemIndex:D,defaultValue:g,defaultVisible:!0,defaultDisabled:!1}),M=R.disabled,L=R.handleChange,N=null!=a?a:T.values[o],F=null!=l?l:0,q=null!=u?u:100,V=m||(null===(r=T.errors)||void 0===r?void 0:r[o]),Q=(0,e.useMemo)(function(){var e=B.textField||B.percentageField||{};return ZA(e,E)},[B,E]),z=(0,e.useMemo)(function(){var e=qj(qj({},Q.container),{},{width:"100%"}),t=tw(Q.input,V&&Q.error,(M||p)&&Q.disabled);return{container:ew(e,Q.responsive),input:t}},[Q,V,M,p]);if(y){var U=f||"Enter percentage (".concat(F,"-").concat(q,")"),W=D?"".concat(o,"-").concat(D):o,H=null!=M&&""!==M?M:p;return n().createElement("div",{className:"form-field ".concat(w||""," ").concat(h||""),style:z.container},C&&n().createElement("div",{className:"field-header",style:B.header},C),n().createElement(Rj,Nj({customInput:VA,suffix:"%",disabled:H},null!=c&&{decimalScale:c},{allowNegative:!1,min:F,max:q,isAllowed:function(e){var t=e.floatValue;return void 0===t||t>=F&&t<=q},onValueChange:function(e){var t=e.value;L&&L(t,void 0!==D&&void 0!==j?{cardListId:j,instanceIndex:D}:{}),P&&P(o,t),s&&s({target:{name:o,value:t}})},value:N||"",placeholder:U,autoComplete:"off",required:d,label:_?i:"",id:String(W),name:String(W),onBlur:x,fullWidth:!0,"data-item-index":D,"data-parent-id":j},O)))}return null};Qj.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),defaultValue:o().oneOfType([o().string,o().number]),onChange:o().func,minValue:o().number,maxValue:o().number,decimalScale:o().number,required:o().bool,disabled:o().bool,placeholder:o().string,helperText:o().string,tooltip:o().string,error:o().string,validationErrorMessages:o().object,className:o().string,hideLabel:o().bool,visible:o().bool,inputProps:o().object,styleName:o().string,customTheme:o().object,header:o().string,onBlur:o().func,showQuestionLabels:o().bool},Qj.defaultProps={minValue:0,maxValue:100,decimalScale:null,required:!1,disabled:!1,visible:!0,hideLabel:!1,inputProps:{}};const zj=Qj;function Uj(e){return Uj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uj(e)}function Wj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wj(Object(n),!0).forEach(function(t){$j(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $j(e,t,n){return(t=function(e){var t=function(e){if("object"!=Uj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Uj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Uj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gj=function(t){var r=t.questionId,o=t.label,i=t.value,a=void 0===i?"":i,s=t.options,l=void 0===s?[]:s,u=t.disabled,c=void 0!==u&&u,d=t.required,p=void 0!==d&&d,f=t.onChange,m=t.inputProps,h=void 0===m?{}:m,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,A=t.error,w=t.helperText,k=t.tooltip,E=void 0===k?"":k,C=t.showQuestionLabels,x=void 0===C||C,S=xc(),_=cc().state,O=h["data-parent-id"],I=h["data-item-index"],T=(0,e.useMemo)(function(){var e,t,n=null===(e=_.optionVisibility)||void 0===e?void 0:e[r];return null!=O&&void 0!==I&&null!==(t=_.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[O])&&void 0!==t&&null!==(t=t[Number(I)])&&void 0!==t&&t[r]&&(n=_.optionVisibilityByInstance[O][Number(I)][r]),n?l.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):l},[l,_.optionVisibility,_.optionVisibilityByInstance,r,O,I]),P=function(e){null==f||f(e)},B=(0,e.useMemo)(function(){var e=S.radioField||{};return ZA(e,b)},[S,b]),D=(0,e.useMemo)(function(){var e=Hj(Hj({},B.container),{},{width:"100%"}),t=tw(B.radioGroup,A&&B.error,c&&B.disabled),n=tw(B.radioOption,c&&B.disabled);return{container:ew(e,B.responsive),radioGroup:t,radioOption:n,radio:B.radio,label:B.optionLabel}},[B,A,c]);return n().createElement("div",{className:"form-field ".concat(y||""),style:D.container},v&&n().createElement("div",{className:"field-header",style:S.header},v),x&&o&&n().createElement("div",{className:"question_label",style:S.label},o,p&&n().createElement("span",{className:"required-mark",style:S.requiredMark},"*"),E&&n().createElement(gE,{tooltip:E})),n().createElement("div",{className:"radio-group",style:D.radioGroup},T.map(function(e,t){var o,i,s=null!==(o=e.value)&&void 0!==o?o:e,l=null!==(i=e.label)&&void 0!==i?i:e,u=void 0===I?"":"-".concat(I),d="".concat(r,"-").concat(O||"","-").concat(t).concat(u),f=String(a)===String(s);return n().createElement("div",{key:d,className:"radio-option",style:D.radioOption},n().createElement("input",{type:"radio",id:d,name:void 0===I?r:"".concat(r,"-").concat(I),value:s,checked:f,onChange:P,disabled:c,required:p,"data-item-index":I,"data-parent-id":O,style:D.radio}),n().createElement("label",{htmlFor:d,style:D.label},l))})),w&&n().createElement("div",{className:"helper-text",style:S.helperText},w))};Gj.propTypes={questionId:o().string,label:o().string,value:o().oneOfType([o().string,o().number,o().bool]),options:o().arrayOf(o().oneOfType([o().string,o().number,o().shape({label:o().string.isRequired,value:o().oneOfType([o().string,o().number,o().bool]).isRequired})])),disabled:o().bool,required:o().bool,onChange:o().func,inputProps:o().object,header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,tooltip:o().string,showQuestionLabels:o().bool};const Yj=Gj;var Kj=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/RadioTabButtonsField.css"),Xj={};function Jj(e){return Jj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jj(e)}Xj.styleTagTransform=nl(),Xj.setAttributes=Js(),Xj.insert=Ks().bind(null,"head"),Xj.domAPI=Gs(),Xj.insertStyleElement=el(),Hs()(Kj.A,Xj),Kj.A&&Kj.A.locals&&Kj.A.locals;var Zj=["name","label","value","onChange","options","disabled","required","error","_validation","header","styleName","customTheme","_questionId","_encrypted","_maskingType","_maskingLength","tooltip","showQuestionLabels"];function eR(){return eR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eR.apply(null,arguments)}function tR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tR(Object(n),!0).forEach(function(t){rR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rR(e,t,n){return(t=function(e){var t=function(e){if("object"!=Jj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Jj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oR=function(t){var r=t.name,o=t.label,i=t.value,a=void 0===i?"":i,s=t.onChange,l=t.options,u=void 0===l?[]:l,c=t.disabled,d=t.required,p=t.error,f=(t._validation,t.header),m=t.styleName,h=t.customTheme,v=void 0===h?{}:h,y=(t._questionId,t._encrypted,t._maskingType,t._maskingLength,t.tooltip),g=void 0===y?"":y,b=t.showQuestionLabels,A=void 0===b||b,w=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,Zj),k=xc(),E=(0,e.useMemo)(function(){var e=k.radioTabButtonsField||k.radioField||{};return ZA(e,v)},[k,v]),C=(0,e.useMemo)(function(){var e=nR(nR({},E.container),{},{width:"100%"}),t=tw(E.tabGroup),n=tw(E.tab,c&&E.disabled),r=tw(E.selectedTab),o=tw(E.disabledTab),i=tw(E.label,d&&E.required,c&&E.disabled);return{container:ew(e,E.responsive),tabGroup:t,tab:n,selectedTab:r,disabledTab:o,label:i,header:tw(E.header),error:tw(E.error)}},[E,d,c]);return n().createElement("div",{className:"radio-tab-buttons-field ".concat(m||""),style:C.container},f&&n().createElement("div",{className:"field-header",style:C.header},f),A&&o&&n().createElement("div",{className:"question_label",style:C.label},o,d&&n().createElement("span",{style:E.required},"*"),g&&n().createElement(gE,{tooltip:g})),n().createElement("div",{className:"radio-tab-buttons-wrapper",style:C.tabGroup},u.map(function(e){var t=String(a).toLowerCase()===String(e.value).toLowerCase();return n().createElement("button",eR({key:e.value,type:"button",onClick:function(){return t=e.value,void(c||!s||s({target:{name:r,value:t}}));var t},disabled:c,style:nR(nR(nR({},C.tab),t?C.selectedTab:{}),c?C.disabledTab:{})},w),e.label)})),p&&n().createElement("div",{style:C.error},p))};oR.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().any,onChange:o().func,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().any.isRequired,name:o().string,text:o().string,selected:o().bool,optionId:o().number,sortOrder:o().number,uncheckOthers:o().bool})),disabled:o().bool,required:o().bool,error:o().string,_validation:o().object,header:o().node,styleName:o().string,customTheme:o().object,_questionId:o().oneOfType([o().string,o().number]),_encrypted:o().bool,_maskingType:o().string,_maskingLength:o().oneOfType([o().string,o().number]),tooltip:o().string,showQuestionLabels:o().bool};const iR=Ay("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),aR=Ay("MuiListItemIcon",["root","alignItemsFlexStart"]),sR=Ay("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function lR(e){return by("MuiMenuItem",e)}const uR=Ay("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),cR=Bv(Jk,{shouldForwardProp:e=>Tv(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})(cy(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${uR.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:th(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${uR.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:th(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${uR.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:th(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:th(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${uR.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${uR.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${iR.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${iR.inset}`]:{marginLeft:52},[`& .${sR.root}`]:{marginTop:0,marginBottom:0},[`& .${sR.inset}`]:{paddingLeft:36},[`& .${aR.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${aR.root} svg`]:{fontSize:"1.25rem"}}}]}))),dR=e.forwardRef(function(t,n){const r=Mv({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:d,className:p,...f}=r,m=e.useContext(Tg),h=e.useMemo(()=>({dense:a||m.dense||!1,disableGutters:l}),[m.dense,a,l]),v=e.useRef(null);fy(()=>{o&&v.current&&v.current.focus()},[o]);const y={...r,dense:h.dense,divider:s,disableGutters:l},g=(e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:a}=e,s=Hd({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},lR,a);return{...a,...s}})(r),b=py(v,n);let A;return r.disabled||(A=void 0!==d?d:-1),(0,jv.jsx)(Tg.Provider,{value:h,children:(0,jv.jsx)(cR,{ref:b,role:c,tabIndex:A,component:i,focusVisibleClassName:Wd(g.focusVisible,u),className:Wd(g.root,p),...f,ownerState:y,classes:g})})});function pR(e){return pR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pR(e)}function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fR(Object(n),!0).forEach(function(t){hR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hR(e,t,n){return(t=function(e){var t=function(e){if("object"!=pR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vR=function(t){var r=t.questionId,o=t.label,i=t.options,a=void 0===i?[]:i,s=t.defaultValue,l=void 0===s?"":s,u=t.helperText,c=t.required,d=void 0!==c&&c,p=t.onChange,f=t.inputProps,m=void 0===f?{}:f,h=t.header,v=t.styleName,y=t.customTheme,g=void 0===y?{}:y,b=t.tooltip,A=void 0===b?"":b,w=t.showQuestionLabels,k=void 0===w||w,E=xc(),C=cc().state,x=m["data-item-index"],S=m["data-parent-id"],_=GA({questionId:r,itemIndex:x,defaultValue:l,defaultVisible:!0,defaultDisabled:!1}),O=_.visible,I=_.disabled,T=_.error,P=_.handleChange,B=_.value,D=(0,e.useMemo)(function(){var e,t,n=S,o=x,i=null===(e=C.optionVisibility)||void 0===e?void 0:e[r];return null!=n&&void 0!==o&&null!==(t=C.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[n])&&void 0!==t&&null!==(t=t[Number(o)])&&void 0!==t&&t[r]&&(i=C.optionVisibilityByInstance[n][Number(o)][r]),i?a.filter(function(e){var t=e.optionId||e.id;return!1!==i[t]}):a},[a,C.optionVisibility,C.optionVisibilityByInstance,r,S,x]),j=(0,e.useMemo)(function(){return function(e,t){if(!(e&&t&&t.length>0))return e;if(t.find(function(t){return t.value===e}))return e;var n=t.find(function(t){return t.label===e});return n?n.value:e}(B,a)},[B,a]),R=(0,e.useMemo)(function(){var e=E.selectField||{};return ZA(e,g)},[E,g]),M=(0,e.useMemo)(function(){var e=mR(mR({},R.container),{},{width:"100%"}),t=tw(R.select,T&&R.error,I&&R.disabled);return{container:ew(e,R.responsive),select:t,menu:R.menu,menuItem:R.menuItem}},[R,T,I]);if(!O)return null;var L=void 0===x?r:"".concat(r,"-").concat(x);return n().createElement("div",{className:"form-field ".concat(v||""),style:M.container},h&&n().createElement("div",{className:"field-header",style:E.header},h),n().createElement(bg,{fullWidth:!0,error:!!T,required:k&&d,style:R.formControl},k&&o&&n().createElement(mg,{id:"label-".concat(String(r)),style:E.label},o,A&&n().createElement(gE,{tooltip:A})),n().createElement(LA,{value:j||"",onChange:function(e){var t=e.target.value;P(t,{cardListId:S,instanceIndex:x}),p&&p(e)},label:k?o:"",disabled:I,id:String(L),name:String(L),labelId:"label-".concat(String(L)),"data-item-index":x,"data-parent-id":S,style:M.select,MenuProps:{PaperProps:{style:M.menu}}},D.map(function(e,t){return n().createElement(dR,{key:"".concat(L,"-").concat(t),value:e.value,disabled:e.disabled,style:M.menuItem},e.label)})),(T||u)&&n().createElement(Cg,{style:T?E.error:E.helperText},T||u)))};function yR(e){return yR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yR(e)}function gR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gR(Object(n),!0).forEach(function(t){AR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AR(e,t,n){return(t=function(e){var t=function(e){if("object"!=yR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=yR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}vR.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,options:o().arrayOf(o().shape({value:o().oneOfType([o().string,o().number,o().bool]).isRequired,label:o().string.isRequired,disabled:o().bool})).isRequired,defaultValue:o().string,helperText:o().string,required:o().bool,onChange:o().func,inputProps:o().object,header:o().node,styleName:o().string,customTheme:o().object,tooltip:o().string,showQuestionLabels:o().bool,addressGroup:o().shape({includes:o().func})};var wR=function(t){var r=t.name,o=t.label,i=t.value,a=t.onChange,s=t.disabled,l=t.required,u=t.error,c=t.validation,d=void 0===c?{}:c,p=t.header,f=t.styleName,m=t.customTheme,h=void 0===m?{}:m,v=t.tooltip,y=void 0===v?"":v,g=t.showQuestionLabels,b=void 0===g||g,A=xc(),w=d.min,k=d.max,E=d.step,C=void 0===E?1:E,x=(0,e.useMemo)(function(){var e=A.spinnerField||{};return ZA(e,h)},[A,h]),S=(0,e.useMemo)(function(){var e=bR(bR({},x.container),{},{width:"100%"}),t=tw(x.input,s&&x.disabled,u&&x.error),n=tw(x.button,s&&x.disabled);return{container:ew(e,x.responsive),wrapper:x.wrapper,input:t,button:n,header:tw(x.header),label:tw(x.label,l&&x.required,s&&x.disabled),error:tw(x.error)}},[x,s,u,l]);return n().createElement("div",{className:"spinner-field ".concat(f||""),style:S.container},p&&n().createElement("div",{className:"field-header",style:S.header},p),b&&o&&n().createElement("div",{className:"question_label",style:S.label},o,l&&n().createElement("span",{style:x.required},"*"),y&&n().createElement(gE,{tooltip:y})),n().createElement("div",{style:S.wrapper},n().createElement("button",{type:"button",onClick:function(){if(!s){var e=(Number(i)||0)-C;(void 0===w||e>=w)&&a({target:{name:r,value:e}})}},disabled:s||void 0!==w&&(Number(i)||0)<=w,style:S.button,"aria-label":"Decrease value"},"-"),n().createElement("input",{type:"number",name:r,value:i||"",onChange:function(e){if(!s){var t=Number(e.target.value);Number.isNaN(t)||(void 0===w||t>=w)&&(void 0===k||t<=k)&&a({target:{name:r,value:t}})}},disabled:s,style:S.input,min:w,max:k,step:C}),n().createElement("button",{type:"button",onClick:function(){if(!s){var e=(Number(i)||0)+C;(void 0===k||e<=k)&&a({target:{name:r,value:e}})}},disabled:s||void 0!==k&&(Number(i)||0)>=k,style:S.button,"aria-label":"Increase value"},"+")),u&&n().createElement("div",{style:S.error},u))};wR.propTypes={name:o().string.isRequired,label:o().string,value:o().oneOfType([o().number,o().string]),onChange:o().func.isRequired,disabled:o().bool,required:o().bool,error:o().string,validation:o().shape({min:o().number,max:o().number,step:o().number}),header:o().node,styleName:o().string,customTheme:o().object,tooltip:o().string,showQuestionLabels:o().bool};var kR=a("./node_modules/css-loader/dist/cjs.js!./src/components/fields/styles/TextAreaField.css"),ER={};ER.styleTagTransform=nl(),ER.setAttributes=Js(),ER.insert=Ks().bind(null,"head"),ER.domAPI=Gs(),ER.insertStyleElement=el(),Hs()(kR.A,ER),kR.A&&kR.A.locals&&kR.A.locals;var CR=["value","_onChange","disabled","_editable"];function xR(e){return xR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xR(e)}function SR(){return SR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SR.apply(null,arguments)}function _R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_R(Object(n),!0).forEach(function(t){IR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_R(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IR(e,t,n){return(t=function(e){var t=function(e){if("object"!=xR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var TR=function(t){t._id;var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.placeholder,l=t.rows,u=void 0===l?3:l,c=t.disabled,d=t.className,p=t.onChange,f=t.header,m=t.styleName,h=t.customTheme,v=void 0===h?{}:h,y=t.error,g=t.helperText,b=t.maxLength,A=t.tooltip,w=void 0===A?"":A,k=t.showQuestionLabels,E=void 0===k||k,C=xc(),x=(0,e.useMemo)(function(){var e=C.textAreaField||{};return ZA(e,v)},[C,v]),S=(0,e.useMemo)(function(){var e=OR(OR({},x.container),{},{width:"100%"}),t=tw(x.textarea,y&&x.error,c&&x.disabled);return{container:ew(e,x.responsive),textarea:t}},[x,y,c]),_=function(e){p&&p(e)};return n().createElement("div",{className:"form-field ".concat(m||""),style:S.container},f&&n().createElement("div",{className:"field-header",style:C.header},f),n().createElement(NE,{name:r,label:E?o:"",value:i,validation:a,className:d,customTheme:x,error:y,helperText:g,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:x.label||{}},t,r&&n().createElement("span",{style:x.required||{}},"*"),w&&n().createElement(gE,{tooltip:w})):null},renderInput:function(e){var t=e.value,r=(e._onChange,e.disabled),o=(e._editable,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,CR)),i=SR({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(o),o));return n().createElement("textarea",SR({},i,{value:t||"",onChange:_,rows:u,placeholder:s,disabled:r,className:"form-field__textarea",style:S.textarea,maxLength:b}))}}))};function PR(){return PR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PR.apply(null,arguments)}TR.propTypes={_id:o().oneOfType([o().string,o().number]),name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,validation:o().object,placeholder:o().string,rows:o().number,disabled:o().bool,className:o().string,onChange:o().func,header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,maxLength:o().number,tooltip:o().string,showQuestionLabels:o().bool};var BR=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.map(function(e){if("string"==typeof e)return{value:e,label:e};var t=e.optionId,n=e.text,r=e.name,o=e.value;return{value:o||r||t||"",label:n||r||o||"",id:t||o||r,selected:e.selected||!1,sortOrder:e.sortOrder||0}}).sort(function(e,t){return e.sortOrder-t.sortOrder}):(console.warn("Invalid options:",e),[])},DR={text:function(e){return n().createElement(ID,PR({},e,{type:"text"}))},textbox:CE,email:function(e){return n().createElement(CE,PR({},e,{type:"email"}))},password:QD,url:function(e){return n().createElement(CE,PR({},e,{type:"url"}))},number:function(e){return n().createElement(ID,PR({},e,{type:"number"}))},ssn:function(e){return n().createElement(ID,PR({},e,{type:"ssn"}))},itin:function(e){return n().createElement(ID,PR({},e,{type:"itin"}))},tin:function(e){return n().createElement(ID,PR({},e,{type:"tin"}))},tel:function(e){return n().createElement(ID,PR({},e,{type:"phone"}))},phone:function(e){return n().createElement(ID,PR({},e,{type:"phone"}))},phonenumber:function(e){return n().createElement(ID,PR({},e,{type:"phone"}))},mobile:function(e){return n().createElement(ID,PR({},e,{type:"phone"}))},percentage:function(e){var t,r,o,i,a;return n().createElement(zj,PR({},e,{minValue:null!==(t=null!==(r=e.minValue)&&void 0!==r?r:e.minvalue)&&void 0!==t?t:0,maxValue:null!==(o=null!==(i=e.maxValue)&&void 0!==i?i:e.maxvalue)&&void 0!==o?o:100,decimalScale:null!==(a=e.decimalScale)&&void 0!==a?a:2,placeholder:e.placeholder}))},currency:GS,textarea:TR,button:YE,radio:Yj,radiobutton:Yj,radiotabbuttons:oR,radioswitch:Yj,select:vR,dropdown:vR,dynamicdropdown:$P,checkbox:Zx,checkboxgroup:FS,address:BE,identification:bD,grid:function(e){return n().createElement(VC,PR({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},beneficiary:function(e){return n().createElement(VC,PR({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},cardlist:function(e){return n().createElement(VC,PR({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},spinner:wR,file:aD,upload:aD,pdf:GD,pdfpackage:sj,date:TP,datetime:TP,month:TP,time:TP,week:TP,displaytext:MP,hyperlink:cD,link:cD,default:function(e){return console.warn("No component found for field type: ".concat(e.type,", falling back to text input")),n().createElement(CE,PR({},e,{type:"text"}))}},jR=function(e){return e?DR[e.toLowerCase()]||(console.warn("No component found for field type: ".concat(e,", using default text input")),DR.default):(console.warn("No field type provided, using default text input"),DR.default)};function RR(e){return RR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},RR(e)}var MR=["showQuestionLabels"];function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(t){FR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FR(e,t,n){return(t=function(e){var t=function(e){if("object"!=RR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=RR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==RR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return VR(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(VR(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,VR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,VR(d,"constructor",u),VR(u,"constructor",l),l.displayName="GeneratorFunction",VR(u,o,"GeneratorFunction"),VR(d),VR(d,o,"Generator"),VR(d,r,function(){return this}),VR(d,"toString",function(){return"[object Generator]"}),(qR=function(){return{w:i,m:p}})()}function VR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}VR=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){VR(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},VR(e,t,n,r)}function QR(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function zR(e){return UR.apply(this,arguments)}function UR(){return e=qR().m(function e(t){var n,r,o,i,a,s,l,u=arguments;return qR().w(function(e){for(;;)switch(e.n){case 0:i=null!==(n=(o=u.length>1&&void 0!==u[1]?u[1]:{}).pollIntervalMs)&&void 0!==n?n:100,a=null!==(r=o.timeoutMs)&&void 0!==r?r:8e3,s=Date.now();case 1:if(!(Date.now()-s<a)){e.n=5;break}if(l="function"==typeof t?t():{},!Object.values(l||{}).some(Boolean)){e.n=3;break}return e.n=2,new Promise(function(e){return setTimeout(e,i)});case 2:e.n=4;break;case 3:return e.a(2,!0);case 4:e.n=1;break;case 5:return e.a(2,!1)}},e)}),UR=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){QR(i,r,o,a,s,"next",e)}function s(e){QR(i,r,o,a,s,"throw",e)}a(void 0)})},UR.apply(this,arguments);var e}function WR(e){return WR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},WR(e)}function HR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(t){GR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GR(e,t,n){return(t=function(e){var t=function(e){if("object"!=WR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=WR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==WR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return KR(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(KR(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,KR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,KR(d,"constructor",u),KR(u,"constructor",l),l.displayName="GeneratorFunction",KR(u,o,"GeneratorFunction"),KR(d),KR(d,o,"Generator"),KR(d,r,function(){return this}),KR(d,"toString",function(){return"[object Generator]"}),(YR=function(){return{w:i,m:p}})()}function KR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}KR=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){KR(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},KR(e,t,n,r)}function XR(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function JR(e){return JR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},JR(e)}function ZR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ZR(Object(n),!0).forEach(function(t){tM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tM(e,t,n){return(t=function(e){var t=function(e){if("object"!=JR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=JR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==JR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nM=function(e,t,n,r,o){return Yc(e,t,{values:n.values,visibility:n.visibility,disabled:n.disabled,required:n.required},o,{formSchema:r})};function rM(e){return rM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rM(e)}function oM(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return iM(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(iM(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,iM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,iM(d,"constructor",u),iM(u,"constructor",l),l.displayName="GeneratorFunction",iM(u,o,"GeneratorFunction"),iM(d),iM(d,o,"Generator"),iM(d,r,function(){return this}),iM(d,"toString",function(){return"[object Generator]"}),(oM=function(){return{w:i,m:p}})()}function iM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}iM=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){iM(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},iM(e,t,n,r)}function aM(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function sM(e,t,n){return(t=function(e){var t=function(e){if("object"!=rM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lM=function(t){var r=t.question,o=t.isVisible,i=t.isDisabled,a=t.isRequired,s=t.value,l=t.parentContext,u=t.apiConfig,c=t.showQuestionLabels,d=void 0===c||c,p=t.isCardlistModal,f=void 0!==p&&p,m=cc(),h=m.state,v=m.setValue,y=m.setSubmitted,g=m.questionRuleDetails,b=m.formSchema,A=m.validateForm,w=m.setRequired,k=m.setNestedState,E=m.rulesEngine,C=(0,e.useRef)(o),x=(0,e.useRef)(!1),S=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,e.useContext)(oc),r=n.state,o=n.formState,i=n.onApiTrigger,a=n.handleApiTrigger,s=(0,e.useCallback)(function(){var e,n=(e=YR().m(function e(n){var s,l;return YR().w(function(e){for(;;)switch(e.n){case 0:if(!(s=a||(i&&"function"==typeof i?function(e){return i(e,r)}:null))){e.n=2;break}return l=$R($R({},n),{},{toastConfigOverride:t,contextStateSnapshot:{values:(null==o?void 0:o.values)||{},visibility:(null==o?void 0:o.visibility)||{},disabled:(null==o?void 0:o.disabled)||{},required:(null==o?void 0:o.required)||{},errors:(null==o?void 0:o.errors)||{},apiErrors:(null==o?void 0:o.apiErrors)||{},isSubmitted:(null==o?void 0:o.isSubmitted)||!1}}),e.n=1,s(l);case 1:return e.a(2,e.v);case 2:return e.a(2,null)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){XR(i,r,o,a,s,"next",e)}function s(e){XR(i,r,o,a,s,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}(),[o,a,i,r,t]);return{triggerApi:s,formState:o}}(),_=S.triggerApi;if((0,e.useEffect)(function(){if(o&&!C.current&&!x.current&&(null==r?void 0:r.apiUrl)&&"function"==typeof _&&function(e){var t,n;return!(null==e||!e.apiUrl||"dropdown"!==(null===(t=e.questionType)||void 0===t?void 0:t.toLowerCase())&&!0!==(null===(n=e.proxyConfig)||void 0===n?void 0:n.callOnMount))}(r)&&function(e,t){if(e){var n=Gc(e);return 0===n.length||n.every(function(e){var n=t[e];return null!=n&&""!==n})}return!1}(r,h.values)){x.current=!0;var e=nM(r,h.values[null==r?void 0:r.questionId],h,b,"pageLoad");_(e)}o||(x.current=!1),C.current=o},[o,r,_,h,b]),(0,e.useEffect)(function(){var e;if(null!=r&&r.questionId&&o){var t=r.questionId,n=r.apiUrl,i=r.questionType,a=r.addressGroup,s=null==h||null===(e=h.optionsByQuestionId)||void 0===e?void 0:e[t];if(n&&"text"===(null==i?void 0:i.toLowerCase())&&(null==a?void 0:a.toLowerCase().includes("owner_info_dropdown"))&&(null==s?void 0:s.length)>0){var u=ee(t);if(void 0!==(null==l?void 0:l.itemIndex)&&(null==l?void 0:l.parentId)&&k){var c=ee(l.parentId);k(c,l.itemIndex,{required:sM({},t,!0)}),null!=E&&E.requiredState&&E.requiredState.set(u,!0),null!=E&&E.updateAllInstanceStates&&E.updateAllInstanceStates(c,u,"required",!0)}else w&&w(u,!0)}}},[null==r?void 0:r.questionId,null==r?void 0:r.apiUrl,null==r?void 0:r.questionType,null==r?void 0:r.addressGroup,null==h?void 0:h.optionsByQuestionId,o,null==l?void 0:l.itemIndex,null==l?void 0:l.parentId,w,k,E]),null!=r&&r.questionId&&o){var O,I=r.questionId,T=r.name,P=r.label,B=r.questionType,D=r.options,j=void 0===D?[]:D,R=r.header,M=void 0===R?"":R,L=r.placeholder,N=void 0===L?"":L,F=r.hintText,q=r.defaultValue,V=r.format,Q=void 0===V?"":V,z=r.minLength,U=r.maxLength,W=r.min,H=r.max,$=r.encrypted,G=void 0!==$&&$,Y=r.maskInput,K=r.maskingType,X=void 0===K?"":K,J=r.maskingLength,Z=void 0===J?"":J,te=r.target,ne=void 0===te?"":te,re=r.validationErrorMessages,oe=void 0===re?{}:re,ie=r.showCheckBox,ae=void 0!==ie&&ie,se=r.isEsignDoc,le=void 0!==se&&se,ue=r.isOpenInNewTab,ce=void 0!==ue&&ue,de=r.addAdditional,pe=void 0!==de&&de,fe=r.addMedication,me=void 0!==fe&&fe,he=r.styleName,ve=void 0===he?"":he,ye=r.customQuestionValueList,ge=r.inputProps,be=r.dependency,Ae=r.fileUploads,we=r.allowedFileType,ke=r.fileSizeLimit,Ee=r.numberOfFiles,Ce=r.includeExtraDropDowns,xe=r.additionalDropDowns,Se=r.uploadQuestionAdditionalDropDown,_e=r.errorMessage,Oe=r.addressGroup,Ie=r.startDate,Te=r.endDate,Pe=r.dateFormat,Be=r.apiUrl,De=r.tooltip,je=void 0===De?"":De,Re=null==h||null===(O=h.optionsByQuestionId)||void 0===O?void 0:O[I];if(function(e,t,n,r){return e&&"text"===(null==t?void 0:t.toLowerCase())&&(null==n?void 0:n.toLowerCase().includes("owner_info_dropdown"))&&!(null!=r&&r.length)}(Be,B,Oe,Re))return null;var Me=function(e,t){var n=null==e?void 0:e.toLowerCase();return"text"===n&&null!=t&&t.toLowerCase().includes("address")?"address":"text"===n&&null!=t&&t.toLowerCase().includes("owner_info_dropdown")?"dropdown":n}(B,Oe),Le=jR(Me);if(Le){var Ne=function(e,t,n,r,o){return"text"===(null==t?void 0:t.toLowerCase())&&(null==n?void 0:n.toLowerCase().includes("address"))&&r&&Object.keys(r).length>0?eM(eM({},e),{},{"data-parent-id":r.parentId||o,"data-item-index":void 0===r.itemIndex?-1:r.itemIndex}):e}(ge,B,Oe,l,I),Fe=BR(Re||j),qe=d&&function(e){return!["radio","radiobutton","checkbox","link","button","cardlist","beneficiary","grid","submit","reset","hidden","checkboxgroup","displaytext"].includes(null==e?void 0:e.toLowerCase())}(B),Ve=function(e,t,n){var r,o,i,a=(null==n||null===(r=n.ruleValidationErrors)||void 0===r?void 0:r[e])||(null==n||null===(o=n.apiErrors)||void 0===o?void 0:o[e])||(null==n||null===(i=n.errors)||void 0===i?void 0:i[e])||null,s=JR(a);if(null!=t&&t.isCardList&&void 0!==(null==t?void 0:t.itemIndex)){var l,u,c,d,p="".concat(t.parentId,"_").concat(t.itemIndex),f=null===(l=n.nestedStates)||void 0===l?void 0:l[p];s=JR(a=(null==f||null===(u=f.ruleValidationErrors)||void 0===u?void 0:u[e])||(null==f||null===(c=f.apiErrors)||void 0===c?void 0:c[e])||(null==f||null===(d=f.errors)||void 0===d?void 0:d[e])||null)}return a&&"object"===JR(a)&&(a=Object.values(a).filter(Boolean).join(", ")),{fieldError:a,fieldErrorType:s}}(I,l,h),Qe=Ve.fieldError,ze=Ve.fieldErrorType,Ue=function(){var e,t=(e=oM().m(function e(){var t,n,o,i,a,s;return oM().w(function(e){for(;;)switch(e.n){case 0:if(t=null==B?void 0:B.toLowerCase(),n="button"===t,o=r.apiUrl,i=r.actionName&&"function"==typeof _,!n||!o&&!i){e.n=4;break}if("string"==typeof(null==r?void 0:r.apiUrl)&&0!==r.apiUrl.trim().length){e.n=3;break}return e.n=1,A();case 1:if(a=e.v,!(Object.keys(a).length>0)){e.n=2;break}return y(!0),e.a(2);case 2:if(!Je([".error_message_display_text",".error-message"])){e.n=3;break}return y(!0),e.a(2);case 3:s=nM(r,null,h,b,"buttonClick"),_(s);case 4:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){aM(i,r,o,a,s,"next",e)}function s(e){aM(i,r,o,a,s,"throw",e)}a(void 0)})});return function(){return t.apply(this,arguments)}}(),We=null!=N&&""!==String(N).trim()?N:F||q||P||"",He=function(e){var t=e.question,n=e.questionId,r=e.name,o=e.label,i=e.shouldShowLabel,a=e.value,s=e.formattedOptions,l=e.handleChange,u=e.handleBlur,c=e.handleButtonClick,d=e.isDisabled,p=e.isRequired,f=e.computedPlaceholder,m=e.fieldError,h=e.minLength,v=e.maxLength,y=e.min,g=e.max,b=e.header,A=e.format,w=e.encrypted,k=e.maskInput,E=e.maskingType,C=e.maskingLength,x=e.target,S=e.validationErrorMessages,_=e.showCheckBox,O=e.isEsignDoc,I=e.isOpenInNewTab,T=e.addAdditional,P=e.addMedication,B=e.questionRuleDetails,D=e.fieldInputProps,j=e.isVisible,R=e.apiConfig,M=e.dependency,L=e.state,N=e.styleName,F=e.customQuestionValueList,q=e.fileUploads,V=e.allowedFileType,Q=e.fileSizeLimit,z=e.numberOfFiles,U=e.includeExtraDropDowns,W=e.additionalDropDowns,H=e.uploadQuestionAdditionalDropDown,$=e.errorMessage,G=e.addressGroup,Y=e.startDate,K=e.endDate,X=e.dateFormat,J=e.questionType,Z=e.parentContext,ee=e.showQuestionLabels,te=e.isCardlistModal,ne=eM({id:String(n),questionId:String(n),name:r,label:i?"":o,value:void 0===a?"":a,options:s,onChange:l,onBlur:u,onClick:"button"===(null==J?void 0:J.toLowerCase())?c:void 0,disabled:d,required:p,placeholder:f,error:m,maxLength:v,minLength:h,min:y,max:g,header:b,format:A,encrypted:w,maskInput:k,maskingType:E,maskingLength:C,target:x,validationerrormessages:S,showcheckbox:_,isesigndoc:O,isopeninnewtab:I,addadditional:T,addmedication:P,questionRuleDetails:B,inputProps:D,visible:j,apiConfig:R,dependsOn:null==M?void 0:M.split(","),formData:L.values,styleName:N,customQuestionValueList:F,fileUploads:q,allowedFileType:V,fileSizeLimit:Q,numberOfFiles:z,includeExtraDropDowns:U,additionalDropDowns:W,uploadQuestionAdditionalDropDown:H,errorMessage:$,addressGroup:G,tooltip:t.tooltip||"",showQuestionLabels:ee},D);t.fieldProps&&Object.assign(ne,t.fieldProps);var re=w?{encrypted:!0}:{},oe=eM(eM({},ne),re);return G&&Object.assign(oe,{addressGroup:G}),"upload"===(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{allowedFileType:V,fileSizeLimit:Q,numberOfFiles:z,includeExtraDropDowns:U,additionalDropDowns:W,uploadQuestionAdditionalDropDown:H,errorMessage:$}),["text","tel","email","password","number","phonenumber","mobile","phone","ssn","tin"].includes(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{maskInput:k,maskingType:E,maskingLength:C}),["cardlist","beneficiary","grid"].includes(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{customQuestionValueList:F,questionType:"cardlist",min:y,max:g,isCardlistModal:te}),["date","datetime","month","time","week"].includes(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{startDate:Y,endDate:K,dateFormat:X}),"displaytext"===(null==J?void 0:J.toLowerCase())&&Object.assign(oe,{value:t.value,parentContext:Z}),oe}({question:r,questionId:I,name:T,label:P,shouldShowLabel:qe,value:s,formattedOptions:Fe,handleChange:function(e){var t=null==B?void 0:B.toLowerCase();("cardlist"===t||r.onChange)&&"function"==typeof r.onChange&&r.onChange(e);var n=function(e,t,n){var r,o;if("upload"===(null==t?void 0:t.toLowerCase())){var i=e.value,a=e.fileUploads;return n.fileUploads=a,i}return null!==(r=null==e||null===(o=e.target)||void 0===o?void 0:o.value)&&void 0!==r?r:e}(e,t,r);if(e&&"cardlist"!==t&&"button"!==t){var o=null!=l&&l.isCardList?{cardListId:l.parentId,instanceIndex:l.itemIndex}:null;v(I,n,null,o)}if(("dropdown"===t||"text"===t)&&r.apiUrl&&"function"==typeof _){var i=nM(r,n,h,b,"onChange");_(i)}},handleBlur:function(e){var t=null==B?void 0:B.toLowerCase();if(("text"===t||"currency"===t)&&r.apiUrl&&"function"==typeof _){var n,o=void 0===(null==e||null===(n=e.target)||void 0===n?void 0:n.value)?e:e.target.value,i=nM(r,o,h,b,"onBlur");_(i)}},handleButtonClick:Ue,isDisabled:i,isRequired:a,computedPlaceholder:We,fieldError:Qe,minLength:z,maxLength:U,min:W,max:H,header:M,format:Q,encrypted:G,maskInput:Y,maskingType:X,maskingLength:Z,target:ne,validationErrorMessages:oe,showCheckBox:ae,isEsignDoc:le,isOpenInNewTab:ce,addAdditional:pe,addMedication:me,questionRuleDetails:g,fieldInputProps:Ne,isVisible:o,apiConfig:u,dependency:be,state:h,styleName:ve,customQuestionValueList:ye,fileUploads:Ae,allowedFileType:we,fileSizeLimit:ke,numberOfFiles:Ee,includeExtraDropDowns:Ce,additionalDropDowns:xe,uploadQuestionAdditionalDropDown:Se,errorMessage:_e,addressGroup:Oe,startDate:Ie,endDate:Te,dateFormat:Pe,questionType:B,parentContext:l,showQuestionLabels:d,isCardlistModal:f}),$e=null!=(null==l?void 0:l.parentId)&&void 0!==(null==l?void 0:l.itemIndex)?"".concat(I,"_").concat(l.itemIndex):I;return n().createElement("div",{id:"question_".concat($e),className:"form-field-container ".concat(Qe?"has-error":""," ").concat(ve)},qe&&P&&n().createElement("div",{className:"field-label"},n().createElement("div",{className:"question_label"},P,d&&a&&n().createElement("span",{className:"required-mark"},"*"),d&&je&&n().createElement(gE,{tooltip:je})),M&&n().createElement("div",{className:"field-header"},M)),n().createElement(Le,He),Qe&&"string"===ze&&"upload"!==(null==B?void 0:B.toLowerCase())&&n().createElement("div",{className:"error-message"},Qe))}}return null};lM.propTypes={question:ad,isVisible:o().bool,isDisabled:o().bool,isRequired:o().bool,value:o().any,parentContext:o().object,apiConfig:o().object,showQuestionLabels:o().bool,isCardlistModal:o().bool};const uM=lM;var cM=function(e){return void 0!==(null==e?void 0:e.itemIndex)&&(null==e?void 0:e.parentId)},dM=function(e){return"".concat(e.parentId,"_").concat(e.itemIndex)},pM=function(e){var t=e.group,r=e.parentContext,o=void 0===r?null:r,i=e.apiConfig,a=e.defaultGroupClass,s=void 0===a?"":a,l=e.showQuestionLabels,u=void 0===l||l,c=e.isCardlistModal,d=void 0!==c&&c,p=cc().state;if(t&&Array.isArray(t.questions)){var f,m;if(!t.groupId||null===(f=null==p||null===(m=p.groupVisibility)||void 0===m?void 0:m[t.groupId])||void 0===f||f){var h=t.questions.some(function(e){var t,n,r,o=null==e?void 0:e.questionId;return!!o&&(null===(t=null!==(n=null==p||null===(r=p.visibility)||void 0===r?void 0:r[o])&&void 0!==n?n:e.visible)||void 0===t||t)}),v=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=ee(null==e?void 0:e.questionId),o=null==e||null===(t=e.questionType)||void 0===t?void 0:t.toLowerCase();return cM(n)?function(e,t,n,r){var o,i,a=null==r||null===(o=r.values)||void 0===o?void 0:o[n.parentId];if(Array.isArray(a)&&a[n.itemIndex]){var s=a[n.itemIndex];if(Array.isArray(null==s?void 0:s.properties)){var l,u,c=s.properties.find(function(e){return ee(e.editQuestionId)===t});if(c)return null!==(l=null!==(u=c.value)&&void 0!==u?u:e.defaultValue)&&void 0!==l?l:""}if(void 0!==s[t])return s[t]}return null!==(i=e.defaultValue)&&void 0!==i?i:""}(e,r,n,p):"cardlist"===o?function(e,t){var n,r=null==t||null===(n=t.values)||void 0===n?void 0:n[e];return Array.isArray(r)?r.map(function(e){return e?{name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){return{editQuestionId:ee(e.editQuestionId),property:e.property,renderMode:e.renderMode,value:e.value}}):[]}:{}}):[]}(r,p):function(e,t,n){var r,o,i,a;return null!==(r=null!==(o=null!==(i=null==n||null===(a=n.values)||void 0===a?void 0:a[t])&&void 0!==i?i:e.value)&&void 0!==o?o:e.defaultValue)&&void 0!==r?r:""}(e,r,p)},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.map(function(e,r){var o=ee(null==e?void 0:e.questionId);if(o){var a=function(e,t,n){return cM(n)?"".concat(e,"-").concat(t,"-").concat(n.itemIndex):"".concat(e,"-").concat(t)}(o,r,t),s=function(e,t,n,r){var o,i,a;if(cM(t)){var s,l,u,c=dM(t);return null===(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.visibility)||void 0===u?void 0:u[e])&&void 0!==l?l:r)||void 0===s||s}return null===(o=null!==(i=null==n||null===(a=n.visibility)||void 0===a?void 0:a[e])&&void 0!==i?i:r)||void 0===o||o}(o,t,p,e.visible),l=function(e,t,n,r){var o,i,a;if(cM(t)){var s,l,u,c=dM(t);return null!==(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.disabled)||void 0===u?void 0:u[e])&&void 0!==l?l:r)&&void 0!==s&&s}return null!==(o=null!==(i=null==n||null===(a=n.disabled)||void 0===a?void 0:a[e])&&void 0!==i?i:r)&&void 0!==o&&o}(o,t,p,e.disabled),c=function(e,t,n,r){var o,i,a;if(cM(t)){var s,l,u,c=dM(t);return null!==(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.required)||void 0===u?void 0:u[e])&&void 0!==l?l:r)&&void 0!==s&&s}return null!==(o=null!==(i=null==n||null===(a=n.required)||void 0===a?void 0:a[e])&&void 0!==i?i:r)&&void 0!==o&&o}(o,t,p,e.required);return n().createElement(uM,{key:a,question:e,isVisible:s,isDisabled:l,isRequired:c,value:v(e,t),parentContext:t,apiConfig:i,showQuestionLabels:u,isCardlistModal:d})}return null})},g="question-group ".concat(cM(o)?"card-list-question":""," ").concat(s||"").trim(),b=t.groupName&&!t.groupName.startsWith("--");return h?n().createElement("div",{className:g,key:"question-group-".concat((null==o?void 0:o.itemIndex)||"")},b&&n().createElement("h3",{className:"group-name"},t.groupName),y(t.questions,o)):y(t.questions,o)}return null}return null};pM.propTypes={group:sd,parentContext:o().object,apiConfig:o().object,defaultGroupClass:o().string,showQuestionLabels:o().bool,isCardlistModal:o().bool};const fM=pM;function mM(e){return mM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mM(e)}function hM(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return vM(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(vM(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,vM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,vM(d,"constructor",u),vM(u,"constructor",l),l.displayName="GeneratorFunction",vM(u,o,"GeneratorFunction"),vM(d),vM(d,o,"Generator"),vM(d,r,function(){return this}),vM(d,"toString",function(){return"[object Generator]"}),(hM=function(){return{w:i,m:p}})()}function vM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}vM=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var i=function(t,n){vM(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},vM(e,t,n,r)}function yM(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function gM(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){yM(i,r,o,a,s,"next",e)}function s(e){yM(i,r,o,a,s,"throw",e)}a(void 0)})}}function bM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bM(Object(n),!0).forEach(function(t){wM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wM(e,t,n){return(t=function(e){var t=function(e){if("object"!=mM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=CM(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function EM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||CM(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CM(e,t){if(e){if("string"==typeof e)return xM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xM(e,t):void 0}}function xM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var SM=function(t){var r,o=t.schema,i=void 0===o?[]:o,a=t.actionSchema,s=void 0===a?[]:a,l=t.onSubmit,u=t.isNested,c=void 0!==u&&u,d=t.parentContext,p=void 0===d?{}:d,f=t.apiConfig,m=t.onApiTrigger,h=t.toastConfig,v=void 0===h?{}:h,y=t.defaultGroupClass,g=void 0===y?"":y,b=t.rerunPageRulesOnNext,A=void 0===b||b,w=t.pageRenderers,k=void 0===w?{}:w,E=t.pageType,C=t.showQuestionLabels,x=void 0===C||C,S=t.isCardlistModal,_=void 0!==S&&S,O=cc(),I=O.state,T=O.setSubmitted,P=O.validateForm,B=O.onApiTrigger,D=O.handleApiTrigger,j=O.batchUpdateFields,R=O.updateFieldOptions,M=O.processPageLoadRules,L=O.clearApiError,N=O.setApiError,F=O.setError,q=(0,e.useRef)(I),V=(0,e.useRef)((null==I?void 0:I.required)||{});if((0,e.useEffect)(function(){q.current=I},[I]),(0,e.useEffect)(function(){if(null!=I&&I.required&&null!=I&&I.errors){for(var e=I.required,t=V.current,n=[],r=0,o=Object.entries(I.errors);r<o.length;r++){var i=EM(o[r],2),a=i[0];if(i[1]){var s=!1!==t[a],l=!1===e[a];s&&l&&n.push(a)}}if(n.length>0&&F){var u,c=kM(n);try{for(c.s();!(u=c.n()).done;){var d=u.value;F(d,null)}}catch(e){c.e(e)}finally{c.f()}}V.current=AM({},e)}else V.current=(null==I?void 0:I.required)||{}},[null==I?void 0:I.required,null==I?void 0:I.errors,F]),!Array.isArray(i))throw new TypeError("Invalid form schema provided");var Q=(0,e.useMemo)(function(){return function(e){if(Array.isArray(e)){var t,n=[],r=Qc(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(Array.isArray(null==o?void 0:o.questions)){var i,a=Qc(o.questions);try{for(a.s();!(i=a.n()).done;){var s=i.value;Uc(s,n)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}return[]}(i)},[i]),z=function(){var e=gM(hM().m(function e(t,n,r){var o,a,s,l,u,c;return hM().w(function(e){for(;;)switch(e.n){case 0:if(o=t.questionId,a=Kc(I),s=Yc(t,n,a,r,{formSchema:i}),!D){e.n=1;break}return e.a(2,D(AM(AM({},s),{},{questionId:o,contextStateSnapshot:a})));case 1:if(!(l=m||B)){e.n=5;break}return e.p=2,e.n=3,l(s,I);case 3:return u=e.v,e.a(2,fl(u,{questionId:o,applyUpdates:j,applyOptions:R,setApiError:N,clearApiError:L,showSuccessToast:function(e){return il(e,"success",v)},showErrorToast:function(e){return il(e,"error",v)}}));case 4:return e.p=4,c=e.v,il(c.message||"An error occurred during API operation","error",v),e.a(2,{errors:{error:c.message||"Unknown error occurred"}});case 5:return e.a(2,null)}},e,null,[[2,4]])}));return function(t,n,r){return e.apply(this,arguments)}}(),U=(0,e.useRef)(new Set);(0,e.useEffect)(function(){if(Q.length&&I){var e,t=kM(Q);try{for(t.s();!(e=t.n()).done;){var n,r,o=e.value,i=null===(n=null===(r=I.visibility)||void 0===r?void 0:r[o.questionId])||void 0===n||n,a="".concat(o.questionId,"_").concat(o.triggerType);if("pageLoad"===o.triggerType&&i&&!Mc(I,o.questionId)&&!U.current.has(a)){U.current.add(a);var s={questionId:o.questionId,questionType:o.questionType,addressGroup:o.addressGroup,apiUrl:o.apiUrl,proxyConfig:o.proxyConfig},l=I.values[o.questionId];z(s,l,"pageLoad")}}}catch(e){t.e(e)}finally{t.f()}}},[Q,null==I?void 0:I.visibility,null==I?void 0:I.values]);var W=function(){var e=gM(hM().m(function e(t,n){var r,o,i,a,s;return hM().w(function(e){for(;;)switch(e.n){case 0:if(n.preventDefault(),"back"!==(null==t?void 0:t.toLowerCase())){e.n=1;break}return l&&l(q.current,t),e.a(2);case 1:return e.n=2,P();case 2:if(s=e.v,!(Object.keys(s).length>0)){e.n=3;break}return T(!0),id(),e.a(2);case 3:return e.n=4,zR(function(){var e;return null===(e=q.current)||void 0===e?void 0:e.apiLoading});case 4:if(!e.v){e.n=5;break}e.n=6;break;case 5:return il("Still waiting for the latest server response. Please try again in a moment.","warning",v),e.a(2);case 6:if("next"!==(null==t?void 0:t.toLowerCase())||!A||!M){e.n=7;break}return e.n=7,M();case 7:if(!od(null===(r=q.current)||void 0===r?void 0:r.errors,null===(o=q.current)||void 0===o?void 0:o.apiErrors,null===(i=q.current)||void 0===i?void 0:i.ruleValidationErrors,null===(a=q.current)||void 0===a?void 0:a.nestedStates)){e.n=8;break}return T(!0),id(),e.a(2);case 8:if(!Je([".error_message_display_text",".error-message"])){e.n=9;break}return T(!0),id(),e.a(2);case 9:l&&l(q.current,t);case 10:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),H=c?"div":"form",$=E?String(E):null!==(r=i[0])&&void 0!==r&&r.groupId?String(i[0].groupId):null,G=$&&k[$]?k[$]:null,Y=function(e,t,r){var o=function(o){var i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,A,w,k,E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!o||!o.questionId)return console.warn("createFieldRenderer: Invalid question provided"),null;var C=e.state,x=o.questionId,S=null===(i=o.questionType)||void 0===i?void 0:i.toLowerCase(),_=t(S);if(!_)return console.warn("createFieldRenderer: No component found for type: ".concat(S)),null;var O=void 0!==E.value?E.value:null!==(a=null!==(s=null!==(l=null==C||null===(u=C.values)||void 0===u?void 0:u[x])&&void 0!==l?l:o.value)&&void 0!==s?s:o.defaultValue)&&void 0!==a?a:"",I=null===(c=null!==(d=null==C||null===(p=C.visibility)||void 0===p?void 0:p[x])&&void 0!==d?d:o.visible)||void 0===c||c,T=null!==(f=null!==(m=null==C||null===(h=C.disabled)||void 0===h?void 0:h[x])&&void 0!==m?m:o.disabled)&&void 0!==f&&f,P=null!==(v=null!==(y=null==C||null===(g=C.required)||void 0===g?void 0:g[x])&&void 0!==y?y:o.required)&&void 0!==v&&v,B=(null==C||null===(b=C.errors)||void 0===b?void 0:b[x])||(null==C||null===(A=C.ruleValidationErrors)||void 0===A?void 0:A[x])||(null==C||null===(w=C.apiErrors)||void 0===w?void 0:w[x])||null,D=(null==C||null===(k=C.optionsByQuestionId)||void 0===k?void 0:k[x])||o.options||[],j=r(D),R=E.showQuestionLabels,M=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(E,MR),L=void 0===R||R,N=NR(NR({id:String(x),questionId:String(x),name:o.name||x,label:o.label||"",value:void 0===O?"":O,options:j,disabled:T||M.disabled,required:P,placeholder:o.placeholder||o.hintText||o.defaultValue||"",error:B,maxLength:o.maxLength,minLength:o.minLength,min:o.min,max:o.max,header:o.header,format:o.format,encrypted:o.encrypted,maskInput:o.maskInput,maskingType:o.maskingType,maskingLength:o.maskingLength,target:o.target,validationerrormessages:o.validationErrorMessages,showcheckbox:o.showCheckBox,isesigndoc:o.isEsignDoc,isopeninnewtab:o.isOpenInNewTab,addadditional:o.addAdditional,addmedication:o.addMedication,visible:I,styleName:o.styleName||"",tooltip:o.tooltip||"",showQuestionLabels:L},o.fieldProps),M);return"upload"===S&&Object.assign(N,{allowedFileType:o.allowedFileType,fileSizeLimit:o.fileSizeLimit,numberOfFiles:o.numberOfFiles,includeExtraDropDowns:o.includeExtraDropDowns,additionalDropDowns:o.additionalDropDowns,uploadQuestionAdditionalDropDown:o.uploadQuestionAdditionalDropDown,errorMessage:o.errorMessage}),["text","tel","email","password","number","phonenumber","mobile","phone","ssn","tin"].includes(S)&&Object.assign(N,{maskInput:o.maskInput,maskingType:o.maskingType,maskingLength:o.maskingLength}),["cardlist","beneficiary","grid"].includes(S)&&Object.assign(N,{customQuestionValueList:o.customQuestionValueList,questionType:"cardlist",min:o.min,max:o.max}),["date","datetime","month","time","week"].includes(S)&&Object.assign(N,{startDate:o.startDate,endDate:o.endDate,dateFormat:o.dateFormat}),!N.onChange&&e.setValue&&(N.onChange=function(t){var n,r,o,i="upload"===S?null!==(n=null==t?void 0:t.value)&&void 0!==n?n:t:null!==(r=null==t||null===(o=t.target)||void 0===o?void 0:o.value)&&void 0!==r?r:t;e.setValue(x,i),M.onChange&&M.onChange(t)}),!N.onBlur&&e.setValue&&(N.onBlur=function(e){M.onBlur&&M.onBlur(e)}),n().createElement(_,N)};return o.displayName="FieldRenderer",o}(O,jR,BR),K=function(){return s&&0!==s.length?n().createElement("div",{className:"form-actions"},s.map(function(e,t){if(e&&"object"===mM(e)){var r,o=e.text,i=e.action,a=e.disabled,s=void 0!==a&&a,l=e.actionButtonId,u="action_".concat(i,"_").concat(t),c="btn ".concat("next"===i?"btn-primary":"btn-secondary"),d=(null===(r=I.actionButtonDisabled)||void 0===r?void 0:r[l])||!1,p=s||d,f=p?{cursor:"not-allowed"}:{};return n().createElement("button",{key:u,type:"button",disabled:p,className:c,style:f,onClick:function(e){return W(i,e)}},o)}return null})):null};return G?n().createElement(H,{onSubmit:c?void 0:function(e){return e.preventDefault()},className:"dynamic-form ".concat(void 0===(null==p?void 0:p.itemIndex)?"":"card-list-form")},n().createElement(G,{pageType:$,schema:i,state:I,formContext:O,renderField:Y,getFieldComponent:jR,formatOptions:BR,actionSchema:s,handleActionClick:W,parentContext:p,apiConfig:f,defaultGroupClass:g,isNested:c,showQuestionLabels:x}),K()):n().createElement(H,{onSubmit:c?void 0:function(e){return e.preventDefault()},className:"dynamic-form ".concat(void 0===(null==p?void 0:p.itemIndex)?"":"card-list-form")},i.map(function(e,t){var r=null!=e&&e.groupId?String(e.groupId):"group_".concat(t),o=k[r];if(o)return n().createElement(o,{key:r,groupId:r,group:e,schema:i,state:I,formContext:O,renderField:Y,getFieldComponent:jR,formatOptions:BR,actionSchema:s,handleActionClick:W,parentContext:p,apiConfig:f,defaultGroupClass:g,isNested:c,showQuestionLabels:x,isCardlistModal:_});var a=(null==e?void 0:e.groupId)||"group_".concat(t);return n().createElement(fM,{key:a,group:e,parentContext:p,apiConfig:f,defaultGroupClass:g,showQuestionLabels:x,isCardlistModal:_})}),K())};SM.propTypes={schema:ld.questionGroups,actionSchema:o().array,onSubmit:o().func,isNested:o().bool,parentContext:o().object,apiConfig:o().object,onApiTrigger:o().func,toastConfig:o().shape({disableToasts:o().bool,useHostToastify:o().bool}),defaultGroupClass:o().string,rerunPageRulesOnNext:o().bool,pageRenderers:o().objectOf(o().elementType),pageType:o().oneOfType([o().string,o().number]),showQuestionLabels:o().bool,isCardlistModal:o().bool};const _M=SM;function OM(e){return OM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OM(e)}function IM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?IM(Object(n),!0).forEach(function(t){PM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PM(e,t,n){return(t=function(e){var t=function(e){if("object"!=OM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=OM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==OM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var BM=function(t){var r=t.questionGroups,o=t.actionButtons,i=t.questionRuleDetails,a=void 0===i?[]:i,s=t.questionRules,l=void 0===s?[]:s,u=t.groupRuleDetails,c=void 0===u?[]:u,d=t.groupRules,p=void 0===d?[]:d,f=t.optionRuleDetails,m=void 0===f?[]:f,h=t.optionRules,v=void 0===h?[]:h,y=t.buttonRules,g=void 0===y?[]:y,b=t.buttonRuleDetails,A=void 0===b?[]:b,w=t.theme,k=void 0===w?{}:w,E=t.debug,C=void 0!==E&&E,x=t.onSubmit,S=t.validationErrors,_=void 0===S?[]:S,I=t.isNested,T=void 0!==I&&I,P=t.parentContext,B=void 0===P?{}:P,D=t.skipFormProvider,j=void 0!==D&&D,R=t.apiConfig,M=t.onApiTrigger,L=t.formApiRef,N=t.handleIncompleteChange,F=t.toastConfig,V=void 0===F?{}:F,Q=t.performanceConfig,z=t.engineOptions,U=t.defaultGroupClass,W=void 0===U?"":U,H=t.rerunPageRulesOnNext,$=void 0===H||H,G=t.pageRenderers,Y=void 0===G?{}:G,K=t.pageType,X=t.showQuestionLabels,J=void 0===X||X,Z=t.isCardlistModal,ee=void 0!==Z&&Z;C&&"undefined"!=typeof console&&"function"==typeof console.log&&console.log("Package Version:","1.2.100");var te=(0,e.useMemo)(function(){return TM(TM({},gc),k)},[k]),ne=n().createElement(Cc,{theme:te},n().createElement(_M,{schema:Array.isArray(r)?r.map(function(e){return e&&"object"===OM(e)&&!Array.isArray(e.questions)?TM(TM({},e),{},{questions:Array.isArray(e.questions)?e.questions:[]}):e}):[],actionSchema:o,onSubmit:x,isNested:T,parentContext:B,apiConfig:R,onApiTrigger:M,toastConfig:V,defaultGroupClass:W,rerunPageRulesOnNext:$,pageRenderers:Y,pageType:K,showQuestionLabels:J,isCardlistModal:ee})),re=ne;if(T||j||(re=n().createElement(uc,{formSchema:r,questionRuleDetails:a,questionRules:l,groupRuleDetails:c,groupRules:p,optionRuleDetails:m,optionRules:v,buttonRules:g,buttonRuleDetails:A,validationSchema:_,debug:C,onApiTrigger:M,formApiRef:L,handleIncompleteChange:N,toastConfig:V,performanceConfig:Q,engineOptions:z},ne)),R){var oe,ie,ae={baseURL:R.baseURL||(null===(oe=R.customApi)||void 0===oe?void 0:oe.baseUrl)||"",headers:(null===(ie=R.customApi)||void 0===ie?void 0:ie.headers)||{}};R.customApi&&Object.assign(ae,R.customApi),re=n().createElement(q,{config:ae},re)}return null!=V&&V.disableToasts||null!=V&&V.useHostToastify||(re=n().createElement(n().Fragment,null,re,n().createElement(O,{position:"top-right",autoClose:5e3}))),re};BM.propTypes={questionGroups:o().arrayOf(o().shape({groupName:o().string,questions:o().arrayOf(o().object)})),actionButtons:o().arrayOf(o().object),questionRuleDetails:o().arrayOf(o().object),questionRules:o().arrayOf(o().shape({targetQuestionId:o().oneOfType([o().string,o().number]).isRequired,expressionToEvaluateForTheAction:o().object.isRequired})),groupRuleDetails:o().arrayOf(o().object),groupRules:o().arrayOf(o().object),optionRuleDetails:o().arrayOf(o().object),optionRules:o().arrayOf(o().object),buttonRules:o().arrayOf(o().object),buttonRuleDetails:o().arrayOf(o().object),theme:o().object,debug:o().bool,onSubmit:o().func,validationErrors:o().arrayOf(o().shape({questionid:o().oneOfType([o().string,o().number]).isRequired,message:o().string.isRequired,groupId:o().oneOfType([o().string,o().number])})),isNested:o().bool,parentContext:o().object,skipFormProvider:o().bool,apiConfig:o().object,parentAddressGroup:o().string,onApiTrigger:o().func,formApiRef:o().shape({current:o().object}),handleIncompleteChange:o().func,toastConfig:o().shape({disableToasts:o().bool,useHostToastify:o().bool}),performanceConfig:o().shape({debounceDelayMs:o().number}),engineOptions:o().shape({enablePerActionGating:o().bool,maxEvaluationDepth:o().number}),rerunPageRulesOnNext:o().bool,pageRenderers:o().objectOf(o().elementType),pageType:o().oneOfType([o().string,o().number]),showQuestionLabels:o().bool,isCardlistModal:o().bool};const DM=((RM=function(e){return n().createElement(Dc,{fallback:Rc},n().createElement(jM,e))}).displayName="WithErrorBoundary(".concat((jM=BM).displayName||jM.name||"Component",")"),RM);var jM,RM;function MM(){var t=cc(),n=t.formData,r=t.errors,o=t.touched,i=t.isSubmitting,a=t.handleChange,s=t.handleSubmit,l=t.setFieldError,u=t.setFieldTouched,c=t.setIsSubmitting,d=t.resetForm,p=(0,e.useCallback)(function(e,t){var n=Fs(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]);return n&&l(e.questionId,n),n},[l]);return{formData:n,errors:r,touched:o,isSubmitting:i,handleChange:a,handleSubmit:s,validateField:p,setFieldTouched:u,setIsSubmitting:c,resetForm:d}}})(),s})());
103
103
  //# sourceMappingURL=index.js.map