freemium-survey-components 0.11.4 → 0.11.5

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/lib/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),r=require("react-transition-group"),o=e(require("react-dom"));function s(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}s(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid #ebeff3;\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n flex-direction: column;\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n}\n.freemium-survey-components .nps-container .nps-scale .help-text-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n background-color: #ebeff3;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choices {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #ebeff3;\n color: #000;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover {\n background: #e43e3d;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):hover {\n background: #00af50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4):hover {\n background: #f8c43e;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n color: #fff;\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const i=e=>{const{type_info:{linear_scale:{button_style:r="highlighted",button_shape:o="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:c}}=e,u=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n.useRef(Array.from({length:10+(0===a?1:0)},((e,n)=>n+a)));return t.createElement("div",{className:"nps-container","data-test-input":"nps"},t.createElement("div",{className:`nps-scale ${o} ${r}`},t.createElement("div",{className:"button-container"},t.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>t.createElement("button",{role:"radio","aria-checked":e.npsValue===n,key:n,"data-test-nps-choice":n,onClick:t=>{e.onChangeHandler(n)},className:`choice ${u(n)} ${e.npsValue===n&&"active"}`},n)))),t.createElement("div",{className:"help-text-container"},t.createElement("span",{className:"negative-text",role:"note"},`${a} - ${s}`),t.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${i}`)))),t.createElement("div",{className:"footer",role:"note"},c))},a=(e,n)=>(e.defaultProps=n,e);s('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic[focus-within] .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .input-basic:focus-within .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .end-max-length {\n transition: opacity ease 0.2s;\n opacity: 0;\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const c=["RANGE","NPS","RADIO","DROPDOWN"],u={default:500,compact:500,cozy:400},l={default:"600px",compact:"350px",cozy:"96%"},m={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},d=n.forwardRef(((e,r)=>{const o=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{o.current?.focus()}),300+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,isErrored:u,startLabel:l,isRequired:m,errorText:d,endLabel:p,maxLength:f=256,onChange:y,autoFocusInput:v,...h}=e;return t.createElement("div",{className:"input-container",style:i},e.label&&t.createElement("label",{className:"input-label "+(m?"required":"")},e.label),t.createElement(t.Fragment,null,l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${u?"error":""}${a||""}`},t.createElement("input",Object.assign({},h,{type:"text",autoComplete:"off",ref:o,style:s,onChange:e=>{e.target.value?.length>f||y?.(e)}})),c&&f>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${f}`)),p&&t.createElement("div",{className:"end-label"},p)),u&&d&&t.createElement("span",{className:"input-error"},e.errorText))})),p=n.forwardRef(((e,r)=>{const o=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{o.current?.focus()}),300+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,maxLength:u=1500,startLabel:l,isRequired:m,autoFocusInput:d,onChange:p,...f}=e;return t.createElement(t.Fragment,null,t.createElement("div",{className:"textarea-container",style:i},e.label&&t.createElement("label",{className:"input-label "+(m?"required":"")},e.label),l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${a||""}`},t.createElement("textarea",Object.assign({},f,{autoComplete:"off",ref:o,style:s,onChange:e=>{e.target.value?.length>u||p?.(e)}})),c&&u&&u>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${u}`)),e.endLabel&&t.createElement("div",{className:"end-label"},e.endLabel)))})),f=a(d,m),y=a(p,m);s('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover {\n border-color: #92a2b1;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const v=()=>t.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},t.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),h=({values:e=[],othersValue:r="",options:o,name:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:u})=>{const l=e.includes("__others__"),m=n.useRef(null);return n.useEffect((()=>{i&&setTimeout((()=>{m.current?.focus()}),300+a)}),[i]),t.createElement("div",{className:"checkbox-group"},t.createElement("button",{ref:m,className:"autofocus-button","aria-hidden":!0}),o?.filter((e=>"__others__"!==e.value)).map(((n,r)=>t.createElement(g,{key:n.id,checked:e?.includes(n.value),name:n.value,id:n.id,onChange:(t,r)=>{if(r)c([...e||[],n.value]);else{const t=e.indexOf(n.value);t>-1&&e.splice(t,1),c([...e])}}},n.value))),o?.find((e=>"__others__"===e.value))&&t.createElement(g,{key:"others",checked:l,name:"__others__",id:"__others__",onChange:(n,t)=>{if(t)c([...e,"__others__"]);else{const n=e.findIndex((e=>"__others__"===e));e.splice(n,1),c(e)}}},"Others"),l&&t.createElement(t.Fragment,null,t.createElement(f,{placeholder:"Enter your comment",value:r,onChange:e=>{u(s,e.target.value)},autoFocusDelay:10,label:""})))},g=a((e=>{const r=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),t.createElement("label",{className:`checkbox-label ${e.disabled&&"disabled"}`},t.createElement("input",{ref:r,id:e.id,type:"checkbox",name:e.name,readOnly:e.readOnly,disabled:e.disabled,"aria-disabled":e.disabled,checked:e.checked,onChange:e.readOnly?()=>{}:n=>e.onChange(n,n.target.checked)}),t.createElement("div",{className:"checkbox"},e.checked&&t.createElement("div",{className:"icon-container"},t.createElement(v,null)," ")),t.createElement("div",null,e.children))}),{checked:!1});s('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n color: #3a4b67;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover {\n border-color: #92a2b1;\n}');const x=({name:e,options:r,value:o,autoFocusGroup:s,autoFocusDelay:i,onChangeHandler:a,saveOthersValue:c,othersOption:u,othersRequired:l,othersValue:m,isFinalQn:d})=>{const p=n.useRef(null);return n.useEffect((()=>{s&&setTimeout((()=>{p.current?.focus()}),300+i)}),[s]),t.createElement("div",{className:"radio-group",role:"radiogroup"},t.createElement("button",{ref:p,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),r?.sort(((e,n)=>"__others__"===e.value?1:"__others__"===n.value?-1:0))?.map(((n,r)=>t.createElement(b,{key:n.value,value:n.value,name:e,onChange:n=>{"__others__"!==n.currentTarget.value&&c(e,null),a(n.currentTarget.value)},checked:o===n.value},"__others__"===n.value?"Others":n.value))),"__others__"===o&&t.createElement(t.Fragment,null,t.createElement(f,{value:m??"",onChange:n=>{"__others__"!==o&&d&&a("__others__"),c(e,n.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},b=a((e=>{const r=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),t.createElement("label",{className:"radio-label"},t.createElement("input",{ref:r,type:"radio",name:e.name,value:e.value,checked:e.checked,onChange:e.onChange}),t.createElement("div",{className:"radio"}),t.createElement("div",null,e.children))}),{checked:!1,autoFocus:!1});s(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n overflow: hidden;\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n}\n\n.progressbar-container.widget {\n position: absolute;\n top: 0;\n height: 2px;\n}\n\n.progressbar {\n transition: transform 0.2s linear 200ms;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const w=e=>{const{totalSteps:n,completedSteps:r,widget:o}=e;return t.createElement("div",{className:"progressbar-container "+(o?"widget":"")},t.createElement("div",{className:"progressbar",style:{width:(r>0?100/n:0)+"%",transform:`scaleX(${r})`}}))};s(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 600;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const k=()=>t.createElement(t.Fragment,null,"..."),_=e=>{const{inline:n=!1,children:r,disabled:o,className:s="",htmlType:i,type:a="primary",onClick:c,size:u,overrideStyleClassName:l="",loading:m=!1,...d}=e;return t.createElement("button",Object.assign({style:n?{display:"inline-block"}:{},disabled:o,className:`action-button ${s} ${l}`,type:i,onClick:c},d),m?t.createElement(k,null):r)},q=()=>t.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),E=()=>t.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),C=()=>t.createElement("svg",{width:"11",height:"10",viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{opacity:"0.01",x:"0.16748",width:"10",height:"10",fill:"white",fillOpacity:"0.01"}),t.createElement("path",{d:"M1.85129 1.68479L8.48395 8.31744",stroke:"#264966",strokeWidth:"1.5",strokeLinecap:"round"}),t.createElement("path",{d:"M8.48395 1.68479L1.85129 8.31744",stroke:"#264966",strokeWidth:"1.5",strokeLinecap:"round"})),S=()=>t.createElement("svg",{width:"8",height:"8",viewBox:"0 0 7 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6.08333 1.32682H0.583333C0.261167 1.32682 0 1.06565 0 0.743489C0 0.421323 0.261167 0.160156 0.583333 0.160156H6.08333C6.4055 0.160156 6.66667 0.421323 6.66667 0.743489C6.66667 1.06565 6.4055 1.32682 6.08333 1.32682Z",fill:"#264966"})),N=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none"},t.createElement("mask",{id:"a",maskUnits:"userSpaceOnUse",x:"-.400146",y:"-.400024",width:"11",height:"11",fill:"#000"},t.createElement("path",{fill:"#fff",d:"M-.400146-.400024h11v11h-11z"}),t.createElement("path",{d:"m4.70226 6.76428-2.6856 2.6856 2.60775-.00293c.02738-.00011.05452.0052.07983.01562.02532.01043.04833.02577.06769.04513.01936.01936.0347.04237.04512.06769.01043.02531.01574.05245.01563.07983l-.00293.41358c.00011.0274-.0052.0545-.01563.0799-.01043.0253-.02576.0483-.04512.0676-.01937.0194-.04237.0347-.06769.0452-.02532.0104-.05245.0157-.07983.0156l-3.59922.0029c-.082493.0001-.161625-.0326-.220005-.0909l-.111467-.1115c-.057526-.0589-.090102-.13767-.090934-.21998L.602787 6.2584c-.000112-.02738.005198-.05452.015625-.07984.010427-.02532.025763-.04832.045125-.06768.019362-.01936.042366-.0347.067685-.04513.025319-.01042.052451-.01573.079833-.01562h.416535c.02704-.00028.05387.00485.0789.01507.02504.01022.04779.02533.06691.04445.01912.01913.03424.04187.04446.06691s.01534.05186.01507.0789l-.00294 2.60775 4.74323-4.74323.0044-.00427 2.6856-2.6856-2.60775.00294c-.02738.00011-.05452-.0052-.07983-.01563-.02532-.01042-.04833-.02576-.06769-.04512-.01936-.01936-.0347-.04237-.04512-.06769-.01043-.02532-.01574-.05245-.01563-.07983l.00293-.413603c-.00011-.027382.0052-.054514.01563-.079833.01043-.025319.02576-.048323.04512-.067685.01937-.019362.04237-.034698.06769-.045125.02532-.010427.05245-.015737.07983-.015625L9.85762.599976c.08249-.000052.16158.032657.21998.090934l.1115.111467c.0575.058878.0901.13769.0909.220003l-.0029 3.59922c.0001.02738-.0052.05452-.0156.07983-.0105.02532-.0258.04833-.0452.06769-.0193.01936-.0423.0347-.0676.04512-.0254.01043-.0525.01574-.0799.01563h-.41651c-.02704.00027-.05387-.00485-.0789-.01507-.02504-.01022-.04779-.02533-.06691-.04446-.01912-.01912-.03424-.04187-.04446-.0669-.01022-.02504-.01534-.05186-.01506-.07891l.00293-2.60775-4.74323 4.74323-.0044.00427Z"})),t.createElement("path",{d:"m4.70226 6.76428-2.6856 2.6856 2.60775-.00293c.02738-.00011.05452.0052.07983.01562.02532.01043.04833.02577.06769.04513.01936.01936.0347.04237.04512.06769.01043.02531.01574.05245.01563.07983l-.00293.41358c.00011.0274-.0052.0545-.01563.0799-.01043.0253-.02576.0483-.04512.0676-.01937.0194-.04237.0347-.06769.0452-.02532.0104-.05245.0157-.07983.0156l-3.59922.0029c-.082493.0001-.161625-.0326-.220005-.0909l-.111467-.1115c-.057526-.0589-.090102-.13767-.090934-.21998L.602787 6.2584c-.000112-.02738.005198-.05452.015625-.07984.010427-.02532.025763-.04832.045125-.06768.019362-.01936.042366-.0347.067685-.04513.025319-.01042.052451-.01573.079833-.01562h.416535c.02704-.00028.05387.00485.0789.01507.02504.01022.04779.02533.06691.04445.01912.01913.03424.04187.04446.06691s.01534.05186.01507.0789l-.00294 2.60775 4.74323-4.74323.0044-.00427 2.6856-2.6856-2.60775.00294c-.02738.00011-.05452-.0052-.07983-.01563-.02532-.01042-.04833-.02576-.06769-.04512-.01936-.01936-.0347-.04237-.04512-.06769-.01043-.02532-.01574-.05245-.01563-.07983l.00293-.413603c-.00011-.027382.0052-.054514.01563-.079833.01043-.025319.02576-.048323.04512-.067685.01937-.019362.04237-.034698.06769-.045125.02532-.010427.05245-.015737.07983-.015625L9.85762.599976c.08249-.000052.16158.032657.21998.090934l.1115.111467c.0575.058878.0901.13769.0909.220003l-.0029 3.59922c.0001.02738-.0052.05452-.0156.07983-.0105.02532-.0258.04833-.0452.06769-.0193.01936-.0423.0347-.0676.04512-.0254.01043-.0525.01574-.0799.01563h-.41651c-.02704.00027-.05387-.00485-.0789-.01507-.02504-.01022-.04779-.02533-.06691-.04446-.01912-.01912-.03424-.04187-.04446-.0669-.01022-.02504-.01534-.05186-.01506-.07891l.00293-2.60775-4.74323 4.74323-.0044.00427Z",fill:"#264966"}),t.createElement("path",{d:"m4.70226 6.76428-.19158-.19732-.00287.00287.19445.19445Zm-2.6856 2.6856-.19445-.19445-.4702.4702.66496-.00075-.00031-.275Zm2.60775-.00293.00031.275h.00082l-.00113-.275Zm.14752.06075.19446-.19445-.00001-.00001-.19445.19446Zm.06075.14752.27499.00195.00001-.00082-.275-.00113Zm-.00293.41358-.27501-.0019.00001.003.275-.0011Zm-.06075.1475.19445.1945-.19445-.1945Zm-.06769.0452-.10471-.2543.10471.2543Zm-.07983.0156.00113-.275h-.00136l.00023.275Zm-3.59922.0029.00017.275h.00005l-.00022-.275Zm-.220005-.0909-.194454.1944.00017.0002.194284-.1946Zm-.111467-.1115-.196712.1922.002257.0023.194455-.1945Zm-.090934-.21998L.324837 9.8574l.000031.003.274986-.00278ZM.602787 6.2584l.275003.00022-.000005-.00135-.274998.00113Zm.015625-.07984L.36413 6.07385H.364129l.254283.10471Zm.045125-.06768.194453.19445h.000003l-.194456-.19445Zm.067685-.04513.104714.25429.000005-.00001-.104719-.25428Zm.079833-.01562-.001128.275h.001127l.000001-.275Zm.416535 0v.27501l.00281-.00002-.00281-.27499Zm.0789.01507-.10394.2546h.00001l.10393-.2546Zm.06691.04445.19445-.19445-.19445.19445Zm.04446.06691.2546-.10394-.2546.10394Zm.01507.0789-.275-.0028v.00249l.275.00031Zm-.00294 2.60775-.275-.00031-.00075.66497.47021-.4702-.19446-.19446Zm4.74323-4.74323-.19158-.19732-.00287.00287.19445.19445Zm.0044-.00427.19158.19733.00287-.00287-.19445-.19446Zm2.6856-2.6856.19445.19446.4702-.4702-.66496.00074.00031.275Zm-2.60775.00294-.00031-.275h-.00082l.00113.275Zm-.07983-.01563-.10472.25429.10472-.25429Zm-.06769-.04512.19446-.19446H6.3024l-.19445.19446Zm-.04512-.06769.25428-.10471v-.00001l-.25428.10472Zm-.01563-.07983-.27499-.00195-.00001.00082.275.00113Zm.00293-.413603.27502.001951L6.32513.81005l-.275.001127Zm.01563-.079833L5.81148.626625v.000004l.25428.104715Zm.04512-.067685L5.91643.469203v.000003l.19445.194453Zm.06769-.045125L6.07385.364252l.10472.254282ZM6.2584.602909 6.25728.87791l.00135-.000001-.00023-.275ZM9.85762.599976l-.00017-.275H9.8574l.00022.275Zm.21998.090934.1945-.194455-.0002-.000172-.1943.194627Zm.1115.111467.1967-.192197-.0023-.002257-.1944.194454Zm.0909.220003.275.00022v-.003l-.275.00278Zm-.0029 3.59922-.275-.00022v.00135l.275-.00113Zm-.0156.07983-.2543-.10472v.00001l.2543.10471Zm-.0452.06769-.1944-.19446.1944.19446Zm-.1475.06075.0012-.275h-.0012v.275Zm-.41651 0v-.27502l-.00281.00003.00281.27499Zm-.0789-.01507.10394-.2546-.10394.2546Zm-.06691-.04446.19446-.19445-.00001-.00001-.19445.19446Zm-.04446-.0669.25461-.10394-.00001-.00001-.2546.10395Zm-.01506-.07891.27499.00282.00001-.00251-.275-.00031Zm.00293-2.60775.275.00031.00075-.66496-.47021.4702.19446.19445ZM4.70666 6.76001l.19159.19733.00286-.00287-.19445-.19446Zm-.19885-.19018-2.6856 2.6856.38891.38891 2.6856-2.6856-.38891-.38891ZM2.01697 9.72488l2.60775-.00293-.00062-.55-2.60775.00293.00062.55Zm2.60857-.00293c-.00893.00003-.01777-.0017-.02601-.00509l.20943-.50857c-.05888-.02425-.12198-.0366-.18568-.03634l.00226.55Zm-.02601-.00509c-.00825-.0034-.01575-.0084-.02205-.0147l.3889-.38892c-.04503-.04503-.09853-.0807-.15742-.10495l-.20943.50857Zm-.02206-.01471c-.00631-.00631-.0113-.0138-.0147-.02205l.50857-.20943c-.02425-.05889-.05992-.11239-.10495-.15742l-.38892.3889Zm-.0147-.02205c-.0034-.00825-.00512-.01709-.00509-.02601l.55.00226c.00026-.06369-.01209-.12679-.03634-.18568l-.50857.20943Zm-.00508-.02683-.00294.41363.54999.0039.00293-.41363-.54998-.0039Zm-.00294.41663c-.00004-.0089.00169-.0177.00509-.026l.50856.2095c.02425-.0589.0366-.122.03634-.1857l-.54999.0022Zm.00509-.026c.0034-.0082.00839-.0157.0147-.022l.38891.3889c.04503-.045.0807-.0985.10495-.1574l-.50856-.2095Zm.01471-.022c.0063-.0063.01379-.0113.02205-.0147l.20943.5085c.05889-.0242.11239-.0599.15742-.1049l-.3889-.3889Zm.02205-.0147c.00824-.0034.01708-.0051.02601-.0051l-.00226.55c.06369.0002.1268-.0121.18568-.0364l-.20943-.5085Zm.02465-.0051-3.59922.0029.00045.55 3.59922-.0029-.00045-.55Zm-3.59917.0029c-.00957 0-.01876-.0038-.025541-.01054l-.388568.38924c.109981.1098.259058.1714.414459.1713l-.00035-.55Zm-.025371-.01037-.111467-.11146-.388909.38893.111468.1114.388908-.38887Zm-.109222-.10919c-.008001-.00819-.012532-.01915-.012648-.0306l-.549971.00556c.001548.1532.062169.2998.169221.4094l.393398-.38436Zm-.012634-.0276.002934-3.59922-.55-.00045L.324854 9.8574l.549999.00044Zm.002932-3.60057a.0675974.0675974 0 0 1-.005091.02601l-.508565-.20943c-.024249.05888-.036601.12199-.03634.18567l.549996-.00225Zm-.005092.02601c-.003395.00825-.008392.01574-.014703.02205l-.388906-.38891c-.045036.04504-.080705.09854-.104954.15743l.508563.20943Zm-.0147.02205c-.006311.00631-.013807.01131-.022057.01471l-.209429-.50857c-.058887.02425-.112392.05992-.157426.10496l.388912.3889Zm-.022052.0147c-.008251.0034-.017093.00513-.026013.0051l.002254-.55c-.063684-.00026-.12679.01209-.185679.03634l.209438.50856Zm-.024887.0051h.416536v-.55H.811055l-.000001.55Zm.419346-.00001c-.00954.00009-.01901-.00171-.02785-.00532l.20788-.5092c-.05891-.02405-.12202-.03611-.18564-.03546l.00561.54998Zm-.02784-.00532c-.00884-.00361-.01687-.00894-.02361-.01569l.3889-.38891c-.04499-.04499-.09851-.08055-.15742-.1046l-.20787.5092Zm-.02362-.01569c-.00674-.00675-.01208-.01477-.01568-.02361l.5092-.20788c-.02405-.05891-.05962-.11243-.10461-.15742l-.38891.38891Zm-.01568-.02361c-.00361-.00884-.00542-.0183-.00532-.02784l.54997.00561c.00065-.06362-.0114-.12674-.03545-.18565l-.5092.20788Zm-.00533-.02535L1.15499 8.8629l.55.00062.00294-2.60775-.55-.00062Zm.46652 2.80252 4.74323-4.74323-.38891-.38891-4.74323 4.74323.38891.38891Zm4.74033-4.74038.0044-.00427-.38312-.39461-.0044.00427.38312.39461Zm.00729-.00712 2.6856-2.6856-.38891-.38891-2.6856 2.6856.38891.38891Zm2.49084-3.15506-2.60775.00294.00062.55 2.60775-.00294-.00062-.55Zm-2.60857.00294c.00892-.00004.01776.00169.02601.00509l-.20943.50857c.05889.02424.12199.0366.18568.03634l-.00226-.55Zm.02601.00509c.00825.0034.01575.00839.02206.0147l-.38891.38891c.04503.04503.09853.0807.15742.10496l.20943-.50857Zm.02205.0147c.00631.00631.01131.01381.01471.02206l-.50857.20943c.02425.05888.05992.11239.10496.15742l.3889-.38891Zm.01471.02205c.0034.00826.00513.0171.00509.02602l-.55-.00226c-.00026.06369.01209.12679.03635.18568l.50856-.20944Zm.00508.02684.00294-.413602-.54999-.003901-.00293.413603.54998.0039Zm.00294-.41668c.00004.00892-.00169.01776-.00509.026009l-.50856-.20943c-.02425.058887-.0366.121992-.03634.185675L6.32513.81005Zm-.00509.026013c-.0034.008247-.00839.015741-.0147.022049L5.91643.469206c-.04503.045032-.0807.098534-.10495.157419l.50856.209438Zm-.0147.022052c-.00631.006307-.0138.011304-.02205.014701L6.07385.364252c-.05889.024251-.11239.059921-.15742.104951l.38891.388912Zm-.02205.014701a.0675974.0675974 0 0 1-.02601.005091l.00225-.549996c-.06369-.000261-.12679.012091-.18568.036341l.20944.508564Zm-.02466.005093L9.85785.874976l-.00045-.55-3.59922.002933.00045.55ZM9.8578.874976c.00957-.000006.01876.003791.02554.01056l.38856-.389253c-.11-.109784-.259-.171404-.41445-.171307l.00035.55Zm.02537.010388.11147.111467.38886-.388908-.1114-.111467-.38893.388908Zm.10922.109197c.00801.008189.01251.019149.01261.030599l.55-.00556c-.0015-.153176-.0622-.29984-.1692-.409407l-.39341.384368Zm.01261.027589-.0029 3.59923.55.00044.0029-3.59922-.55-.00045Zm-.0029 3.60058c0-.00892.0017-.01777.0051-.02602l.5085.20945c.0243-.05889.0367-.122.0364-.18569l-.55.00226Zm.0051-.02601c.0034-.00825.0084-.01574.0147-.02206l.3889.38892c.045-.04504.0807-.09855.105-.15743l-.5086-.20943Zm.0147-.02206c.0063-.00631.0138-.0113.022-.0147l.2095.50857c.0589-.02425.1124-.05992.1574-.10496l-.3889-.38891Zm.022-.0147c.0083-.0034.0171-.00513.0261-.00509l-.0023.55c.0637.00026.1268-.01209.1857-.03634l-.2095-.50857Zm.0249-.00509h-.41651v.55h.41651v-.55Zm-.41932.00001c.00954-.00009.01901.00171.02785.00532l-.20789.5092c.05892.02405.12203.0361.18566.03545l-.00562-.54997Zm.02785.00532c.00883.00361.01686.00894.02361.01569l-.38892.3889c.045.045.09852.08056.15743.10461l.20788-.5092Zm.0236.01568c.00675.00675.01209.01478.0157.02362l-.50921.20787c.02405.05892.05961.11244.10461.15743l.3889-.38892Zm.01569.02361c.00361.00884.00542.01831.00532.02786l-.54997-.00563c-.00065.06363.0114.12675.03546.18566l.50919-.20789Zm.00534.02535.00293-2.60775-.55-.00061-.00293 2.60774.55.00062Zm-.46653-2.80251L4.51221 6.56556l.3889.38891 4.74323-4.74323-.38891-.38891ZM4.51509 6.56271l-.00439.00427.38313.3946.0044-.00427-.38314-.3946Z",fill:"#264966",mask:"url(#a)"})),B=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"76",height:"16",viewBox:"0 0 200 40"},t.createElement("g",{fill:"none",fillRule:"nonzero"},t.createElement("path",{fill:"#4D4D4D",d:"M48.6 1c-5 0-6.8 3.5-6.8 6.8v2h-1c-.8 0-1.4.6-1.4 1.4 0 .8.6 1.4 1.4 1.4h1v13.8c0 .8.6 1.5 1.5 1.5s1.5-.6 1.5-1.5V12.5H48c.8 0 1.4-.6 1.4-1.4 0-.8-.6-1.4-1.4-1.4h-3.2v-2c0-1.8.7-4 3.9-4 .8 0 1.4-.6 1.4-1.3-.1-.8-.7-1.4-1.5-1.4zM60 9.3c-2-.1-3.8.8-5 2.4v-.8c0-.8-.6-1.5-1.5-1.5s-1.5.7-1.5 1.5v15.4c0 .8.6 1.5 1.5 1.5s1.5-.6 1.5-1.5v-8.5c0-3.6 1.9-5.7 5-5.7.8 0 1.4-.6 1.4-1.4 0-.8-.7-1.4-1.4-1.4zM77.7 16.9c0-1.7-.5-3.4-1.4-4.8-1.4-1.9-3.7-3-6.1-2.8-5.1 0-8 3.4-8 9.3 0 6.1 2.9 9.4 8.4 9.4 2.2.1 4.4-.7 6.1-2.2.3-.2.5-.6.5-1 0-.7-.6-1.3-1.3-1.3-.3 0-.6.1-.8.3-1.2 1-2.8 1.6-4.4 1.6-3.3 0-5.4-2.2-5.5-5.7H76c1.7-.2 1.7-1.8 1.7-2.8zm-7.4-5c3 0 4.5 1.7 4.6 5h-9.7c.3-3.2 2.1-5 5.1-5zM87.5 17.1c-2.2-.8-4-1.4-4-3 0-1.8 2-2 3.1-2 1.5-.1 3 .5 4 1.5.5.5 1.4.5 1.9 0 .3-.3.4-.6.4-1 0-.3-.1-.6-.3-.9-1.5-1.7-3.7-2.7-5.9-2.5-3.7 0-6 1.9-6 4.8 0 3.6 3.2 4.7 6 5.7 2.1.7 4 1.3 4 2.9 0 2.1-2.4 2.5-3.8 2.5-1.7.1-3.4-.6-4.6-1.8-.3-.3-.6-.4-1-.5-.7 0-1.3.6-1.3 1.3 0 .3.1.6.3.9 1.7 2 4.1 3 6.6 3 4.2 0 6.7-2 6.7-5.2-.2-3.7-3.3-4.7-6.1-5.7zM104.8 9.2c-1.8-.1-3.6.7-4.8 2.1V1.5c0-.8-.6-1.5-1.5-1.5-.8 0-1.4.6-1.4 1.5v24.8c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.5V17c0-3.4 1.6-5.1 4.8-5.1 3.2 0 4.3 1.4 4.3 4.8v9.6c0 .8.6 1.5 1.5 1.5.8 0 1.4-.6 1.4-1.5V16.2c0-4.6-2.4-7-7.2-7zM136.2 9.5c-.6 0-1.2.4-1.4 1l-4.2 11.8-3.4-11.8c-.3-.8-1.1-1.1-1.9-.9-.4.1-.7.5-.9.9L121 22.3l-4-11.9c-.2-.6-.7-1-1.4-.9-.8 0-1.4.6-1.4 1.4 0 .2 0 .4.1.6l5.6 15.3c.2.6.7 1 1.4 1 .6 0 1.2-.4 1.4-1l3.3-11.2 3.3 11.2c.2.6.8 1 1.4 1 .6 0 1.2-.4 1.4-1l5.6-15.3c.1-.2.1-.4.1-.6-.2-.8-.8-1.4-1.6-1.4zM146.8 9.2c-5.3 0-8.2 3.3-8.2 9.3 0 6 2.9 9.4 8.2 9.4 5.3 0 8.2-3.3 8.2-9.4 0-6.1-2.9-9.3-8.2-9.3zm0 16c-3.5 0-5.3-2.2-5.3-6.7s1.8-6.7 5.3-6.7 5.2 2.3 5.2 6.7-1.7 6.8-5.2 6.7zM166.2 9.3c-2-.1-3.8.8-5 2.4v-.8c0-.8-.6-1.5-1.4-1.5-.8 0-1.5.6-1.5 1.4v15.4c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.4v-8.5c0-3.6 1.9-5.7 5-5.7.8 0 1.4-.6 1.4-1.4 0-.8-.6-1.4-1.4-1.4zM177.3 16.9l6-4.8c.4-.3.6-.7.6-1.2 0-.8-.6-1.4-1.4-1.4-.4 0-.7.1-1 .4l-8.6 7V1.5c0-.8-.6-1.5-1.4-1.5-.8 0-1.5.6-1.5 1.4v24.8c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.4v-6l2-1.6 6.6 8.4c.3.4.8.7 1.2.7.8 0 1.4-.6 1.4-1.4 0-.3-.1-.7-.3-.9l-6.5-8.6zM193.7 17.1c-2.2-.8-4-1.4-4-3 0-1.8 2-2 3.1-2 1.5-.1 3 .5 4 1.5.3.3.6.4 1 .4.7-.1 1.2-.7 1.2-1.4 0-.3-.1-.6-.3-.9-1.5-1.7-3.7-2.7-5.9-2.5-3.7 0-6 1.9-6 4.8 0 3.6 3.2 4.7 6 5.7 2.1.7 4 1.3 4 2.9 0 2.1-2.4 2.5-3.8 2.5-1.7.1-3.4-.6-4.6-1.8-.3-.3-.6-.4-1-.5-.7 0-1.3.6-1.3 1.3 0 .3.1.6.3.9 1.7 1.9 4.1 2.9 6.7 2.8 4.2 0 6.7-2 6.7-5.2-.2-3.5-3.3-4.5-6.1-5.5z"}),t.createElement("path",{fill:"#9B65C3",d:"M.2 25.5C.7 29.1 2.4 32.4 5 35l5.8-5.8c0-6.1 3.2-11.7 8.5-14.8L.2 25.5z"}),t.createElement("path",{fill:"#9B65C3",d:"M10.8 29.2c-3 0-5.9-.8-8.5-2.3-.7-.4-1.4-.9-2.1-1.4.5 3.6 2.2 6.9 4.8 9.5l5.8-5.8z"}),t.createElement("path",{fill:"#BE63C5",d:"M10.8 29.2L5 35c2.6 2.6 5.9 4.3 9.5 4.8l11-19.1c-3 5.2-8.6 8.5-14.7 8.5z"}),t.createElement("path",{fill:"#BF63C6",d:"M13.1 37.7c-1.5-2.6-2.3-5.5-2.3-8.5L5 35c2.6 2.6 5.9 4.3 9.5 4.8-.5-.7-1-1.4-1.4-2.1z"}),t.createElement("path",{fill:"#3278B1",d:"M32.5 6.8l-13.2 7.6c-5.3 3-11.7 3-17 0C.8 17 0 20 0 23c0 .8.1 1.7.2 2.5.7.5 1.4 1 2.1 1.4 2.6 1.5 5.5 2.3 8.5 2.3l22-22c-.1-.1-.2-.2-.3-.4z"}),t.createElement("path",{fill:"#3278B2",d:"M2.3 26.9c2.6 1.5 5.5 2.3 8.5 2.3 0-6.1 3.2-11.7 8.5-14.8L.2 25.4c.7.6 1.4 1.1 2.1 1.5z"}),t.createElement("path",{fill:"#45A4EC",d:"M2.3 14.4C.8 17 0 20 0 23c0 .8.1 1.7.2 2.5l19.1-11.1c-5.2 3.1-11.7 3.1-17 0z"}),t.createElement("path",{fill:"#19BB7D",d:"M32.8 7.2c-.3-.3-.5-.5-.8-.7-.6-.4-1.4-.6-2.1-.6H17c-6.1 0-11.7 3.3-14.7 8.5 5.3 3 11.7 3 17 0-5.3 3-8.5 8.7-8.5 14.8 6.1 0 11.7-3.2 14.8-8.5l7.6-13.2c-.2-.1-.3-.2-.4-.3z"}),t.createElement("path",{fill:"#08C7FB",d:"M19.3 14.4l13.2-7.6c-.2-.1-.3-.3-.5-.4l-29.7 8c5.3 3.1 11.8 3.1 17 0z"}),t.createElement("path",{fill:"#59F2F6",d:"M29.8 5.9H17c-6.1 0-11.7 3.3-14.7 8.5l29.7-8c-.7-.3-1.4-.5-2.2-.5z"}),t.createElement("path",{fill:"#DA3757",d:"M25.6 20.7l7.6-13.2c-.1-.1-.2-.2-.3-.4l-22 22c0 3 .8 5.9 2.3 8.5.4.7.9 1.4 1.4 2.1.8.1 1.6.2 2.4.2 3 0 5.9-.8 8.5-2.3-3-5.2-3-11.7.1-16.9z"}),t.createElement("path",{fill:"#D33C4E",d:"M10.8 29.2c0 3 .8 5.9 2.3 8.5.4.7.9 1.4 1.4 2.1l11-19.1c-3 5.2-8.6 8.5-14.7 8.5z"}),t.createElement("path",{fill:"#EE5A24",d:"M25.6 20.7l-11 19.1c.8.1 1.6.2 2.5.2 3 0 5.9-.8 8.5-2.3-3.1-5.3-3.1-11.8 0-17z"}),t.createElement("path",{fill:"#8BDF55",d:"M33.5 8c-.3-.5-.6-.9-1-1.2l-13.2 7.6c-5.3 3-8.5 8.7-8.5 14.8 6.1 0 11.7-3.2 14.8-8.5-3 5.3-3 11.7 0 17 5.2-3 8.5-8.6 8.5-14.6V10.2c0-.8-.2-1.5-.6-2.2z"}),t.createElement("path",{fill:"#25C16F",d:"M32.5 6.8l-13.2 7.6c-5.3 3-8.5 8.7-8.5 14.8l22-22c-.1-.1-.2-.3-.3-.4z"}),t.createElement("path",{fill:"#8BDF55",d:"M10.8 29.2c6.1 0 11.7-3.2 14.8-8.5l7.6-13.2c-.1-.1-.2-.2-.3-.4L10.8 29.2z"}),t.createElement("path",{fill:"#FB0",d:"M33.2 7.5l-7.6 13.2c-3 5.3-3 11.7 0 17l8-29.7c-.2-.2-.3-.3-.4-.5z"}),t.createElement("path",{fill:"#FFA800",d:"M25.6 37.7c5.3-3 8.5-8.6 8.5-14.7V10.2c0-.8-.2-1.5-.6-2.2l-7.9 29.7z"}))),z=({question:e,formValues:n,othersMeta:r,onChangeHandler:o,saveOthersValue:s,autoFocus:a,autoFocusDelay:c,isFinalQn:u})=>{switch(e.type_info.question_type){case"RANGE":return t.createElement(i,{type_info:e.type_info,onChangeHandler:o,npsValue:n[e.name]});case"CHECKBOX":case"MULTI_SELECT":return t.createElement(h,{name:e.name,autoFocusGroup:a,values:n[e.name],othersValue:r[e.name],options:e.type_info.choices,onChangeHandler:o,saveOthersValue:s,othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,autoFocusDelay:c});case"RADIO":case"DROPDOWN":return t.createElement(x,{autoFocusGroup:a,autoFocusDelay:c,name:e.name,onChangeHandler:o,saveOthersValue:s,options:e.type_info.choices,value:n[e.name],othersValue:r[e.name],othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,isFinalQn:u});case"INPUT":case"TEXT":return e.type_info?.meta?.readOnly?t.createElement("div",{className:"message-container"},e.type_info?.meta?.value):t.createElement("div",{className:"responsive-text-field"},t.createElement(f,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,value:n[e.name]||"",placeholder:e.type_info?.meta?.placeholder??"",onChange:e=>o(e.target.value)}),t.createElement(y,{autoFocusInput:a,autoFocusDelay:c,label:"",maxLength:256,isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>o(e.target.value)}));case"PARAGRAPH":return t.createElement(y,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>o(e.target.value)});default:return console.error(`Question type ${e.type_info.question_type} not found`),null}},I=(e,n,t)=>{if(e){let r={};t&&(r={"{{nps.rating}}":t}),n&&(r={...r,...n});const o=new RegExp(Object.keys(r).join("|"),"gi");e=e.replace(o,(function(e){return r[e.toLowerCase()]}))}return e},R=e=>({...e.brand_color&&{"--brand-color":e.brand_color},...e.body_background_color&&{"--background-color":e.body_background_color},...e.secondary_button_color&&{"--secondary-button-color":e.secondary_button_color},...e.question_background_color&&{"--question-background-color":e.question_background_color},...e.primary_button_text_color&&{"--button-text-color":e.primary_button_text_color},...e.secondary_button_text_color&&{"--secondary-button-text-color":e.secondary_button_text_color},...e.question_text_color&&{"--question-text-color":e.question_text_color}}),O=e=>n.useMemo((()=>{const n=JSON.parse(JSON.stringify(e)),t=[];return(n.question_details?.questions||[]).forEach((e=>{const n=e.type_info?.meta?.block;n&&(n.question_names||(n.question_names=[e.name]),t.push(n))})),{...n,meta:{...n.meta,blocks:t}}}),[e]);s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-components.card-survey-style {\n padding: 20px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button svg {\n transform: rotate(90deg);\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.card-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components.card-survey-style .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.card-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.card-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.card-survey-style .fade-enter .question-container {\n opacity: 0;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.card-survey-style .question-footer {\n display: flex;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.card-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.card-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.card-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.card-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .submit {\n max-width: 700px;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.card-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.card-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.card-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.card-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.card-survey-style .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n div.freemium-survey-components.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n div.freemium-survey-components.card-survey-style .question-footer {\n flex-direction: column-reverse;\n }\n div.freemium-survey-components.card-survey-style .question-footer > *:first-child {\n margin-bottom: 0px;\n }\n div.freemium-survey-components.card-survey-style .question-footer > * {\n margin-bottom: 20px;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons button {\n max-width: unset;\n }\n div.freemium-survey-components.card-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .thankyou .text {\n width: auto;\n }\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .input-container {\n display: none;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer {\n flex-direction: column-reverse;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer > *:first-child {\n margin-bottom: 0px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer > * {\n margin-bottom: 20px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation {\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons {\n flex-direction: column;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons button {\n max-width: unset;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-button {\n max-width: unset;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .thankyou .text {\n width: auto;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const Z=({thankYouQuestion:e,preview:r,placeholders:o,npsValue:s})=>(n.useEffect((()=>{r||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*e.type_info.meta?.redirectDelay??1e4)}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,o,s)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),M=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,setCurrentBlockIndexOfBlocksWithQnsDirty:r,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:i,preventQuestionAnimation:a,tempCurrentBlockIndexOfBlocksWithQns:c,setReverse:u,reverse:l})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{l?(n.current=Math.max(n.current-1,0),e.current=s.findIndex((e=>e.name===o[n.current].name))):(c.current=Math.max(n.current-1,0),e.current=s.findIndex((e=>e.name===o[c.current].name))),a.current=!1,r.current=!0,u(!0),i({})}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{a.current=!1,l?(c.current=Math.min(n.current+1,o.length-1),e.current=s.findIndex((e=>e.name===o[c.current].name))):(n.current=Math.min(n.current+1,o.length-1),e.current=s.findIndex((e=>e.name===o[n.current].name))),r.current=!0,u(!1),i({})}},t.createElement(q,null))),L=({widget:e,surveyStyle:n,formValues:r,blocksWithQns:o,blocks:s,thankYouQuestion:i,currentBlockIndexOfBlocksWithQns:a,currentBlockIndexOfBlocks:u,currentEditingBlock:l,isSubmitting:m,isValuesCommitted:d,isCurrentBlockFinal:p,setHorizontalScrollUnits:f,handleFormValues:y,skipBlock:v,setIsSubmitting:h,onSubmit:g,setIsSurveyCompleted:x,preventQuestionAnimation:b,preview:w,closePreview:k,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,question:C,block:S,reverse:N,othersMeta:B,setCurrentBlockIndexOfBlocksWithQnsDirty:z,...I})=>{const R=I.blockIndex??a.current,O=()=>(!c.includes(C.type_info.question_type)||"DROPDOWN"===C.type_info.question_type&&"__others__"===r[C.name])&&!p(),Z=()=>"RANGE"!==C.type_info.question_type&&!S.required&&!p(),L=()=>("DROPDOWN"===C.type_info.question_type&&!S.required&&r[C.name],!1),D=()=>p()&&(e||"standard"!==n),F=("MULTI_SELECT"===l.current.question.type_info.question_type&&r[l.current.question.name]?.includes("__others__")||"DROPDOWN"===l.current.question.type_info.question_type&&"__others__"===r[l.current.question.name])&&(!B[l.current.question.name]||""===B[l.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===n||0===R&&void 0===r[C.name]||0===a.current&&!N)&&t.createElement(M,{currentBlockIndex:u,currentBlockIndexOfBlocksWithQns:a,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:f,preventQuestionAnimation:b,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,reverse:N,setCurrentBlockIndexOfBlocksWithQnsDirty:z}),(O()||L()||Z()||D())&&t.createElement("div",{className:"action-buttons"},O()&&t.createElement(_,{onClick:()=>{z.current=!1,q(!1),y(o[R],null,!0)},disabled:l.current.required&&(!r[l.current.question.name]||Array.isArray(r[l.current.question.name])&&0===r[l.current.question.name].length)||l.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),Z()&&t.createElement("button",{className:"skip-button",onClick:()=>{z.current=!1,q(!1),v(C)}},"Skip"),D()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(l.current.required||l.current.question.type_info.pivot_question)&&(null==r[l.current.question.name]||0===r[l.current.question.name]?.length)||l.current.question.type_info.meta?.othersRequired&&F||m,onClick:()=>{h(!0),g()}},m?"Submitting":"Submit survey")),L()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),l.current=o[R],u.current=s.findIndex((e=>e.name===o[R].name)),v(C)}},"Clear selection")))},D=({survey:e,surveyStyle:o="standard",placeholders:s,onSubmit:i,widget:a,npsValue:u,preview:l,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[y,v]=n.useState(null),[h,g]=n.useState({}),[x,b]=n.useState(!1),[k,_]=n.useState([]),[q,E]=n.useState({}),[C,S]=n.useState(!1),[N,B]=n.useState(null),[R,O]=n.useState({}),M=n.useRef(null),D=n.useRef(null),F=n.useRef(-1),Q=n.useRef(null),T=n.useRef(0),W=n.useRef(0),V=n.useRef(!1),H=n.useRef(!1),P=n.useRef([]),Y=t.useRef(null!=u&&"card"===o),A=n.useRef(null),$=n.useRef(0),[U,j]=n.useState(!1),G=n.useRef();n.useEffect((()=>{f&&(A.current=f.find((e=>"TY"===e.name)),v(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{V.current&&(W.current=$.current,E({}))}),[U]),n.useEffect((()=>{if(y)if(D.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=u){F.current=Math.min(D.current.type_info.validation.max,Math.max(D.current.type_info.validation.min,u));const e=p.find((e=>e.name===y[0].question_names[0]));M.current={...y[0],question:e},P.current=[...P.current,{...y[0],question:e}],_(P.current),g({Q_1:F.current})}else if(!M.current&&y.length>0)return M.current=y[0],void J(y[0])}),[y,u]),t.useEffect((()=>{k.length&&(P.current=k,W.current=k.length-1),E({})}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&M.current.question&&(c.includes(M.current.question.type_info.question_type)&&("DROPDOWN"!==M.current.question.type_info.question_type||"__others__"!==h[M.current.question.name])||H.current)&&!K()&&(null!=u&&1==k.length?G.current?(clearTimeout(G.current),G.current=null,ee()):G.current=setTimeout((()=>{ee()}),1500):ee())}),[h]),n.useEffect((()=>{if(null!=h?.[D.current?.name])if(A.current?.is_based_on_rating){const e=D.current?.type_info?.choices[h?.[D.current?.name]-D.current?.type_info?.validation?.min??0]?.dependent_question_names,n=A.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));B(t)}else{const e=p.find((e=>e.name==A.current?.question_names[0]));B(e)}}),[h?.[D.current?.name]]);const X=()=>{i({...h,others_meta:R},(()=>{N?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=N?.type_info.meta?.redirectUrl:b(!0)}))},K=()=>(T.current===y.length-1||"end"===M.current.branchOption)&&W.current===k.length-1,J=e=>{let n={};if(e.is_based_on_rating){const t=D.current?.type_info?.choices[h?.[D.current?.name]-D.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===r))}else n=p.find((n=>n.name===e.question_names[0]));M.current.question=n;P.current.find((e=>e.question.name===n.name))?(W.current+=1,E({})):_([...P.current,{...e,question:n}])},ee=()=>{if(K())b(!0);else{if(M.current.nextBlock)T.current=y.findIndex((e=>e.name===M.current.nextBlock));else if(M.current.question.type_info?.meta?.branches){const e=M.current.question.type_info?.meta?.branches,n=h[M.current.question.name];let t;if(t="RANGE"===M.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return X(),void b(!0);T.current=y.findIndex((e=>e.name===t.nextBlock))}else T.current+=1}else T.current+=1;M.current=y[T.current],J(y[T.current])}},ne=(e,n,t)=>{if(Y.current=!1,t){if(H.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,r]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return T.current=y.findIndex((n=>n.name===e.name)),[t,r]})(e);g({...r,...null!=n&&{[e.question.name]:n}}),P.current=t}else g({...h,...null!=n&&{[e.question.name]:n}});D?.current?.name==e?.question?.name&&(F.current=n)}else g({...h,...null!=n&&{[e.question.name]:n}})};if(!M.current||!M.current.question)return null;const te=k[Math.min(W.current??k.length-1,k.length-1)];return t.createElement("div",{className:`freemium-survey-components ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},x?null:t.createElement(w,{totalSteps:y.length,completedSteps:T.current+(x?1:0)}),t.createElement(r.SwitchTransition,{mode:"out-in"},t.createElement(r.CSSTransition,{key:W.current+String(x),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:U?"fade-reverse":"fade"},t.createElement("div",{className:"questions"},x?t.createElement(Z,{thankYouQuestion:N,preview:l,placeholders:s,npsValue:F.current}):t.createElement("div",{ref:Q,id:`${te.question.name}`,className:`question-container ${a||"card"===o}`,"data-test-question-name":te.question.name},t.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:I(te.question.text,s,F.current)},"aria-label":`question-${W.current}`,role:"heading","aria-level":1}),t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},t.createElement(z,{question:te.question,isFinalQn:K(),formValues:h,othersMeta:R,autoFocus:!0,autoFocusDelay:"standard"===o?350:0,saveOthersValue:(e,n)=>{if(null===n){const n={...R};delete n[e],O({...n})}else O({...R,[e]:n})},onChangeHandler:e=>{H.current=!1,T.current=y.findIndex((e=>e.name===te.name)),M.current=te,V.current=!1,j(!1),ne(te,e,!("DROPDOWN"===te.question.type_info.question_type&&"__others__"===e)&&c.includes(te.question.type_info.question_type)&&!K())}})),t.createElement(L,{question:te.question,block:te,widget:a,surveyStyle:o,formValues:h,othersMeta:R,blocksWithQns:k,blocks:y,thankYouQuestion:N,currentBlockIndexOfBlocksWithQns:W,reverse:U,setReverse:j,currentBlockIndexOfBlocks:T,currentEditingBlock:M,isSubmitting:C,isValuesCommitted:H,isCurrentBlockFinal:K,setHorizontalScrollUnits:E,handleFormValues:ne,skipBlock:e=>{H.current=!0,delete h[e.name],g({...h})},setIsSubmitting:S,onSubmit:X,setIsSurveyCompleted:b,preventQuestionAnimation:Y,preview:l,closePreview:d,tempCurrentBlockIndexOfBlocksWithQns:$,setCurrentBlockIndexOfBlocksWithQnsDirty:V}))))))};s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 480px;\n --default-widget-max-height: 460px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n border-radius: 3px;\n border: 1px solid #efefef;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components.standard-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components.standard-survey-style .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components.standard-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.standard-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.standard-survey-style .question-footer {\n display: flex;\n justify-content: flex-start;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.standard-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components.standard-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.standard-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.standard-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n padding-bottom: 40px;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .fade-enter {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(40px);\n}\n.freemium-survey-components.standard-survey-style .fade-enter-active {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit-active {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(-40px);\n}\n.freemium-survey-components.standard-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.standard-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.standard-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .message-container:empty {\n display: none;\n}\n@media (max-width: 550px) {\n .freemium-survey-components.standard-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .action-buttons button {\n max-width: unset;\n }\n .freemium-survey-components.standard-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .thankyou .text {\n width: auto;\n }\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container {\n display: flex;\n }\n .freemium-survey-component .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n}\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const F=({thankYouQuestion:e,preview:r,placeholders:o,npsValue:s})=>(n.useEffect((()=>{r||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*(1e3*e.type_info.meta?.redirectDelay??1e4))}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,o,s)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),Q=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,preventQuestionAnimation:i})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{n.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[n.current].name)),i.current=!1,s(n.current)}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=r.length-1,onClick:()=>{i.current=!1,n.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[n.current].name)),s(n.current)}},t.createElement(q,null))),T=({widget:e,block:n,surveyStyle:r,formValues:o,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:u,currentBlockIndexOfBlocksWithQns:l,currentBlockIndexOfBlocks:m,currentEditingBlock:d,isSubmitting:p,isValuesCommitted:f,isCurrentBlockFinal:y,setHorizontalScrollUnits:v,handleFormValues:h,skipBlock:g,setIsSubmitting:x,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:q,closePreview:E,...C})=>{const S=C.blockIndex??l.current,N=C.question??i[S].question,B=()=>N.name===d.current.question.name&&(!c.includes(N.type_info.question_type)||"DROPDOWN"===N.type_info.question_type&&"__others__"===o[N.name])&&!y(),z=()=>"RANGE"!==N.type_info.question_type&&!n.required&&N.name===d.current.question.name&&!y(),I=()=>("DROPDOWN"===N.type_info.question_type&&N.name!==d.current.question.name&&!n.required&&o[N.name],!1),R=()=>y()&&(e||"standard"!==r)&&N.name===d.current.question.name,O=("MULTI_SELECT"===d.current.question.type_info.question_type&&o[d.current.question.name]?.includes("__others__")||"DROPDOWN"===d.current.question.type_info.question_type&&"__others__"===o[d.current.question.name])&&(!s[d.current.question.name]||""===s[d.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===r||0===S&&!o[N.name])&&t.createElement(Q,{currentBlockIndex:m,currentBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:v,preventQuestionAnimation:k}),(B()||I()||z()||R())&&t.createElement("div",{className:"action-buttons"},B()&&t.createElement(_,{onClick:()=>{h(i[S],null,!0)},disabled:d.current.required&&(!o[d.current.question.name]||Array.isArray(o[d.current.question.name])&&0===o[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&O,className:"next-button"},"Next"),z()&&t.createElement("button",{className:"skip-button",onClick:()=>g(N)},"Skip"),I()&&t.createElement("button",{className:"skip-button",onClick:()=>{d.current=i[S],m.current=a.findIndex((e=>e.name===i[S].name)),g(N)}},"Clear selection"),R()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(d.current.required||d.current.question.type_info.pivot_question)&&(null==o[d.current.question.name]||0===o[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&O||p,onClick:()=>{x(!0),b()}},p?"Submitting":"Submit survey"))))},W=({survey:e,surveyStyle:o="standard",placeholders:s,onSubmit:i,widget:a,npsValue:u,preview:l,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[y,v]=n.useState(null),[h,g]=n.useState({}),[x,b]=n.useState(!1),[k,q]=n.useState([]),[E,C]=n.useState(0),[S,N]=n.useState(!1),[B,R]=n.useState(null),[O,Z]=n.useState({}),M=n.useRef(null),L=n.useRef(null),D=n.useRef(-1),Q=n.useRef(null),W=n.useRef(0),V=n.useRef(0),H=n.useRef(!1),P=n.useRef([]),Y=n.useRef(null!=u&&"card"===o),A=n.useRef(null),$=n.useRef([]);n.useEffect((()=>{f&&(A.current=f.find((e=>"TY"===e.name)),v(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{if(y)if(L.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=u){D.current=Math.min(L.current.type_info.validation.max,Math.max(L.current.type_info.validation.min,u));const e=p.find((e=>e.name===y[0].question_names[0]));M.current={...y[0],question:e},P.current=[...P.current,{...y[0],question:e}],q(P.current),g({Q_1:D.current})}else if(!M.current&&y.length>0)return M.current=y[0],void G(y[0])}),[y,u]),n.useEffect((()=>{k.length&&(P.current=k,V.current=k.length-1),a||"standard"!==o?(Q.current&&(Q.current.style.maxHeight="unset"),$.current[W.current]=Q.current?.scrollHeight||$.current[W.current]||0,Q.current&&(Q.current.style.maxHeight="100%")):Q.current?.scrollIntoView({block:"start",behavior:"smooth"}),C(k.length-1)}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&M.current.question&&(c.includes(M.current.question.type_info.question_type)&&("DROPDOWN"!==M.current.question.type_info.question_type||"__others__"!==h[M.current.question.name])||H.current)&&!j()&&X()}),[h]),n.useEffect((()=>{if(null!=h?.[L.current?.name])if(A.current?.is_based_on_rating){const e=L.current?.type_info?.choices[h?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,n=A.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));R(t)}else{const e=p.find((e=>e.name==A.current?.question_names[0]));R(e)}}),[h?.[L.current?.name]]);const U=()=>{i({...h,others_meta:O},(()=>{B?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=B?.type_info.meta?.redirectUrl:b(!0)}))},j=()=>W.current===y.length-1||"end"===M.current.branchOption,G=e=>{let n={};if(e.is_based_on_rating){const t=L.current?.type_info?.choices[h?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===r))}else n=p.find((n=>n.name===e.question_names[0]));M.current.question=n;P.current.find((e=>e.question.name===n.name))?(C(E+1),V.current+=1):q([...P.current,{...e,question:n}])},X=()=>{if(j())b(!0);else{if(M.current.nextBlock)W.current=y.findIndex((e=>e.name===M.current.nextBlock));else if(M.current.question.type_info?.meta?.branches){const e=M.current.question.type_info?.meta?.branches,n=h[M.current.question.name];let t;if(t="RANGE"===M.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return U(),void b(!0);W.current=y.findIndex((e=>e.name===t.nextBlock))}else W.current+=1}else W.current+=1;M.current=y[W.current],G(y[W.current])}},K=e=>{H.current=!0,delete h[e.name],g({...h})},J=(e,n,t)=>{if(Y.current=!1,t){if(H.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,r]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return W.current=y.findIndex((n=>n.name===e.name)),[t,r]})(e);g({...r,...null!=n&&{[e.question.name]:n}}),P.current=t}else g({...h,...null!=n&&{[e.question.name]:n}});L?.current?.name==e?.question?.name&&(D.current=n)}else g({...h,...null!=n&&{[e.question.name]:n}})},ee=(e,n)=>{const t=k.find((n=>n.question.name===e));if(W.current=y.findIndex((e=>e.name===t.name)),M.current=t,null===n){const n={...O};delete n[e],Z({...n})}else Z({...O,[e]:n})};if(!M.current||!M.current.question)return null;const ne=("MULTI_SELECT"===M.current.question.type_info.question_type&&h[M.current.question.name]?.includes("__others__")||"DROPDOWN"===M.current.question.type_info.question_type&&"__others__"===h[M.current.question.name])&&(!O[M.current.question.name]||""===O[M.current.question.name]);return t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},x?null:t.createElement(w,{totalSteps:y.length,completedSteps:W.current}),t.createElement(r.SwitchTransition,{mode:"out-in"},t.createElement(r.CSSTransition,{key:String(x),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:a?"":"fade"},t.createElement("div",null,x?t.createElement(F,{thankYouQuestion:B,preview:l,placeholders:s,npsValue:D.current}):t.createElement(t.Fragment,null,t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:a||"card"===o?{transform:`translateX(calc(-${E} * 100%))`,height:`${$.current[W.current]}px`,transition:Y.current||k?.length<=1?"none":"all 300ms ease-out 0ms"}:{},className:"questions"},k.map(((e,n)=>t.createElement("div",{key:e.question.name,ref:Q,className:"question-container "+(!a&&"card"!==o||V.current===n?"":"hide-question-container")},t.createElement("div",{className:"question-text "+(0===n?"nps":""),dangerouslySetInnerHTML:{__html:I(e.question.text,s,D.current)},"aria-label":`question-${n}`,role:"heading","aria-level":1}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(z,{question:e.question,isFinalQn:j(),formValues:h,othersMeta:O,autoFocus:V.current===n,autoFocusDelay:"standard"===o?350:20,saveOthersValue:ee,onChangeHandler:n=>{H.current=!1,W.current=y.findIndex((n=>n.name===e.name)),M.current=e,J(e,n,!("DROPDOWN"===e.question.type_info.question_type&&"__others__"===n)&&c.includes(e.question.type_info.question_type)&&!j())}}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(T,{question:e.question,block:e,blockIndex:n,widget:a,surveyStyle:o,formValues:h,othersMeta:O,blocksWithQns:k,blocks:y,thankYouQuestion:B,currentBlockIndexOfBlocksWithQns:V,currentBlockIndexOfBlocks:W,currentEditingBlock:M,isSubmitting:S,isValuesCommitted:H,isCurrentBlockFinal:j,setHorizontalScrollUnits:C,handleFormValues:J,skipBlock:K,setIsSubmitting:N,onSubmit:U,setIsSurveyCompleted:b,preventQuestionAnimation:Y,preview:l,closePreview:d})))),!a&&"card"!==o&&j()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(M.current.required||M.current.question.type_info.pivot_question)&&(null==h[M.current.question.name]||0===h[M.current.question.name]?.length)||M.current.question.type_info.meta?.othersRequired&&ne||S,onClick:()=>{N(!0),i({...h,others_meta:O},(()=>{B?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=B?.type_info.meta?.redirectUrl:b(!0)}))}},S?"Submitting":"Submit survey"))))))))};s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n}\n\n.freemium-survey-components.widget-survey-components {\n overflow: hidden;\n}\n.freemium-survey-components.widget-survey-components * {\n scrollbar-color: rgba(216, 216, 216, 0.5) transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar {\n height: auto;\n height: initial;\n width: 6px;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-track {\n background: transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: rgba(216, 216, 216, 0.5) !important;\n}\n.freemium-survey-components.widget-survey-components p {\n margin: 0;\n}\n.freemium-survey-components.widget-survey-components .questions {\n min-width: 100%;\n max-width: 100%;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n position: relative;\n display: flex;\n justify-content: row;\n align-items: flex-end;\n height: 100%;\n transition: height 200ms ease;\n}\n.freemium-survey-components.widget-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n text-align: center;\n max-height: 100%;\n min-width: 100%;\n max-width: 700px;\n margin: 0 auto;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px 0;\n padding-top: 0;\n grid-gap: 28px;\n gap: 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .question-wrapper {\n width: 100%;\n flex-grow: 1;\n padding: 4px 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.widget-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n padding: 0 28px;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.widget-survey-components .question-text p {\n all: inherit;\n padding: 0;\n}\n.freemium-survey-components.widget-survey-components .nps-container .footer {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter {\n opacity: 1;\n transform: translateX(80px);\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active {\n position: absolute;\n opacity: 1;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-done {\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-exit {\n opacity: 0.05;\n pointer-events: none;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n pointer-events: none;\n opacity: 0;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter {\n opacity: 0;\n position: absolute;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active {\n opacity: 1;\n position: absolute;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit {\n opacity: 0.05;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active {\n opacity: 0;\n transform: translateX(80px);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active,\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.widget-survey-components .question-footer {\n margin: 0px auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: -webkit-sticky;\n position: sticky;\n padding: 0 28px;\n bottom: -28px;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 40px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.widget-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .skip-button {\n font-weight: 500;\n cursor: pointer;\n color: #3a4b67;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.widget-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.widget-survey-components .next-button,\n.freemium-survey-components.widget-survey-components .submit {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.widget-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.widget-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.widget-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\n.freemium-survey-components.widget-survey-components .message-container:empty {\n display: none;\n}\n\n.freemium-survey-components.widget-survey-components.compact-style .nps-question-text {\n text-align: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-container {\n grid-gap: 20px;\n gap: 20px;\n max-width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer {\n flex-direction: column-reverse;\n grid-gap: 0;\n gap: 0;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer > *:first-child {\n margin-bottom: 0px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer > * {\n margin-bottom: 20px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout {\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-buttons {\n grid-gap: 32px;\n gap: 32px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .submit,\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-button {\n max-width: unset;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 10px;\n gap: 10px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .thankyou .text {\n width: 86%;\n}\n\n.freemium-survey-components.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group {\n flex-direction: column;\n flex-wrap: nowrap;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\n.freemium-survey-components.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.widget-survey-components.cozy-style {\n max-width: 1000px;\n min-width: 600px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n text-align: left;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-question-text {\n text-align: center;\n width: 70%;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const V=({thankYouQuestion:e,preview:n,placeholders:r,npsValue:o},s)=>t.createElement(t.Fragment,null,t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,r,o)}})),H=({currentBlockIndexOfBlocks:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,tempCurrentBlockIndexOfBlocksWithQns:i,setCurrentBlockIndexOfBlocksWithQnsDirty:a,setReverse:c,reverse:u})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{u?(n.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[n.current].name))):(i.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[i.current].name))),a.current=!0,c(!0),s({})}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=r.length-1,onClick:()=>{u?(i.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[i.current].name))):(n.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[n.current].name))),a.current=!0,c(!1),s({})}},t.createElement(q,null))),P=({widget:e,widgetStyle:n,surveyStyle:r,formValues:o,blocksWithQns:s,blocks:i,thankYouQuestion:a,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:l,currentEditingBlock:m,isSubmitting:d,isValuesCommitted:p,isCurrentBlockFinal:f,setHorizontalScrollUnits:y,handleFormValues:v,skipBlock:h,setIsSubmitting:g,onSubmit:x,setIsSurveyCompleted:b,preview:w,closePreview:k,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,question:C,block:S,reverse:N,othersMeta:B,setCurrentBlockIndexOfBlocksWithQnsDirty:z,...I})=>{const R=I.blockIndex??u.current,O=()=>!(!e&&"standard"===r||0===R&&void 0===o[C.name]||0===u.current&&!N),Z=()=>(!c.includes(C.type_info.question_type)||"DROPDOWN"===C.type_info.question_type&&"__others__"===o[C.name])&&!f(),M=()=>"RANGE"!==C.type_info.question_type&&!S.required&&!f(),L=()=>("DROPDOWN"===C.type_info.question_type&&!S.required&&o[C.name],!1),D=()=>f()&&(e||"standard"!==r),F=("MULTI_SELECT"===m.current.question.type_info.question_type&&o[m.current.question.name]?.includes("__others__")||"DROPDOWN"===m.current.question.type_info.question_type&&"__others__"===o[m.current.question.name])&&(!B[m.current.question.name]||""===B[m.current.question.name].trim()),Q="compact"===n&&M()&&O(),T=!Q&&O();return t.createElement("div",{className:"question-footer"},Q?t.createElement("div",{className:"compact-footer-layout"},O()&&t.createElement(H,{currentBlockIndexOfBlocks:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,setCurrentBlockIndexOfBlocksWithQnsDirty:z,reverse:N}),M()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),h(C)}},"Skip")):null,(Z()||L()||"compact"!==n&&M()||T||D())&&t.createElement("div",{className:"action-buttons"},T&&t.createElement("div",{style:{marginRight:"auto"}},t.createElement(H,{currentBlockIndexOfBlocks:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,setCurrentBlockIndexOfBlocksWithQnsDirty:z,reverse:N})),Z()&&t.createElement(_,{onClick:()=>{z.current=!1,q(!1),v(s[R],null,!0)},disabled:m.current.required&&(!o[m.current.question.name]||Array.isArray(o[m.current.question.name])&&0===o[m.current.question.name].length)||m.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),D()&&t.createElement(_,{className:"submit",disabled:(m.current.required||m.current.question.type_info.pivot_question)&&(null==o[m.current.question.name]||0===o[m.current.question.name]?.length)||m.current.question.type_info.meta?.othersRequired&&F||d,onClick:()=>{x(),g(!0)}},d?"Submitting":"Submit survey"),L()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),m.current=s[R],l.current=i.findIndex((e=>e.name===s[R].name)),h(C)}},"Clear selection")))},Y=({survey:e,placeholders:s,onSubmit:i,widgetStyle:a,widgetHeaderQuerySelector:l,setCurrentSurveyState:m})=>{const d=e.question_details?.questions||[],p=e.meta?.blocks||[],[f,y]=n.useState(null),[v,h]=n.useState({}),[g,x]=n.useState(!1),[b,k]=n.useState([]),[_,q]=n.useState({}),[E,C]=n.useState(!1),[S,N]=n.useState(null),[B,R]=n.useState({}),O=n.useRef(null),Z=n.useRef(null),M=n.useRef(-1),[L,D]=n.useState(null),F=n.useRef(0),Q=n.useRef(0),T=n.useRef(!1),W=n.useRef([]),H=n.useRef(null),Y=n.useRef(0),[A,$]=n.useState(!1),U=n.useRef(0),j=n.useRef(!1);n.useEffect((()=>{p&&(H.current=p.find((e=>"TY"===e.name)),y(p.filter((e=>"TY"!==e.name))))}),[p]),n.useEffect((()=>{j.current&&(Q.current=Y.current,q({}))}),[A]),n.useEffect((()=>{if(f)return Z.current=d.find((e=>e.type_info?.pivot_question))??d.find((e=>"RANGE"===e.type_info?.question_type))??d[0],!O.current&&f.length>0?(O.current=f[0],void K(f[0])):void 0}),[f]),n.useEffect((()=>{b.length&&(W.current=b,Q.current=b.length-1,q({}))}),[b]),n.useEffect((()=>{Object.keys(v).length>0&&O.current.question&&(c.includes(O.current.question.type_info.question_type)&&("DROPDOWN"!==O.current.question.type_info.question_type||"__others__"!==v[O.current.question.name])||T.current)&&!X()&&J()}),[v]),n.useEffect((()=>{if(null!=v?.[Z.current?.name])if(H.current?.is_based_on_rating){const e=Z.current?.type_info?.choices[v?.[Z.current?.name]-Z.current?.type_info?.validation?.min??0]?.dependent_question_names,n=H.current?.question_names.find((n=>e?.includes(n))),t=d.find((e=>e.name===n));N(t)}else{const e=d.find((e=>e.name==H.current?.question_names[0]));N(e)}}),[v?.[Z.current?.name]]);n.useMemo((()=>{(()=>{if(L){L.style.minHeight="unset",L.style.maxHeight="unset",L.style.height="min-content",L.style.position="static";const e=Math.min(L?.scrollHeight+2,u[a]);L.style.height=e+"px",L.style.minHeight=e+"px",U.current=e}})()}),[L]),n.useEffect((()=>{m({question:b?.[Q.current]?.question,npsScore:M.current})}),[Q.current,b,M.current]);const G=()=>{i({...v,others_meta:B},(()=>{x(!0)}))},X=()=>(F.current===f.length-1||"end"===O.current.branchOption)&&Q.current===b.length-1,K=e=>{let n={};if(e.is_based_on_rating){const t=Z.current?.type_info?.choices[v?.[Z.current?.name]-Z.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=d.find((e=>e.name===r))}else n=d.find((n=>n.name===e.question_names[0]));O.current.question=n;W.current.find((e=>e.question.name===n.name))?(q({}),Q.current+=1):k([...W.current,{...e,question:n}])},J=()=>{if(X())x(!0);else{if(O.current.nextBlock)F.current=f.findIndex((e=>e.name===O.current.nextBlock));else if(O.current.question.type_info?.meta?.branches){const e=O.current.question.type_info?.meta?.branches,n=v[O.current.question.name];let t;if(t="RANGE"===O.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return G(),void x(!0);F.current=f.findIndex((e=>e.name===t.nextBlock))}else F.current+=1}else F.current+=1;O.current=f[F.current],K(f[F.current])}},ee=(e,n,t)=>{if(t){if(T.current=!0,null!=v[e.question.name]&&e.name!==b[b.length-1].name){const[t,r]=(e=>{const n=b.findIndex((n=>n.name===e.name)),t=b.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=v[n.question.name],e)),{});return F.current=f.findIndex((n=>n.name===e.name)),[t,r]})(e);h({...r,...null!=n&&{[e.question.name]:n}}),W.current=t}else h({...v,...null!=n&&{[e.question.name]:n}});Z?.current?.name==e?.question?.name&&(M.current=n)}else h({...v,...null!=n&&{[e.question.name]:n}})};if(!O.current||!O.current.question)return null;const ne=b[Math.min(Q.current??b.length-1,b.length-1)];return t.createElement("div",{className:`freemium-survey-components widget-survey-components\n ${a}-style `,id:"freemium-survey"},l&&!g&&document.querySelector(l)?o.createPortal(t.createElement(w,{totalSteps:f.length,completedSteps:F.current+(g?1:0),widget:!0}),document.querySelector(l)):null,t.createElement("div",{className:"questions",style:{height:U.current,...1===b.length?{transition:"none"}:{}}},t.createElement(r.TransitionGroup,{component:null},t.createElement(r.CSSTransition,{key:ne.question.name+String(g),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:A?"fade-reverse":"fade"},t.createElement("div",{ref:e=>e?D(e):null,id:`${ne.question.name}`,className:"question-container "+(g?"thankyou":""),"data-test-question-name":ne.question.name},g?t.createElement(V,{thankYouQuestion:S,placeholders:s,npsValue:M.current,setBlockElementRef:D}):t.createElement(t.Fragment,null,t.createElement("div",{className:"question-text "+("RANGE"===ne.question.type_info.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:I(ne.question.text,s,M.current)},"aria-label":`question-${Q.current}`,role:"heading","aria-level":1}),t.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},t.createElement(z,{question:ne.question,isFinalQn:X(),formValues:v,othersMeta:B,autoFocus:!0,autoFocusDelay:0,saveOthersValue:(e,n)=>{if(null===n){const n={...B};delete n[e],R({...n})}else R({...B,[e]:n})},onChangeHandler:e=>{T.current=!1,F.current=f.findIndex((e=>e.name===ne.name)),O.current=ne,j.current=!1,$(!1),ee(ne,e,!("DROPDOWN"===ne.question.type_info.question_type&&"__others__"===e)&&c.includes(ne.question.type_info.question_type)&&!X())}})),t.createElement(P,{question:ne.question,block:ne,widgetStyle:a,formValues:v,othersMeta:B,blocksWithQns:b,blocks:f,thankYouQuestion:S,currentBlockIndexOfBlocksWithQns:Q,reverse:A,setReverse:$,currentBlockIndexOfBlocks:F,currentEditingBlock:O,isSubmitting:E,isValuesCommitted:T,isCurrentBlockFinal:X,setHorizontalScrollUnits:q,handleFormValues:ee,skipBlock:e=>{T.current=!0,delete v[e.name],h({...v})},setIsSubmitting:C,onSubmit:G,setIsSurveyCompleted:x,tempCurrentBlockIndexOfBlocksWithQns:Y,setCurrentBlockIndexOfBlocksWithQnsDirty:j})))))))};s('#freshworks-survey-widget {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n --container-width: 350px;\n --widget-header-height: 36px;\n --widget-footer-height: 32px;\n}\n#freshworks-survey-widget * {\n box-sizing: border-box;\n}\n#freshworks-survey-widget input,\n#freshworks-survey-widget select,\n#freshworks-survey-widget textarea,\n#freshworks-survey-widget button {\n font-family: inherit;\n}\n@-webkit-keyframes mountWidget {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes mountWidget {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n#freshworks-survey-widget div.widget-survey-components {\n border: none;\n}\n#freshworks-survey-widget .freemium-survey-components {\n width: 100%;\n height: 100%;\n min-height: inherit;\n}\n#freshworks-survey-widget .default-container-style {\n right: calc(50% - var(--container-width) / 2);\n}\n#freshworks-survey-widget .compact-container-style {\n right: 40px;\n}\n#freshworks-survey-widget .compact-container-style .widget-footer {\n padding: 8px 16px;\n}\n#freshworks-survey-widget .compact-container-style .header-content.minimized {\n padding-left: 16px;\n}\n#freshworks-survey-widget .cozy-container-style {\n max-width: 1000px;\n min-width: 800px;\n left: 50%;\n transform: translate(-50%, 0);\n}\n#freshworks-survey-widget .container {\n position: fixed;\n bottom: 0;\n border-radius: 4px 4px 0 0;\n z-index: 2147483647;\n display: flex;\n flex-direction: column;\n background-color: #fff;\n background-color: var(--question-background-color, #fff);\n width: var(--container-width);\n box-shadow: 0px 7px 13px rgba(18, 52, 77, 0.19);\n transition: opacity 0.25s ease, height var(--height-transition-duration) ease;\n -webkit-animation: mountWidget 0.5s ease;\n animation: mountWidget 0.5s ease;\n height: auto;\n}\n#freshworks-survey-widget .widget-header {\n height: var(--widget-header-height);\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: row-reverse;\n grid-gap: 8px;\n gap: 8px;\n background-color: #fff;\n background-color: var(--question-background-color, #fff);\n border-radius: inherit;\n position: relative;\n}\n#freshworks-survey-widget .widget-header .icons {\n height: 100%;\n display: flex;\n}\n#freshworks-survey-widget .widget-header .icon {\n cursor: pointer;\n height: 100%;\n width: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background-color: transparent;\n border: none;\n}\n#freshworks-survey-widget .widget-header .icon:hover .icon-tooltip {\n display: block;\n -webkit-animation: mountWidget 0.4s ease;\n animation: mountWidget 0.4s ease;\n opacity: 1;\n}\n#freshworks-survey-widget .widget-header .icon:hover .icon-tooltip:hover {\n display: none;\n}\n#freshworks-survey-widget .widget-header .icon-tooltip {\n background: rgba(18, 52, 77, 0.8901960784);\n color: #fff;\n letter-spacing: 0.5px;\n padding: 4px 8px;\n border-radius: 4px;\n font-weight: 500;\n font-size: 0.9rem;\n position: absolute;\n right: 48px;\n top: 12px;\n white-space: nowrap;\n z-index: 1;\n transition: opacity ease 0.2s;\n display: none;\n opacity: 0;\n}\n#freshworks-survey-widget .widget-header.minimized {\n min-height: var(--widget-header-height);\n width: 100%;\n flex-direction: row;\n}\n#freshworks-survey-widget .header-content.minimized {\n opacity: 0;\n text-overflow: ellipsis;\n width: calc(100% - 72px);\n padding-left: 28px;\n overflow: hidden;\n white-space: nowrap;\n -webkit-animation: mountWidget 0.8s ease forwards;\n animation: mountWidget 0.8s ease forwards;\n -webkit-animation-delay: 0.3s;\n animation-delay: 0.3s;\n font-weight: 500;\n line-height: 1.8;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n#freshworks-survey-widget .header-content.minimized p {\n all: inherit;\n width: 100%;\n padding: 0;\n margin: 0;\n}\n#freshworks-survey-widget .widget-main {\n opacity: 1;\n flex-grow: 1;\n transition: opacity 0.25s ease, height var(--height-transition-duration) ease;\n}\n#freshworks-survey-widget .widget-main.minimized {\n opacity: 0;\n height: 0;\n border-radius: 3px 3px 0 0;\n}\n#freshworks-survey-widget .widget-footer {\n height: var(--widget-footer-height);\n font-size: 12px;\n display: flex;\n padding: 8px 28px;\n justify-content: space-between;\n align-items: center;\n color: rgba(18, 52, 77, 0.831372549);\n background-color: rgba(187, 187, 187, 0.1);\n letter-spacing: 0.2px;\n}\n#freshworks-survey-widget .widget-footer .fw-link {\n display: flex;\n align-items: center;\n grid-gap: 6px;\n gap: 6px;\n}\n#freshworks-survey-widget .widget-footer .emoji {\n position: relative;\n top: -1px;\n left: -2px;\n}\n#freshworks-survey-widget .widget-footer a {\n color: inherit;\n text-decoration: none;\n box-sizing: border-box;\n border-bottom: 1px solid transparent;\n}\n#freshworks-survey-widget .widget-footer a:hover {\n border-bottom: 1px solid;\n}\n#freshworks-survey-widget .title,\n#freshworks-survey-widget .description {\n text-align: center;\n}\n#freshworks-survey-widget .description {\n color: #666;\n line-height: 1.2;\n}\n#freshworks-survey-widget .close-widget {\n position: absolute;\n z-index: 10;\n background-color: #fff;\n flex-direction: column;\n display: flex;\n top: 40px;\n right: 12px;\n box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);\n border-radius: 2px;\n padding: 4px;\n}\n#freshworks-survey-widget .close-widget button {\n cursor: pointer;\n border: none;\n background-color: transparent;\n padding: 8px 12px;\n border-radius: 2px;\n font-size: 14px;\n}\n#freshworks-survey-widget .close-widget button:hover {\n background-color: #f3f3f3;\n}\n#freshworks-survey-widget .close-widget.top {\n top: -72px;\n}');const A=({onDismiss:e,remindLater:r,closeMenu:o,closeIconRef:s,position:i="bottom"})=>(n.useEffect((()=>{const e=e=>{s.current===e.target||s.current.contains(e.target)||o()};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[]),t.createElement("div",{className:"close-widget "+("top"===i?"top":"")},t.createElement("button",{onClick:async()=>{await r()},autoFocus:!0},"Remind me later"),t.createElement("button",{onClick:async()=>{await e()}},"Dismiss"))),$=({survey:e,preview:r,placeholders:o,onSubmit:s,remindLater:i,onDismiss:a,onClose:c,surveyType:u,unsubscribeUrl:m,isSurveyCompleted:d,children:p=null})=>{const[f,y]=n.useState(!1),[v,h]=n.useState(!1),[g,x]=n.useState(0),{ui_theme:b}=e,[w,k]=n.useState(null),[_,q]=n.useState(!1),[E,z]=n.useState(null),O=e.question_details.questions.find((e=>e.pivot_question))??e.question_details.questions.find((e=>"RANGE"===e.type_info.question_type))??e.question_details.questions[0],Z=()=>{y(!0),setTimeout((()=>{window.SurveyWidget?.unmount()}),300)},M=n.useRef(null);return t.createElement("div",{className:`container ${u}-container-style ${v?"minimized":""}`,style:{opacity:f?0:1,"--container-width":`${l[u]}`,"--height-transition-duration":"600ms",...R(b)}},p,t.createElement("header",{id:"surveyserv-widget-header",className:"widget-header "+(v?"minimized":"")},v&&t.createElement("span",{className:"header-content minimized",dangerouslySetInnerHTML:{__html:I(E?.question?.text??O?.text,{...o,"{{nps.rating}}":E?.npsScore})}}),t.createElement("div",{className:"icons"},!d&&t.createElement("button",{onClick:()=>{v?(h(!v),setTimeout((()=>{x(0)}),700)):(x(w?.clientHeight??0),setTimeout((()=>{h(!v)}),0))},className:"icon"},v?t.createElement(N,null):t.createElement(S,null)),t.createElement("button",{ref:M,onClick:()=>{d?(Z(),c?.()):q(!_)},className:"icon"},t.createElement(C,null))),_&&t.createElement(A,{position:v?"top":"bottom",closeIconRef:M,onDismiss:async()=>{await a(),Z()},remindLater:async()=>{await i(),Z()},closeMenu:()=>q(!_)})),t.createElement("main",{ref:e=>k(e),className:"widget-main "+(v?"minimized":""),style:{height:v?0:g||"auto"}},t.createElement(Y,{widgetStyle:u,survey:e,placeholders:o,onSubmit:s,setCurrentSurveyState:z,widgetHeaderQuerySelector:v?void 0:"#surveyserv-widget-header"})),t.createElement("footer",{className:"widget-footer"},t.createElement("a",{className:"fw-link",href:"https://www.freshworks.com/?utm_source=survey&utm_medium=survey_public_page",target:"_blank",rel:"noopener noreferrer"},"Powered by",t.createElement(B,null)),m&&!v&&t.createElement("a",{href:m,target:"_blank",rel:"noopener noreferrer",onClick:e=>{r&&(e.preventDefault(),c?.()),e.stopPropagation(),Z()}},"Unsubscribe")))};exports.BUTTON_SIZE_VARIANTS={LARGE:"large",MINI:"mini",NORMAL:"normal"},exports.Button=_,exports.CheckboxGroup=h,exports.Input=f,exports.NPS=i,exports.ProgressBar=w,exports.Radio=b,exports.RadioGroup=x,exports.Survey=e=>{const n=O(e.survey);return t.createElement(t.Fragment,null,"standard"===e.surveyStyle?t.createElement(W,Object.assign({},e,{survey:n})):t.createElement(D,Object.assign({},e,{survey:n})))},exports.TextArea=y,exports.WebInAppSurvey=e=>{const n=O(e.survey);return t.createElement($,Object.assign({},e,{survey:n}))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),r=require("react-transition-group"),o=e(require("react-dom"));function s(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}s(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid #ebeff3;\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n flex-direction: column;\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n}\n.freemium-survey-components .nps-container .nps-scale .help-text-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale .choice {\n background: #ebeff3;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: rgba(228, 62, 61, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2) {\n background: rgba(0, 175, 80, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4) {\n background: rgba(248, 196, 62, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n background: rgb(228, 62, 61);\n color: #fff;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(2) {\n background: rgb(0, 175, 80);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(4) {\n background: rgb(248, 196, 62);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const i=e=>{const{type_info:{linear_scale:{button_style:r="highlighted",button_shape:o="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:c}}=e,u=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n.useRef(Array.from({length:10+(0===a?1:0)},((e,n)=>n+a)));return t.createElement("div",{className:"nps-container","data-test-input":"nps"},t.createElement("div",{className:`nps-scale ${o} ${r}`},t.createElement("div",{className:"button-container"},t.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>t.createElement("button",{role:"radio","aria-checked":e.npsValue===n,key:n,"data-test-nps-choice":n,onClick:t=>{e.onChangeHandler(n)},className:`choice ${u(n)} ${e.npsValue===n&&"active"}`},n)))),t.createElement("div",{className:"help-text-container"},t.createElement("span",{className:"negative-text",role:"note"},`${a} - ${s}`),t.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${i}`)))),t.createElement("div",{className:"footer",role:"note"},c))},a=(e,n)=>(e.defaultProps=n,e);s('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic[focus-within] .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .input-basic:focus-within .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .end-max-length {\n transition: opacity ease 0.2s;\n opacity: 0;\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const c=["RANGE","NPS","RADIO","DROPDOWN"],u={default:500,compact:500,cozy:400},l={default:"600px",compact:"350px",cozy:"96%"},m={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},d=n.forwardRef(((e,r)=>{const o=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{o.current?.focus()}),300+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,isErrored:u,startLabel:l,isRequired:m,errorText:d,endLabel:p,maxLength:f=256,onChange:y,autoFocusInput:v,...h}=e;return t.createElement("div",{className:"input-container",style:i},e.label&&t.createElement("label",{className:"input-label "+(m?"required":"")},e.label),t.createElement(t.Fragment,null,l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${u?"error":""}${a||""}`},t.createElement("input",Object.assign({},h,{type:"text",autoComplete:"off",ref:o,style:s,onChange:e=>{e.target.value?.length>f||y?.(e)}})),c&&f>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${f}`)),p&&t.createElement("div",{className:"end-label"},p)),u&&d&&t.createElement("span",{className:"input-error"},e.errorText))})),p=n.forwardRef(((e,r)=>{const o=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{o.current?.focus()}),300+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,maxLength:u=1500,startLabel:l,isRequired:m,autoFocusInput:d,onChange:p,...f}=e;return t.createElement(t.Fragment,null,t.createElement("div",{className:"textarea-container",style:i},e.label&&t.createElement("label",{className:"input-label "+(m?"required":"")},e.label),l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${a||""}`},t.createElement("textarea",Object.assign({},f,{autoComplete:"off",ref:o,style:s,onChange:e=>{e.target.value?.length>u||p?.(e)}})),c&&u&&u>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${u}`)),e.endLabel&&t.createElement("div",{className:"end-label"},e.endLabel)))})),f=a(d,m),y=a(p,m);s('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover {\n border-color: #92a2b1;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const v=()=>t.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},t.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),h=({values:e=[],othersValue:r="",options:o,name:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:u})=>{const l=e.includes("__others__"),m=n.useRef(null);return n.useEffect((()=>{i&&setTimeout((()=>{m.current?.focus()}),300+a)}),[i]),t.createElement("div",{className:"checkbox-group"},t.createElement("button",{ref:m,className:"autofocus-button","aria-hidden":!0}),o?.filter((e=>"__others__"!==e.value)).map(((n,r)=>t.createElement(g,{key:n.id,checked:e?.includes(n.value),name:n.value,id:n.id,onChange:(t,r)=>{if(r)c([...e||[],n.value]);else{const t=e.indexOf(n.value);t>-1&&e.splice(t,1),c([...e])}}},n.value))),o?.find((e=>"__others__"===e.value))&&t.createElement(g,{key:"others",checked:l,name:"__others__",id:"__others__",onChange:(n,t)=>{if(t)c([...e,"__others__"]);else{const n=e.findIndex((e=>"__others__"===e));e.splice(n,1),c(e)}}},"Others"),l&&t.createElement(t.Fragment,null,t.createElement(f,{placeholder:"Enter your comment",value:r,onChange:e=>{u(s,e.target.value)},autoFocusDelay:10,label:""})))},g=a((e=>{const r=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),t.createElement("label",{className:`checkbox-label ${e.disabled&&"disabled"}`},t.createElement("input",{ref:r,id:e.id,type:"checkbox",name:e.name,readOnly:e.readOnly,disabled:e.disabled,"aria-disabled":e.disabled,checked:e.checked,onChange:e.readOnly?()=>{}:n=>e.onChange(n,n.target.checked)}),t.createElement("div",{className:"checkbox"},e.checked&&t.createElement("div",{className:"icon-container"},t.createElement(v,null)," ")),t.createElement("div",null,e.children))}),{checked:!1});s('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n color: #3a4b67;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover {\n border-color: #92a2b1;\n}');const x=({name:e,options:r,value:o,autoFocusGroup:s,autoFocusDelay:i,onChangeHandler:a,saveOthersValue:c,othersOption:u,othersRequired:l,othersValue:m,isFinalQn:d})=>{const p=n.useRef(null);return n.useEffect((()=>{s&&setTimeout((()=>{p.current?.focus()}),300+i)}),[s]),t.createElement("div",{className:"radio-group",role:"radiogroup"},t.createElement("button",{ref:p,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),r?.sort(((e,n)=>"__others__"===e.value?1:"__others__"===n.value?-1:0))?.map(((n,r)=>t.createElement(b,{key:n.value,value:n.value,name:e,onChange:n=>{"__others__"!==n.currentTarget.value&&c(e,null),a(n.currentTarget.value)},checked:o===n.value},"__others__"===n.value?"Others":n.value))),"__others__"===o&&t.createElement(t.Fragment,null,t.createElement(f,{value:m??"",onChange:n=>{"__others__"!==o&&d&&a("__others__"),c(e,n.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},b=a((e=>{const r=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),t.createElement("label",{className:"radio-label"},t.createElement("input",{ref:r,type:"radio",name:e.name,value:e.value,checked:e.checked,onChange:e.onChange}),t.createElement("div",{className:"radio"}),t.createElement("div",null,e.children))}),{checked:!1,autoFocus:!1});s(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n overflow: hidden;\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n}\n\n.progressbar-container.widget {\n position: absolute;\n top: 0;\n height: 2px;\n}\n\n.progressbar {\n transition: transform 0.2s linear 200ms;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const w=e=>{const{totalSteps:n,completedSteps:r,widget:o}=e;return t.createElement("div",{className:"progressbar-container "+(o?"widget":"")},t.createElement("div",{className:"progressbar",style:{width:(r>0?100/n:0)+"%",transform:`scaleX(${r})`}}))};s(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 600;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const k=()=>t.createElement(t.Fragment,null,"..."),_=e=>{const{inline:n=!1,children:r,disabled:o,className:s="",htmlType:i,type:a="primary",onClick:c,size:u,overrideStyleClassName:l="",loading:m=!1,...d}=e;return t.createElement("button",Object.assign({style:n?{display:"inline-block"}:{},disabled:o,className:`action-button ${s} ${l}`,type:i,onClick:c},d),m?t.createElement(k,null):r)},q=()=>t.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),E=()=>t.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),C=()=>t.createElement("svg",{width:"11",height:"10",viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{opacity:"0.01",x:"0.16748",width:"10",height:"10",fill:"white",fillOpacity:"0.01"}),t.createElement("path",{d:"M1.85129 1.68479L8.48395 8.31744",stroke:"#264966",strokeWidth:"1.5",strokeLinecap:"round"}),t.createElement("path",{d:"M8.48395 1.68479L1.85129 8.31744",stroke:"#264966",strokeWidth:"1.5",strokeLinecap:"round"})),S=()=>t.createElement("svg",{width:"8",height:"8",viewBox:"0 0 7 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6.08333 1.32682H0.583333C0.261167 1.32682 0 1.06565 0 0.743489C0 0.421323 0.261167 0.160156 0.583333 0.160156H6.08333C6.4055 0.160156 6.66667 0.421323 6.66667 0.743489C6.66667 1.06565 6.4055 1.32682 6.08333 1.32682Z",fill:"#264966"})),N=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none"},t.createElement("mask",{id:"a",maskUnits:"userSpaceOnUse",x:"-.400146",y:"-.400024",width:"11",height:"11",fill:"#000"},t.createElement("path",{fill:"#fff",d:"M-.400146-.400024h11v11h-11z"}),t.createElement("path",{d:"m4.70226 6.76428-2.6856 2.6856 2.60775-.00293c.02738-.00011.05452.0052.07983.01562.02532.01043.04833.02577.06769.04513.01936.01936.0347.04237.04512.06769.01043.02531.01574.05245.01563.07983l-.00293.41358c.00011.0274-.0052.0545-.01563.0799-.01043.0253-.02576.0483-.04512.0676-.01937.0194-.04237.0347-.06769.0452-.02532.0104-.05245.0157-.07983.0156l-3.59922.0029c-.082493.0001-.161625-.0326-.220005-.0909l-.111467-.1115c-.057526-.0589-.090102-.13767-.090934-.21998L.602787 6.2584c-.000112-.02738.005198-.05452.015625-.07984.010427-.02532.025763-.04832.045125-.06768.019362-.01936.042366-.0347.067685-.04513.025319-.01042.052451-.01573.079833-.01562h.416535c.02704-.00028.05387.00485.0789.01507.02504.01022.04779.02533.06691.04445.01912.01913.03424.04187.04446.06691s.01534.05186.01507.0789l-.00294 2.60775 4.74323-4.74323.0044-.00427 2.6856-2.6856-2.60775.00294c-.02738.00011-.05452-.0052-.07983-.01563-.02532-.01042-.04833-.02576-.06769-.04512-.01936-.01936-.0347-.04237-.04512-.06769-.01043-.02532-.01574-.05245-.01563-.07983l.00293-.413603c-.00011-.027382.0052-.054514.01563-.079833.01043-.025319.02576-.048323.04512-.067685.01937-.019362.04237-.034698.06769-.045125.02532-.010427.05245-.015737.07983-.015625L9.85762.599976c.08249-.000052.16158.032657.21998.090934l.1115.111467c.0575.058878.0901.13769.0909.220003l-.0029 3.59922c.0001.02738-.0052.05452-.0156.07983-.0105.02532-.0258.04833-.0452.06769-.0193.01936-.0423.0347-.0676.04512-.0254.01043-.0525.01574-.0799.01563h-.41651c-.02704.00027-.05387-.00485-.0789-.01507-.02504-.01022-.04779-.02533-.06691-.04446-.01912-.01912-.03424-.04187-.04446-.0669-.01022-.02504-.01534-.05186-.01506-.07891l.00293-2.60775-4.74323 4.74323-.0044.00427Z"})),t.createElement("path",{d:"m4.70226 6.76428-2.6856 2.6856 2.60775-.00293c.02738-.00011.05452.0052.07983.01562.02532.01043.04833.02577.06769.04513.01936.01936.0347.04237.04512.06769.01043.02531.01574.05245.01563.07983l-.00293.41358c.00011.0274-.0052.0545-.01563.0799-.01043.0253-.02576.0483-.04512.0676-.01937.0194-.04237.0347-.06769.0452-.02532.0104-.05245.0157-.07983.0156l-3.59922.0029c-.082493.0001-.161625-.0326-.220005-.0909l-.111467-.1115c-.057526-.0589-.090102-.13767-.090934-.21998L.602787 6.2584c-.000112-.02738.005198-.05452.015625-.07984.010427-.02532.025763-.04832.045125-.06768.019362-.01936.042366-.0347.067685-.04513.025319-.01042.052451-.01573.079833-.01562h.416535c.02704-.00028.05387.00485.0789.01507.02504.01022.04779.02533.06691.04445.01912.01913.03424.04187.04446.06691s.01534.05186.01507.0789l-.00294 2.60775 4.74323-4.74323.0044-.00427 2.6856-2.6856-2.60775.00294c-.02738.00011-.05452-.0052-.07983-.01563-.02532-.01042-.04833-.02576-.06769-.04512-.01936-.01936-.0347-.04237-.04512-.06769-.01043-.02532-.01574-.05245-.01563-.07983l.00293-.413603c-.00011-.027382.0052-.054514.01563-.079833.01043-.025319.02576-.048323.04512-.067685.01937-.019362.04237-.034698.06769-.045125.02532-.010427.05245-.015737.07983-.015625L9.85762.599976c.08249-.000052.16158.032657.21998.090934l.1115.111467c.0575.058878.0901.13769.0909.220003l-.0029 3.59922c.0001.02738-.0052.05452-.0156.07983-.0105.02532-.0258.04833-.0452.06769-.0193.01936-.0423.0347-.0676.04512-.0254.01043-.0525.01574-.0799.01563h-.41651c-.02704.00027-.05387-.00485-.0789-.01507-.02504-.01022-.04779-.02533-.06691-.04446-.01912-.01912-.03424-.04187-.04446-.0669-.01022-.02504-.01534-.05186-.01506-.07891l.00293-2.60775-4.74323 4.74323-.0044.00427Z",fill:"#264966"}),t.createElement("path",{d:"m4.70226 6.76428-.19158-.19732-.00287.00287.19445.19445Zm-2.6856 2.6856-.19445-.19445-.4702.4702.66496-.00075-.00031-.275Zm2.60775-.00293.00031.275h.00082l-.00113-.275Zm.14752.06075.19446-.19445-.00001-.00001-.19445.19446Zm.06075.14752.27499.00195.00001-.00082-.275-.00113Zm-.00293.41358-.27501-.0019.00001.003.275-.0011Zm-.06075.1475.19445.1945-.19445-.1945Zm-.06769.0452-.10471-.2543.10471.2543Zm-.07983.0156.00113-.275h-.00136l.00023.275Zm-3.59922.0029.00017.275h.00005l-.00022-.275Zm-.220005-.0909-.194454.1944.00017.0002.194284-.1946Zm-.111467-.1115-.196712.1922.002257.0023.194455-.1945Zm-.090934-.21998L.324837 9.8574l.000031.003.274986-.00278ZM.602787 6.2584l.275003.00022-.000005-.00135-.274998.00113Zm.015625-.07984L.36413 6.07385H.364129l.254283.10471Zm.045125-.06768.194453.19445h.000003l-.194456-.19445Zm.067685-.04513.104714.25429.000005-.00001-.104719-.25428Zm.079833-.01562-.001128.275h.001127l.000001-.275Zm.416535 0v.27501l.00281-.00002-.00281-.27499Zm.0789.01507-.10394.2546h.00001l.10393-.2546Zm.06691.04445.19445-.19445-.19445.19445Zm.04446.06691.2546-.10394-.2546.10394Zm.01507.0789-.275-.0028v.00249l.275.00031Zm-.00294 2.60775-.275-.00031-.00075.66497.47021-.4702-.19446-.19446Zm4.74323-4.74323-.19158-.19732-.00287.00287.19445.19445Zm.0044-.00427.19158.19733.00287-.00287-.19445-.19446Zm2.6856-2.6856.19445.19446.4702-.4702-.66496.00074.00031.275Zm-2.60775.00294-.00031-.275h-.00082l.00113.275Zm-.07983-.01563-.10472.25429.10472-.25429Zm-.06769-.04512.19446-.19446H6.3024l-.19445.19446Zm-.04512-.06769.25428-.10471v-.00001l-.25428.10472Zm-.01563-.07983-.27499-.00195-.00001.00082.275.00113Zm.00293-.413603.27502.001951L6.32513.81005l-.275.001127Zm.01563-.079833L5.81148.626625v.000004l.25428.104715Zm.04512-.067685L5.91643.469203v.000003l.19445.194453Zm.06769-.045125L6.07385.364252l.10472.254282ZM6.2584.602909 6.25728.87791l.00135-.000001-.00023-.275ZM9.85762.599976l-.00017-.275H9.8574l.00022.275Zm.21998.090934.1945-.194455-.0002-.000172-.1943.194627Zm.1115.111467.1967-.192197-.0023-.002257-.1944.194454Zm.0909.220003.275.00022v-.003l-.275.00278Zm-.0029 3.59922-.275-.00022v.00135l.275-.00113Zm-.0156.07983-.2543-.10472v.00001l.2543.10471Zm-.0452.06769-.1944-.19446.1944.19446Zm-.1475.06075.0012-.275h-.0012v.275Zm-.41651 0v-.27502l-.00281.00003.00281.27499Zm-.0789-.01507.10394-.2546-.10394.2546Zm-.06691-.04446.19446-.19445-.00001-.00001-.19445.19446Zm-.04446-.0669.25461-.10394-.00001-.00001-.2546.10395Zm-.01506-.07891.27499.00282.00001-.00251-.275-.00031Zm.00293-2.60775.275.00031.00075-.66496-.47021.4702.19446.19445ZM4.70666 6.76001l.19159.19733.00286-.00287-.19445-.19446Zm-.19885-.19018-2.6856 2.6856.38891.38891 2.6856-2.6856-.38891-.38891ZM2.01697 9.72488l2.60775-.00293-.00062-.55-2.60775.00293.00062.55Zm2.60857-.00293c-.00893.00003-.01777-.0017-.02601-.00509l.20943-.50857c-.05888-.02425-.12198-.0366-.18568-.03634l.00226.55Zm-.02601-.00509c-.00825-.0034-.01575-.0084-.02205-.0147l.3889-.38892c-.04503-.04503-.09853-.0807-.15742-.10495l-.20943.50857Zm-.02206-.01471c-.00631-.00631-.0113-.0138-.0147-.02205l.50857-.20943c-.02425-.05889-.05992-.11239-.10495-.15742l-.38892.3889Zm-.0147-.02205c-.0034-.00825-.00512-.01709-.00509-.02601l.55.00226c.00026-.06369-.01209-.12679-.03634-.18568l-.50857.20943Zm-.00508-.02683-.00294.41363.54999.0039.00293-.41363-.54998-.0039Zm-.00294.41663c-.00004-.0089.00169-.0177.00509-.026l.50856.2095c.02425-.0589.0366-.122.03634-.1857l-.54999.0022Zm.00509-.026c.0034-.0082.00839-.0157.0147-.022l.38891.3889c.04503-.045.0807-.0985.10495-.1574l-.50856-.2095Zm.01471-.022c.0063-.0063.01379-.0113.02205-.0147l.20943.5085c.05889-.0242.11239-.0599.15742-.1049l-.3889-.3889Zm.02205-.0147c.00824-.0034.01708-.0051.02601-.0051l-.00226.55c.06369.0002.1268-.0121.18568-.0364l-.20943-.5085Zm.02465-.0051-3.59922.0029.00045.55 3.59922-.0029-.00045-.55Zm-3.59917.0029c-.00957 0-.01876-.0038-.025541-.01054l-.388568.38924c.109981.1098.259058.1714.414459.1713l-.00035-.55Zm-.025371-.01037-.111467-.11146-.388909.38893.111468.1114.388908-.38887Zm-.109222-.10919c-.008001-.00819-.012532-.01915-.012648-.0306l-.549971.00556c.001548.1532.062169.2998.169221.4094l.393398-.38436Zm-.012634-.0276.002934-3.59922-.55-.00045L.324854 9.8574l.549999.00044Zm.002932-3.60057a.0675974.0675974 0 0 1-.005091.02601l-.508565-.20943c-.024249.05888-.036601.12199-.03634.18567l.549996-.00225Zm-.005092.02601c-.003395.00825-.008392.01574-.014703.02205l-.388906-.38891c-.045036.04504-.080705.09854-.104954.15743l.508563.20943Zm-.0147.02205c-.006311.00631-.013807.01131-.022057.01471l-.209429-.50857c-.058887.02425-.112392.05992-.157426.10496l.388912.3889Zm-.022052.0147c-.008251.0034-.017093.00513-.026013.0051l.002254-.55c-.063684-.00026-.12679.01209-.185679.03634l.209438.50856Zm-.024887.0051h.416536v-.55H.811055l-.000001.55Zm.419346-.00001c-.00954.00009-.01901-.00171-.02785-.00532l.20788-.5092c-.05891-.02405-.12202-.03611-.18564-.03546l.00561.54998Zm-.02784-.00532c-.00884-.00361-.01687-.00894-.02361-.01569l.3889-.38891c-.04499-.04499-.09851-.08055-.15742-.1046l-.20787.5092Zm-.02362-.01569c-.00674-.00675-.01208-.01477-.01568-.02361l.5092-.20788c-.02405-.05891-.05962-.11243-.10461-.15742l-.38891.38891Zm-.01568-.02361c-.00361-.00884-.00542-.0183-.00532-.02784l.54997.00561c.00065-.06362-.0114-.12674-.03545-.18565l-.5092.20788Zm-.00533-.02535L1.15499 8.8629l.55.00062.00294-2.60775-.55-.00062Zm.46652 2.80252 4.74323-4.74323-.38891-.38891-4.74323 4.74323.38891.38891Zm4.74033-4.74038.0044-.00427-.38312-.39461-.0044.00427.38312.39461Zm.00729-.00712 2.6856-2.6856-.38891-.38891-2.6856 2.6856.38891.38891Zm2.49084-3.15506-2.60775.00294.00062.55 2.60775-.00294-.00062-.55Zm-2.60857.00294c.00892-.00004.01776.00169.02601.00509l-.20943.50857c.05889.02424.12199.0366.18568.03634l-.00226-.55Zm.02601.00509c.00825.0034.01575.00839.02206.0147l-.38891.38891c.04503.04503.09853.0807.15742.10496l.20943-.50857Zm.02205.0147c.00631.00631.01131.01381.01471.02206l-.50857.20943c.02425.05888.05992.11239.10496.15742l.3889-.38891Zm.01471.02205c.0034.00826.00513.0171.00509.02602l-.55-.00226c-.00026.06369.01209.12679.03635.18568l.50856-.20944Zm.00508.02684.00294-.413602-.54999-.003901-.00293.413603.54998.0039Zm.00294-.41668c.00004.00892-.00169.01776-.00509.026009l-.50856-.20943c-.02425.058887-.0366.121992-.03634.185675L6.32513.81005Zm-.00509.026013c-.0034.008247-.00839.015741-.0147.022049L5.91643.469206c-.04503.045032-.0807.098534-.10495.157419l.50856.209438Zm-.0147.022052c-.00631.006307-.0138.011304-.02205.014701L6.07385.364252c-.05889.024251-.11239.059921-.15742.104951l.38891.388912Zm-.02205.014701a.0675974.0675974 0 0 1-.02601.005091l.00225-.549996c-.06369-.000261-.12679.012091-.18568.036341l.20944.508564Zm-.02466.005093L9.85785.874976l-.00045-.55-3.59922.002933.00045.55ZM9.8578.874976c.00957-.000006.01876.003791.02554.01056l.38856-.389253c-.11-.109784-.259-.171404-.41445-.171307l.00035.55Zm.02537.010388.11147.111467.38886-.388908-.1114-.111467-.38893.388908Zm.10922.109197c.00801.008189.01251.019149.01261.030599l.55-.00556c-.0015-.153176-.0622-.29984-.1692-.409407l-.39341.384368Zm.01261.027589-.0029 3.59923.55.00044.0029-3.59922-.55-.00045Zm-.0029 3.60058c0-.00892.0017-.01777.0051-.02602l.5085.20945c.0243-.05889.0367-.122.0364-.18569l-.55.00226Zm.0051-.02601c.0034-.00825.0084-.01574.0147-.02206l.3889.38892c.045-.04504.0807-.09855.105-.15743l-.5086-.20943Zm.0147-.02206c.0063-.00631.0138-.0113.022-.0147l.2095.50857c.0589-.02425.1124-.05992.1574-.10496l-.3889-.38891Zm.022-.0147c.0083-.0034.0171-.00513.0261-.00509l-.0023.55c.0637.00026.1268-.01209.1857-.03634l-.2095-.50857Zm.0249-.00509h-.41651v.55h.41651v-.55Zm-.41932.00001c.00954-.00009.01901.00171.02785.00532l-.20789.5092c.05892.02405.12203.0361.18566.03545l-.00562-.54997Zm.02785.00532c.00883.00361.01686.00894.02361.01569l-.38892.3889c.045.045.09852.08056.15743.10461l.20788-.5092Zm.0236.01568c.00675.00675.01209.01478.0157.02362l-.50921.20787c.02405.05892.05961.11244.10461.15743l.3889-.38892Zm.01569.02361c.00361.00884.00542.01831.00532.02786l-.54997-.00563c-.00065.06363.0114.12675.03546.18566l.50919-.20789Zm.00534.02535.00293-2.60775-.55-.00061-.00293 2.60774.55.00062Zm-.46653-2.80251L4.51221 6.56556l.3889.38891 4.74323-4.74323-.38891-.38891ZM4.51509 6.56271l-.00439.00427.38313.3946.0044-.00427-.38314-.3946Z",fill:"#264966",mask:"url(#a)"})),B=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"76",height:"16",viewBox:"0 0 200 40"},t.createElement("g",{fill:"none",fillRule:"nonzero"},t.createElement("path",{fill:"#4D4D4D",d:"M48.6 1c-5 0-6.8 3.5-6.8 6.8v2h-1c-.8 0-1.4.6-1.4 1.4 0 .8.6 1.4 1.4 1.4h1v13.8c0 .8.6 1.5 1.5 1.5s1.5-.6 1.5-1.5V12.5H48c.8 0 1.4-.6 1.4-1.4 0-.8-.6-1.4-1.4-1.4h-3.2v-2c0-1.8.7-4 3.9-4 .8 0 1.4-.6 1.4-1.3-.1-.8-.7-1.4-1.5-1.4zM60 9.3c-2-.1-3.8.8-5 2.4v-.8c0-.8-.6-1.5-1.5-1.5s-1.5.7-1.5 1.5v15.4c0 .8.6 1.5 1.5 1.5s1.5-.6 1.5-1.5v-8.5c0-3.6 1.9-5.7 5-5.7.8 0 1.4-.6 1.4-1.4 0-.8-.7-1.4-1.4-1.4zM77.7 16.9c0-1.7-.5-3.4-1.4-4.8-1.4-1.9-3.7-3-6.1-2.8-5.1 0-8 3.4-8 9.3 0 6.1 2.9 9.4 8.4 9.4 2.2.1 4.4-.7 6.1-2.2.3-.2.5-.6.5-1 0-.7-.6-1.3-1.3-1.3-.3 0-.6.1-.8.3-1.2 1-2.8 1.6-4.4 1.6-3.3 0-5.4-2.2-5.5-5.7H76c1.7-.2 1.7-1.8 1.7-2.8zm-7.4-5c3 0 4.5 1.7 4.6 5h-9.7c.3-3.2 2.1-5 5.1-5zM87.5 17.1c-2.2-.8-4-1.4-4-3 0-1.8 2-2 3.1-2 1.5-.1 3 .5 4 1.5.5.5 1.4.5 1.9 0 .3-.3.4-.6.4-1 0-.3-.1-.6-.3-.9-1.5-1.7-3.7-2.7-5.9-2.5-3.7 0-6 1.9-6 4.8 0 3.6 3.2 4.7 6 5.7 2.1.7 4 1.3 4 2.9 0 2.1-2.4 2.5-3.8 2.5-1.7.1-3.4-.6-4.6-1.8-.3-.3-.6-.4-1-.5-.7 0-1.3.6-1.3 1.3 0 .3.1.6.3.9 1.7 2 4.1 3 6.6 3 4.2 0 6.7-2 6.7-5.2-.2-3.7-3.3-4.7-6.1-5.7zM104.8 9.2c-1.8-.1-3.6.7-4.8 2.1V1.5c0-.8-.6-1.5-1.5-1.5-.8 0-1.4.6-1.4 1.5v24.8c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.5V17c0-3.4 1.6-5.1 4.8-5.1 3.2 0 4.3 1.4 4.3 4.8v9.6c0 .8.6 1.5 1.5 1.5.8 0 1.4-.6 1.4-1.5V16.2c0-4.6-2.4-7-7.2-7zM136.2 9.5c-.6 0-1.2.4-1.4 1l-4.2 11.8-3.4-11.8c-.3-.8-1.1-1.1-1.9-.9-.4.1-.7.5-.9.9L121 22.3l-4-11.9c-.2-.6-.7-1-1.4-.9-.8 0-1.4.6-1.4 1.4 0 .2 0 .4.1.6l5.6 15.3c.2.6.7 1 1.4 1 .6 0 1.2-.4 1.4-1l3.3-11.2 3.3 11.2c.2.6.8 1 1.4 1 .6 0 1.2-.4 1.4-1l5.6-15.3c.1-.2.1-.4.1-.6-.2-.8-.8-1.4-1.6-1.4zM146.8 9.2c-5.3 0-8.2 3.3-8.2 9.3 0 6 2.9 9.4 8.2 9.4 5.3 0 8.2-3.3 8.2-9.4 0-6.1-2.9-9.3-8.2-9.3zm0 16c-3.5 0-5.3-2.2-5.3-6.7s1.8-6.7 5.3-6.7 5.2 2.3 5.2 6.7-1.7 6.8-5.2 6.7zM166.2 9.3c-2-.1-3.8.8-5 2.4v-.8c0-.8-.6-1.5-1.4-1.5-.8 0-1.5.6-1.5 1.4v15.4c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.4v-8.5c0-3.6 1.9-5.7 5-5.7.8 0 1.4-.6 1.4-1.4 0-.8-.6-1.4-1.4-1.4zM177.3 16.9l6-4.8c.4-.3.6-.7.6-1.2 0-.8-.6-1.4-1.4-1.4-.4 0-.7.1-1 .4l-8.6 7V1.5c0-.8-.6-1.5-1.4-1.5-.8 0-1.5.6-1.5 1.4v24.8c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.4v-6l2-1.6 6.6 8.4c.3.4.8.7 1.2.7.8 0 1.4-.6 1.4-1.4 0-.3-.1-.7-.3-.9l-6.5-8.6zM193.7 17.1c-2.2-.8-4-1.4-4-3 0-1.8 2-2 3.1-2 1.5-.1 3 .5 4 1.5.3.3.6.4 1 .4.7-.1 1.2-.7 1.2-1.4 0-.3-.1-.6-.3-.9-1.5-1.7-3.7-2.7-5.9-2.5-3.7 0-6 1.9-6 4.8 0 3.6 3.2 4.7 6 5.7 2.1.7 4 1.3 4 2.9 0 2.1-2.4 2.5-3.8 2.5-1.7.1-3.4-.6-4.6-1.8-.3-.3-.6-.4-1-.5-.7 0-1.3.6-1.3 1.3 0 .3.1.6.3.9 1.7 1.9 4.1 2.9 6.7 2.8 4.2 0 6.7-2 6.7-5.2-.2-3.5-3.3-4.5-6.1-5.5z"}),t.createElement("path",{fill:"#9B65C3",d:"M.2 25.5C.7 29.1 2.4 32.4 5 35l5.8-5.8c0-6.1 3.2-11.7 8.5-14.8L.2 25.5z"}),t.createElement("path",{fill:"#9B65C3",d:"M10.8 29.2c-3 0-5.9-.8-8.5-2.3-.7-.4-1.4-.9-2.1-1.4.5 3.6 2.2 6.9 4.8 9.5l5.8-5.8z"}),t.createElement("path",{fill:"#BE63C5",d:"M10.8 29.2L5 35c2.6 2.6 5.9 4.3 9.5 4.8l11-19.1c-3 5.2-8.6 8.5-14.7 8.5z"}),t.createElement("path",{fill:"#BF63C6",d:"M13.1 37.7c-1.5-2.6-2.3-5.5-2.3-8.5L5 35c2.6 2.6 5.9 4.3 9.5 4.8-.5-.7-1-1.4-1.4-2.1z"}),t.createElement("path",{fill:"#3278B1",d:"M32.5 6.8l-13.2 7.6c-5.3 3-11.7 3-17 0C.8 17 0 20 0 23c0 .8.1 1.7.2 2.5.7.5 1.4 1 2.1 1.4 2.6 1.5 5.5 2.3 8.5 2.3l22-22c-.1-.1-.2-.2-.3-.4z"}),t.createElement("path",{fill:"#3278B2",d:"M2.3 26.9c2.6 1.5 5.5 2.3 8.5 2.3 0-6.1 3.2-11.7 8.5-14.8L.2 25.4c.7.6 1.4 1.1 2.1 1.5z"}),t.createElement("path",{fill:"#45A4EC",d:"M2.3 14.4C.8 17 0 20 0 23c0 .8.1 1.7.2 2.5l19.1-11.1c-5.2 3.1-11.7 3.1-17 0z"}),t.createElement("path",{fill:"#19BB7D",d:"M32.8 7.2c-.3-.3-.5-.5-.8-.7-.6-.4-1.4-.6-2.1-.6H17c-6.1 0-11.7 3.3-14.7 8.5 5.3 3 11.7 3 17 0-5.3 3-8.5 8.7-8.5 14.8 6.1 0 11.7-3.2 14.8-8.5l7.6-13.2c-.2-.1-.3-.2-.4-.3z"}),t.createElement("path",{fill:"#08C7FB",d:"M19.3 14.4l13.2-7.6c-.2-.1-.3-.3-.5-.4l-29.7 8c5.3 3.1 11.8 3.1 17 0z"}),t.createElement("path",{fill:"#59F2F6",d:"M29.8 5.9H17c-6.1 0-11.7 3.3-14.7 8.5l29.7-8c-.7-.3-1.4-.5-2.2-.5z"}),t.createElement("path",{fill:"#DA3757",d:"M25.6 20.7l7.6-13.2c-.1-.1-.2-.2-.3-.4l-22 22c0 3 .8 5.9 2.3 8.5.4.7.9 1.4 1.4 2.1.8.1 1.6.2 2.4.2 3 0 5.9-.8 8.5-2.3-3-5.2-3-11.7.1-16.9z"}),t.createElement("path",{fill:"#D33C4E",d:"M10.8 29.2c0 3 .8 5.9 2.3 8.5.4.7.9 1.4 1.4 2.1l11-19.1c-3 5.2-8.6 8.5-14.7 8.5z"}),t.createElement("path",{fill:"#EE5A24",d:"M25.6 20.7l-11 19.1c.8.1 1.6.2 2.5.2 3 0 5.9-.8 8.5-2.3-3.1-5.3-3.1-11.8 0-17z"}),t.createElement("path",{fill:"#8BDF55",d:"M33.5 8c-.3-.5-.6-.9-1-1.2l-13.2 7.6c-5.3 3-8.5 8.7-8.5 14.8 6.1 0 11.7-3.2 14.8-8.5-3 5.3-3 11.7 0 17 5.2-3 8.5-8.6 8.5-14.6V10.2c0-.8-.2-1.5-.6-2.2z"}),t.createElement("path",{fill:"#25C16F",d:"M32.5 6.8l-13.2 7.6c-5.3 3-8.5 8.7-8.5 14.8l22-22c-.1-.1-.2-.3-.3-.4z"}),t.createElement("path",{fill:"#8BDF55",d:"M10.8 29.2c6.1 0 11.7-3.2 14.8-8.5l7.6-13.2c-.1-.1-.2-.2-.3-.4L10.8 29.2z"}),t.createElement("path",{fill:"#FB0",d:"M33.2 7.5l-7.6 13.2c-3 5.3-3 11.7 0 17l8-29.7c-.2-.2-.3-.3-.4-.5z"}),t.createElement("path",{fill:"#FFA800",d:"M25.6 37.7c5.3-3 8.5-8.6 8.5-14.7V10.2c0-.8-.2-1.5-.6-2.2l-7.9 29.7z"}))),z=({question:e,formValues:n,othersMeta:r,onChangeHandler:o,saveOthersValue:s,autoFocus:a,autoFocusDelay:c,isFinalQn:u})=>{switch(e.type_info.question_type){case"RANGE":return t.createElement(i,{type_info:e.type_info,onChangeHandler:o,npsValue:n[e.name]});case"CHECKBOX":case"MULTI_SELECT":return t.createElement(h,{name:e.name,autoFocusGroup:a,values:n[e.name],othersValue:r[e.name],options:e.type_info.choices,onChangeHandler:o,saveOthersValue:s,othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,autoFocusDelay:c});case"RADIO":case"DROPDOWN":return t.createElement(x,{autoFocusGroup:a,autoFocusDelay:c,name:e.name,onChangeHandler:o,saveOthersValue:s,options:e.type_info.choices,value:n[e.name],othersValue:r[e.name],othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,isFinalQn:u});case"INPUT":case"TEXT":return e.type_info?.meta?.readOnly?t.createElement("div",{className:"message-container"},e.type_info?.meta?.value):t.createElement("div",{className:"responsive-text-field"},t.createElement(f,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,value:n[e.name]||"",placeholder:e.type_info?.meta?.placeholder??"",onChange:e=>o(e.target.value)}),t.createElement(y,{autoFocusInput:a,autoFocusDelay:c,label:"",maxLength:256,isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>o(e.target.value)}));case"PARAGRAPH":return t.createElement(y,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>o(e.target.value)});default:return console.error(`Question type ${e.type_info.question_type} not found`),null}},I=(e,n,t)=>{if(e){let r={};t&&(r={"{{nps.rating}}":t}),n&&(r={...r,...n});const o=new RegExp(Object.keys(r).join("|"),"gi");e=e.replace(o,(function(e){return r[e.toLowerCase()]}))}return e},R=e=>({...e.brand_color&&{"--brand-color":e.brand_color},...e.body_background_color&&{"--background-color":e.body_background_color},...e.secondary_button_color&&{"--secondary-button-color":e.secondary_button_color},...e.question_background_color&&{"--question-background-color":e.question_background_color},...e.primary_button_text_color&&{"--button-text-color":e.primary_button_text_color},...e.secondary_button_text_color&&{"--secondary-button-text-color":e.secondary_button_text_color},...e.question_text_color&&{"--question-text-color":e.question_text_color}}),O=e=>n.useMemo((()=>{const n=JSON.parse(JSON.stringify(e)),t=[];return(n.question_details?.questions||[]).forEach((e=>{const n=e.type_info?.meta?.block;n&&(n.question_names||(n.question_names=[e.name]),t.push(n))})),{...n,meta:{...n.meta,blocks:t}}}),[e]);s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-components.card-survey-style {\n padding: 20px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button svg {\n transform: rotate(90deg);\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.card-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components.card-survey-style .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.card-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.card-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.card-survey-style .fade-enter .question-container {\n opacity: 0;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.card-survey-style .question-footer {\n display: flex;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.card-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.card-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.card-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.card-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .submit {\n max-width: 700px;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.card-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.card-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.card-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.card-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.card-survey-style .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n div.freemium-survey-components.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n div.freemium-survey-components.card-survey-style .question-footer {\n flex-direction: column-reverse;\n }\n div.freemium-survey-components.card-survey-style .question-footer > *:first-child {\n margin-bottom: 0px;\n }\n div.freemium-survey-components.card-survey-style .question-footer > * {\n margin-bottom: 20px;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons button {\n max-width: unset;\n }\n div.freemium-survey-components.card-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .thankyou .text {\n width: auto;\n }\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .input-container {\n display: none;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer {\n flex-direction: column-reverse;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer > *:first-child {\n margin-bottom: 0px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer > * {\n margin-bottom: 20px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation {\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons {\n flex-direction: column;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons button {\n max-width: unset;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-button {\n max-width: unset;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .thankyou .text {\n width: auto;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const Z=({thankYouQuestion:e,preview:r,placeholders:o,npsValue:s})=>(n.useEffect((()=>{r||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*e.type_info.meta?.redirectDelay??1e4)}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,o,s)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),M=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,setCurrentBlockIndexOfBlocksWithQnsDirty:r,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:i,preventQuestionAnimation:a,tempCurrentBlockIndexOfBlocksWithQns:c,setReverse:u,reverse:l})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{l?(n.current=Math.max(n.current-1,0),e.current=s.findIndex((e=>e.name===o[n.current].name))):(c.current=Math.max(n.current-1,0),e.current=s.findIndex((e=>e.name===o[c.current].name))),a.current=!1,r.current=!0,u(!0),i({})}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{a.current=!1,l?(c.current=Math.min(n.current+1,o.length-1),e.current=s.findIndex((e=>e.name===o[c.current].name))):(n.current=Math.min(n.current+1,o.length-1),e.current=s.findIndex((e=>e.name===o[n.current].name))),r.current=!0,u(!1),i({})}},t.createElement(q,null))),L=({widget:e,surveyStyle:n,formValues:r,blocksWithQns:o,blocks:s,thankYouQuestion:i,currentBlockIndexOfBlocksWithQns:a,currentBlockIndexOfBlocks:u,currentEditingBlock:l,isSubmitting:m,isValuesCommitted:d,isCurrentBlockFinal:p,setHorizontalScrollUnits:f,handleFormValues:y,skipBlock:v,setIsSubmitting:h,onSubmit:g,setIsSurveyCompleted:x,preventQuestionAnimation:b,preview:w,closePreview:k,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,question:C,block:S,reverse:N,othersMeta:B,setCurrentBlockIndexOfBlocksWithQnsDirty:z,...I})=>{const R=I.blockIndex??a.current,O=()=>(!c.includes(C.type_info.question_type)||"DROPDOWN"===C.type_info.question_type&&"__others__"===r[C.name])&&!p(),Z=()=>"RANGE"!==C.type_info.question_type&&!S.required&&!p(),L=()=>("DROPDOWN"===C.type_info.question_type&&!S.required&&r[C.name],!1),D=()=>p()&&(e||"standard"!==n),F=("MULTI_SELECT"===l.current.question.type_info.question_type&&r[l.current.question.name]?.includes("__others__")||"DROPDOWN"===l.current.question.type_info.question_type&&"__others__"===r[l.current.question.name])&&(!B[l.current.question.name]||""===B[l.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===n||0===R&&void 0===r[C.name]||0===a.current&&!N)&&t.createElement(M,{currentBlockIndex:u,currentBlockIndexOfBlocksWithQns:a,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:f,preventQuestionAnimation:b,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,reverse:N,setCurrentBlockIndexOfBlocksWithQnsDirty:z}),(O()||L()||Z()||D())&&t.createElement("div",{className:"action-buttons"},O()&&t.createElement(_,{onClick:()=>{z.current=!1,q(!1),y(o[R],null,!0)},disabled:l.current.required&&(!r[l.current.question.name]||Array.isArray(r[l.current.question.name])&&0===r[l.current.question.name].length)||l.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),Z()&&t.createElement("button",{className:"skip-button",onClick:()=>{z.current=!1,q(!1),v(C)}},"Skip"),D()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(l.current.required||l.current.question.type_info.pivot_question)&&(null==r[l.current.question.name]||0===r[l.current.question.name]?.length)||l.current.question.type_info.meta?.othersRequired&&F||m,onClick:()=>{h(!0),g()}},m?"Submitting":"Submit survey")),L()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),l.current=o[R],u.current=s.findIndex((e=>e.name===o[R].name)),v(C)}},"Clear selection")))},D=({survey:e,surveyStyle:o="standard",placeholders:s,onSubmit:i,widget:a,npsValue:u,preview:l,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[y,v]=n.useState(null),[h,g]=n.useState({}),[x,b]=n.useState(!1),[k,_]=n.useState([]),[q,E]=n.useState({}),[C,S]=n.useState(!1),[N,B]=n.useState(null),[R,O]=n.useState({}),M=n.useRef(null),D=n.useRef(null),F=n.useRef(-1),Q=n.useRef(null),T=n.useRef(0),W=n.useRef(0),V=n.useRef(!1),H=n.useRef(!1),P=n.useRef([]),Y=t.useRef(null!=u&&"card"===o),A=n.useRef(null),$=n.useRef(0),[U,j]=n.useState(!1),G=n.useRef();n.useEffect((()=>{f&&(A.current=f.find((e=>"TY"===e.name)),v(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{V.current&&(W.current=$.current,E({}))}),[U]),n.useEffect((()=>{if(y)if(D.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=u){F.current=Math.min(D.current.type_info.validation.max,Math.max(D.current.type_info.validation.min,u));const e=p.find((e=>e.name===y[0].question_names[0]));M.current={...y[0],question:e},P.current=[...P.current,{...y[0],question:e}],_(P.current),g({Q_1:F.current})}else if(!M.current&&y.length>0)return M.current=y[0],void J(y[0])}),[y,u]),t.useEffect((()=>{k.length&&(P.current=k,W.current=k.length-1),E({})}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&M.current.question&&(c.includes(M.current.question.type_info.question_type)&&("DROPDOWN"!==M.current.question.type_info.question_type||"__others__"!==h[M.current.question.name])||H.current)&&!K()&&(null!=u&&1==k.length?G.current?(clearTimeout(G.current),G.current=null,ee()):G.current=setTimeout((()=>{ee()}),1500):ee())}),[h]),n.useEffect((()=>{if(null!=h?.[D.current?.name])if(A.current?.is_based_on_rating){const e=D.current?.type_info?.choices[h?.[D.current?.name]-D.current?.type_info?.validation?.min??0]?.dependent_question_names,n=A.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));B(t)}else{const e=p.find((e=>e.name==A.current?.question_names[0]));B(e)}}),[h?.[D.current?.name]]);const X=()=>{i({...h,others_meta:R},(()=>{N?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=N?.type_info.meta?.redirectUrl:b(!0)}))},K=()=>(T.current===y.length-1||"end"===M.current.branchOption)&&W.current===k.length-1,J=e=>{let n={};if(e.is_based_on_rating){const t=D.current?.type_info?.choices[h?.[D.current?.name]-D.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===r))}else n=p.find((n=>n.name===e.question_names[0]));M.current.question=n;P.current.find((e=>e.question.name===n.name))?(W.current+=1,E({})):_([...P.current,{...e,question:n}])},ee=()=>{if(K())b(!0);else{if(M.current.nextBlock)T.current=y.findIndex((e=>e.name===M.current.nextBlock));else if(M.current.question.type_info?.meta?.branches){const e=M.current.question.type_info?.meta?.branches,n=h[M.current.question.name];let t;if(t="RANGE"===M.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return X(),void b(!0);T.current=y.findIndex((e=>e.name===t.nextBlock))}else T.current+=1}else T.current+=1;M.current=y[T.current],J(y[T.current])}},ne=(e,n,t)=>{if(Y.current=!1,t){if(H.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,r]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return T.current=y.findIndex((n=>n.name===e.name)),[t,r]})(e);g({...r,...null!=n&&{[e.question.name]:n}}),P.current=t}else g({...h,...null!=n&&{[e.question.name]:n}});D?.current?.name==e?.question?.name&&(F.current=n)}else g({...h,...null!=n&&{[e.question.name]:n}})};if(!M.current||!M.current.question)return null;const te=k[Math.min(W.current??k.length-1,k.length-1)];return t.createElement("div",{className:`freemium-survey-components ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},x?null:t.createElement(w,{totalSteps:y.length,completedSteps:T.current+(x?1:0)}),t.createElement(r.SwitchTransition,{mode:"out-in"},t.createElement(r.CSSTransition,{key:W.current+String(x),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:U?"fade-reverse":"fade"},t.createElement("div",{className:"questions"},x?t.createElement(Z,{thankYouQuestion:N,preview:l,placeholders:s,npsValue:F.current}):t.createElement("div",{ref:Q,id:`${te.question.name}`,className:`question-container ${a||"card"===o}`,"data-test-question-name":te.question.name},t.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:I(te.question.text,s,F.current)},"aria-label":`question-${W.current}`,role:"heading","aria-level":1}),t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},t.createElement(z,{question:te.question,isFinalQn:K(),formValues:h,othersMeta:R,autoFocus:!0,autoFocusDelay:"standard"===o?350:0,saveOthersValue:(e,n)=>{if(null===n){const n={...R};delete n[e],O({...n})}else O({...R,[e]:n})},onChangeHandler:e=>{H.current=!1,T.current=y.findIndex((e=>e.name===te.name)),M.current=te,V.current=!1,j(!1),ne(te,e,!("DROPDOWN"===te.question.type_info.question_type&&"__others__"===e)&&c.includes(te.question.type_info.question_type)&&!K())}})),t.createElement(L,{question:te.question,block:te,widget:a,surveyStyle:o,formValues:h,othersMeta:R,blocksWithQns:k,blocks:y,thankYouQuestion:N,currentBlockIndexOfBlocksWithQns:W,reverse:U,setReverse:j,currentBlockIndexOfBlocks:T,currentEditingBlock:M,isSubmitting:C,isValuesCommitted:H,isCurrentBlockFinal:K,setHorizontalScrollUnits:E,handleFormValues:ne,skipBlock:e=>{H.current=!0,delete h[e.name],g({...h})},setIsSubmitting:S,onSubmit:X,setIsSurveyCompleted:b,preventQuestionAnimation:Y,preview:l,closePreview:d,tempCurrentBlockIndexOfBlocksWithQns:$,setCurrentBlockIndexOfBlocksWithQnsDirty:V}))))))};s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 480px;\n --default-widget-max-height: 460px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n border-radius: 3px;\n border: 1px solid #efefef;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components.standard-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components.standard-survey-style .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components.standard-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.standard-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.standard-survey-style .question-footer {\n display: flex;\n justify-content: flex-start;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.standard-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components.standard-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.standard-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.standard-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n padding-bottom: 40px;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .fade-enter {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(40px);\n}\n.freemium-survey-components.standard-survey-style .fade-enter-active {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit-active {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(-40px);\n}\n.freemium-survey-components.standard-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.standard-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.standard-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .message-container:empty {\n display: none;\n}\n@media (max-width: 550px) {\n .freemium-survey-components.standard-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .action-buttons button {\n max-width: unset;\n }\n .freemium-survey-components.standard-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .thankyou .text {\n width: auto;\n }\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container {\n display: flex;\n }\n .freemium-survey-component .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n}\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const F=({thankYouQuestion:e,preview:r,placeholders:o,npsValue:s})=>(n.useEffect((()=>{r||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*(1e3*e.type_info.meta?.redirectDelay??1e4))}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,o,s)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),Q=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,preventQuestionAnimation:i})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{n.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[n.current].name)),i.current=!1,s(n.current)}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=r.length-1,onClick:()=>{i.current=!1,n.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[n.current].name)),s(n.current)}},t.createElement(q,null))),T=({widget:e,block:n,surveyStyle:r,formValues:o,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:u,currentBlockIndexOfBlocksWithQns:l,currentBlockIndexOfBlocks:m,currentEditingBlock:d,isSubmitting:p,isValuesCommitted:f,isCurrentBlockFinal:y,setHorizontalScrollUnits:v,handleFormValues:h,skipBlock:g,setIsSubmitting:x,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:q,closePreview:E,...C})=>{const S=C.blockIndex??l.current,N=C.question??i[S].question,B=()=>N.name===d.current.question.name&&(!c.includes(N.type_info.question_type)||"DROPDOWN"===N.type_info.question_type&&"__others__"===o[N.name])&&!y(),z=()=>"RANGE"!==N.type_info.question_type&&!n.required&&N.name===d.current.question.name&&!y(),I=()=>("DROPDOWN"===N.type_info.question_type&&N.name!==d.current.question.name&&!n.required&&o[N.name],!1),R=()=>y()&&(e||"standard"!==r)&&N.name===d.current.question.name,O=("MULTI_SELECT"===d.current.question.type_info.question_type&&o[d.current.question.name]?.includes("__others__")||"DROPDOWN"===d.current.question.type_info.question_type&&"__others__"===o[d.current.question.name])&&(!s[d.current.question.name]||""===s[d.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===r||0===S&&!o[N.name])&&t.createElement(Q,{currentBlockIndex:m,currentBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:v,preventQuestionAnimation:k}),(B()||I()||z()||R())&&t.createElement("div",{className:"action-buttons"},B()&&t.createElement(_,{onClick:()=>{h(i[S],null,!0)},disabled:d.current.required&&(!o[d.current.question.name]||Array.isArray(o[d.current.question.name])&&0===o[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&O,className:"next-button"},"Next"),z()&&t.createElement("button",{className:"skip-button",onClick:()=>g(N)},"Skip"),I()&&t.createElement("button",{className:"skip-button",onClick:()=>{d.current=i[S],m.current=a.findIndex((e=>e.name===i[S].name)),g(N)}},"Clear selection"),R()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(d.current.required||d.current.question.type_info.pivot_question)&&(null==o[d.current.question.name]||0===o[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&O||p,onClick:()=>{x(!0),b()}},p?"Submitting":"Submit survey"))))},W=({survey:e,surveyStyle:o="standard",placeholders:s,onSubmit:i,widget:a,npsValue:u,preview:l,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[y,v]=n.useState(null),[h,g]=n.useState({}),[x,b]=n.useState(!1),[k,q]=n.useState([]),[E,C]=n.useState(0),[S,N]=n.useState(!1),[B,R]=n.useState(null),[O,Z]=n.useState({}),M=n.useRef(null),L=n.useRef(null),D=n.useRef(-1),Q=n.useRef(null),W=n.useRef(0),V=n.useRef(0),H=n.useRef(!1),P=n.useRef([]),Y=n.useRef(null!=u&&"card"===o),A=n.useRef(null),$=n.useRef([]);n.useEffect((()=>{f&&(A.current=f.find((e=>"TY"===e.name)),v(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{if(y)if(L.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=u){D.current=Math.min(L.current.type_info.validation.max,Math.max(L.current.type_info.validation.min,u));const e=p.find((e=>e.name===y[0].question_names[0]));M.current={...y[0],question:e},P.current=[...P.current,{...y[0],question:e}],q(P.current),g({Q_1:D.current})}else if(!M.current&&y.length>0)return M.current=y[0],void G(y[0])}),[y,u]),n.useEffect((()=>{k.length&&(P.current=k,V.current=k.length-1),a||"standard"!==o?(Q.current&&(Q.current.style.maxHeight="unset"),$.current[W.current]=Q.current?.scrollHeight||$.current[W.current]||0,Q.current&&(Q.current.style.maxHeight="100%")):Q.current?.scrollIntoView({block:"start",behavior:"smooth"}),C(k.length-1)}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&M.current.question&&(c.includes(M.current.question.type_info.question_type)&&("DROPDOWN"!==M.current.question.type_info.question_type||"__others__"!==h[M.current.question.name])||H.current)&&!j()&&X()}),[h]),n.useEffect((()=>{if(null!=h?.[L.current?.name])if(A.current?.is_based_on_rating){const e=L.current?.type_info?.choices[h?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,n=A.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));R(t)}else{const e=p.find((e=>e.name==A.current?.question_names[0]));R(e)}}),[h?.[L.current?.name]]);const U=()=>{i({...h,others_meta:O},(()=>{B?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=B?.type_info.meta?.redirectUrl:b(!0)}))},j=()=>W.current===y.length-1||"end"===M.current.branchOption,G=e=>{let n={};if(e.is_based_on_rating){const t=L.current?.type_info?.choices[h?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===r))}else n=p.find((n=>n.name===e.question_names[0]));M.current.question=n;P.current.find((e=>e.question.name===n.name))?(C(E+1),V.current+=1):q([...P.current,{...e,question:n}])},X=()=>{if(j())b(!0);else{if(M.current.nextBlock)W.current=y.findIndex((e=>e.name===M.current.nextBlock));else if(M.current.question.type_info?.meta?.branches){const e=M.current.question.type_info?.meta?.branches,n=h[M.current.question.name];let t;if(t="RANGE"===M.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return U(),void b(!0);W.current=y.findIndex((e=>e.name===t.nextBlock))}else W.current+=1}else W.current+=1;M.current=y[W.current],G(y[W.current])}},K=e=>{H.current=!0,delete h[e.name],g({...h})},J=(e,n,t)=>{if(Y.current=!1,t){if(H.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,r]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return W.current=y.findIndex((n=>n.name===e.name)),[t,r]})(e);g({...r,...null!=n&&{[e.question.name]:n}}),P.current=t}else g({...h,...null!=n&&{[e.question.name]:n}});L?.current?.name==e?.question?.name&&(D.current=n)}else g({...h,...null!=n&&{[e.question.name]:n}})},ee=(e,n)=>{const t=k.find((n=>n.question.name===e));if(W.current=y.findIndex((e=>e.name===t.name)),M.current=t,null===n){const n={...O};delete n[e],Z({...n})}else Z({...O,[e]:n})};if(!M.current||!M.current.question)return null;const ne=("MULTI_SELECT"===M.current.question.type_info.question_type&&h[M.current.question.name]?.includes("__others__")||"DROPDOWN"===M.current.question.type_info.question_type&&"__others__"===h[M.current.question.name])&&(!O[M.current.question.name]||""===O[M.current.question.name]);return t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},x?null:t.createElement(w,{totalSteps:y.length,completedSteps:W.current}),t.createElement(r.SwitchTransition,{mode:"out-in"},t.createElement(r.CSSTransition,{key:String(x),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:a?"":"fade"},t.createElement("div",null,x?t.createElement(F,{thankYouQuestion:B,preview:l,placeholders:s,npsValue:D.current}):t.createElement(t.Fragment,null,t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:a||"card"===o?{transform:`translateX(calc(-${E} * 100%))`,height:`${$.current[W.current]}px`,transition:Y.current||k?.length<=1?"none":"all 300ms ease-out 0ms"}:{},className:"questions"},k.map(((e,n)=>t.createElement("div",{key:e.question.name,ref:Q,className:"question-container "+(!a&&"card"!==o||V.current===n?"":"hide-question-container")},t.createElement("div",{className:"question-text "+(0===n?"nps":""),dangerouslySetInnerHTML:{__html:I(e.question.text,s,D.current)},"aria-label":`question-${n}`,role:"heading","aria-level":1}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(z,{question:e.question,isFinalQn:j(),formValues:h,othersMeta:O,autoFocus:V.current===n,autoFocusDelay:"standard"===o?350:20,saveOthersValue:ee,onChangeHandler:n=>{H.current=!1,W.current=y.findIndex((n=>n.name===e.name)),M.current=e,J(e,n,!("DROPDOWN"===e.question.type_info.question_type&&"__others__"===n)&&c.includes(e.question.type_info.question_type)&&!j())}}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(T,{question:e.question,block:e,blockIndex:n,widget:a,surveyStyle:o,formValues:h,othersMeta:O,blocksWithQns:k,blocks:y,thankYouQuestion:B,currentBlockIndexOfBlocksWithQns:V,currentBlockIndexOfBlocks:W,currentEditingBlock:M,isSubmitting:S,isValuesCommitted:H,isCurrentBlockFinal:j,setHorizontalScrollUnits:C,handleFormValues:J,skipBlock:K,setIsSubmitting:N,onSubmit:U,setIsSurveyCompleted:b,preventQuestionAnimation:Y,preview:l,closePreview:d})))),!a&&"card"!==o&&j()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(M.current.required||M.current.question.type_info.pivot_question)&&(null==h[M.current.question.name]||0===h[M.current.question.name]?.length)||M.current.question.type_info.meta?.othersRequired&&ne||S,onClick:()=>{N(!0),i({...h,others_meta:O},(()=>{B?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=B?.type_info.meta?.redirectUrl:b(!0)}))}},S?"Submitting":"Submit survey"))))))))};s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n}\n\n.freemium-survey-components.widget-survey-components {\n overflow: hidden;\n}\n.freemium-survey-components.widget-survey-components * {\n scrollbar-color: rgba(216, 216, 216, 0.5) transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar {\n height: auto;\n height: initial;\n width: 6px;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-track {\n background: transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: rgba(216, 216, 216, 0.5) !important;\n}\n.freemium-survey-components.widget-survey-components p {\n margin: 0;\n}\n.freemium-survey-components.widget-survey-components .questions {\n min-width: 100%;\n max-width: 100%;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n position: relative;\n display: flex;\n justify-content: row;\n align-items: flex-end;\n height: 100%;\n transition: height 200ms ease;\n}\n.freemium-survey-components.widget-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n text-align: center;\n max-height: 100%;\n min-width: 100%;\n max-width: 700px;\n margin: 0 auto;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px 0;\n padding-top: 0;\n grid-gap: 28px;\n gap: 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .question-wrapper {\n width: 100%;\n flex-grow: 1;\n padding: 4px 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.widget-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n padding: 0 28px;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.widget-survey-components .question-text p {\n all: inherit;\n padding: 0;\n}\n.freemium-survey-components.widget-survey-components .nps-container .footer {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter {\n opacity: 1;\n transform: translateX(80px);\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active {\n position: absolute;\n opacity: 1;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-done {\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-exit {\n opacity: 0.05;\n pointer-events: none;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n pointer-events: none;\n opacity: 0;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter {\n opacity: 0;\n position: absolute;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active {\n opacity: 1;\n position: absolute;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit {\n opacity: 0.05;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active {\n opacity: 0;\n transform: translateX(80px);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active,\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.widget-survey-components .question-footer {\n margin: 0px auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: -webkit-sticky;\n position: sticky;\n padding: 0 28px;\n bottom: -28px;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 40px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.widget-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .skip-button {\n font-weight: 500;\n cursor: pointer;\n color: #3a4b67;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.widget-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.widget-survey-components .next-button,\n.freemium-survey-components.widget-survey-components .submit {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.widget-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.widget-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.widget-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\n.freemium-survey-components.widget-survey-components .message-container:empty {\n display: none;\n}\n\n.freemium-survey-components.widget-survey-components.compact-style .nps-question-text {\n text-align: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-container {\n grid-gap: 20px;\n gap: 20px;\n max-width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer {\n flex-direction: column-reverse;\n grid-gap: 0;\n gap: 0;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer > *:first-child {\n margin-bottom: 0px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer > * {\n margin-bottom: 20px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout {\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-buttons {\n grid-gap: 32px;\n gap: 32px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .submit,\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-button {\n max-width: unset;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 10px;\n gap: 10px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .thankyou .text {\n width: 86%;\n}\n\n.freemium-survey-components.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group {\n flex-direction: column;\n flex-wrap: nowrap;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\n.freemium-survey-components.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.widget-survey-components.cozy-style {\n max-width: 1000px;\n min-width: 600px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n text-align: left;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-question-text {\n text-align: center;\n width: 70%;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const V=({thankYouQuestion:e,preview:n,placeholders:r,npsValue:o},s)=>t.createElement(t.Fragment,null,t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,r,o)}})),H=({currentBlockIndexOfBlocks:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,tempCurrentBlockIndexOfBlocksWithQns:i,setCurrentBlockIndexOfBlocksWithQnsDirty:a,setReverse:c,reverse:u})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{u?(n.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[n.current].name))):(i.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[i.current].name))),a.current=!0,c(!0),s({})}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=r.length-1,onClick:()=>{u?(i.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[i.current].name))):(n.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[n.current].name))),a.current=!0,c(!1),s({})}},t.createElement(q,null))),P=({widget:e,widgetStyle:n,surveyStyle:r,formValues:o,blocksWithQns:s,blocks:i,thankYouQuestion:a,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:l,currentEditingBlock:m,isSubmitting:d,isValuesCommitted:p,isCurrentBlockFinal:f,setHorizontalScrollUnits:y,handleFormValues:v,skipBlock:h,setIsSubmitting:g,onSubmit:x,setIsSurveyCompleted:b,preview:w,closePreview:k,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,question:C,block:S,reverse:N,othersMeta:B,setCurrentBlockIndexOfBlocksWithQnsDirty:z,...I})=>{const R=I.blockIndex??u.current,O=()=>!(!e&&"standard"===r||0===R&&void 0===o[C.name]||0===u.current&&!N),Z=()=>(!c.includes(C.type_info.question_type)||"DROPDOWN"===C.type_info.question_type&&"__others__"===o[C.name])&&!f(),M=()=>"RANGE"!==C.type_info.question_type&&!S.required&&!f(),L=()=>("DROPDOWN"===C.type_info.question_type&&!S.required&&o[C.name],!1),D=()=>f()&&(e||"standard"!==r),F=("MULTI_SELECT"===m.current.question.type_info.question_type&&o[m.current.question.name]?.includes("__others__")||"DROPDOWN"===m.current.question.type_info.question_type&&"__others__"===o[m.current.question.name])&&(!B[m.current.question.name]||""===B[m.current.question.name].trim()),Q="compact"===n&&M()&&O(),T=!Q&&O();return t.createElement("div",{className:"question-footer"},Q?t.createElement("div",{className:"compact-footer-layout"},O()&&t.createElement(H,{currentBlockIndexOfBlocks:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,setCurrentBlockIndexOfBlocksWithQnsDirty:z,reverse:N}),M()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),h(C)}},"Skip")):null,(Z()||L()||"compact"!==n&&M()||T||D())&&t.createElement("div",{className:"action-buttons"},T&&t.createElement("div",{style:{marginRight:"auto"}},t.createElement(H,{currentBlockIndexOfBlocks:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,setCurrentBlockIndexOfBlocksWithQnsDirty:z,reverse:N})),Z()&&t.createElement(_,{onClick:()=>{z.current=!1,q(!1),v(s[R],null,!0)},disabled:m.current.required&&(!o[m.current.question.name]||Array.isArray(o[m.current.question.name])&&0===o[m.current.question.name].length)||m.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),D()&&t.createElement(_,{className:"submit",disabled:(m.current.required||m.current.question.type_info.pivot_question)&&(null==o[m.current.question.name]||0===o[m.current.question.name]?.length)||m.current.question.type_info.meta?.othersRequired&&F||d,onClick:()=>{x(),g(!0)}},d?"Submitting":"Submit survey"),L()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),m.current=s[R],l.current=i.findIndex((e=>e.name===s[R].name)),h(C)}},"Clear selection")))},Y=({survey:e,placeholders:s,onSubmit:i,widgetStyle:a,widgetHeaderQuerySelector:l,setCurrentSurveyState:m})=>{const d=e.question_details?.questions||[],p=e.meta?.blocks||[],[f,y]=n.useState(null),[v,h]=n.useState({}),[g,x]=n.useState(!1),[b,k]=n.useState([]),[_,q]=n.useState({}),[E,C]=n.useState(!1),[S,N]=n.useState(null),[B,R]=n.useState({}),O=n.useRef(null),Z=n.useRef(null),M=n.useRef(-1),[L,D]=n.useState(null),F=n.useRef(0),Q=n.useRef(0),T=n.useRef(!1),W=n.useRef([]),H=n.useRef(null),Y=n.useRef(0),[A,$]=n.useState(!1),U=n.useRef(0),j=n.useRef(!1);n.useEffect((()=>{p&&(H.current=p.find((e=>"TY"===e.name)),y(p.filter((e=>"TY"!==e.name))))}),[p]),n.useEffect((()=>{j.current&&(Q.current=Y.current,q({}))}),[A]),n.useEffect((()=>{if(f)return Z.current=d.find((e=>e.type_info?.pivot_question))??d.find((e=>"RANGE"===e.type_info?.question_type))??d[0],!O.current&&f.length>0?(O.current=f[0],void K(f[0])):void 0}),[f]),n.useEffect((()=>{b.length&&(W.current=b,Q.current=b.length-1,q({}))}),[b]),n.useEffect((()=>{Object.keys(v).length>0&&O.current.question&&(c.includes(O.current.question.type_info.question_type)&&("DROPDOWN"!==O.current.question.type_info.question_type||"__others__"!==v[O.current.question.name])||T.current)&&!X()&&J()}),[v]),n.useEffect((()=>{if(null!=v?.[Z.current?.name])if(H.current?.is_based_on_rating){const e=Z.current?.type_info?.choices[v?.[Z.current?.name]-Z.current?.type_info?.validation?.min??0]?.dependent_question_names,n=H.current?.question_names.find((n=>e?.includes(n))),t=d.find((e=>e.name===n));N(t)}else{const e=d.find((e=>e.name==H.current?.question_names[0]));N(e)}}),[v?.[Z.current?.name]]);n.useMemo((()=>{(()=>{if(L){L.style.minHeight="unset",L.style.maxHeight="unset",L.style.height="min-content",L.style.position="static";const e=Math.min(L?.scrollHeight+2,u[a]);L.style.height=e+"px",L.style.minHeight=e+"px",U.current=e}})()}),[L]),n.useEffect((()=>{m({question:b?.[Q.current]?.question,npsScore:M.current})}),[Q.current,b,M.current]);const G=()=>{i({...v,others_meta:B},(()=>{x(!0)}))},X=()=>(F.current===f.length-1||"end"===O.current.branchOption)&&Q.current===b.length-1,K=e=>{let n={};if(e.is_based_on_rating){const t=Z.current?.type_info?.choices[v?.[Z.current?.name]-Z.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=d.find((e=>e.name===r))}else n=d.find((n=>n.name===e.question_names[0]));O.current.question=n;W.current.find((e=>e.question.name===n.name))?(q({}),Q.current+=1):k([...W.current,{...e,question:n}])},J=()=>{if(X())x(!0);else{if(O.current.nextBlock)F.current=f.findIndex((e=>e.name===O.current.nextBlock));else if(O.current.question.type_info?.meta?.branches){const e=O.current.question.type_info?.meta?.branches,n=v[O.current.question.name];let t;if(t="RANGE"===O.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return G(),void x(!0);F.current=f.findIndex((e=>e.name===t.nextBlock))}else F.current+=1}else F.current+=1;O.current=f[F.current],K(f[F.current])}},ee=(e,n,t)=>{if(t){if(T.current=!0,null!=v[e.question.name]&&e.name!==b[b.length-1].name){const[t,r]=(e=>{const n=b.findIndex((n=>n.name===e.name)),t=b.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=v[n.question.name],e)),{});return F.current=f.findIndex((n=>n.name===e.name)),[t,r]})(e);h({...r,...null!=n&&{[e.question.name]:n}}),W.current=t}else h({...v,...null!=n&&{[e.question.name]:n}});Z?.current?.name==e?.question?.name&&(M.current=n)}else h({...v,...null!=n&&{[e.question.name]:n}})};if(!O.current||!O.current.question)return null;const ne=b[Math.min(Q.current??b.length-1,b.length-1)];return t.createElement("div",{className:`freemium-survey-components widget-survey-components\n ${a}-style `,id:"freemium-survey"},l&&!g&&document.querySelector(l)?o.createPortal(t.createElement(w,{totalSteps:f.length,completedSteps:F.current+(g?1:0),widget:!0}),document.querySelector(l)):null,t.createElement("div",{className:"questions",style:{height:U.current,...1===b.length?{transition:"none"}:{}}},t.createElement(r.TransitionGroup,{component:null},t.createElement(r.CSSTransition,{key:ne.question.name+String(g),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:A?"fade-reverse":"fade"},t.createElement("div",{ref:e=>e?D(e):null,id:`${ne.question.name}`,className:"question-container "+(g?"thankyou":""),"data-test-question-name":ne.question.name},g?t.createElement(V,{thankYouQuestion:S,placeholders:s,npsValue:M.current,setBlockElementRef:D}):t.createElement(t.Fragment,null,t.createElement("div",{className:"question-text "+("RANGE"===ne.question.type_info.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:I(ne.question.text,s,M.current)},"aria-label":`question-${Q.current}`,role:"heading","aria-level":1}),t.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},t.createElement(z,{question:ne.question,isFinalQn:X(),formValues:v,othersMeta:B,autoFocus:!0,autoFocusDelay:0,saveOthersValue:(e,n)=>{if(null===n){const n={...B};delete n[e],R({...n})}else R({...B,[e]:n})},onChangeHandler:e=>{T.current=!1,F.current=f.findIndex((e=>e.name===ne.name)),O.current=ne,j.current=!1,$(!1),ee(ne,e,!("DROPDOWN"===ne.question.type_info.question_type&&"__others__"===e)&&c.includes(ne.question.type_info.question_type)&&!X())}})),t.createElement(P,{question:ne.question,block:ne,widgetStyle:a,formValues:v,othersMeta:B,blocksWithQns:b,blocks:f,thankYouQuestion:S,currentBlockIndexOfBlocksWithQns:Q,reverse:A,setReverse:$,currentBlockIndexOfBlocks:F,currentEditingBlock:O,isSubmitting:E,isValuesCommitted:T,isCurrentBlockFinal:X,setHorizontalScrollUnits:q,handleFormValues:ee,skipBlock:e=>{T.current=!0,delete v[e.name],h({...v})},setIsSubmitting:C,onSubmit:G,setIsSurveyCompleted:x,tempCurrentBlockIndexOfBlocksWithQns:Y,setCurrentBlockIndexOfBlocksWithQnsDirty:j})))))))};s('#freshworks-survey-widget {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n --container-width: 350px;\n --widget-header-height: 36px;\n --widget-footer-height: 32px;\n}\n#freshworks-survey-widget * {\n box-sizing: border-box;\n}\n#freshworks-survey-widget input,\n#freshworks-survey-widget select,\n#freshworks-survey-widget textarea,\n#freshworks-survey-widget button {\n font-family: inherit;\n}\n@-webkit-keyframes mountWidget {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes mountWidget {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n#freshworks-survey-widget div.widget-survey-components {\n border: none;\n}\n#freshworks-survey-widget .freemium-survey-components {\n width: 100%;\n height: 100%;\n min-height: inherit;\n}\n#freshworks-survey-widget .default-container-style {\n right: calc(50% - var(--container-width) / 2);\n}\n#freshworks-survey-widget .compact-container-style {\n right: 40px;\n}\n#freshworks-survey-widget .compact-container-style .widget-footer {\n padding: 8px 16px;\n}\n#freshworks-survey-widget .compact-container-style .header-content.minimized {\n padding-left: 16px;\n}\n#freshworks-survey-widget .cozy-container-style {\n max-width: 1000px;\n min-width: 800px;\n left: 50%;\n transform: translate(-50%, 0);\n}\n#freshworks-survey-widget .container {\n position: fixed;\n bottom: 0;\n border-radius: 4px 4px 0 0;\n z-index: 2147483647;\n display: flex;\n flex-direction: column;\n background-color: #fff;\n background-color: var(--question-background-color, #fff);\n width: var(--container-width);\n box-shadow: 0px 7px 13px rgba(18, 52, 77, 0.19);\n transition: opacity 0.25s ease, height var(--height-transition-duration) ease;\n -webkit-animation: mountWidget 0.5s ease;\n animation: mountWidget 0.5s ease;\n height: auto;\n}\n#freshworks-survey-widget .widget-header {\n height: var(--widget-header-height);\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: row-reverse;\n grid-gap: 8px;\n gap: 8px;\n background-color: #fff;\n background-color: var(--question-background-color, #fff);\n border-radius: inherit;\n position: relative;\n}\n#freshworks-survey-widget .widget-header .icons {\n height: 100%;\n display: flex;\n}\n#freshworks-survey-widget .widget-header .icon {\n cursor: pointer;\n height: 100%;\n width: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background-color: transparent;\n border: none;\n}\n#freshworks-survey-widget .widget-header .icon:hover .icon-tooltip {\n display: block;\n -webkit-animation: mountWidget 0.4s ease;\n animation: mountWidget 0.4s ease;\n opacity: 1;\n}\n#freshworks-survey-widget .widget-header .icon:hover .icon-tooltip:hover {\n display: none;\n}\n#freshworks-survey-widget .widget-header .icon-tooltip {\n background: rgba(18, 52, 77, 0.8901960784);\n color: #fff;\n letter-spacing: 0.5px;\n padding: 4px 8px;\n border-radius: 4px;\n font-weight: 500;\n font-size: 0.9rem;\n position: absolute;\n right: 48px;\n top: 12px;\n white-space: nowrap;\n z-index: 1;\n transition: opacity ease 0.2s;\n display: none;\n opacity: 0;\n}\n#freshworks-survey-widget .widget-header.minimized {\n min-height: var(--widget-header-height);\n width: 100%;\n flex-direction: row;\n}\n#freshworks-survey-widget .header-content.minimized {\n opacity: 0;\n text-overflow: ellipsis;\n width: calc(100% - 72px);\n padding-left: 28px;\n overflow: hidden;\n white-space: nowrap;\n -webkit-animation: mountWidget 0.8s ease forwards;\n animation: mountWidget 0.8s ease forwards;\n -webkit-animation-delay: 0.3s;\n animation-delay: 0.3s;\n font-weight: 500;\n line-height: 1.8;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n#freshworks-survey-widget .header-content.minimized p {\n all: inherit;\n width: 100%;\n padding: 0;\n margin: 0;\n}\n#freshworks-survey-widget .widget-main {\n opacity: 1;\n flex-grow: 1;\n transition: opacity 0.25s ease, height var(--height-transition-duration) ease;\n}\n#freshworks-survey-widget .widget-main.minimized {\n opacity: 0;\n height: 0;\n border-radius: 3px 3px 0 0;\n}\n#freshworks-survey-widget .widget-footer {\n height: var(--widget-footer-height);\n font-size: 12px;\n display: flex;\n padding: 8px 28px;\n justify-content: space-between;\n align-items: center;\n color: rgba(18, 52, 77, 0.831372549);\n background-color: rgba(187, 187, 187, 0.1);\n letter-spacing: 0.2px;\n}\n#freshworks-survey-widget .widget-footer .fw-link {\n display: flex;\n align-items: center;\n grid-gap: 6px;\n gap: 6px;\n}\n#freshworks-survey-widget .widget-footer .emoji {\n position: relative;\n top: -1px;\n left: -2px;\n}\n#freshworks-survey-widget .widget-footer a {\n color: inherit;\n text-decoration: none;\n box-sizing: border-box;\n border-bottom: 1px solid transparent;\n}\n#freshworks-survey-widget .widget-footer a:hover {\n border-bottom: 1px solid;\n}\n#freshworks-survey-widget .title,\n#freshworks-survey-widget .description {\n text-align: center;\n}\n#freshworks-survey-widget .description {\n color: #666;\n line-height: 1.2;\n}\n#freshworks-survey-widget .close-widget {\n position: absolute;\n z-index: 10;\n background-color: #fff;\n flex-direction: column;\n display: flex;\n top: 40px;\n right: 12px;\n box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);\n border-radius: 2px;\n padding: 4px;\n}\n#freshworks-survey-widget .close-widget button {\n cursor: pointer;\n border: none;\n background-color: transparent;\n padding: 8px 12px;\n border-radius: 2px;\n font-size: 14px;\n}\n#freshworks-survey-widget .close-widget button:hover {\n background-color: #f3f3f3;\n}\n#freshworks-survey-widget .close-widget.top {\n top: -72px;\n}');const A=({onDismiss:e,remindLater:r,closeMenu:o,closeIconRef:s,position:i="bottom"})=>(n.useEffect((()=>{const e=e=>{s.current===e.target||s.current.contains(e.target)||o()};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[]),t.createElement("div",{className:"close-widget "+("top"===i?"top":"")},t.createElement("button",{onClick:async()=>{await r()},autoFocus:!0},"Remind me later"),t.createElement("button",{onClick:async()=>{await e()}},"Dismiss"))),$=({survey:e,preview:r,placeholders:o,onSubmit:s,remindLater:i,onDismiss:a,onClose:c,surveyType:u,unsubscribeUrl:m,isSurveyCompleted:d,children:p=null})=>{const[f,y]=n.useState(!1),[v,h]=n.useState(!1),[g,x]=n.useState(0),{ui_theme:b}=e,[w,k]=n.useState(null),[_,q]=n.useState(!1),[E,z]=n.useState(null),O=e.question_details.questions.find((e=>e.pivot_question))??e.question_details.questions.find((e=>"RANGE"===e.type_info.question_type))??e.question_details.questions[0],Z=()=>{y(!0),setTimeout((()=>{window.SurveyWidget?.unmount()}),300)},M=n.useRef(null);return t.createElement("div",{className:`container ${u}-container-style ${v?"minimized":""}`,style:{opacity:f?0:1,"--container-width":`${l[u]}`,"--height-transition-duration":"600ms",...R(b)}},p,t.createElement("header",{id:"surveyserv-widget-header",className:"widget-header "+(v?"minimized":"")},v&&t.createElement("span",{className:"header-content minimized",dangerouslySetInnerHTML:{__html:I(E?.question?.text??O?.text,{...o,"{{nps.rating}}":E?.npsScore})}}),t.createElement("div",{className:"icons"},!d&&t.createElement("button",{onClick:()=>{v?(h(!v),setTimeout((()=>{x(0)}),700)):(x(w?.clientHeight??0),setTimeout((()=>{h(!v)}),0))},className:"icon"},v?t.createElement(N,null):t.createElement(S,null)),t.createElement("button",{ref:M,onClick:()=>{d?(Z(),c?.()):q(!_)},className:"icon"},t.createElement(C,null))),_&&t.createElement(A,{position:v?"top":"bottom",closeIconRef:M,onDismiss:async()=>{await a(),Z()},remindLater:async()=>{await i(),Z()},closeMenu:()=>q(!_)})),t.createElement("main",{ref:e=>k(e),className:"widget-main "+(v?"minimized":""),style:{height:v?0:g||"auto"}},t.createElement(Y,{widgetStyle:u,survey:e,placeholders:o,onSubmit:s,setCurrentSurveyState:z,widgetHeaderQuerySelector:v?void 0:"#surveyserv-widget-header"})),t.createElement("footer",{className:"widget-footer"},t.createElement("a",{className:"fw-link",href:"https://www.freshworks.com/?utm_source=survey&utm_medium=survey_public_page",target:"_blank",rel:"noopener noreferrer"},"Powered by",t.createElement(B,null)),m&&!v&&t.createElement("a",{href:m,target:"_blank",rel:"noopener noreferrer",onClick:e=>{r&&(e.preventDefault(),c?.()),e.stopPropagation(),Z()}},"Unsubscribe")))};exports.BUTTON_SIZE_VARIANTS={LARGE:"large",MINI:"mini",NORMAL:"normal"},exports.Button=_,exports.CheckboxGroup=h,exports.Input=f,exports.NPS=i,exports.ProgressBar=w,exports.Radio=b,exports.RadioGroup=x,exports.Survey=e=>{const n=O(e.survey);return t.createElement(t.Fragment,null,"standard"===e.surveyStyle?t.createElement(W,Object.assign({},e,{survey:n})):t.createElement(D,Object.assign({},e,{survey:n})))},exports.TextArea=y,exports.WebInAppSurvey=e=>{const n=O(e.survey);return t.createElement($,Object.assign({},e,{survey:n}))};