"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7522],{25138:function(e,t,r){r.r(t),r.d(t,{MediaBackground:function(){return a}});var n=r(91674),i=r(86655);let a=e=>{var t,r,a,o;let{children:s,survey:l,isEditorView:d=!1,isMobilePreview:c=!1,ContentRef:u}=e,p=(0,i.useRef)(null);(0,i.useEffect)(()=>{var e,t,r,n,i,a;(null===(t=l.styling)||void 0===t?void 0:null===(e=t.background)||void 0===e?void 0:e.bgType)==="animation"&&p.current&&(null===(n=l.styling)||void 0===n?void 0:null===(r=n.background)||void 0===r?void 0:r.bg)&&(p.current.src=null===(a=l.styling)||void 0===a?void 0:null===(i=a.background)||void 0===i?void 0:i.bg,p.current.play())},[null===(r=l.styling)||void 0===r?void 0:null===(t=r.background)||void 0===t?void 0:t.bg,null===(o=l.styling)||void 0===o?void 0:null===(a=o.background)||void 0===a?void 0:a.bgType]);let f=()=>{var e,t,r,n;return(null===(t=l.styling)||void 0===t?void 0:null===(e=t.background)||void 0===e?void 0:e.brightness)?"brightness(".concat(null===(n=l.styling)||void 0===n?void 0:null===(r=n.background)||void 0===r?void 0:r.brightness,"%)"):"brightness(100%)"},h=()=>{var e,t,r,i,a,o,s,d;let c=f(),u="absolute inset-0 h-full w-full";switch(null===(t=l.styling)||void 0===t?void 0:null===(e=t.background)||void 0===e?void 0:e.bgType){case"color":return(0,n.jsx)("div",{className:"".concat(u),style:{backgroundColor:(null===(i=l.styling)||void 0===i?void 0:null===(r=i.background)||void 0===r?void 0:r.bg)||"#ffff",filter:"".concat(c)}});case"animation":return(0,n.jsx)("video",{ref:p,muted:!0,loop:!0,autoPlay:!0,className:"".concat(u," object-cover"),style:{filter:"".concat(c)},children:(0,n.jsx)("source",{src:(null===(o=l.styling)||void 0===o?void 0:null===(a=o.background)||void 0===a?void 0:a.bg)||"",type:"video/mp4"})});case"image":return(0,n.jsx)("div",{className:"".concat(u," bg-cover bg-center"),style:{backgroundImage:"url(".concat(null===(d=l.styling)||void 0===d?void 0:null===(s=d.background)||void 0===s?void 0:s.bg,")"),filter:"".concat(c)}});default:return(0,n.jsx)("div",{className:"".concat(u," bg-white")})}};return c?(0,n.jsxs)("div",{ref:u,className:"relative h-[90%] max-h-[40rem] w-80 overflow-hidden rounded-3xl border-8 border-slate-500 ".concat(f()),children:[(0,n.jsx)("div",{className:"absolute left-1/2 right-1/2 top-0 z-20 h-4 w-1/2 -translate-x-1/2 transform rounded-b-md bg-slate-500"}),h(),(0,n.jsx)("div",{className:"no-scrollbar absolute flex h-full w-full items-center justify-center overflow-y-auto",children:s})]}):d?(0,n.jsx)("div",{ref:u,className:"flex flex-grow flex-col overflow-y-auto rounded-b-lg",children:(0,n.jsxs)("div",{className:"relative flex w-full flex-grow flex-col items-center justify-center p-4 py-6",children:[h(),(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:s})]})}):(0,n.jsxs)("div",{className:"flex min-h-screen flex-col items-center justify-center px-2",children:[h(),(0,n.jsx)("div",{className:"relative w-full",children:s})]})}},69453:function(e,t,r){r.d(t,{cn:function(){return a}});var n=r(44115),i=r(443);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.m6)((0,n.W)(t))}},14207:function(e,t,r){r.d(t,{FI:function(){return o},Fc:function(){return i},j2:function(){return a}});var n=r(68444);n.z.string(),n.z.number(),n.z.number().optional();let i=n.z.string().regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/),a=n.z.enum(["bottomLeft","bottomRight","topLeft","topRight","center"]),o=n.z.enum(["png","jpeg","jpg","pdf","doc","docx","xls","xlsx","ppt","pptx","plain","csv","mp4","mov","avi","mkv","webm","zip","rar","7z","tar"])},97172:function(e,t,r){r.d(t,{GW:function(){return i}});var n,i,a=r(68444),o=r(14207);let s=a.z.object({enabled:a.z.boolean(),headline:a.z.optional(a.z.string()),subheader:a.z.optional(a.z.string()),buttonLabel:a.z.optional(a.z.string()),buttonLink:a.z.optional(a.z.string()),imageUrl:a.z.string().optional()});(n=i||(i={})).FileUpload="fileUpload",n.OpenText="openText",n.MultipleChoiceSingle="multipleChoiceSingle",n.MultipleChoiceMulti="multipleChoiceMulti",n.NPS="nps",n.CTA="cta",n.Rating="rating",n.Consent="consent",n.PictureSelection="pictureSelection",n.Cal="cal",n.Date="date";let l=a.z.object({enabled:a.z.boolean(),headline:a.z.optional(a.z.string()),html:a.z.string().optional(),fileUrl:a.z.string().optional(),buttonLabel:a.z.string().optional(),timeToFinish:a.z.boolean().default(!0),showResponseCount:a.z.boolean().default(!1)}),d=a.z.object({enabled:a.z.boolean(),fieldIds:a.z.optional(a.z.array(a.z.string()))}),c=a.z.object({brandColor:o.Fc.nullish(),highlightBorderColor:o.Fc.nullish(),placement:o.j2.nullish(),clickOutsideClose:a.z.boolean().nullish(),darkOverlay:a.z.boolean().nullish()});a.z.enum(["animation","color","image"]);let u=a.z.object({bg:a.z.string().nullish(),bgType:a.z.enum(["animation","color","image"]).nullish(),brightness:a.z.number().nullish()}),p=a.z.object({background:u.nullish(),hideProgressBar:a.z.boolean().nullish()}),f=a.z.object({enabled:a.z.boolean().optional(),heading:a.z.string().optional(),subheading:a.z.string().optional()}).nullable().optional(),h=a.z.object({enabled:a.z.boolean(),heading:a.z.optional(a.z.string()),subheading:a.z.optional(a.z.string()),isEncrypted:a.z.boolean()}).nullable(),m=a.z.object({name:a.z.optional(a.z.string()),subheading:a.z.optional(a.z.string())}).optional(),b=a.z.object({id:a.z.string(),label:a.z.string()}),g=a.z.object({id:a.z.string(),imageUrl:a.z.string()}),v=a.z.enum(["accepted","clicked","submitted","skipped","equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","includesAll","includesOne","uploaded","notUploaded","booked"]),_=a.z.object({condition:v.optional(),value:a.z.union([a.z.string(),a.z.array(a.z.string())]).optional(),destination:a.z.union([a.z.string(),a.z.literal("end")]).optional()}),y=_.extend({condition:a.z.enum(["uploaded","notUploaded"]).optional(),value:a.z.undefined()}),w=_.extend({condition:a.z.enum(["submitted","skipped"]).optional(),value:a.z.undefined()}),x=_.extend({condition:a.z.enum(["skipped","accepted"]).optional(),value:a.z.undefined()}),k=_.extend({condition:a.z.enum(["submitted","skipped","equals","notEquals"]).optional(),value:a.z.string().optional()}),j=_.extend({condition:a.z.enum(["submitted","skipped","includesAll","includesOne","equals"]).optional(),value:a.z.union([a.z.array(a.z.string()),a.z.string()]).optional()}),C=_.extend({condition:a.z.enum(["equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","submitted","skipped"]).optional(),value:a.z.union([a.z.string(),a.z.number()]).optional()}),z=_.extend({condition:a.z.enum(["clicked","submitted","skipped"]).optional(),value:a.z.undefined()}),N=_.extend({condition:a.z.enum(["equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","submitted","skipped"]).optional(),value:a.z.union([a.z.string(),a.z.number()]).optional()}),L=_.extend({condition:a.z.enum(["submitted","skipped"]).optional(),value:a.z.undefined()}),T=_.extend({condition:a.z.enum(["booked","skipped"]).optional(),value:a.z.undefined()}),E=a.z.union([w,x,k,j,C,z,N,L,y,T]),S=a.z.object({id:a.z.string(),type:a.z.string(),headline:a.z.string(),subheader:a.z.string().optional(),imageUrl:a.z.string().optional(),required:a.z.boolean(),buttonLabel:a.z.string().optional(),backButtonLabel:a.z.string().optional(),scale:a.z.enum(["number","smiley","star"]).optional(),range:a.z.union([a.z.literal(5),a.z.literal(3),a.z.literal(4),a.z.literal(7),a.z.literal(10)]).optional(),logic:a.z.array(E).optional(),isDraft:a.z.boolean().optional()}),M=a.z.enum(["text","email","url","number","phone"]),I=S.extend({type:a.z.literal("openText"),placeholder:a.z.string().optional(),longAnswer:a.z.boolean().optional(),logic:a.z.array(w).optional(),inputType:M.optional().default("text")}),O=S.extend({type:a.z.literal("consent"),html:a.z.string().optional(),label:a.z.string(),dismissButtonLabel:a.z.string().optional(),placeholder:a.z.string().optional(),logic:a.z.array(x).optional()}),q=S.extend({type:a.z.literal("multipleChoiceSingle"),choices:a.z.array(b),logic:a.z.array(k).optional(),shuffleOption:a.z.enum(["none","all","exceptLast"]).optional(),otherOptionPlaceholder:a.z.string().optional()}),A=S.extend({type:a.z.literal("multipleChoiceMulti"),choices:a.z.array(b),logic:a.z.array(j).optional(),shuffleOption:a.z.enum(["none","all","exceptLast"]).optional(),otherOptionPlaceholder:a.z.string().optional()}),P=S.extend({type:a.z.literal("nps"),lowerLabel:a.z.string(),upperLabel:a.z.string(),logic:a.z.array(C).optional()}),Z=S.extend({type:a.z.literal("cta"),html:a.z.string().optional(),buttonUrl:a.z.string().optional(),buttonExternal:a.z.boolean(),dismissButtonLabel:a.z.string().optional(),logic:a.z.array(z).optional()}),U=S.extend({type:a.z.literal("rating"),scale:a.z.enum(["number","smiley","star"]),range:a.z.union([a.z.literal(5),a.z.literal(3),a.z.literal(4),a.z.literal(7),a.z.literal(10)]),lowerLabel:a.z.string(),upperLabel:a.z.string(),logic:a.z.array(N).optional()}),R=S.extend({type:a.z.literal("date"),html:a.z.string().optional(),format:a.z.enum(["M-d-y","d-M-y","y-M-d"])}),B=S.extend({type:a.z.literal("pictureSelection"),allowMulti:a.z.boolean().optional().default(!1),choices:a.z.array(g),logic:a.z.array(L).optional()}),D=S.extend({type:a.z.literal("fileUpload"),allowMultipleFiles:a.z.boolean(),maxSizeInMB:a.z.number().optional(),allowedFileExtensions:a.z.array(o.FI).optional(),logic:a.z.array(y).optional()}),F=S.extend({type:a.z.literal("cal"),calUserName:a.z.string(),logic:a.z.array(T).optional()}),W=a.z.union([I,O,q,A,P,Z,U,B,R,D,F]),V=a.z.array(W),H=a.z.object({attributeClassId:a.z.string().cuid2(),condition:a.z.enum(["equals","notEquals"]),value:a.z.string()}),K=a.z.enum(["displayOnce","displayMultiple","respondMultiple"]),Y=a.z.enum(["web","email","link","mobile"]),$=a.z.enum(["draft","inProgress","paused","completed"]);a.z.object({id:a.z.string().cuid2(),createdAt:a.z.date(),updatedAt:a.z.date(),name:a.z.string(),type:Y,environmentId:a.z.string(),createdBy:a.z.string().nullable(),status:$,attributeFilters:a.z.array(H),displayOption:K,autoClose:a.z.number().nullable(),triggers:a.z.array(a.z.string()),redirectUrl:a.z.string().url().nullable(),recontactDays:a.z.number().nullable(),welcomeCard:l,questions:V,thankYouCard:s,hiddenFields:d,delay:a.z.number(),autoComplete:a.z.number().nullable(),closeOnDate:a.z.date().nullable(),productOverwrites:c.nullable(),styling:p.nullable(),surveyClosedMessage:f.nullable(),singleUse:h.nullable(),verifyEmail:m.nullable(),pin:a.z.string().nullable().optional(),resultShareKey:a.z.string().nullable(),displayPercentage:a.z.number().min(1).max(100).nullable()}),a.z.object({name:a.z.string(),type:Y.optional(),createdBy:a.z.string().cuid().optional(),status:$.optional(),displayOption:K.optional(),autoClose:a.z.number().optional(),redirectUrl:a.z.string().url().optional(),recontactDays:a.z.number().optional(),welcomeCard:l.optional(),questions:V.optional(),thankYouCard:s.optional(),hiddenFields:d,delay:a.z.number().optional(),autoComplete:a.z.number().optional(),closeOnDate:a.z.date().optional(),surveyClosedMessage:f.optional(),verifyEmail:m.optional(),attributeFilters:a.z.array(H).optional(),triggers:a.z.array(a.z.string()).optional()}),a.z.union([a.z.literal("fileUpload"),a.z.literal("openText"),a.z.literal("multipleChoiceSingle"),a.z.literal("multipleChoiceMulti"),a.z.literal("nps"),a.z.literal("cta"),a.z.literal("rating"),a.z.literal("consent"),a.z.literal("pictureSelection"),a.z.literal("cal"),a.z.literal("date")])},78249:function(e,t,r){r.d(t,{z:function(){return s}});var n=r(91674),i=r(77997),a=r(86655),o=r(69453);let s=(0,a.forwardRef)(function(e,t){let{loading:r=!1,variant:s="primary",size:l="base",StartIcon:d,startIconClassName:c,endIconClassName:u,EndIcon:p,shallow:f,...h}=e,m=e.disabled||r,b=void 0!==e.href,g=a.createElement(b?"span":"button",{...h,disabled:m,ref:t,className:(0,o.cn)("inline-flex items-center appearance-none","sm"===l&&"px-3 py-2 text-sm leading-4 font-medium rounded-md","base"===l&&"px-6 py-3 text-sm font-medium rounded-md","lg"===l&&"px-8 py-4 text-base font-medium rounded-md","icon"===l&&"w-10 h-10 justify-center group p-2 border rounded-lg border-transparent text-neutral-400 hover:border-slate-200 transition","fab"===l?"fixed":"relative","fab"===l&&"justify-center bottom-20 right-8 rounded-full p-4 w-14 h-14","highlight"===s&&(m?"border border-transparent bg-slate-400 text-white":"text-white bg-brand-dark focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-slate-900 transition ease-in-out delay-50 hover:scale-105"),"primary"===s&&(m?"border border-transparent bg-slate-400 text-white":"text-white bg-brand-dark hover:bg-brand focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-slate-900"),"minimal"===s&&(m?"border border-slate-200 text-slate-400":"hover:text-slate-600 text-slate-700  focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-neutral-900 dark:text-slate-700 dark:hover:text-slate-500"),"alert"===s&&(m?"border border-transparent bg-slate-400 text-white":"border border-transparent dark:text-darkmodebrandcontrast text-brandcontrast bg-red-600 dark:bg-darkmodebrand hover:bg-opacity-90 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-neutral-900"),"secondary"===s&&(m?"text-slate-400 dark:text-slate-500 bg-slate-200 dark:bg-slate-800":"text-slate-600 hover:text-slate-500 bg-slate-200 hover:bg-slate-100 dark:bg-slate-700 dark:text-slate-300 dark:hover:bg-slate-600 focus:outline-none focus:ring-2 focus:ring-offset-1  focus:bg-slate-300 focus:ring-neutral-500"),"warn"===s&&(m?"text-slate-400 bg-transparent":"hover:bg-red-200 text-red-700 bg-red-100 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:bg-red-50 focus:ring-red-500"),"darkCTA"===s&&(m?"text-slate-400 dark:text-slate-500 bg-slate-200 dark:bg-slate-800":"text-slate-100 hover:text-slate-50 bg-gradient-to-br from-slate-900 to-slate-800 hover:from-slate-800 hover:to-slate-700 dark:text-slate-300 focus:outline-none focus:ring-2 focus:ring-offset-1  focus:bg-slate-700 focus:ring-neutral-500"),r?"cursor-wait":m?"cursor-not-allowed":"",e.className),onClick:m?e=>{e.preventDefault()}:e.onClick},(0,n.jsxs)(n.Fragment,{children:[d&&(0,n.jsx)(d,{className:(0,o.cn)("flex","icon"===l?"h-4 w-4 ":"-ml-1 mr-1 h-3 w-3",c||"")}),e.children,r&&(0,n.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform",children:(0,n.jsxs)("svg",{className:(0,o.cn)("mx-4 h-5 w-5 animate-spin","primary"===s?"text-white dark:text-slate-900":"text-slate-900"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),p&&(0,n.jsx)(p,{className:(0,o.cn)("-mr-1 ml-2 inline h-5 w-5 rtl:mr-2",u||"")})]}));return e.href?(0,n.jsx)(i.default,{passHref:!0,href:e.href,shallow:f&&f,target:e.target||"_self",children:g}):g})},63813:function(e,t,r){let n;r.d(t,{g:function(){return n7}});var i,a,o,s,l,d,c,u,p,f,h,m,b,g,v,_=r(91674),y=r(86655),w={},x=[],k=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,j=Array.isArray;function C(e,t){for(var r in t)e[r]=t[r];return e}function z(e){var t=e.parentNode;t&&t.removeChild(e)}function N(e,t,r){var n,i,a,o={};for(a in t)"key"==a?n=t[a]:"ref"==a?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?p.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return L(e,o,n,i,null)}function L(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++h:i,__i:-1,__u:0};return null==i&&null!=f.vnode&&f.vnode(a),a}function T(e){return e.children}function E(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?S(e):null}function M(e){(!e.__d&&(e.__d=!0)&&m.push(e)&&!I.__r++||b!==f.debounceRendering)&&((b=f.debounceRendering)||g)(I)}function I(){var e,t,r,n,i,a,o,s,l;for(m.sort(v);e=m.shift();)e.__d&&(t=m.length,n=void 0,a=(i=(r=e).__v).__e,s=[],l=[],(o=r.__P)&&((n=C({},i)).__v=i.__v+1,f.vnode&&f.vnode(n),R(o,n,i,r.__n,void 0!==o.ownerSVGElement,32&i.__u?[a]:null,s,null==a?S(i):a,!!(32&i.__u),l),n.__.__k[n.__i]=n,B(s,n,l),n.__e!=a&&function e(t){var r,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,r=0;r<t.__k.length;r++)if(null!=(n=t.__k[r])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return e(t)}}(n)),m.length>t&&m.sort(v));I.__r=0}function O(e,t,r,n,i,a,o,s,l,d,c){var u,p,f,h,m,b=n&&n.__k||x,g=t.length;for(r.__d=l,function(e,t,r){var n,i,a,o,s,l=t.length,d=r.length,c=d,u=0;for(e.__k=[],n=0;n<l;n++)null!=(i=e.__k[n]=null==(i=t[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?L(null,i,null,null,i):j(i)?L(T,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?L(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=function(e,t,r,n){var i=e.key,a=e.type,o=r-1,s=r+1,l=t[r];if(null===l||l&&i==l.key&&a===l.type)return r;if(n>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||s<t.length;){if(o>=0){if((l=t[o])&&0==(131072&l.__u)&&i==l.key&&a===l.type)return o;o--}if(s<t.length){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&a===l.type)return s;s++}}return -1}(i,r,o=n+u,c),i.__i=s,a=null,-1!==s&&(c--,(a=r[s])&&(a.__u|=131072)),null==a||null===a.__v?(-1==s&&u--,"function"!=typeof i.type&&(i.__u|=65536)):s!==o&&(s===o+1?u++:s>o?c>l-o?u+=s-o:u--:u=s<o&&s==o-1?s-o:0,s!==n+u&&(i.__u|=65536))):(a=r[n])&&null==a.key&&a.__e&&(a.__e==e.__d&&(e.__d=S(a)),F(a,a,!1),r[n]=null,c--);if(c)for(n=0;n<d;n++)null!=(a=r[n])&&0==(131072&a.__u)&&(a.__e==e.__d&&(e.__d=S(a)),F(a,a))}(r,t,b),l=r.__d,u=0;u<g;u++)null!=(f=r.__k[u])&&"boolean"!=typeof f&&"function"!=typeof f&&(p=-1===f.__i?w:b[f.__i]||w,f.__i=u,R(e,f,p,i,a,o,s,l,d,c),h=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&D(p.ref,null,f),c.push(f.ref,f.__c||h,f)),null==m&&null!=h&&(m=h),65536&f.__u||p.__k===f.__k?l=function e(t,r,n){var i,a;if("function"==typeof t.type){for(i=t.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=t,r=e(i[a],r,n));return r}return t.__e!=r&&(n.insertBefore(t.__e,r||null),r=t.__e),r&&r.nextSibling}(f,l,e):"function"==typeof f.type&&void 0!==f.__d?l=f.__d:h&&(l=h.nextSibling),f.__d=void 0,f.__u&=-196609);r.__d=l,r.__e=m}function q(e,t){return t=t||[],null==e||"boolean"==typeof e||(j(e)?e.some(function(e){q(e,t)}):t.push(e)),t}function A(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||k.test(t)?r:r+"px"}function P(e,t,r,n,i){var a;e:if("style"===t){if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||A(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||A(e.style,t,r[t])}}else if("o"===t[0]&&"n"===t[1])a=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase() in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,a?U:Z,a)):e.removeEventListener(t,a?U:Z,a);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function Z(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(f.event?f.event(e):e)}function U(e){return this.l[e.type+!0](f.event?f.event(e):e)}function R(e,t,r,n,i,a,o,s,l,d){var c,u,h,m,b,g,v,_,y,x,k,N,L,M,I,q=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),a=[s=t.__e=r.__e]),(c=f.__b)&&c(t);e:if("function"==typeof q)try{if(_=t.props,y=(c=q.contextType)&&n[c.__c],x=c?y?y.props.value:c.__:n,r.__c?v=(u=t.__c=r.__c).__=u.__E:("prototype"in q&&q.prototype.render?t.__c=u=new q(_,x):(t.__c=u=new E(_,x),u.constructor=q,u.render=W),y&&y.sub(u),u.props=_,u.state||(u.state={}),u.context=x,u.__n=n,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=q.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=C({},u.__s)),C(u.__s,q.getDerivedStateFromProps(_,u.__s))),m=u.props,b=u.state,u.__v=t,h)null==q.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==q.getDerivedStateFromProps&&_!==m&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(_,x),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(_,u.__s,x)||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=_,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(e){e&&(e.__=t)}),k=0;k<u._sb.length;k++)u.__h.push(u._sb[k]);u._sb=[],u.__h.length&&o.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(_,u.__s,x),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(m,b,g)})}if(u.context=x,u.props=_,u.__P=e,u.__e=!1,N=f.__r,L=0,"prototype"in q&&q.prototype.render){for(u.state=u.__s,u.__d=!1,N&&N(t),c=u.render(u.props,u.state,u.context),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[]}else do u.__d=!1,N&&N(t),c=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++L<25);u.state=u.__s,null!=u.getChildContext&&(n=C(C({},n),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(g=u.getSnapshotBeforeUpdate(m,b)),O(e,j(I=null!=c&&c.type===T&&null==c.key?c.props.children:c)?I:[I],t,r,n,i,a,o,s,l,d),u.base=t.__e,t.__u&=-161,u.__h.length&&o.push(u),v&&(u.__E=u.__=null)}catch(e){t.__v=null,l||null!=a?(t.__e=s,t.__u|=l?160:32,a[a.indexOf(s)]=null):(t.__e=r.__e,t.__k=r.__k),f.__e(e,t,r)}else null==a&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,i,a,o,s,l){var d,c,u,f,h,m,b,g=r.props,v=t.props,_=t.type;if("svg"===_&&(i=!0),null!=a){for(d=0;d<a.length;d++)if((h=a[d])&&"setAttribute"in h==!!_&&(_?h.localName===_:3===h.nodeType)){e=h,a[d]=null;break}}if(null==e){if(null===_)return document.createTextNode(v);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,v.is&&v),a=null,s=!1}if(null===_)g===v||s&&e.data===v||(e.data=v);else{if(a=a&&p.call(e.childNodes),g=r.props||w,!s&&null!=a)for(g={},d=0;d<e.attributes.length;d++)g[(h=e.attributes[d]).name]=h.value;for(d in g)h=g[d],"children"==d||("dangerouslySetInnerHTML"==d?u=h:"key"===d||d in v||P(e,d,null,h,i));for(d in v)h=v[d],"children"==d?f=h:"dangerouslySetInnerHTML"==d?c=h:"value"==d?m=h:"checked"==d?b=h:"key"===d||s&&"function"!=typeof h||g[d]===h||P(e,d,h,g[d],i);if(c)s||u&&(c.__html===u.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(u&&(e.innerHTML=""),O(e,j(f)?f:[f],t,r,n,i&&"foreignObject"!==_,a,o,a?a[0]:r.__k&&S(r,0),s,l),null!=a)for(d=a.length;d--;)null!=a[d]&&z(a[d]);s||(d="value",void 0===m||m===e[d]&&("progress"!==_||m)&&("option"!==_||m===g[d])||P(e,d,m,g[d],!1),d="checked",void 0!==b&&b!==e[d]&&P(e,d,b,g[d],!1))}return e}(r.__e,t,r,n,i,a,o,l,d);(c=f.diffed)&&c(t)}function B(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)D(r[n],r[++n],r[++n]);f.__c&&f.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){f.__e(e,t.__v)}})}function D(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){f.__e(e,r)}}function F(e,t,r){var n,i;if(f.unmount&&f.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||D(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){f.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&F(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||z(e.__e),e.__=e.__e=e.__d=void 0}function W(e,t,r){return this.constructor(e,r)}function V(e,t,r){var n,i,a,o;f.__&&f.__(e,t),i=(n="function"==typeof r)?null:r&&r.__k||t.__k,a=[],o=[],R(t,e=(!n&&r||t).__k=N(T,null,[e]),i||w,w,void 0!==t.ownerSVGElement,!n&&r?[r]:i?null:t.firstChild?p.call(t.childNodes):null,a,!n&&r?r:i?i.__e:t.firstChild,n,o),B(a,e,o)}p=x.slice,f={__e:function(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&null!=a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},h=0,E.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=C({},this.state),"function"==typeof e&&(e=e(C({},r),this.props)),e&&C(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),M(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},E.prototype.render=T,m=[],g="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,v=function(e,t){return e.__v.__b-t.__v.__b},I.__r=0;var H=0;function K(e,t,r,n,i,a){var o,s,l={};for(s in t)"ref"==s?o=t[s]:l[s]=t[s];var d={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--H,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===l[s]&&(l[s]=o[s]);return f.vnode&&f.vnode(d),d}function Y(){return K("a",{href:"https://formbricks.com?utm_source=survey_branding",target:"_blank",tabIndex:-1,className:"mb-5 mt-2 flex justify-center",children:K("p",{className:"text-signature text-xs",children:["Powered by"," ",K("b",{children:K("span",{className:"text-info-text hover:text-heading",children:"Formbricks"})})]})})}let $=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")},J=e=>{for(let t=0;t<e.length;t++){let r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}},Q=(e,t)=>{let r=[...e],n=r.findIndex(e=>"other"===e.id),i=-1!==n?r.splice(n,1)[0]:null;if("all"===t)J(r);else if("exceptLast"===t){let e=r.pop();J(r),r.push(e)}return i&&r.push(i),r},G=(e,t)=>{var r;let n=e.questions[t],i=Math.floor(e.questions.length/2),a=(null==(r=null==n?void 0:n.logic)?void 0:r.map(e=>e.destination))||[],o=t||.5,s=(()=>{let t=e.questions.filter(e=>a.includes(e.id)).sort((t,r)=>e.questions.indexOf(t)-e.questions.indexOf(r)).pop();return e.questions.findIndex(e=>e.id===(null==t?void 0:t.id))})();return s>0&&(o=Math.min(i,s-1)),a.includes("end")&&(o=i),o};var X,ee,et,er,en=0,ei=[],ea=[],eo=f.__b,es=f.__r,el=f.diffed,ed=f.__c,ec=f.unmount;function eu(e,t){f.__h&&f.__h(ee,e,en||t),en=0;var r=ee.__H||(ee.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ea}),r.__[e]}function ep(e){return en=1,function(e,t,r){var n=eu(X++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):ex(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=ee,!ee.u)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,r);var o=!1;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),!(!o&&n.__c.props===e)&&(!a||a.call(this,e,t,r))};ee.u=!0;var a=ee.shouldComponentUpdate,o=ee.componentWillUpdate;ee.componentWillUpdate=function(e,t,r){if(this.__e){var n=a;a=void 0,i(e,t,r),a=n}o&&o.call(this,e,t,r)},ee.shouldComponentUpdate=i}return n.__N||n.__}(ex,e)}function ef(e,t){var r=eu(X++,3);!f.__s&&ew(r.__H,t)&&(r.__=e,r.i=t,ee.__H.__h.push(r))}function eh(e){return en=5,em(function(){return{current:e}},[])}function em(e,t){var r=eu(X++,7);return ew(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function eb(e,t){return en=8,em(function(){return e},t)}function eg(){for(var e;e=ei.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(e_),e.__H.__h.forEach(ey),e.__H.__h=[]}catch(t){e.__H.__h=[],f.__e(t,e.__v)}}f.__b=function(e){ee=null,eo&&eo(e)},f.__r=function(e){es&&es(e),X=0;var t=(ee=e.__c).__H;t&&(et===ee?(t.__h=[],ee.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=ea,e.__N=e.i=void 0})):(t.__h.forEach(e_),t.__h.forEach(ey),t.__h=[],X=0)),et=ee},f.diffed=function(e){el&&el(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ei.push(t)&&er===f.requestAnimationFrame||((er=f.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),ev&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);ev&&(t=requestAnimationFrame(r))})(eg)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==ea&&(e.__=e.__V),e.i=void 0,e.__V=ea})),et=ee=null},f.__c=function(e,t){t.some(function(e){try{e.__h.forEach(e_),e.__h=e.__h.filter(function(e){return!e.__||ey(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],f.__e(r,e.__v)}}),ed&&ed(e,t)},f.unmount=function(e){ec&&ec(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(e){try{e_(e)}catch(e){t=e}}),r.__H=void 0,t&&f.__e(t,r.__v))};var ev="function"==typeof requestAnimationFrame;function e_(e){var t=ee,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),ee=t}function ey(e){var t=ee;e.__c=e.__(),ee=t}function ew(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function ex(e,t){return"function"==typeof t?t(e):t}function ek(e){let{progress:t}=e;return K("div",{className:"bg-accent-bg h-2 w-full overflow-hidden rounded-full",children:K("div",{className:"transition-width bg-brand z-20 h-2 rounded-full duration-500",style:{width:"".concat(Math.floor(100*t),"%")}})})}function ej(e){let{survey:t,questionId:r}=e,n=em(()=>t.questions.findIndex(e=>e.id===r),[t,r]),i=eb((e,t,r)=>{if(0===t.questions.length)return 0;let n=t.questions.findIndex(t=>t.id===e);-1===n&&(n=0);let i=G(t,n)/t.questions.length,a=r;return i>r?a=i:i<=r&&r+.1<=1&&(a=r+.1),a},[]),a=em(()=>{let e=0,r=[];return t.questions.forEach(n=>{e=i(n.id,t,e),r.push(e)}),r},[i,t]);return K(ek,{progress:"end"===r?1:a[n]})}function eC(e){let{buttonLabel:t,isLastQuestion:r,onClick:n,tabIndex:i=1,focus:a=!1,type:o="submit"}=e;return K("button",{ref:eb(e=>{e&&a&&setTimeout(()=>{e.focus()},200)},[a]),type:o,tabIndex:i,autoFocus:a,className:"bg-brand border-submit-button-border text-on-brand focus:ring-focus flex items-center rounded-md border px-3 py-3 text-base font-medium leading-4 shadow-sm hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2",onClick:n,children:t||(r?"Finish":"Next")})}let ez=e=>{let{questions:t,responseData:r,onRetry:n}=e;return K("div",{className:"flex flex-col bg-white",children:[K("span",{className:"mb-1.5 text-base font-bold leading-6 text-slate-900",children:"Your feedback is stuck :("}),K("p",{className:"max-w-md text-sm font-normal leading-6 text-slate-600",children:["The servers cannot be reached at the moment.",K("br",{}),"Please retry now or try again later."]}),K("div",{className:"mt-4 rounded-lg border border-slate-200 bg-slate-100 px-4 py-5",children:K("div",{className:"flex max-h-36 flex-1 flex-col space-y-3 overflow-y-scroll",children:t.map((e,t)=>{let n=r[e.id];if(n)return K("div",{className:"flex flex-col",children:[K("span",{className:"text-sm leading-6 text-slate-900",children:"Question ".concat(t+1)}),K("span",{className:"mt-1 text-sm font-semibold leading-6 text-slate-900",children:"object"==typeof n?n.join(", "):n})]})})})}),K("div",{className:"mt-4 flex flex-1 flex-row items-center justify-end space-x-2",children:K(eC,{tabIndex:2,buttonLabel:"Retry",isLastQuestion:!1,onClick:()=>n()})})]})};function eN(e){let{survey:t,onClose:r,children:n}=e,[i,a]=ep(100),[o,s]=ep(!1),l=eh(performance.now()),d=eh(null),c=()=>{null!==d.current&&(s(!0),cancelAnimationFrame(d.current),d.current=null)};return ef(()=>{if(!t.autoClose)return;let e=()=>{let n=1e3*t.autoClose,i=Math.max(0,n-(performance.now()-l.current));a(i/n),i>0?d.current=requestAnimationFrame(e):(c(),r())};return a(1),d.current=requestAnimationFrame(e),()=>c()},[t.autoClose,r]),K(T,{children:[!o&&t.autoClose&&K(ek,{progress:i}),K("div",{onClick:c,onMouseOver:c,className:"h-full w-full",children:n})]})}function eL(e,t){switch(e.condition){case"equals":return Array.isArray(t)&&1===t.length&&t.includes(e.value)||(null==t?void 0:t.toString())===e.value;case"notEquals":return t!==e.value;case"lessThan":return void 0!==e.value&&t<e.value;case"lessEqual":return void 0!==e.value&&t<=e.value;case"greaterThan":return void 0!==e.value&&t>e.value;case"greaterEqual":return void 0!==e.value&&t>=e.value;case"includesAll":return Array.isArray(t)&&Array.isArray(e.value)&&e.value.every(e=>t.includes(e));case"includesOne":return Array.isArray(t)&&Array.isArray(e.value)&&e.value.some(e=>t.includes(e));case"accepted":return"accepted"===t;case"clicked":return"clicked"===t;case"submitted":if("string"==typeof t)return"dismissed"!==t&&""!==t&&null!==t;if(Array.isArray(t))return t.length>0;if("number"==typeof t)return null!==t;return!1;case"skipped":return Array.isArray(t)&&0===t.length||""===t||null==t||"dismissed"===t;case"uploaded":if(Array.isArray(t))return t.length>0;return"skipped"!==t&&""!==t&&null!==t;case"notUploaded":return Array.isArray(t)&&0===t.length||""===t||null===t||"skipped"===t;default:return!1}}(i=l||(l={})).assertEqual=e=>e,i.assertIs=function(e){},i.assertNever=function(e){throw Error()},i.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},i.getValidEnumValues=e=>{let t=i.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return i.objectValues(r)},i.objectValues=e=>i.objectKeys(e).map(function(t){return e[t]}),i.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},i.find=(e,t)=>{for(let r of e)if(t(r))return r},i.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,i.joinValues=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return e.map(e=>"string"==typeof e?"'".concat(e,"'"):e).join(t)},i.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(d||(d={})).mergeShapes=(e,t)=>({...e,...t});let eT=l.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),eE=e=>{switch(typeof e){case"undefined":return eT.undefined;case"string":return eT.string;case"number":return isNaN(e)?eT.nan:eT.number;case"boolean":return eT.boolean;case"function":return eT.function;case"bigint":return eT.bigint;case"symbol":return eT.symbol;case"object":if(Array.isArray(e))return eT.array;if(null===e)return eT.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return eT.promise;if("undefined"!=typeof Map&&e instanceof Map)return eT.map;if("undefined"!=typeof Set&&e instanceof Set)return eT.set;if("undefined"!=typeof Date&&e instanceof Date)return eT.date;return eT.object;default:return eT.unknown}},eS=l.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class eM extends Error{get errors(){return this.issues}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){let r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,l.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e.message,t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}constructor(e){var t;super(),t=this,this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.issues=[...t.issues,...e]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}}eM.create=e=>new eM(e);let eI=(e,t)=>{let r;switch(e.code){case eS.invalid_type:r=e.received===eT.undefined?"Required":"Expected ".concat(e.expected,", received ").concat(e.received);break;case eS.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,l.jsonStringifyReplacer));break;case eS.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(l.joinValues(e.keys,", "));break;case eS.invalid_union:r="Invalid input";break;case eS.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(l.joinValues(e.options));break;case eS.invalid_enum_value:r="Invalid enum value. Expected ".concat(l.joinValues(e.options),", received '").concat(e.received,"'");break;case eS.invalid_arguments:r="Invalid function arguments";break;case eS.invalid_return_type:r="Invalid function return type";break;case eS.invalid_date:r="Invalid date";break;case eS.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),"number"==typeof e.validation.position&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):l.assertNever(e.validation):r="regex"!==e.validation?"Invalid ".concat(e.validation):"Invalid";break;case eS.too_small:r="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):"date"===e.type?"Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):"Invalid input";break;case eS.too_big:r="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"bigint"===e.type?"BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"date"===e.type?"Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):"Invalid input";break;case eS.custom:r="Invalid input";break;case eS.invalid_intersection_types:r="Intersection results could not be merged";break;case eS.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case eS.not_finite:r="Number must be finite";break;default:r=t.defaultError,l.assertNever(e)}return{message:r}},eO=eI;function eq(){return eO}let eA=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],o={...i,path:a},s="";for(let e of n.filter(e=>!!e).slice().reverse())s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:i.message||s}};function eP(e,t){let r=eA({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,eq(),eI].filter(e=>!!e)});e.common.issues.push(r)}class eZ{dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return eU;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t)r.push({key:await e.key,value:await e.value});return eZ.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:i}=n;if("aborted"===t.status||"aborted"===i.status)return eU;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||n.alwaysSet)&&(r[t.value]=i.value)}return{status:e.value,value:r}}constructor(){this.value="valid"}}let eU=Object.freeze({status:"aborted"}),eR=e=>({status:"dirty",value:e}),eB=e=>({status:"valid",value:e}),eD=e=>"aborted"===e.status,eF=e=>"dirty"===e.status,eW=e=>"valid"===e.status,eV=e=>"undefined"!=typeof Promise&&e instanceof Promise;(a=c||(c={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},a.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class eH{get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}}let eK=(e,t)=>{if(eW(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new eM(e.common.issues);return this._error=t,this._error}}};function eY(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError},description:i}}class e${get description(){return this._def.description}_getType(e){return eE(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:eE(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new eZ,ctx:{common:e.parent.common,data:e.data,parsedType:eE(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(eV(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eE(e)},i=this._parseSync({data:e,path:n.path,parent:n});return eK(n,i)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eE(e)},n=this._parse({data:e,path:r.path,parent:r});return eK(r,await (eV(n)?n:Promise.resolve(n)))}refine(e,t){let r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{let i=e(t),a=()=>n.addIssue({code:eS.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(a(),!1)):!!i||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new tk({schema:this,typeName:u.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return tj.create(this,this._def)}nullable(){return tC.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return to.create(this,this._def)}promise(){return tx.create(this,this._def)}or(e){return tl.create([this,e],this._def)}and(e){return tu.create(this,e,this._def)}transform(e){return new tk({...eY(this._def),schema:this,typeName:u.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new tz({...eY(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:u.ZodDefault})}brand(){return new tE({typeName:u.ZodBranded,type:this,...eY(this._def)})}catch(e){return new tN({...eY(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:u.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return tS.create(this,e)}readonly(){return tM.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}}let eJ=/^c[^\s-]{8,}$/i,eQ=/^[a-z][a-z0-9]*$/,eG=/^[0-9A-HJKMNP-TV-Z]{26}$/,eX=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,e0=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,e1=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,e2=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,e3=e=>e.precision?new RegExp(e.offset?"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{".concat(e.precision,"}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{".concat(e.precision,"}Z$")):0===e.precision?e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");class e4 extends e${_parse(e){let t;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==eT.string){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.string,received:t.parsedType}),eU}let r=new eZ;for(let o of this._def.checks)if("min"===o.kind)e.data.length<o.value&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("max"===o.kind)e.data.length>o.value&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("length"===o.kind){let n=e.data.length>o.value,i=e.data.length<o.value;(n||i)&&(t=this._getOrReturnCtx(e,t),n?eP(t,{code:eS.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&eP(t,{code:eS.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if("email"===o.kind)e0.test(e.data)||(eP(t=this._getOrReturnCtx(e,t),{validation:"email",code:eS.invalid_string,message:o.message}),r.dirty());else if("emoji"===o.kind)n||(n=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),n.test(e.data)||(eP(t=this._getOrReturnCtx(e,t),{validation:"emoji",code:eS.invalid_string,message:o.message}),r.dirty());else if("uuid"===o.kind)eX.test(e.data)||(eP(t=this._getOrReturnCtx(e,t),{validation:"uuid",code:eS.invalid_string,message:o.message}),r.dirty());else if("cuid"===o.kind)eJ.test(e.data)||(eP(t=this._getOrReturnCtx(e,t),{validation:"cuid",code:eS.invalid_string,message:o.message}),r.dirty());else if("cuid2"===o.kind)eQ.test(e.data)||(eP(t=this._getOrReturnCtx(e,t),{validation:"cuid2",code:eS.invalid_string,message:o.message}),r.dirty());else if("ulid"===o.kind)eG.test(e.data)||(eP(t=this._getOrReturnCtx(e,t),{validation:"ulid",code:eS.invalid_string,message:o.message}),r.dirty());else if("url"===o.kind)try{new URL(e.data)}catch(n){eP(t=this._getOrReturnCtx(e,t),{validation:"url",code:eS.invalid_string,message:o.message}),r.dirty()}else if("regex"===o.kind)o.regex.lastIndex=0,o.regex.test(e.data)||(eP(t=this._getOrReturnCtx(e,t),{validation:"regex",code:eS.invalid_string,message:o.message}),r.dirty());else if("trim"===o.kind)e.data=e.data.trim();else if("includes"===o.kind)e.data.includes(o.value,o.position)||(eP(t=this._getOrReturnCtx(e,t),{code:eS.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty());else if("toLowerCase"===o.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===o.kind)e.data=e.data.toUpperCase();else if("startsWith"===o.kind)e.data.startsWith(o.value)||(eP(t=this._getOrReturnCtx(e,t),{code:eS.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty());else if("endsWith"===o.kind)e.data.endsWith(o.value)||(eP(t=this._getOrReturnCtx(e,t),{code:eS.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty());else if("datetime"===o.kind)e3(o).test(e.data)||(eP(t=this._getOrReturnCtx(e,t),{code:eS.invalid_string,validation:"datetime",message:o.message}),r.dirty());else if("ip"===o.kind){var i,a;i=e.data,("v4"===(a=o.version)||!a)&&e1.test(i)||("v6"===a||!a)&&e2.test(i)||(eP(t=this._getOrReturnCtx(e,t),{validation:"ip",code:eS.invalid_string,message:o.message}),r.dirty())}else l.assertNever(o);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:eS.invalid_string,...c.errToObj(r)})}_addCheck(e){return new e4({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...c.errToObj(e)})}url(e){return this._addCheck({kind:"url",...c.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...c.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...c.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...c.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...c.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...c.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...c.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...c.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...c.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...c.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...c.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...c.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...c.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...c.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...c.errToObj(t)})}nonempty(e){return this.min(1,c.errToObj(e))}trim(){return new e4({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e4({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e4({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}e4.create=e=>{var t;return new e4({checks:[],typeName:u.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...eY(e)})};class e5 extends e${_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==eT.number){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.number,received:t.parsedType}),eU}let r=new eZ;for(let n of this._def.checks)"int"===n.kind?l.isInteger(e.data)||(eP(t=this._getOrReturnCtx(e,t),{code:eS.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}(e.data,n.value)&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(eP(t=this._getOrReturnCtx(e,t),{code:eS.not_finite,message:n.message}),r.dirty()):l.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,c.toString(t))}gt(e,t){return this.setLimit("min",e,!1,c.toString(t))}lte(e,t){return this.setLimit("max",e,!0,c.toString(t))}lt(e,t){return this.setLimit("max",e,!1,c.toString(t))}setLimit(e,t,r,n){return new e5({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:c.toString(n)}]})}_addCheck(e){return new e5({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:c.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:c.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:c.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:c.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:c.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:c.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:c.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:c.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:c.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&l.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}}e5.create=e=>new e5({checks:[],typeName:u.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...eY(e)});class e6 extends e${_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==eT.bigint){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.bigint,received:t.parsedType}),eU}let r=new eZ;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):l.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,c.toString(t))}gt(e,t){return this.setLimit("min",e,!1,c.toString(t))}lte(e,t){return this.setLimit("max",e,!0,c.toString(t))}lt(e,t){return this.setLimit("max",e,!1,c.toString(t))}setLimit(e,t,r,n){return new e6({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:c.toString(n)}]})}_addCheck(e){return new e6({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:c.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:c.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:c.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:c.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:c.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}}e6.create=e=>{var t;return new e6({checks:[],typeName:u.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...eY(e)})};class e8 extends e${_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==eT.boolean){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.boolean,received:t.parsedType}),eU}return eB(e.data)}}e8.create=e=>new e8({typeName:u.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...eY(e)});class e7 extends e${_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==eT.date){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.date,received:t.parsedType}),eU}if(isNaN(e.data.getTime()))return eP(this._getOrReturnCtx(e),{code:eS.invalid_date}),eU;let r=new eZ;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(eP(t=this._getOrReturnCtx(e,t),{code:eS.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):l.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new e7({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:c.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:c.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}e7.create=e=>new e7({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:u.ZodDate,...eY(e)});class e9 extends e${_parse(e){if(this._getType(e)!==eT.symbol){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.symbol,received:t.parsedType}),eU}return eB(e.data)}}e9.create=e=>new e9({typeName:u.ZodSymbol,...eY(e)});class te extends e${_parse(e){if(this._getType(e)!==eT.undefined){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.undefined,received:t.parsedType}),eU}return eB(e.data)}}te.create=e=>new te({typeName:u.ZodUndefined,...eY(e)});class tt extends e${_parse(e){if(this._getType(e)!==eT.null){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.null,received:t.parsedType}),eU}return eB(e.data)}}tt.create=e=>new tt({typeName:u.ZodNull,...eY(e)});class tr extends e${_parse(e){return eB(e.data)}constructor(){super(...arguments),this._any=!0}}tr.create=e=>new tr({typeName:u.ZodAny,...eY(e)});class tn extends e${_parse(e){return eB(e.data)}constructor(){super(...arguments),this._unknown=!0}}tn.create=e=>new tn({typeName:u.ZodUnknown,...eY(e)});class ti extends e${_parse(e){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.never,received:t.parsedType}),eU}}ti.create=e=>new ti({typeName:u.ZodNever,...eY(e)});class ta extends e${_parse(e){if(this._getType(e)!==eT.undefined){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.void,received:t.parsedType}),eU}return eB(e.data)}}ta.create=e=>new ta({typeName:u.ZodVoid,...eY(e)});class to extends e${_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==eT.array)return eP(t,{code:eS.invalid_type,expected:eT.array,received:t.parsedType}),eU;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(e||i)&&(eP(t,{code:e?eS.too_big:eS.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(eP(t,{code:eS.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(eP(t,{code:eS.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new eH(t,e,t.path,r)))).then(e=>eZ.mergeArray(r,e));let i=[...t.data].map((e,r)=>n.type._parseSync(new eH(t,e,t.path,r)));return eZ.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new to({...this._def,minLength:{value:e,message:c.toString(t)}})}max(e,t){return new to({...this._def,maxLength:{value:e,message:c.toString(t)}})}length(e,t){return new to({...this._def,exactLength:{value:e,message:c.toString(t)}})}nonempty(e){return this.min(1,e)}}to.create=(e,t)=>new to({type:e,minLength:null,maxLength:null,exactLength:null,typeName:u.ZodArray,...eY(t)});class ts extends e${_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=l.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==eT.object){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.object,received:t.parsedType}),eU}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ti&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=n[e],i=r.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new eH(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ti){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of a)o.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(eP(r,{code:eS.unrecognized_keys,keys:a}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of a){let n=r.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new eH(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>eZ.mergeObjectSync(t,e)):eZ.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return c.errToObj,new ts({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,a,o;let s=null!==(a=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=c.errToObj(e).message)&&void 0!==o?o:s}:{message:s}}}:{}})}strip(){return new ts({...this._def,unknownKeys:"strip"})}passthrough(){return new ts({...this._def,unknownKeys:"passthrough"})}extend(e){return new ts({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ts({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:u.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ts({...this._def,catchall:e})}pick(e){let t={};return l.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new ts({...this._def,shape:()=>t})}omit(e){let t={};return l.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new ts({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof ts){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=tj.create(e(i))}return new ts({...t._def,shape:()=>r})}return t instanceof to?new to({...t._def,type:e(t.element)}):t instanceof tj?tj.create(e(t.unwrap())):t instanceof tC?tC.create(e(t.unwrap())):t instanceof tp?tp.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};return l.objectKeys(this.shape).forEach(r=>{let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new ts({...this._def,shape:()=>t})}required(e){let t={};return l.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof tj;)e=e._def.innerType;t[r]=e}}),new ts({...this._def,shape:()=>t})}keyof(){return t_(l.objectKeys(this.shape))}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}}ts.create=(e,t)=>new ts({shape:()=>e,unknownKeys:"strip",catchall:ti.create(),typeName:u.ZodObject,...eY(t)}),ts.strictCreate=(e,t)=>new ts({shape:()=>e,unknownKeys:"strict",catchall:ti.create(),typeName:u.ZodObject,...eY(t)}),ts.lazycreate=(e,t)=>new ts({shape:e,unknownKeys:"strip",catchall:ti.create(),typeName:u.ZodObject,...eY(t)});class tl extends e${_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new eM(e.ctx.common.issues));return eP(t,{code:eS.invalid_union,unionErrors:r}),eU});{let e;let n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=n.map(e=>new eM(e));return eP(t,{code:eS.invalid_union,unionErrors:i}),eU}}get options(){return this._def.options}}tl.create=(e,t)=>new tl({options:e,typeName:u.ZodUnion,...eY(t)});let td=e=>{if(e instanceof tg)return td(e.schema);if(e instanceof tk)return td(e.innerType());if(e instanceof tv)return[e.value];if(e instanceof ty)return e.options;if(e instanceof tw)return Object.keys(e.enum);if(e instanceof tz)return td(e._def.innerType);if(e instanceof te)return[void 0];else if(e instanceof tt)return[null];else return null};class tc extends e${_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==eT.object)return eP(t,{code:eS.invalid_type,expected:eT.object,received:t.parsedType}),eU;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(eP(t,{code:eS.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),eU)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=td(r.shape[e]);if(!t)throw Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let i of t){if(n.has(i))throw Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(i)));n.set(i,r)}}return new tc({typeName:u.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...eY(r)})}}class tu extends e${_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(eD(e)||eD(n))return eU;let i=function e(t,r){let n=eE(t),i=eE(r);if(t===r)return{valid:!0,data:t};if(n===eT.object&&i===eT.object){let n=l.objectKeys(r),i=l.objectKeys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};a[n]=i.data}return{valid:!0,data:a}}if(n===eT.array&&i===eT.array){if(t.length!==r.length)return{valid:!1};let n=[];for(let i=0;i<t.length;i++){let a=e(t[i],r[i]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===eT.date&&i===eT.date&&+t==+r?{valid:!0,data:t}:{valid:!1}}(e.value,n.value);return i.valid?((eF(e)||eF(n))&&t.dirty(),{status:t.value,value:i.data}):(eP(r,{code:eS.invalid_intersection_types}),eU)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(e=>{let[t,r]=e;return n(t,r)}):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}tu.create=(e,t,r)=>new tu({left:e,right:t,typeName:u.ZodIntersection,...eY(r)});class tp extends e${_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eT.array)return eP(r,{code:eS.invalid_type,expected:eT.array,received:r.parsedType}),eU;if(r.data.length<this._def.items.length)return eP(r,{code:eS.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),eU;!this._def.rest&&r.data.length>this._def.items.length&&(eP(r,{code:eS.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new eH(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>eZ.mergeArray(t,e)):eZ.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new tp({...this._def,rest:e})}}tp.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new tp({items:e,typeName:u.ZodTuple,rest:null,...eY(t)})};class tf extends e${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eT.object)return eP(r,{code:eS.invalid_type,expected:eT.object,received:r.parsedType}),eU;let n=[],i=this._def.keyType,a=this._def.valueType;for(let e in r.data)n.push({key:i._parse(new eH(r,e,r.path,e)),value:a._parse(new eH(r,r.data[e],r.path,e))});return r.common.async?eZ.mergeObjectAsync(t,n):eZ.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new tf(t instanceof e$?{keyType:e,valueType:t,typeName:u.ZodRecord,...eY(r)}:{keyType:e4.create(),valueType:e,typeName:u.ZodRecord,...eY(t)})}}class th extends e${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eT.map)return eP(r,{code:eS.invalid_type,expected:eT.map,received:r.parsedType}),eU;let n=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map((e,t)=>{let[a,o]=e;return{key:n._parse(new eH(r,a,r.path,[t,"key"])),value:i._parse(new eH(r,o,r.path,[t,"value"]))}});if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of a){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return eU;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of a){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return eU;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}th.create=(e,t,r)=>new th({valueType:t,keyType:e,typeName:u.ZodMap,...eY(r)});class tm extends e${_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eT.set)return eP(r,{code:eS.invalid_type,expected:eT.set,received:r.parsedType}),eU;let n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(eP(r,{code:eS.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(eP(r,{code:eS.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let r=new Set;for(let n of e){if("aborted"===n.status)return eU;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let o=[...r.data.values()].map((e,t)=>i._parse(new eH(r,e,r.path,t)));return r.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(e,t){return new tm({...this._def,minSize:{value:e,message:c.toString(t)}})}max(e,t){return new tm({...this._def,maxSize:{value:e,message:c.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}tm.create=(e,t)=>new tm({valueType:e,minSize:null,maxSize:null,typeName:u.ZodSet,...eY(t)});class tb extends e${_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==eT.function)return eP(t,{code:eS.invalid_type,expected:eT.function,received:t.parsedType}),eU;function r(e,r){return eA({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,eq(),eI].filter(e=>!!e),issueData:{code:eS.invalid_arguments,argumentsError:r}})}function n(e,r){return eA({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,eq(),eI].filter(e=>!!e),issueData:{code:eS.invalid_return_type,returnTypeError:r}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof tx){let e=this;return eB(async function(){for(var t=arguments.length,o=Array(t),s=0;s<t;s++)o[s]=arguments[s];let l=new eM([]),d=await e._def.args.parseAsync(o,i).catch(e=>{throw l.addIssue(r(o,e)),l}),c=await Reflect.apply(a,this,d);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw l.addIssue(n(c,e)),l})})}{let e=this;return eB(function(){for(var t=arguments.length,o=Array(t),s=0;s<t;s++)o[s]=arguments[s];let l=e._def.args.safeParse(o,i);if(!l.success)throw new eM([r(o,l.error)]);let d=Reflect.apply(a,this,l.data),c=e._def.returns.safeParse(d,i);if(!c.success)throw new eM([n(d,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new tb({...this._def,args:tp.create(t).rest(tn.create())})}returns(e){return new tb({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new tb({args:e||tp.create([]).rest(tn.create()),returns:t||tn.create(),typeName:u.ZodFunction,...eY(r)})}constructor(){super(...arguments),this.validate=this.implement}}class tg extends e${get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}tg.create=(e,t)=>new tg({getter:e,typeName:u.ZodLazy,...eY(t)});class tv extends e${_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return eP(t,{received:t.data,code:eS.invalid_literal,expected:this._def.value}),eU}return{status:"valid",value:e.data}}get value(){return this._def.value}}function t_(e,t){return new ty({values:e,typeName:u.ZodEnum,...eY(t)})}tv.create=(e,t)=>new tv({value:e,typeName:u.ZodLiteral,...eY(t)});class ty extends e${_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return eP(t,{expected:l.joinValues(r),received:t.parsedType,code:eS.invalid_type}),eU}if(-1===this._def.values.indexOf(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return eP(t,{received:t.data,code:eS.invalid_enum_value,options:r}),eU}return eB(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return ty.create(e)}exclude(e){return ty.create(this.options.filter(t=>!e.includes(t)))}}ty.create=t_;class tw extends e${_parse(e){let t=l.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==eT.string&&r.parsedType!==eT.number){let e=l.objectValues(t);return eP(r,{expected:l.joinValues(e),received:r.parsedType,code:eS.invalid_type}),eU}if(-1===t.indexOf(e.data)){let e=l.objectValues(t);return eP(r,{received:r.data,code:eS.invalid_enum_value,options:e}),eU}return eB(e.data)}get enum(){return this._def.values}}tw.create=(e,t)=>new tw({values:e,typeName:u.ZodNativeEnum,...eY(t)});class tx extends e${unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==eT.promise&&!1===t.common.async?(eP(t,{code:eS.invalid_type,expected:eT.promise,received:t.parsedType}),eU):eB((t.parsedType===eT.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}tx.create=(e,t)=>new tx({type:e,typeName:u.ZodPromise,...eY(t)});class tk extends e${innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===u.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{eP(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then(e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r})):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?eU:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?eU:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>eW(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!eW(e))return e;let a=n.transform(e.value,i);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}}l.assertNever(n)}}tk.create=(e,t,r)=>new tk({schema:e,typeName:u.ZodEffects,effect:t,...eY(r)}),tk.createWithPreprocess=(e,t,r)=>new tk({schema:t,effect:{type:"preprocess",transform:e},typeName:u.ZodEffects,...eY(r)});class tj extends e${_parse(e){return this._getType(e)===eT.undefined?eB(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tj.create=(e,t)=>new tj({innerType:e,typeName:u.ZodOptional,...eY(t)});class tC extends e${_parse(e){return this._getType(e)===eT.null?eB(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tC.create=(e,t)=>new tC({innerType:e,typeName:u.ZodNullable,...eY(t)});class tz extends e${_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===eT.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}tz.create=(e,t)=>new tz({innerType:e,typeName:u.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...eY(t)});class tN extends e${_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return eV(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new eM(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new eM(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}tN.create=(e,t)=>new tN({innerType:e,typeName:u.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...eY(t)});class tL extends e${_parse(e){if(this._getType(e)!==eT.nan){let t=this._getOrReturnCtx(e);return eP(t,{code:eS.invalid_type,expected:eT.nan,received:t.parsedType}),eU}return{status:"valid",value:e.data}}}tL.create=e=>new tL({typeName:u.ZodNaN,...eY(e)});let tT=Symbol("zod_brand");class tE extends e${_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class tS extends e${_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?eU:"dirty"===e.status?(t.dirty(),eR(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?eU:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new tS({in:e,out:t,typeName:u.ZodPipeline})}}class tM extends e${_parse(e){let t=this._def.innerType._parse(e);return eW(t)&&(t.value=Object.freeze(t.value)),t}}tM.create=(e,t)=>new tM({innerType:e,typeName:u.ZodReadonly,...eY(t)});let tI=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return e?tr.create().superRefine((n,i)=>{var a,o;if(!e(n)){let e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,s=null===(o=null!==(a=e.fatal)&&void 0!==a?a:r)||void 0===o||o;i.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:s})}}):tr.create()},tO={object:ts.lazycreate};(o=u||(u={})).ZodString="ZodString",o.ZodNumber="ZodNumber",o.ZodNaN="ZodNaN",o.ZodBigInt="ZodBigInt",o.ZodBoolean="ZodBoolean",o.ZodDate="ZodDate",o.ZodSymbol="ZodSymbol",o.ZodUndefined="ZodUndefined",o.ZodNull="ZodNull",o.ZodAny="ZodAny",o.ZodUnknown="ZodUnknown",o.ZodNever="ZodNever",o.ZodVoid="ZodVoid",o.ZodArray="ZodArray",o.ZodObject="ZodObject",o.ZodUnion="ZodUnion",o.ZodDiscriminatedUnion="ZodDiscriminatedUnion",o.ZodIntersection="ZodIntersection",o.ZodTuple="ZodTuple",o.ZodRecord="ZodRecord",o.ZodMap="ZodMap",o.ZodSet="ZodSet",o.ZodFunction="ZodFunction",o.ZodLazy="ZodLazy",o.ZodLiteral="ZodLiteral",o.ZodEnum="ZodEnum",o.ZodEffects="ZodEffects",o.ZodNativeEnum="ZodNativeEnum",o.ZodOptional="ZodOptional",o.ZodNullable="ZodNullable",o.ZodDefault="ZodDefault",o.ZodCatch="ZodCatch",o.ZodPromise="ZodPromise",o.ZodBranded="ZodBranded",o.ZodPipeline="ZodPipeline",o.ZodReadonly="ZodReadonly";let tq=e4.create,tA=e5.create,tP=tL.create,tZ=e6.create,tU=e8.create,tR=e7.create,tB=e9.create,tD=te.create,tF=tt.create,tW=tr.create,tV=tn.create,tH=ti.create,tK=ta.create,tY=to.create,t$=ts.create,tJ=ts.strictCreate,tQ=tl.create,tG=tc.create,tX=tu.create,t0=tp.create,t1=tf.create,t2=th.create,t3=tm.create,t4=tb.create,t5=tg.create,t6=tv.create,t8=ty.create,t7=tw.create,t9=tx.create,re=tk.create,rt=tj.create,rr=tC.create,rn=tk.createWithPreprocess,ri=tS.create;var ra=Object.freeze({__proto__:null,defaultErrorMap:eI,setErrorMap:function(e){eO=e},getErrorMap:eq,makeIssue:eA,EMPTY_PATH:[],addIssueToContext:eP,ParseStatus:eZ,INVALID:eU,DIRTY:eR,OK:eB,isAborted:eD,isDirty:eF,isValid:eW,isAsync:eV,get util(){return l},get objectUtil(){return d},ZodParsedType:eT,getParsedType:eE,ZodType:e$,ZodString:e4,ZodNumber:e5,ZodBigInt:e6,ZodBoolean:e8,ZodDate:e7,ZodSymbol:e9,ZodUndefined:te,ZodNull:tt,ZodAny:tr,ZodUnknown:tn,ZodNever:ti,ZodVoid:ta,ZodArray:to,ZodObject:ts,ZodUnion:tl,ZodDiscriminatedUnion:tc,ZodIntersection:tu,ZodTuple:tp,ZodRecord:tf,ZodMap:th,ZodSet:tm,ZodFunction:tb,ZodLazy:tg,ZodLiteral:tv,ZodEnum:ty,ZodNativeEnum:tw,ZodPromise:tx,ZodEffects:tk,ZodTransformer:tk,ZodOptional:tj,ZodNullable:tC,ZodDefault:tz,ZodCatch:tN,ZodNaN:tL,BRAND:tT,ZodBranded:tE,ZodPipeline:tS,ZodReadonly:tM,custom:tI,Schema:e$,ZodSchema:e$,late:tO,get ZodFirstPartyTypeKind(){return u},coerce:{string:e=>e4.create({...e,coerce:!0}),number:e=>e5.create({...e,coerce:!0}),boolean:e=>e8.create({...e,coerce:!0}),bigint:e=>e6.create({...e,coerce:!0}),date:e=>e7.create({...e,coerce:!0})},any:tW,array:tY,bigint:tZ,boolean:tU,date:tR,discriminatedUnion:tG,effect:re,enum:t8,function:t4,instanceof:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{message:"Input not instance of ".concat(e.name)};return tI(t=>t instanceof e,t)},intersection:tX,lazy:t5,literal:t6,map:t2,nan:tP,nativeEnum:t7,never:tH,null:tF,nullable:rr,number:tA,object:t$,oboolean:()=>tU().optional(),onumber:()=>tA().optional(),optional:rt,ostring:()=>tq().optional(),pipeline:ri,preprocess:rn,promise:t9,record:t1,set:t3,strictObject:tJ,string:tq,symbol:tB,transformer:re,tuple:t0,undefined:tD,union:tQ,unknown:tV,void:tK,NEVER:eU,ZodIssueCode:eS,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:eM});let ro=e=>{let t=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()],r=e.getDate(),n=e.getMonth(),i=e.getFullYear();return"".concat(t,", ").concat(["January","February","March","April","May","June","July","August","September","October","November","December"][n]," ").concat(r).concat((e=>{let t=e<30?e%20:e%30;return["th","st","nd","rd"][t<=3?t:0]})(r),", ").concat(i)};function rs(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function rl(e){this.props=e}(rl.prototype=new E).isPureReactComponent=!0,rl.prototype.shouldComponentUpdate=function(e,t){return rs(this.props,e)||rs(this.state,t)};var rd=f.__b;f.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),rd&&rd(e)};var rc=f.__e;f.__e=function(e,t,r,n){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return null==t.__e&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}rc(e,t,r,n)};var ru=f.unmount;function rp(){this.__u=0,this.t=null,this.__b=null}function rf(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function rh(){this.u=null,this.o=null}f.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ru&&ru(e)},(rp.prototype=new E).__c=function(e,t){var r=t.__c,n=this;null==n.t&&(n.t=[]),n.t.push(r);var i=rf(n.__v),a=!1,o=function(){a||(a=!0,r.__R=null,i?i(s):s())};r.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var e,t=n.state.__a;n.__v.__k[0]=function e(t,r,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,r,n)}),t.__c&&t.__c.__P===r&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}(t,t.__c.__P,t.__c.__O)}for(n.setState({__a:n.__b=null});e=n.t.pop();)e.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(o,o)},rp.prototype.componentWillUnmount=function(){this.t=[]},rp.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,r,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var r in t)e[r]=t[r];return e}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=r),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,r,n)})),t}(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&N(T,null,e.fallback);return i&&(i.__u&=-33),[N(T,null,t.__a?null:e.children),i]};var rm=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};(rh.prototype=new E).__a=function(e){var t=this,r=rf(t.__v),n=t.o.get(e);return n[0]++,function(i){var a=function(){t.props.revealOrder?(n.push(i),rm(t,e,n)):i()};r?r(a):a()}},rh.prototype.render=function(e){this.u=null,this.o=new Map;var t=q(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},rh.prototype.componentDidUpdate=rh.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){rm(e,r,t)})};var rb="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,rg=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,rv=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,r_=/[A-Z0-9]/g,ry="undefined"!=typeof document;E.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var rw=f.event;function rx(){}function rk(){return this.cancelBubble}function rj(){return this.defaultPrevented}f.event=function(e){return rw&&(e=rw(e)),e.persist=rx,e.isPropagationStopped=rk,e.isDefaultPrevented=rj,e.nativeEvent=e};var rC={enumerable:!1,configurable:!0,get:function(){return this.class}},rz=f.vnode;f.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={};for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||ry&&"children"===i&&"noscript"===r||"class"===i||"className"===i)){var o,s=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"ondoubleclick"===s?i="ondblclick":"onchange"!==s||"input"!==r&&"textarea"!==r||(o=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(o))?"onfocus"===s?i="onfocusin":"onblur"===s?i="onfocusout":rv.test(i)?i=s:-1===r.indexOf("-")&&rg.test(i)?i=i.replace(r_,"-$&").toLowerCase():null===a&&(a=void 0):s=i="oninput","oninput"===s&&n[i=s]&&(i="oninputCapture"),n[i]=a}}"select"==r&&n.multiple&&Array.isArray(n.value)&&(n.value=q(t.children).forEach(function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)})),"select"==r&&null!=n.defaultValue&&(n.value=q(t.children).forEach(function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value})),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",rC)):(t.className&&!t.class||t.class&&t.className)&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=rb,rz&&rz(e)};var rN=f.__r;f.__r=function(e){rN&&rN(e),e.__c};var rL=f.diffed;f.diffed=function(e){rL&&rL(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};let rT=e=>{let t=e.match(/#recall:([A-Za-z0-9]+)/);return t&&t[1]?t[1]:null},rE=e=>{let t=e.match(/fallback:(\S*)#/);return t&&t[1]?t[1]:""},rS=e=>{let t=e.match(/#recall:([A-Za-z0-9]+)\/fallback:(\S*)#/);return t?t[0]:null};function rM(e){let{onClick:t,backButtonLabel:r,tabIndex:n=2}=e;return K("button",{tabIndex:n,type:"button",className:$("border-back-button-border text-heading focus:ring-focus flex items-center rounded-md border px-3 py-3 text-base font-medium leading-4 shadow-sm hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2"),onClick:t,children:r||"Back"})}function rI(e){let{headline:t,questionId:r,required:n=!0,alignTextCenter:i=!1}=e;return K("label",{htmlFor:r,className:"text-heading mb-1.5 block text-base font-semibold leading-6",children:K("div",{className:"flex items-center  ".concat(i?"justify-center":"justify-between"),children:[t,!n&&K("span",{className:"text-info-text ml-2 self-start text-sm font-normal leading-7",tabIndex:-1,children:"Optional"})]})})}function rO(e){let{htmlString:t,questionId:n}=e,[i,a]=ep("");return(ef(()=>{t&&r.e(2020).then(r.bind(r,2020)).then(e=>e.b).then(e=>{a(e.sanitize(t))})},[t]),t)?K("label",{htmlFor:n,className:"fb-htmlbody",dangerouslySetInnerHTML:{__html:i}}):null}function rq(e){let{imgUrl:t,altText:r="Image"}=e;return K("div",{className:"mb-4 rounded-md",children:K("img",{src:t,alt:r,className:"mb-4 rounded-md"})})}let rA=(e,t,r)=>e.hasOwnProperty(t)?{...e,[t]:e[t]+r}:{...e,[t]:r},rP=(e,t,r,n,i)=>{ef(()=>{i(performance.now())},[e,i]),ef(()=>{let a=()=>{"visible"===document.visibilityState?i(performance.now()):r(rA(t,e,performance.now()-n))};return document.addEventListener("visibilitychange",a),()=>{document.removeEventListener("visibilitychange",a)}},[e,i,r,n,t])};function rZ(e){let{question:t,onSubmit:r,onChange:n,onBack:i,isFirstQuestion:a,isLastQuestion:o,ttc:s,setTtc:l}=e,[d,c]=ep(performance.now());return rP(t.id,s,l,d,c),K("div",{children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rO,{htmlString:t.html,questionId:t.id}),K("div",{className:"mt-4 flex w-full justify-between",children:[!a&&K(rM,{backButtonLabel:t.backButtonLabel,onClick:()=>{let e=rA(s,t.id,performance.now()-d);l(e),r({[t.id]:""},e),i()}}),K("div",{className:"flex w-full justify-end",children:[!t.required&&K("button",{tabIndex:0,type:"button",onClick:()=>{let e=rA(s,t.id,performance.now()-d);l(e),r({[t.id]:"dismissed"},e),n({[t.id]:"dismissed"})},className:"text-heading focus:ring-focus mr-4 flex items-center rounded-md px-3 py-3 text-base font-medium leading-4 hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2",children:t.dismissButtonLabel||"Skip"}),K(eC,{buttonLabel:t.buttonLabel,isLastQuestion:o,focus:!0,onClick:()=>{var e;t.buttonExternal&&t.buttonUrl&&(null==(e=null==window?void 0:window.open(t.buttonUrl,"_blank"))||e.focus());let i=rA(s,t.id,performance.now()-d);l(i),r({[t.id]:"clicked"},i),n({[t.id]:"clicked"})},type:"button"})]})]})]})}function rU(){var e;let t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"https://app.cal.com/embed/embed.js";/*!  Copying ends here. */return e=window,t=function(e,t){e.q.push(t)},r=e.document,e.Cal=e.Cal||function(){let i=e.Cal,a=arguments;if(i.loaded||(i.ns={},i.q=i.q||[],r.head.appendChild(r.createElement("script")).src=n,i.loaded=!0),"init"===a[0]){let e=function(){t(e,arguments)},r=a[1];e.q=e.q||[],"string"==typeof r?(i.ns[r]=e)&&t(e,a):t(i,a);return}t(i,a)},window.Cal}function rR(e){let{question:t,onSuccessfulBooking:r}=e,n=em(()=>{let e=rU("https://cal.com/embed.js"),t={"cal-border-subtle":"transparent","cal-border-booker":"transparent"};return e("ui",{theme:"light",cssVarsPerTheme:{light:{...t},dark:{"cal-bg-muted":"transparent","cal-bg":"transparent",...t}}}),e("on",{action:"bookingSuccessful",callback:()=>{r()}}),e},[r]);return ef(()=>{document.querySelectorAll("cal-inline").forEach(e=>e.remove()),n("inline",{elementOrSelector:"#fb-cal-embed",calLink:t.calUserName})},[n,t.calUserName]),K("div",{className:"relative mt-4",children:K("div",{id:"fb-cal-embed",className:$("h-96 overflow-auto rounded-lg border border-slate-200")})})}function rB(e){let{subheader:t,questionId:r}=e;return K("label",{htmlFor:r,className:"text-subheading block text-sm font-normal leading-6",children:t})}function rD(e){let{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:l,setTtc:d}=e,[c,u]=ep(performance.now());rP(t.id,l,d,c,u);let[p,f]=ep(""),h=eb(()=>{n({[t.id]:"booked"});let e=rA(l,t.id,performance.now()-c);d(e),i({[t.id]:"booked"},e)},[n,i,t.id,d,c,l]);return K("form",{onSubmit:e=>{if(e.preventDefault(),t.required&&!r){f("Please book an appointment");return}let a=rA(l,t.id,performance.now()-c);d(a),n({[t.id]:r}),i({[t.id]:r},a)},className:"w-full",children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rB,{subheader:t.subheader,questionId:t.id}),K(T,{children:[p&&K("span",{className:"text-red-500",children:p}),K(rR,{question:t,onSuccessfulBooking:h},t.id)]}),K("div",{className:"mt-4 flex w-full justify-between",children:[!o&&K(rM,{backButtonLabel:t.backButtonLabel,onClick:()=>{a()}}),K("div",{}),!t.required&&K(eC,{buttonLabel:t.buttonLabel,isLastQuestion:s,onClick:()=>{}})]})]})}function rF(e){let{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:l,setTtc:d}=e,[c,u]=ep(performance.now());return rP(t.id,l,d,c,u),K("div",{children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rO,{htmlString:t.html||"",questionId:t.id}),K("form",{onSubmit:e=>{e.preventDefault();let n=rA(l,t.id,performance.now()-c);d(n),i({[t.id]:r},n)},children:[K("label",{tabIndex:1,onKeyDown:e=>{"Enter"==e.key&&n({[t.id]:"accepted"})},className:"border-border bg-survey-bg text-heading hover:bg-accent-bg focus:bg-accent-bg focus:ring-border-highlight relative z-10 mt-4 flex w-full cursor-pointer items-center rounded-md border p-4 text-sm focus:outline-none focus:ring-2 focus:ring-offset-2",children:[K("input",{type:"checkbox",id:t.id,name:t.id,value:t.label,onChange:e=>{e.target instanceof HTMLInputElement&&e.target.checked?n({[t.id]:"accepted"}):n({[t.id]:"dismissed"})},checked:"accepted"===r,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":"".concat(t.id,"-label"),required:t.required}),K("span",{id:"".concat(t.id,"-label"),className:"ml-3 font-medium",children:t.label})]}),K("div",{className:"mt-4 flex w-full justify-between",children:[!o&&K(rM,{tabIndex:3,backButtonLabel:t.backButtonLabel,onClick:()=>{let e=rA(l,t.id,performance.now()-c);d(e),i({[t.id]:r},e),a()}}),K("div",{}),K(eC,{tabIndex:2,buttonLabel:t.buttonLabel,isLastQuestion:s,onClick:()=>{}})]})]})]})}function rW(e){let{question:t,value:r,onSubmit:n,onBack:i,isFirstQuestion:a,isLastQuestion:o,onChange:s,setTtc:l,ttc:d}=e,[c,u]=ep(performance.now()),[p,f]=ep(""),[h,m]=ep(!0);rP(t.id,d,l,c,u);let b=r?new Date(r):void 0;return ef(()=>{if(window.initDatePicker){m(!1);let e=document.getElementById("datePickerContainer");e&&e.remove(),window.initDatePicker(document.getElementById("date-picker-root"),b,t.format)}else{let e=document.createElement("script");return e.src="https://unpkg.com/@formbricks/surveys@^1.5.1/dist/question-date.umd.js",e.async=!0,document.body.appendChild(e),e.onload=()=>{window.initDatePicker(document.getElementById("date-picker-root"),b,t.format),m(!1)},()=>{document.body.removeChild(e)}}return()=>{}},[t.format,t.id]),ef(()=>{window.addEventListener("dateChange",e=>{let r=e.detail,n=6e4*r.getTimezoneOffset(),i=new Date(r.getTime()-n).toISOString().split("T")[0];s({[t.id]:i})})},[s,t.id]),ef(()=>{r&&p&&f("")},[r]),K("form",{onSubmit:e=>{if(e.preventDefault(),t.required&&!r){f("Please select a date.");return}let i=rA(d,t.id,performance.now()-c);l(i),n({[t.id]:r},i)},className:"w-full",children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rB,{subheader:t.subheader,questionId:t.id}),K("div",{className:"text-red-600",children:K("span",{children:p})}),K("div",{className:$("my-4",p&&"rounded-lg border-2 border-red-500"),id:"date-picker-root",children:h&&K("div",{className:"relative flex h-12 w-full cursor-pointer appearance-none items-center justify-center rounded-lg border border-slate-300 bg-white text-left text-base font-normal text-slate-900 hover:bg-slate-50 focus:outline-none focus:ring-2 focus:ring-neutral-900 focus:ring-offset-1",children:K("span",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-neutral-900",style:{borderTopColor:"transparent"}})})}),K("div",{className:"mt-4 flex w-full justify-between",children:[K("div",{children:!a&&K(rM,{backButtonLabel:t.backButtonLabel,onClick:()=>{l(rA(d,t.id,performance.now()-c)),i()}})}),K(eC,{isLastQuestion:o,onClick:()=>{},buttonLabel:t.buttonLabel})]})]})}rU.toString();let rV=e=>{let t=new URL(e).pathname.split("/").pop(),r=null==t?void 0:t.split(".").pop(),n=null==t?void 0:t.split("--fid--")[0];return(null==t?void 0:t.split("--fid--")[1])?n?decodeURIComponent("".concat(n,".").concat(r)||""):"":n?decodeURIComponent(n||""):""};function rH(e){let{allowedFileExtensions:t,surveyId:r,onUploadCallback:n,onFileUpload:i,fileUrls:a,maxSizeInMB:o,allowMultipleFiles:s}=e,[l,d]=ep([]),[c,u]=ep(!1),p=async e=>{if(e){if(o){if((await e.arrayBuffer()).byteLength/1024>1024*o)alert("File should be less than ".concat(o," MB"));else{u(!0);try{let o=await i(e,{allowedFileExtensions:t,surveyId:r});d([...l,e]),u(!1),a?n([...a,o]):n([o])}catch(e){u(!1),"FileTooLargeError"===e.name?alert(e.message):alert("Upload failed! Please try again.")}}}else{u(!0);try{let o=await i(e,{allowedFileExtensions:t,surveyId:r});d([...l,e]),u(!1),a?n([...a,o]):n([o])}catch(e){u(!1),"FileTooLargeError"===e.name?alert(e.message):alert("Upload failed! Please try again.")}}}else alert("Please select a file")},f=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},h=async e=>{e.preventDefault(),e.stopPropagation();let c=Array.from(e.dataTransfer.files);if(!s&&c.length>1){alert("Only one file can be uploaded at a time.");return}if(c.length>0){let e=c.filter(e=>!t||!(t.length>0)||t.includes(e.type.substring(e.type.lastIndexOf("/")+1)));if(e.length>0){let s=[];for(let n of e)if(o){if((await n.arrayBuffer()).byteLength/1024>1024*o)alert("File should be less than ".concat(o," MB"));else{u(!0);try{let e=await i(n,{allowedFileExtensions:t,surveyId:r});d([...l,n]),s.push(e)}catch(e){u(!1),"FileTooLargeError"===e.name?alert(e.message):alert("Upload failed! Please try again.")}}}else{u(!0);try{let e=await i(n,{allowedFileExtensions:t,surveyId:r});d([...l,n]),s.push(e)}catch(e){u(!1),"FileTooLargeError"===e.name?alert(e.message):alert("Upload failed! Please try again.")}}u(!1),a?n([...a,...s]):n(s)}else alert("no selected files are valid")}},m=(e,t)=>{if(t.stopPropagation(),a){let t=[...l];t.splice(e,1),d(t);let r=[...a];r.splice(e,1),n(r)}},b=em(()=>!c&&(!!s||!a||!(a.length>0)),[s,a,c]);return K("div",{className:"items-left relative mt-3 flex w-full cursor-pointer flex-col justify-center rounded-lg border-2 border-dashed border-slate-300 bg-slate-50 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-700 dark:hover:border-slate-500 dark:hover:bg-slate-800",children:[K("div",{children:a&&(null==a?void 0:a.map((e,t)=>{let r=rV(e);return K("div",{className:"relative m-2 rounded-md bg-slate-200",children:[K("div",{className:"absolute right-0 top-0 m-2",children:K("div",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-slate-100 hover:bg-slate-50",children:K("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 26 26",strokeWidth:1,stroke:"currentColor",className:"h-5 text-slate-700 hover:text-slate-900",onClick:e=>m(t,e),children:K("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9l10 10m0-10L9 19"})})})}),K("div",{className:"flex flex-col items-center justify-center p-2",children:[K("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-file",className:"h-6 text-slate-500",children:[K("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),K("polyline",{points:"14 2 14 8 20 8"})]}),K("p",{className:"mt-1 text-sm text-slate-600 dark:text-slate-400",children:r})]})]},t)}))}),K("div",{children:[c&&K("div",{className:"inset-0 flex animate-pulse items-center justify-center rounded-lg bg-slate-100 py-4",children:K("label",{htmlFor:"selectedFile",className:"text-sm font-medium text-slate-500",children:"Uploading..."})}),K("label",{htmlFor:"selectedFile",onDragOver:e=>f(e),onDrop:e=>h(e),children:b&&K("div",{className:"flex flex-col items-center justify-center py-6",children:[K("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-6 text-slate-500",children:K("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})}),K("p",{className:"mt-2 text-sm text-slate-500 dark:text-slate-400",children:K("span",{className:"font-medium",children:"Click or drag to upload files."})}),K("input",{type:"file",id:"selectedFile",name:"selectedFile",accept:null==t?void 0:t.map(e=>".".concat(e)).join(","),className:"hidden",onChange:e=>{let t=e.target;t.files&&p(t.files[0])}})]})})]})]})}function rK(e){let{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,surveyId:l,onFileUpload:d,ttc:c,setTtc:u}=e,[p,f]=ep(performance.now());return rP(t.id,c,u,p,f),K("form",{onSubmit:e=>{e.preventDefault();let n=rA(c,t.id,performance.now()-p);u(n),t.required?r&&("string"==typeof r||Array.isArray(r))&&r.length>0?i({[t.id]:"string"==typeof r?[r]:r},n):alert("Please upload a file"):r?i({[t.id]:"string"==typeof r?[r]:r},n):i({[t.id]:"skipped"},n)},className:"w-full",children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rB,{subheader:t.subheader,questionId:t.id}),K(rH,{surveyId:l,onFileUpload:d,onUploadCallback:e=>{e?n({[t.id]:e}):n({[t.id]:"skipped"})},fileUrls:r,allowMultipleFiles:t.allowMultipleFiles,...t.allowedFileExtensions?{allowedFileExtensions:t.allowedFileExtensions}:{},...t.maxSizeInMB?{maxSizeInMB:t.maxSizeInMB}:{}}),K("div",{className:"mt-4 flex w-full justify-between",children:[!o&&K(rM,{backButtonLabel:t.backButtonLabel,onClick:()=>{a()}}),K("div",{}),K(eC,{buttonLabel:t.buttonLabel,isLastQuestion:s,onClick:()=>{}})]})]})}function rY(e){var t;let{question:r,value:n,onChange:i,onSubmit:a,onBack:o,isFirstQuestion:s,isLastQuestion:l,ttc:d,setTtc:c}=e,[u,p]=ep(performance.now());rP(r.id,d,c,u,p);let f=eb(()=>r.choices.filter(e=>"other"!==e.id).map(e=>e.label),[r]),[h,m]=ep(!1),[b,g]=ep("");ef(()=>{m(!!n&&(Array.isArray(n)?n:[n]).some(e=>!1===f().includes(e))),g(Array.isArray(n)&&n.filter(e=>!r.choices.find(t=>t.label===e))[0]||"")},[r.id,f,r.choices,n]);let v=em(()=>{if(!r.choices)return[];let e=r.choices.filter(e=>"other"!==e.id);return r.shuffleOption?Q(e,r.shuffleOption):e},[r.choices,r.shuffleOption]),_=v.map(e=>e.label),y=em(()=>r.choices.find(e=>"other"===e.id),[r.choices]),w=eh(null);ef(()=>{var e;h&&(null==(e=w.current)||e.focus())},[h]);let x=e=>{let t=!_.includes(e);if(Array.isArray(n)){if(!t)return i({[r.id]:[...n,e]});{let t=n.filter(e=>_.includes(e));return i({[r.id]:[...t,e]})}}return i({[r.id]:[e]})},k=e=>Array.isArray(n)?i({[r.id]:n.filter(t=>t!==e)}):i({[r.id]:[]});return K("form",{onSubmit:e=>{e.preventDefault();let t=null==n?void 0:n.filter(e=>f().includes(e)||e===b);i({[r.id]:t});let o=rA(d,r.id,performance.now()-u);c(o),a({[r.id]:n},o)},className:"w-full",children:[r.imageUrl&&K(rq,{imgUrl:r.imageUrl}),K(rI,{headline:r.headline,questionId:r.id,required:r.required}),K(rB,{subheader:r.subheader,questionId:r.id}),K("div",{className:"mt-4",children:K("fieldset",{children:[K("legend",{className:"sr-only",children:"Options"}),K("div",{className:"bg-survey-bg relative max-h-[42vh] space-y-2 overflow-y-auto rounded-md py-0.5 pr-2",children:[v.map((e,t)=>K("label",{tabIndex:t+1,onKeyDown:t=>{"Enter"==t.key&&(Array.isArray(n)&&n.includes(e.label)?k(e.label):x(e.label))},className:$(n===e.label?"border-border-highlight bg-accent-selected-bg z-10":"border-border","text-heading focus-within:border-border-highlight hover:bg-accent-bg focus:bg-accent-bg relative flex cursor-pointer flex-col rounded-md border p-4 focus:outline-none"),children:K("span",{className:"flex items-center text-sm",children:[K("input",{type:"checkbox",id:e.id,name:r.id,tabIndex:-1,value:e.label,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":"".concat(e.id,"-label"),onChange:t=>{var r;(null==(r=t.target)?void 0:r.checked)?x(e.label):k(e.label)},checked:Array.isArray(n)&&n.includes(e.label),required:(!(r.required&&Array.isArray(n))||!n.length)&&r.required}),K("span",{id:"".concat(e.id,"-label"),className:"ml-3 font-medium",children:e.label})]})},e.id)),y&&K("label",{tabIndex:v.length+1,className:$(n===y.label?"border-border-highlight bg-accent-selected-bg z-10":"border-border","text-heading focus-within:border-border-highlight focus-within:bg-accent-bg hover:bg-accent-bg relative flex cursor-pointer flex-col rounded-md border p-4 focus:outline-none"),onKeyDown:e=>{"Enter"==e.key&&m(!h)},children:[K("span",{className:"flex items-center text-sm",children:[K("input",{type:"checkbox",tabIndex:-1,id:y.id,name:r.id,value:y.label,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":"".concat(y.id,"-label"),onChange:e=>{var t;if(m(!h),null==(t=e.target)?void 0:t.checked){if(!b)return;x(b)}else k(b)},checked:h}),K("span",{id:"".concat(y.id,"-label"),className:"ml-3 font-medium",children:y.label})]}),h&&K("input",{ref:w,id:"".concat(y.id,"-label"),name:r.id,tabIndex:v.length+1,value:b,onChange:e=>{g(e.currentTarget.value),x(e.currentTarget.value)},onKeyDown:e=>{if("Enter"==e.key){let e=rA(d,r.id,performance.now()-u);c(e),setTimeout(()=>{a({[r.id]:n},e)},100)}},placeholder:null!==(t=r.otherOptionPlaceholder)&&void 0!==t?t:"Please specify",className:"placeholder:text-placeholder border-border bg-survey-bg text-heading focus:ring-focus mt-3 flex h-10 w-full rounded-md border px-3 py-2 text-sm  focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",required:r.required,"aria-labelledby":"".concat(y.id,"-label")})]})]})]})}),K("div",{className:"mt-4 flex w-full justify-between",children:[!s&&K(rM,{tabIndex:v.length+3,backButtonLabel:r.backButtonLabel,onClick:()=>{c(rA(d,r.id,performance.now()-u)),o()}}),K("div",{}),K(eC,{tabIndex:v.length+2,buttonLabel:r.buttonLabel,isLastQuestion:l,onClick:()=>{}})]})]})}function r$(e){var t;let{question:r,value:n,onChange:i,onSubmit:a,onBack:o,isFirstQuestion:s,isLastQuestion:l,ttc:d,setTtc:c}=e,[u,p]=ep(performance.now());rP(r.id,d,c,u,p);let[f,h]=ep(!1),m=em(()=>{if(!r.choices)return[];let e=r.choices.filter(e=>"other"!==e.id);return r.shuffleOption?Q(e,r.shuffleOption):e},[r.choices,r.shuffleOption]),b=em(()=>r.choices.find(e=>"other"===e.id),[r.choices]);ef(()=>{h(void 0!==n&&!r.choices.some(e=>e.label===n))},[r.id,r.choices,n]);let g=eh(null);return ef(()=>{var e;f&&(null==(e=g.current)||e.focus())},[f]),K("form",{onSubmit:e=>{e.preventDefault();let t=rA(d,r.id,performance.now()-u);c(t),a({[r.id]:n},t)},className:"w-full",children:[r.imageUrl&&K(rq,{imgUrl:r.imageUrl}),K(rI,{headline:r.headline,questionId:r.id,required:r.required}),K(rB,{subheader:r.subheader,questionId:r.id}),K("div",{className:"mt-4",children:K("fieldset",{children:[K("legend",{className:"sr-only",children:"Options"}),K("div",{className:"bg-survey-bg relative max-h-[42vh] space-y-2 overflow-y-auto rounded-md py-0.5 pr-2",role:"radiogroup",children:[m.map((e,t)=>K("label",{tabIndex:t+1,onKeyDown:t=>{if("Enter"==t.key){i({[r.id]:e.label});let t=rA(d,r.id,performance.now()-u);c(t),setTimeout(()=>{a({[r.id]:e.label},t)},350)}},className:$(n===e.label?"border-border-highlight bg-accent-selected-bg z-10":"border-border","text-heading focus-within:border-border-highlight focus-within:bg-accent-bg hover:bg-accent-bg relative flex cursor-pointer flex-col rounded-md border p-4 focus:outline-none"),children:K("span",{className:"flex items-center text-sm",children:[K("input",{tabIndex:-1,type:"radio",id:e.id,name:r.id,value:e.label,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":"".concat(e.id,"-label"),onChange:()=>{h(!1),i({[r.id]:e.label})},checked:n===e.label,required:r.required&&0===t}),K("span",{id:"".concat(e.id,"-label"),className:"ml-3 font-medium",children:e.label})]})},e.id)),b&&K("label",{tabIndex:m.length+1,className:$(n===b.label?"border-border-highlight bg-accent-selected-bg z-10":"border-border","text-heading focus-within:border-border-highlight focus-within:bg-accent-bg hover:bg-accent-bg relative flex cursor-pointer flex-col rounded-md border p-4 focus:outline-none"),onKeyDown:e=>{"Enter"!=e.key||(h(!f),f||i({[r.id]:""}))},children:[K("span",{className:"flex items-center text-sm",children:[K("input",{type:"radio",id:b.id,tabIndex:-1,name:r.id,value:b.label,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":"".concat(b.id,"-label"),onChange:()=>{h(!f),i({[r.id]:""})},checked:f}),K("span",{id:"".concat(b.id,"-label"),className:"ml-3 font-medium",children:b.label})]}),f&&K("input",{ref:g,tabIndex:m.length+1,id:"".concat(b.id,"-label"),name:r.id,value:n,onChange:e=>{i({[r.id]:e.currentTarget.value})},onKeyDown:e=>{if("Enter"==e.key){let e=rA(d,r.id,performance.now()-u);c(e),setTimeout(()=>{a({[r.id]:n},e)},100)}},placeholder:null!==(t=r.otherOptionPlaceholder)&&void 0!==t?t:"Please specify",className:"placeholder:text-placeholder border-border bg-survey-bg text-heading focus:ring-focus mt-3 flex h-10 w-full rounded-md border px-3 py-2 text-sm  focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",required:r.required,"aria-labelledby":"".concat(b.id,"-label")})]})]})]})}),K("div",{className:"mt-4 flex w-full justify-between",children:[!s&&K(rM,{backButtonLabel:r.backButtonLabel,tabIndex:m.length+3,onClick:()=>{c(rA(d,r.id,performance.now()-u)),o()}}),K("div",{}),K(eC,{tabIndex:m.length+2,buttonLabel:r.buttonLabel,isLastQuestion:l,onClick:()=>{}})]})]})}function rJ(e){let{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:l,setTtc:d}=e,[c,u]=ep(performance.now());return rP(t.id,l,d,c,u),K("form",{onSubmit:e=>{e.preventDefault();let n=rA(l,t.id,performance.now()-c);d(n),i({[t.id]:r},n)},children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rB,{subheader:t.subheader,questionId:t.id}),K("div",{className:"my-4",children:K("fieldset",{children:[K("legend",{className:"sr-only",children:"Options"}),K("div",{className:"flex",children:Array.from({length:11},(e,t)=>t).map((e,a)=>K("label",{tabIndex:a+1,onKeyDown:r=>{if("Enter"==r.key){let r=rA(l,t.id,performance.now()-c);d(r),i({[t.id]:e},r)}},className:$(r===e?"border-border-highlight bg-accent-selected-bg z-10":"border-border","bg-survey-bg text-heading hover:bg-accent-bg relative h-10 flex-1 cursor-pointer border text-center text-sm leading-10 first:rounded-l-md last:rounded-r-md focus:outline-none"),children:[K("input",{type:"radio",name:"nps",value:e,checked:r===e,className:"absolute h-full w-full cursor-pointer opacity-0",onClick:()=>{if(t.required){let r=rA(l,t.id,performance.now()-c);d(r),i({[t.id]:e},r)}n({[t.id]:e})},required:t.required}),e]},e))}),K("div",{className:"text-info-text flex justify-between px-1.5 text-xs leading-6",children:[K("p",{children:t.lowerLabel}),K("p",{children:t.upperLabel})]})]})}),K("div",{className:"mt-4 flex w-full justify-between",children:[!o&&K(rM,{tabIndex:s?12:13,backButtonLabel:t.backButtonLabel,onClick:()=>{d(rA(l,t.id,performance.now()-c)),a()}}),K("div",{}),!t.required&&K(eC,{tabIndex:12,buttonLabel:t.buttonLabel,isLastQuestion:s,onClick:()=>{}})]})]})}function rQ(e){let{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,autoFocus:l=!0,ttc:d,setTtc:c}=e,[u,p]=ep(performance.now());rP(t.id,d,c,u,p);let f=e=>{n({[t.id]:e})},h=eb(e=>{t.id&&e&&l&&e.focus()},[t.id,l]),m=e=>t.required&&!(null==e?void 0:e.trim());return K("form",{onSubmit:e=>{e.preventDefault();let n=rA(d,t.id,performance.now()-u);c(n),i({[t.id]:r,inputType:t.inputType},n)},className:"w-full",children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rB,{subheader:t.subheader,questionId:t.id}),K("div",{className:"mt-4",children:!1===t.longAnswer?K("input",{ref:h,tabIndex:1,name:t.id,id:t.id,placeholder:t.placeholder,required:t.required,value:r||"",type:t.inputType,onInput:e=>f(e.currentTarget.value),autoFocus:l,className:"border-border bg-survey-bg focus:border-border-highlight block w-full rounded-md border p-2 shadow-sm focus:outline-none focus:ring-0 sm:text-sm",onKeyDown:e=>{if("Enter"===e.key&&m(r))e.preventDefault();else if("Enter"===e.key){let e=rA(d,t.id,performance.now()-u);c(e),i({[t.id]:r,inputType:t.inputType},e)}},pattern:"phone"===t.inputType?"[0-9+ ]+":".*",title:"phone"===t.inputType?"Enter a valid phone number":void 0}):K("textarea",{ref:h,rows:3,name:t.id,tabIndex:1,id:t.id,placeholder:t.placeholder,required:t.required,value:r,type:t.inputType,onInput:e=>f(e.currentTarget.value),autoFocus:l,className:"border-border bg-survey-bg text-subheading focus:border-border-highlight block w-full rounded-md border p-2 shadow-sm focus:ring-0 sm:text-sm",pattern:"phone"===t.inputType?"[+][0-9 ]+":".*",title:"phone"===t.inputType?"Please enter a valid phone number":void 0})}),K("div",{className:"mt-4 flex w-full justify-between",children:[!o&&K(rM,{backButtonLabel:t.backButtonLabel,onClick:()=>{c(rA(d,t.id,performance.now()-u)),a()}}),K("div",{}),K(eC,{buttonLabel:t.buttonLabel,isLastQuestion:s,onClick:()=>{}})]})]})}function rG(e){let{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:l,setTtc:d}=e,[c,u]=ep(performance.now());rP(t.id,l,d,c,u);let p=e=>{let i=[];return i=t.allowMulti&&Array.isArray(r)?[...r,e]:[e],n({[t.id]:i})},f=e=>{let i=[];return i=t.allowMulti&&Array.isArray(r)?r.filter(t=>t!==e):[],n({[t.id]:i})},h=e=>{Array.isArray(r)&&r.includes(e)?f(e):p(e)};ef(()=>{!t.allowMulti&&Array.isArray(r)&&r.length>1&&n({[t.id]:[]})},[t.allowMulti]);let m=t.choices;return K("form",{onSubmit:e=>{e.preventDefault();let n=rA(l,t.id,performance.now()-c);d(n),i({[t.id]:r},n)},className:"w-full",children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rB,{subheader:t.subheader,questionId:t.id}),K("div",{className:"mt-4",children:K("fieldset",{children:[K("legend",{className:"sr-only",children:"Options"}),K("div",{className:"rounded-m bg-survey-bg relative grid max-h-[42vh] grid-cols-2 gap-x-5 gap-y-4 overflow-y-auto pr-2.5",children:m.map((e,n)=>K("label",{tabIndex:n+1,htmlFor:e.id,onKeyDown:t=>{"Enter"==t.key&&h(e.id)},onClick:()=>h(e.id),className:$(Array.isArray(r)&&r.includes(e.id)?"border-brand text-brand z-10 border-4 shadow-xl focus:border-4":"","border-border focus:border-border-highlight focus:bg-accent-selected-bg relative box-border inline-block h-28 w-full overflow-hidden rounded-xl border focus:outline-none"),children:[K("img",{src:e.imageUrl,id:e.id,alt:e.imageUrl.split("/").pop(),className:"h-full w-full object-cover"}),t.allowMulti?K("input",{id:"".concat(e.id,"-checked"),name:"".concat(e.id,"-checkbox"),type:"checkbox",tabIndex:-1,checked:Array.isArray(r)&&r.includes(e.id),className:$("border-border pointer-events-none absolute right-2 top-2 z-20 h-5 w-5 rounded border",Array.isArray(r)&&r.includes(e.id)?"border-brand text-brand":""),required:(!(t.required&&Array.isArray(r))||!r.length)&&t.required}):K("input",{id:"".concat(e.id,"-radio"),name:"".concat(e.id,"-radio"),type:"radio",tabIndex:-1,checked:Array.isArray(r)&&r.includes(e.id),className:$("border-border pointer-events-none absolute right-2 top-2 z-20 h-5 w-5 rounded-full border",Array.isArray(r)&&r.includes(e.id)?"border-brand text-brand":""),required:(!(t.required&&Array.isArray(r))||!r.length)&&t.required})]},e.id))})]})}),K("div",{className:"mt-4 flex w-full justify-between",children:[!o&&K(rM,{tabIndex:m.length+3,backButtonLabel:t.backButtonLabel,onClick:()=>{d(rA(l,t.id,performance.now()-c)),a()}}),K("div",{}),K(eC,{tabIndex:m.length+2,buttonLabel:t.buttonLabel,isLastQuestion:s,onClick:()=>{}})]})]})}let rX=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m21.88 23.92c5.102-0.06134 7.273-1.882 8.383-3.346"}),K("path",{stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",d:"m46.24 47.56c0-2.592-2.867-7.121-10.25-6.93-6.974 0.1812-10.22 4.518-10.22 7.111s4.271-1.611 10.05-1.492c6.317 0.13 10.43 3.903 10.43 1.311z"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m23.16 28.47c5.215 1.438 5.603 0.9096 8.204 1.207 1.068 0.1221-2.03 2.67-7.282 4.397"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m50.12 23.92c-5.102-0.06134-7.273-1.882-8.383-3.346"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m48.84 28.47c-5.215 1.438-5.603 0.9096-8.204 1.207-1.068 0.1221 2.03 2.67 7.282 4.397"})]})}),r0=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m22.88 23.92c5.102-0.06134 7.273-1.882 8.383-3.346"}),K("path",{stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",d:"m46.24 47.56c0-2.592-2.867-7.121-10.25-6.93-6.974 0.1812-10.22 4.518-10.22 7.111s4.271-1.611 10.05-1.492c6.317 0.13 10.43 3.903 10.43 1.311z"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m49.12 23.92c-5.102-0.06134-7.273-1.882-8.383-3.346"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m48.24 30.51c-6.199 1.47-7.079 1.059-8.868-1.961"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m23.76 30.51c6.199 1.47 7.079 1.059 8.868-1.961"})]})}),r1=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),K("line",{x1:"44.5361",x2:"50.9214",y1:"21.4389",y2:"24.7158",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2"}),K("line",{x1:"26.9214",x2:"20.5361",y1:"21.4389",y2:"24.7158",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M24,28c2.3334,1.3333,4.6666,2.6667,7,4c-2.3334,1.3333-4.6666,2.6667-7,4"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M48,28c-2.3334,1.3333-4.6666,2.6667-7,4c2.3334,1.3333,4.6666,2.6667,7,4"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M28,51c0.2704-0.3562,1-8,8.4211-8.0038C43,42.9929,43.6499,50.5372,44,51C38.6667,51,33.3333,51,28,51z"})]})}),r2=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M26.5,48c1.8768-3.8326,5.8239-6.1965,10-6c3.8343,0.1804,7.2926,2.4926,9,6"}),K("path",{d:"M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"}),K("path",{d:"M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"})]})}),r3=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m44.7 43.92c-6.328-1.736-11.41-0.906-17.4 1.902"}),K("path",{d:"M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"}),K("path",{d:"M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"})]})}),r4=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),K("line",{x1:"27",x2:"45",y1:"43",y2:"43",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2"}),K("path",{d:"M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"}),K("path",{d:"M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"})]})}),r5=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",...e}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M45.8149,44.9293 c-2.8995,1.6362-6.2482,2.5699-9.8149,2.5699s-6.9153-0.9336-9.8149-2.5699"}),K("path",{d:"M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"}),K("path",{d:"M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"})]})}),r6=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",...e}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M45.8147,45.2268a15.4294,15.4294,0,0,1-19.6294,0"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M31.6941,33.4036a4.7262,4.7262,0,0,0-8.6382,0"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M48.9441,33.4036a4.7262,4.7262,0,0,0-8.6382,0"})]})}),r8=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",...e}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M50.595,41.64a11.5554,11.5554,0,0,1-.87,4.49c-12.49,3.03-25.43.34-27.49-.13a11.4347,11.4347,0,0,1-.83-4.36h.11s14.8,3.59,28.89.07Z"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M49.7251,46.13c-1.79,4.27-6.35,7.23-13.69,7.23-7.41,0-12.03-3.03-13.8-7.36C24.2951,46.47,37.235,49.16,49.7251,46.13Z"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M31.6941,32.4036a4.7262,4.7262,0,0,0-8.6382,0"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M48.9441,32.4036a4.7262,4.7262,0,0,0-8.6382,0"})]})}),r7=e=>K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:K("g",{id:"line",children:[K("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",...e}),K("polyline",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",points:"25.168 27.413 31.755 31.427 25.168 35.165"}),K("polyline",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",points:"46.832 27.413 40.245 31.427 46.832 35.165"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M50.595,41.64a11.5554,11.5554,0,0,1-.87,4.49c-12.49,3.03-25.43.34-27.49-.13a11.4347,11.4347,0,0,1-.83-4.36h.11s14.8,3.59,28.89.07Z"}),K("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M49.7251,46.13c-1.79,4.27-6.35,7.23-13.69,7.23-7.41,0-12.03-3.03-13.8-7.36C24.2951,46.47,37.235,49.16,49.7251,46.13Z"})]})});function r9(e){let{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:l,setTtc:d}=e,[c,u]=ep(0),[p,f]=ep(performance.now());rP(t.id,l,d,p,f);let h=e=>{if(n({[t.id]:e}),t.required){let r=rA(l,t.id,performance.now()-p);d(r),i({[t.id]:e},r)}},m=e=>{let{number:n}=e;return K("input",{type:"radio",name:"rating",value:n,className:"absolute left-0 h-full w-full cursor-pointer opacity-0",onChange:()=>h(n),required:t.required,checked:r===n})};return K("form",{onSubmit:e=>{e.preventDefault();let n=rA(l,t.id,performance.now()-p);d(n),i({[t.id]:r},n)},className:"w-full",children:[t.imageUrl&&K(rq,{imgUrl:t.imageUrl}),K(rI,{headline:t.headline,questionId:t.id,required:t.required}),K(rB,{subheader:t.subheader,questionId:t.id}),K("div",{className:"mb-4 mt-6 flex items-center justify-center",children:K("fieldset",{className:"w-full ",children:[K("legend",{className:"sr-only",children:"Choices"}),K("div",{className:"flex pb-2",children:Array.from({length:t.range},(e,t)=>t+1).map((e,n,i)=>K("span",{onMouseOver:()=>u(e),onMouseLeave:()=>u(0),className:"bg-survey-bg relative flex-1 cursor-pointer text-center text-sm leading-[2.8rem]",children:"number"===t.scale?K("label",{tabIndex:n+1,onKeyDown:t=>{"Enter"==t.key&&h(e)},className:$(r===e?"bg-accent-selected-bg border-border-highlight z-10":"",i.length===e?"rounded-r-md":"",1===e?"rounded-l-md":"","text-heading hover:bg-accent-bg focus:bg-accent-bg block h-full w-full border focus:outline-none"),children:[K(m,{number:e}),e]}):"star"===t.scale?K("label",{tabIndex:n+1,onKeyDown:t=>{"Enter"==t.key&&h(e)},className:$("flex h-full w-full justify-center focus:outline-none",e<=c||e<=r?"text-amber-400":"text-slate-300","hover:text-amber-400"),onFocus:()=>u(e),onBlur:()=>u(0),children:[K(m,{number:e}),K("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-14 max-h-full w-14",children:K("path",{fillRule:"evenodd",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})]}):K("label",{className:$("flex h-full w-full justify-center",r===e||c===e?"stroke-rating-selected text-rating-selected":"stroke-heading text-heading"),tabIndex:n+1,onKeyDown:t=>{"Enter"==t.key&&h(e)},onFocus:()=>u(e),onBlur:()=>u(0),children:[K(m,{number:e}),K(ne,{active:r===e||c===e,idx:n,range:t.range})]})},e))}),K("div",{className:"text-subheading flex justify-between px-1.5 text-xs leading-6",children:[K("p",{className:"w-1/2 text-left",children:t.lowerLabel}),K("p",{className:"w-1/2 text-right",children:t.upperLabel})]})]})}),K("div",{className:"mt-4 flex w-full justify-between",children:[!o&&K(rM,{tabIndex:!t.required||r?t.range+2:t.range+1,backButtonLabel:t.backButtonLabel,onClick:()=>{d(rA(l,t.id,performance.now()-p)),a()}}),K("div",{}),(!t.required||r)&&K(eC,{tabIndex:t.range+1,buttonLabel:t.buttonLabel,isLastQuestion:s,onClick:()=>{}})]})]})}function ne(e){let{active:t,idx:r,range:n}=e,i="fill-rating-fill",a="fill-none",o=[K(rX,{className:t?i:a}),K(r0,{className:t?i:a}),K(r1,{className:t?i:a}),K(r2,{className:t?i:a}),K(r3,{className:t?i:a}),K(r4,{className:t?i:a}),K(r5,{className:t?i:a}),K(r6,{className:t?i:a}),K(r8,{className:t?i:a}),K(r7,{className:t?i:a})];return 7==n?o=[o[1],o[3],o[4],o[5],o[6],o[8],o[9]]:5==n?o=[o[3],o[4],o[5],o[6],o[7]]:4==n?o=[o[4],o[5],o[6],o[7]]:3==n&&(o=[o[4],o[5],o[7]]),o[r]}K("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48}),ra.string(),ra.number(),ra.number().optional();let nt=ra.string().regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/),nr=ra.enum(["bottomLeft","bottomRight","topLeft","topRight","center"]),nn=ra.enum(["png","jpeg","jpg","pdf","doc","docx","xls","xlsx","ppt","pptx","plain","csv","mp4","mov","avi","mkv","webm","zip","rar","7z","tar"]),ni=ra.object({enabled:ra.boolean(),headline:ra.optional(ra.string()),subheader:ra.optional(ra.string()),buttonLabel:ra.optional(ra.string()),buttonLink:ra.optional(ra.string()),imageUrl:ra.string().optional()});var na=((s=na||{}).FileUpload="fileUpload",s.OpenText="openText",s.MultipleChoiceSingle="multipleChoiceSingle",s.MultipleChoiceMulti="multipleChoiceMulti",s.NPS="nps",s.CTA="cta",s.Rating="rating",s.Consent="consent",s.PictureSelection="pictureSelection",s.Cal="cal",s.Date="date",s);let no=ra.object({enabled:ra.boolean(),headline:ra.optional(ra.string()),html:ra.string().optional(),fileUrl:ra.string().optional(),buttonLabel:ra.string().optional(),timeToFinish:ra.boolean().default(!0),showResponseCount:ra.boolean().default(!1)}),ns=ra.object({enabled:ra.boolean(),fieldIds:ra.optional(ra.array(ra.string()))}),nl=ra.object({brandColor:nt.nullish(),highlightBorderColor:nt.nullish(),placement:nr.nullish(),clickOutsideClose:ra.boolean().nullish(),darkOverlay:ra.boolean().nullish()});ra.enum(["animation","color","image"]);let nd=ra.object({bg:ra.string().nullish(),bgType:ra.enum(["animation","color","image"]).nullish(),brightness:ra.number().nullish()}),nc=ra.object({background:nd.nullish(),hideProgressBar:ra.boolean().nullish()}),nu=ra.object({enabled:ra.boolean().optional(),heading:ra.string().optional(),subheading:ra.string().optional()}).nullable().optional(),np=ra.object({enabled:ra.boolean(),heading:ra.optional(ra.string()),subheading:ra.optional(ra.string()),isEncrypted:ra.boolean()}).nullable(),nf=ra.object({name:ra.optional(ra.string()),subheading:ra.optional(ra.string())}).optional(),nh=ra.object({id:ra.string(),label:ra.string()}),nm=ra.object({id:ra.string(),imageUrl:ra.string()}),nb=ra.enum(["accepted","clicked","submitted","skipped","equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","includesAll","includesOne","uploaded","notUploaded","booked"]),ng=ra.object({condition:nb.optional(),value:ra.union([ra.string(),ra.array(ra.string())]).optional(),destination:ra.union([ra.string(),ra.literal("end")]).optional()}),nv=ng.extend({condition:ra.enum(["uploaded","notUploaded"]).optional(),value:ra.undefined()}),n_=ng.extend({condition:ra.enum(["submitted","skipped"]).optional(),value:ra.undefined()}),ny=ng.extend({condition:ra.enum(["skipped","accepted"]).optional(),value:ra.undefined()}),nw=ng.extend({condition:ra.enum(["submitted","skipped","equals","notEquals"]).optional(),value:ra.string().optional()}),nx=ng.extend({condition:ra.enum(["submitted","skipped","includesAll","includesOne","equals"]).optional(),value:ra.union([ra.array(ra.string()),ra.string()]).optional()}),nk=ng.extend({condition:ra.enum(["equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","submitted","skipped"]).optional(),value:ra.union([ra.string(),ra.number()]).optional()}),nj=ng.extend({condition:ra.enum(["clicked","submitted","skipped"]).optional(),value:ra.undefined()}),nC=ng.extend({condition:ra.enum(["equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","submitted","skipped"]).optional(),value:ra.union([ra.string(),ra.number()]).optional()}),nz=ng.extend({condition:ra.enum(["submitted","skipped"]).optional(),value:ra.undefined()}),nN=ng.extend({condition:ra.enum(["booked","skipped"]).optional(),value:ra.undefined()}),nL=ra.union([n_,ny,nw,nx,nk,nj,nC,nz,nv,nN]),nT=ra.object({id:ra.string(),type:ra.string(),headline:ra.string(),subheader:ra.string().optional(),imageUrl:ra.string().optional(),required:ra.boolean(),buttonLabel:ra.string().optional(),backButtonLabel:ra.string().optional(),scale:ra.enum(["number","smiley","star"]).optional(),range:ra.union([ra.literal(5),ra.literal(3),ra.literal(4),ra.literal(7),ra.literal(10)]).optional(),logic:ra.array(nL).optional(),isDraft:ra.boolean().optional()}),nE=ra.enum(["text","email","url","number","phone"]),nS=nT.extend({type:ra.literal("openText"),placeholder:ra.string().optional(),longAnswer:ra.boolean().optional(),logic:ra.array(n_).optional(),inputType:nE.optional().default("text")}),nM=nT.extend({type:ra.literal("consent"),html:ra.string().optional(),label:ra.string(),dismissButtonLabel:ra.string().optional(),placeholder:ra.string().optional(),logic:ra.array(ny).optional()}),nI=nT.extend({type:ra.literal("multipleChoiceSingle"),choices:ra.array(nh),logic:ra.array(nw).optional(),shuffleOption:ra.enum(["none","all","exceptLast"]).optional(),otherOptionPlaceholder:ra.string().optional()}),nO=nT.extend({type:ra.literal("multipleChoiceMulti"),choices:ra.array(nh),logic:ra.array(nx).optional(),shuffleOption:ra.enum(["none","all","exceptLast"]).optional(),otherOptionPlaceholder:ra.string().optional()}),nq=nT.extend({type:ra.literal("nps"),lowerLabel:ra.string(),upperLabel:ra.string(),logic:ra.array(nk).optional()}),nA=nT.extend({type:ra.literal("cta"),html:ra.string().optional(),buttonUrl:ra.string().optional(),buttonExternal:ra.boolean(),dismissButtonLabel:ra.string().optional(),logic:ra.array(nj).optional()}),nP=nT.extend({type:ra.literal("rating"),scale:ra.enum(["number","smiley","star"]),range:ra.union([ra.literal(5),ra.literal(3),ra.literal(4),ra.literal(7),ra.literal(10)]),lowerLabel:ra.string(),upperLabel:ra.string(),logic:ra.array(nC).optional()}),nZ=nT.extend({type:ra.literal("date"),html:ra.string().optional(),format:ra.enum(["M-d-y","d-M-y","y-M-d"])}),nU=nT.extend({type:ra.literal("pictureSelection"),allowMulti:ra.boolean().optional().default(!1),choices:ra.array(nm),logic:ra.array(nz).optional()}),nR=nT.extend({type:ra.literal("fileUpload"),allowMultipleFiles:ra.boolean(),maxSizeInMB:ra.number().optional(),allowedFileExtensions:ra.array(nn).optional(),logic:ra.array(nv).optional()}),nB=nT.extend({type:ra.literal("cal"),calUserName:ra.string(),logic:ra.array(nN).optional()}),nD=ra.union([nS,nM,nI,nO,nq,nA,nP,nU,nZ,nR,nB]),nF=ra.array(nD),nW=ra.object({attributeClassId:ra.string().cuid2(),condition:ra.enum(["equals","notEquals"]),value:ra.string()}),nV=ra.enum(["displayOnce","displayMultiple","respondMultiple"]),nH=ra.enum(["web","email","link","mobile"]),nK=ra.enum(["draft","inProgress","paused","completed"]);function nY(e){let{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,autoFocus:l=!0,ttc:d,setTtc:c,surveyId:u,onFileUpload:p}=e;return t.type===na.OpenText?K(rQ,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,autoFocus:l,ttc:d,setTtc:c}):t.type===na.MultipleChoiceSingle?K(r$,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):t.type===na.MultipleChoiceMulti?K(rY,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):t.type===na.NPS?K(rJ,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):t.type===na.CTA?K(rZ,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):t.type===na.Rating?K(r9,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):t.type===na.Consent?K(rF,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):t.type===na.Date?K(rW,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):t.type===na.PictureSelection?K(rG,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):t.type===na.FileUpload?K(rK,{surveyId:u,question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,onFileUpload:p,ttc:d,setTtc:c}):t.type===na.Cal?K(rD,{question:t,value:r,onChange:n,onSubmit:i,onBack:a,isFirstQuestion:o,isLastQuestion:s,ttc:d,setTtc:c}):null}function n$(e){let{redirectUrl:t,isRedirectDisabled:r}=e,[n,i]=ep(5);return(ef(()=>{let e;if(t){let e=setInterval(()=>{i(n=>n<=0?(clearInterval(e),r||(window.location.href=t),0):n-1)},1e3)}return()=>clearInterval(e)},[t,r]),t)?K("div",{children:K("div",{className:"bg-accent-bg text-subheading mt-10 rounded-md p-2 text-sm",children:[K("span",{children:"You're redirected in "}),K("span",{children:n})]})}):null}function nJ(e){let{headline:t,subheader:r,redirectUrl:n,isRedirectDisabled:i,buttonLabel:a,buttonLink:o,imageUrl:s}=e;return ef(()=>{if(!o)return;let e=e=>{"Enter"===e.key&&(window.location.href=o)};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[o]),K("div",{className:"text-center",children:[s?K(rq,{imgUrl:s}):K("div",{children:[K("div",{className:"text-brand flex items-center justify-center",children:K("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-24 w-24",children:K("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),K("span",{className:"bg-shadow mb-[10px] inline-block h-1 w-16 rounded-[100%]"})]}),K("div",{children:[K(rI,{alignTextCenter:!0,headline:t,questionId:"thankYouCard"}),K(rB,{subheader:r,questionId:"thankYouCard"}),K(n$,{redirectUrl:n,isRedirectDisabled:i}),a&&K("div",{className:"mt-6 flex w-full flex-col items-center justify-center space-y-4",children:[K(eC,{buttonLabel:a,isLastQuestion:!1,onClick:()=>{o&&(window.location.href=o)}}),K("p",{class:"text-xs",children:"Press Enter ↵"})]})]})]})}ra.object({id:ra.string().cuid2(),createdAt:ra.date(),updatedAt:ra.date(),name:ra.string(),type:nH,environmentId:ra.string(),createdBy:ra.string().nullable(),status:nK,attributeFilters:ra.array(nW),displayOption:nV,autoClose:ra.number().nullable(),triggers:ra.array(ra.string()),redirectUrl:ra.string().url().nullable(),recontactDays:ra.number().nullable(),welcomeCard:no,questions:nF,thankYouCard:ni,hiddenFields:ns,delay:ra.number(),autoComplete:ra.number().nullable(),closeOnDate:ra.date().nullable(),productOverwrites:nl.nullable(),styling:nc.nullable(),surveyClosedMessage:nu.nullable(),singleUse:np.nullable(),verifyEmail:nf.nullable(),pin:ra.string().nullable().optional(),resultShareKey:ra.string().nullable(),displayPercentage:ra.number().min(1).max(100).nullable()}),ra.object({name:ra.string(),type:nH.optional(),createdBy:ra.string().cuid().optional(),status:nK.optional(),displayOption:nV.optional(),autoClose:ra.number().optional(),redirectUrl:ra.string().url().optional(),recontactDays:ra.number().optional(),welcomeCard:no.optional(),questions:nF.optional(),thankYouCard:ni.optional(),hiddenFields:ns,delay:ra.number().optional(),autoComplete:ra.number().optional(),closeOnDate:ra.date().optional(),surveyClosedMessage:nu.optional(),verifyEmail:nf.optional(),attributeFilters:ra.array(nW).optional(),triggers:ra.array(ra.string()).optional()}),ra.union([ra.literal("fileUpload"),ra.literal("openText"),ra.literal("multipleChoiceSingle"),ra.literal("multipleChoiceMulti"),ra.literal("nps"),ra.literal("cta"),ra.literal("rating"),ra.literal("consent"),ra.literal("pictureSelection"),ra.literal("cal"),ra.literal("date")]);let nQ=()=>K("div",{className:"mr-1",children:K("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-stopwatch",viewBox:"0 0 16 16",children:[K("path",{d:"M8.5 5.6a.5.5 0 1 0-1 0v2.9h-3a.5.5 0 0 0 0 1H8a.5.5 0 0 0 .5-.5V5.6z"}),K("path",{d:"M6.5 1A.5.5 0 0 1 7 .5h2a.5.5 0 0 1 0 1v.57c1.36.196 2.594.78 3.584 1.64a.715.715 0 0 1 .012-.013l.354-.354-.354-.353a.5.5 0 0 1 .707-.708l1.414 1.415a.5.5 0 1 1-.707.707l-.353-.354-.354.354a.512.512 0 0 1-.013.012A7 7 0 1 1 7 2.071V1.5a.5.5 0 0 1-.5-.5zM8 3a6 6 0 1 0 .001 12A6 6 0 0 0 8 3z"})]})}),nG=()=>K("div",{className:"mr-1",children:K("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-4 w-4",children:K("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"})})});function nX(e){let{headline:t,html:r,fileUrl:n,buttonLabel:i,onSubmit:a,survey:o,responseCount:s}=e,l=()=>{let e=G(o,0);.5===e&&(e=1);let t=o.questions.length/e*15;if(t>360)return"6+ minutes";let r=Math.floor(t/60);return t%60>0?0===r?"less than 1 minute":"less than ".concat(r+1," minutes"):"".concat(r," minutes")},d=o.welcomeCard.timeToFinish,c=o.welcomeCard.showResponseCount;return K("div",{children:[n&&K("img",{src:n,className:"mb-8 max-h-96 w-1/3 rounded-lg object-contain",alt:"Company Logo"}),K(rI,{headline:t,questionId:"welcomeCard"}),K(rO,{htmlString:r,questionId:"welcomeCard"}),K("div",{className:"mt-10 flex w-full justify-between",children:K("div",{className:"flex w-full justify-start gap-4",children:[K(eC,{buttonLabel:i,isLastQuestion:!1,focus:!0,onClick:()=>{a({welcomeCard:"clicked"},{})},type:"button"}),K("div",{className:"text-subheading flex items-center text-xs",children:"Press Enter ↵"})]})}),d&&!c?K("div",{className:"item-center mt-4 flex text-slate-500",children:[K(nQ,{}),K("p",{className:"pt-1 text-xs",children:K("span",{children:[" Takes ",l()," "]})})]}):c&&!d&&s&&s>3?K("div",{className:"item-center mt-4 flex text-slate-500",children:[K(nG,{}),K("p",{className:"pt-1 text-xs",children:K("span",{children:"".concat(s," people responded")})})]}):d&&c?K("div",{className:"item-center mt-4 flex text-slate-500",children:[K(nQ,{}),K("p",{className:"pt-1 text-xs",children:[K("span",{children:[" Takes ",l()," "]}),K("span",{children:s&&s>3?"⋅ ".concat(s," people responded"):""})]})]}):null]})}function n0(e){var t,r,n;let{survey:i,isBrandingEnabled:a,activeQuestionId:o,onDisplay:s=()=>{},onActiveQuestionChange:l=()=>{},onResponse:d=()=>{},onClose:c=()=>{},onFinished:u=()=>{},onRetry:p=()=>{},isRedirectDisabled:f=!1,prefillResponseData:h,getSetIsError:m,onFileUpload:b,responseCount:g}=e,[v,_]=ep(o||(i.welcomeCard.enabled?"start":null==(t=null==i?void 0:i.questions[0])?void 0:t.id)),[y,w]=ep(!1),[x,k]=ep(!1),[j,C]=ep([]),[z,N]=ep({}),[L,E]=ep({}),S=i.questions.findIndex(e=>e.id===v),M=em(()=>{if("end"!==v||i.thankYouCard.enabled)return i.questions.find(e=>e.id===v);{let e=[...j].pop();return i.questions.find(t=>t.id===e)}},[v,i]),I=eh(null),O=!(null==(r=i.styling)?void 0:r.hideProgressBar);ef(()=>{var e,t;if("hidden"!==o){if("start"===o&&!i.welcomeCard.enabled){_(null==(e=null==i?void 0:i.questions[0])?void 0:e.id);return}_(o||(i.welcomeCard.enabled?"start":null==(t=null==i?void 0:i.questions[0])?void 0:t.id))}},[o,i.questions,i.welcomeCard.enabled]),ef(()=>{I.current&&(I.current.scrollTop=0)},[v]),ef(()=>{s(),h&&P(h,{},!0)},[]),ef(()=>{m&&m(e=>{w(e)})});let q=S,A=M,P=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=Object.keys(e)[0];k(!0);let a=function(e){var t,r;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=i.questions,o=e[v];if("start"===v){if(!n)return(null==(t=a[0])?void 0:t.id)||"end";q=0,A=a[0]}if(-1===q)throw Error("Question not found");if((null==A?void 0:A.logic)&&(null==A?void 0:A.logic.length)>0&&M){for(let e of A.logic)if(e.destination&&(("multipleChoiceSingle"===M.type||"multipleChoiceMulti"===M.type)&&!M.choices.find(e=>e.label===o)&&eL(e,"Other")||eL(e,o)))return e.destination}return(null==(r=a[q+1])?void 0:r.id)||"end"}(e,r),o="end"===a;d({data:e,ttc:t,finished:o}),o&&u(),_(a),C([...j,n]),k(!1),l(a)},Z=e=>{for(;e.includes("recall:");){let r=rS(e);if(r){var t;let n=rT(r),i=rE(r).replaceAll("nbsp"," "),a=n&&z[n]?z[n]:i;t=a,/^(?:\d{4}-\d{2}-\d{2}|\d{2}-\d{2}-\d{4})$/.test(t)&&new Date(t)&&(a=ro(new Date(a))),Array.isArray(a)&&(a=a.join(", ")),e=e.replace(r,a)}}return e};return K(T,{children:K(eN,{survey:i,onClose:c,children:K("div",{className:"no-scrollbar flex h-full w-full flex-col justify-between rounded-lg bg-[--fb-survey-background-color] px-6 pb-3 pt-6",children:[K("div",{ref:I,className:$(x?"animate-pulse opacity-60":"","my-auto"),children:0!==i.questions.length||i.welcomeCard.enabled||i.thankYouCard.enabled?y?K(ez,{responseData:z,questions:i.questions,onRetry:p}):"start"===v&&i.welcomeCard.enabled?K(nX,{headline:i.welcomeCard.headline,html:i.welcomeCard.html,fileUrl:i.welcomeCard.fileUrl,buttonLabel:i.welcomeCard.buttonLabel,onSubmit:P,survey:i,responseCount:g}):"end"===v&&i.thankYouCard.enabled?K(nJ,{headline:"string"==typeof i.thankYouCard.headline?Z(i.thankYouCard.headline):"",subheader:"string"==typeof i.thankYouCard.subheader?Z(i.thankYouCard.subheader):"",buttonLabel:i.thankYouCard.buttonLabel,buttonLink:i.thankYouCard.buttonLink,imageUrl:i.thankYouCard.imageUrl,redirectUrl:i.redirectUrl,isRedirectDisabled:f}):M&&K(nY,{surveyId:i.id,question:(e=>{let t={...e};return e.headline.includes("recall:")&&(t.headline=Z(t.headline)),e.subheader&&e.subheader.includes("recall:")&&(t.subheader=Z(t.subheader)),t})(M),value:z[M.id],onChange:e=>{N({...z,...e})},onSubmit:P,onBack:()=>{var e;let t;if((null==j?void 0:j.length)>0){let e=[...j];if(t=e.pop(),h&&t===i.questions[0].id)return;C(e)}else t=null==(e=i.questions[q-1])?void 0:e.id;if(!t)throw Error("Question not found");_(t),l(t)},ttc:L,setTtc:E,onFileUpload:b,isFirstQuestion:j&&h?j[j.length-1]===i.questions[0].id:M.id===(null==(n=null==i?void 0:i.questions[0])?void 0:n.id),isLastQuestion:M.id===i.questions[i.questions.length-1].id}):K("div",{children:"No questions available."})}),K("div",{className:"mt-8",children:[a&&K(Y,{}),O&&K(ej,{survey:i,questionId:v})]})]})})})}function n1(e){return K("div",{id:"fbjs",className:"formbricks-form h-full w-full",children:K(n0,{...e})})}function n2(e){let{children:t,isOpen:r,placement:n,clickOutside:i,darkOverlay:a,highlightBorderColor:o,onClose:s}=e,[l,d]=ep(!1),c="center"===n,u=eh(null);ef(()=>{d(r)},[r]),ef(()=>{if(c)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)};function e(e){i&&l&&u.current&&!u.current.contains(e.target)&&s()}},[l,i,s,c]);let p=em(()=>o?{borderRadius:"8px",border:"2px solid",borderColor:o}:{overflow:"visible"},[o]);return l?K("div",{"aria-live":"assertive",className:$(c?"pointer-events-auto":"pointer-events-none","z-999999 fixed inset-0 flex items-end"),children:K("div",{className:$("relative h-full w-full",c?a?"bg-gray-700/80":"bg-white/50":"bg-none transition-all duration-500 ease-in-out"),children:K("div",{ref:u,className:$((e=>{switch(e){case"bottomRight":default:return"sm:bottom-3 sm:right-3";case"topRight":return"sm:top-3 sm:right-3 sm:bottom-3";case"topLeft":return"sm:top-3 sm:left-3 sm:bottom-3";case"bottomLeft":return"sm:bottom-3 sm:left-3";case"center":return"sm:top-1/2 sm:left-1/2 sm:transform sm:-translate-x-1/2 sm:-translate-y-1/2"}})(n),l?"opacity-100":"opacity-0","border-border pointer-events-auto absolute bottom-0 h-fit w-full overflow-visible rounded-lg border bg-white shadow-lg transition-all duration-500 ease-in-out sm:m-4 sm:max-w-sm"),children:[!c&&K("div",{class:"absolute right-0 top-0 block pr-2 pt-2",children:K("button",{type:"button",onClick:s,class:"text-close-button hover:text-close-button-focus focus:ring-close-button-focus relative h-5 w-5 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2",children:[K("span",{class:"sr-only",children:"Close survey"}),K("svg",{class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true",children:K("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 4L20 20M4 20L20 4"})})]})}),K("div",{style:p,children:t})]})})}):null}function n3(e){let{survey:t,isBrandingEnabled:r,activeQuestionId:n,getSetIsError:i,placement:a,clickOutside:o,darkOverlay:s,highlightBorderColor:l,onDisplay:d,onActiveQuestionChange:c,onResponse:u,onClose:p,onFinished:f=()=>{},onFileUpload:h,onRetry:m,isRedirectDisabled:b=!1,responseCount:g}=e,[v,_]=ep(!0),y=()=>{_(!1),setTimeout(()=>{p&&p()},1e3)};return K("div",{id:"fbjs",className:"formbricks-form",children:K(n2,{placement:a,clickOutside:o,darkOverlay:s,highlightBorderColor:l,isOpen:v,onClose:y,children:K(n0,{survey:t,isBrandingEnabled:r,activeQuestionId:n,onDisplay:d,onActiveQuestionChange:c,onResponse:u,onClose:y,onFinished:()=>{f(),setTimeout(()=>{t.redirectUrl||y()},3e3)},onRetry:m,getSetIsError:i,onFileUpload:h,isRedirectDisabled:b,responseCount:g})})})}let n4=()=>{if(null===document.getElementById("formbricks__css")){let e=document.createElement("style");e.id="formbricks__css",e.innerHTML='#fbjs *,#fbjs :before,#fbjs :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}#fbjs :before,#fbjs :after{--tw-content: ""}#fbjs html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}#fbjs body{margin:0;line-height:inherit}#fbjs hr{height:0;color:inherit;border-top-width:1px}#fbjs abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#fbjs h1,#fbjs h2,#fbjs h3,#fbjs h4,#fbjs h5,#fbjs h6{font-size:inherit;font-weight:inherit}#fbjs a{color:inherit;text-decoration:inherit}#fbjs b,#fbjs strong{font-weight:bolder}#fbjs code,#fbjs kbd,#fbjs samp,#fbjs pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}#fbjs small{font-size:80%}#fbjs sub,#fbjs sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#fbjs sub{bottom:-.25em}#fbjs sup{top:-.5em}#fbjs table{text-indent:0;border-color:inherit;border-collapse:collapse}#fbjs button,#fbjs input,#fbjs optgroup,#fbjs select,#fbjs textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}#fbjs button,#fbjs select{text-transform:none}#fbjs button,#fbjs [type=button],#fbjs [type=reset],#fbjs [type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}#fbjs :-moz-focusring{outline:auto}#fbjs :-moz-ui-invalid{box-shadow:none}#fbjs progress{vertical-align:baseline}#fbjs ::-webkit-inner-spin-button,#fbjs ::-webkit-outer-spin-button{height:auto}#fbjs [type=search]{-webkit-appearance:textfield;outline-offset:-2px}#fbjs ::-webkit-search-decoration{-webkit-appearance:none}#fbjs ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}#fbjs summary{display:list-item}#fbjs blockquote,#fbjs dl,#fbjs dd,#fbjs h1,#fbjs h2,#fbjs h3,#fbjs h4,#fbjs h5,#fbjs h6,#fbjs hr,#fbjs figure,#fbjs p,#fbjs pre{margin:0}#fbjs fieldset{margin:0;padding:0}#fbjs legend{padding:0}#fbjs ol,#fbjs ul,#fbjs menu{list-style:none;margin:0;padding:0}#fbjs textarea{resize:vertical}#fbjs input::-moz-placeholder,#fbjs textarea::-moz-placeholder{opacity:1;color:#9ca3af}#fbjs input::placeholder,#fbjs textarea::placeholder{opacity:1;color:#9ca3af}#fbjs button,#fbjs [role=button]{cursor:pointer}#fbjs :disabled{cursor:default}#fbjs img,#fbjs svg,#fbjs video,#fbjs canvas,#fbjs audio,#fbjs iframe,#fbjs embed,#fbjs object{display:block;vertical-align:middle}#fbjs img,#fbjs video{max-width:100%;height:auto}#fbjs [hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}#fbjs :is(.sr-only){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}#fbjs :is(.pointer-events-none){pointer-events:none}#fbjs :is(.pointer-events-auto){pointer-events:auto}#fbjs :is(.visible){visibility:visible}#fbjs :is(.fixed){position:fixed}#fbjs :is(.absolute){position:absolute}#fbjs :is(.relative){position:relative}#fbjs :is(.inset-0){top:0;right:0;bottom:0;left:0}#fbjs :is(.bottom-0){bottom:0}#fbjs :is(.left-0){left:0}#fbjs :is(.right-0){right:0}#fbjs :is(.right-2){right:.5em}#fbjs :is(.top-0){top:0}#fbjs :is(.top-2){top:.5em}#fbjs :is(.z-10){z-index:10}#fbjs :is(.z-20){z-index:20}#fbjs :is(.z-999999){z-index:999999}#fbjs :is(.m-2){margin:.5em}#fbjs :is(.my-4){margin-top:1em;margin-bottom:1em}#fbjs :is(.my-auto){margin-top:auto;margin-bottom:auto}#fbjs :is(.mb-1){margin-bottom:.25em}#fbjs :is(.mb-1\\.5){margin-bottom:.375em}#fbjs :is(.mb-4){margin-bottom:1em}#fbjs :is(.mb-5){margin-bottom:1.25em}#fbjs :is(.mb-8){margin-bottom:2em}#fbjs :is(.mb-\\[10px\\]){margin-bottom:10px}#fbjs :is(.ml-2){margin-left:.5em}#fbjs :is(.ml-3){margin-left:.75em}#fbjs :is(.mr-1){margin-right:.25em}#fbjs :is(.mr-4){margin-right:1em}#fbjs :is(.mt-1){margin-top:.25em}#fbjs :is(.mt-10){margin-top:2.5em}#fbjs :is(.mt-2){margin-top:.5em}#fbjs :is(.mt-3){margin-top:.75em}#fbjs :is(.mt-4){margin-top:1em}#fbjs :is(.mt-6){margin-top:1.5em}#fbjs :is(.mt-8){margin-top:2em}#fbjs :is(.box-border){box-sizing:border-box}#fbjs :is(.block){display:block}#fbjs :is(.inline-block){display:inline-block}#fbjs :is(.inline){display:inline}#fbjs :is(.flex){display:flex}#fbjs :is(.grid){display:grid}#fbjs :is(.hidden){display:none}#fbjs :is(.h-1){height:.25em}#fbjs :is(.h-10){height:2.5em}#fbjs :is(.h-12){height:3em}#fbjs :is(.h-14){height:3.5em}#fbjs :is(.h-2){height:.5em}#fbjs :is(.h-24){height:6em}#fbjs :is(.h-28){height:7em}#fbjs :is(.h-4){height:1em}#fbjs :is(.h-40){height:10em}#fbjs :is(.h-5){height:1.25em}#fbjs :is(.h-6){height:1.5em}#fbjs :is(.h-9){height:2.25em}#fbjs :is(.h-96){height:24em}#fbjs :is(.h-fit){height:-moz-fit-content;height:fit-content}#fbjs :is(.h-full){height:100%}#fbjs :is(.max-h-36){max-height:9em}#fbjs :is(.max-h-96){max-height:24em}#fbjs :is(.max-h-\\[42vh\\]){max-height:42vh}#fbjs :is(.max-h-full){max-height:100%}#fbjs :is(.w-1\\/2){width:50%}#fbjs :is(.w-1\\/3){width:33.333333%}#fbjs :is(.w-14){width:3.5em}#fbjs :is(.w-16){width:4em}#fbjs :is(.w-24){width:6em}#fbjs :is(.w-4){width:1em}#fbjs :is(.w-5){width:1.25em}#fbjs :is(.w-6){width:1.5em}#fbjs :is(.w-80){width:20em}#fbjs :is(.w-full){width:100%}#fbjs :is(.max-w-md){max-width:28em}#fbjs :is(.flex-1){flex:1 1 0%}@keyframes pulse{50%{opacity:.5}}#fbjs :is(.animate-pulse){animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}#fbjs :is(.animate-spin){animation:spin 1s linear infinite}#fbjs :is(.cursor-pointer){cursor:pointer}#fbjs :is(.appearance-none){-webkit-appearance:none;-moz-appearance:none;appearance:none}#fbjs :is(.grid-cols-2){grid-template-columns:repeat(2,minmax(0,1fr))}#fbjs :is(.flex-row){flex-direction:row}#fbjs :is(.flex-col){flex-direction:column}#fbjs :is(.items-end){align-items:flex-end}#fbjs :is(.items-center){align-items:center}#fbjs :is(.justify-start){justify-content:flex-start}#fbjs :is(.justify-end){justify-content:flex-end}#fbjs :is(.justify-center){justify-content:center}#fbjs :is(.justify-between){justify-content:space-between}#fbjs :is(.gap-2){gap:.5em}#fbjs :is(.gap-4){gap:1em}#fbjs :is(.gap-x-5){-moz-column-gap:1.25em;column-gap:1.25em}#fbjs :is(.gap-y-4){row-gap:1em}#fbjs :is(.space-x-2>:not([hidden])~:not([hidden])){--tw-space-x-reverse: 0;margin-right:calc(.5em * var(--tw-space-x-reverse));margin-left:calc(.5em * calc(1 - var(--tw-space-x-reverse)))}#fbjs :is(.space-y-2>:not([hidden])~:not([hidden])){--tw-space-y-reverse: 0;margin-top:calc(.5em * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5em * var(--tw-space-y-reverse))}#fbjs :is(.space-y-3>:not([hidden])~:not([hidden])){--tw-space-y-reverse: 0;margin-top:calc(.75em * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75em * var(--tw-space-y-reverse))}#fbjs :is(.space-y-4>:not([hidden])~:not([hidden])){--tw-space-y-reverse: 0;margin-top:calc(1em * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1em * var(--tw-space-y-reverse))}#fbjs :is(.self-start){align-self:flex-start}#fbjs :is(.overflow-auto){overflow:auto}#fbjs :is(.overflow-hidden){overflow:hidden}#fbjs :is(.overflow-visible){overflow:visible}#fbjs :is(.overflow-y-auto){overflow-y:auto}#fbjs :is(.overflow-y-scroll){overflow-y:scroll}#fbjs :is(.rounded){border-radius:.25em}#fbjs :is(.rounded-\\[100\\%\\]){border-radius:100%}#fbjs :is(.rounded-full){border-radius:9999px}#fbjs :is(.rounded-lg){border-radius:.5em}#fbjs :is(.rounded-md){border-radius:.375em}#fbjs :is(.rounded-xl){border-radius:.75em}#fbjs :is(.rounded-l-md){border-top-left-radius:.375em;border-bottom-left-radius:.375em}#fbjs :is(.rounded-r-md){border-top-right-radius:.375em;border-bottom-right-radius:.375em}#fbjs :is(.border){border-width:1px}#fbjs :is(.border-2){border-width:2px}#fbjs :is(.border-4){border-width:4px}#fbjs :is(.border-b-2){border-bottom-width:2px}#fbjs :is(.border-dashed){border-style:dashed}#fbjs :is(.border-\\[\\#e5e7eb\\]){--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}#fbjs :is(.border-back-button-border){border-color:var(--fb-back-btn-border)}#fbjs :is(.border-border){border-color:var(--fb-border-color)}#fbjs :is(.border-border-highlight){border-color:var(--fb-border-color-highlight)}#fbjs :is(.border-brand){border-color:var(--fb-brand-color)}#fbjs :is(.border-neutral-900){--tw-border-opacity: 1;border-color:rgb(23 23 23 / var(--tw-border-opacity))}#fbjs :is(.border-red-500){--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}#fbjs :is(.border-slate-200){--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}#fbjs :is(.border-slate-300){--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity))}#fbjs :is(.border-submit-button-border){border-color:var(--fb-submit-btn-border)}#fbjs :is(.\\!bg-slate-900){--tw-bg-opacity: 1 !important;background-color:rgb(15 23 42 / var(--tw-bg-opacity))!important}#fbjs :is(.bg-\\[--fb-survey-background-color\\]){background-color:var(--fb-survey-background-color)}#fbjs :is(.bg-accent-bg){background-color:var(--fb-accent-background-color)}#fbjs :is(.bg-accent-selected-bg){background-color:var(--fb-accent-background-color-selected)}#fbjs :is(.bg-brand){background-color:var(--fb-brand-color)}#fbjs :is(.bg-gray-700\\/80){background-color:#374151cc}#fbjs :is(.bg-shadow){background-color:var(--fb-shadow-color)}#fbjs :is(.bg-slate-100){--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}#fbjs :is(.bg-slate-200){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}#fbjs :is(.bg-slate-50){--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}#fbjs :is(.bg-survey-bg){background-color:var(--fb-survey-background-color)}#fbjs :is(.bg-white){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#fbjs :is(.bg-white\\/50){background-color:#ffffff80}#fbjs :is(.bg-none){background-image:none}#fbjs :is(.fill-none){fill:none}#fbjs :is(.fill-rating-fill){fill:var(--fb-rating-fill)}#fbjs :is(.stroke-heading){stroke:var(--fb-heading-color)}#fbjs :is(.stroke-rating-selected){stroke:var(--fb-rating-selected)}#fbjs :is(.object-contain){-o-object-fit:contain;object-fit:contain}#fbjs :is(.object-cover){-o-object-fit:cover;object-fit:cover}#fbjs :is(.p-0){padding:0}#fbjs :is(.p-2){padding:.5em}#fbjs :is(.p-3){padding:.75em}#fbjs :is(.p-4){padding:1em}#fbjs :is(.px-1){padding-left:.25em;padding-right:.25em}#fbjs :is(.px-1\\.5){padding-left:.375em;padding-right:.375em}#fbjs :is(.px-3){padding-left:.75em;padding-right:.75em}#fbjs :is(.px-4){padding-left:1em;padding-right:1em}#fbjs :is(.px-6){padding-left:1.5em;padding-right:1.5em}#fbjs :is(.py-0){padding-top:0;padding-bottom:0}#fbjs :is(.py-0\\.5){padding-top:.125em;padding-bottom:.125em}#fbjs :is(.py-2){padding-top:.5em;padding-bottom:.5em}#fbjs :is(.py-3){padding-top:.75em;padding-bottom:.75em}#fbjs :is(.py-4){padding-top:1em;padding-bottom:1em}#fbjs :is(.py-5){padding-top:1.25em;padding-bottom:1.25em}#fbjs :is(.py-6){padding-top:1.5em;padding-bottom:1.5em}#fbjs :is(.pb-2){padding-bottom:.5em}#fbjs :is(.pb-3){padding-bottom:.75em}#fbjs :is(.pr-2){padding-right:.5em}#fbjs :is(.pr-2\\.5){padding-right:.625em}#fbjs :is(.pt-1){padding-top:.25em}#fbjs :is(.pt-2){padding-top:.5em}#fbjs :is(.pt-6){padding-top:1.5em}#fbjs :is(.text-left){text-align:left}#fbjs :is(.text-center){text-align:center}#fbjs :is(.text-right){text-align:right}#fbjs :is(.text-base){font-size:1em;line-height:1.5em}#fbjs :is(.text-sm){font-size:.875em;line-height:1.25em}#fbjs :is(.text-xs){font-size:.75em;line-height:1em}#fbjs :is(.font-bold){font-weight:700}#fbjs :is(.font-medium){font-weight:500}#fbjs :is(.font-normal){font-weight:400}#fbjs :is(.font-semibold){font-weight:600}#fbjs :is(.leading-10){line-height:2.5em}#fbjs :is(.leading-4){line-height:1em}#fbjs :is(.leading-6){line-height:1.5em}#fbjs :is(.leading-7){line-height:1.75em}#fbjs :is(.leading-\\[2\\.8rem\\]){line-height:2.8em}#fbjs :is(.\\!text-slate-100){--tw-text-opacity: 1 !important;color:rgb(241 245 249 / var(--tw-text-opacity))!important}#fbjs :is(.text-amber-400){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity))}#fbjs :is(.text-brand){color:var(--fb-brand-color)}#fbjs :is(.text-close-button){color:var(--fb-close-btn-color)}#fbjs :is(.text-heading){color:var(--fb-heading-color)}#fbjs :is(.text-info-text){color:var(--fb-info-text-color)}#fbjs :is(.text-on-brand){color:var(--fb-brand-text-color)}#fbjs :is(.text-rating-selected){color:var(--fb-rating-selected)}#fbjs :is(.text-red-500){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}#fbjs :is(.text-red-600){--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}#fbjs :is(.text-signature){color:var(--fb-signature-text-color)}#fbjs :is(.text-slate-300){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}#fbjs :is(.text-slate-500){--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}#fbjs :is(.text-slate-600){--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}#fbjs :is(.text-slate-700){--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}#fbjs :is(.text-slate-900){--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}#fbjs :is(.text-subheading){color:var(--fb-subheading-color)}#fbjs :is(.opacity-0){opacity:0}#fbjs :is(.opacity-100){opacity:1}#fbjs :is(.opacity-60){opacity:.6}#fbjs :is(.shadow-lg){--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#fbjs :is(.shadow-md){--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#fbjs :is(.shadow-sm){--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#fbjs :is(.shadow-xl){--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#fbjs :is(.filter){filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#fbjs :is(.transition-all){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#fbjs :is(.duration-500){transition-duration:.5s}#fbjs :is(.ease-in-out){transition-timing-function:cubic-bezier(.4,0,.2,1)}#fbjs{font-size:16px}#fbjs *{scrollbar-width:thin;scrollbar-color:#e2e8f0}#fbjs *::-webkit-scrollbar{width:8px;border-radius:99px}#fbjs *::-webkit-scrollbar-track{background:#e2e8f0;border-radius:99px}#fbjs *::-webkit-scrollbar-thumb{background-color:#cbd5e1;border:3px solid #cbd5e1;border-radius:99px}.fb-htmlbody{display:block;font-size:.875em;font-weight:400;line-height:1.5em;color:var(--fb-subheading-color)!important}p.fb-editor-paragraph{color:var(--fb-subheading-color)!important}:root{--slate-50: rgb(248 250 252);--slate-100: rgb(241 245 249);--slate-200: rgb(226 232 240);--slate-300: rgb(203 213 225);--slate-400: rgb(148 163 184);--slate-500: rgb(100 116 139);--slate-600: rgb(71 85 105);--slate-700: rgb(51 65 85);--slate-800: rgb(30 41 59);--slate-900: rgb(15 23 42);--gray-100: rgb(243 244 246);--gray-200: rgb(229 231 235);--yellow-300: rgb(253 224 71);--yellow-500: rgb(234 179 8);--fb-brand-color: rgb(255, 255, 255);--fb-brand-text-color: black;--fb-border-color: var(--slate-300);--fb-border-color-highlight: var(--slate-500);--fb-focus-color: var(--slate-500);--fb-heading-color: var(--slate-900);--fb-subheading-color: var(--slate-700);--fb-info-text-color: var(--slate-500);--fb-signature-text-color: var(--slate-400);--fb-survey-background-color: white;--fb-accent-background-color: var(--slate-200);--fb-accent-background-color-selected: var(--slate-100);--fb-placeholder-color: var(--slate-400);--fb-shadow-color: var(--slate-300);--fb-rating-fill: var(--yellow-300);--fb-rating-hover: var(--yellow-500);--fb-back-btn-border: transparent;--fb-submit-btn-border: transparent;--fb-rating-selected: black;--fb-close-btn-color: var(--slate-500);--fb-close-btn-color-hover: var(--slate-700)}#fbjs :is(.placeholder\\:text-placeholder)::-moz-placeholder{color:var(--fb-placeholder-color)}#fbjs :is(.placeholder\\:text-placeholder)::placeholder{color:var(--fb-placeholder-color)}#fbjs :is(.first\\:rounded-l-md:first-child){border-top-left-radius:.375em;border-bottom-left-radius:.375em}#fbjs :is(.last\\:rounded-r-md:last-child){border-top-right-radius:.375em;border-bottom-right-radius:.375em}#fbjs :is(.focus-within\\:border-border-highlight:focus-within){border-color:var(--fb-border-color-highlight)}#fbjs :is(.focus-within\\:bg-accent-bg:focus-within){background-color:var(--fb-accent-background-color)}#fbjs :is(.hover\\:bg-accent-bg:hover){background-color:var(--fb-accent-background-color)}#fbjs :is(.hover\\:bg-slate-100:hover){--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}#fbjs :is(.hover\\:bg-slate-200:hover){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}#fbjs :is(.hover\\:bg-slate-50:hover){--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}#fbjs :is(.hover\\:text-amber-400:hover){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity))}#fbjs :is(.hover\\:text-close-button-focus:hover){color:var(--fb-close-btn-hover-color)}#fbjs :is(.hover\\:text-heading:hover){color:var(--fb-heading-color)}#fbjs :is(.hover\\:text-slate-900:hover){--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}#fbjs :is(.hover\\:opacity-90:hover){opacity:.9}#fbjs :is(.focus\\:border-4:focus){border-width:4px}#fbjs :is(.focus\\:border-border-highlight:focus){border-color:var(--fb-border-color-highlight)}#fbjs :is(.focus\\:bg-accent-bg:focus){background-color:var(--fb-accent-background-color)}#fbjs :is(.focus\\:bg-accent-selected-bg:focus){background-color:var(--fb-accent-background-color-selected)}#fbjs :is(.focus\\:outline-none:focus){outline:2px solid transparent;outline-offset:2px}#fbjs :is(.focus\\:ring-0:focus){--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#fbjs :is(.focus\\:ring-2:focus){--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#fbjs :is(.focus\\:ring-border-highlight:focus){--tw-ring-color: var(--fb-border-color-highlight)}#fbjs :is(.focus\\:ring-close-button-focus:focus){--tw-ring-color: var(--fb-close-btn-hover-color)}#fbjs :is(.focus\\:ring-focus:focus){--tw-ring-color: var(--fb-focus-color)}#fbjs :is(.focus\\:ring-neutral-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(23 23 23 / var(--tw-ring-opacity))}#fbjs :is(.focus\\:ring-offset-0:focus){--tw-ring-offset-width: 0px}#fbjs :is(.focus\\:ring-offset-1:focus){--tw-ring-offset-width: 1px}#fbjs :is(.focus\\:ring-offset-2:focus){--tw-ring-offset-width: 2px}#fbjs :is(.disabled\\:cursor-not-allowed:disabled){cursor:not-allowed}#fbjs :is(.disabled\\:opacity-50:disabled){opacity:.5}#fbjs :is(.aria-selected\\:opacity-100[aria-selected=true]){opacity:1}#fbjs :is(.dark .dark\\:border-slate-600){--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}#fbjs :is(.dark .dark\\:bg-slate-700){--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}#fbjs :is(.dark .dark\\:text-slate-400){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}#fbjs :is(.dark .dark\\:hover\\:border-slate-500:hover){--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity))}#fbjs :is(.dark .dark\\:hover\\:bg-slate-800:hover){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}@media (min-width: 640px){#fbjs :is(.sm\\:bottom-3){bottom:.75em}#fbjs :is(.sm\\:left-1\\/2){left:50%}#fbjs :is(.sm\\:left-3){left:.75em}#fbjs :is(.sm\\:right-3){right:.75em}#fbjs :is(.sm\\:top-1\\/2){top:50%}#fbjs :is(.sm\\:top-3){top:.75em}#fbjs :is(.sm\\:m-4){margin:1em}#fbjs :is(.sm\\:max-w-sm){max-width:24em}#fbjs :is(.sm\\:-translate-x-1\\/2){--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#fbjs :is(.sm\\:-translate-y-1\\/2){--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#fbjs :is(.sm\\:transform){transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#fbjs :is(.sm\\:text-sm){font-size:.875em;line-height:1.25em}}.fb-editor-text-bold{font-weight:700!important}.fb-editor-text-italic{font-style:italic!important}.fb-editor-link{color:#334155!important;text-decoration:underline!important}.editor-tokenFunction{color:#dd4a68!important}.fb-editor-paragraph{margin:0!important;position:relative!important;color:#334155!important}.fb-editor-paragraph:last-child{margin-bottom:0!important}.fb-editor-heading-h1{font-size:25px!important;font-weight:400!important;margin-bottom:20px!important;font-weight:700!important}.fb-editor-heading-h2{font-size:20px!important;font-weight:700!important;margin-bottom:20px!important}.fb-editor-list-ul,.fb-editor-list-ol{margin-bottom:12px!important}.fb-editor-listitem{margin:0 32px!important}.fb-editor-nested-listitem{list-style-type:none!important}',document.head.appendChild(e)}},n5=e=>{let{brandColor:t}=e;if(null===document.getElementById("formbricks__css"))return;let r=document.createElement("style");r.id="formbricks__css__custom",r.innerHTML="\n    :root {\n      --fb-brand-color: ".concat(t,";\n      ").concat(!function(e){let t,r,n;if(4===e.length?(t=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),n=parseInt(e[3]+e[3],16)):7===e.length&&(t=parseInt(e[1]+e[2],16),r=parseInt(e[3]+e[4],16),n=parseInt(e[5]+e[6],16)),void 0===t||void 0===r||void 0===n)throw Error("Invalid color");return .299*t+.587*r+.114*n>128}(t)?"--fb-brand-text-color: white;":"--fb-brand-text-color: black;","\n    }\n  "),document.head.appendChild(r)},n6=e=>{n4(),n5({brandColor:e.brandColor});let t=document.getElementById(e.containerId);if(!t)throw Error("renderSurvey: Element with id ".concat(e.containerId," not found."));V(N(n1,e),t)};window.formbricksSurveys={renderSurveyInline:n6,renderSurveyModal:e=>{n4(),n5({brandColor:e.brandColor});let t=document.createElement("div");t.id="formbricks-modal-container",document.body.appendChild(t),V(N(n3,e),t)}};let n8=()=>"formbricks-survey-container",n7=e=>{let t=(0,y.useMemo)(()=>n8(),[]);return(0,y.useEffect)(()=>{n6({...e,containerId:t})},[t,e]),(0,_.jsx)("div",{id:t,className:"h-full w-full"})}}}]);