@sprig-technologies/sprig-browser 2.21.5 → 2.21.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Mo=Object.defineProperty;var No=(e,t,n)=>t in e?Mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ie=(e,t,n)=>(No(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var ce=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.PageChange="page.change",e.API="api",e.Override="override",e))(ce||{}),D=(e=>(e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyClosed="survey.closed",e.SurveyDimensions="survey.dimensions",e.SurveyFadingOut="survey.fadingOut",e.SurveyHeight="survey.height",e.SurveyPresented="survey.presented",e.SurveyLifeCycle="survey.lifeCycle",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e))(D||{}),er=(e=>(e.SurveyId="survey.id",e))(er||{});const Jt={SDK_READY:"sdk.ready",SURVEY_APPEARED:"survey.appeared",SURVEY_CLOSED:"survey.closed",SURVEY_DIMENSIONS:"survey.dimensions",SURVEY_FADING_OUT:"survey.fadingOut",SURVEY_HEIGHT:"survey.height",SURVEY_PRESENTED:"survey.presented",SURVEY_LIFE_CYCLE:"survey.lifeCycle",SURVEY_WILL_CLOSE:"survey.willClose",SURVEY_WILL_PRESENT:"survey.will.present",CLOSE_SURVEY_ON_OVERLAY_CLICK:"close.survey.overlayClick",VISITOR_ID_UPDATED:"visitor.id.updated",DATA:{DISMISS_REASONS:{API:"api",CLOSED:"close.click",COMPLETE:"survey.completed",PAGE_CHANGE:"page.change",OVERRIDE:"override"},SURVEY_ID:"survey.id"}};var X=(e=>(e.VerifyViewVersion="verify.view.version",e.CurrentQuestion="survey.question",e.ViewPrototypeClick="question.prototype.click",e.ViewAgreementClick="question.agreement.click",e.RecordedTaskStart="recorded.task.start",e.RecordedTaskPermissionScreen="recorded.task.permission.screen",e.SurveyComplete="survey.complete",e))(X||{}),Ie=(e=>(e.ViewVersion="view.version",e.QuestionId="qid",e.Props="props",e))(Ie||{});let at;const Vo=new Uint8Array(16);function Ho(){if(!at&&(at=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!at))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return at(Vo)}const W=[];for(let e=0;e<256;++e)W.push((e+256).toString(16).slice(1));function $o(e,t=0){return(W[e[t+0]]+W[e[t+1]]+W[e[t+2]]+W[e[t+3]]+"-"+W[e[t+4]]+W[e[t+5]]+"-"+W[e[t+6]]+W[e[t+7]]+"-"+W[e[t+8]]+W[e[t+9]]+"-"+W[e[t+10]]+W[e[t+11]]+W[e[t+12]]+W[e[t+13]]+W[e[t+14]]+W[e[t+15]]).toLowerCase()}const Bo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gn={randomUUID:Bo};function vt(e,t,n){if(gn.randomUUID&&!t&&!e)return gn.randomUUID();e=e||{};const r=e.random||(e.rng||Ho)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return $o(r)}const De="ul-app";var b=(e=>(e.Caption="ul-caption",e.CardContainer="ul-card__container",e.CardMainContent="ul-card-main-content",e.Choice="choice",e.ChoiceCheckbox="select-checkbox",e.ChoiceGroup="ul-card__choices",e.ChoiceLabel="select-label",e.ChoiceLabelContainer="choice-label-container",e.ChoiceRadio="select-radio",e.ChoiceTextEntryContainer="choice-text-entry-container",e.ChoiceTextInput="choice-text-input",e.CloseButton="close-btn",e.CloseContainer="close-container",e.ConsentLegalNameInput="ul-consent-legal__name-input",e.CustomStyle="ul-custom-style",e.DesktopSuffix="--desktop",e.FadeInTransition="fade-in-transition",e.LikertNumber="likert-number",e.LikertSmiley="likert-smiley",e.LikertStar="likert-star",e.LoadingSpinner="ul-loading-spinner",e.LoadingSpinnerContainer="ul-loading-spinner-container",e.LoadingSpinnerFirst="first",e.LoadingSpinnerFourth="fourth",e.LoadingSpinnerSecond="second",e.LoadingSpinnerThird="third",e.MobileSuffix="--mobile",e.NPSNumber="nps-number",e.OpenTextInput="ul-card-text__input",e.QuestionHeader="ul-question",e.VideoCard="ul-card--video",e.CheckmarkButton="ul-button-checkmark",e.InactiveButton="ul-button-inactive",e.LeftAlignButton="ul-button-left-align",e.ButtonDisabled="sprig-button-disabled",e))(b||{});const Xt="#e6e6e6",Ye="#bd282a",Fo=500,zo=1030,tr=()=>{try{return window.parent.Intercom}catch(e){return console.error(e),null}},qo=()=>{const e=tr();!e||(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)},Wo=()=>{const e=tr();!e||(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},Go=Object.freeze(Object.defineProperty({__proto__:null,enable:qo,disable:Wo},Symbol.toStringTag,{value:"Module"})),vn=[Go];class Bt{static disable(){vn.forEach(t=>t.disable())}static enable(){vn.forEach(t=>t.enable())}}const Zo=1,Ne=e=>e instanceof HTMLElement,Yo=e=>e instanceof HTMLInputElement,Qe=e=>e instanceof HTMLTextAreaElement,nr=(e,t,n)=>{const r=e.createElement("style");n&&(r.nonce=n),r.textContent=t,r.id=b.CustomStyle,e.head.appendChild(r)},rr=e=>{const t=e.querySelector(`.${b.CardContainer}`),n=t?t.scrollHeight:600,r=t&&t.parentElement?t.parentElement.clientHeight-t.clientHeight:0;return n+r+Zo},Qo=e=>{const t=e.querySelector(`.${b.CardContainer}`);t&&(t.scrollTop=0)};var lt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jo(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var or={},St={},rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.MemoryLeakError=void 0;class Xo extends Error{constructor(t,n,r){super(`Possible EventEmitter memory leak detected. ${r} ${n.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=t,this.type=n,this.count=r,this.name="MaxListenersExceededWarning"}}rt.MemoryLeakError=Xo;Object.defineProperty(St,"__esModule",{value:!0});St.Emitter=void 0;const ei=rt;class Et{constructor(){this.events=new Map,this.maxListeners=Et.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1}static listenerCount(t,n){return t.listenerCount(n)}_emitInternalEvent(t,n,r){this.emit(t,n,r)}_getListeners(t){return this.events.get(t)||[]}_removeListener(t,n){const r=t.indexOf(n);return r>-1&&t.splice(r,1),[]}_wrapOnceListener(t,n){const r=(...o)=>{this.removeListener(t,r),n.apply(this,o)};return r}setMaxListeners(t){return this.maxListeners=t,this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(t,...n){const r=this._getListeners(t);return r.forEach(o=>{o.apply(this,n)}),r.length>0}addListener(t,n){this._emitInternalEvent("newListener",t,n);const r=this._getListeners(t).concat(n);if(this.events.set(t,r),this.maxListeners>0&&this.listenerCount(t)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=!0;const o=new ei.MemoryLeakError(this,t,this.listenerCount(t));console.warn(o)}return this}on(t,n){return this.addListener(t,n)}once(t,n){return this.addListener(t,this._wrapOnceListener(t,n))}prependListener(t,n){const r=this._getListeners(t);if(r.length>0){const o=[n].concat(r);this.events.set(t,o)}else this.events.set(t,r.concat(n));return this}prependOnceListener(t,n){return this.prependListener(t,this._wrapOnceListener(t,n))}removeListener(t,n){const r=this._getListeners(t);return r.length>0&&(this._removeListener(r,n),this.events.set(t,r),this._emitInternalEvent("removeListener",t,n)),this}off(t,n){return this.removeListener(t,n)}removeAllListeners(t){return t?this.events.delete(t):this.events.clear(),this}listeners(t){return Array.from(this._getListeners(t))}listenerCount(t){return this._getListeners(t).length}rawListeners(t){return this.listeners(t)}}St.Emitter=Et;Et.defaultMaxListeners=10;(function(e){var t=lt&&lt.__createBinding||(Object.create?function(r,o,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(o,i);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[i]}}),Object.defineProperty(r,a,s)}:function(r,o,i,a){a===void 0&&(a=i),r[a]=o[i]}),n=lt&&lt.__exportStar||function(r,o){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&t(o,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(St,e),n(rt,e)})(or);const V=new or.Emitter;var Ze=(e=>(e.BottomLeft="bottomLeft",e.BottomRight="bottomRight",e.Center="center",e.TopLeft="topLeft",e.TopRight="topRight",e))(Ze||{}),ae=(e=>(e.Error="x-ul-error",e.EnvironmentID="x-ul-environment-id",e.InstallationMethod="x-ul-installation-method",e.PartnerAnonymousId="x-ul-anonymous-id",e.Platform="userleap-platform",e.PreviewMode="x-ul-preview-mode",e.UserID="x-ul-user-id",e.VisitorID="x-ul-visitor-id",e))(ae||{}),je=(e=>(e.Email="email",e.Link="link",e.Web="web",e))(je||{}),xe=(e=>(e.Npm="web-npm",e.Gtm="web-gtm",e.Segment="web-segment",e.SegmentAndroid="android-segment",e.SegmentReactNative="react-native-segment",e.SegmentIOS="ios-segment",e.Snippet="web-snippet",e))(xe||{});const _t=e=>new Promise(t=>{setTimeout(()=>{t()},e)}),Me=({"userleap-platform":e})=>e!==je.Web,z=(e,t)=>{const n=t?b.MobileSuffix:b.DesktopSuffix;return[e+n,e]},ue=(e,t)=>[e,`${e}__${t}`];class ti{constructor(t){ie(this,"payload");ie(this,"promise");ie(this,"reject",()=>{});ie(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((n,r)=>{this.reject=r,this.resolve=n})}resolveRequest(t){this.resolve(t)}}const ni={RATELIMIT_RESET_DEFAULT:10};let ir=!1,sr="",ct=!1,dt=[];const ri=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?xe.Gtm:e._segment?xe.Segment:xe.Snippet,Ft=(e="")=>{ir=!0,sr=e};function ot(e={}){const t={"Content-Type":"application/json","userleap-platform":je.Web,"x-ul-sdk-version":"2.21.5",[ae.InstallationMethod]:ri(e)};if(e.envId&&(t[ae.EnvironmentID]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t[ae.UserID]=e.userId),e.visitorId&&(t[ae.VisitorID]=e.visitorId),e.partnerAnonymousId&&(t[ae.PartnerAnonymousId]=e.partnerAnonymousId),e.mobileHeadersJSON){const n=JSON.parse(e.mobileHeadersJSON);Object.assign(t,n)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t[ae.PreviewMode]="1"),t}const _n=async(e,t,n)=>{if(e)return{status:429};{const r=new ti(n);return dt.push(r),r.promise}},ge=async(e,t,n=0,r=!1,o=!1)=>{const i={url:e,options:t,attempt:n,shouldDropOnRateLimit:r};if(ct&&!o)return _n(r,o,i);const a={ok:!1,reportError:!1};if(ir)return console.info(`UserLeap - ${sr}`),a;try{t.headers=Object.assign(ot(),t.headers);const s=await fetch(e,t);if(s.status===429)if(!ct&&!r||o){ct=!0;const d=s.headers.has("ratelimit-reset")?Number(s.headers.get("ratelimit-reset")):ni.RATELIMIT_RESET_DEFAULT;return await _t(d*1e3),ge(e,t,0,r,!0)}else return _n(r,!1,i);if(ct=!1,dt.length&&(dt.map(c=>{const{url:d,options:l,attempt:h,shouldDropOnRateLimit:p}=c.payload;ge(d,l,h,p).then(f=>{c.resolveRequest(f)})}),dt=[]),s.ok){if(s.status===249)return Ft(),a;const c=await s.text();try{return c&&c!=="OK"&&(s.json=JSON.parse(c)),s}catch{return{ok:!1,reportError:!1,error:new Error(`failed parsing response json for ${e} - ${c}`)}}}return s}catch(s){const c=n+1;return c>5?{ok:!1,reportError:!1,error:s}:(await _t(Math.pow(2,n)*1e3),ge(e,t,c))}};var it,S,ar,Ve,Le,wn,lr,cr,wt={},dr=[],oi=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function he(e,t){for(var n in t)e[n]=t[n];return e}function ur(e){var t=e.parentNode;t&&t.removeChild(e)}function F(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?it.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Ke(e,a,r,o,null)}function Ke(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o==null?++ar:o};return o==null&&S.vnode!=null&&S.vnode(i),i}function pr(){return{current:null}}function oe(e){return e.children}function ii(e,t,n,r,o){var i;for(i in n)i==="children"||i==="key"||i in t||yt(e,i,null,n[i],r);for(i in t)o&&typeof t[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||n[i]===t[i]||yt(e,i,t[i],n[i],r)}function yn(e,t,n){t[0]==="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||oi.test(t)?n:n+"px"}function yt(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||yn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||yn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?xn:bn,i):e.removeEventListener(t,i?xn:bn,i);else if(t!=="dangerouslySetInnerHTML"){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t.indexOf("-")==-1?e.removeAttribute(t):e.setAttribute(t,n))}}function bn(e){Ve=!0;try{return this.l[e.type+!1](S.event?S.event(e):e)}finally{Ve=!1}}function xn(e){Ve=!0;try{return this.l[e.type+!0](S.event?S.event(e):e)}finally{Ve=!1}}function ne(e,t){this.props=e,this.context=t}function Xe(e,t){if(t==null)return e.__?Xe(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Xe(e):null}function fr(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return fr(e)}}function si(e){Ve?setTimeout(e):lr(e)}function zt(e){(!e.__d&&(e.__d=!0)&&Le.push(e)&&!bt.__r++||wn!==S.debounceRendering)&&((wn=S.debounceRendering)||si)(bt)}function bt(){var e,t,n,r,o,i,a,s;for(Le.sort(function(c,d){return c.__v.__b-d.__v.__b});e=Le.shift();)e.__d&&(t=Le.length,r=void 0,o=void 0,a=(i=(n=e).__v).__e,(s=n.__P)&&(r=[],(o=he({},i)).__v=i.__v+1,en(s,i,o,n.__n,s.ownerSVGElement!==void 0,i.__h!=null?[a]:null,r,a==null?Xe(i):a,i.__h),_r(r,i),i.__e!=a&&fr(i)),Le.length>t&&Le.sort(function(c,d){return c.__v.__b-d.__v.__b}));bt.__r=0}function mr(e,t,n,r,o,i,a,s,c,d){var l,h,p,f,m,g,v,_=r&&r.__k||dr,y=_.length;for(n.__k=[],l=0;l<t.length;l++)if((f=n.__k[l]=(f=t[l])==null||typeof f=="boolean"?null:typeof f=="string"||typeof f=="number"||typeof f=="bigint"?Ke(null,f,null,null,f):Array.isArray(f)?Ke(oe,{children:f},null,null,null):f.__b>0?Ke(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)!=null){if(f.__=n,f.__b=n.__b+1,(p=_[l])===null||p&&f.key==p.key&&f.type===p.type)_[l]=void 0;else for(h=0;h<y;h++){if((p=_[h])&&f.key==p.key&&f.type===p.type){_[h]=void 0;break}p=null}en(e,f,p=p||wt,o,i,a,s,c,d),m=f.__e,(h=f.ref)&&p.ref!=h&&(v||(v=[]),p.ref&&v.push(p.ref,null,f),v.push(h,f.__c||m,f)),m!=null?(g==null&&(g=m),typeof f.type=="function"&&f.__k===p.__k?f.__d=c=hr(f,c,e):c=gr(e,f,p,_,m,c),typeof n.type=="function"&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=e&&(c=Xe(p))}for(n.__e=g,l=y;l--;)_[l]!=null&&(typeof n.type=="function"&&_[l].__e!=null&&_[l].__e==n.__d&&(n.__d=vr(r).nextSibling),yr(_[l],_[l]));if(v)for(l=0;l<v.length;l++)wr(v[l],v[++l],v[++l])}function hr(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t=typeof r.type=="function"?hr(r,t,n):gr(n,r,r,o,r.__e,t));return t}function ve(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(n){ve(n,t)}):t.push(e)),t}function gr(e,t,n,r,o,i){var a,s,c;if(t.__d!==void 0)a=t.__d,t.__d=void 0;else if(n==null||o!=i||o.parentNode==null)e:if(i==null||i.parentNode!==e)e.appendChild(o),a=null;else{for(s=i,c=0;(s=s.nextSibling)&&c<r.length;c+=1)if(s==o)break e;e.insertBefore(o,i),a=i}return a!==void 0?a:o.nextSibling}function vr(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=vr(n)))return r}return null}function en(e,t,n,r,o,i,a,s,c){var d,l,h,p,f,m,g,v,_,y,R,x,U,M,C,T=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,s=t.__e=n.__e,t.__h=null,i=[s]),(d=S.__b)&&d(t);try{e:if(typeof T=="function"){if(v=t.props,_=(d=T.contextType)&&r[d.__c],y=d?_?_.props.value:d.__:r,n.__c?g=(l=t.__c=n.__c).__=l.__E:("prototype"in T&&T.prototype.render?t.__c=l=new T(v,y):(t.__c=l=new ne(v,y),l.constructor=T,l.render=li),_&&_.sub(l),l.props=v,l.state||(l.state={}),l.context=y,l.__n=r,h=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),T.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=he({},l.__s)),he(l.__s,T.getDerivedStateFromProps(v,l.__s))),p=l.props,f=l.state,l.__v=t,h)T.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(T.getDerivedStateFromProps==null&&v!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(v,y),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(v,l.__s,y)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(l.props=v,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(P){P&&(P.__=t)}),R=0;R<l._sb.length;R++)l.__h.push(l._sb[R]);l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(v,l.__s,y),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,f,m)})}if(l.context=y,l.props=v,l.__P=e,x=S.__r,U=0,"prototype"in T&&T.prototype.render){for(l.state=l.__s,l.__d=!1,x&&x(t),d=l.render(l.props,l.state,l.context),M=0;M<l._sb.length;M++)l.__h.push(l._sb[M]);l._sb=[]}else do l.__d=!1,x&&x(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++U<25);l.state=l.__s,l.getChildContext!=null&&(r=he(he({},r),l.getChildContext())),h||l.getSnapshotBeforeUpdate==null||(m=l.getSnapshotBeforeUpdate(p,f)),C=d!=null&&d.type===oe&&d.key==null?d.props.children:d,mr(e,Array.isArray(C)?C:[C],t,n,r,o,i,a,s,c),l.base=t.__e,t.__h=null,l.__h.length&&a.push(l),g&&(l.__E=l.__=null),l.__e=!1}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ai(n.__e,t,n,r,o,i,a,c);(d=S.diffed)&&d(t)}catch(P){t.__v=null,(c||i!=null)&&(t.__e=s,t.__h=!!c,i[i.indexOf(s)]=null),S.__e(P,t,n)}}function _r(e,t){S.__c&&S.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){S.__e(r,n.__v)}})}function ai(e,t,n,r,o,i,a,s){var c,d,l,h=n.props,p=t.props,f=t.type,m=0;if(f==="svg"&&(o=!0),i!=null){for(;m<i.length;m++)if((c=i[m])&&"setAttribute"in c==!!f&&(f?c.localName===f:c.nodeType===3)){e=c,i[m]=null;break}}if(e==null){if(f===null)return document.createTextNode(p);e=o?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),i=null,s=!1}if(f===null)h===p||s&&e.data===p||(e.data=p);else{if(i=i&&it.call(e.childNodes),d=(h=n.props||wt).dangerouslySetInnerHTML,l=p.dangerouslySetInnerHTML,!s){if(i!=null)for(h={},m=0;m<e.attributes.length;m++)h[e.attributes[m].name]=e.attributes[m].value;(l||d)&&(l&&(d&&l.__html==d.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(ii(e,p,h,o,s),l)t.__k=[];else if(m=t.props.children,mr(e,Array.isArray(m)?m:[m],t,n,r,o&&f!=="foreignObject",i,a,i?i[0]:n.__k&&Xe(n,0),s),i!=null)for(m=i.length;m--;)i[m]!=null&&ur(i[m]);s||("value"in p&&(m=p.value)!==void 0&&(m!==e.value||f==="progress"&&!m||f==="option"&&m!==h.value)&&yt(e,"value",m,h.value,!1),"checked"in p&&(m=p.checked)!==void 0&&m!==e.checked&&yt(e,"checked",m,h.checked,!1))}return e}function wr(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){S.__e(r,n)}}function yr(e,t,n){var r,o;if(S.unmount&&S.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||wr(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){S.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&yr(r[o],t,n||typeof e.type!="function");n||e.__e==null||ur(e.__e),e.__=e.__e=e.__d=void 0}function li(e,t,n){return this.constructor(e,n)}function He(e,t,n){var r,o,i;S.__&&S.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],en(t,e=(!r&&n||t).__k=F(oe,null,[e]),o||wt,wt,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?it.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r),_r(i,e)}function br(e,t){He(e,t,br)}function ci(e,t,n){var r,o,i,a=he({},e.props);for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];return arguments.length>2&&(a.children=arguments.length>3?it.call(arguments,2):n),Ke(e.type,a,r||e.key,o||e.ref,null)}function xr(e,t){var n={__c:t="__cC"+cr++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&o.some(function(s){s.__e=!0,zt(s)})},this.sub=function(a){o.push(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){o.splice(o.indexOf(a),1),s&&s.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}it=dr.slice,S={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s}throw e}},ar=0,Ve=!1,ne.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=he({},this.state),typeof e=="function"&&(e=e(he({},n),this.props)),e&&he(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),zt(this))},ne.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),zt(this))},ne.prototype.render=oe,Le=[],lr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,bt.__r=0,cr=0;var E=(e=>(e.ConsentLegal="consentlegal",e.Likert="likert",e.MultipleChoice="multiplechoice",e.MultipleSelect="multipleselect",e.NPS="nps",e.Open="open",e.RecordedTask="recordedtask",e.TextUrlPrompt="texturlprompt",e.Thanks="thanks",e.Uploading="uploading",e.VideoVoice="videovoice",e))(E||{}),Pe=(e=>(e.Answered="answered",e.Equal="eq",e.NotEqual="neq",e.Skipped="skipped",e.LessThan="lt",e.LessThanOrEqual="lte",e.GivenUp="given_up",e.GreaterThan="gt",e.GreaterThanOrEqual="gte",e.ListAll="list_all",e.ListAtLeastOne="list_alo",e.ListExact="list_exact",e))(Pe||{}),$e=(e=>(e.Camera="camera",e.Microphone="microphone",e.Screen="screen",e))($e||{}),J=(e=>(e.AvPermission="av_permission",e.ScreenPermission="screen_permission",e.StartTask="start_task",e.CompleteTask="complete_task",e))(J||{}),Te=(e=>(e.Number="number",e.Smiley="smiley",e.Star="star",e))(Te||{}),fe=(e=>(e.Video="video",e.Audio="audio",e.Screen="screen",e))(fe||{}),G=(e=>(e.PermissionStatus="permission.status",e.AvPermission="av.permission",e.ScreenPermission="screen.permission",e.BeginRecording="begin.recording",e.StartTask="start.task",e.FinishTask="finish.task",e))(G||{}),Y=(e=>(e.Abandoned="abandoned",e.GivenUp="given.up",e.Completed="completed",e))(Y||{}),A=(e=>(e.PermissionDescriptors="permission.descriptors",e.PermissionStatusCallback="permission.status.callback",e.StreamReadyCallback="stream.ready.callback",e.StreamCanceledCallback="stream.canceled.callback",e.TaskCompleteCallback="task.complete.callback",e.TaskResponse="task.response",e.TaskStatus="task.status",e.RecordingMediaTypes="recording.media.types",e.StartRecordingCallback="start.recording.callback",e.PassthroughData="passthrough.data",e.CurrentIndex="current.index",e.UploadCallback="upload.callback",e.ProgressCallback="progress.callback",e.BeginCallback="begin.callback",e))(A||{});const Cn=e=>{let t;const n=new Set,r=(c,d)=>{const l=typeof c=="function"?c(t):c;if(!Object.is(l,t)){const h=t;t=(d!=null?d:typeof l!="object")?l:Object.assign({},t,l),n.forEach(p=>p(t,h))}},o=()=>t,s={setState:r,getState:o,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return t=e(r,o,s),s},di=e=>e?Cn(e):Cn;var ke,H,Pt,kn,Be=0,Cr=[],ut=[],Sn=S.__b,En=S.__r,Ln=S.diffed,Un=S.__c,In=S.unmount;function Re(e,t){S.__h&&S.__h(H,e,Be||t),Be=0;var n=H.__H||(H.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:ut}),n.__[e]}function Z(e){return Be=1,tn(Ur,e)}function tn(e,t,n){var r=Re(ke++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ur(void 0,t),function(i){var a=r.__N?r.__N[0]:r.__[0],s=r.t(a,i);a!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=H,!H.u)){H.u=!0;var o=H.shouldComponentUpdate;H.shouldComponentUpdate=function(i,a,s){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(l){return l.__c});if(c.every(function(l){return!l.__N}))return!o||o.call(this,i,a,s);var d=!1;return c.forEach(function(l){if(l.__N){var h=l.__[0];l.__=l.__N,l.__N=void 0,h!==l.__[0]&&(d=!0)}}),!(!d&&r.__c.props===i)&&(!o||o.call(this,i,a,s))}}return r.__N||r.__}function re(e,t){var n=Re(ke++,3);!S.__s&&rn(n.__H,t)&&(n.__=e,n.i=t,H.__H.__h.push(n))}function st(e,t){var n=Re(ke++,4);!S.__s&&rn(n.__H,t)&&(n.__=e,n.i=t,H.__h.push(n))}function Ce(e){return Be=5,Lt(function(){return{current:e}},[])}function kr(e,t,n){Be=6,st(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Lt(e,t){var n=Re(ke++,7);return rn(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Sr(e,t){return Be=8,Lt(function(){return e},t)}function Er(e){var t=H.context[e.__c],n=Re(ke++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(H)),t.props.value):e.__}function nn(e,t){S.useDebugValue&&S.useDebugValue(t?t(e):e)}function ui(e){var t=Re(ke++,10),n=Z();return t.__=e,H.componentDidCatch||(H.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Lr(){var e=Re(ke++,11);if(!e.__){for(var t=H.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function pi(){for(var e;e=Cr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(pt),e.__H.__h.forEach(qt),e.__H.__h=[]}catch(t){e.__H.__h=[],S.__e(t,e.__v)}}S.__b=function(e){H=null,Sn&&Sn(e)},S.__r=function(e){En&&En(e),ke=0;var t=(H=e.__c).__H;t&&(Pt===H?(t.__h=[],H.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=ut,n.__N=n.i=void 0})):(t.__h.forEach(pt),t.__h.forEach(qt),t.__h=[])),Pt=H},S.diffed=function(e){Ln&&Ln(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Cr.push(t)!==1&&kn===S.requestAnimationFrame||((kn=S.requestAnimationFrame)||fi)(pi)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==ut&&(n.__=n.__V),n.i=void 0,n.__V=ut})),Pt=H=null},S.__c=function(e,t){t.some(function(n){try{n.__h.forEach(pt),n.__h=n.__h.filter(function(r){return!r.__||qt(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],S.__e(r,n.__v)}}),Un&&Un(e,t)},S.unmount=function(e){In&&In(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{pt(r)}catch(o){t=o}}),n.__H=void 0,t&&S.__e(t,n.__v))};var Tn=typeof requestAnimationFrame=="function";function fi(e){var t,n=function(){clearTimeout(r),Tn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Tn&&(t=requestAnimationFrame(n))}function pt(e){var t=H,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),H=t}function qt(e){var t=H;e.__c=e.__(),H=t}function rn(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ur(e,t){return typeof t=="function"?t(e):t}function Ir(e,t){for(var n in t)e[n]=t[n];return e}function Wt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function jt(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function xt(e){this.props=e}function Tr(e,t){function n(o){var i=this.props.ref,a=i==o.ref;return!a&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!a:Wt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,F(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(xt.prototype=new ne).isPureReactComponent=!0,xt.prototype.shouldComponentUpdate=function(e,t){return Wt(this.props,e)||Wt(this.state,t)};var Pn=S.__b;S.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Pn&&Pn(e)};var mi=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Pr(e){function t(n){var r=Ir({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=mi,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var jn=function(e,t){return e==null?null:ve(ve(e).map(t))},jr={map:jn,forEach:jn,count:function(e){return e?ve(e).length:0},only:function(e){var t=ve(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ve},hi=S.__e;S.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}hi(e,t,n,r)};var Rn=S.unmount;function Rr(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Ir({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Rr(r,t,n)})),e}function Or(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Or(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Je(){this.__u=0,this.t=null,this.__b=null}function Ar(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Dr(e){var t,n,r;function o(i){if(t||(t=e()).then(function(a){n=a.default||a},function(a){r=a}),r)throw r;if(!n)throw t;return F(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Ae(){this.u=null,this.o=null}S.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Rn&&Rn(e)},(Je.prototype=new ne).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=Ar(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var d=r.state.__a;r.__v.__k[0]=Or(d,d.__c.__P,d.__c.__O)}var l;for(r.setState({__a:r.__b=null});l=r.t.pop();)l.forceUpdate()}},c=t.__h===!0;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},Je.prototype.componentWillUnmount=function(){this.t=[]},Je.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Rr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&F(oe,null,e.fallback);return o&&(o.__h=null),[F(oe,null,t.__a?null:e.children),o]};var On=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function gi(e){return this.getChildContext=function(){return e.context},e.children}function vi(e){var t=this,n=e.i;t.componentWillUnmount=function(){He(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),He(F(gi,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Mr(e,t){var n=F(vi,{__v:e,i:t});return n.containerInfo=t,n}(Ae.prototype=new ne).__a=function(e){var t=this,n=Ar(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),On(t,e,r)):o()};n?n(i):i()}},Ae.prototype.render=function(e){this.u=null,this.o=new Map;var t=ve(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Ae.prototype.componentDidUpdate=Ae.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){On(e,n,t)})};var Nr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_i=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|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]/,wi=typeof document<"u",yi=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};function Vr(e,t,n){return t.__k==null&&(t.textContent=""),He(e,t),typeof n=="function"&&n(),e?e.__c:null}function Hr(e,t,n){return br(e,t),typeof n=="function"&&n(),e?e.__c:null}ne.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ne.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var An=S.event;function bi(){}function xi(){return this.cancelBubble}function Ci(){return this.defaultPrevented}S.event=function(e){return An&&(e=An(e)),e.persist=bi,e.isPropagationStopped=xi,e.isDefaultPrevented=Ci,e.nativeEvent=e};var $r,Dn={configurable:!0,get:function(){return this.class}},Mn=S.vnode;S.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){var o=t.indexOf("-")===-1;for(var i in r={},n){var a=n[i];wi&&i==="children"&&t==="noscript"||i==="value"&&"defaultValue"in n&&a==null||(i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&a===!0?a="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!yi(n.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&_i.test(i)?i=i.replace(/[A-Z0-9]/g,"-$&").toLowerCase():a===null&&(a=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),r[i]&&(i="oninputCapture")),r[i]=a)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=ve(n.children).forEach(function(s){s.props.selected=r.value.indexOf(s.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=ve(n.children).forEach(function(s){s.props.selected=r.multiple?r.defaultValue.indexOf(s.props.value)!=-1:r.defaultValue==s.props.value})),e.props=r,n.class!=n.className&&(Dn.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",Dn))}e.$$typeof=Nr,Mn&&Mn(e)};var Nn=S.__r;S.__r=function(e){Nn&&Nn(e),$r=e.__c};var Br={ReactCurrentDispatcher:{current:{readContext:function(e){return $r.__n[e.__c].props.value}}}},ki="17.0.2";function Fr(e){return F.bind(null,e)}function on(e){return!!e&&e.$$typeof===Nr}function zr(e){return on(e)?ci.apply(null,arguments):e}function qr(e){return!!e.__k&&(He(null,e),!0)}function Wr(e){return e&&(e.base||e.nodeType===1&&e)||null}var Gr=function(e,t){return e(t)},Zr=function(e,t){return e(t)},Yr=oe;function sn(e){e()}function Qr(e){return e}function Kr(){return[!1,sn]}var Jr=st;function Xr(e,t){var n=t(),r=Z({h:{__:n,v:t}}),o=r[0].h,i=r[1];return st(function(){o.__=n,o.v=t,jt(o.__,t())||i({h:o})},[e,n,t]),re(function(){return jt(o.__,o.v())||i({h:o}),e(function(){jt(o.__,o.v())||i({h:o})})},[e]),n}var Si={useState:Z,useId:Lr,useReducer:tn,useEffect:re,useLayoutEffect:st,useInsertionEffect:Jr,useTransition:Kr,useDeferredValue:Qr,useSyncExternalStore:Xr,startTransition:sn,useRef:Ce,useImperativeHandle:kr,useMemo:Lt,useCallback:Sr,useContext:Er,useDebugValue:nn,version:"17.0.2",Children:jr,render:Vr,hydrate:Hr,unmountComponentAtNode:qr,createPortal:Mr,createElement:F,createContext:xr,createFactory:Fr,cloneElement:zr,createRef:pr,Fragment:oe,isValidElement:on,findDOMNode:Wr,Component:ne,PureComponent:xt,memo:Tr,forwardRef:Pr,flushSync:Zr,unstable_batchedUpdates:Gr,StrictMode:Yr,Suspense:Je,SuspenseList:Ae,lazy:Dr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Br};const Ei=Object.freeze(Object.defineProperty({__proto__:null,Children:jr,PureComponent:xt,StrictMode:Yr,Suspense:Je,SuspenseList:Ae,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Br,cloneElement:zr,createFactory:Fr,createPortal:Mr,default:Si,findDOMNode:Wr,flushSync:Zr,forwardRef:Pr,hydrate:Hr,isValidElement:on,lazy:Dr,memo:Tr,render:Vr,startTransition:sn,unmountComponentAtNode:qr,unstable_batchedUpdates:Gr,useDeferredValue:Qr,useInsertionEffect:Jr,useSyncExternalStore:Xr,useTransition:Kr,version:ki,Component:ne,Fragment:oe,createContext:xr,createElement:F,createRef:pr,useCallback:Sr,useContext:Er,useDebugValue:nn,useEffect:re,useErrorBoundary:ui,useId:Lr,useImperativeHandle:kr,useLayoutEffect:st,useMemo:Lt,useReducer:tn,useRef:Ce,useState:Z},Symbol.toStringTag,{value:"Module"}));var eo={exports:{}},to={};const no=Jo(Ei);var ro={exports:{}},oo={};/**
1
+ "use strict";var No=Object.defineProperty;var Vo=(e,t,n)=>t in e?No(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var se=(e,t,n)=>(Vo(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var de=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.PageChange="page.change",e.API="api",e.Override="override",e))(de||{}),M=(e=>(e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyClosed="survey.closed",e.SurveyDimensions="survey.dimensions",e.SurveyFadingOut="survey.fadingOut",e.SurveyHeight="survey.height",e.SurveyPresented="survey.presented",e.SurveyLifeCycle="survey.lifeCycle",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e))(M||{}),tr=(e=>(e.SurveyId="survey.id",e))(tr||{});const Xt={SDK_READY:"sdk.ready",SURVEY_APPEARED:"survey.appeared",SURVEY_CLOSED:"survey.closed",SURVEY_DIMENSIONS:"survey.dimensions",SURVEY_FADING_OUT:"survey.fadingOut",SURVEY_HEIGHT:"survey.height",SURVEY_PRESENTED:"survey.presented",SURVEY_LIFE_CYCLE:"survey.lifeCycle",SURVEY_WILL_CLOSE:"survey.willClose",SURVEY_WILL_PRESENT:"survey.will.present",CLOSE_SURVEY_ON_OVERLAY_CLICK:"close.survey.overlayClick",VISITOR_ID_UPDATED:"visitor.id.updated",DATA:{DISMISS_REASONS:{API:"api",CLOSED:"close.click",COMPLETE:"survey.completed",PAGE_CHANGE:"page.change",OVERRIDE:"override"},SURVEY_ID:"survey.id"}};var ee=(e=>(e.VerifyViewVersion="verify.view.version",e.CurrentQuestion="survey.question",e.ViewPrototypeClick="question.prototype.click",e.ViewAgreementClick="question.agreement.click",e.RecordedTaskStart="recorded.task.start",e.RecordedTaskPermissionScreen="recorded.task.permission.screen",e.SurveyComplete="survey.complete",e))(ee||{}),Te=(e=>(e.ViewVersion="view.version",e.QuestionId="qid",e.Props="props",e))(Te||{});let st;const Ho=new Uint8Array(16);function $o(){if(!st&&(st=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!st))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return st(Ho)}const W=[];for(let e=0;e<256;++e)W.push((e+256).toString(16).slice(1));function Bo(e,t=0){return(W[e[t+0]]+W[e[t+1]]+W[e[t+2]]+W[e[t+3]]+"-"+W[e[t+4]]+W[e[t+5]]+"-"+W[e[t+6]]+W[e[t+7]]+"-"+W[e[t+8]]+W[e[t+9]]+"-"+W[e[t+10]]+W[e[t+11]]+W[e[t+12]]+W[e[t+13]]+W[e[t+14]]+W[e[t+15]]).toLowerCase()}const Fo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vn={randomUUID:Fo};function gt(e,t,n){if(vn.randomUUID&&!t&&!e)return vn.randomUUID();e=e||{};const r=e.random||(e.rng||$o)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return Bo(r)}const De="ul-app";var y=(e=>(e.Caption="ul-caption",e.CardContainer="ul-card__container",e.CardMainContent="ul-card-main-content",e.Choice="choice",e.ChoiceCheckbox="select-checkbox",e.ChoiceGroup="ul-card__choices",e.ChoiceLabel="select-label",e.ChoiceLabelContainer="choice-label-container",e.ChoiceRadio="select-radio",e.ChoiceTextEntryContainer="choice-text-entry-container",e.ChoiceTextInput="choice-text-input",e.CloseButton="close-btn",e.CloseContainer="close-container",e.ConsentLegalNameInput="ul-consent-legal__name-input",e.CustomStyle="ul-custom-style",e.DesktopSuffix="--desktop",e.FadeInTransition="fade-in-transition",e.LikertNumber="likert-number",e.LikertSmiley="likert-smiley",e.LikertStar="likert-star",e.LoadingSpinner="ul-loading-spinner",e.LoadingSpinnerContainer="ul-loading-spinner-container",e.LoadingSpinnerFirst="first",e.LoadingSpinnerFourth="fourth",e.LoadingSpinnerSecond="second",e.LoadingSpinnerThird="third",e.MobileSuffix="--mobile",e.NPSNumber="nps-number",e.OpenTextInput="ul-card-text__input",e.QuestionHeader="ul-question",e.VideoCard="ul-card--video",e.CheckmarkButton="ul-button-checkmark",e.InactiveButton="ul-button-inactive",e.LeftAlignButton="ul-button-left-align",e.ButtonDisabled="sprig-button-disabled",e))(y||{});const en="#e6e6e6",Ye="#bd282a",zo=500,qo=1030,nr=()=>{try{return window.parent.Intercom}catch(e){return console.error(e),null}},Wo=()=>{const e=nr();!e||(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)},Go=()=>{const e=nr();!e||(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},Zo=Object.freeze(Object.defineProperty({__proto__:null,enable:Wo,disable:Go},Symbol.toStringTag,{value:"Module"})),_n=[Zo];class Bt{static disable(){_n.forEach(t=>t.disable())}static enable(){_n.forEach(t=>t.enable())}}const Yo=1,Ne=e=>e instanceof HTMLElement,Qo=e=>e instanceof HTMLInputElement,Qe=e=>e instanceof HTMLTextAreaElement,rr=(e,t,n)=>{const r=e.createElement("style");n&&(r.nonce=n),r.textContent=t,r.id=y.CustomStyle,e.head.appendChild(r)},or=e=>{const t=e.querySelector(`.${y.CardContainer}`),n=t?t.scrollHeight:600,r=t&&t.parentElement?t.parentElement.clientHeight-t.clientHeight:0;return n+r+Yo},Ko=e=>{const t=e.querySelector(`.${y.CardContainer}`);t&&(t.scrollTop=0)};var at=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xo(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var ir={},kt={},nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.MemoryLeakError=void 0;class ei extends Error{constructor(t,n,r){super(`Possible EventEmitter memory leak detected. ${r} ${n.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=t,this.type=n,this.count=r,this.name="MaxListenersExceededWarning"}}nt.MemoryLeakError=ei;Object.defineProperty(kt,"__esModule",{value:!0});kt.Emitter=void 0;const ti=nt;class St{constructor(){this.events=new Map,this.maxListeners=St.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1}static listenerCount(t,n){return t.listenerCount(n)}_emitInternalEvent(t,n,r){this.emit(t,n,r)}_getListeners(t){return this.events.get(t)||[]}_removeListener(t,n){const r=t.indexOf(n);return r>-1&&t.splice(r,1),[]}_wrapOnceListener(t,n){const r=(...o)=>{this.removeListener(t,r),n.apply(this,o)};return r}setMaxListeners(t){return this.maxListeners=t,this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(t,...n){const r=this._getListeners(t);return r.forEach(o=>{o.apply(this,n)}),r.length>0}addListener(t,n){this._emitInternalEvent("newListener",t,n);const r=this._getListeners(t).concat(n);if(this.events.set(t,r),this.maxListeners>0&&this.listenerCount(t)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=!0;const o=new ti.MemoryLeakError(this,t,this.listenerCount(t));console.warn(o)}return this}on(t,n){return this.addListener(t,n)}once(t,n){return this.addListener(t,this._wrapOnceListener(t,n))}prependListener(t,n){const r=this._getListeners(t);if(r.length>0){const o=[n].concat(r);this.events.set(t,o)}else this.events.set(t,r.concat(n));return this}prependOnceListener(t,n){return this.prependListener(t,this._wrapOnceListener(t,n))}removeListener(t,n){const r=this._getListeners(t);return r.length>0&&(this._removeListener(r,n),this.events.set(t,r),this._emitInternalEvent("removeListener",t,n)),this}off(t,n){return this.removeListener(t,n)}removeAllListeners(t){return t?this.events.delete(t):this.events.clear(),this}listeners(t){return Array.from(this._getListeners(t))}listenerCount(t){return this._getListeners(t).length}rawListeners(t){return this.listeners(t)}}kt.Emitter=St;St.defaultMaxListeners=10;(function(e){var t=at&&at.__createBinding||(Object.create?function(r,o,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(o,i);(!a||("get"in a?!o.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return o[i]}}),Object.defineProperty(r,s,a)}:function(r,o,i,s){s===void 0&&(s=i),r[s]=o[i]}),n=at&&at.__exportStar||function(r,o){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&t(o,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(kt,e),n(nt,e)})(ir);const H=new ir.Emitter;var Ze=(e=>(e.BottomLeft="bottomLeft",e.BottomRight="bottomRight",e.Center="center",e.TopLeft="topLeft",e.TopRight="topRight",e))(Ze||{}),le=(e=>(e.Error="x-ul-error",e.EnvironmentID="x-ul-environment-id",e.InstallationMethod="x-ul-installation-method",e.PartnerAnonymousId="x-ul-anonymous-id",e.Platform="userleap-platform",e.PreviewMode="x-ul-preview-mode",e.UserID="x-ul-user-id",e.VisitorID="x-ul-visitor-id",e))(le||{}),Re=(e=>(e.Email="email",e.Link="link",e.Web="web",e))(Re||{}),xe=(e=>(e.Npm="web-npm",e.Gtm="web-gtm",e.Segment="web-segment",e.SegmentAndroid="android-segment",e.SegmentReactNative="react-native-segment",e.SegmentIOS="ios-segment",e.Snippet="web-snippet",e))(xe||{});const vt=e=>new Promise(t=>{setTimeout(()=>{t()},e)}),Me=({"userleap-platform":e})=>e!==Re.Web,z=(e,t)=>{const n=t?y.MobileSuffix:y.DesktopSuffix;return[e+n,e]},pe=(e,t)=>[e,`${e}__${t}`];class ni{constructor(t){se(this,"payload");se(this,"promise");se(this,"reject",()=>{});se(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((n,r)=>{this.reject=r,this.resolve=n})}resolveRequest(t){this.resolve(t)}}const ri={RATELIMIT_RESET_DEFAULT:10};let sr=!1,ar="",lt=!1,ct=[];const oi=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?xe.Gtm:e._segment?xe.Segment:xe.Snippet,Ft=(e="")=>{sr=!0,ar=e};function rt(e={}){const t={"Content-Type":"application/json","userleap-platform":Re.Web,"x-ul-sdk-version":"2.21.7",[le.InstallationMethod]:oi(e)};if(e.envId&&(t[le.EnvironmentID]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t[le.UserID]=e.userId),e.visitorId&&(t[le.VisitorID]=e.visitorId),e.partnerAnonymousId&&(t[le.PartnerAnonymousId]=e.partnerAnonymousId),e.mobileHeadersJSON){const n=JSON.parse(e.mobileHeadersJSON);Object.assign(t,n)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t[le.PreviewMode]="1"),t}const wn=async(e,t,n)=>{if(e)return{status:429};{const r=new ni(n);return ct.push(r),r.promise}},ge=async(e,t,n=0,r=!1,o=!1)=>{const i={url:e,options:t,attempt:n,shouldDropOnRateLimit:r};if(lt&&!o)return wn(r,o,i);const s={ok:!1,reportError:!1};if(sr)return console.info(`UserLeap - ${ar}`),s;try{t.headers=Object.assign(rt(),t.headers);const a=await fetch(e,t);if(a.status===429)if(!lt&&!r||o){lt=!0;const d=a.headers.has("ratelimit-reset")?Number(a.headers.get("ratelimit-reset")):ri.RATELIMIT_RESET_DEFAULT;return await vt(d*1e3),ge(e,t,0,r,!0)}else return wn(r,!1,i);if(lt=!1,ct.length&&(ct.map(c=>{const{url:d,options:l,attempt:m,shouldDropOnRateLimit:p}=c.payload;ge(d,l,m,p).then(f=>{c.resolveRequest(f)})}),ct=[]),a.ok){if(a.status===249)return Ft(),s;const c=await a.text();try{return c&&c!=="OK"&&(a.json=JSON.parse(c)),a}catch{return{ok:!1,reportError:!1,error:new Error(`failed parsing response json for ${e} - ${c}`)}}}return a}catch(a){const c=n+1;return c>5?{ok:!1,reportError:!1,error:a}:(await vt(Math.pow(2,n)*1e3),ge(e,t,c))}};var ot,S,lr,Ve,Ue,yn,cr,dr,_t={},ur=[],ii=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function he(e,t){for(var n in t)e[n]=t[n];return e}function pr(e){var t=e.parentNode;t&&t.removeChild(e)}function F(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?ot.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Ke(e,s,r,o,null)}function Ke(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o==null?++lr:o};return o==null&&S.vnode!=null&&S.vnode(i),i}function fr(){return{current:null}}function ie(e){return e.children}function si(e,t,n,r,o){var i;for(i in n)i==="children"||i==="key"||i in t||wt(e,i,null,n[i],r);for(i in t)o&&typeof t[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||n[i]===t[i]||wt(e,i,t[i],n[i],r)}function bn(e,t,n){t[0]==="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||ii.test(t)?n:n+"px"}function wt(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||bn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||bn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?Cn:xn,i):e.removeEventListener(t,i?Cn:xn,i);else if(t!=="dangerouslySetInnerHTML"){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t.indexOf("-")==-1?e.removeAttribute(t):e.setAttribute(t,n))}}function xn(e){Ve=!0;try{return this.l[e.type+!1](S.event?S.event(e):e)}finally{Ve=!1}}function Cn(e){Ve=!0;try{return this.l[e.type+!0](S.event?S.event(e):e)}finally{Ve=!1}}function re(e,t){this.props=e,this.context=t}function Xe(e,t){if(t==null)return e.__?Xe(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Xe(e):null}function mr(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return mr(e)}}function ai(e){Ve?setTimeout(e):cr(e)}function zt(e){(!e.__d&&(e.__d=!0)&&Ue.push(e)&&!yt.__r++||yn!==S.debounceRendering)&&((yn=S.debounceRendering)||ai)(yt)}function yt(){var e,t,n,r,o,i,s,a;for(Ue.sort(function(c,d){return c.__v.__b-d.__v.__b});e=Ue.shift();)e.__d&&(t=Ue.length,r=void 0,o=void 0,s=(i=(n=e).__v).__e,(a=n.__P)&&(r=[],(o=he({},i)).__v=i.__v+1,tn(a,i,o,n.__n,a.ownerSVGElement!==void 0,i.__h!=null?[s]:null,r,s==null?Xe(i):s,i.__h),wr(r,i),i.__e!=s&&mr(i)),Ue.length>t&&Ue.sort(function(c,d){return c.__v.__b-d.__v.__b}));yt.__r=0}function hr(e,t,n,r,o,i,s,a,c,d){var l,m,p,f,h,g,v,w=r&&r.__k||ur,_=w.length;for(n.__k=[],l=0;l<t.length;l++)if((f=n.__k[l]=(f=t[l])==null||typeof f=="boolean"?null:typeof f=="string"||typeof f=="number"||typeof f=="bigint"?Ke(null,f,null,null,f):Array.isArray(f)?Ke(ie,{children:f},null,null,null):f.__b>0?Ke(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)!=null){if(f.__=n,f.__b=n.__b+1,(p=w[l])===null||p&&f.key==p.key&&f.type===p.type)w[l]=void 0;else for(m=0;m<_;m++){if((p=w[m])&&f.key==p.key&&f.type===p.type){w[m]=void 0;break}p=null}tn(e,f,p=p||_t,o,i,s,a,c,d),h=f.__e,(m=f.ref)&&p.ref!=m&&(v||(v=[]),p.ref&&v.push(p.ref,null,f),v.push(m,f.__c||h,f)),h!=null?(g==null&&(g=h),typeof f.type=="function"&&f.__k===p.__k?f.__d=c=gr(f,c,e):c=vr(e,f,p,w,h,c),typeof n.type=="function"&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=e&&(c=Xe(p))}for(n.__e=g,l=_;l--;)w[l]!=null&&(typeof n.type=="function"&&w[l].__e!=null&&w[l].__e==n.__d&&(n.__d=_r(r).nextSibling),br(w[l],w[l]));if(v)for(l=0;l<v.length;l++)yr(v[l],v[++l],v[++l])}function gr(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t=typeof r.type=="function"?gr(r,t,n):vr(n,r,r,o,r.__e,t));return t}function ve(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(n){ve(n,t)}):t.push(e)),t}function vr(e,t,n,r,o,i){var s,a,c;if(t.__d!==void 0)s=t.__d,t.__d=void 0;else if(n==null||o!=i||o.parentNode==null)e:if(i==null||i.parentNode!==e)e.appendChild(o),s=null;else{for(a=i,c=0;(a=a.nextSibling)&&c<r.length;c+=1)if(a==o)break e;e.insertBefore(o,i),s=i}return s!==void 0?s:o.nextSibling}function _r(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=_r(n)))return r}return null}function tn(e,t,n,r,o,i,s,a,c){var d,l,m,p,f,h,g,v,w,_,U,C,I,A,b,P=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=t.__e=n.__e,t.__h=null,i=[a]),(d=S.__b)&&d(t);try{e:if(typeof P=="function"){if(v=t.props,w=(d=P.contextType)&&r[d.__c],_=d?w?w.props.value:d.__:r,n.__c?g=(l=t.__c=n.__c).__=l.__E:("prototype"in P&&P.prototype.render?t.__c=l=new P(v,_):(t.__c=l=new re(v,_),l.constructor=P,l.render=ci),w&&w.sub(l),l.props=v,l.state||(l.state={}),l.context=_,l.__n=r,m=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),P.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=he({},l.__s)),he(l.__s,P.getDerivedStateFromProps(v,l.__s))),p=l.props,f=l.state,l.__v=t,m)P.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(P.getDerivedStateFromProps==null&&v!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(v,_),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(v,l.__s,_)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(l.props=v,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(j){j&&(j.__=t)}),U=0;U<l._sb.length;U++)l.__h.push(l._sb[U]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(v,l.__s,_),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,f,h)})}if(l.context=_,l.props=v,l.__P=e,C=S.__r,I=0,"prototype"in P&&P.prototype.render){for(l.state=l.__s,l.__d=!1,C&&C(t),d=l.render(l.props,l.state,l.context),A=0;A<l._sb.length;A++)l.__h.push(l._sb[A]);l._sb=[]}else do l.__d=!1,C&&C(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++I<25);l.state=l.__s,l.getChildContext!=null&&(r=he(he({},r),l.getChildContext())),m||l.getSnapshotBeforeUpdate==null||(h=l.getSnapshotBeforeUpdate(p,f)),b=d!=null&&d.type===ie&&d.key==null?d.props.children:d,hr(e,Array.isArray(b)?b:[b],t,n,r,o,i,s,a,c),l.base=t.__e,t.__h=null,l.__h.length&&s.push(l),g&&(l.__E=l.__=null),l.__e=!1}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=li(n.__e,t,n,r,o,i,s,c);(d=S.diffed)&&d(t)}catch(j){t.__v=null,(c||i!=null)&&(t.__e=a,t.__h=!!c,i[i.indexOf(a)]=null),S.__e(j,t,n)}}function wr(e,t){S.__c&&S.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){S.__e(r,n.__v)}})}function li(e,t,n,r,o,i,s,a){var c,d,l,m=n.props,p=t.props,f=t.type,h=0;if(f==="svg"&&(o=!0),i!=null){for(;h<i.length;h++)if((c=i[h])&&"setAttribute"in c==!!f&&(f?c.localName===f:c.nodeType===3)){e=c,i[h]=null;break}}if(e==null){if(f===null)return document.createTextNode(p);e=o?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),i=null,a=!1}if(f===null)m===p||a&&e.data===p||(e.data=p);else{if(i=i&&ot.call(e.childNodes),d=(m=n.props||_t).dangerouslySetInnerHTML,l=p.dangerouslySetInnerHTML,!a){if(i!=null)for(m={},h=0;h<e.attributes.length;h++)m[e.attributes[h].name]=e.attributes[h].value;(l||d)&&(l&&(d&&l.__html==d.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(si(e,p,m,o,a),l)t.__k=[];else if(h=t.props.children,hr(e,Array.isArray(h)?h:[h],t,n,r,o&&f!=="foreignObject",i,s,i?i[0]:n.__k&&Xe(n,0),a),i!=null)for(h=i.length;h--;)i[h]!=null&&pr(i[h]);a||("value"in p&&(h=p.value)!==void 0&&(h!==e.value||f==="progress"&&!h||f==="option"&&h!==m.value)&&wt(e,"value",h,m.value,!1),"checked"in p&&(h=p.checked)!==void 0&&h!==e.checked&&wt(e,"checked",h,m.checked,!1))}return e}function yr(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){S.__e(r,n)}}function br(e,t,n){var r,o;if(S.unmount&&S.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||yr(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){S.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&br(r[o],t,n||typeof e.type!="function");n||e.__e==null||pr(e.__e),e.__=e.__e=e.__d=void 0}function ci(e,t,n){return this.constructor(e,n)}function He(e,t,n){var r,o,i;S.__&&S.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],tn(t,e=(!r&&n||t).__k=F(ie,null,[e]),o||_t,_t,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?ot.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r),wr(i,e)}function xr(e,t){He(e,t,xr)}function di(e,t,n){var r,o,i,s=he({},e.props);for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];return arguments.length>2&&(s.children=arguments.length>3?ot.call(arguments,2):n),Ke(e.type,s,r||e.key,o||e.ref,null)}function Cr(e,t){var n={__c:t="__cC"+dr++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&o.some(function(a){a.__e=!0,zt(a)})},this.sub=function(s){o.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),a&&a.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}ot=ur.slice,S={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},lr=0,Ve=!1,re.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=he({},this.state),typeof e=="function"&&(e=e(he({},n),this.props)),e&&he(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),zt(this))},re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),zt(this))},re.prototype.render=ie,Ue=[],cr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yt.__r=0,dr=0;var L=(e=>(e.ConsentLegal="consentlegal",e.Likert="likert",e.MultipleChoice="multiplechoice",e.MultipleSelect="multipleselect",e.NPS="nps",e.Open="open",e.RecordedTask="recordedtask",e.TextUrlPrompt="texturlprompt",e.Thanks="thanks",e.Uploading="uploading",e.VideoVoice="videovoice",e))(L||{}),je=(e=>(e.Answered="answered",e.Equal="eq",e.NotEqual="neq",e.Skipped="skipped",e.LessThan="lt",e.LessThanOrEqual="lte",e.GivenUp="given_up",e.GreaterThan="gt",e.GreaterThanOrEqual="gte",e.ListAll="list_all",e.ListAtLeastOne="list_alo",e.ListExact="list_exact",e))(je||{}),$e=(e=>(e.Camera="camera",e.Microphone="microphone",e.Screen="screen",e))($e||{}),J=(e=>(e.AvPermission="av_permission",e.ScreenPermission="screen_permission",e.StartTask="start_task",e.CompleteTask="complete_task",e))(J||{}),Pe=(e=>(e.Number="number",e.Smiley="smiley",e.Star="star",e))(Pe||{}),ne=(e=>(e.Video="video",e.Audio="audio",e.Screen="screen",e))(ne||{}),Z=(e=>(e.PermissionStatus="permission.status",e.AvPermission="av.permission",e.ScreenPermission="screen.permission",e.BeginRecording="begin.recording",e.StartTask="start.task",e.FinishTask="finish.task",e))(Z||{}),oe=(e=>(e.Abandoned="abandoned",e.GivenUp="given.up",e.Completed="completed",e))(oe||{}),N=(e=>(e.ScreenPermissionRequested="screen.permission.requested",e.PermissionDescriptors="permission.descriptors",e.PermissionStatusCallback="permission.status.callback",e.StreamReadyCallback="stream.ready.callback",e.StreamCanceledCallback="stream.canceled.callback",e.TaskCompleteCallback="task.complete.callback",e.TaskResponse="task.response",e.TaskStatus="task.status",e.RecordingMediaTypes="recording.media.types",e.StartRecordingCallback="start.recording.callback",e.PassthroughData="passthrough.data",e.CurrentIndex="current.index",e.UploadCallback="upload.callback",e.ProgressCallback="progress.callback",e.BeginCallback="begin.callback",e))(N||{});const kn=e=>{let t;const n=new Set,r=(c,d)=>{const l=typeof c=="function"?c(t):c;if(!Object.is(l,t)){const m=t;t=(d!=null?d:typeof l!="object")?l:Object.assign({},t,l),n.forEach(p=>p(t,m))}},o=()=>t,a={setState:r,getState:o,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return t=e(r,o,a),a},ui=e=>e?kn(e):kn;var ke,$,Pt,Sn,Be=0,kr=[],dt=[],En=S.__b,Ln=S.__r,Un=S.diffed,In=S.__c,Tn=S.unmount;function Oe(e,t){S.__h&&S.__h($,e,Be||t),Be=0;var n=$.__H||($.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:dt}),n.__[e]}function G(e){return Be=1,nn(Ir,e)}function nn(e,t,n){var r=Oe(ke++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ir(void 0,t),function(i){var s=r.__N?r.__N[0]:r.__[0],a=r.t(s,i);s!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=$,!$.u)){$.u=!0;var o=$.shouldComponentUpdate;$.shouldComponentUpdate=function(i,s,a){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(l){return l.__c});if(c.every(function(l){return!l.__N}))return!o||o.call(this,i,s,a);var d=!1;return c.forEach(function(l){if(l.__N){var m=l.__[0];l.__=l.__N,l.__N=void 0,m!==l.__[0]&&(d=!0)}}),!(!d&&r.__c.props===i)&&(!o||o.call(this,i,s,a))}}return r.__N||r.__}function X(e,t){var n=Oe(ke++,3);!S.__s&&on(n.__H,t)&&(n.__=e,n.i=t,$.__H.__h.push(n))}function it(e,t){var n=Oe(ke++,4);!S.__s&&on(n.__H,t)&&(n.__=e,n.i=t,$.__h.push(n))}function Ce(e){return Be=5,Et(function(){return{current:e}},[])}function Sr(e,t,n){Be=6,it(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Et(e,t){var n=Oe(ke++,7);return on(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Er(e,t){return Be=8,Et(function(){return e},t)}function Lr(e){var t=$.context[e.__c],n=Oe(ke++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub($)),t.props.value):e.__}function rn(e,t){S.useDebugValue&&S.useDebugValue(t?t(e):e)}function pi(e){var t=Oe(ke++,10),n=G();return t.__=e,$.componentDidCatch||($.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Ur(){var e=Oe(ke++,11);if(!e.__){for(var t=$.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function fi(){for(var e;e=kr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ut),e.__H.__h.forEach(qt),e.__H.__h=[]}catch(t){e.__H.__h=[],S.__e(t,e.__v)}}S.__b=function(e){$=null,En&&En(e)},S.__r=function(e){Ln&&Ln(e),ke=0;var t=($=e.__c).__H;t&&(Pt===$?(t.__h=[],$.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=dt,n.__N=n.i=void 0})):(t.__h.forEach(ut),t.__h.forEach(qt),t.__h=[])),Pt=$},S.diffed=function(e){Un&&Un(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(kr.push(t)!==1&&Sn===S.requestAnimationFrame||((Sn=S.requestAnimationFrame)||mi)(fi)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==dt&&(n.__=n.__V),n.i=void 0,n.__V=dt})),Pt=$=null},S.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ut),n.__h=n.__h.filter(function(r){return!r.__||qt(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],S.__e(r,n.__v)}}),In&&In(e,t)},S.unmount=function(e){Tn&&Tn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ut(r)}catch(o){t=o}}),n.__H=void 0,t&&S.__e(t,n.__v))};var Pn=typeof requestAnimationFrame=="function";function mi(e){var t,n=function(){clearTimeout(r),Pn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Pn&&(t=requestAnimationFrame(n))}function ut(e){var t=$,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),$=t}function qt(e){var t=$;e.__c=e.__(),$=t}function on(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ir(e,t){return typeof t=="function"?t(e):t}function Tr(e,t){for(var n in t)e[n]=t[n];return e}function Wt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function jt(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function bt(e){this.props=e}function Pr(e,t){function n(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:Wt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,F(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(bt.prototype=new re).isPureReactComponent=!0,bt.prototype.shouldComponentUpdate=function(e,t){return Wt(this.props,e)||Wt(this.state,t)};var jn=S.__b;S.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),jn&&jn(e)};var hi=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function jr(e){function t(n){var r=Tr({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=hi,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Rn=function(e,t){return e==null?null:ve(ve(e).map(t))},Rr={map:Rn,forEach:Rn,count:function(e){return e?ve(e).length:0},only:function(e){var t=ve(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ve},gi=S.__e;S.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}gi(e,t,n,r)};var On=S.unmount;function Or(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Tr({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Or(r,t,n)})),e}function Ar(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Ar(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Je(){this.__u=0,this.t=null,this.__b=null}function Dr(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Mr(e){var t,n,r;function o(i){if(t||(t=e()).then(function(s){n=s.default||s},function(s){r=s}),r)throw r;if(!n)throw t;return F(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Ae(){this.u=null,this.o=null}S.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),On&&On(e)},(Je.prototype=new re).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=Dr(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var d=r.state.__a;r.__v.__k[0]=Ar(d,d.__c.__P,d.__c.__O)}var l;for(r.setState({__a:r.__b=null});l=r.t.pop();)l.forceUpdate()}},c=t.__h===!0;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Je.prototype.componentWillUnmount=function(){this.t=[]},Je.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Or(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&F(ie,null,e.fallback);return o&&(o.__h=null),[F(ie,null,t.__a?null:e.children),o]};var An=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function vi(e){return this.getChildContext=function(){return e.context},e.children}function _i(e){var t=this,n=e.i;t.componentWillUnmount=function(){He(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),He(F(vi,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Nr(e,t){var n=F(_i,{__v:e,i:t});return n.containerInfo=t,n}(Ae.prototype=new re).__a=function(e){var t=this,n=Dr(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),An(t,e,r)):o()};n?n(i):i()}},Ae.prototype.render=function(e){this.u=null,this.o=new Map;var t=ve(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Ae.prototype.componentDidUpdate=Ae.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){An(e,n,t)})};var Vr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,wi=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|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]/,yi=typeof document<"u",bi=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};function Hr(e,t,n){return t.__k==null&&(t.textContent=""),He(e,t),typeof n=="function"&&n(),e?e.__c:null}function $r(e,t,n){return xr(e,t),typeof n=="function"&&n(),e?e.__c:null}re.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(re.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Dn=S.event;function xi(){}function Ci(){return this.cancelBubble}function ki(){return this.defaultPrevented}S.event=function(e){return Dn&&(e=Dn(e)),e.persist=xi,e.isPropagationStopped=Ci,e.isDefaultPrevented=ki,e.nativeEvent=e};var Br,Mn={configurable:!0,get:function(){return this.class}},Nn=S.vnode;S.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){var o=t.indexOf("-")===-1;for(var i in r={},n){var s=n[i];yi&&i==="children"&&t==="noscript"||i==="value"&&"defaultValue"in n&&s==null||(i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!bi(n.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&wi.test(i)?i=i.replace(/[A-Z0-9]/g,"-$&").toLowerCase():s===null&&(s=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),r[i]&&(i="oninputCapture")),r[i]=s)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=ve(n.children).forEach(function(a){a.props.selected=r.value.indexOf(a.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=ve(n.children).forEach(function(a){a.props.selected=r.multiple?r.defaultValue.indexOf(a.props.value)!=-1:r.defaultValue==a.props.value})),e.props=r,n.class!=n.className&&(Mn.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",Mn))}e.$$typeof=Vr,Nn&&Nn(e)};var Vn=S.__r;S.__r=function(e){Vn&&Vn(e),Br=e.__c};var Fr={ReactCurrentDispatcher:{current:{readContext:function(e){return Br.__n[e.__c].props.value}}}},Si="17.0.2";function zr(e){return F.bind(null,e)}function sn(e){return!!e&&e.$$typeof===Vr}function qr(e){return sn(e)?di.apply(null,arguments):e}function Wr(e){return!!e.__k&&(He(null,e),!0)}function Gr(e){return e&&(e.base||e.nodeType===1&&e)||null}var Zr=function(e,t){return e(t)},Yr=function(e,t){return e(t)},Qr=ie;function an(e){e()}function Kr(e){return e}function Jr(){return[!1,an]}var Xr=it;function eo(e,t){var n=t(),r=G({h:{__:n,v:t}}),o=r[0].h,i=r[1];return it(function(){o.__=n,o.v=t,jt(o.__,t())||i({h:o})},[e,n,t]),X(function(){return jt(o.__,o.v())||i({h:o}),e(function(){jt(o.__,o.v())||i({h:o})})},[e]),n}var Ei={useState:G,useId:Ur,useReducer:nn,useEffect:X,useLayoutEffect:it,useInsertionEffect:Xr,useTransition:Jr,useDeferredValue:Kr,useSyncExternalStore:eo,startTransition:an,useRef:Ce,useImperativeHandle:Sr,useMemo:Et,useCallback:Er,useContext:Lr,useDebugValue:rn,version:"17.0.2",Children:Rr,render:Hr,hydrate:$r,unmountComponentAtNode:Wr,createPortal:Nr,createElement:F,createContext:Cr,createFactory:zr,cloneElement:qr,createRef:fr,Fragment:ie,isValidElement:sn,findDOMNode:Gr,Component:re,PureComponent:bt,memo:Pr,forwardRef:jr,flushSync:Yr,unstable_batchedUpdates:Zr,StrictMode:Qr,Suspense:Je,SuspenseList:Ae,lazy:Mr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Fr};const Li=Object.freeze(Object.defineProperty({__proto__:null,Children:Rr,PureComponent:bt,StrictMode:Qr,Suspense:Je,SuspenseList:Ae,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Fr,cloneElement:qr,createFactory:zr,createPortal:Nr,default:Ei,findDOMNode:Gr,flushSync:Yr,forwardRef:jr,hydrate:$r,isValidElement:sn,lazy:Mr,memo:Pr,render:Hr,startTransition:an,unmountComponentAtNode:Wr,unstable_batchedUpdates:Zr,useDeferredValue:Kr,useInsertionEffect:Xr,useSyncExternalStore:eo,useTransition:Jr,version:Si,Component:re,Fragment:ie,createContext:Cr,createElement:F,createRef:fr,useCallback:Er,useContext:Lr,useDebugValue:rn,useEffect:X,useErrorBoundary:pi,useId:Ur,useImperativeHandle:Sr,useLayoutEffect:it,useMemo:Et,useReducer:nn,useRef:Ce,useState:G},Symbol.toStringTag,{value:"Module"}));var to={exports:{}},no={};const ro=Xo(Li);var oo={exports:{}},io={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Fe=no;function Li(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ui=typeof Object.is=="function"?Object.is:Li,Ii=Fe.useState,Ti=Fe.useEffect,Pi=Fe.useLayoutEffect,ji=Fe.useDebugValue;function Ri(e,t){var n=t(),r=Ii({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Pi(function(){o.value=n,o.getSnapshot=t,Rt(o)&&i({inst:o})},[e,n,t]),Ti(function(){return Rt(o)&&i({inst:o}),e(function(){Rt(o)&&i({inst:o})})},[e]),ji(n),n}function Rt(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ui(e,n)}catch{return!0}}function Oi(e,t){return t()}var Ai=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Oi:Ri;oo.useSyncExternalStore=Fe.useSyncExternalStore!==void 0?Fe.useSyncExternalStore:Ai;(function(e){e.exports=oo})(ro);/**
9
+ */var Fe=ro;function Ui(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ii=typeof Object.is=="function"?Object.is:Ui,Ti=Fe.useState,Pi=Fe.useEffect,ji=Fe.useLayoutEffect,Ri=Fe.useDebugValue;function Oi(e,t){var n=t(),r=Ti({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return ji(function(){o.value=n,o.getSnapshot=t,Rt(o)&&i({inst:o})},[e,n,t]),Pi(function(){return Rt(o)&&i({inst:o}),e(function(){Rt(o)&&i({inst:o})})},[e]),Ri(n),n}function Rt(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ii(e,n)}catch{return!0}}function Ai(e,t){return t()}var Di=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ai:Oi;io.useSyncExternalStore=Fe.useSyncExternalStore!==void 0?Fe.useSyncExternalStore:Di;(function(e){e.exports=io})(oo);/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim/with-selector.production.min.js
12
12
  *
@@ -14,18 +14,18 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ut=no,Di=ro.exports;function Mi(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ni=typeof Object.is=="function"?Object.is:Mi,Vi=Di.useSyncExternalStore,Hi=Ut.useRef,$i=Ut.useEffect,Bi=Ut.useMemo,Fi=Ut.useDebugValue;to.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Hi(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Bi(function(){function c(f){if(!d){if(d=!0,l=f,f=r(f),o!==void 0&&a.hasValue){var m=a.value;if(o(m,f))return h=m}return h=f}if(m=h,Ni(l,f))return m;var g=r(f);return o!==void 0&&o(m,g)?m:(l=f,h=g)}var d=!1,l,h,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,o]);var s=Vi(e,i[0],i[1]);return $i(function(){a.hasValue=!0,a.value=s},[s]),Fi(s),s};(function(e){e.exports=to})(eo);const zi=Ko(eo.exports),{useSyncExternalStoreWithSelector:qi}=zi;function Wi(e,t=e.getState,n){const r=qi(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return nn(r),r}const Vn=e=>{const t=typeof e=="function"?di(e):e,n=(r,o)=>Wi(t,r,o);return Object.assign(n,t),n},io=e=>e?Vn(e):Vn,Ot=1,an={eq(e,t){return e==t},neq(e,t){return!this.eq(e,t)},gt(e,t){return e>t},gte(e,t){return e>=t},lt(e,t){return e<t},lte(e,t){return e<=t},list_exact(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:e.slice().sort().join(",")===t.slice().sort().join(",")},list_all(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:!t.some(n=>e.indexOf(n)===-1)},list_alo(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:t.some(n=>e.indexOf(n)!=-1)}},ln=(e,t,n)=>{switch(t){case E.VideoVoice:return Boolean(e&&e.value);case E.Open:return!!n;case E.MultipleSelect:return Boolean(n&&!!Object.keys(n).length);case E.RecordedTask:return(n==null?void 0:n.taskStatus)===Y.Completed;case E.TextUrlPrompt:return!e.value;case E.ConsentLegal:return n!==null;case E.MultipleChoice:return n!==void 0;case E.NPS:return n!==null;case E.Likert:return n!==null;default:return!0}},so=({cards:e,index:t,hasEndCard:n,selectedValue:r,hasValidAnswer:o=!0,uploadProgress:i={}})=>{if(t>=e.length||t<0)return null;const s=e[t].props.routingOptions||[];let c=null,d=null;for(let f=0;f<s.length;f++){const{comparator:m,target:g,value:v}=s[f];if(m===Pe.Answered&&o){c=g;break}else if(m===Pe.GivenUp&&r instanceof Object&&"taskStatus"in r&&(r==null?void 0:r.taskStatus)===Y.GivenUp){c=g;break}else if(m===Pe.Skipped&&!o&&!(r instanceof Object&&"taskStatus"in r&&(r==null?void 0:r.taskStatus)===Y.GivenUp)){c=g;break}else if(o&&ao(m)&&an[m](r,v)){c=g;break}}const l=c&&parseInt(String(c),10);c&&l!==null&&!isNaN(l)&&(l===-1||l>t)&&(d=l);const h=e.findIndex(f=>f.type===E.Uploading);let p;return h>0&&n?p=e.length-3:h>0||n?p=e.length-2:p=e.length-1,t>=p||d===-1||d!==null&&d>p?h>0&&Object.values(i).some(m=>m.isSubmitted&&!m.isComplete)?h:n?e.length-1:null:d!==null?d:t+1},Gi=13,Zi=(e,t)=>e.reduce((n,r)=>n.concat(n.map(o=>[...o,r])),[[]]).filter(n=>t||n.length>0),Yi=e=>{switch(e.type){case E.MultipleSelect:return!e||!e.props||!e.props.options?null:e.props.options.length>Gi?e.props.options.map(t=>[t.value]):Zi(e.props.options.map(t=>t.value),!e.props.properties.required);case E.MultipleChoice:{if(!e||!e.props||!e.props.options)return null;const t=e.props.options.map(n=>n.value);return e.props.properties.required||t.push(void 0),t}case E.Likert:return[1,2,3,4,5,...e.props.properties.required?[]:[null]];case E.NPS:return[0,1,2,3,4,5,6,7,8,9,10,...e.props.properties.required?[]:[null]];case E.VideoVoice:case E.Open:return[Ot,...e.props.properties.required?[]:[""]];case E.RecordedTask:return[{taskStatus:Y.Completed},{taskStatus:Y.GivenUp},...e.props.properties.required?[]:[{taskStatus:Y.Abandoned}]];case E.TextUrlPrompt:return[void 0,...e.props.properties.required?[]:[{skipped:!0}]];case E.ConsentLegal:return[Ot,...e.props.properties.required?[]:[null]];default:return[Ot]}},ao=e=>e in an,Qi=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,Ki=(e,t)=>{const n=new Set([E.Thanks,E.Uploading]);if(t>=e.length||t<0||n.has(e[t].type))return 0;const r=e.filter(i=>!n.has(i.type));if(t===r.length-1)return 1;const o={[r.length-1]:1,[-1]:0};for(let i=r.length-2;i>=t;i--){const a=r[i],s=a.props.routingOptions||[];if(s.length===0){o[i]=o[i+1]+1;continue}let c=0,d=Yi(a);if(d===null)return r.length-1-t;for(let l=0;l<s.length&&d.length!==0;l++){const{comparator:h,target:p,value:f}=s[l],m=d.filter(g=>{const v=ln({value:g},a.type,g);return!(v&&h===Pe.Answered||!v&&h===Pe.Skipped||h===Pe.GivenUp&&Qi(g)&&g.taskStatus===Y.GivenUp||v&&ao(h)&&an[h](g,f))});if(m.length<d.length){const g=parseInt(String(p),10);if(g!==-1&&g<=i||g>=r.length)return r.length-1-t;c=Math.max(o[g]+1,c)}d=m}d.length>0&&(c=Math.max(o[i+1]+1,c)),o[i]=c}return o[t]},Ji=e=>!(e.type===E.Thanks||e.type===E.Uploading),B=io()((e,t)=>({answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(n=De)=>{const r=t(),{fadeout:o,remove:i,trackHistory:a}=r;await o(n),At(r)||a({event:"closed"}),Bt.enable(),i({initiator:ce.Closed})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async n=>{const{eventEmitFn:r,fadeout:o,remove:i}=t();r(X.SurveyComplete),await o(n),Bt.enable(),i({initiator:ce.Complete})},endCard:{headline:""},envId:"",eventEmitFn:V.emit.bind(V),fadeout:async n=>{const{eventEmitFn:r,headers:o,viewDocument:i}=t();return Me(o)?Promise.resolve():(r(D.SurveyFadingOut),new Promise(a=>{const s=i.getElementById(n);s?(s.addEventListener("transitionend",()=>{a()}),s.classList.remove("ul-app--visible")):a()}))},frame:document.createElement("iframe"),handleClickEmbedButton:n=>{const{cards:r,eventEmitFn:o,index:i}=t();o(n,{[Ie.QuestionId]:r[i].name,[Ie.Props]:r[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:n,isComplete:r,progressPct:o,isSubmitted:i})=>{var p,f,m;const{cards:a,destroy:s,index:c,uploadProgress:d}=t(),l={...d,[n]:{progressPct:o||o===0?o:(p=d[n])==null?void 0:p.progressPct,isComplete:r||((f=d[n])==null?void 0:f.isComplete),isSubmitted:i||((m=d[n])==null?void 0:m.isSubmitted)}};if(a[c].type!==E.Uploading){e({uploadProgress:l});return}const h=Object.entries(d).every(([g,v])=>!v.isSubmitted||v.isComplete||n==g&&r);if(h&&c>=a.length-1){s(De);return}e({index:h?c+1:c,uploadingCardViewed:!0,uploadProgress:l})},hasViewedEmbed:!1,headers:{Authorization:"","Content-Type":"","userleap-platform":je.Web,"x-ul-environment-id":"","x-ul-installation-method":xe.Snippet,"x-ul-sdk-version":"","x-ul-visitor-id":""},index:0,isPreview:!1,marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:n=>{const{cards:r,eventEmitFn:o,index:i,responseGroupUid:a,submit:s,trackHistory:c,uploadProgress:d,viewedCardCount:l}=t(),h=Date.now(),p=[...r],f=p[i],{type:m}=n.data,g={...n.data},v=g.value;Ji(f)&&(f.value=v),g.answeredAt=h,delete g.type;const _={response:g,responseGroupUid:a};let y=m===E.MultipleChoice?Object.values(v).find(C=>C!==!1):v;m===E.MultipleSelect&&(y=p[i].props.options.reduce((C,T)=>(v[T.id]&&C.push(T.value),C),[]));const R=ln(g,m,y),x=so({cards:p,index:i,selectedValue:y,hasEndCard:!!n.endCard,hasValidAnswer:R,uploadProgress:d});if(x===null){_.completedAt=h,s(_),n.completeSurvey();return}else[E.Thanks,E.Uploading].includes(p[x].type)&&(_.completedAt=h);const U=s(_);[E.Thanks,E.Uploading].includes(p[x].type)||U.finally(()=>{c({event:"seen",index:x})});const M=p[x];p[x]&&o&&o(X.CurrentQuestion,{[Ie.QuestionId]:M.name,[Ie.Props]:M.props}),e({cards:p,hasViewedEmbed:!1,index:x,viewedCardCount:l+1})},recorder:()=>{},recorderEventEmitter:V,responseGroupUid:"",remove:({initiator:n})=>{const{frame:r,headers:o,eventEmitFn:i}=t();["ios","android"].includes(o["userleap-platform"])&&i(D.SurveyWillClose,{name:D.SurveyWillClose,initiator:n}),!Me(o)&&(i(D.SurveyWillClose,{name:D.SurveyWillClose,initiator:n}),r.remove())},seen:async()=>{const{trackHistory:n}=t();return n({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:n,response:r,responseGroupUid:o})=>{const i=t();if(!o||At(i))return;const a={responseGroupUid:o,meta:i.meta,customMetadata:i.customMetadata,responses:[r],completedAt:n},s=await ge(`${i.apiURL}/sdk/1/environments/${i.envId}/visitors/${i.userId}/responses/submit`,{body:JSON.stringify(a),headers:i.headers,method:"POST"});if(!s.ok){s.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",s.error),await Hn(i,"submitResponse",s.error));return}},surveyId:0,tabTitle:"",trackHistory:async({event:n,index:r,isNew:o=!1})=>{const i=t();if(At(i))return;const{cards:a,index:s}=i,c=r!==void 0?a[r]:a[s],d={sid:i.surveyId,qid:c.name,action:n,vid:i.userId,eid:i.envId,isNew:o,responseGroupUid:i.responseGroupUid},l=await ge(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`,{body:JSON.stringify(d),headers:i.headers,method:"POST"});!l.ok&&l.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",l.error),await Hn(i,"trackHistory",l.error))},update:()=>{const{headers:n,eventEmitFn:r,frame:o,viewDocument:i}=t();setTimeout(()=>{var s;const a=rr(i);Me(n)?r(D.SurveyHeight,{name:D.SurveyHeight,contentFrameHeight:a}):(s=o.setHeight)==null||s.call(o,a)},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),At=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview,Hn=async(e,t,n)=>{const{mode:r,userId:o,envId:i,apiURL:a,headers:s,viewDocument:c}=e,d=c.documentElement,l={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:d.clientWidth,clientHeight:d.clientHeight,location:window.location.href,language:window.navigator.language},h={action:t,err:{message:n==null?void 0:n.message,stack:n==null?void 0:n.stack},meta:l,vid:o,envId:i};(await ge(`${a}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},s),body:JSON.stringify(h)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},Xi=async(e,t)=>{var r;const n=await fetch(t,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok){const o=await n.json();return(r=o==null?void 0:o.upload)==null?void 0:r.url}else return null},lo=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",$n=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:lo()};return new MediaRecorder(e,t)},Bn=(e,t,n)=>{n[t]=[],e.ondataavailable=function(r){n[t].push(r.data)},e.currentMediaRecordingUid=t,e.start()};function Fn(e,t,n,r,o,i){if(e&&e.state!=="inactive"){const{[A.BeginCallback]:a}=r,s=e.currentMediaRecordingUid;if(!s)return;a&&a(s),e.onstop=()=>es(t,e,n,r,s,o,i),e.stop()}}async function es(e,t,n,r,o,i,a){const s=B.getState().viewDocument,{[A.UploadCallback]:c,[A.ProgressCallback]:d}=r,l={mediaType:n,updatedAt:new Date().toISOString(),mediaRecordingUid:o,...r[A.PassthroughData]},h=await Xi(l,e);if(!h){c&&c(null,{message:"failed to get upload url"});return}const p=new Blob(a,{type:lo()});if(!s.defaultView)return;const f=new s.defaultView.File([p],`recording video ${Date.now()}`),m=i.createUpload({endpoint:h,file:f,chunkSize:5120});m.startTime=Date.now(),m.on("error",g=>{c&&c(null,g)}),m.on("progress",g=>{d&&d(o,g)}),m.on("success",()=>{c&&c(o,!0)})}const ts={chunks:{}},ns={state:{...ts},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:n,screenRecorder:r,UpChunk:o}=this.state,i=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?fe.Video:fe.Audio;this.state.chunks&&t&&o&&(n!=null&&n.currentMediaRecordingUid&&Fn(n,t,i,e,o,this.state.chunks[n==null?void 0:n.currentMediaRecordingUid]),r!=null&&r.currentMediaRecordingUid&&Fn(r,t,fe.Screen,e,o,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]))},handleCancelledStream(e,t){const n=e.getVideoTracks(),r=e.getAudioTracks();let o=n.length&&n[0];o=o||r.length&&r[0],o&&o.addEventListener("ended",()=>{let i=!1;[this.state.avRecorder,this.state.screenRecorder].map(a=>{a&&(a.state==="recording"&&a.stop(),a.stream.getTracks().map(s=>{s.readyState==="live"&&s.stop()}),i=!0)}),Object.assign(this.state,{avStream:null,captureStream:null,avRecorder:null,screenRecorder:null}),i&&t&&t()})},taskDurationMillisecond(){return this.state.startTime?new Date().getTime()-this.state.startTime.getTime():0},setUpChunk(e){this.state.UpChunk=e},configure(e,t){Object.assign(this.state,t),this.state.uploadApiEndpoint=`${t.apiURL}/2/environments/integrations/upload`,this.state.chunks={},e.on(G.PermissionStatus,this.permissionStatusCallback.bind(this)),e.on(G.AvPermission,async n=>{this.avPermissionCallback(n)}),e.on(G.BeginRecording,this.beginRecordingCallback.bind(this)),e.on(G.StartTask,this.startTaskCallback.bind(this)),e.on(G.ScreenPermission,async n=>{this.screenPermissionCallback(n)}),e.on(G.FinishTask,async n=>{this.finishTaskCallback(n)})},async avPermissionCallback(e){var o,i,a;const{[A.StreamReadyCallback]:t,[A.StreamCanceledCallback]:n,[A.PermissionDescriptors]:r}=e;try{(o=this.state.avStream)!=null&&o.active&&(this.state.avStream.getTracks().map(s=>s.readyState==="live"&&s.stop()),((i=this.state.captureStream)==null?void 0:i.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:r.includes($e.Camera),audio:!0}),((a=this.state.captureStream)==null?void 0:a.getAudioTracks().length)===0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.avStream,n)}catch(s){console.warn("Error: failed to get permissions: "+s),t&&t(null,null);return}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{[A.StreamReadyCallback]:t,[A.StreamCanceledCallback]:n}=e;try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(r){console.warn("Error: failed to get permissions: "+r),t&&t(null,null);return}this.state.avStream&&this.state.avStream.getAudioTracks().length>0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.captureStream,n),t&&t(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{[A.RecordingMediaTypes]:t,[A.StartRecordingCallback]:n}=e;if(!t)return;const r=[];if(t.includes(fe.Video)&&this.state.avStream){this.state.avRecorder=$n(this.state.avStream);const o=vt();Bn(this.state.avRecorder,o,this.state.chunks),r.push(o)}if(t.includes(fe.Screen)&&this.state.captureStream){this.state.screenRecorder=$n(this.state.captureStream);const o=vt();Bn(this.state.screenRecorder,o,this.state.chunks),r.push(o)}r&&n&&n(r)},async finishTaskCallback(e){const{[A.CurrentIndex]:t,[A.TaskResponse]:n,[A.TaskCompleteCallback]:r}=e;await this.stopRecording(e),r&&r(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,n,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var r;const{[A.PermissionStatusCallback]:t}=e,n=this.state.avStream;t&&t(n,n?(n==null?void 0:n.getVideoTracks().length)>0:!1,!!((r=this.state.captureStream)!=null&&r.active))},lookAheadAndStopStream(e,t,n,r){const{avRecorder:o,screenRecorder:i}=this.state,a=so({cards:n,index:e,selectedValue:t.value,hasEndCard:r,hasValidAnswer:ln(t,t.type,t.value)});a!==null&&n[a].type===E.RecordedTask||[o,i].map(s=>{s&&(s.state==="recording"&&s.stop(),s.stream.getTracks().map(c=>{c.readyState==="live"&&c.stop()}))})}},ft=Object.create(ns);Object.freeze(ft);function co(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=co(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function j(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=co(e))&&(r&&(r+=" "),r+=t);return r}var rs=0;function u(e,t,n,r,o,i){var a,s,c={};for(s in t)s=="ref"?a=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--rs,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)c[s]===void 0&&(c[s]=a[s]);return S.vnode&&S.vnode(d),d}const Q=e=>u("button",{...e,className:j("ul-card-text__button",e.className),id:"ul-card-text__button"}),pe=({message:e,properties:t})=>{const n=t==null?void 0:t.captionText;return u(oe,{children:[e&&u("h1",{className:b.QuestionHeader,id:b.QuestionHeader,...n?{}:{style:{marginBottom:"15px"}},children:e}),n&&u("p",{className:b.Caption,id:b.Caption,children:n})]})},zn=({buttonText:e="View Prototype",handleClick:t})=>u("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),Se=({defaultBody:e,embeddedType:t="prototype",properties:n})=>{var h;const{handleClickEmbedButton:r,hasViewedEmbed:o,headers:i,useDesktopPrototype:a}=B(p=>({handleClickEmbedButton:p.handleClickEmbedButton,hasViewedEmbed:p.hasViewedEmbed,headers:p.headers,useDesktopPrototype:p.useDesktopPrototype})),s=(n==null?void 0:n.conceptUrl)||((h=n==null?void 0:n.consentDocument)==null?void 0:h.url),c=window.innerWidth<zo,d=i["userleap-platform"],l=(p,f)=>{p.preventDefault(),r(f)};if(!a&&c&&!o&&s&&["email","link"].includes(d)){if(t==="prototype")return u(zn,{handleClick:p=>{l(p,X.ViewPrototypeClick)}});if(t==="pdf")return u(zn,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:p=>{l(p,X.ViewAgreementClick)}})}return e()},uo=(e,t)=>{const n=Ce(0),r=()=>{if(e.current){const o=e.current;o.style.height="1px";const i=o.scrollHeight,a=o.offsetHeight-o.clientHeight,s=i+a,c=parseInt(window.getComputedStyle(o).getPropertyValue("max-height")),d=s<=c?s:c;n.current!==d&&t(),n.current=d,o.style.height=`${d}px`}};return re(r,[]),r},po=({border:e,label:t,isSelected:n,value:r,text:o,id:i,isRadio:a,useMobileStyling:s,error:c,allowTextEntry:d,promptText:l,onUserInputChanged:h})=>{const{styleNonce:p,viewDocument:f}=B(P=>({styleNonce:P.styleNonce,viewDocument:P.viewDocument})),[m,g]=Z(!1);ss(f,e,p);const v=({isSelected:P,userText:N})=>{h&&h({id:i||"",selected:P,value:r,userText:N})},_=P=>{P.stopPropagation(),v({isSelected:a||!n,userText:o}),g(!1)},y=()=>{m||g(!0)},R=()=>{m&&g(!1)},x=P=>{Qe(P.target)||(P.key==="Enter"||P.key===" ")&&_(P)},U={onClick:P=>_(P),onKeyPress:P=>x(P)};"ontouchstart"in f.documentElement?(U.onTouchStart=R,U.onTouchCancel=R,U.onTouchEnd=R):(U.onMouseDown=y,U.onMouseLeave=R);const M=a?`radio-${i}`:`checkbox-${i}`,C=n||m?[mt]:[],T=[...c?[fo]:[],...C];return u("div",{className:j([...z(b.Choice,s),...T]),id:`choice-div-${i}`,style:c?{borderColor:Ye}:{},...U,children:[u("div",{className:j([b.ChoiceLabelContainer]),children:[a?u("div",{"aria-labelledby":`label-${i}`,className:j([b.ChoiceRadio,...C]),id:M,role:"radio",tabIndex:0}):u("div",{"aria-checked":n,"aria-labelledby":`label-${i}`,className:b.ChoiceCheckbox,id:M,role:"checkbox",style:n?{backgroundColor:e,borderColor:e,boxShadow:"none"}:{},tabIndex:0,children:n&&u("svg",{fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})}),u("label",{className:j(z(b.ChoiceLabel,s)),htmlFor:M,id:`label-${i}`,children:t})]}),d&&n&&u("div",{className:j([b.ChoiceTextEntryContainer,...C]),children:u(os,{onTextChange:P=>v({isSelected:n,userText:P}),promptText:l||"Please specify",textValue:o,useMobileStyling:s})})]})},os=({promptText:e,textValue:t,onTextChange:n,useMobileStyling:r})=>{const o=Ce(null),{update:i}=B(s=>({update:s.update})),a=uo(o,()=>i());return re(()=>{o.current&&o.current.focus()},[]),u("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:j(z(b.ChoiceTextInput,r)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:s=>{a(),Qe(s.target)&&(s.stopPropagation(),n(s.target.value))},onClick:s=>{s.stopPropagation()},onKeyPress:s=>{s.stopPropagation()},placeholder:e,ref:o,role:"textbox",rows:1,value:t})},qn="ul-select-style-element",mt="ul-select-active-dynamic-style",fo="ul-select-error-dynamic-style",is=e=>e.tagName.toLowerCase()==="style",ss=(e,t,n)=>{let r=e.getElementById(qn),o=!1;r||(r=e.createElement("style"),o=!0),is(r)&&(r.id=qn,n&&(r.nonce=n),r.textContent=as(t),o&&e.head.appendChild(r))},as=e=>`
18
- .${mt} {
17
+ */var Lt=ro,Mi=oo.exports;function Ni(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vi=typeof Object.is=="function"?Object.is:Ni,Hi=Mi.useSyncExternalStore,$i=Lt.useRef,Bi=Lt.useEffect,Fi=Lt.useMemo,zi=Lt.useDebugValue;no.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=$i(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=Fi(function(){function c(f){if(!d){if(d=!0,l=f,f=r(f),o!==void 0&&s.hasValue){var h=s.value;if(o(h,f))return m=h}return m=f}if(h=m,Vi(l,f))return h;var g=r(f);return o!==void 0&&o(h,g)?h:(l=f,m=g)}var d=!1,l,m,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,o]);var a=Hi(e,i[0],i[1]);return Bi(function(){s.hasValue=!0,s.value=a},[a]),zi(a),a};(function(e){e.exports=no})(to);const qi=Jo(to.exports),{useSyncExternalStoreWithSelector:Wi}=qi;function Gi(e,t=e.getState,n){const r=Wi(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return rn(r),r}const Hn=e=>{const t=typeof e=="function"?ui(e):e,n=(r,o)=>Gi(t,r,o);return Object.assign(n,t),n},so=e=>e?Hn(e):Hn,Ot=1,ln={eq(e,t){return e==t},neq(e,t){return!this.eq(e,t)},gt(e,t){return e>t},gte(e,t){return e>=t},lt(e,t){return e<t},lte(e,t){return e<=t},list_exact(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:e.slice().sort().join(",")===t.slice().sort().join(",")},list_all(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:!t.some(n=>e.indexOf(n)===-1)},list_alo(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:t.some(n=>e.indexOf(n)!=-1)}},cn=(e,t,n)=>{switch(t){case L.VideoVoice:return Boolean(e&&e.value);case L.Open:return!!n;case L.MultipleSelect:return Boolean(n&&!!Object.keys(n).length);case L.RecordedTask:return(n==null?void 0:n.taskStatus)===oe.Completed;case L.TextUrlPrompt:return!e.value;case L.ConsentLegal:return n!==null;case L.MultipleChoice:return n!==void 0;case L.NPS:return n!==null;case L.Likert:return n!==null;default:return!0}},ao=({cards:e,index:t,hasEndCard:n,selectedValue:r,hasValidAnswer:o=!0,uploadProgress:i={}})=>{if(t>=e.length||t<0)return null;const a=e[t].props.routingOptions||[];let c=null,d=null;for(let f=0;f<a.length;f++){const{comparator:h,target:g,value:v}=a[f];if(h===je.Answered&&o){c=g;break}else if(h===je.GivenUp&&r instanceof Object&&"taskStatus"in r&&(r==null?void 0:r.taskStatus)===oe.GivenUp){c=g;break}else if(h===je.Skipped&&!o&&!(r instanceof Object&&"taskStatus"in r&&(r==null?void 0:r.taskStatus)===oe.GivenUp)){c=g;break}else if(o&&lo(h)&&ln[h](r,v)){c=g;break}}const l=c&&parseInt(String(c),10);c&&l!==null&&!isNaN(l)&&(l===-1||l>t)&&(d=l);const m=e.findIndex(f=>f.type===L.Uploading);let p;return m>0&&n?p=e.length-3:m>0||n?p=e.length-2:p=e.length-1,t>=p||d===-1||d!==null&&d>p?m>0&&Object.values(i).some(h=>h.isSubmitted&&!h.isComplete)?m:n?e.length-1:null:d!==null?d:t+1},Zi=13,Yi=(e,t)=>e.reduce((n,r)=>n.concat(n.map(o=>[...o,r])),[[]]).filter(n=>t||n.length>0),Qi=e=>{switch(e.type){case L.MultipleSelect:return!e||!e.props||!e.props.options?null:e.props.options.length>Zi?e.props.options.map(t=>[t.value]):Yi(e.props.options.map(t=>t.value),!e.props.properties.required);case L.MultipleChoice:{if(!e||!e.props||!e.props.options)return null;const t=e.props.options.map(n=>n.value);return e.props.properties.required||t.push(void 0),t}case L.Likert:return[1,2,3,4,5,...e.props.properties.required?[]:[null]];case L.NPS:return[0,1,2,3,4,5,6,7,8,9,10,...e.props.properties.required?[]:[null]];case L.VideoVoice:case L.Open:return[Ot,...e.props.properties.required?[]:[""]];case L.RecordedTask:return[{taskStatus:oe.Completed},{taskStatus:oe.GivenUp},...e.props.properties.required?[]:[{taskStatus:oe.Abandoned}]];case L.TextUrlPrompt:return[void 0,...e.props.properties.required?[]:[{skipped:!0}]];case L.ConsentLegal:return[Ot,...e.props.properties.required?[]:[null]];default:return[Ot]}},lo=e=>e in ln,Ki=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,Ji=(e,t)=>{const n=new Set([L.Thanks,L.Uploading]);if(t>=e.length||t<0||n.has(e[t].type))return 0;const r=e.filter(i=>!n.has(i.type));if(t===r.length-1)return 1;const o={[r.length-1]:1,[-1]:0};for(let i=r.length-2;i>=t;i--){const s=r[i],a=s.props.routingOptions||[];if(a.length===0){o[i]=o[i+1]+1;continue}let c=0,d=Qi(s);if(d===null)return r.length-1-t;for(let l=0;l<a.length&&d.length!==0;l++){const{comparator:m,target:p,value:f}=a[l],h=d.filter(g=>{const v=cn({value:g},s.type,g);return!(v&&m===je.Answered||!v&&m===je.Skipped||m===je.GivenUp&&Ki(g)&&g.taskStatus===oe.GivenUp||v&&lo(m)&&ln[m](g,f))});if(h.length<d.length){const g=parseInt(String(p),10);if(g!==-1&&g<=i||g>=r.length)return r.length-1-t;c=Math.max(o[g]+1,c)}d=h}d.length>0&&(c=Math.max(o[i+1]+1,c)),o[i]=c}return o[t]},Xi=e=>!(e.type===L.Thanks||e.type===L.Uploading),B=so()((e,t)=>({answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(n=De)=>{const r=t(),{fadeout:o,remove:i,trackHistory:s}=r;await o(n),At(r)||s({event:"closed"}),Bt.enable(),i({initiator:de.Closed})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async n=>{const{eventEmitFn:r,fadeout:o,remove:i}=t();r(ee.SurveyComplete),await o(n),Bt.enable(),i({initiator:de.Complete})},endCard:{headline:""},envId:"",eventEmitFn:H.emit.bind(H),fadeout:async n=>{const{eventEmitFn:r,headers:o,viewDocument:i}=t();return Me(o)?Promise.resolve():(r(M.SurveyFadingOut),new Promise(s=>{const a=i.getElementById(n);a?(a.addEventListener("transitionend",()=>{s()}),a.classList.remove("ul-app--visible")):s()}))},frame:document.createElement("iframe"),handleClickEmbedButton:n=>{const{cards:r,eventEmitFn:o,index:i}=t();o(n,{[Te.QuestionId]:r[i].name,[Te.Props]:r[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:n,isComplete:r,progressPct:o,isSubmitted:i})=>{var p,f,h;const{cards:s,destroy:a,index:c,uploadProgress:d}=t(),l={...d,[n]:{progressPct:o||o===0?o:(p=d[n])==null?void 0:p.progressPct,isComplete:r||((f=d[n])==null?void 0:f.isComplete),isSubmitted:i||((h=d[n])==null?void 0:h.isSubmitted)}};if(s[c].type!==L.Uploading){e({uploadProgress:l});return}const m=Object.entries(d).every(([g,v])=>!v.isSubmitted||v.isComplete||n==g&&r);if(m&&c>=s.length-1){a(De);return}e({index:m?c+1:c,uploadingCardViewed:!0,uploadProgress:l})},hasViewedEmbed:!1,headers:{Authorization:"","Content-Type":"","userleap-platform":Re.Web,"x-ul-environment-id":"","x-ul-installation-method":xe.Snippet,"x-ul-sdk-version":"","x-ul-visitor-id":""},index:0,isPreview:!1,marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:n=>{const{cards:r,eventEmitFn:o,index:i,responseGroupUid:s,submit:a,trackHistory:c,uploadProgress:d,viewedCardCount:l}=t(),m=Date.now(),p=[...r],f=p[i],{type:h}=n.data,g={...n.data},v=g.value;Xi(f)&&(f.value=v),g.answeredAt=m,delete g.type;const w={response:g,responseGroupUid:s};let _=h===L.MultipleChoice?Object.values(v).find(b=>b!==!1):v;h===L.MultipleSelect&&(_=p[i].props.options.reduce((b,P)=>(v[P.id]&&b.push(P.value),b),[]));const U=cn(g,h,_),C=ao({cards:p,index:i,selectedValue:_,hasEndCard:!!n.endCard,hasValidAnswer:U,uploadProgress:d});if(C===null){w.completedAt=m,a(w),n.completeSurvey();return}else[L.Thanks,L.Uploading].includes(p[C].type)&&(w.completedAt=m);const I=a(w);[L.Thanks,L.Uploading].includes(p[C].type)||I.finally(()=>{c({event:"seen",index:C})});const A=p[C];p[C]&&o&&o(ee.CurrentQuestion,{[Te.QuestionId]:A.name,[Te.Props]:A.props}),e({cards:p,hasViewedEmbed:!1,index:C,viewedCardCount:l+1})},recorder:()=>{},recorderEventEmitter:H,responseGroupUid:"",remove:({initiator:n})=>{const{frame:r,headers:o,eventEmitFn:i}=t();["ios","android"].includes(o["userleap-platform"])&&i(M.SurveyWillClose,{name:M.SurveyWillClose,initiator:n}),!Me(o)&&(i(M.SurveyWillClose,{name:M.SurveyWillClose,initiator:n}),r.remove())},seen:async()=>{const{trackHistory:n}=t();return n({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:n,response:r,responseGroupUid:o})=>{const i=t();if(!o||At(i))return;const s={responseGroupUid:o,meta:i.meta,customMetadata:i.customMetadata,responses:[r],completedAt:n},a=await ge(`${i.apiURL}/sdk/1/environments/${i.envId}/visitors/${i.userId}/responses/submit`,{body:JSON.stringify(s),headers:i.headers,method:"POST"});if(!a.ok){a.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",a.error),await $n(i,"submitResponse",a.error));return}},surveyId:0,tabTitle:"",trackHistory:async({event:n,index:r,isNew:o=!1})=>{const i=t();if(At(i))return;const{cards:s,index:a}=i,c=r!==void 0?s[r]:s[a],d={sid:i.surveyId,qid:c.name,action:n,vid:i.userId,eid:i.envId,isNew:o,responseGroupUid:i.responseGroupUid},l=await ge(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`,{body:JSON.stringify(d),headers:i.headers,method:"POST"});!l.ok&&l.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",l.error),await $n(i,"trackHistory",l.error))},update:()=>{const{headers:n,eventEmitFn:r,frame:o,viewDocument:i}=t();setTimeout(()=>{var a;const s=or(i);Me(n)?r(M.SurveyHeight,{name:M.SurveyHeight,contentFrameHeight:s}):(a=o.setHeight)==null||a.call(o,s)},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),At=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview,$n=async(e,t,n)=>{const{mode:r,userId:o,envId:i,apiURL:s,headers:a,viewDocument:c}=e,d=c.documentElement,l={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:d.clientWidth,clientHeight:d.clientHeight,location:window.location.href,language:window.navigator.language},m={action:t,err:{message:n==null?void 0:n.message,stack:n==null?void 0:n.stack},meta:l,vid:o,envId:i};(await ge(`${s}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},a),body:JSON.stringify(m)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},es=async(e,t)=>{var r;const n=await fetch(t,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok){const o=await n.json();return(r=o==null?void 0:o.upload)==null?void 0:r.url}else return null},co=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",Bn=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:co()};return new MediaRecorder(e,t)},Fn=(e,t,n)=>{n[t]=[],e.ondataavailable=function(r){n[t].push(r.data)},e.currentMediaRecordingUid=t,e.start()};function zn(e,t,n,r,o,i){if(e&&e.state!=="inactive"){const{[N.BeginCallback]:s}=r,a=e.currentMediaRecordingUid;if(!a)return;s&&s(a),e.onstop=()=>ts(t,e,n,r,a,o,i),e.stop()}}async function ts(e,t,n,r,o,i,s){const a=B.getState().viewDocument,{[N.UploadCallback]:c,[N.ProgressCallback]:d}=r,l={mediaType:n,updatedAt:new Date().toISOString(),mediaRecordingUid:o,...r[N.PassthroughData]},m=await es(l,e);if(!m){c&&c(null,{message:"failed to get upload url"});return}const p=new Blob(s,{type:co()});if(!a.defaultView)return;const f=new a.defaultView.File([p],`recording video ${Date.now()}`),h=i.createUpload({endpoint:m,file:f,chunkSize:5120});h.startTime=Date.now(),h.on("error",g=>{c&&c(null,g)}),h.on("progress",g=>{d&&d(o,g)}),h.on("success",()=>{c&&c(o,!0)})}const ns={chunks:{}},rs={state:{...ns},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:n,screenRecorder:r,UpChunk:o}=this.state,i=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?ne.Video:ne.Audio;this.state.chunks&&t&&o&&(n!=null&&n.currentMediaRecordingUid&&zn(n,t,i,e,o,this.state.chunks[n==null?void 0:n.currentMediaRecordingUid]),r!=null&&r.currentMediaRecordingUid&&zn(r,t,ne.Screen,e,o,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]))},handleCancelledStream(e){const t=e.getVideoTracks(),n=e.getAudioTracks();let r=t.length&&t[0];r=r||n.length&&n[0],r&&r.addEventListener("ended",()=>{[this.state.avRecorder,this.state.screenRecorder].map(o=>{o&&(o.state==="recording"&&o.stop(),o.stream.getTracks().map(i=>{i.readyState==="live"&&i.stop()}))}),Object.assign(this.state,{avStream:null,captureStream:null,avRecorder:null,screenRecorder:null})})},taskDurationMillisecond(){return this.state.startTime?new Date().getTime()-this.state.startTime.getTime():0},setUpChunk(e){this.state.UpChunk=e},configure(e,t){Object.assign(this.state,t),this.state.uploadApiEndpoint=`${t.apiURL}/2/environments/integrations/upload`,this.state.chunks={},e.on(Z.PermissionStatus,this.permissionStatusCallback.bind(this)),e.on(Z.AvPermission,async n=>{this.avPermissionCallback(n)}),e.on(Z.BeginRecording,this.beginRecordingCallback.bind(this)),e.on(Z.StartTask,this.startTaskCallback.bind(this)),e.on(Z.ScreenPermission,async n=>{this.screenPermissionCallback(n)}),e.on(Z.FinishTask,async n=>{this.finishTaskCallback(n)})},async avPermissionCallback(e){var r,o,i;const{[N.StreamReadyCallback]:t,[N.PermissionDescriptors]:n}=e;try{(r=this.state.avStream)!=null&&r.active&&(this.state.avStream.getTracks().map(s=>s.readyState==="live"&&s.stop()),((o=this.state.captureStream)==null?void 0:o.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:n.includes($e.Camera),audio:!0}),((i=this.state.captureStream)==null?void 0:i.getAudioTracks().length)===0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.avStream)}catch(s){console.warn("Error: failed to get permissions: "+s),t&&t(null,null);return}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{[N.ScreenPermissionRequested]:t,[N.StreamReadyCallback]:n}=e;t==null||t(!0);try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(r){t==null||t(!1),console.warn("Error: failed to get permissions: "+r),n&&n(null,null);return}t==null||t(!1),this.state.avStream&&this.state.avStream.getAudioTracks().length>0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.captureStream),n&&n(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{[N.RecordingMediaTypes]:t,[N.StartRecordingCallback]:n}=e;if(!t)return;const r=[];if(t.includes(ne.Video)&&this.state.avStream){this.state.avRecorder=Bn(this.state.avStream);const o=gt();Fn(this.state.avRecorder,o,this.state.chunks),r.push(o)}if(t.includes(ne.Screen)&&this.state.captureStream){this.state.screenRecorder=Bn(this.state.captureStream);const o=gt();Fn(this.state.screenRecorder,o,this.state.chunks),r.push(o)}r&&n&&n(r)},async finishTaskCallback(e){const{[N.CurrentIndex]:t,[N.TaskResponse]:n,[N.TaskCompleteCallback]:r}=e;await this.stopRecording(e),r&&r(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,n,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var r;const{[N.PermissionStatusCallback]:t}=e,n=this.state.avStream;t&&t(n,n?(n==null?void 0:n.getVideoTracks().length)>0:!1,!!((r=this.state.captureStream)!=null&&r.active),this.state.captureStream)},lookAheadAndStopStream(e,t,n,r){const{avRecorder:o,screenRecorder:i}=this.state,s=ao({cards:n,index:e,selectedValue:t.value,hasEndCard:r,hasValidAnswer:cn(t,t.type,t.value)});s!==null&&n[s].type===L.RecordedTask||[o,i].map(a=>{a&&(a.state==="recording"&&a.stop(),a.stream.getTracks().map(c=>{c.readyState==="live"&&c.stop()}))})}},pt=Object.create(rs);Object.freeze(pt);function uo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=uo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function R(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=uo(e))&&(r&&(r+=" "),r+=t);return r}var os=0;function u(e,t,n,r,o,i){var s,a,c={};for(a in t)a=="ref"?s=t[a]:c[a]=t[a];var d={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--os,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return S.vnode&&S.vnode(d),d}const K=e=>u("button",{...e,className:R("ul-card-text__button",e.className),id:"ul-card-text__button"}),fe=({message:e,properties:t})=>{const n=t==null?void 0:t.captionText;return u(ie,{children:[e&&u("h1",{className:y.QuestionHeader,id:y.QuestionHeader,...n?{}:{style:{marginBottom:"15px"}},children:e}),n&&u("p",{className:y.Caption,id:y.Caption,children:n})]})},qn=({buttonText:e="View Prototype",handleClick:t})=>u("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),Se=({defaultBody:e,embeddedType:t="prototype",properties:n})=>{var m;const{handleClickEmbedButton:r,hasViewedEmbed:o,headers:i,useDesktopPrototype:s}=B(p=>({handleClickEmbedButton:p.handleClickEmbedButton,hasViewedEmbed:p.hasViewedEmbed,headers:p.headers,useDesktopPrototype:p.useDesktopPrototype})),a=(n==null?void 0:n.conceptUrl)||((m=n==null?void 0:n.consentDocument)==null?void 0:m.url),c=window.innerWidth<qo,d=i["userleap-platform"],l=(p,f)=>{p.preventDefault(),r(f)};if(!s&&c&&!o&&a&&["email","link"].includes(d)){if(t==="prototype")return u(qn,{handleClick:p=>{l(p,ee.ViewPrototypeClick)}});if(t==="pdf")return u(qn,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:p=>{l(p,ee.ViewAgreementClick)}})}return e()},po=(e,t)=>{const n=Ce(0),r=()=>{if(e.current){const o=e.current;o.style.height="1px";const i=o.scrollHeight,s=o.offsetHeight-o.clientHeight,a=i+s,c=parseInt(window.getComputedStyle(o).getPropertyValue("max-height")),d=a<=c?a:c;n.current!==d&&t(),n.current=d,o.style.height=`${d}px`}};return X(r,[]),r},fo=({border:e,label:t,isSelected:n,value:r,text:o,id:i,isRadio:s,useMobileStyling:a,error:c,allowTextEntry:d,promptText:l,onUserInputChanged:m})=>{const{styleNonce:p,viewDocument:f}=B(j=>({styleNonce:j.styleNonce,viewDocument:j.viewDocument})),[h,g]=G(!1);as(f,e,p);const v=({isSelected:j,userText:V})=>{m&&m({id:i||"",selected:j,value:r,userText:V})},w=j=>{j.stopPropagation(),v({isSelected:s||!n,userText:o}),g(!1)},_=()=>{h||g(!0)},U=()=>{h&&g(!1)},C=j=>{Qe(j.target)||(j.key==="Enter"||j.key===" ")&&w(j)},I={onClick:j=>w(j),onKeyPress:j=>C(j)};"ontouchstart"in f.documentElement?(I.onTouchStart=U,I.onTouchCancel=U,I.onTouchEnd=U):(I.onMouseDown=_,I.onMouseLeave=U);const A=s?`radio-${i}`:`checkbox-${i}`,b=n||h?[ft]:[],P=[...c?[mo]:[],...b];return u("div",{className:R([...z(y.Choice,a),...P]),id:`choice-div-${i}`,style:c?{borderColor:Ye}:{},...I,children:[u("div",{className:R([y.ChoiceLabelContainer]),children:[s?u("div",{"aria-labelledby":`label-${i}`,className:R([y.ChoiceRadio,...b]),id:A,role:"radio",tabIndex:0}):u("div",{"aria-checked":n,"aria-labelledby":`label-${i}`,className:y.ChoiceCheckbox,id:A,role:"checkbox",style:n?{backgroundColor:e,borderColor:e,boxShadow:"none"}:{},tabIndex:0,children:n&&u("svg",{fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})}),u("label",{className:R(z(y.ChoiceLabel,a)),htmlFor:A,id:`label-${i}`,children:t})]}),d&&n&&u("div",{className:R([y.ChoiceTextEntryContainer,...b]),children:u(is,{onTextChange:j=>v({isSelected:n,userText:j}),promptText:l||"Please specify",textValue:o,useMobileStyling:a})})]})},is=({promptText:e,textValue:t,onTextChange:n,useMobileStyling:r})=>{const o=Ce(null),{update:i}=B(a=>({update:a.update})),s=po(o,()=>i());return X(()=>{o.current&&o.current.focus()},[]),u("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:R(z(y.ChoiceTextInput,r)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:a=>{s(),Qe(a.target)&&(a.stopPropagation(),n(a.target.value))},onClick:a=>{a.stopPropagation()},onKeyPress:a=>{a.stopPropagation()},placeholder:e,ref:o,role:"textbox",rows:1,value:t})},Wn="ul-select-style-element",ft="ul-select-active-dynamic-style",mo="ul-select-error-dynamic-style",ss=e=>e.tagName.toLowerCase()==="style",as=(e,t,n)=>{let r=e.getElementById(Wn),o=!1;r||(r=e.createElement("style"),o=!0),ss(r)&&(r.id=Wn,n&&(r.nonce=n),r.textContent=ls(t),o&&e.head.appendChild(r))},ls=e=>`
18
+ .${ft} {
19
19
  border-color: ${e};
20
20
  }
21
- .${mt} .${b.ChoiceRadio}, .${mt}.${b.ChoiceRadio} {
21
+ .${ft} .${y.ChoiceRadio}, .${ft}.${y.ChoiceRadio} {
22
22
  border: 6px solid ${e};
23
23
  box-shadow: none;
24
24
  }
25
- .${fo} {
25
+ .${mo} {
26
26
  border-color: ${Ye};
27
27
  }
28
- `,ze=e=>(e==null?void 0:e.buttonText)||"Next",cn=e=>(e==null?void 0:e.skipButtonText)||"Skip",ls=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{headers:a,useMobileStyling:s,border:c}=B(k=>({headers:k.headers,useMobileStyling:k.useMobileStyling,border:k.border})),[d,l]=Z(!1),[h,p]=Z(""),[f,m]=Z(!1),g=a["userleap-platform"],v=r==null?void 0:r.collectName,_=(r==null?void 0:r.nameLabelText)||"Full Name",y=(r==null?void 0:r.consentText)||"I agree to the stated conditions",R=(r==null?void 0:r.submitButtonText)||"Submit",x=!!h.trim(),U=d&&(!v||x),M=(k,w=!1)=>{k.preventDefault(),k.stopPropagation();let L=null;if(!w){if(!U){m(!0);return}L={submitted:!0},v&&(L.name=h)}n({value:L,questionId:o,type:i})},C=k=>{Yo(k.target)&&(k.preventDefault(),k.stopPropagation(),p(k.target.value))},T=k=>{Ne(k.target)&&(k.target.style.borderColor=f&&!x?Ye:c)},P=k=>{Ne(k.target)&&(k.target.style.borderColor=f&&!x?Ye:Xt)},N=()=>u("div",{children:[u(po,{allowTextEntry:!1,border:c,error:f&&!d,index:0,isRadio:!1,isSelected:d,label:y,onUserInputChanged:({selected:k})=>{k!==d&&l(!d)},useMobileStyling:s}),v&&u("input",{"aria-label":_,"aria-placeholder":_,className:j(z(b.ConsentLegalNameInput,s)),"data-gramm":"false",maxLength:250,name:"name",onBlur:P,onFocus:T,onInput:C,placeholder:_,style:f&&!x?{borderColor:Ye}:{},tabIndex:0,value:h}),u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[u(Q,{className:U?"":b.ButtonDisabled,onClick:M,children:R}),r.required===!1&&u("button",{className:"ul-card-skip__button",onClick:k=>M(k,!0),children:cn(r)})]})]});return u("div",{className:j(ue(b.CardMainContent,g)),children:u("div",{className:j([e,"ul-card__consent-legal",b.FadeInTransition]),children:[u(pe,{message:t}),u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:r&&r.richTextBody?{__html:r&&r.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"}),u(Se,{properties:r,defaultBody:N,embeddedType:"pdf"})]},o)})},cs=({activeValue:e,border:t,icon:n,isPressed:r,onSubmit:o,range:i,scaleLabelType:a,setActiveValue:s,setIsPressed:c,useMobileStyling:d,value:l})=>{const h=`option-${l}`,p=a===Te.Number,f=a===Te.Star,m=p&&l===e,[g,v]=(()=>l<=e&&f||l===e?r?[t,1]:[t,.3]:["",1])(),_=()=>{switch(a){case Te.Star:return j([...z(b.LikertStar,d),...z(`${b.LikertStar}-${l}`,d)]);case Te.Smiley:return j([...z(b.LikertSmiley,d),...z(`${b.LikertSmiley}-${l}`,d)]);default:return j(l===i?[...z(b.LikertNumber,d),...z(`${b.LikertNumber}-${l}`,d),...z("likert-last-option",d)]:[...z(b.LikertNumber,d),...z(`${b.LikertNumber}-${l}`,d)])}},y=()=>{s(-1),c(!1)};return u("div",{"aria-label":p?void 0:String(l),className:_(),dangerouslySetInnerHTML:{__html:n},id:h,onClick:()=>o(),onPointerDown:()=>c(!0),onPointerEnter:()=>s(l),onPointerLeave:y,role:"radio",style:{color:p?"":g,borderColor:m?g:"",fillOpacity:m?"":v,zIndex:m?3:"auto"},tabIndex:0})},ds=({className:e,labels:t,message:n,next:r,properties:o,questionId:i,type:a})=>{const{border:s,headers:c,useMobileStyling:d}=B(N=>({border:N.border,headers:N.headers,useMobileStyling:N.useMobileStyling})),[l,h]=Z(-1),[p,f]=Z(!1),m=c["userleap-platform"],g=t&&t.left,v=t&&t.right;let _;const{range:y,scaleLabelType:R,ratingIcons:x}=o;y&&(_=Number(y));const U=_||5,M=N=>{var k,w;switch(R){case Te.Star:return(k=x[0])==null?void 0:k.svg;case Te.Smiley:return(w=x[N])==null?void 0:w.svg;default:return String(N+1)}},C=[...Array(U)].map((N,k)=>{const w=k+1;return u(cs,{activeValue:l,border:s,icon:M(k),isPressed:p,onSubmit:()=>r({value:w,questionId:i,type:a}),range:U,scaleLabelType:R,setActiveValue:h,setIsPressed:f,useMobileStyling:d,value:w},k)}),T=N=>{N.preventDefault(),N.stopPropagation(),r({value:null,questionId:i,type:a})},P=()=>u(oe,{children:[u("div",{"aria-label":`Rating (1 - ${U})`,className:"ul-card--likert__numbers",role:"radiogroup",children:C}),u("div",{className:"ul-card--likert__labels",children:[u("span",{children:g}),u("span",{children:v})]}),!o.required&&u("div",{className:"ul-vertical-centered-container",children:u(Q,{onClick:T,children:ze(o)})})]});return u("div",{className:j(ue(b.CardMainContent,m)),children:u("form",{className:j([e,"ul-card--likert",b.FadeInTransition]),children:[u(pe,{message:n,properties:o}),u(Se,{properties:o,defaultBody:P})]},i)})},mo=({className:e,message:t,onSubmit:n,options:r=[],properties:o,questionId:i,type:a})=>{const{border:s,headers:c,useMobileStyling:d}=B(C=>({border:C.border,headers:C.headers,useMobileStyling:C.useMobileStyling})),l=r.reduce((C,T)=>(C[T.id]={isSelected:!1},C),{}),[h,p]=Z(l),f=c["userleap-platform"],m=a===E.MultipleChoice,g=o.required,v=Object.entries(h).some(([C,T])=>{var k;const P=r.find(w=>`${w.id}`===C),N=T.userText===void 0||T.userText.trim()==="";return((k=P==null?void 0:P.optionProperties)==null?void 0:k.allowsTextEntry)&&N&&T.isSelected}),_=Object.values(h).some(C=>C.isSelected),y=v||g&&!_,R=r.map(({id:C,label:T,value:P,optionProperties:N},k)=>{var $,K;const w=`${C}`,{allowsTextEntry:L}=N||{allowsTextEntry:!1};return u(po,{allowTextEntry:L,border:s,error:!1,id:w,index:k,isRadio:m,isSelected:!!(($=h[w])!=null&&$.isSelected),label:T,onUserInputChanged:qe=>U(qe.id,qe.selected,qe.userText),promptText:"Please specify",text:(K=h[C])==null?void 0:K.userText,useMobileStyling:d,value:P},w)}),x=C=>{C.preventDefault(),C.stopPropagation(),n(h)},U=(C,T,P)=>{const N=Object.assign({},h);if(m&&T)for(const k of Object.values(N))k.isSelected=!1,delete k.userText;N[C]={isSelected:T,userText:P},p(N)},M=()=>u("div",{children:[u("div",{className:j(z(b.ChoiceGroup,d)),role:m?"radiogroup":"group",children:R}),u("div",{className:"ul-card__button-wrapper",children:u(Q,{disabled:y,onClick:x,children:ze(o)})})]});return u("div",{className:j(ue(b.CardMainContent,f)),children:u("form",{className:j([e,"ul-card--multiple",b.FadeInTransition]),id:"text-form",onSubmit:x,children:[u(pe,{message:t,properties:o}),u(Se,{properties:o,defaultBody:M})]},i)})},us=e=>{const{questionId:t,type:n,next:r,options:o}=e;return u(mo,{...e,onSubmit:a=>{const s=Object.entries(a).find(([,p])=>p.isSelected)||[void 0,void 0],[c,d]=s,l=o.find(p=>`${p.id}`===c),h=d!=null&&d.userText?{[c]:{userText:d.userText}}:null;r({value:l&&c?{[c]:l.value}:{},secondaryValue:h,questionId:t,type:n})}})},ps=e=>{const{questionId:t,type:n,next:r}=e;return u(mo,{...e,onSubmit:i=>{const a={},s=Object.entries(i).reduce((d,[l,h])=>(d[l]=h.isSelected,d),a),c=Object.entries(i).reduce((d,[l,h])=>{if(!h.userText)return d;const p=d||{};return p[l]={userText:h.userText},p},null);r({value:s,secondaryValue:c,questionId:t,type:n})}})},fs=({className:e,props:{labels:t,message:n,properties:r},next:o,questionId:i,type:a})=>{const{border:s,headers:c,useMobileStyling:d}=B(v=>({border:v.border,headers:v.headers,useMobileStyling:v.useMobileStyling})),l=c["userleap-platform"],h=t&&t.left,p=t&&t.right,f=[...Array(11)].map((v,_)=>u("div",{className:j([...z(b.NPSNumber,d),...z(`${b.NPSNumber}-${_}`,d)]),id:`option-${_}`,onClick:()=>o({value:_,questionId:i,type:a}),onKeyPress:y=>{y.preventDefault(),(y.key==="Enter"||y.key===" ")&&o({value:_,questionId:i,type:a})},onPointerDown:y=>{Ne(y.target)&&(y.target.style.zIndex="2",y.target.style.borderColor=s)},onPointerLeave:y=>{Ne(y.target)&&(y.target.style.zIndex="auto",y.target.style.borderColor=Xt)},role:"radio",tabIndex:0,children:_},_)),m=v=>{v.preventDefault(),v.stopPropagation(),o({value:null,questionId:i,type:a})},g=()=>u("div",{children:[u("div",{className:"ul-card--nps__numbers",children:f}),u("div",{className:"ul-card--nps__labels",children:[u("span",{children:h}),u("span",{children:p})]}),!r.required&&u("div",{className:"ul-vertical-centered-container",children:u(Q,{onClick:m,children:ze(r)})})]});return u("div",{className:j(ue(b.CardMainContent,l)),children:u("form",{className:j([e,"ul-card--nps",b.FadeInTransition]),children:[u(pe,{message:n,properties:r}),u(Se,{properties:r,defaultBody:g})]},i)})},ms=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{border:a,headers:s,useMobileStyling:c,update:d}=B(C=>({border:C.border,headers:C.headers,useMobileStyling:C.useMobileStyling,update:C.update})),[l,h]=Z(""),p=Ce(null),f=s["userleap-platform"],m=l.trim(),g=r.required===!0&&!m,v=uo(p,()=>d()),_=C=>{v(),C.preventDefault(),C.stopPropagation(),Qe(C.target)&&h(C.target.value)},y=C=>{C.preventDefault(),C.stopPropagation(),n({value:l,questionId:o,type:i})},R=r&&r.openTextPlaceholder?r.openTextPlaceholder:"",x=C=>{Qe(C.target)&&(C.target.style.borderColor=a)},U=C=>{Qe(C.target)&&(C.target.style.borderColor=Xt)},M=()=>u("div",{className:"ul-card-text",children:[u("div",{className:"ul-card-text__container",children:u("textarea",{"aria-label":R,"aria-labelledby":b.QuestionHeader,"aria-multiline":"true","aria-placeholder":R,className:j(z(b.OpenTextInput,c)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:U,onChange:_,onFocus:x,placeholder:R,ref:p,role:"textbox",tabIndex:0})}),u(Q,{disabled:g,onClick:y,style:{backgroundColor:g?"":a},children:ze(r)})]});return u("div",{className:j(ue(b.CardMainContent,f)),children:u("form",{className:j([e,"ul-card--text",b.FadeInTransition]),id:"text-form",children:[u(pe,{message:t,properties:r}),u(Se,{defaultBody:M,properties:r})]},o)})};var ye=(e=>(e[e.RequestNeeded=1]="RequestNeeded",e[e.TryAgain=2]="TryAgain",e[e.Ready=3]="Ready",e))(ye||{});const It=e=>e.type===J.AvPermission,ho=e=>e.type===J.ScreenPermission,hs=(e,t)=>!(It(t)?t.permissionDescriptors:[]).includes($e.Camera)||e.getVideoTracks().length>0,go=(e,t)=>{if(e===void 0)return ye.RequestNeeded;if(e){if(!hs(e,t))return ye.RequestNeeded}else return ye.TryAgain;return ye.Ready},Wn={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},de=io(e=>({...Wn,reset:()=>{e(Wn)},updatePage:t=>{e(t)}}));function Gt({currentPage:e,pages:t}){const{avStream:n,recordingMediaTypes:r,updatePage:o}=de.getState(),{recorderEventEmitter:i}=B.getState();i.emit(G.AvPermission,{[A.PermissionDescriptors]:e.permissionDescriptors,[A.StreamReadyCallback]:(a,s)=>{if(n===a)return;let c=e;if(a&&!e.permissionDescriptors.includes($e.Camera)){const d=t.indexOf(e),l=s!=null&&s.active?d+2:d+1;(s==null?void 0:s.active)&&r&&i.emit(G.BeginRecording,{[A.RecordingMediaTypes]:r,[A.StartRecordingCallback]:h=>o({mediaRecordingUids:h})}),c=t[l]}o({currentPage:c,avStream:a})},[A.StreamCanceledCallback]:()=>{et({status:Y.Abandoned})}})}function gs({pages:e,userId:t,responseGroupUid:n,surveyId:r,questionId:o,next:i}){const{updatePage:a}=de.getState(),{eventEmitFn:s,recorderEventEmitter:c}=B.getState(),d={questionId:o,surveyId:r,visitorId:t,responseGroupUid:n};let l=0;c.emit(X.RecordedTaskPermissionScreen),s(X.RecordedTaskPermissionScreen),c.emit(G.PermissionStatus,{[A.PermissionStatusCallback]:(p,f,m)=>{const g=e[l],{type:v}=g,_=[fe.Screen];if(It(g)){const{permissionDescriptors:y}=g,R=y==null?void 0:y.includes($e.Microphone),x=y==null?void 0:y.includes($e.Camera);R&&_.push(fe.Audio),x&&_.push(fe.Video);const U=(p==null?void 0:p.active)&&!x,M=(p==null?void 0:p.active)&&f;(U||M)&&l++}ho(e[l])&&m&&(l++,c.emit(G.BeginRecording,{[A.RecordingMediaTypes]:_,[A.StartRecordingCallback]:y=>a({mediaRecordingUids:y})})),a({currentPage:e[l],avStream:p,screenPermissionRequested:m,nextQuestion:i,type:v,passthroughData:d,recordingMediaTypes:_})}});const h=e[l];return h.type===J.AvPermission&&Gt({currentPage:h,pages:e}),h}function et({status:e}){const{nextQuestion:t,passthroughData:n,mediaRecordingUids:r,reset:o}=de.getState(),{recorderEventEmitter:i,handleUploadUpdate:a,index:s}=B.getState(),c={value:{taskStatus:e},type:E.RecordedTask,questionId:(n==null?void 0:n.questionId)||1};!n||i.emit(G.FinishTask,{[A.BeginCallback]:d=>{a({mediaRecordingUid:d,isSubmitted:!0,progressPct:0,isComplete:!1})},[A.ProgressCallback]:(d,l)=>{a({mediaRecordingUid:d,progressPct:l.detail,isSubmitted:!1,isComplete:!1})},[A.UploadCallback]:d=>{d&&a({mediaRecordingUid:d,isComplete:!0,isSubmitted:!0,progressPct:100})},[A.PassthroughData]:n,[A.CurrentIndex]:s,[A.TaskResponse]:c,[A.TaskCompleteCallback]:d=>{c.value.taskDurationMillisecond=d,r&&(c.value.mediaRecordingUids=r),o(),t(c)}})}function dn({pages:e}){const{recorderEventEmitter:t,eventEmitFn:n}=B.getState(),{updatePage:r,currentPage:o,recordingMediaTypes:i,screenPermissionRequested:a}=de.getState();if(!o)return;const s=e.indexOf(o);switch(o.type){case J.AvPermission:{const c=a?s+2:s+1;a&&i&&t.emit(G.BeginRecording,{[A.RecordingMediaTypes]:i,[A.StartRecordingCallback]:d=>{r({mediaRecordingUids:d})}}),r({currentPage:e[c]});return}case J.ScreenPermission:t.emit(G.ScreenPermission,{[A.StreamReadyCallback]:(c,d)=>{const l=d?e[s+1]:o;d&&i&&t.emit(G.BeginRecording,{[A.RecordingMediaTypes]:i,[A.StartRecordingCallback]:h=>{r({mediaRecordingUids:h})}}),r({currentPage:l,screenPermissionRequested:!0})},[A.StreamCanceledCallback]:()=>{et({status:Y.Abandoned})}});return;case J.StartTask:n(X.RecordedTaskStart),t.emit(X.RecordedTaskStart),t.emit(G.StartTask),r({currentPage:e[s+1],screenPermissionRequested:!0});return;case J.CompleteTask:return}}const vo="ul-permission-graphics-container",_o="ul-permission-body",wo=j([vo,"ul_recorded-task-inset-spacing"]),Tt=j(["ul-horizontal-button-container","ul-horizontal-button-container-left"]),yo=({richTextBody:e})=>u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),un=({required:e,skipButtonText:t,bottom:n=!1})=>e?null:u(Q,{className:j([n&&"ul-skip-button-below",b.InactiveButton]),onClick:et.bind(null,{status:Y.Abandoned}),children:t||"Skip"}),vs=({content:e,pages:t})=>{const{buttonText:n,taskDetail:r}=e;return u("div",{className:"ul-task-page",children:[u(yo,{richTextBody:r}),u("div",{className:Tt,children:u(Q,{onClick:dn.bind(null,{pages:t}),children:n})})]},"start-task")},_s=({content:e,properties:t})=>{const{buttonText:n,skipButtonText:r}=e,i=u(Se,{properties:t,defaultBody:()=>u("div",{className:Tt,children:[u(Q,{className:"ul-complete-task-button",onClick:et.bind(null,{status:Y.Completed}),children:n}),u(Q,{className:j([b.InactiveButton]),onClick:et.bind(null,{status:Y.GivenUp}),children:r})]})});return u("div",{className:"ul-task-page",children:[u(yo,{richTextBody:e.taskDetail}),i]},"complete-task")},ws=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:o}=e,[i]=B(a=>[a.tabTitle]);return u("div",{children:[u("div",{className:wo,children:[u("p",{style:{marginTop:"auto"},children:e.selectTabText}),u("div",{className:"ul-select-tab-container",children:u("p",{className:_o,children:i})})]}),u("div",{className:n?"":Tt,children:[u(Q,{onClick:dn.bind(null,{pages:t}),children:r}),u(un,{required:n,skipButtonText:o})]})]})},ys=({content:e})=>u("div",{className:j([vo,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"]),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),bs=({content:e,pages:t,required:n})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:o,skipButtonText:i,tryAgainButtonText:a}=e,s=It(t[0])?t[0]:null;return re(()=>{const c=setInterval(()=>{s!==null&&Gt({currentPage:s,pages:t})},1e3);return()=>clearInterval(c)},[s,t]),s?u("div",{children:[u("div",{className:wo,children:u("p",{className:"ul-av-permission-denied-paragraph",children:[u("span",{className:"ul-av-permission-denied-headline",children:r}),u("span",{className:_o,children:o})]})}),u("div",{className:Tt,children:[u(Q,{onClick:Gt.bind(null,{currentPage:s,pages:t}),children:a}),u(un,{required:n,skipButtonText:i})]})]}):null},xs=({stream:e})=>u("video",{autoPlay:!0,className:j(["ul_recorded-task-inset-spacing"]),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),Cs=({content:e,pages:t,required:n})=>{const{skipButtonText:r}=e,o=de(i=>i.avStream);return u("div",{children:[u(xs,{stream:o}),u("div",{className:"ul-vertical-button-container-center",children:[u(Q,{onClick:dn.bind(null,{pages:t}),children:e.buttonText}),u(un,{bottom:!0,required:n,skipButtonText:r})]})]})},ks=({properties:e})=>{const{pages:t,required:n}=e,r=de(i=>i.avStream),o=de(i=>i.currentPage);if(o===void 0)return null;switch(o==null?void 0:o.type){case J.AvPermission:{const i=go(r,o);return i===ye.RequestNeeded?u(ys,{content:o}):i===ye.TryAgain?u(bs,{content:o,pages:t,required:n}):u(Cs,{content:o,pages:t,required:n})}case J.ScreenPermission:return u(ws,{content:o,pages:t,required:n});case J.StartTask:return u(vs,{content:o,pages:t});case J.CompleteTask:return u(_s,{content:o,properties:e});default:return null}},Ss=({className:e,properties:t,next:n,questionId:r})=>{const o=B(),{headers:i,surveyId:a,responseGroupUid:s,userId:c}=o,d=de(),{screenPermissionRequested:l}=d,h=de(v=>v.avStream);let p=de(v=>v.currentPage);p||(p=gs({questionId:r,surveyId:a,next:v=>{n(v)},pages:t.pages,responseGroupUid:s,userId:c}));let f=p.headline,m=p.captionText;const g=go(h,p);return ho(p)&&l&&(f=p.permissionDeniedHeadline,m=p.permissionDeniedCaptionText),It(p)&&g===ye.Ready&&(f=p.permissionGrantedHeadline,m=p.permissionGrantedCaptionText),u("div",{className:j([...ue(b.CardMainContent,i["userleap-platform"])]),children:u("div",{className:j([e,"ul-center-horizontally",b.FadeInTransition]),children:[u(pe,{message:f,properties:{captionText:m}}),u(ks,{properties:t})]})})},Es={"{{user_id}}":"externalUserId","{{email}}":"email"},Ls=(e=void 0,t={})=>{if(!e)return e;let n=e;const r=[];for(const[c,d]of Object.entries(Es))if(n.toLowerCase().includes(c))if(t[d]){const l=new RegExp(c,"gi");n=n.replace(l,t[d])}else r.push(c);if(r.length===0||!n.includes("?"))return n;const o=n.slice(0,n.indexOf("?")),a=n.slice(n.indexOf("?")+1).split("&").map(c=>c.split("=")).filter(c=>!r.includes(c[1]));if(a.length===0)return o;const s=a.map(c=>c.join("=")).join("&");return`${o}?${s}`},Us=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{headers:a,visitorAttributes:s}=B(f=>({headers:f.headers,visitorAttributes:f.visitorAttributes})),c=a["userleap-platform"],d=(f,m=!1)=>{n({value:m?{skipped:!0}:void 0,questionId:o,type:i})},l=f=>{(f.key==="Enter"||f.key===" ")&&n({value:void 0,questionId:o,type:i})},h=()=>u("div",{className:"ul-card-button-group",children:[u("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:Ls(r&&r.buttonUrl,s),id:"ul-card-text__button",onClick:d,onKeyPress:l,rel:"noreferrer",role:"button",tabIndex:0,target:"_blank",children:ze(r)}),r.required===!1&&u("button",{className:"ul-card-skip__button",onClick:f=>d(f,!0),children:cn(r)})]}),p=(f,m)=>f?u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:f},id:"ul-card__text-url-body-container"}):u("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(m?m.split(/\n\s*\n/g):[]).map((g,v)=>u("p",{children:g},v))});return u("div",{className:j(ue(b.CardMainContent,c)),children:u("div",{className:j([e,"ul-card__text-url-prompt",b.FadeInTransition]),children:[u(pe,{message:t}),p(r&&r.richTextBody,r&&r.body),u(Se,{defaultBody:h,properties:r})]},o)})},Is=({className:e,questionId:t})=>{const{border:n,destroy:r,endCard:o,headers:i}=B(c=>({border:c.border,endCard:c.endCard,destroy:c.destroy,headers:c.headers}));re(()=>{setTimeout(()=>{r(De)},2e3)},[r]);const a=o&&o.subheader?u("p",{className:b.Caption,children:o.subheader}):null,s=o&&o.headline?o.headline:"";return u("div",{className:j(ue(b.CardMainContent,i["userleap-platform"])),children:u("div",{className:j([e,"ul-card--thanks",b.FadeInTransition]),children:u("div",{children:u("div",{className:"ul-card--thanks-content",children:[u("div",{className:"ul-thanks-check",children:u("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:n,fillRule:"evenodd"}),u("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:n,fillRule:"evenodd"}),u("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),u(pe,{message:s}),a]})})},t)})},Ue="https://cdn.sprig.com",I={document:void 0,videojs:void 0},Ts=`/* progress control styles */
28
+ `,ze=e=>(e==null?void 0:e.buttonText)||"Next",dn=e=>(e==null?void 0:e.skipButtonText)||"Skip",cs=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{headers:s,useMobileStyling:a,border:c}=B(k=>({headers:k.headers,useMobileStyling:k.useMobileStyling,border:k.border})),[d,l]=G(!1),[m,p]=G(""),[f,h]=G(!1),g=s["userleap-platform"],v=r==null?void 0:r.collectName,w=(r==null?void 0:r.nameLabelText)||"Full Name",_=(r==null?void 0:r.consentText)||"I agree to the stated conditions",U=(r==null?void 0:r.submitButtonText)||"Submit",C=!!m.trim(),I=d&&(!v||C),A=(k,x=!1)=>{k.preventDefault(),k.stopPropagation();let E=null;if(!x){if(!I){h(!0);return}E={submitted:!0},v&&(E.name=m)}n({value:E,questionId:o,type:i})},b=k=>{Qo(k.target)&&(k.preventDefault(),k.stopPropagation(),p(k.target.value))},P=k=>{Ne(k.target)&&(k.target.style.borderColor=f&&!C?Ye:c)},j=k=>{Ne(k.target)&&(k.target.style.borderColor=f&&!C?Ye:en)},V=()=>u("div",{children:[u(fo,{allowTextEntry:!1,border:c,error:f&&!d,index:0,isRadio:!1,isSelected:d,label:_,onUserInputChanged:({selected:k})=>{k!==d&&l(!d)},useMobileStyling:a}),v&&u("input",{"aria-label":w,"aria-placeholder":w,className:R(z(y.ConsentLegalNameInput,a)),"data-gramm":"false",maxLength:250,name:"name",onBlur:j,onFocus:P,onInput:b,placeholder:w,style:f&&!C?{borderColor:Ye}:{},tabIndex:0,value:m}),u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[u(K,{className:I?"":y.ButtonDisabled,onClick:A,children:U}),r.required===!1&&u("button",{className:"ul-card-skip__button",onClick:k=>A(k,!0),children:dn(r)})]})]});return u("div",{className:R(pe(y.CardMainContent,g)),children:u("div",{className:R([e,"ul-card__consent-legal",y.FadeInTransition]),children:[u(fe,{message:t}),u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:r&&r.richTextBody?{__html:r&&r.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"}),u(Se,{properties:r,defaultBody:V,embeddedType:"pdf"})]},o)})},ds=({activeValue:e,border:t,icon:n,isPressed:r,onSubmit:o,range:i,scaleLabelType:s,setActiveValue:a,setIsPressed:c,useMobileStyling:d,value:l})=>{const m=`option-${l}`,p=s===Pe.Number,f=s===Pe.Star,h=p&&l===e,[g,v]=(()=>l<=e&&f||l===e?r?[t,1]:[t,.3]:["",1])(),w=()=>{switch(s){case Pe.Star:return R([...z(y.LikertStar,d),...z(`${y.LikertStar}-${l}`,d)]);case Pe.Smiley:return R([...z(y.LikertSmiley,d),...z(`${y.LikertSmiley}-${l}`,d)]);default:return R(l===i?[...z(y.LikertNumber,d),...z(`${y.LikertNumber}-${l}`,d),...z("likert-last-option",d)]:[...z(y.LikertNumber,d),...z(`${y.LikertNumber}-${l}`,d)])}},_=()=>{a(-1),c(!1)};return u("div",{"aria-label":p?void 0:String(l),className:w(),dangerouslySetInnerHTML:{__html:n},id:m,onClick:()=>o(),onPointerDown:()=>c(!0),onPointerEnter:()=>a(l),onPointerLeave:_,role:"radio",style:{color:p?"":g,borderColor:h?g:"",fillOpacity:h?"":v,zIndex:h?3:"auto"},tabIndex:0})},us=({className:e,labels:t,message:n,next:r,properties:o,questionId:i,type:s})=>{const{border:a,headers:c,useMobileStyling:d}=B(V=>({border:V.border,headers:V.headers,useMobileStyling:V.useMobileStyling})),[l,m]=G(-1),[p,f]=G(!1),h=c["userleap-platform"],g=t&&t.left,v=t&&t.right;let w;const{range:_,scaleLabelType:U,ratingIcons:C}=o;_&&(w=Number(_));const I=w||5,A=V=>{var k,x;switch(U){case Pe.Star:return(k=C[0])==null?void 0:k.svg;case Pe.Smiley:return(x=C[V])==null?void 0:x.svg;default:return String(V+1)}},b=[...Array(I)].map((V,k)=>{const x=k+1;return u(ds,{activeValue:l,border:a,icon:A(k),isPressed:p,onSubmit:()=>r({value:x,questionId:i,type:s}),range:I,scaleLabelType:U,setActiveValue:m,setIsPressed:f,useMobileStyling:d,value:x},k)}),P=V=>{V.preventDefault(),V.stopPropagation(),r({value:null,questionId:i,type:s})},j=()=>u(ie,{children:[u("div",{"aria-label":`Rating (1 - ${I})`,className:"ul-card--likert__numbers",role:"radiogroup",children:b}),u("div",{className:"ul-card--likert__labels",children:[u("span",{children:g}),u("span",{children:v})]}),!o.required&&u("div",{className:"ul-vertical-centered-container",children:u(K,{onClick:P,children:ze(o)})})]});return u("div",{className:R(pe(y.CardMainContent,h)),children:u("form",{className:R([e,"ul-card--likert",y.FadeInTransition]),children:[u(fe,{message:n,properties:o}),u(Se,{properties:o,defaultBody:j})]},i)})},ho=({className:e,message:t,onSubmit:n,options:r=[],properties:o,questionId:i,type:s})=>{const{border:a,headers:c,useMobileStyling:d}=B(b=>({border:b.border,headers:b.headers,useMobileStyling:b.useMobileStyling})),l=r.reduce((b,P)=>(b[P.id]={isSelected:!1},b),{}),[m,p]=G(l),f=c["userleap-platform"],h=s===L.MultipleChoice,g=o.required,v=Object.entries(m).some(([b,P])=>{var k;const j=r.find(x=>`${x.id}`===b),V=P.userText===void 0||P.userText.trim()==="";return((k=j==null?void 0:j.optionProperties)==null?void 0:k.allowsTextEntry)&&V&&P.isSelected}),w=Object.values(m).some(b=>b.isSelected),_=v||g&&!w,U=r.map(({id:b,label:P,value:j,optionProperties:V},k)=>{var O,Y;const x=`${b}`,{allowsTextEntry:E}=V||{allowsTextEntry:!1};return u(fo,{allowTextEntry:E,border:a,error:!1,id:x,index:k,isRadio:h,isSelected:!!((O=m[x])!=null&&O.isSelected),label:P,onUserInputChanged:qe=>I(qe.id,qe.selected,qe.userText),promptText:"Please specify",text:(Y=m[b])==null?void 0:Y.userText,useMobileStyling:d,value:j},x)}),C=b=>{b.preventDefault(),b.stopPropagation(),n(m)},I=(b,P,j)=>{const V=Object.assign({},m);if(h&&P)for(const k of Object.values(V))k.isSelected=!1,delete k.userText;V[b]={isSelected:P,userText:j},p(V)},A=()=>u("div",{children:[u("div",{className:R(z(y.ChoiceGroup,d)),role:h?"radiogroup":"group",children:U}),u("div",{className:"ul-card__button-wrapper",children:u(K,{disabled:_,onClick:C,children:ze(o)})})]});return u("div",{className:R(pe(y.CardMainContent,f)),children:u("form",{className:R([e,"ul-card--multiple",y.FadeInTransition]),id:"text-form",onSubmit:C,children:[u(fe,{message:t,properties:o}),u(Se,{properties:o,defaultBody:A})]},i)})},ps=e=>{const{questionId:t,type:n,next:r,options:o}=e;return u(ho,{...e,onSubmit:s=>{const a=Object.entries(s).find(([,p])=>p.isSelected)||[void 0,void 0],[c,d]=a,l=o.find(p=>`${p.id}`===c),m=d!=null&&d.userText?{[c]:{userText:d.userText}}:null;r({value:l&&c?{[c]:l.value}:{},secondaryValue:m,questionId:t,type:n})}})},fs=e=>{const{questionId:t,type:n,next:r}=e;return u(ho,{...e,onSubmit:i=>{const s={},a=Object.entries(i).reduce((d,[l,m])=>(d[l]=m.isSelected,d),s),c=Object.entries(i).reduce((d,[l,m])=>{if(!m.userText)return d;const p=d||{};return p[l]={userText:m.userText},p},null);r({value:a,secondaryValue:c,questionId:t,type:n})}})},ms=({className:e,props:{labels:t,message:n,properties:r},next:o,questionId:i,type:s})=>{const{border:a,headers:c,useMobileStyling:d}=B(v=>({border:v.border,headers:v.headers,useMobileStyling:v.useMobileStyling})),l=c["userleap-platform"],m=t&&t.left,p=t&&t.right,f=[...Array(11)].map((v,w)=>u("div",{className:R([...z(y.NPSNumber,d),...z(`${y.NPSNumber}-${w}`,d)]),id:`option-${w}`,onClick:()=>o({value:w,questionId:i,type:s}),onKeyPress:_=>{_.preventDefault(),(_.key==="Enter"||_.key===" ")&&o({value:w,questionId:i,type:s})},onPointerDown:_=>{Ne(_.target)&&(_.target.style.zIndex="2",_.target.style.borderColor=a)},onPointerLeave:_=>{Ne(_.target)&&(_.target.style.zIndex="auto",_.target.style.borderColor=en)},role:"radio",tabIndex:0,children:w},w)),h=v=>{v.preventDefault(),v.stopPropagation(),o({value:null,questionId:i,type:s})},g=()=>u("div",{children:[u("div",{className:"ul-card--nps__numbers",children:f}),u("div",{className:"ul-card--nps__labels",children:[u("span",{children:m}),u("span",{children:p})]}),!r.required&&u("div",{className:"ul-vertical-centered-container",children:u(K,{onClick:h,children:ze(r)})})]});return u("div",{className:R(pe(y.CardMainContent,l)),children:u("form",{className:R([e,"ul-card--nps",y.FadeInTransition]),children:[u(fe,{message:n,properties:r}),u(Se,{properties:r,defaultBody:g})]},i)})},hs=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{border:s,headers:a,useMobileStyling:c,update:d}=B(b=>({border:b.border,headers:b.headers,useMobileStyling:b.useMobileStyling,update:b.update})),[l,m]=G(""),p=Ce(null),f=a["userleap-platform"],h=l.trim(),g=r.required===!0&&!h,v=po(p,()=>d()),w=b=>{v(),b.preventDefault(),b.stopPropagation(),Qe(b.target)&&m(b.target.value)},_=b=>{b.preventDefault(),b.stopPropagation(),n({value:l,questionId:o,type:i})},U=r&&r.openTextPlaceholder?r.openTextPlaceholder:"",C=b=>{Qe(b.target)&&(b.target.style.borderColor=s)},I=b=>{Qe(b.target)&&(b.target.style.borderColor=en)},A=()=>u("div",{className:"ul-card-text",children:[u("div",{className:"ul-card-text__container",children:u("textarea",{"aria-label":U,"aria-labelledby":y.QuestionHeader,"aria-multiline":"true","aria-placeholder":U,className:R(z(y.OpenTextInput,c)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:I,onChange:w,onFocus:C,placeholder:U,ref:p,role:"textbox",tabIndex:0})}),u(K,{disabled:g,onClick:_,style:{backgroundColor:g?"":s},children:ze(r)})]});return u("div",{className:R(pe(y.CardMainContent,f)),children:u("form",{className:R([e,"ul-card--text",y.FadeInTransition]),id:"text-form",children:[u(fe,{message:t,properties:r}),u(Se,{defaultBody:A,properties:r})]},o)})};var ye=(e=>(e[e.RequestNeeded=1]="RequestNeeded",e[e.TryAgain=2]="TryAgain",e[e.Ready=3]="Ready",e))(ye||{});const Ut=e=>e.type===J.AvPermission,go=e=>e.type===J.ScreenPermission,gs=(e,t)=>!(Ut(t)?t.permissionDescriptors:[]).includes($e.Camera)||e.getVideoTracks().length>0,vo=(e,t)=>{if(e===void 0)return ye.RequestNeeded;if(e){if(!gs(e,t))return ye.RequestNeeded}else return ye.TryAgain;return ye.Ready},Gn={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},ue=so(e=>({...Gn,reset:()=>{e(Gn)},updatePage:t=>{e(t)}}));function Gt({currentPage:e,pages:t}){const{avStream:n,recordingMediaTypes:r,updatePage:o}=ue.getState(),{recorderEventEmitter:i}=B.getState();i.emit(Z.AvPermission,{[N.PermissionDescriptors]:e.permissionDescriptors,[N.StreamReadyCallback]:(s,a)=>{if(n===s)return;let c=e;if(s&&!e.permissionDescriptors.includes($e.Camera)){const d=t.indexOf(e),l=a!=null&&a.active?d+2:d+1;(a==null?void 0:a.active)&&r&&i.emit(Z.BeginRecording,{[N.RecordingMediaTypes]:r,[N.StartRecordingCallback]:m=>o({mediaRecordingUids:m})}),c=t[l]}o({currentPage:c,avStream:s})}})}function vs({pages:e,userId:t,responseGroupUid:n,surveyId:r,questionId:o,next:i}){const{updatePage:s}=ue.getState(),{eventEmitFn:a,recorderEventEmitter:c}=B.getState(),d={questionId:o,surveyId:r,visitorId:t,responseGroupUid:n};let l=0;c.emit(ee.RecordedTaskPermissionScreen),a(ee.RecordedTaskPermissionScreen),c.emit(Z.PermissionStatus,{[N.PermissionStatusCallback]:(p,f,h,g)=>{const v=e[l],{type:w}=v,_=[ne.Screen];if(Ut(v)){const{permissionDescriptors:U}=v,C=U==null?void 0:U.includes($e.Microphone),I=U==null?void 0:U.includes($e.Camera);C&&_.push(ne.Audio),I&&_.push(ne.Video);const A=(p==null?void 0:p.active)&&!I,b=(p==null?void 0:p.active)&&f;(A||b)&&l++}go(e[l])&&h&&(l++,c.emit(Z.BeginRecording,{[N.RecordingMediaTypes]:_,[N.StartRecordingCallback]:U=>s({mediaRecordingUids:U})})),s({currentPage:e[l],avStream:p,screenPermissionRequested:h,nextQuestion:i,type:w,passthroughData:d,recordingMediaTypes:_,captureStream:g})}});const m=e[l];return m.type===J.AvPermission&&Gt({currentPage:m,pages:e}),m}function Zt({status:e}){const{nextQuestion:t,passthroughData:n,mediaRecordingUids:r,reset:o}=ue.getState(),{recorderEventEmitter:i,handleUploadUpdate:s,index:a}=B.getState(),c={value:{taskStatus:e},type:L.RecordedTask,questionId:(n==null?void 0:n.questionId)||1};!n||i.emit(Z.FinishTask,{[N.BeginCallback]:d=>{s({mediaRecordingUid:d,isSubmitted:!0,progressPct:0,isComplete:!1})},[N.ProgressCallback]:(d,l)=>{s({mediaRecordingUid:d,progressPct:l.detail,isSubmitted:!1,isComplete:!1})},[N.UploadCallback]:d=>{d&&s({mediaRecordingUid:d,isComplete:!0,isSubmitted:!0,progressPct:100})},[N.PassthroughData]:n,[N.CurrentIndex]:a,[N.TaskResponse]:c,[N.TaskCompleteCallback]:d=>{c.value.taskDurationMillisecond=d,r&&(c.value.mediaRecordingUids=r),o(),t(c)}})}function un({pages:e,setIsRequestingPermission:t}){const{recorderEventEmitter:n,eventEmitFn:r}=B.getState(),{updatePage:o,currentPage:i,recordingMediaTypes:s,screenPermissionRequested:a}=ue.getState();if(!i)return;const c=e.indexOf(i);switch(i.type){case J.AvPermission:{const d=a?c+2:c+1;a&&s&&n.emit(Z.BeginRecording,{[N.RecordingMediaTypes]:s,[N.StartRecordingCallback]:l=>{o({mediaRecordingUids:l})}}),o({currentPage:e[d]});return}case J.ScreenPermission:n.emit(Z.ScreenPermission,{[N.ScreenPermissionRequested]:t,[N.StreamReadyCallback]:(d,l)=>{const m=l?e[c+1]:i;l&&s&&n.emit(Z.BeginRecording,{[N.RecordingMediaTypes]:s,[N.StartRecordingCallback]:p=>{o({captureStream:l,mediaRecordingUids:p})}}),o({currentPage:m,screenPermissionRequested:!0,captureStream:l})}});return;case J.StartTask:r(ee.RecordedTaskStart),n.emit(ee.RecordedTaskStart),n.emit(Z.StartTask),o({currentPage:e[c+1],screenPermissionRequested:!0});return;case J.CompleteTask:return}}const _o="ul-permission-graphics-container",wo="ul-permission-body",yo=R([_o,"ul_recorded-task-inset-spacing"]),It=R(["ul-horizontal-button-container","ul-horizontal-button-container-left"]),bo=({richTextBody:e})=>u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),Tt=({required:e,skipButtonText:t,bottom:n=!1})=>e?null:u(K,{className:R([n&&"ul-skip-button-below",y.InactiveButton]),onClick:Zt.bind(null,{status:oe.Abandoned}),children:t||"Skip"}),pn=e=>{const{avStream:t,captureStream:n,recordingMediaTypes:r,updatePage:o}=ue.getState(),i=(r==null?void 0:r.includes(ne.Audio))||(r==null?void 0:r.includes(ne.Video));X(()=>{const s=setInterval(()=>{i&&t&&!t.active?o({avStream:null,currentPage:e[0]}):(!n||!n.active)&&o({captureStream:void 0,currentPage:e[i?1:0]})},1e3);return()=>clearInterval(s)},[t,n,i,e,r,o])},_s=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:o,taskDetail:i}=e;return pn(t),u("div",{className:"ul-task-page",children:[u(bo,{richTextBody:i}),u("div",{className:It,children:[u(K,{onClick:un.bind(null,{pages:t}),children:r}),u(Tt,{required:n,skipButtonText:o})]})]},"start-task")},ws=({content:e,pages:t,properties:n})=>{const{buttonText:r,skipButtonText:o}=e;pn(t);const s=u(Se,{properties:n,defaultBody:()=>u("div",{className:It,children:[u(K,{className:"ul-complete-task-button",onClick:Zt.bind(null,{status:oe.Completed}),children:r}),u(K,{className:R([y.InactiveButton]),onClick:Zt.bind(null,{status:oe.GivenUp}),children:o})]})});return u("div",{className:"ul-task-page",children:[u(bo,{richTextBody:e.taskDetail}),s]},"complete-task")},ys=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:o}=e,[i]=B(c=>[c.tabTitle]),[s,a]=G(!1);return u("div",{children:[u("div",{className:yo,children:[u("p",{style:{marginTop:"auto"},children:e.selectTabText}),u("div",{className:"ul-select-tab-container",children:u("p",{className:wo,children:i})})]}),u("div",{className:n?"":It,children:[u(K,{disabled:s,onClick:un.bind(null,{pages:t,setIsRequestingPermission:a}),children:r}),u(Tt,{required:n,skipButtonText:o})]})]})},bs=({content:e})=>u("div",{className:R([_o,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"]),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),xs=({content:e,pages:t,required:n})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:o,skipButtonText:i,tryAgainButtonText:s}=e,a=Ut(t[0])?t[0]:null;return X(()=>{const c=setInterval(()=>{a!==null&&Gt({currentPage:a,pages:t})},1e3);return()=>clearInterval(c)},[a,t]),a?u("div",{children:[u("div",{className:yo,children:u("p",{className:"ul-av-permission-denied-paragraph",children:[u("span",{className:"ul-av-permission-denied-headline",children:r}),u("span",{className:wo,children:o})]})}),u("div",{className:It,children:[u(K,{onClick:Gt.bind(null,{currentPage:a,pages:t}),children:s}),u(Tt,{required:n,skipButtonText:i})]})]}):null},Cs=({stream:e})=>u("video",{autoPlay:!0,className:R(["ul_recorded-task-inset-spacing"]),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),ks=({content:e,pages:t,required:n})=>{const{skipButtonText:r}=e,{avStream:o}=ue.getState();return pn(t),u("div",{children:[u(Cs,{stream:o}),u("div",{className:"ul-vertical-button-container-center",children:[u(K,{onClick:un.bind(null,{pages:t}),children:e.buttonText}),u(Tt,{bottom:!0,required:n,skipButtonText:r})]})]})},Ss=({properties:e})=>{const{pages:t,required:n}=e,{avStream:r,currentPage:o}=ue.getState();if(o===void 0)return null;switch(o==null?void 0:o.type){case J.AvPermission:{const i=vo(r,o);return i===ye.RequestNeeded?u(bs,{content:o}):i===ye.TryAgain?u(xs,{content:o,pages:t,required:n}):u(ks,{content:o,pages:t,required:n})}case J.ScreenPermission:return u(ys,{content:o,pages:t,required:n});case J.StartTask:return u(_s,{content:o,pages:t,required:n});case J.CompleteTask:return u(ws,{content:o,pages:t,properties:e});default:return null}},Es=({className:e,properties:t,next:n,questionId:r})=>{const o=B(),{headers:i,surveyId:s,responseGroupUid:a,userId:c}=o,d=ue(),{screenPermissionRequested:l}=d,m=ue(v=>v.avStream);let p=ue(v=>v.currentPage);p||(p=vs({questionId:r,surveyId:s,next:v=>{n(v)},pages:t.pages,responseGroupUid:a,userId:c}));let f=p.headline,h=p.captionText;const g=vo(m,p);return go(p)&&l&&(f=p.permissionDeniedHeadline,h=p.permissionDeniedCaptionText),Ut(p)&&g===ye.Ready&&(f=p.permissionGrantedHeadline,h=p.permissionGrantedCaptionText),u("div",{className:R([...pe(y.CardMainContent,i["userleap-platform"])]),children:u("div",{className:R([e,"ul-center-horizontally",y.FadeInTransition]),children:[u(fe,{message:f,properties:{captionText:h}}),u(Ss,{properties:t})]})})},Ls={"{{user_id}}":"externalUserId","{{email}}":"email"},Us=(e=void 0,t={})=>{if(!e)return e;let n=e;const r=[];for(const[c,d]of Object.entries(Ls))if(n.toLowerCase().includes(c))if(t[d]){const l=new RegExp(c,"gi");n=n.replace(l,t[d])}else r.push(c);if(r.length===0||!n.includes("?"))return n;const o=n.slice(0,n.indexOf("?")),s=n.slice(n.indexOf("?")+1).split("&").map(c=>c.split("=")).filter(c=>!r.includes(c[1]));if(s.length===0)return o;const a=s.map(c=>c.join("=")).join("&");return`${o}?${a}`},Is=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{headers:s,visitorAttributes:a}=B(f=>({headers:f.headers,visitorAttributes:f.visitorAttributes})),c=s["userleap-platform"],d=(f,h=!1)=>{n({value:h?{skipped:!0}:void 0,questionId:o,type:i})},l=f=>{(f.key==="Enter"||f.key===" ")&&n({value:void 0,questionId:o,type:i})},m=()=>u("div",{className:"ul-card-button-group",children:[u("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:Us(r&&r.buttonUrl,a),id:"ul-card-text__button",onClick:d,onKeyPress:l,rel:"noreferrer",role:"button",tabIndex:0,target:"_blank",children:ze(r)}),r.required===!1&&u("button",{className:"ul-card-skip__button",onClick:f=>d(f,!0),children:dn(r)})]}),p=(f,h)=>f?u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:f},id:"ul-card__text-url-body-container"}):u("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(h?h.split(/\n\s*\n/g):[]).map((g,v)=>u("p",{children:g},v))});return u("div",{className:R(pe(y.CardMainContent,c)),children:u("div",{className:R([e,"ul-card__text-url-prompt",y.FadeInTransition]),children:[u(fe,{message:t}),p(r&&r.richTextBody,r&&r.body),u(Se,{defaultBody:m,properties:r})]},o)})},Ts=({className:e,questionId:t})=>{const{border:n,destroy:r,endCard:o,headers:i}=B(c=>({border:c.border,endCard:c.endCard,destroy:c.destroy,headers:c.headers}));X(()=>{setTimeout(()=>{r(De)},2e3)},[r]);const s=o&&o.subheader?u("p",{className:y.Caption,children:o.subheader}):null,a=o&&o.headline?o.headline:"";return u("div",{className:R(pe(y.CardMainContent,i["userleap-platform"])),children:u("div",{className:R([e,"ul-card--thanks",y.FadeInTransition]),children:u("div",{children:u("div",{className:"ul-card--thanks-content",children:[u("div",{className:"ul-thanks-check",children:u("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:n,fillRule:"evenodd"}),u("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:n,fillRule:"evenodd"}),u("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),u(fe,{message:a}),s]})})},t)})},Ie="https://cdn.sprig.com",T={document:void 0,videojs:void 0},Ps=`/* progress control styles */
29
29
  .video-js .vjs-control {
30
30
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
31
31
  }
@@ -682,5 +682,5 @@ span.ul-button-text {
682
682
  .vjs-poster {
683
683
  background-size: cover;
684
684
  }
685
- `,Ps=e=>{const t=I.document.createElement("div");return t.className="ul-video-player-loading",t.id=pn(e),["first","second","third","fourth"].map(n=>{const r=I.document.createElement("div");r.className=n,t.appendChild(r)}),t},pn=e=>e+"-loading-spiner",q="hidden",Gn=".m3u8",Dt="questionId",Mt="ul-video-recorder-camera-off-button",Nt="ul-recording-in-session",js=[{type:"link",content:`${Ue}/dependencies/videojs-record-4.5.0.min.css`},{type:"script",content:`${Ue}/dependencies/RecordRTC-5.6.2.js`},{type:"script",content:`${Ue}/dependencies/adapter.8.0.0.min.js`},{type:"script",content:`${Ue}/dependencies/videojs-record-4.5.0.min.js`},{type:"script",content:`${Ue}/userleap-web-upchunk-v2.2.2.js`}],bo=[{type:"link",content:`${Ue}/dependencies/video-js-7.18.0.min.css`},{type:"script",content:`${Ue}/dependencies/video-js-7.18.0.min.js`},{type:"style",content:Ts}],xo="-video-player",Co="-secondary-video-player",ko="-video-recorder";let se,Zn;const we=async({event:e,apiBase:t,headers:n,visitorId:r,envId:o,metadata:i})=>{const a=I.document.documentElement;if(!r||!o)return;const s={event:`SDK - ${e}`,visitorId:r,environmentId:o,metadata:{...i||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:a.clientWidth,clientHeight:a.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${t}/sdk/1/visitors/${r}/analytics`,{method:"POST",cache:"no-cache",headers:n,body:JSON.stringify(s)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",e)},me=async(e,t,n,r,o,i)=>{we({event:`Video Error ${t}`,apiBase:n,headers:r,visitorId:o,envId:i,metadata:{errorMessage:e.message}});const a=I.document.documentElement,s={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:a.clientWidth,clientHeight:a.clientHeight,location:window.location.href,language:navigator.language},c={action:t,err:{message:e.message,stack:e.stack},meta:s,vid:o,envId:i};(await fetch(`${n}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...r,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(c)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",e)},Rs=(e,{type:t,content:n})=>new Promise(function(r,o){let i;t==="script"?(i=I.document.createElement("script"),i.src=n):t==="link"?(i=I.document.createElement("link"),i.rel="stylesheet",i.href=n,i.type="text/css"):(i=I.document.createElement("style"),i.innerHTML=n),i.onload=function(){r(n)},i.onerror=function(){o(n)},i.async=!1,i.id=btoa(n),e.appendChild(i)}),So=(e,t)=>{if(e.length===0)return t&&t();Promise.all(e.reduce((n,r)=>(n.push(Rs(I.document.head,r)),n),[])).then(()=>{I.videojs=I.document.defaultView.videojs,t&&t()}).catch(function(n){console.log(n+" failed to load")})},Yn=(e,t,n)=>{if(t==="start"&&(e.style.visibility="visible"),t==="none")e.style.visibility=q;else if(t==="success")e.style.visibility=q,e.innerHTML="Upload succeeded!";else{const r=Math.round(parseFloat(n));e.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${r}%</span>`,e.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`}},Vt=(e,t)=>{const n=I.videojs(e.id());return n==null?void 0:n.payload[t]},Os=(e,t,n,r,o)=>{const{surveyId:i,responseGroupUid:a,visitorId:s,envId:c}=e.payload;e.on("deviceError",function(){console.warn("device error: ",e.deviceErrorCode),e.deviceErrorCode.message==="Permission denied"?(e.deviceButton.addClass("permission-denied"),n&&n(O.ERROR,{type:O.PERMISSION_DENIED}),we({event:"Video Permission Denied",apiBase:t,headers:o,visitorId:s,envId:c,metadata:{questionId:Vt(e,Dt),responseGroupUid:a,surveyId:i}})):(n&&n(O.ERROR,{type:O.OTHER}),me(new Error(e.deviceErrorCode.message),"recorderDeviceError",t,o,s,c))}),e.on("error",function(d,l){me(l||e.error(),"recorderError",t,o,s,c)}),e.on("startRecord",function(d,l){r(e.uploadProgressLabel,"none"),we({event:"Video Record Start",apiBase:t,headers:o,visitorId:s,envId:c,metadata:{questionId:Vt(e,Dt),responseGroupUid:a,surveyId:i}})}),e.on("finishRecord",async function(){r(e.uploadProgressLabel,"start",0);const d=Vt(e,Dt);if(!i){const g="internal error: missing fields in payload";return n&&n(O.ERROR,{type:O.OTHER}),me(new Error(g),"finishRecord",t,o,s,c),null}e.record().stopDevice();const l=e.cameraOff?O.MEDIA_TYPE_AUDIO:O.MEDIA_TYPE_VIDEO,h=vt();we({event:"Video Record Finish",apiBase:t,headers:o,visitorId:s,envId:c,metadata:{mediaRecordingUid:h,questionId:d,responseGroupUid:a,surveyId:i,mediaType:l}});const p={surveyId:i,updatedAt:new Date().toISOString(),mediaType:l,mediaRecordingUid:h};d&&(p.questionId=d),a&&(p.responseGroupUid=a),s&&(p.visitorId=s);const m=await(async()=>{const g=await fetch(`${t}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(g.ok){const v=await g.json();return n&&n(O.UPLOAD_STARTED,{[O.UPLOAD_ID]:v.upload.id,[O.MEDIA_TYPE]:l,[O.MEDIA_RECORDING_UID]:h}),v.upload.url}else return n&&n(O.ERROR,{type:O.OTHER,response:g}),me(new Error("failed to get upload response with url"),"finishRecord",t,o,s,c),null})();!m||(se=I.document.defaultView.UpChunk.createUpload({endpoint:m,file:new I.document.defaultView.File([e.recordedData],`recording ${l} ${Date.now()}`),chunkSize:5120}),se.startTime=Date.now(),we({event:"Video Upload Start",apiBase:t,headers:o,visitorId:s,envId:c,metadata:{mediaRecordingUid:h,questionId:d,responseGroupUid:a,surveyId:i,mediaType:l,url:m}}),se.on("error",g=>{r(e.uploadProgressLabel,"none"),n&&n(O.UPLOAD_FINISHED,{[O.MEDIA_RECORDING_UID]:h}),me(g,"finishRecord",t,o,s,c)}),se.on("progress",g=>{n&&n(O.UPLOAD_PROGRESS,{[O.MEDIA_RECORDING_UID]:h,[O.UPLOAD_PROGRESS_PCT]:g.detail}),r(e.uploadProgressLabel,"progress",g.detail)}),se.on("success",()=>{r(e.uploadProgressLabel,"success"),n&&n(O.UPLOAD_FINISHED,{[O.MEDIA_RECORDING_UID]:h}),we({event:"Video Upload Success",apiBase:t,headers:o,visitorId:s,envId:c,metadata:{mediaRecordingUid:h,questionId:d,responseGroupUid:a,surveyId:i,mediaType:l,url:m,elapsedMs:se.startTime&&Date.now()-se.startTime}})}))})},Eo=(e,t)=>{const n=new(I.videojs.getComponent("Component"))(e);return n.addClass("ul-buttons-panel"),t.map(r=>{n.addChild(r)}),As(n),n},As=e=>{e.children().forEach(t=>{if(ee[t.name_]){const n=ht(ee[t.name_],`ul-${ee[t.name_]}`);t.el_.appendChild(n)}})},ht=(e,t="")=>{const n=I.document.createElement("span");return n.className="ul-button-text",n.innerHTML=e,n.id=t,n},Lo=(e,t,n,r,o=!1,i)=>{e.addClass("ul-video-player");const a=new(I.videojs.getComponent("Component"))(e);a.addClass("ul-control-panel"),e.progressBar=a.addChild("ProgressControl"),n&&e.src(n),e.audioPlayerPlaceholder=new(I.videojs.getComponent("Component"))(e),e.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const s=n&&n.src?Fs(n.src):null;n&&(o||!s)?(e.children()[0].classList.add("vjs-hidden"),I.document.getElementById(`${e.id()}_html5_api`).style.height="0px"):(e.audioPlayerPlaceholder.hide(),I.document.getElementById(`${e.id()}_html5_api`).style.height="100%",s&&e.poster(s)),e.on("play",()=>{!o&&n&&!s&&Ns(e,!1),i==null||i.play()}),e.on("pause",()=>{i==null||i.pause()}),e.on("seeked",()=>{i==null||i.currentTime(e.currentTime())}),e.on("ratechange",()=>{i==null||i.playbackRate(e.playbackRate())}),e.addChild(e.audioPlayerPlaceholder,{},1),a.addChild(t),e.addChild(a),r&&r(e)},Ds=(e,t,n)=>{e.addClass(`ul${Co}`);const r=new(I.videojs.getComponent("Component"))(e);t&&e.src(t),e.addChild(r),n&&n(e)},Ms=(e,t,n,r,o,i,a,s=!1)=>{Zn=Date.now();const d=Ct(t,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!d)return;d.payload=n;const{surveyId:l,questionId:h,responseGroupUid:p,visitorId:f,envId:m}=n;let g;const v=k=>{const w=Mt,L=Mt+"-audio-only";Yn(d.uploadProgressLabel,"none"),se&&se.startTime>=Zn&&se.abort();const $=I.document.getElementById("ul-camera-button");k?(d.children()[0].classList.add("vjs-hidden"),x.removeClass(w),x.addClass(L),$.innerHTML=ee.TurnOnCamera,d.audioPlayerPlaceholder.removeClass("vjs-hidden"),g==null||g.getTracks().forEach(K=>{K.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(K=>{g=K,K.getVideoTracks().forEach(qe=>{qe.enabled=!1}),d.record().onDeviceReady(K)}).catch(d.record().onDeviceError.bind(d.record()))):(g==null||g.getVideoTracks().forEach(K=>{K.enabled=!0}),d.children()[0].classList.remove("vjs-hidden"),d.record().getDevice(),x.removeClass(L),x.addClass(w),$.innerHTML=ee.TurnOffCamera,d.audioPlayerPlaceholder.addClass("vjs-hidden"))},_=new(I.videojs.getComponent("Button"))(d,{clickHandler:()=>{_.hasClass(q)||(we({event:"Video Delete Button Clicked",apiBase:r,headers:a,visitorId:f,envId:m,metadata:{questionId:h,responseGroupUid:p,surveyId:l}}),v(d.cameraOff),o(O.DELETE,{}),x.removeClass(q),_.addClass(q))}});_.addClass("ul-video-recorder-delete-button"),_.el_.appendChild(ht(ee.DeleteButton,"ul-delete-button"));const y=I.document.getElementById(t),R=()=>{y.classList.contains("vjs-fullscreen")&&d.cameraOff?y.style.display="table":y.style.display="flex"};R();const x=new(I.videojs.getComponent("Button"))(d,{clickHandler:()=>{d.record().isRecording()||(d.cameraOff=!d.cameraOff,we({event:"Video Camera Button Clicked",apiBase:r,headers:a,visitorId:n.visitorId,envId:n.envId,metadata:{questionId:h,responseGroupUid:p,surveyId:l,cameraOff:d.cameraOff}}),v(d.cameraOff),!_.hasClass(q)&&_.addClass(q),o(O.DELETE,{}),R())}});x.addClass(Mt),x.el_.appendChild(ht(ee.TurnOffCamera,"ul-camera-button"));const U=new(I.videojs.getComponent("Button"))(d,{clickHandler:()=>{const k=I.document.getElementById("ul-recorder-toggle");if(d.record().isRecording())d.record().stop(),k&&(k.innerHTML=ee.RecordButton),U.removeClass(Nt),_.removeClass(q);else{const w=I.document.getElementById("ul-recording-countdown-screen");if(w)w.remove(),k&&(k.innerHTML=ee.RecordButton),v(d.cameraOff),o(O.DELETE,{}),x.removeClass(q),_.addClass(q),U.removeClass(Nt),T.show();else{U.addClass(Nt),T.hide(),x.addClass(q),_.addClass(q),k&&(k.innerHTML=ee.StopButton);const L=I.document.createElement("div");L.id="ul-recording-countdown-screen",y.insertBefore(L,y.children[1]),L.style.height=`${y.offsetHeight}px`,Uo(d,3)}}}});U.addClass("ul-video-recorder-toggle-button"),U.el_.appendChild(ht(ee.RecordButton,"ul-recorder-toggle"));const M=I.document.createElement("p");M.style.visibility="hidden",M.className="ul-upload-progress-label",e.appendChild(M),d.uploadProgressLabel=M;const C=Eo(d,[_,x,"PlayToggle",U,"FullscreenToggle"]),T=C.children().find(k=>k.name_==="FullscreenToggle");T.hasClass("vjs-disabled")&&T.hide();const P=C.children().find(k=>k.name_==="PlayToggle");P.hide(),i&&x.addClass(q),!i&&_.addClass(q),Lo(d,C,i,!1,s),d.on("stopRecord",()=>{U.hide(),P.show(),T.show(),_.removeClass(q)}),d.on("deviceReady",()=>{U.show(),P.hide(),_.addClass(q)}),Os(d,r,o,Yn,a),i&&(d.deviceButton&&d.deviceButton.hide(),d.src(i),P.show(),U.hide(),_.removeClass(q));const N=[{name:"microphone"}];!d.cameraOff&&N.push({name:"camera"}),Promise.all(N.map(k=>{var w;return(w=navigator==null?void 0:navigator.permissions)==null?void 0:w.query(k)})).then(k=>{k.reduce((L,$)=>L&$.state==="granted",!0)&&d&&(d.deviceButton&&d.deviceButton.hide(),!i&&d.record().getDevice())}).catch(k=>{})},Uo=(e,t=3)=>{const n=I.document.getElementById("ul-recording-countdown-screen");n&&t===0?(n.remove(),e.record().start()):n&&(n.innerHTML=`<span class='ul-countdown-text'>Recording in... ${t}</span>`,setTimeout(()=>{Uo(e,t-1)},1e3))},Io=e=>{const t=I.document.createElement("div");return t.className="ul-video-container",t.appendChild(Ps(e)),t},Zt=(e,t)=>{const n=I.document.createElement("video");n.id=e,n.className="video-js vjs-default-skin ul-video-player-video";const r=I.document.createElement("p");r.className="vjs-no-js",r.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const o=I.document.createElement("a");return o.href="https://videojs.com/html5-video-support/",o.target="_blank",o.innerHTML="supports HTML5 video",r.appendChild(o),n.appendChild(r),t.appendChild(n),t},Ns=(e,t)=>{t?(e.children()[0].classList.add("vjs-hidden"),e.audioPlayerPlaceholder.show(),I.document.getElementById(`${e.id()}_html5_api`).style.height="0px"):(e.children()[0].classList.remove("vjs-hidden"),e.audioPlayerPlaceholder.hide(),I.document.getElementById(`${e.id()}_html5_api`).style.height="100%")},Ct=(e,t)=>I.document.getElementById(e)?t?I.videojs(e,t):I.videojs(e):(console.error(`Error in finding player element with ID, ${e}`),null),Vs=(e,t,n,r=!1,o="https://api.sprig.com",i=document,a=null,s=null)=>{I.document=i;const c=e+xo,d=Io(c);return I.document.addEventListener("securitypolicyviolation",l=>{me(new Error(`Voice & Video feature violates ${l.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",o,{})}),So(bo,()=>{I.document.getElementById(pn(c)).remove(),Zt(c,d);const l={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const h=e+Co;Zt(h,d);const p=Ct(c,l),f=Ct(h,{muted:!0,...l});if(!p||!f)return;Ds(f,a,s),a||f.addClass(q);const m=Eo(p,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),g=m.children().find(v=>v.name_==="FullscreenToggle");g.hasClass("vjs-disabled")&&g.hide(),Lo(p,m,t,n,r,f)}catch(h){me(new Error(`Error when creating video player object ${h}`),"playerDeviceError",o,{});return}}),d},Hs=(e,t={},n="https://api.userleap.com",r,o,i,a=!1,s=document)=>{I.document=s;const c=e+ko,d=Io(c);return I.document.addEventListener("securitypolicyviolation",l=>{me(new Error(`Voice & Video feature violates ${l.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",n,i,t.visitorId,t.envId)}),So(bo.concat(js),()=>{Zt(c,d),I.document.getElementById(pn(c)).remove();try{Ms(d,c,t,n,r,o,i,a)}catch(l){me(new Error(`Error when creating video recorder player object ${l}`),"recorderDeviceError",n,i,t.visitorId,t.envId);return}}),d},$s=e=>{const t=e+ko;if(!!I.document.getElementById(t)&&!!I.videojs){try{if(!I.videojs(t).record().stream)return}catch{return}I.videojs(t).record().stop(),I.videojs(t).record().stopDevice()}},Bs=e=>{const t=Ct(e+xo);t==null||t.pause()},Fs=e=>{if(!e)return null;const t=e.match(/https:\/\/stream.mux.com\/(.*)/);let n=t?t[1]:null;return n.includes(Gn)&&(n=n.replace(Gn,"")),n?`https://image.mux.com/${n}/thumbnail.jpg?time=0`:null},O={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},ee={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},We="ul-card-video__player_recorder",zs="ul-card-video__skip_button",qs="ul-video-interview-form",Qn="ul-video-btn",Ws=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{apiURL:a,envId:s,handleUploadUpdate:c,headers:d,responseGroupUid:l,surveyId:h,viewDocument:p,visitorId:f}=B(L=>({apiURL:L.apiURL,envId:L.envId,handleUploadUpdate:L.handleUploadUpdate,headers:L.headers,responseGroupUid:L.responseGroupUid,surveyId:L.surveyId,viewDocument:L.viewDocument,visitorId:L.userId})),[m,g]=Z(!1),[v,_]=Z(null),[y,R]=Z(null),[x,U]=Z(0),M=d["userleap-platform"],C=r&&r.videoUrl,T=(L,$)=>{L===O.UPLOAD_STARTED?(_($[O.UPLOAD_ID]),R($[O.MEDIA_RECORDING_UID]),g(!0)):L===O.DELETE?(_(null),R(null),g(!1)):L===O.UPLOAD_PROGRESS?isNaN($[O.UPLOAD_PROGRESS_PCT])?c({mediaRecordingUid:$[O.MEDIA_RECORDING_UID],isComplete:!0}):c({mediaRecordingUid:$[O.MEDIA_RECORDING_UID],progressPct:$[O.UPLOAD_PROGRESS_PCT]}):L===O.UPLOAD_FINISHED&&c({mediaRecordingUid:$[O.MEDIA_RECORDING_UID],isComplete:!0})},P=L=>{if(L&&L.children.length===0){const $=Vs(We,{src:C,type:"application/x-mpegURL"},void 0,r.mediaType===O.MEDIA_TYPE_AUDIO,a,p);L.appendChild($)}},N=L=>{if(L&&L.children.length===0){const $=Hs(We,{surveyId:h,responseGroupUid:l,questionId:o,visitorId:f,envId:s},a,T,void 0,{...d,"x-ul-video-recorder-origin":"sdk"},r.mediaType===O.MEDIA_TYPE_AUDIO,p);L.appendChild($)}},k=L=>{L.preventDefault(),L.stopPropagation(),$s(We),v&&y?(c({mediaRecordingUid:y,isSubmitted:!0}),n({value:{mediaRecordingUid:y},questionId:o,type:i})):n({value:null,questionId:o,type:i})},w=()=>u(Se,{defaultBody:()=>u("button",{className:`${Qn} ul-record-response-btn`,onClick:L=>{L.preventDefault(),L.stopPropagation(),Bs(We),U(1)}}),properties:r});return u("div",{className:j(ue(b.CardMainContent,M)),style:{marginTop:"unset"},children:u("form",{className:j([e,b.VideoCard,b.FadeInTransition]),id:qs,children:[u(pe,{message:t,properties:r}),u("div",{id:"ul-card-voice__video",children:[u("div",{children:[u("div",{id:"ul-question-player-container",style:{display:x===0?"":"none"},children:[u("div",{id:We,ref:P}),w()]}),u("div",{style:{display:x===1?"block":"none"},children:[u("button",{className:`${Qn} ul-back-question-btn`,onClick:L=>{L.preventDefault(),L.stopPropagation(),U(0)}}),u("div",{id:"ul-recorder-player-container",ref:N})]})]}),u(Q,{disabled:!m,onClick:k,children:ze(r)}),u("button",{className:`ul-card-text__button ${b.InactiveButton}`,id:zs,onClick:k,style:{display:r.required?"none":"block",...m?{display:"none"}:{}},children:cn(r)})]})]})})},Gs=({className:e})=>{const{headers:t,uploadProgress:n}=B(a=>({headers:a.headers,uploadProgress:a.uploadProgress}));let r,o;Object.values(n).filter(a=>a.isSubmitted).length>1?(r="Your responses are processing",o="Please keep this tab open until your responses are fully processed."):(r="Your response is processing",o="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(n).filter(a=>a.isSubmitted).map(a=>a.progressPct)));return u("div",{className:j(ue(b.CardMainContent,t["userleap-platform"])),children:u("div",{className:j([e,"ul-card--uploading",b.FadeInTransition]),children:[u("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:b.LoadingSpinnerContainer,role:"progressbar",children:u("div",{className:b.LoadingSpinner,children:[u("div",{className:b.LoadingSpinnerFirst}),u("div",{className:b.LoadingSpinnerSecond}),u("div",{className:b.LoadingSpinnerThird}),u("div",{className:b.LoadingSpinnerFourth})]})}),u(pe,{message:`${r} (${i}% complete)`}),u("p",{className:b.Caption,children:o})]})})},Kn=()=>u("svg",{alt:"Powered by Sprig",fill:"none",height:"13",viewBox:"0 0 100 13",width:"100",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M3.0369 0.839981H0.0249023V8.99998H1.3209V6.53998H2.8569C4.8969 6.53998 6.2409 5.37598 6.2409 3.62398C6.2409 1.95598 4.9689 0.839981 3.0369 0.839981ZM3.0009 5.35198H1.3209V2.02798H3.0009C4.1769 2.02798 4.9689 2.67598 4.9689 3.62398C4.9689 4.65598 4.1769 5.35198 3.0009 5.35198Z",fill:"#5D696F"}),u("path",{d:"M9.90653 3.21598C8.15453 3.21598 6.90653 4.45198 6.90653 6.17998C6.90653 7.90798 8.15453 9.14398 9.90653 9.14398C11.6585 9.14398 12.9065 7.90798 12.9065 6.17998C12.9065 4.45198 11.6585 3.21598 9.90653 3.21598ZM9.90653 8.01598C8.88653 8.01598 8.15453 7.23598 8.15453 6.17998C8.15453 5.11198 8.88653 4.34398 9.90653 4.34398C10.9265 4.34398 11.6585 5.11198 11.6585 6.17998C11.6585 7.23598 10.9265 8.01598 9.90653 8.01598Z",fill:"#5D696F"}),u("path",{d:"M20.9631 3.35998L19.7391 7.11598L18.3951 3.35998H17.3271L15.9831 7.12798L14.7591 3.35998H13.4151L15.4431 8.99998H16.5351L17.8671 5.08798L19.1871 8.99998H20.2791L22.3071 3.35998H20.9631Z",fill:"#5D696F"}),u("path",{d:"M25.7246 3.21598C24.0086 3.21598 22.8206 4.51198 22.8206 6.17998C22.8206 7.85998 24.0206 9.14398 25.7966 9.14398C27.0206 9.14398 28.0166 8.54398 28.3766 7.52398H27.0086C26.7806 7.88398 26.3606 8.05198 25.8086 8.05198C24.7526 8.05198 24.2126 7.40398 24.0926 6.55198H28.5206C28.7606 4.64398 27.5966 3.21598 25.7246 3.21598ZM25.7366 4.27198C26.6126 4.27198 27.2126 4.76398 27.2846 5.68798H24.1166C24.2606 4.89598 24.8006 4.27198 25.7366 4.27198Z",fill:"#5D696F"}),u("path",{d:"M31.1297 4.12798V3.35998H29.8817V8.99998H31.1297V5.44798C31.6337 4.78798 32.3177 4.45198 33.2177 4.41598V3.23998C32.3537 3.23998 31.6457 3.56398 31.1297 4.12798Z",fill:"#5D696F"}),u("path",{d:"M36.8222 3.21598C35.1062 3.21598 33.9182 4.51198 33.9182 6.17998C33.9182 7.85998 35.1182 9.14398 36.8942 9.14398C38.1182 9.14398 39.1142 8.54398 39.4742 7.52398H38.1062C37.8782 7.88398 37.4582 8.05198 36.9062 8.05198C35.8502 8.05198 35.3102 7.40398 35.1902 6.55198H39.6182C39.8582 4.64398 38.6942 3.21598 36.8222 3.21598ZM36.8342 4.27198C37.7102 4.27198 38.3102 4.76398 38.3822 5.68798H35.2142C35.3582 4.89598 35.8982 4.27198 36.8342 4.27198Z",fill:"#5D696F"}),u("path",{d:"M45.4886 0.47998V3.80398C45.0086 3.43198 44.3966 3.21598 43.6766 3.21598C42.0926 3.21598 40.8206 4.53598 40.8206 6.16798C40.8206 7.82398 42.0926 9.14398 43.6766 9.14398C44.3966 9.14398 45.0086 8.92798 45.4886 8.54398V8.99998H46.7246V0.47998H45.4886ZM43.8566 8.01598C42.8246 8.01598 42.0686 7.17598 42.0686 6.16798C42.0686 5.17198 42.8246 4.34398 43.8566 4.34398C44.4806 4.34398 45.0686 4.55998 45.4886 5.15998V7.18798C45.0686 7.79998 44.4806 8.01598 43.8566 8.01598Z",fill:"#5D696F"}),u("path",{d:"M54.6797 3.21598C53.9597 3.21598 53.3477 3.43198 52.8797 3.79198V0.47998H51.6317V8.99998H52.8797V8.55598C53.3477 8.92798 53.9597 9.14398 54.6797 9.14398C56.2637 9.14398 57.5477 7.82398 57.5477 6.16798C57.5477 4.53598 56.2637 3.21598 54.6797 3.21598ZM54.4997 8.01598C53.8757 8.01598 53.2997 7.79998 52.8797 7.21198V5.13598C53.2997 4.54798 53.8757 4.34398 54.4997 4.34398C55.5437 4.34398 56.2997 5.17198 56.2997 6.16798C56.2997 7.17598 55.5437 8.01598 54.4997 8.01598Z",fill:"#5D696F"}),u("path",{d:"M63.3347 3.34798L61.3907 7.76398L59.2667 3.34798H57.9347L60.8147 9.08398L59.6267 11.784H60.9347L64.6547 3.34798H63.3347Z",fill:"#5D696F"}),u("path",{d:"M71.1466 4.34661C69.8092 4.05038 69.131 3.53001 69.131 2.80065C69.131 2.04705 69.8546 1.47822 70.8142 1.47822C71.8034 1.47822 72.5496 2.10339 72.5496 2.9321V2.99813H73.9165V2.9321C73.9165 1.41764 72.5883 0.272705 70.8271 0.272705C69.9784 0.272705 69.2009 0.533191 68.6379 1.0057C68.3584 1.23619 68.1339 1.52487 67.9805 1.8511C67.8271 2.17733 67.7486 2.53303 67.7506 2.89273C67.7451 3.22255 67.8137 3.54949 67.9515 3.84994C68.0894 4.15038 68.293 4.41686 68.5478 4.63012C69.0218 5.04266 69.6945 5.34798 70.5463 5.5388C71.9806 5.85502 72.7078 6.39296 72.7078 7.13686C72.7078 7.94316 71.9156 8.55076 70.8682 8.55076C69.7804 8.55076 68.9599 7.87531 68.9599 6.97996V6.91393H67.5918V6.97996C67.5918 8.56348 68.9942 9.75688 70.8535 9.75688C71.7426 9.75688 72.5588 9.48731 73.1518 8.99662C73.446 8.75831 73.6827 8.4581 73.8445 8.1179C74.0063 7.7777 74.0891 7.40611 74.087 7.03024C74.087 5.6854 73.0991 4.78217 71.1466 4.34661Z",fill:"#5D696F"}),u("path",{d:"M78.7986 2.50806C78.2874 2.50175 77.7823 2.6176 77.3263 2.84576C76.8703 3.07391 76.4768 3.40759 76.1795 3.81837V2.66738H74.8789V12.0752H76.1795V8.48716C76.4768 8.8979 76.8703 9.23152 77.3263 9.45957C77.7824 9.68763 78.2875 9.80335 78.7986 9.79687C80.8167 9.79687 82.3381 8.23031 82.3381 6.15246C82.3381 4.07462 80.8167 2.50806 78.7986 2.50806ZM80.9835 6.42264C80.9316 6.9629 80.6921 7.46879 80.3056 7.8544C79.919 8.24001 79.4093 8.48156 78.863 8.53804C78.1369 8.61074 77.4605 8.40295 76.9583 7.95407C76.4561 7.50518 76.1795 6.86365 76.1795 6.15246C76.1795 4.7846 77.2122 3.75295 78.5815 3.75295C79.2904 3.75295 79.9306 4.02191 80.3776 4.51018C80.8387 5.01116 81.054 5.69025 80.9835 6.42264Z",fill:"#5D696F"}),u("path",{d:"M98.2908 2.6692V3.80747C97.6776 2.97875 96.7302 2.50806 95.6583 2.50806C93.6482 2.50806 92.1323 4.04615 92.1323 6.08582C92.1323 8.1255 93.6482 9.66299 95.6583 9.66299C96.7345 9.66299 97.6819 9.19714 98.2908 8.37691V8.55198C98.2908 9.96891 97.3906 10.8843 95.9974 10.8843C95.0561 10.8843 94.2718 10.4766 93.8996 9.79384L93.8806 9.7587H92.5389L92.5695 9.84654C92.7961 10.514 93.2392 11.0889 93.8303 11.4822C94.4233 11.8723 95.1726 12.0783 95.9974 12.0783C97.0552 12.0783 97.9554 11.7451 98.6017 11.1157C99.2481 10.4862 99.5915 9.6012 99.5915 8.56773V2.6692H98.2908ZM97.5611 7.842C97.0092 8.36418 96.2225 8.58348 95.4001 8.44294C94.9132 8.35796 94.4664 8.12184 94.1245 7.76889C93.7827 7.41593 93.5636 6.96452 93.4992 6.48019C93.3833 5.66541 93.631 4.89364 94.1786 4.36418C94.6383 3.92741 95.2542 3.68788 95.8919 3.69782C96.0464 3.69795 96.2006 3.71031 96.3531 3.73477C97.3459 3.89349 98.1314 4.70403 98.2632 5.71024C98.3749 6.53835 98.1179 7.31436 97.5611 7.842Z",fill:"#5D696F"}),u("path",{d:"M90.705 0.0995975C90.4602 0.046773 90.2043 0.0911971 89.9925 0.223269C89.7806 0.35534 89.6299 0.564452 89.5729 0.805409C89.5159 1.04637 89.5571 1.29982 89.6877 1.51098C89.8183 1.72215 90.0277 1.87407 90.2708 1.93391C90.3415 1.94954 90.4136 1.95747 90.486 1.95754C90.72 1.9579 90.9458 1.87325 91.1206 1.71973C91.2955 1.5662 91.407 1.35452 91.4341 1.125C91.4611 0.89547 91.4017 0.664135 91.2673 0.475046C91.1329 0.285958 90.9327 0.152325 90.705 0.0995975V0.0995975Z",fill:"#5D696F"}),u("path",{d:"M89.8366 8.39143H88.715C87.9178 8.39143 87.4389 7.85531 87.4389 6.95693C87.4389 6.08096 87.8681 5.03659 88.7432 3.76444L88.7548 3.74748V3.38825L85.0271 2.86727C85.0284 2.71553 84.9886 2.56622 84.9118 2.43478C84.8351 2.30335 84.7241 2.19458 84.5905 2.11973C84.2563 1.938 83.8908 1.938 83.5879 2.11368C83.4361 2.2023 83.3122 2.33077 83.23 2.4848C83.1477 2.63884 83.1103 2.8124 83.1219 2.98618C83.1336 3.15996 83.1938 3.32714 83.2958 3.46914C83.3979 3.61114 83.5379 3.72238 83.7001 3.79049L82.5405 9.63753H83.8283L84.8977 4.08551L86.9115 4.42111C86.3701 5.38007 86.0953 6.27421 86.0953 7.07869C86.0953 8.56347 87.0041 9.53576 88.4734 9.62965V9.63753H91.1341V2.69099H89.8366V8.39143Z",fill:"#5D696F"})]}),Zs=()=>{const{border:e,cards:t,headers:n,index:r,marketingUrl:o,showSurveyBrand:i,slugName:a,surveyId:s,viewedCardCount:c}=B(g=>({border:g.border,cards:g.cards,headers:g.headers,index:g.index,marketingUrl:g.marketingUrl,showSurveyBrand:g.showSurveyBrand,slugName:g.slugName,surveyId:g.surveyId,viewedCardCount:g.viewedCardCount})),d=Ce(null),l=t.filter(g=>g.type!==E.Uploading&&g.type!==E.Thanks),h=Ki(t,r),p=c+1,f=p/(p+h);re(()=>{d.current&&(d.current.style.width=`${f*100}%`)},[f]);const m=()=>i?u("a",{href:`${o}?utm_source=survey_branding&utm_medium=website&utm_campaign=${a}&utm_content=${s}`,rel:"noreferrer",style:{display:"block",margin:"5px 0"},target:"_blank",children:u(Kn,{})}):null;return!l||l.length===1?u("footer",{className:"ul-footer",style:i?{}:{marginBottom:"10px"},children:m()}):u("footer",{className:`ul-footer ${n["userleap-platform"]==="link"?"ul-footer__link":""}`,children:[l.length>1&&u("div",{id:"ul-progress-bar-container",children:u("div",{id:"ul-progress-bar-current",ref:d,style:{border:`1px solid ${e||"#000"}`}})}),i&&u("a",{href:`${o}?utm_source=survey_branding&utm_medium=website&utm_campaign=${a}&utm_content=${s}`,rel:"noreferrer",style:{display:"block",margin:"5px 0"},target:"_blank",children:u(Kn,{})})]})},Ys=()=>{const{answers:e,border:t,cards:n,close:r,configureExitOnOverlayClick:o,destroy:i,endCard:a,eventEmitFn:s,fontFamily:c,headers:d,index:l,next:h,showStripes:p,update:f,useMobileStyling:m,viewDocument:g}=B(w=>({answers:w.answers,border:w.border,cards:w.cards,close:w.close,configureExitOnOverlayClick:w.configureExitOnOverlayClick,destroy:w.destroy,endCard:w.endCard,eventEmitFn:w.eventEmitFn,fontFamily:w.fontFamily,headers:w.headers,index:w.index,next:w.next,showStripes:w.showStripes,update:w.update,useMobileStyling:w.useMobileStyling,viewDocument:w.viewDocument})),v=Ce(null),_=Ce(!1),{props:y,type:R,name:x}=n[l],U=n.length;re(()=>{v.current&&(v.current.classList.contains("ul-app--visible")||v.current.classList.add("ul-app--visible"),!_.current&&s&&(_.current=!0,s(D.SurveyAppeared)))},[s]),re(()=>{f()},[l,f]),re(()=>{o(()=>r())},[r,o]);const M=()=>r(De),C=w=>{w.key==="Enter"&&M()},T=async function(w){h({data:w,completeSurvey:()=>{i(De)},endCard:a}),Qo(g)};if(e){for(const w of e)if(w.questionId===x){let L;if(R===E.MultipleChoice){const $=y.options.find(({value:K})=>K===w.value);if(!$)break;L={[$.id]:$.value}}else L=w.value;T({value:L,type:R,questionId:w.questionId});break}}const P=()=>[je.Email,je.Link].includes(d["userleap-platform"])?!1:!a||l+1!==U,N=()=>m?{borderColor:t}:{borderColor:t,margin:"15px"},k=()=>{const w={className:"ul-card",next:T,questionId:x,type:R};switch(R){case E.ConsentLegal:return F(ls,{...w,...y,key:x});case E.Likert:return F(ds,{...w,...y,key:x});case E.MultipleChoice:return F(us,{...w,...y,key:x});case E.MultipleSelect:return F(ps,{...w,...y,key:x});case E.NPS:return F(fs,{...w,key:x,props:y});case E.Open:return F(ms,{...w,...y,key:x});case E.RecordedTask:return F(Ss,{...w,...y,key:x});case E.TextUrlPrompt:return F(Us,{...w,...y,key:x});case E.Thanks:return F(Is,{...w,...y,key:x});case E.Uploading:return F(Gs,{...w,...y,key:x});case E.VideoVoice:return F(Ws,{...w,...y,key:x});default:return null}};return u("div",{className:j("ul-app",Me(d)?"ul-app--visible":"ul-app--overlay"),id:De,ref:v,style:{"--theme":t,...c?{fontFamily:c.replace(";","")}:{}},children:u("div",{className:"ul-app__container",children:[u("div",{className:j(z(b.CardContainer,m)),style:N(),children:[p&&u("div",{className:"ul-header__container",children:u("div",{className:"ul-header",children:"For development purposes only"})}),k(),u(Zs,{})]}),P()&&u("div",{className:j(z(b.CloseContainer,m)),children:u("div",{"aria-label":"Close button",className:b.CloseButton,onClick:M,onKeyPress:C,role:"button",tabIndex:0,children:u("svg",{fill:"none",height:"18px",viewBox:"0 0 13 13",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})})]})})},Qs=`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:left;margin:auto}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container{background:#ffffff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;overflow:auto;padding:20px 20px 5px;position:relative;text-align:center;word-break:break-word}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;margin-bottom:3px;display:flex;gap:16px;justify-content:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0 5px 20px}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:left;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email{flex-grow:55;display:flex}.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{padding-top:15px;margin-bottom:5px}.ul-question{color:#343442;display:block;font-size:20px;line-height:125%;font-weight:500;cursor:default;text-align:left}.ul-caption{flex:1 0 auto;margin-top:8px;margin-bottom:15px;font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:left}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.choice-label-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%;height:fit-content;flex:0 0 fit-content}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:transparent;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:0;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:#6c6c6e80}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.select-checkbox{height:16px;width:16px;border-radius:3px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 3px 3px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.fade-in-transition{animation:fadeIn .4s ease-in;-webkit-animation:fadeIn .4s ease-in;-moz-animation:fadeIn .4s ease-in;-o-animation:fadeIn .4s ease-in;-ms-animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-ms-keyframes fadeIn{0%{opacity:0}to{opacity:1}}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{box-shadow:unset;border-radius:unset;border:none!important;position:unset}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:white}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.likert-number--mobile{border:2px solid #e6e6e6;margin-left:-2px}.likert-number--desktop{border:1px solid #e6e6e6;margin-left:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-number-1{border-top-left-radius:5px;border-bottom-left-radius:5px}.likert-last-option{border-top-right-radius:5px;border-bottom-right-radius:5px}.likert-star--mobile{margin-left:-2px}.likert-star--desktop{margin-left:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;font-size:18px;line-height:24px;height:67px}.likert-smiley--mobile{margin-left:-2px}.likert-smiley--desktop{margin-left:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--likert__labels span:last-child{text-align:right}.select-label{flex:1;overflow-wrap:anywhere;cursor:pointer;padding-left:15px}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid #e6e6e6;margin-left:-2px}.nps-number--desktop{border:1px solid #e6e6e6;margin-left:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.nps-number-0{border-top-left-radius:5px;border-bottom-left-radius:5px}.nps-number-10{border-top-right-radius:5px;border-bottom-right-radius:5px}.ul-card--nps__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--nps__labels span:last-child{text-align:right}.ul-card-text{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:white}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}#ul-card-voice__video{align-items:center;display:flex;flex-direction:column}#ul-card-voice__video>div{margin-bottom:10px;width:100%}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#ffffff;border-radius:5px;text-align:left;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:#4c4c4c}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:30px}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none}b{font-weight:500}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;left:0;position:absolute;top:0;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:auto;flex-grow:1;width:100%}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.close-container--desktop,.close-container--mobile{height:22px;width:22px;border-radius:22px;background-color:#fff;align-items:center;justify-content:center}.close-container--desktop{top:25px;right:25px}.close-container--mobile{top:15px;right:10px}.close-container{background:transparent;box-sizing:border-box;display:flex;position:absolute}.close-btn{height:18px;width:18px;align-items:center;justify-content:center;display:flex;cursor:pointer}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}#ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px;max-width:250px;margin:25px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{width:100%;background:rgba(0,0,0,.01);border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:1;margin:0;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}
686
- `,Ks=(e,t)=>{const n=[...e],r=new Set([E.VideoVoice,E.RecordedTask]);return e.some(o=>r.has(o.type))&&n.push({name:-2,props:{routingOptions:[]},type:E.Uploading}),t&&n.push({name:-1,props:{routingOptions:[]},type:E.Thanks}),n},Js=({mode:e=null,viewWindow:t,viewDocument:n})=>{const r=n.documentElement;return{mode:e,sw:t.screen.width,sh:t.screen.height,cw:r.clientWidth,ch:r.clientHeight,p:t.location.href,l:t.navigator.language}};function Xs(e,t=!0){var x;const{answers:n,apiURL:r,customStyles:o,endCard:i,eventEmitFn:a,fontFamilyURL:s,frame:c,UpChunk:d,viewDocument:l,viewWindow:h}=e,p=Me(e.headers)?e.frame:l.body,f=V,m=Ks(e.cards,!!i);ft.configure(f,{cards:m,hasEndCard:!!i,apiURL:r,UpChunk:d}),B.setState({apiURL:r,answers:n,border:e.border,index:e.startingQuestionIdx||0,cards:m,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:a,fontFamily:e.fontFamily,frame:c,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:Js({mode:e.mode,viewWindow:h,viewDocument:l}),mode:e.mode,recorder:ft,recorderEventEmitter:f,responseGroupUid:e.responseGroupUid,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,styleNonce:e.styleNonce,surveyId:e.surveyId,tabTitle:e.tabTitle,uploadingCardViewed:!1,uploadProgress:{},useMobileStyling:e.useMobileStyling,useDesktopPrototype:e.useDesktopPrototype,userId:e.userId,viewDocument:e.viewDocument,visitorAttributes:e.visitorAttributes,viewedCardCount:e.startingQuestionIdx||0});const{seen:g}=B.getState();g();const{head:v}=l,_=l.createElement("style");if(_.id="sprig-style",_.textContent=Qs,_.nonce=e.styleNonce,v.appendChild(_),e.fontFamily&&s&&parent){const U=l.createElement("link");U.rel="stylesheet",U.href=s,v.appendChild(U)}if(e.customStyles&&nr(l,o,e.styleNonce),!d)if(e.installationMethod!==xe.Npm){const U=l.createElement("script");U.src="https://cdn.sprig.com/userleap-web-upchunk-v2.2.2.js",U.onload=()=>{ft.setUpChunk(h.UpChunk)},U.onerror=()=>{console.warn("[Sprig] - recording functionality not configured due to UpChunk library load failure")},v.appendChild(U)}else console.warn("[Sprig] - recording functionality not configured due to missing UpChunk dependency");const y="2.21.5",R=a||((x=c.eventEmitter)==null?void 0:x.emit);R==null||R(X.VerifyViewVersion,{[Ie.ViewVersion]:y}),p&&t&&He(u(Ys,{}),p)}const ea={configure:Xs};window.UserLeap&&window.Sprig&&(window.Sprig._gtm?window.Sprig=window.UserLeap:window.UserLeap=window.Sprig);window.UserLeap||(window.UserLeap=window.Sprig);window.Sprig||(window.Sprig=window.UserLeap);const ta="rgba(255,255,255, 0.95)",na="rgba(0,0,0,0.9)",ra="360px",Ht="0px",To=()=>{window.UserLeap.container=document.createElement("div"),window.UserLeap.container.className="ul-container",document.body.appendChild(window.UserLeap.container)},Po=e=>{const t=window.UserLeap.container;if(!!t)try{document.body.removeChild(t),window.UserLeap.container=null,V.emit(D.SurveyLifeCycle,{state:"dismissed"}),V.emit(D.SurveyClosed,{name:D.SurveyClosed,initiator:e})}catch(n){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+t),n instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",n)}},jo=()=>{V.on(D.SurveyWillClose,({initiator:e})=>{Po(e)})},oa=(e,t)=>{const r={...{position:"fixed",overflow:"auto",top:"0px",left:"0px",display:"none",height:"100%",width:"100%",transition:"background-color 0.3s ease-out",zIndex:2147483646}},o=t?e.overlayStyleMobile:e.overlayStyle;r["background-color"]=o==="light"?ta:na,t||(r.margin="auto"),window.UserLeap.container&&Object.assign(window.UserLeap.container.style,r)},ia=(e,t,n)=>{var s,c;const r={position:"fixed",bottom:"0px",right:Ht,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646},o=Object.assign({},t,window.UserLeap);let i,a=!1;return n?((s=window.UserLeap.windowDimensions)!=null&&s.width?r.width=`${window.UserLeap.windowDimensions.width}px`:r.width="100%",(c=window.UserLeap.windowDimensions)!=null&&c.height?r.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`:window.UserLeap.maxHeight?r.maxHeight=window.UserLeap.maxHeight:r.maxHeight=`${document.body.clientHeight-20}px`,["light","dark"].includes(o.overlayStyleMobile)&&(a=!0)):(r.width=ra,r.maxHeight=window.UserLeap.maxHeight||"66vh",o.framePosition===Ze.BottomLeft?i={left:Ht}:o.framePosition===Ze.TopLeft?i={left:Ht,top:"0px"}:o.framePosition===Ze.TopRight?i={top:"0px"}:o.framePosition===Ze.Center&&(a=!0,i={margin:"auto",position:"static"},r.maxHeight=null)),a&&oa(o,n),Object.assign(e.style,r,i),a},sa=(e,t)=>{var s,c;const n="ul-frame";To();const r=document.createElement("iframe");r.id=n,r.setAttribute("title","Sprig User Feedback Dialog");const o=ia(r,e,t);V.on(D.SurveyFadingOut,()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}),jo(),r.setHeight=d=>{parseInt(r.style.height)!=d&&(r.style.height=`${d}px`,V.emit(D.SurveyHeight,{name:D.SurveyHeight,contentFrameHeight:r.clientHeight}))},(s=window.UserLeap.container)==null||s.appendChild(r),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{V.emit(D.CloseSurveyOnOverlayClick)}),V.emit(D.SurveyLifeCycle,{state:"presented"}),V.emit(D.SurveyPresented,{name:D.SurveyPresented});const i=(c=r.contentWindow)==null?void 0:c.document;i&&(i.open("text/html","replace"),i.write("<!doctype html><head></head><body></body></html>"),i.close());const a=i==null?void 0:i.head;return{frameId:n,contentWinDocHead:a,contentWindow:r.contentWindow,hasOverlay:o,iframe:r}},aa="!optimizely_experiments_";class la{constructor(){ie(this,"_optimizelyData",{})}setOptimizelyExperiment(t){if(!t||typeof t!="object")return!1;const{experiments:n}=t;try{return Object.keys(this._optimizelyData).map(r=>{delete this._optimizelyData[r]}),n&&n.map(r=>{const{id:o,variation:i}=r,a=this.transformExperimentId(o);i&&typeof i=="string"&&(this._optimizelyData[a]=i)}),!0}catch(r){return r instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",r),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(t){return this._optimizelyData[this.transformExperimentId(t)]}transformExperimentId(t){return aa+t}getAndSetWebOptimizelyExperiments(){var t;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const n=(t=window.optimizely.get("state"))==null?void 0:t.getExperimentStates({isActive:!0});if(n){const r=Object.keys(n).map(o=>{var i,a;return(i=n[o].variation)!=null&&i.name?{id:o,variation:(a=n[o].variation)==null?void 0:a.name}:{id:o,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r}),!0}return!1}return!1}catch(n){return n instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",n),!1}}}const gt=new la;Object.freeze(gt);class ca{constructor(t,n){ie(this,"paused");ie(this,"queue");ie(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(n)}flush(t){const n=t.length;if(n)for(let r=0;r<n;r++)this.push(t[r])}isPaused(){return this.paused}pause(){this.paused=!0}unpause(){this.paused=!1;const t=this.queue.slice();this.empty(),this.flush(t)}push(t){if(this.paused)this.queue.push(t);else if(t instanceof Function)t();else{const n=Array.prototype.slice.call(t,1),r=t[0],o=this.ul[r];o instanceof Function?o.apply(this.ul,n):r&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",r)}}perform(t){if(this.paused){let n=()=>{};const r=new Promise(function(o){n=function(){o(t())}});return this.queue.push(n),r}else return t()}empty(){this.queue.length=0}}const tt="userleap.ids",Yt="userleap.pageviews",da=["popState","pushState","replaceState"],ua={test:"test"},Ge="!email",pa=["ios","android"],be="environments",Qt="pageUrl",Ee="visitors",Jn="ul-view-sdk-script",Xn=Object.freeze({contains:(e,t)=>t.includes(e),notContains:(e,t)=>!t.includes(e),exactly:(e,t)=>t===e,notExactly:(e,t)=>t!==e,startsWith:(e,t)=>t.startsWith(e),endsWith:(e,t)=>t.endsWith(e),regex:(e,t)=>new RegExp(e).test(t),legacy:(e,t)=>new RegExp(e,"i").test(t)});function fn(e,t){const{matchType:n,pattern:r}=e;return(n?Xn[n]:Xn.legacy)(r,t)}function fa(e,t){const{pageUrlEvents:n,interactiveEvents:r,dismissOnPageChange:o}=window.UserLeap._config;if(!o)return!0;const i=[];n&&n.length&&i.push(...n),r&&r.length&&i.push(...r);const a=e&&i.find(s=>s.id===e);return a?fn(a,window.location.href):t===window.location.href}function nt(e){const{pageUrlEvents:t,interactiveEvents:n,dismissOnPageChange:r,platform:o}=window.UserLeap._config;o&&o!==je.Web||(t&&wa(window.location.href),n&&(Oo(),ma()),r&&e&&da.includes(e.type)&&window.UserLeap("dismissActiveSurvey",ce.PageChange))}const Ro={capture:!0},ma=()=>{const t=window.UserLeap._config.interactiveEvents.filter(r=>fn(r,window.location.href)).map(r=>{const{name:o,properties:i}=r,{selector:a,innerText:s}=i;return a?c=>(Ne(c.target)&&c.target.closest(a)&&window.UserLeap("track",o),!1):c=>(Ne(c.target)&&c.target.innerText===s&&window.UserLeap("track",o),!1)}),n=r=>t.forEach(o=>o(r));window.UserLeap._config.interactiveEventsHandler=n,window.addEventListener("click",n,Ro)},Oo=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,Ro),delete window.UserLeap._config.interactiveEventsHandler};function ha(){["hashchange","popstate"].forEach(e=>window.addEventListener(e,nt,!0))}function ga(){["hashchange","popstate"].forEach(e=>window.removeEventListener(e,nt,!0)),window.UserLeap._config.interactiveEvents&&Oo()}function le(e,t,n){const r=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(o=>{r.push(o),o===be?r.push(window.UserLeap.envId):o===Ee&&r.push(mn())}),n&&r.push(n),r.join("/")}function va(e,t){let n=le("1",[be],"questions?");return e!=null&&(n+=`&vid=${e}`),t&&(t.surveyId&&(n+=`&surveyid=${t.surveyId}`),t.surveyTemplateId&&(n+=`&surveytemplateid=${t.surveyTemplateId}`)),n}function _a(){try{if(typeof localStorage<"u"&&(localStorage.setItem("is_available","yes"),localStorage.getItem("is_available")==="yes"))return localStorage.removeItem("is_available"),!0}catch{return!1}return!1}function Oe(e){if(!window.UserLeap.localStorageAvailable)return null;const t=localStorage.getItem(tt);if(t)try{const r=JSON.parse(t)[window.UserLeap.envId];return r&&r[e]||null}catch(n){n instanceof Error&&(n.stack=t,window.UserLeap.reportError("Failed to parse local storage credentials",n)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",n)}return null}function te(e,t){if(!window.UserLeap.localStorageAvailable)return;const n=localStorage.getItem(tt);let r={};if(n)try{r=JSON.parse(n)}catch(i){i instanceof Error&&(i.stack=n,window.UserLeap.reportError("Failed to parse local storage credentials",i)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",i)}let o=r[window.UserLeap.envId];o?o[e]=t:o={[e]:t},r[window.UserLeap.envId]=o;try{localStorage.setItem(tt,JSON.stringify(r))}catch(i){i instanceof Error&&console.warn(`[Sprig] (ERR-426) Unable to write to Local Storage:: ${i.message}`)}}function Ao(){window.previewMode||(window.UserLeap.visitorId=vt(),te("vid",window.UserLeap.visitorId),V.emit(D.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}))}function mn(){return window.previewMode?"0":window.UserLeap.visitorId||""}function wa(e){if(!window.UserLeap.localStorageAvailable||e.endsWith("mock_snippet.html"))return;const t=window.UserLeap._config.pageUrlEvents;if(t&&t.length){let s=!1;for(let c=0;c<t.length&&(s=fn(t[c],e),!s);c++);if(!s)return}window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const n=10,r=1;let o=[];const i={viewedAt:Date.now(),location:e},a=localStorage.getItem(Yt);try{if(o=a?JSON.parse(a):[],Array.isArray(o)||(o=[]),o.length>0){const s=o[o.length-1],c=(Date.now()-s.viewedAt)/1e3;(s.location!=e&&c>r||c>n)&&(window.UserLeap._queue.push(["track",Qt,null,{url:e}]),o.push(i))}else window.UserLeap._queue.push(["track",Qt,null,{url:e}]),o.push(i);o.length>5&&o.splice(0,o.length-5);try{localStorage.setItem(Yt,JSON.stringify(o))}catch(s){s instanceof Error&&console.warn(`[Sprig] Unable to write to Local Storage: ${s.message}`)}}catch(s){s instanceof Error&&(s.stack=a||"",window.UserLeap.reportError("trackPageView",s)),console.warn("[Sprig] (ERR-425) Failed to update page views in local storage")}}function ya(){const e="Backbone"in window&&window.Backbone&&window.Backbone.history?window.Backbone.history:window.history;"pushState"in e&&(e.pushState=(t=>function(...r){const o=t.apply(this,r),i=new Event("pushState");return window.dispatchEvent(i),nt(i),o})(e.pushState)),"replaceState"in e&&(e.replaceState=(t=>function(...r){const o=t.apply(this,r),i=new Event("replaceState");return window.dispatchEvent(i),nt(i),o})(e.replaceState)),ha()}async function $t(e,t){const n=mn();e&&!t&&(window.UserLeap._config.mode=ua.test);const r=await _e(va(n,e),{},0,!0);return r.ok?(r.json.delay&&await _t(r.json.delay),Do(r.json)):(r.reportError&&r.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",r.error),window.UserLeap.reportError("getQuestions",r.error)),{success:!1,surveyState:"no survey"})}const Do=e=>{var N,k;const{context:t,endCard:n,locale:r,productConfig:o,questions:i,responseGroupUid:a,surveyId:s,uuid:c,vid:d}=e,l=ot(window.UserLeap),h=hn(l),p=ba(l);if(d==null||!i||!i.length)return{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(window.UserLeap.container){const w="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(w),{success:!1,message:w,surveyState:"no survey"}}if(d!==window.UserLeap.visitorId&&c!==window.UserLeap.visitorId&&!window.previewMode){const w="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(w)),{success:!1,message:w,surveyState:"no survey"}}Bt.disable(),V.emit(D.SurveyWillPresent,{name:D.SurveyWillPresent,[er.SurveyId]:s});let f,m=document.createElement("div"),g,v,_;const y=w=>{const{[Ie.ViewVersion]:L}=w;L!==l["x-ul-sdk-version"]&&Po(),V.removeListener(X.VerifyViewVersion,y)};V.on(X.VerifyViewVersion,y),Me(l)?(f="ul-direct-embeded-frame",g=document.head,v=window,_=!1,h&&(To(),m.id=f,window.UserLeap.container.appendChild(m),jo(),V.emit(D.SurveyLifeCycle,{state:"presented"}),V.emit(D.SurveyPresented,{name:D.SurveyPresented}))):{frameId:f,contentWinDocHead:g,contentWindow:v,hasOverlay:_,iframe:m}=sa(o,p),window.UserLeap.frameId=f,window.UserLeap.useMobileStyling=p;const R=w=>{V.on(D.CloseSurveyOnOverlayClick,w)},x=Object.assign({frame:m,envId:window.UserLeap.envId,surveyId:s,userId:c,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},cards:i,context:t,locale:r,fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,apiURL:window.UserLeap._API_URL,responseGroupUid:a,headers:l,endCard:n,useMobileStyling:p,mobileSDKVersion:window.UserLeap.mobileSDKVersion,configureExitOnOverlayClick:R,eventEmitFn:V.emit.bind(V),ulEvents:Jt,viewDocument:v==null?void 0:v.document,viewWindow:v,tabTitle:document.title,startingQuestionIdx:(N=window.UserLeap.config)==null?void 0:N.startingQuestionIdx,styleNonce:window.UserLeap.styleNonce},window.UserLeap._config);(k=window.UserLeap.config)!=null&&k.startingQuestionIdx&&(window.UserLeap.config={...window.UserLeap.config,startingQuestionIdx:null}),window.UserLeap.customStyles&&(x.customStyles=window.UserLeap.customStyles),v&&(v.__cfg=x);function U(){const w=document.createElement("script");return window.UserLeap.nonce&&w.setAttribute("nonce",window.UserLeap.nonce),w.id=Jn,w}const M=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:x.path,C=document.getElementById(Jn);C&&C.remove();const T=U(),P=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};return x.installationMethod===xe.Npm?(ea.configure(x),_&&window.UserLeap.container&&P()):M&&(T.src=M,_&&T.addEventListener("load",()=>{window.UserLeap.container&&P()}),v==null||v.addEventListener("error",w=>{w.target instanceof HTMLScriptElement&&w.target.src===M&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0})),g==null||g.appendChild(T),{success:!0,surveyState:"ready"}};function ba(e){if(window.UserLeap.useMobileStyling!==void 0)return window.UserLeap.useMobileStyling;const t=window.UserLeap.windowDimensions&&window.UserLeap.windowDimensions.width||document.body.clientWidth;return hn(e)||t>10&&t<Fo}function hn(e){return pa.includes(e[ae.Platform])}function xa(e){let t=e.length;for(;t;){const n=Math.floor(Math.random()*t);t-=1;const r=e[t];e[t]=e[n],e[n]=r}}function Ca(e){if(!e)return;window.UserLeap._config=e,e.mute&&window.UserLeap._queue.pause();const{interactiveEvents:t,pageUrlEvents:n,dismissOnPageChange:r}=e;t&&xa(t),(t||n||r)&&(ya(),nt())}async function _e(e,t,n=0,r=!1){var i,a;t.headers=Object.assign(ot(window.UserLeap),t.headers);const o=await ge(e,t,n,r);if(o.ok){const s=(i=o.headers)==null?void 0:i.get("Authorization"),c=s?s.split(" "):void 0,d=c&&c.length===2?c[1]:void 0,l=(a=o.headers)==null?void 0:a.get(ae.VisitorID);d&&l&&(l!==window.UserLeap.visitorId||window.UserLeap.token!==d)&&(te("token",d),te("vid",l),V.emit(D.VisitorIDUpdated,{visitorId:l}),window.UserLeap.token=d,window.UserLeap.visitorId=l)}return o.json&&o.json.logMessage&&console.warn(`[Sprig] ${o.json.logMessage}`),o}async function ka(e){var t;!((t=e==null?void 0:e.json)!=null&&t.delay)||(window.UserLeap.delayingSurvey=!0,await _t(e.json.delay),window.UserLeap.delayingSurvey=!1)}const Sa=function(e){if(!window.UserLeap)return;const t=async(r={})=>{var p,f;const{userId:o,anonymousId:i,metadata:a={},properties:s}=r;let{eventName:c}=r;if(window.UserLeap.debugMode&&c!==Qt&&console.info("[DEBUG] Sprig track",r),e.mode==="test")return;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!o){const m="[Sprig] - Skipping tracking without userId";return console.warn(m),{success:!1,message:m,surveyState:"no survey"}}if(!c||c.trim().length===0){c=c?String(c):"";const m="[Sprig] - Invalid event name "+c;return console.warn(m),{success:!1,message:m,surveyState:"no survey"}}const d=window.location.href;if(a.url||(a.url=d),(f=(p=window.UserLeap)==null?void 0:p._config)!=null&&f.optimizelyEnabled){const m=ot(window.UserLeap);hn(m)||gt.getAndSetWebOptimizelyExperiments(),a.optimizelyExperiments=Object.assign({},gt.getAllOptimizelyExperiments())}o&&(window.UserLeap.userId=o),i&&(window.UserLeap.partnerAnonymousId=i),s&&(a.eventProperties=s);const l=window.UserLeap.delayingSurvey?await _e(le("1",[Ee],"events/batch"),{body:JSON.stringify({events:[{event:c,metadata:a}]}),method:"POST"},0,!0):await _e(le("1",[Ee],"events"),{body:JSON.stringify({event:c,metadata:a}),method:"POST"},0,!0);if(!l.ok){const m="[Sprig] (ERR-421) Failed to track event";return l.reportError&&(console.warn(m,l.error),l.error&&window.UserLeap.reportError("track",l.error)),{success:!1,message:m,error:l.error,surveyState:"no survey"}}o&&te("uid",o),i&&te("aid",i);const h=l.json;return await ka(l),fa(h.eventId,d)?Do(h):{success:!1,message:"Study should not be displayed after page navigation",surveyState:"no survey"}},n={async displaySurvey(r){return console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",ce.Override),$t({surveyId:r},!0)},_previewSurvey(r){window.UserLeap("dismissActiveSurvey",ce.Override),$t({surveyTemplateId:r},!1)},_reviewSurvey(r){window.UserLeap("dismissActiveSurvey",ce.Override),$t({surveyId:r},!1)},previewSurvey(r){n._previewSurvey(r)},reviewSurvey(r){n._reviewSurvey(r)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(r=ce.API){V.emit(D.SurveyWillClose,{name:D.SurveyWillClose,initiator:r})},async setAttribute(r,o){if(!r||!o&&o!==0){const i="[Sprig] - Disregarding empty attribute / value provided";return console.warn(i),{success:!1,message:i}}return this.setAttributes({[r]:o})},async setAttributes(r){if(r==null||Object.keys(r).length===0){const o="[Sprig] - Disregarding empty attributes provided";return console.warn(o),{success:!1,message:o}}return this.identifyAndSetAttributes({attributes:r})},async identifyAndSetAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",r),e.mode==="test")return;if(r===null||typeof r!="object"||!(r.userId||r.anonymousId||r.attributes)){const d="[Sprig] - Disregarding empty payload provided";return console.warn(d),{success:!1,message:d}}const{userId:o,anonymousId:i,attributes:a}=r;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!o){const d="[Sprig] - Skipping tracking without userId";return console.warn(d),{success:!1,message:d}}if(!a&&(!o||window.UserLeap.userId===o)&&(!i||window.UserLeap.partnerAnonymousId===i))return{success:!0};const s={};o&&(s.userId=window.UserLeap.userId=o),i&&(s.partnerAnonymousId=window.UserLeap.partnerAnonymousId=i);let c;return a?(a.email&&!Object.prototype.hasOwnProperty.call(a,Ge)&&(a[Ge]=a.email,delete a.email),c=await _e(le("1",[be,Ee],"attributes"),{body:JSON.stringify(a),method:"PUT"}),!c.ok&&c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await _e(le("1",[be,Ee]),{body:JSON.stringify(s),method:"PUT"}),a&&a[Ge]&&(window.UserLeap.email=a[Ge]),c.ok&&(o&&te("uid",o),i&&te("aid",i)),{success:!!c.ok}},async removeAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig removeAttributes",r),e.mode==="test")return;if(r==null||r.length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}if(e.requireUserIdForTracking&&!window.UserLeap.userId){const i="[Sprig] - Skipping tracking without userId";return console.warn(i),{success:!1,message:i}}const o=await _e(le("1",[be,Ee],"attributes"),{body:JSON.stringify({delete:r}),method:"DELETE"});return!o.ok&&o.reportError&&(console.warn("[Sprig] (ERR-433) Remove attributes failed",o.error),o.error&&window.UserLeap.reportError("removeAttributes",o.error)),{success:!!o.ok}},async addSurveyListener(r){V.on(D.SurveyLifeCycle,r)},async removeSurveyListener(r){V.removeListener(D.SurveyLifeCycle,r)},async addListener(r,o){V.on(r,o)},async removeListener(r,o){V.removeListener(r,o)},async removeAllListeners(){V.removeAllListeners()},setVisitorAttribute(r,o){return console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"),n.setAttribute(r,o)},async setEmail(r){return n.setAttribute(Ge,r)},async setVisitorEmail(r){return console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"),n.setEmail(r)},async setUserId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setUserId",r),r==null){const i=`[Sprig] - Invalid userId ${r}`;return console.warn(i),{success:!1,message:i}}if(e.mode==="test"||r===window.UserLeap.userId)return;window.UserLeap.userId=r;const o=await _e(le("1",[be,Ee]),{body:JSON.stringify({userId:r}),method:"PUT"});if(!o.ok){o.reportError&&(console.warn("[Sprig] (ERR-420) Failed to set user id",o.error),o.error&&window.UserLeap.reportError("setUserId",o.error));return}te("uid",r)},async setPartnerAnonymousId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setPartnerAnonymousId",r),r==null){const o=`[Sprig] - Invalid partnerAnonymousId ${r}`;return console.warn(o),{success:!1,message:o}}return window.UserLeap.partnerAnonymousId=r,te("aid",r),{success:!0}},async track(r,o,i={}){return t({eventName:r,properties:o,metadata:i})},async identifyAndTrack(r){return await t(r)},applyStyles(r){if(window.UserLeap.customStyles=r,window.UserLeap.container){const o=window.UserLeap.container.children[0].contentDocument;if(o){const i=o.getElementById(b.CustomStyle);i?i.textContent=r:nr(o,r,window.UserLeap.styleNonce)}}},setWindowDimensions(r,o){var c,d;const i=typeof r=="string"?parseInt(r,10):r,a=typeof o=="string"?parseInt(o,10):o;if(!isNaN(i)&&!isNaN(a)&&(window.UserLeap.windowDimensions={width:i,height:a}),!window.UserLeap.frameId)return;const s=document.getElementById(window.UserLeap.frameId);!s||(window.UserLeap.useMobileStyling&&((c=window.UserLeap.windowDimensions)!=null&&c.width&&(s.style.width=`${window.UserLeap.windowDimensions.width}px`),(d=window.UserLeap.windowDimensions)!=null&&d.height&&(s.style.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`),s.contentDocument&&(s.style.height=String(rr(s.contentDocument))+"px")),V.emit(D.SurveyDimensions,{name:D.SurveyDimensions,contentFrameWidth:s.clientWidth,contentFrameHeight:s.clientHeight}))},logoutUser(){window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,window.UserLeap.localStorageAvailable&&(localStorage.removeItem(tt),localStorage.removeItem(Yt)),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),Ao(),window.UserLeap._queue.unpause()},teardown(){ga(),window.UserLeap("dismissActiveSurvey",ce.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(r){const o=JSON.parse(r);gt.setOptimizelyExperiment(o)}};Object.assign(window.UserLeap,n)};async function Ea(e){const t=ot(window.UserLeap);let n=await ge(le("1",[be],"config"),{headers:t});const r="TypeError";if(window.UserLeap.error=n.error,!n.ok&&n.error&&n.error.name===r&&(window.UserLeap._API_URL="https://api.sprig.com",window.UserLeap.reportError("sprigDomainRequest",n.error),n=await ge(le("1",[be],"config"),{headers:t})),!n.ok)return n.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",n.error),n.error&&window.UserLeap.reportError("applyRemoteConfig",n.error)),Ft("Disabled: failed to fetch configuration"),e;const o=n.json;return o!=null&&o.disabled?(Ft(`Disabled: ${o.disabled}`),{disabled:o.disabled}):Object.assign({},e,o)}async function La(e,t){const n=window.__cfg&&window.__cfg.mode,r=mn(),o=window.UserLeap.envId,i=window.document.documentElement,a={mode:n,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:i.clientWidth,clientHeight:i.clientHeight,location:window.location.href,language:window.navigator.language},s={action:e,err:{message:t.message,stack:t.stack},meta:a,vid:r,envId:o};(await _e(le("1",null,"errors"),{method:"POST",headers:{[ae.Error]:window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(s)},0,!0)).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}function Ua(e={}){async function t(){if(window.UserLeap.loaded)return;if(window.UserLeap.UPDATES=Jt,window.UserLeap.reportError=La,window.UserLeap.loaded=!0,window.UserLeap._config=Object.assign({},e,window.UserLeap.config),window.UserLeap.delayingSurvey=!1,window.UserLeap._config&&typeof window.UserLeap._config=="object")for(const s in window.UserLeap._config)window.UserLeap[s]=window.UserLeap._config[s];if(!window.UserLeap.envId)if(window.UserLeap.appId)window.UserLeap.envId=window.UserLeap.appId;else throw new Error("Missing Environment id");window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const n=_a();window.UserLeap.localStorageAvailable=n;const r=window.UserLeap.sampleRate;if(r)if(!n)window.UserLeap.debugMode&&console.info("[DEBUG] Sprig cannot sample users without localStorage permissions");else{let s=Oe("sampled");if(s===null&&(s=Math.random()<r,te("sampled",s)),!s)return}else n&&Oe("sampled")!==null&&te("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const o=[...window.UserLeap._queue];window.UserLeap._queue=new ca(window.UserLeap,[]),window.UserLeap._queue.pause();for(let s=0;s<o.length;s++)window.UserLeap._queue.push(o[s]);const i=Oe("token");i?(window.UserLeap.token=i,window.UserLeap.visitorId=Oe("vid"),window.UserLeap.userId=Oe("uid"),window.UserLeap.partnerAnonymousId=Oe("aid")):(window.UserLeap.localStorageAvailable&&localStorage.removeItem(tt),Ao());const a=await Ea(e);Sa(a),await Ca(a),window.UserLeap._queue.unpause(),V.emit(D.SDKReady),V.emit(D.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}document.readyState==="complete"?t():window.attachEvent?window.attachEvent("onload",t):window.addEventListener("load",t,!1)}class kt{constructor(){ie(this,"UPDATES",Jt)}displaySurvey(t){window.Sprig("displaySurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,n){window.Sprig("setAttribute",t,n)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,n){window.Sprig("addListener",t,n)}removeListener(t,n){window.Sprig("removeListener",t,n)}removeAllListeners(){window.Sprig("removeAllListeners")}setEmail(t){window.Sprig("setAttribute","!email",t)}setUserId(t){window.Sprig("setUserId",t)}setPartnerAnonymousId(t){window.Sprig("setPartnerAnonymousId",t)}track(t,n={},r={}){window.Sprig("track",t,n,r)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,n){window.Sprig("setWindowDimensions",t,n)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}}const Kt={configure:e=>{if(!e.envId&&!e.environmentId)throw new Error("Initialization Error: Sprig configure requires an environmentId");if(e.envId||(e.envId=e.environmentId||""),e.installationMethod=xe.Npm,window.Sprig)return window.Sprig;window.Sprig=function(){window.Sprig._queue.push(arguments)},Object.getOwnPropertyNames(kt.prototype).map(n=>{n!=="constructor"&&(window.Sprig[n]=kt.prototype[n])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,Ua(e),window.Sprig}},Ia={sprig:Kt,SprigAPI:kt,configure:Kt.configure};exports.DismissReason=ce;exports.SprigAPI=kt;exports.SprigEvent=D;exports.default=Ia;exports.sprig=Kt;
685
+ `,js=e=>{const t=T.document.createElement("div");return t.className="ul-video-player-loading",t.id=fn(e),["first","second","third","fourth"].map(n=>{const r=T.document.createElement("div");r.className=n,t.appendChild(r)}),t},fn=e=>e+"-loading-spiner",q="hidden",Zn=".m3u8",Dt="questionId",Mt="ul-video-recorder-camera-off-button",Nt="ul-recording-in-session",Rs=[{type:"link",content:`${Ie}/dependencies/videojs-record-4.5.0.min.css`},{type:"script",content:`${Ie}/dependencies/RecordRTC-5.6.2.js`},{type:"script",content:`${Ie}/dependencies/adapter.8.0.0.min.js`},{type:"script",content:`${Ie}/dependencies/videojs-record-4.5.0.min.js`},{type:"script",content:`${Ie}/userleap-web-upchunk-v2.2.2.js`}],xo=[{type:"link",content:`${Ie}/dependencies/video-js-7.18.0.min.css`},{type:"script",content:`${Ie}/dependencies/video-js-7.18.0.min.js`},{type:"style",content:Ps}],Co="-video-player",ko="-secondary-video-player",So="-video-recorder";let ae,Yn;const we=async({event:e,apiBase:t,headers:n,visitorId:r,envId:o,metadata:i})=>{const s=T.document.documentElement;if(!r||!o)return;const a={event:`SDK - ${e}`,visitorId:r,environmentId:o,metadata:{...i||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:s.clientWidth,clientHeight:s.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${t}/sdk/1/visitors/${r}/analytics`,{method:"POST",cache:"no-cache",headers:n,body:JSON.stringify(a)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",e)},me=async(e,t,n,r,o,i)=>{we({event:`Video Error ${t}`,apiBase:n,headers:r,visitorId:o,envId:i,metadata:{errorMessage:e.message}});const s=T.document.documentElement,a={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:s.clientWidth,clientHeight:s.clientHeight,location:window.location.href,language:navigator.language},c={action:t,err:{message:e.message,stack:e.stack},meta:a,vid:o,envId:i};(await fetch(`${n}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...r,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(c)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",e)},Os=(e,{type:t,content:n})=>new Promise(function(r,o){let i;t==="script"?(i=T.document.createElement("script"),i.src=n):t==="link"?(i=T.document.createElement("link"),i.rel="stylesheet",i.href=n,i.type="text/css"):(i=T.document.createElement("style"),i.innerHTML=n),i.onload=function(){r(n)},i.onerror=function(){o(n)},i.async=!1,i.id=btoa(n),e.appendChild(i)}),Eo=(e,t)=>{if(e.length===0)return t&&t();Promise.all(e.reduce((n,r)=>(n.push(Os(T.document.head,r)),n),[])).then(()=>{T.videojs=T.document.defaultView.videojs,t&&t()}).catch(function(n){console.log(n+" failed to load")})},Qn=(e,t,n)=>{if(t==="start"&&(e.style.visibility="visible"),t==="none")e.style.visibility=q;else if(t==="success")e.style.visibility=q,e.innerHTML="Upload succeeded!";else{const r=Math.round(parseFloat(n));e.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${r}%</span>`,e.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`}},Vt=(e,t)=>{const n=T.videojs(e.id());return n==null?void 0:n.payload[t]},As=(e,t,n,r,o)=>{const{surveyId:i,responseGroupUid:s,visitorId:a,envId:c}=e.payload;e.on("deviceError",function(){console.warn("device error: ",e.deviceErrorCode),e.deviceErrorCode.message==="Permission denied"?(e.deviceButton.addClass("permission-denied"),n&&n(D.ERROR,{type:D.PERMISSION_DENIED}),we({event:"Video Permission Denied",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{questionId:Vt(e,Dt),responseGroupUid:s,surveyId:i}})):(n&&n(D.ERROR,{type:D.OTHER}),me(new Error(e.deviceErrorCode.message),"recorderDeviceError",t,o,a,c))}),e.on("error",function(d,l){me(l||e.error(),"recorderError",t,o,a,c)}),e.on("startRecord",function(d,l){r(e.uploadProgressLabel,"none"),we({event:"Video Record Start",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{questionId:Vt(e,Dt),responseGroupUid:s,surveyId:i}})}),e.on("finishRecord",async function(){r(e.uploadProgressLabel,"start",0);const d=Vt(e,Dt);if(!i){const g="internal error: missing fields in payload";return n&&n(D.ERROR,{type:D.OTHER}),me(new Error(g),"finishRecord",t,o,a,c),null}e.record().stopDevice();const l=e.cameraOff?D.MEDIA_TYPE_AUDIO:D.MEDIA_TYPE_VIDEO,m=gt();we({event:"Video Record Finish",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{mediaRecordingUid:m,questionId:d,responseGroupUid:s,surveyId:i,mediaType:l}});const p={surveyId:i,updatedAt:new Date().toISOString(),mediaType:l,mediaRecordingUid:m};d&&(p.questionId=d),s&&(p.responseGroupUid=s),a&&(p.visitorId=a);const h=await(async()=>{const g=await fetch(`${t}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(g.ok){const v=await g.json();return n&&n(D.UPLOAD_STARTED,{[D.UPLOAD_ID]:v.upload.id,[D.MEDIA_TYPE]:l,[D.MEDIA_RECORDING_UID]:m}),v.upload.url}else return n&&n(D.ERROR,{type:D.OTHER,response:g}),me(new Error("failed to get upload response with url"),"finishRecord",t,o,a,c),null})();!h||(ae=T.document.defaultView.UpChunk.createUpload({endpoint:h,file:new T.document.defaultView.File([e.recordedData],`recording ${l} ${Date.now()}`),chunkSize:5120}),ae.startTime=Date.now(),we({event:"Video Upload Start",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{mediaRecordingUid:m,questionId:d,responseGroupUid:s,surveyId:i,mediaType:l,url:h}}),ae.on("error",g=>{r(e.uploadProgressLabel,"none"),n&&n(D.UPLOAD_FINISHED,{[D.MEDIA_RECORDING_UID]:m}),me(g,"finishRecord",t,o,a,c)}),ae.on("progress",g=>{n&&n(D.UPLOAD_PROGRESS,{[D.MEDIA_RECORDING_UID]:m,[D.UPLOAD_PROGRESS_PCT]:g.detail}),r(e.uploadProgressLabel,"progress",g.detail)}),ae.on("success",()=>{r(e.uploadProgressLabel,"success"),n&&n(D.UPLOAD_FINISHED,{[D.MEDIA_RECORDING_UID]:m}),we({event:"Video Upload Success",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{mediaRecordingUid:m,questionId:d,responseGroupUid:s,surveyId:i,mediaType:l,url:h,elapsedMs:ae.startTime&&Date.now()-ae.startTime}})}))})},Lo=(e,t)=>{const n=new(T.videojs.getComponent("Component"))(e);return n.addClass("ul-buttons-panel"),t.map(r=>{n.addChild(r)}),Ds(n),n},Ds=e=>{e.children().forEach(t=>{if(te[t.name_]){const n=mt(te[t.name_],`ul-${te[t.name_]}`);t.el_.appendChild(n)}})},mt=(e,t="")=>{const n=T.document.createElement("span");return n.className="ul-button-text",n.innerHTML=e,n.id=t,n},Uo=(e,t,n,r,o=!1,i)=>{e.addClass("ul-video-player");const s=new(T.videojs.getComponent("Component"))(e);s.addClass("ul-control-panel"),e.progressBar=s.addChild("ProgressControl"),n&&e.src(n),e.audioPlayerPlaceholder=new(T.videojs.getComponent("Component"))(e),e.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const a=n&&n.src?zs(n.src):null;n&&(o||!a)?(e.children()[0].classList.add("vjs-hidden"),T.document.getElementById(`${e.id()}_html5_api`).style.height="0px"):(e.audioPlayerPlaceholder.hide(),T.document.getElementById(`${e.id()}_html5_api`).style.height="100%",a&&e.poster(a)),e.on("play",()=>{!o&&n&&!a&&Vs(e,!1),i==null||i.play()}),e.on("pause",()=>{i==null||i.pause()}),e.on("seeked",()=>{i==null||i.currentTime(e.currentTime())}),e.on("ratechange",()=>{i==null||i.playbackRate(e.playbackRate())}),e.addChild(e.audioPlayerPlaceholder,{},1),s.addChild(t),e.addChild(s),r&&r(e)},Ms=(e,t,n)=>{e.addClass(`ul${ko}`);const r=new(T.videojs.getComponent("Component"))(e);t&&e.src(t),e.addChild(r),n&&n(e)},Ns=(e,t,n,r,o,i,s,a=!1)=>{Yn=Date.now();const d=xt(t,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!d)return;d.payload=n;const{surveyId:l,questionId:m,responseGroupUid:p,visitorId:f,envId:h}=n;let g;const v=k=>{const x=Mt,E=Mt+"-audio-only";Qn(d.uploadProgressLabel,"none"),ae&&ae.startTime>=Yn&&ae.abort();const O=T.document.getElementById("ul-camera-button");k?(d.children()[0].classList.add("vjs-hidden"),C.removeClass(x),C.addClass(E),O.innerHTML=te.TurnOnCamera,d.audioPlayerPlaceholder.removeClass("vjs-hidden"),g==null||g.getTracks().forEach(Y=>{Y.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(Y=>{g=Y,Y.getVideoTracks().forEach(qe=>{qe.enabled=!1}),d.record().onDeviceReady(Y)}).catch(d.record().onDeviceError.bind(d.record()))):(g==null||g.getVideoTracks().forEach(Y=>{Y.enabled=!0}),d.children()[0].classList.remove("vjs-hidden"),d.record().getDevice(),C.removeClass(E),C.addClass(x),O.innerHTML=te.TurnOffCamera,d.audioPlayerPlaceholder.addClass("vjs-hidden"))},w=new(T.videojs.getComponent("Button"))(d,{clickHandler:()=>{w.hasClass(q)||(we({event:"Video Delete Button Clicked",apiBase:r,headers:s,visitorId:f,envId:h,metadata:{questionId:m,responseGroupUid:p,surveyId:l}}),v(d.cameraOff),o(D.DELETE,{}),C.removeClass(q),w.addClass(q))}});w.addClass("ul-video-recorder-delete-button"),w.el_.appendChild(mt(te.DeleteButton,"ul-delete-button"));const _=T.document.getElementById(t),U=()=>{_.classList.contains("vjs-fullscreen")&&d.cameraOff?_.style.display="table":_.style.display="flex"};U();const C=new(T.videojs.getComponent("Button"))(d,{clickHandler:()=>{d.record().isRecording()||(d.cameraOff=!d.cameraOff,we({event:"Video Camera Button Clicked",apiBase:r,headers:s,visitorId:n.visitorId,envId:n.envId,metadata:{questionId:m,responseGroupUid:p,surveyId:l,cameraOff:d.cameraOff}}),v(d.cameraOff),!w.hasClass(q)&&w.addClass(q),o(D.DELETE,{}),U())}});C.addClass(Mt),C.el_.appendChild(mt(te.TurnOffCamera,"ul-camera-button"));const I=new(T.videojs.getComponent("Button"))(d,{clickHandler:()=>{const k=T.document.getElementById("ul-recorder-toggle");if(d.record().isRecording())d.record().stop(),k&&(k.innerHTML=te.RecordButton),I.removeClass(Nt),w.removeClass(q);else{const x=T.document.getElementById("ul-recording-countdown-screen");if(x)x.remove(),k&&(k.innerHTML=te.RecordButton),v(d.cameraOff),o(D.DELETE,{}),C.removeClass(q),w.addClass(q),I.removeClass(Nt),P.show();else{I.addClass(Nt),P.hide(),C.addClass(q),w.addClass(q),k&&(k.innerHTML=te.StopButton);const E=T.document.createElement("div");E.id="ul-recording-countdown-screen",_.insertBefore(E,_.children[1]),E.style.height=`${_.offsetHeight}px`,Io(d,3)}}}});I.addClass("ul-video-recorder-toggle-button"),I.el_.appendChild(mt(te.RecordButton,"ul-recorder-toggle"));const A=T.document.createElement("p");A.style.visibility="hidden",A.className="ul-upload-progress-label",e.appendChild(A),d.uploadProgressLabel=A;const b=Lo(d,[w,C,"PlayToggle",I,"FullscreenToggle"]),P=b.children().find(k=>k.name_==="FullscreenToggle");P.hasClass("vjs-disabled")&&P.hide();const j=b.children().find(k=>k.name_==="PlayToggle");j.hide(),i&&C.addClass(q),!i&&w.addClass(q),Uo(d,b,i,!1,a),d.on("stopRecord",()=>{I.hide(),j.show(),P.show(),w.removeClass(q)}),d.on("deviceReady",()=>{I.show(),j.hide(),w.addClass(q)}),As(d,r,o,Qn,s),i&&(d.deviceButton&&d.deviceButton.hide(),d.src(i),j.show(),I.hide(),w.removeClass(q));const V=[{name:"microphone"}];!d.cameraOff&&V.push({name:"camera"}),Promise.all(V.map(k=>{var x;return(x=navigator==null?void 0:navigator.permissions)==null?void 0:x.query(k)})).then(k=>{k.reduce((E,O)=>E&O.state==="granted",!0)&&d&&(d.deviceButton&&d.deviceButton.hide(),!i&&d.record().getDevice())}).catch(k=>{})},Io=(e,t=3)=>{const n=T.document.getElementById("ul-recording-countdown-screen");n&&t===0?(n.remove(),e.record().start()):n&&(n.innerHTML=`<span class='ul-countdown-text'>Recording in... ${t}</span>`,setTimeout(()=>{Io(e,t-1)},1e3))},To=e=>{const t=T.document.createElement("div");return t.className="ul-video-container",t.appendChild(js(e)),t},Yt=(e,t)=>{const n=T.document.createElement("video");n.id=e,n.className="video-js vjs-default-skin ul-video-player-video";const r=T.document.createElement("p");r.className="vjs-no-js",r.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const o=T.document.createElement("a");return o.href="https://videojs.com/html5-video-support/",o.target="_blank",o.innerHTML="supports HTML5 video",r.appendChild(o),n.appendChild(r),t.appendChild(n),t},Vs=(e,t)=>{t?(e.children()[0].classList.add("vjs-hidden"),e.audioPlayerPlaceholder.show(),T.document.getElementById(`${e.id()}_html5_api`).style.height="0px"):(e.children()[0].classList.remove("vjs-hidden"),e.audioPlayerPlaceholder.hide(),T.document.getElementById(`${e.id()}_html5_api`).style.height="100%")},xt=(e,t)=>T.document.getElementById(e)?t?T.videojs(e,t):T.videojs(e):(console.error(`Error in finding player element with ID, ${e}`),null),Hs=(e,t,n,r=!1,o="https://api.sprig.com",i=document,s=null,a=null)=>{T.document=i;const c=e+Co,d=To(c);return T.document.addEventListener("securitypolicyviolation",l=>{me(new Error(`Voice & Video feature violates ${l.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",o,{})}),Eo(xo,()=>{T.document.getElementById(fn(c)).remove(),Yt(c,d);const l={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const m=e+ko;Yt(m,d);const p=xt(c,l),f=xt(m,{muted:!0,...l});if(!p||!f)return;Ms(f,s,a),s||f.addClass(q);const h=Lo(p,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),g=h.children().find(v=>v.name_==="FullscreenToggle");g.hasClass("vjs-disabled")&&g.hide(),Uo(p,h,t,n,r,f)}catch(m){me(new Error(`Error when creating video player object ${m}`),"playerDeviceError",o,{});return}}),d},$s=(e,t={},n="https://api.userleap.com",r,o,i,s=!1,a=document)=>{T.document=a;const c=e+So,d=To(c);return T.document.addEventListener("securitypolicyviolation",l=>{me(new Error(`Voice & Video feature violates ${l.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",n,i,t.visitorId,t.envId)}),Eo(xo.concat(Rs),()=>{Yt(c,d),T.document.getElementById(fn(c)).remove();try{Ns(d,c,t,n,r,o,i,s)}catch(l){me(new Error(`Error when creating video recorder player object ${l}`),"recorderDeviceError",n,i,t.visitorId,t.envId);return}}),d},Bs=e=>{const t=e+So;if(!!T.document.getElementById(t)&&!!T.videojs){try{if(!T.videojs(t).record().stream)return}catch{return}T.videojs(t).record().stop(),T.videojs(t).record().stopDevice()}},Fs=e=>{const t=xt(e+Co);t==null||t.pause()},zs=e=>{if(!e)return null;const t=e.match(/https:\/\/stream.mux.com\/(.*)/);let n=t?t[1]:null;return n.includes(Zn)&&(n=n.replace(Zn,"")),n?`https://image.mux.com/${n}/thumbnail.jpg?time=0`:null},D={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},te={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},We="ul-card-video__player_recorder",qs="ul-card-video__skip_button",Ws="ul-video-interview-form",Kn="ul-video-btn",Gs=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{apiURL:s,envId:a,handleUploadUpdate:c,headers:d,responseGroupUid:l,surveyId:m,viewDocument:p,visitorId:f}=B(E=>({apiURL:E.apiURL,envId:E.envId,handleUploadUpdate:E.handleUploadUpdate,headers:E.headers,responseGroupUid:E.responseGroupUid,surveyId:E.surveyId,viewDocument:E.viewDocument,visitorId:E.userId})),[h,g]=G(!1),[v,w]=G(null),[_,U]=G(null),[C,I]=G(0),A=d["userleap-platform"],b=r&&r.videoUrl,P=(E,O)=>{E===D.UPLOAD_STARTED?(w(O[D.UPLOAD_ID]),U(O[D.MEDIA_RECORDING_UID]),g(!0)):E===D.DELETE?(w(null),U(null),g(!1)):E===D.UPLOAD_PROGRESS?isNaN(O[D.UPLOAD_PROGRESS_PCT])?c({mediaRecordingUid:O[D.MEDIA_RECORDING_UID],isComplete:!0}):c({mediaRecordingUid:O[D.MEDIA_RECORDING_UID],progressPct:O[D.UPLOAD_PROGRESS_PCT]}):E===D.UPLOAD_FINISHED&&c({mediaRecordingUid:O[D.MEDIA_RECORDING_UID],isComplete:!0})},j=E=>{if(E&&E.children.length===0){const O=Hs(We,{src:b,type:"application/x-mpegURL"},void 0,r.mediaType===D.MEDIA_TYPE_AUDIO,s,p);E.appendChild(O)}},V=E=>{if(E&&E.children.length===0){const O=$s(We,{surveyId:m,responseGroupUid:l,questionId:o,visitorId:f,envId:a},s,P,void 0,{...d,"x-ul-video-recorder-origin":"sdk"},r.mediaType===D.MEDIA_TYPE_AUDIO,p);E.appendChild(O)}},k=E=>{E.preventDefault(),E.stopPropagation(),Bs(We),v&&_?(c({mediaRecordingUid:_,isSubmitted:!0}),n({value:{mediaRecordingUid:_},questionId:o,type:i})):n({value:null,questionId:o,type:i})},x=()=>u(Se,{defaultBody:()=>u("button",{className:`${Kn} ul-record-response-btn`,onClick:E=>{E.preventDefault(),E.stopPropagation(),Fs(We),I(1)}}),properties:r});return u("div",{className:R(pe(y.CardMainContent,A)),style:{marginTop:"unset"},children:u("form",{className:R([e,y.VideoCard,y.FadeInTransition]),id:Ws,children:[u(fe,{message:t,properties:r}),u("div",{id:"ul-card-voice__video",children:[u("div",{children:[u("div",{id:"ul-question-player-container",style:{display:C===0?"":"none"},children:[u("div",{id:We,ref:j}),x()]}),u("div",{style:{display:C===1?"block":"none"},children:[u("button",{className:`${Kn} ul-back-question-btn`,onClick:E=>{E.preventDefault(),E.stopPropagation(),I(0)}}),u("div",{id:"ul-recorder-player-container",ref:V})]})]}),u(K,{disabled:!h,onClick:k,children:ze(r)}),u("button",{className:`ul-card-text__button ${y.InactiveButton}`,id:qs,onClick:k,style:{display:r.required?"none":"block",...h?{display:"none"}:{}},children:dn(r)})]})]})})},Zs=({className:e})=>{const{headers:t,uploadProgress:n}=B(s=>({headers:s.headers,uploadProgress:s.uploadProgress}));let r,o;Object.values(n).filter(s=>s.isSubmitted).length>1?(r="Your responses are processing",o="Please keep this tab open until your responses are fully processed."):(r="Your response is processing",o="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(n).filter(s=>s.isSubmitted).map(s=>s.progressPct)));return u("div",{className:R(pe(y.CardMainContent,t["userleap-platform"])),children:u("div",{className:R([e,"ul-card--uploading",y.FadeInTransition]),children:[u("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:y.LoadingSpinnerContainer,role:"progressbar",children:u("div",{className:y.LoadingSpinner,children:[u("div",{className:y.LoadingSpinnerFirst}),u("div",{className:y.LoadingSpinnerSecond}),u("div",{className:y.LoadingSpinnerThird}),u("div",{className:y.LoadingSpinnerFourth})]})}),u(fe,{message:`${r} (${i}% complete)`}),u("p",{className:y.Caption,children:o})]})})},Jn=()=>u("svg",{alt:"Powered by Sprig",fill:"none",height:"13",viewBox:"0 0 100 13",width:"100",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M3.0369 0.839981H0.0249023V8.99998H1.3209V6.53998H2.8569C4.8969 6.53998 6.2409 5.37598 6.2409 3.62398C6.2409 1.95598 4.9689 0.839981 3.0369 0.839981ZM3.0009 5.35198H1.3209V2.02798H3.0009C4.1769 2.02798 4.9689 2.67598 4.9689 3.62398C4.9689 4.65598 4.1769 5.35198 3.0009 5.35198Z",fill:"#5D696F"}),u("path",{d:"M9.90653 3.21598C8.15453 3.21598 6.90653 4.45198 6.90653 6.17998C6.90653 7.90798 8.15453 9.14398 9.90653 9.14398C11.6585 9.14398 12.9065 7.90798 12.9065 6.17998C12.9065 4.45198 11.6585 3.21598 9.90653 3.21598ZM9.90653 8.01598C8.88653 8.01598 8.15453 7.23598 8.15453 6.17998C8.15453 5.11198 8.88653 4.34398 9.90653 4.34398C10.9265 4.34398 11.6585 5.11198 11.6585 6.17998C11.6585 7.23598 10.9265 8.01598 9.90653 8.01598Z",fill:"#5D696F"}),u("path",{d:"M20.9631 3.35998L19.7391 7.11598L18.3951 3.35998H17.3271L15.9831 7.12798L14.7591 3.35998H13.4151L15.4431 8.99998H16.5351L17.8671 5.08798L19.1871 8.99998H20.2791L22.3071 3.35998H20.9631Z",fill:"#5D696F"}),u("path",{d:"M25.7246 3.21598C24.0086 3.21598 22.8206 4.51198 22.8206 6.17998C22.8206 7.85998 24.0206 9.14398 25.7966 9.14398C27.0206 9.14398 28.0166 8.54398 28.3766 7.52398H27.0086C26.7806 7.88398 26.3606 8.05198 25.8086 8.05198C24.7526 8.05198 24.2126 7.40398 24.0926 6.55198H28.5206C28.7606 4.64398 27.5966 3.21598 25.7246 3.21598ZM25.7366 4.27198C26.6126 4.27198 27.2126 4.76398 27.2846 5.68798H24.1166C24.2606 4.89598 24.8006 4.27198 25.7366 4.27198Z",fill:"#5D696F"}),u("path",{d:"M31.1297 4.12798V3.35998H29.8817V8.99998H31.1297V5.44798C31.6337 4.78798 32.3177 4.45198 33.2177 4.41598V3.23998C32.3537 3.23998 31.6457 3.56398 31.1297 4.12798Z",fill:"#5D696F"}),u("path",{d:"M36.8222 3.21598C35.1062 3.21598 33.9182 4.51198 33.9182 6.17998C33.9182 7.85998 35.1182 9.14398 36.8942 9.14398C38.1182 9.14398 39.1142 8.54398 39.4742 7.52398H38.1062C37.8782 7.88398 37.4582 8.05198 36.9062 8.05198C35.8502 8.05198 35.3102 7.40398 35.1902 6.55198H39.6182C39.8582 4.64398 38.6942 3.21598 36.8222 3.21598ZM36.8342 4.27198C37.7102 4.27198 38.3102 4.76398 38.3822 5.68798H35.2142C35.3582 4.89598 35.8982 4.27198 36.8342 4.27198Z",fill:"#5D696F"}),u("path",{d:"M45.4886 0.47998V3.80398C45.0086 3.43198 44.3966 3.21598 43.6766 3.21598C42.0926 3.21598 40.8206 4.53598 40.8206 6.16798C40.8206 7.82398 42.0926 9.14398 43.6766 9.14398C44.3966 9.14398 45.0086 8.92798 45.4886 8.54398V8.99998H46.7246V0.47998H45.4886ZM43.8566 8.01598C42.8246 8.01598 42.0686 7.17598 42.0686 6.16798C42.0686 5.17198 42.8246 4.34398 43.8566 4.34398C44.4806 4.34398 45.0686 4.55998 45.4886 5.15998V7.18798C45.0686 7.79998 44.4806 8.01598 43.8566 8.01598Z",fill:"#5D696F"}),u("path",{d:"M54.6797 3.21598C53.9597 3.21598 53.3477 3.43198 52.8797 3.79198V0.47998H51.6317V8.99998H52.8797V8.55598C53.3477 8.92798 53.9597 9.14398 54.6797 9.14398C56.2637 9.14398 57.5477 7.82398 57.5477 6.16798C57.5477 4.53598 56.2637 3.21598 54.6797 3.21598ZM54.4997 8.01598C53.8757 8.01598 53.2997 7.79998 52.8797 7.21198V5.13598C53.2997 4.54798 53.8757 4.34398 54.4997 4.34398C55.5437 4.34398 56.2997 5.17198 56.2997 6.16798C56.2997 7.17598 55.5437 8.01598 54.4997 8.01598Z",fill:"#5D696F"}),u("path",{d:"M63.3347 3.34798L61.3907 7.76398L59.2667 3.34798H57.9347L60.8147 9.08398L59.6267 11.784H60.9347L64.6547 3.34798H63.3347Z",fill:"#5D696F"}),u("path",{d:"M71.1466 4.34661C69.8092 4.05038 69.131 3.53001 69.131 2.80065C69.131 2.04705 69.8546 1.47822 70.8142 1.47822C71.8034 1.47822 72.5496 2.10339 72.5496 2.9321V2.99813H73.9165V2.9321C73.9165 1.41764 72.5883 0.272705 70.8271 0.272705C69.9784 0.272705 69.2009 0.533191 68.6379 1.0057C68.3584 1.23619 68.1339 1.52487 67.9805 1.8511C67.8271 2.17733 67.7486 2.53303 67.7506 2.89273C67.7451 3.22255 67.8137 3.54949 67.9515 3.84994C68.0894 4.15038 68.293 4.41686 68.5478 4.63012C69.0218 5.04266 69.6945 5.34798 70.5463 5.5388C71.9806 5.85502 72.7078 6.39296 72.7078 7.13686C72.7078 7.94316 71.9156 8.55076 70.8682 8.55076C69.7804 8.55076 68.9599 7.87531 68.9599 6.97996V6.91393H67.5918V6.97996C67.5918 8.56348 68.9942 9.75688 70.8535 9.75688C71.7426 9.75688 72.5588 9.48731 73.1518 8.99662C73.446 8.75831 73.6827 8.4581 73.8445 8.1179C74.0063 7.7777 74.0891 7.40611 74.087 7.03024C74.087 5.6854 73.0991 4.78217 71.1466 4.34661Z",fill:"#5D696F"}),u("path",{d:"M78.7986 2.50806C78.2874 2.50175 77.7823 2.6176 77.3263 2.84576C76.8703 3.07391 76.4768 3.40759 76.1795 3.81837V2.66738H74.8789V12.0752H76.1795V8.48716C76.4768 8.8979 76.8703 9.23152 77.3263 9.45957C77.7824 9.68763 78.2875 9.80335 78.7986 9.79687C80.8167 9.79687 82.3381 8.23031 82.3381 6.15246C82.3381 4.07462 80.8167 2.50806 78.7986 2.50806ZM80.9835 6.42264C80.9316 6.9629 80.6921 7.46879 80.3056 7.8544C79.919 8.24001 79.4093 8.48156 78.863 8.53804C78.1369 8.61074 77.4605 8.40295 76.9583 7.95407C76.4561 7.50518 76.1795 6.86365 76.1795 6.15246C76.1795 4.7846 77.2122 3.75295 78.5815 3.75295C79.2904 3.75295 79.9306 4.02191 80.3776 4.51018C80.8387 5.01116 81.054 5.69025 80.9835 6.42264Z",fill:"#5D696F"}),u("path",{d:"M98.2908 2.6692V3.80747C97.6776 2.97875 96.7302 2.50806 95.6583 2.50806C93.6482 2.50806 92.1323 4.04615 92.1323 6.08582C92.1323 8.1255 93.6482 9.66299 95.6583 9.66299C96.7345 9.66299 97.6819 9.19714 98.2908 8.37691V8.55198C98.2908 9.96891 97.3906 10.8843 95.9974 10.8843C95.0561 10.8843 94.2718 10.4766 93.8996 9.79384L93.8806 9.7587H92.5389L92.5695 9.84654C92.7961 10.514 93.2392 11.0889 93.8303 11.4822C94.4233 11.8723 95.1726 12.0783 95.9974 12.0783C97.0552 12.0783 97.9554 11.7451 98.6017 11.1157C99.2481 10.4862 99.5915 9.6012 99.5915 8.56773V2.6692H98.2908ZM97.5611 7.842C97.0092 8.36418 96.2225 8.58348 95.4001 8.44294C94.9132 8.35796 94.4664 8.12184 94.1245 7.76889C93.7827 7.41593 93.5636 6.96452 93.4992 6.48019C93.3833 5.66541 93.631 4.89364 94.1786 4.36418C94.6383 3.92741 95.2542 3.68788 95.8919 3.69782C96.0464 3.69795 96.2006 3.71031 96.3531 3.73477C97.3459 3.89349 98.1314 4.70403 98.2632 5.71024C98.3749 6.53835 98.1179 7.31436 97.5611 7.842Z",fill:"#5D696F"}),u("path",{d:"M90.705 0.0995975C90.4602 0.046773 90.2043 0.0911971 89.9925 0.223269C89.7806 0.35534 89.6299 0.564452 89.5729 0.805409C89.5159 1.04637 89.5571 1.29982 89.6877 1.51098C89.8183 1.72215 90.0277 1.87407 90.2708 1.93391C90.3415 1.94954 90.4136 1.95747 90.486 1.95754C90.72 1.9579 90.9458 1.87325 91.1206 1.71973C91.2955 1.5662 91.407 1.35452 91.4341 1.125C91.4611 0.89547 91.4017 0.664135 91.2673 0.475046C91.1329 0.285958 90.9327 0.152325 90.705 0.0995975V0.0995975Z",fill:"#5D696F"}),u("path",{d:"M89.8366 8.39143H88.715C87.9178 8.39143 87.4389 7.85531 87.4389 6.95693C87.4389 6.08096 87.8681 5.03659 88.7432 3.76444L88.7548 3.74748V3.38825L85.0271 2.86727C85.0284 2.71553 84.9886 2.56622 84.9118 2.43478C84.8351 2.30335 84.7241 2.19458 84.5905 2.11973C84.2563 1.938 83.8908 1.938 83.5879 2.11368C83.4361 2.2023 83.3122 2.33077 83.23 2.4848C83.1477 2.63884 83.1103 2.8124 83.1219 2.98618C83.1336 3.15996 83.1938 3.32714 83.2958 3.46914C83.3979 3.61114 83.5379 3.72238 83.7001 3.79049L82.5405 9.63753H83.8283L84.8977 4.08551L86.9115 4.42111C86.3701 5.38007 86.0953 6.27421 86.0953 7.07869C86.0953 8.56347 87.0041 9.53576 88.4734 9.62965V9.63753H91.1341V2.69099H89.8366V8.39143Z",fill:"#5D696F"})]}),Ys=()=>{const{border:e,cards:t,headers:n,index:r,marketingUrl:o,showSurveyBrand:i,slugName:s,surveyId:a,viewedCardCount:c}=B(g=>({border:g.border,cards:g.cards,headers:g.headers,index:g.index,marketingUrl:g.marketingUrl,showSurveyBrand:g.showSurveyBrand,slugName:g.slugName,surveyId:g.surveyId,viewedCardCount:g.viewedCardCount})),d=Ce(null),l=t.filter(g=>g.type!==L.Uploading&&g.type!==L.Thanks),m=Ji(t,r),p=c+1,f=p/(p+m);X(()=>{d.current&&(d.current.style.width=`${f*100}%`)},[f]);const h=()=>i?u("a",{href:`${o}?utm_source=survey_branding&utm_medium=website&utm_campaign=${s}&utm_content=${a}`,rel:"noreferrer",style:{display:"block",margin:"5px 0"},target:"_blank",children:u(Jn,{})}):null;return!l||l.length===1?u("footer",{className:"ul-footer",style:i?{}:{marginBottom:"10px"},children:h()}):u("footer",{className:`ul-footer ${n["userleap-platform"]==="link"?"ul-footer__link":""}`,children:[l.length>1&&u("div",{id:"ul-progress-bar-container",children:u("div",{id:"ul-progress-bar-current",ref:d,style:{border:`1px solid ${e||"#000"}`}})}),i&&u("a",{href:`${o}?utm_source=survey_branding&utm_medium=website&utm_campaign=${s}&utm_content=${a}`,rel:"noreferrer",style:{display:"block",margin:"5px 0"},target:"_blank",children:u(Jn,{})})]})},Qs=()=>{const{answers:e,border:t,cards:n,close:r,configureExitOnOverlayClick:o,destroy:i,endCard:s,eventEmitFn:a,fontFamily:c,headers:d,index:l,next:m,showStripes:p,update:f,useMobileStyling:h,viewDocument:g}=B(x=>({answers:x.answers,border:x.border,cards:x.cards,close:x.close,configureExitOnOverlayClick:x.configureExitOnOverlayClick,destroy:x.destroy,endCard:x.endCard,eventEmitFn:x.eventEmitFn,fontFamily:x.fontFamily,headers:x.headers,index:x.index,next:x.next,showStripes:x.showStripes,update:x.update,useMobileStyling:x.useMobileStyling,viewDocument:x.viewDocument})),v=Ce(null),w=Ce(!1),{props:_,type:U,name:C}=n[l],I=n.length;X(()=>{v.current&&(v.current.classList.contains("ul-app--visible")||v.current.classList.add("ul-app--visible"),!w.current&&a&&(w.current=!0,a(M.SurveyAppeared)))},[a]),X(()=>{f()},[l,f]),X(()=>{o(()=>r())},[r,o]);const A=()=>r(De),b=x=>{x.key==="Enter"&&A()},P=async function(x){m({data:x,completeSurvey:()=>{i(De)},endCard:s}),Ko(g)};if(e){for(const x of e)if(x.questionId===C){let E;if(U===L.MultipleChoice){const O=_.options.find(({value:Y})=>Y===x.value);if(!O)break;E={[O.id]:O.value}}else E=x.value;P({value:E,type:U,questionId:x.questionId});break}}const j=()=>[Re.Email,Re.Link].includes(d["userleap-platform"])?!1:!s||l+1!==I,V=()=>h?{borderColor:t}:{borderColor:t,margin:"15px"},k=()=>{const x={className:"ul-card",next:P,questionId:C,type:U};switch(U){case L.ConsentLegal:return F(cs,{...x,..._,key:C});case L.Likert:return F(us,{...x,..._,key:C});case L.MultipleChoice:return F(ps,{...x,..._,key:C});case L.MultipleSelect:return F(fs,{...x,..._,key:C});case L.NPS:return F(ms,{...x,key:C,props:_});case L.Open:return F(hs,{...x,..._,key:C});case L.RecordedTask:return F(Es,{...x,..._,key:C});case L.TextUrlPrompt:return F(Is,{...x,..._,key:C});case L.Thanks:return F(Ts,{...x,..._,key:C});case L.Uploading:return F(Zs,{...x,..._,key:C});case L.VideoVoice:return F(Gs,{...x,..._,key:C});default:return null}};return u("div",{className:R("ul-app",Me(d)?"ul-app--visible":"ul-app--overlay"),id:De,ref:v,style:{"--theme":t,...c?{fontFamily:c.replace(";","")}:{}},children:u("div",{className:"ul-app__container",children:[u("div",{className:R(z(y.CardContainer,h)),style:V(),children:[p&&u("div",{className:"ul-header__container",children:u("div",{className:"ul-header",children:"For development purposes only"})}),k(),u(Ys,{})]}),j()&&u("div",{className:R(z(y.CloseContainer,h)),children:u("div",{"aria-label":"Close button",className:y.CloseButton,onClick:A,onKeyPress:b,role:"button",tabIndex:0,children:u("svg",{fill:"none",height:"18px",viewBox:"0 0 13 13",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})})]})})},Ks=`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:left;margin:auto}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container{background:#ffffff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;overflow:auto;padding:20px 20px 5px;position:relative;text-align:center;word-break:break-word}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;margin-bottom:3px;display:flex;gap:16px;justify-content:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0 5px 20px}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:left;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email{flex-grow:55;display:flex}.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{padding-top:15px;margin-bottom:5px}.ul-question{color:#343442;display:block;font-size:20px;line-height:125%;font-weight:500;cursor:default;text-align:left}.ul-caption{flex:1 0 auto;margin-top:8px;margin-bottom:15px;font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:left}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.choice-label-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%;height:fit-content;flex:0 0 fit-content}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:transparent;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:0;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:#6c6c6e80}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.select-checkbox{height:16px;width:16px;border-radius:3px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 3px 3px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.fade-in-transition{animation:fadeIn .4s ease-in;-webkit-animation:fadeIn .4s ease-in;-moz-animation:fadeIn .4s ease-in;-o-animation:fadeIn .4s ease-in;-ms-animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-ms-keyframes fadeIn{0%{opacity:0}to{opacity:1}}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{box-shadow:unset;border-radius:unset;border:none!important;position:unset}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:white}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.likert-number--mobile{border:2px solid #e6e6e6;margin-left:-2px}.likert-number--desktop{border:1px solid #e6e6e6;margin-left:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-number-1{border-top-left-radius:5px;border-bottom-left-radius:5px}.likert-last-option{border-top-right-radius:5px;border-bottom-right-radius:5px}.likert-star--mobile{margin-left:-2px}.likert-star--desktop{margin-left:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;font-size:18px;line-height:24px;height:67px}.likert-smiley--mobile{margin-left:-2px}.likert-smiley--desktop{margin-left:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--likert__labels span:last-child{text-align:right}.select-label{flex:1;overflow-wrap:anywhere;cursor:pointer;padding-left:15px}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid #e6e6e6;margin-left:-2px}.nps-number--desktop{border:1px solid #e6e6e6;margin-left:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.nps-number-0{border-top-left-radius:5px;border-bottom-left-radius:5px}.nps-number-10{border-top-right-radius:5px;border-bottom-right-radius:5px}.ul-card--nps__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--nps__labels span:last-child{text-align:right}.ul-card-text{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:white}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}#ul-card-voice__video{align-items:center;display:flex;flex-direction:column}#ul-card-voice__video>div{margin-bottom:10px;width:100%}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#ffffff;border-radius:5px;text-align:left;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:#4c4c4c}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:30px}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none}b{font-weight:500}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;left:0;position:absolute;top:0;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:auto;flex-grow:1;width:100%}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.close-container--desktop,.close-container--mobile{height:22px;width:22px;border-radius:22px;background-color:#fff;align-items:center;justify-content:center}.close-container--desktop{top:25px;right:25px}.close-container--mobile{top:15px;right:10px}.close-container{background:transparent;box-sizing:border-box;display:flex;position:absolute}.close-btn{height:18px;width:18px;align-items:center;justify-content:center;display:flex;cursor:pointer}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}#ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px;max-width:250px;margin:25px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{width:100%;background:rgba(0,0,0,.01);border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:1;margin:0;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}
686
+ `,Js=(e,t)=>{const n=[...e],r=new Set([L.VideoVoice,L.RecordedTask]);return e.some(o=>r.has(o.type))&&n.push({name:-2,props:{routingOptions:[]},type:L.Uploading}),t&&n.push({name:-1,props:{routingOptions:[]},type:L.Thanks}),n},Xs=({mode:e=null,viewWindow:t,viewDocument:n})=>{const r=n.documentElement;return{mode:e,sw:t.screen.width,sh:t.screen.height,cw:r.clientWidth,ch:r.clientHeight,p:t.location.href,l:t.navigator.language}};function ea(e,t=!0){var C;const{answers:n,apiURL:r,customStyles:o,endCard:i,eventEmitFn:s,fontFamilyURL:a,frame:c,UpChunk:d,viewDocument:l,viewWindow:m}=e,p=Me(e.headers)?e.frame:l.body,f=H,h=Js(e.cards,!!i);pt.configure(f,{cards:h,hasEndCard:!!i,apiURL:r,UpChunk:d}),B.setState({apiURL:r,answers:n,border:e.border,index:e.startingQuestionIdx||0,cards:h,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:s,fontFamily:e.fontFamily,frame:c,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:Xs({mode:e.mode,viewWindow:m,viewDocument:l}),mode:e.mode,recorder:pt,recorderEventEmitter:f,responseGroupUid:e.responseGroupUid,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,styleNonce:e.styleNonce,surveyId:e.surveyId,tabTitle:e.tabTitle,uploadingCardViewed:!1,uploadProgress:{},useMobileStyling:e.useMobileStyling,useDesktopPrototype:e.useDesktopPrototype,userId:e.userId,viewDocument:e.viewDocument,visitorAttributes:e.visitorAttributes,viewedCardCount:e.startingQuestionIdx||0});const{seen:g}=B.getState();g();const{head:v}=l,w=l.createElement("style");if(w.id="sprig-style",w.textContent=Ks,w.nonce=e.styleNonce,v.appendChild(w),e.fontFamily&&a&&parent){const I=l.createElement("link");I.rel="stylesheet",I.href=a,v.appendChild(I)}if(e.customStyles&&rr(l,o,e.styleNonce),!d)if(e.installationMethod!==xe.Npm){const I=l.createElement("script");I.src="https://cdn.sprig.com/userleap-web-upchunk-v2.2.2.js",I.onload=()=>{pt.setUpChunk(m.UpChunk)},I.onerror=()=>{console.warn("[Sprig] - recording functionality not configured due to UpChunk library load failure")},v.appendChild(I)}else console.warn("[Sprig] - recording functionality not configured due to missing UpChunk dependency");const _="2.21.7",U=s||((C=c.eventEmitter)==null?void 0:C.emit);U==null||U(ee.VerifyViewVersion,{[Te.ViewVersion]:_}),p&&t&&He(u(Qs,{}),p)}const ta={configure:ea};window.UserLeap&&window.Sprig&&(window.Sprig._gtm?window.Sprig=window.UserLeap:window.UserLeap=window.Sprig);window.UserLeap||(window.UserLeap=window.Sprig);window.Sprig||(window.Sprig=window.UserLeap);const na="rgba(255,255,255, 0.95)",ra="rgba(0,0,0,0.9)",oa="360px",Ht="0px",Po=()=>{window.UserLeap.container=document.createElement("div"),window.UserLeap.container.className="ul-container",document.body.appendChild(window.UserLeap.container)},jo=e=>{const t=window.UserLeap.container;if(!!t)try{document.body.removeChild(t),window.UserLeap.container=null,Q("trackStartUrl",null),H.emit(M.SurveyLifeCycle,{state:"dismissed"}),H.emit(M.SurveyClosed,{name:M.SurveyClosed,initiator:e})}catch(n){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+t),n instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",n)}},Ro=()=>{H.on(M.SurveyWillClose,({initiator:e})=>{jo(e)})},ia=(e,t)=>{const r={...{position:"fixed",overflow:"auto",top:"0px",left:"0px",display:"none",height:"100%",width:"100%",transition:"background-color 0.3s ease-out",zIndex:2147483646}},o=t?e.overlayStyleMobile:e.overlayStyle;r["background-color"]=o==="light"?na:ra,t||(r.margin="auto"),window.UserLeap.container&&Object.assign(window.UserLeap.container.style,r)},sa=(e,t,n)=>{var a,c;const r={position:"fixed",bottom:"0px",right:Ht,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646},o=Object.assign({},t,window.UserLeap);let i,s=!1;return n?((a=window.UserLeap.windowDimensions)!=null&&a.width?r.width=`${window.UserLeap.windowDimensions.width}px`:r.width="100%",(c=window.UserLeap.windowDimensions)!=null&&c.height?r.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`:window.UserLeap.maxHeight?r.maxHeight=window.UserLeap.maxHeight:r.maxHeight=`${document.body.clientHeight-20}px`,["light","dark"].includes(o.overlayStyleMobile)&&(s=!0)):(r.width=oa,r.maxHeight=window.UserLeap.maxHeight||"66vh",o.framePosition===Ze.BottomLeft?i={left:Ht}:o.framePosition===Ze.TopLeft?i={left:Ht,top:"0px"}:o.framePosition===Ze.TopRight?i={top:"0px"}:o.framePosition===Ze.Center&&(s=!0,i={margin:"auto",position:"static"},r.maxHeight=null)),s&&ia(o,n),Object.assign(e.style,r,i),s},aa=(e,t)=>{var a,c;const n="ul-frame";Po();const r=document.createElement("iframe");r.id=n,r.setAttribute("title","Sprig User Feedback Dialog");const o=sa(r,e,t);H.on(M.SurveyFadingOut,()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}),Ro(),r.setHeight=d=>{parseInt(r.style.height)!=d&&(r.style.height=`${d}px`,H.emit(M.SurveyHeight,{name:M.SurveyHeight,contentFrameHeight:r.clientHeight}))},(a=window.UserLeap.container)==null||a.appendChild(r),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{H.emit(M.CloseSurveyOnOverlayClick)}),H.emit(M.SurveyLifeCycle,{state:"presented"}),H.emit(M.SurveyPresented,{name:M.SurveyPresented});const i=(c=r.contentWindow)==null?void 0:c.document;i&&(i.open("text/html","replace"),i.write("<!doctype html><head></head><body></body></html>"),i.close());const s=i==null?void 0:i.head;return{frameId:n,contentWinDocHead:s,contentWindow:r.contentWindow,hasOverlay:o,iframe:r}},la="!optimizely_experiments_";class ca{constructor(){se(this,"_optimizelyData",{})}setOptimizelyExperiment(t){if(!t||typeof t!="object")return!1;const{experiments:n}=t;try{return Object.keys(this._optimizelyData).map(r=>{delete this._optimizelyData[r]}),n&&n.map(r=>{const{id:o,variation:i}=r,s=this.transformExperimentId(o);i&&typeof i=="string"&&(this._optimizelyData[s]=i)}),!0}catch(r){return r instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",r),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(t){return this._optimizelyData[this.transformExperimentId(t)]}transformExperimentId(t){return la+t}getAndSetWebOptimizelyExperiments(){var t;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const n=(t=window.optimizely.get("state"))==null?void 0:t.getExperimentStates({isActive:!0});if(n){const r=Object.keys(n).map(o=>{var i,s;return(i=n[o].variation)!=null&&i.name?{id:o,variation:(s=n[o].variation)==null?void 0:s.name}:{id:o,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r}),!0}return!1}return!1}catch(n){return n instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",n),!1}}}const ht=new ca;Object.freeze(ht);class da{constructor(t,n){se(this,"paused");se(this,"queue");se(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(n)}flush(t){const n=t.length;if(n)for(let r=0;r<n;r++)this.push(t[r])}isPaused(){return this.paused}pause(){this.paused=!0}unpause(){this.paused=!1;const t=this.queue.slice();this.empty(),this.flush(t)}push(t){if(this.paused)this.queue.push(t);else if(t instanceof Function)t();else{const n=Array.prototype.slice.call(t,1),r=t[0],o=this.ul[r];o instanceof Function?o.apply(this.ul,n):r&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",r)}}perform(t){if(this.paused){let n=()=>{};const r=new Promise(function(o){n=function(){o(t())}});return this.queue.push(n),r}else return t()}empty(){this.queue.length=0}}const et="userleap.ids",Qt="userleap.pageviews",ua=["popState","pushState","replaceState"],pa={test:"test"},Ge="!email",fa=["ios","android"],be="environments",Kt="pageUrl",Ee="visitors",Xn="ul-view-sdk-script",er=Object.freeze({contains:(e,t)=>t.includes(e),notContains:(e,t)=>!t.includes(e),exactly:(e,t)=>t===e,notExactly:(e,t)=>t!==e,startsWith:(e,t)=>t.startsWith(e),endsWith:(e,t)=>t.endsWith(e),regex:(e,t)=>new RegExp(e).test(t),legacy:(e,t)=>new RegExp(e,"i").test(t)});function mn(e,t){const{matchType:n,pattern:r}=e,o=n?er[n]:er.legacy;let i=!1;try{i=o(r,t)}catch(s){const a=`[Sprig] (ERR-445) Failed to check url match with pattern ${r}`;s instanceof Error&&(console.warn(a,s),s.stack=JSON.stringify(e),window.UserLeap.reportError(a,s))}return i}function ma(e,t){const{pageUrlEvents:n,interactiveEvents:r,dismissOnPageChange:o}=window.UserLeap._config;if(!o)return!0;const i=[];n&&n.length&&i.push(...n),r&&r.length&&i.push(...r);const s=e&&i.find(a=>a.id===e);return s?mn(s,window.location.href):t===window.location.href}function tt(e){const{pageUrlEvents:t,interactiveEvents:n,dismissOnPageChange:r,platform:o}=window.UserLeap._config;if(o&&o!==Re.Web)return;const i=Le("trackStartUrl"),s=i?String(i):null;t&&ya(window.location.href),n&&(Ao(),ha()),r&&s&&s!==window.location.href&&e&&ua.includes(e.type)&&window.UserLeap("dismissActiveSurvey",de.PageChange)}const Oo={capture:!0},ha=()=>{const t=window.UserLeap._config.interactiveEvents.filter(r=>mn(r,window.location.href)).map(r=>{const{name:o,properties:i}=r,{selector:s,innerText:a}=i;return s?c=>(Ne(c.target)&&c.target.closest(s)&&window.UserLeap("track",o),!1):c=>(Ne(c.target)&&c.target.innerText===a&&window.UserLeap("track",o),!1)}),n=r=>t.forEach(o=>o(r));window.UserLeap._config.interactiveEventsHandler=n,window.addEventListener("click",n,Oo)},Ao=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,Oo),delete window.UserLeap._config.interactiveEventsHandler};function ga(){["hashchange","popstate"].forEach(e=>window.addEventListener(e,tt,!0))}function va(){["hashchange","popstate"].forEach(e=>window.removeEventListener(e,tt,!0)),window.UserLeap._config.interactiveEvents&&Ao()}function ce(e,t,n){const r=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(o=>{r.push(o),o===be?r.push(window.UserLeap.envId):o===Ee&&r.push(hn())}),n&&r.push(n),r.join("/")}function _a(e,t){let n=ce("1",[be],"questions?");return e!=null&&(n+=`&vid=${e}`),t&&(t.surveyId&&(n+=`&surveyid=${t.surveyId}`),t.surveyTemplateId&&(n+=`&surveytemplateid=${t.surveyTemplateId}`)),n}function wa(){try{if(typeof localStorage<"u"&&(localStorage.setItem("is_available","yes"),localStorage.getItem("is_available")==="yes"))return localStorage.removeItem("is_available"),!0}catch{return!1}return!1}function Le(e){if(!window.UserLeap.localStorageAvailable)return null;const t=localStorage.getItem(et);if(t)try{const r=JSON.parse(t)[window.UserLeap.envId];return r&&r[e]||null}catch(n){n instanceof Error&&(n.stack=t,window.UserLeap.reportError("Failed to parse local storage credentials",n)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",n)}return null}function Q(e,t){if(!window.UserLeap.localStorageAvailable)return;const n=localStorage.getItem(et);let r={};if(n)try{r=JSON.parse(n)}catch(i){i instanceof Error&&(i.stack=n,window.UserLeap.reportError("Failed to parse local storage credentials",i)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",i)}let o=r[window.UserLeap.envId];o?o[e]=t:o={[e]:t},r[window.UserLeap.envId]=o;try{localStorage.setItem(et,JSON.stringify(r))}catch(i){i instanceof Error&&console.warn(`[Sprig] (ERR-426) Unable to write to Local Storage:: ${i.message}`)}}function Do(){window.previewMode||(window.UserLeap.visitorId=gt(),Q("vid",window.UserLeap.visitorId),H.emit(M.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}))}function hn(){return window.previewMode?"0":window.UserLeap.visitorId||""}function ya(e){if(!window.UserLeap.localStorageAvailable||e.endsWith("mock_snippet.html"))return;const t=window.UserLeap._config.pageUrlEvents;if(t&&t.length){let a=!1;for(let c=0;c<t.length&&(a=mn(t[c],e),!a);c++);if(!a)return}window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const n=10,r=1;let o=[];const i={viewedAt:Date.now(),location:e},s=localStorage.getItem(Qt);try{if(o=s?JSON.parse(s):[],Array.isArray(o)||(o=[]),o.length>0){const a=o[o.length-1],c=(Date.now()-a.viewedAt)/1e3;(a.location!=e&&c>r||c>n)&&(window.UserLeap._queue.push(["track",Kt,null,{url:e}]),o.push(i))}else window.UserLeap._queue.push(["track",Kt,null,{url:e}]),o.push(i);o.length>5&&o.splice(0,o.length-5);try{localStorage.setItem(Qt,JSON.stringify(o))}catch(a){a instanceof Error&&console.warn(`[Sprig] Unable to write to Local Storage: ${a.message}`)}}catch(a){a instanceof Error&&(a.stack=s||"",window.UserLeap.reportError("trackPageView",a)),console.warn("[Sprig] (ERR-425) Failed to update page views in local storage")}}function ba(){const e="Backbone"in window&&window.Backbone&&window.Backbone.history?window.Backbone.history:window.history;"pushState"in e&&(e.pushState=(t=>function(...r){const o=t.apply(this,r),i=new Event("pushState");return window.dispatchEvent(i),tt(i),o})(e.pushState)),"replaceState"in e&&(e.replaceState=(t=>function(...r){const o=t.apply(this,r),i=new Event("replaceState");return window.dispatchEvent(i),tt(i),o})(e.replaceState)),ga()}async function $t(e,t){const n=hn();e&&!t&&(window.UserLeap._config.mode=pa.test);const r=await _e(_a(n,e),{},0,!0);return r.ok?(r.json.delay&&await vt(r.json.delay),Mo(r.json)):(r.reportError&&r.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",r.error),window.UserLeap.reportError("getQuestions",r.error)),{success:!1,surveyState:"no survey"})}const Mo=async(e,t)=>{var x,E;const{context:n,endCard:r,locale:o,productConfig:i,questions:s,responseGroupUid:a,surveyId:c,uuid:d,vid:l}=e,m=rt(window.UserLeap),p=gn(m),f=xa(m);if(l==null||!s||!s.length)return{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(window.UserLeap.container){const O="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(O),{success:!1,message:O,surveyState:"no survey"}}if(l!==window.UserLeap.visitorId&&d!==window.UserLeap.visitorId&&!window.previewMode){const O="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(O)),{success:!1,message:O,surveyState:"no survey"}}if(!(t?await t(c):!0))return{success:!1,message:"[Sprig] Callback returned false, aborting rendering of survey",surveyState:"no survey"};Bt.disable(),H.emit(M.SurveyWillPresent,{name:M.SurveyWillPresent,[tr.SurveyId]:c});let g,v=document.createElement("div"),w,_,U;const C=O=>{const{[Te.ViewVersion]:Y}=O;Y!==m["x-ul-sdk-version"]&&jo(),H.removeListener(ee.VerifyViewVersion,C)};H.on(ee.VerifyViewVersion,C),Me(m)?(g="ul-direct-embeded-frame",w=document.head,_=window,U=!1,p&&(Po(),v.id=g,window.UserLeap.container.appendChild(v),Ro(),H.emit(M.SurveyLifeCycle,{state:"presented"}),H.emit(M.SurveyPresented,{name:M.SurveyPresented}))):{frameId:g,contentWinDocHead:w,contentWindow:_,hasOverlay:U,iframe:v}=aa(i,f),window.UserLeap.frameId=g,window.UserLeap.useMobileStyling=f;const I=O=>{H.on(M.CloseSurveyOnOverlayClick,O)},A=Object.assign({frame:v,envId:window.UserLeap.envId,surveyId:c,userId:d,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},cards:s,context:n,locale:o,fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,apiURL:window.UserLeap._API_URL,responseGroupUid:a,headers:m,endCard:r,useMobileStyling:f,mobileSDKVersion:window.UserLeap.mobileSDKVersion,configureExitOnOverlayClick:I,eventEmitFn:H.emit.bind(H),ulEvents:Xt,viewDocument:_==null?void 0:_.document,viewWindow:_,tabTitle:document.title,startingQuestionIdx:(x=window.UserLeap.config)==null?void 0:x.startingQuestionIdx,styleNonce:window.UserLeap.styleNonce},window.UserLeap._config);(E=window.UserLeap.config)!=null&&E.startingQuestionIdx&&(window.UserLeap.config={...window.UserLeap.config,startingQuestionIdx:null}),window.UserLeap.customStyles&&(A.customStyles=window.UserLeap.customStyles),_&&(_.__cfg=A);function b(){const O=document.createElement("script");return window.UserLeap.nonce&&O.setAttribute("nonce",window.UserLeap.nonce),O.id=Xn,O}const P=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:A.path,j=document.getElementById(Xn);j&&j.remove();const V=b(),k=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};return A.installationMethod===xe.Npm?(ta.configure(A),U&&window.UserLeap.container&&k()):P&&(V.src=P,U&&V.addEventListener("load",()=>{window.UserLeap.container&&k()}),_==null||_.addEventListener("error",O=>{O.target instanceof HTMLScriptElement&&O.target.src===P&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0})),w==null||w.appendChild(V),{success:!0,surveyState:"ready"}};function xa(e){if(window.UserLeap.useMobileStyling!==void 0)return window.UserLeap.useMobileStyling;const t=window.UserLeap.windowDimensions&&window.UserLeap.windowDimensions.width||document.body.clientWidth;return gn(e)||t>10&&t<zo}function gn(e){return fa.includes(e[le.Platform])}function Ca(e){let t=e.length;for(;t;){const n=Math.floor(Math.random()*t);t-=1;const r=e[t];e[t]=e[n],e[n]=r}}function ka(e){if(!e)return;window.UserLeap._config=e,e.mute&&window.UserLeap._queue.pause();const{interactiveEvents:t,pageUrlEvents:n,dismissOnPageChange:r}=e;t&&Ca(t),(t||n||r)&&(ba(),tt())}async function _e(e,t,n=0,r=!1){var i,s;t.headers=Object.assign(rt(window.UserLeap),t.headers);const o=await ge(e,t,n,r);if(o.ok){const a=(i=o.headers)==null?void 0:i.get("Authorization"),c=a?a.split(" "):void 0,d=c&&c.length===2?c[1]:void 0,l=(s=o.headers)==null?void 0:s.get(le.VisitorID);d&&l&&(l!==window.UserLeap.visitorId||window.UserLeap.token!==d)&&(Q("token",d),Q("vid",l),H.emit(M.VisitorIDUpdated,{visitorId:l}),window.UserLeap.token=d,window.UserLeap.visitorId=l)}return o.json&&o.json.logMessage&&console.warn(`[Sprig] ${o.json.logMessage}`),o}async function Sa(e){var t;!((t=e==null?void 0:e.json)!=null&&t.delay)||(window.UserLeap.delayingSurvey=!0,await vt(e.json.delay),window.UserLeap.delayingSurvey=!1)}const Ea=function(e){if(!window.UserLeap)return;const t=async(r={})=>{var f,h;const{userId:o,anonymousId:i,metadata:s={},properties:a,showSurveyCallback:c}=r;let{eventName:d}=r;if(window.UserLeap.debugMode&&d!==Kt&&console.info("[DEBUG] Sprig track",r),e.mode==="test")return;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!o){const g="[Sprig] - Skipping tracking without userId";return console.warn(g),{success:!1,message:g,surveyState:"no survey"}}if(!d||d.trim().length===0){d=d?String(d):"";const g="[Sprig] - Invalid event name "+d;return console.warn(g),{success:!1,message:g,surveyState:"no survey"}}const l=window.location.href;if(s.url||(s.url=l),Q("trackStartUrl",l),(h=(f=window.UserLeap)==null?void 0:f._config)!=null&&h.optimizelyEnabled){const g=rt(window.UserLeap);gn(g)||ht.getAndSetWebOptimizelyExperiments(),s.optimizelyExperiments=Object.assign({},ht.getAllOptimizelyExperiments())}o&&(window.UserLeap.userId=o),i&&(window.UserLeap.partnerAnonymousId=i),a&&(s.eventProperties=a);const m=window.UserLeap.delayingSurvey?await _e(ce("1",[Ee],"events/batch"),{body:JSON.stringify({events:[{event:d,metadata:s}]}),method:"POST"},0,!0):await _e(ce("1",[Ee],"events"),{body:JSON.stringify({event:d,metadata:s}),method:"POST"},0,!0);if(!m.ok){const g="[Sprig] (ERR-421) Failed to track event";return m.reportError&&(console.warn(g,m.error),m.error&&window.UserLeap.reportError("track",m.error)),{success:!1,message:g,error:m.error,surveyState:"no survey"}}o&&Q("uid",o),i&&Q("aid",i);const p=m.json;return await Sa(m),ma(p.eventId,l)?Mo(p,c):{success:!1,message:"Study should not be displayed after page navigation",surveyState:"no survey"}},n={async displaySurvey(r){return console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",de.Override),$t({surveyId:r},!0)},_previewSurvey(r){window.UserLeap("dismissActiveSurvey",de.Override),$t({surveyTemplateId:r},!1)},_reviewSurvey(r){window.UserLeap("dismissActiveSurvey",de.Override),$t({surveyId:r},!1)},previewSurvey(r){n._previewSurvey(r)},reviewSurvey(r){n._reviewSurvey(r)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(r=de.API){H.emit(M.SurveyWillClose,{name:M.SurveyWillClose,initiator:r})},async setAttribute(r,o){if(!r||!o&&o!==0){const i="[Sprig] - Disregarding empty attribute / value provided";return console.warn(i),{success:!1,message:i}}return this.setAttributes({[r]:o})},async setAttributes(r){if(r==null||Object.keys(r).length===0){const o="[Sprig] - Disregarding empty attributes provided";return console.warn(o),{success:!1,message:o}}return this.identifyAndSetAttributes({attributes:r})},async identifyAndSetAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",r),e.mode==="test")return;if(r===null||typeof r!="object"||!(r.userId||r.anonymousId||r.attributes)){const d="[Sprig] - Disregarding empty payload provided";return console.warn(d),{success:!1,message:d}}const{userId:o,anonymousId:i,attributes:s}=r;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!o){const d="[Sprig] - Skipping tracking without userId";return console.warn(d),{success:!1,message:d}}if(!s&&(!o||window.UserLeap.userId===o)&&(!i||window.UserLeap.partnerAnonymousId===i))return{success:!0};const a={};o&&(a.userId=window.UserLeap.userId=o),i&&(a.partnerAnonymousId=window.UserLeap.partnerAnonymousId=i);let c;return s?(s.email&&!Object.prototype.hasOwnProperty.call(s,Ge)&&(s[Ge]=s.email,delete s.email),c=await _e(ce("1",[be,Ee],"attributes"),{body:JSON.stringify(s),method:"PUT"}),!c.ok&&c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await _e(ce("1",[be,Ee]),{body:JSON.stringify(a),method:"PUT"}),s&&s[Ge]&&(window.UserLeap.email=s[Ge]),c.ok&&(o&&Q("uid",o),i&&Q("aid",i)),{success:!!c.ok}},async removeAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig removeAttributes",r),e.mode==="test")return;if(r==null||r.length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}if(e.requireUserIdForTracking&&!window.UserLeap.userId){const i="[Sprig] - Skipping tracking without userId";return console.warn(i),{success:!1,message:i}}const o=await _e(ce("1",[be,Ee],"attributes"),{body:JSON.stringify({delete:r}),method:"DELETE"});return!o.ok&&o.reportError&&(console.warn("[Sprig] (ERR-433) Remove attributes failed",o.error),o.error&&window.UserLeap.reportError("removeAttributes",o.error)),{success:!!o.ok}},async addSurveyListener(r){H.on(M.SurveyLifeCycle,r)},async removeSurveyListener(r){H.removeListener(M.SurveyLifeCycle,r)},async addListener(r,o){H.on(r,o)},async removeListener(r,o){H.removeListener(r,o)},async removeAllListeners(){H.removeAllListeners()},setVisitorAttribute(r,o){return console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"),n.setAttribute(r,o)},async setEmail(r){return n.setAttribute(Ge,r)},async setVisitorEmail(r){return console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"),n.setEmail(r)},async setUserId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setUserId",r),r==null){const i=`[Sprig] - Invalid userId ${r}`;return console.warn(i),{success:!1,message:i}}if(e.mode==="test"||r===window.UserLeap.userId)return;window.UserLeap.userId=r;const o=await _e(ce("1",[be,Ee]),{body:JSON.stringify({userId:r}),method:"PUT"});if(!o.ok){o.reportError&&(console.warn("[Sprig] (ERR-420) Failed to set user id",o.error),o.error&&window.UserLeap.reportError("setUserId",o.error));return}Q("uid",r)},async setPartnerAnonymousId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setPartnerAnonymousId",r),r==null){const o=`[Sprig] - Invalid partnerAnonymousId ${r}`;return console.warn(o),{success:!1,message:o}}return window.UserLeap.partnerAnonymousId=r,Q("aid",r),{success:!0}},async track(r,o,i={},s=void 0){return t({eventName:r,properties:o,metadata:i,showSurveyCallback:s})},async identifyAndTrack(r){return await t(r)},applyStyles(r){if(window.UserLeap.customStyles=r,window.UserLeap.container){const o=window.UserLeap.container.children[0].contentDocument;if(o){const i=o.getElementById(y.CustomStyle);i?i.textContent=r:rr(o,r,window.UserLeap.styleNonce)}}},setWindowDimensions(r,o){var c,d;const i=typeof r=="string"?parseInt(r,10):r,s=typeof o=="string"?parseInt(o,10):o;if(!isNaN(i)&&!isNaN(s)&&(window.UserLeap.windowDimensions={width:i,height:s}),!window.UserLeap.frameId)return;const a=document.getElementById(window.UserLeap.frameId);!a||(window.UserLeap.useMobileStyling&&((c=window.UserLeap.windowDimensions)!=null&&c.width&&(a.style.width=`${window.UserLeap.windowDimensions.width}px`),(d=window.UserLeap.windowDimensions)!=null&&d.height&&(a.style.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`),a.contentDocument&&(a.style.height=String(or(a.contentDocument))+"px")),H.emit(M.SurveyDimensions,{name:M.SurveyDimensions,contentFrameWidth:a.clientWidth,contentFrameHeight:a.clientHeight}))},logoutUser(){window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,window.UserLeap.localStorageAvailable&&(localStorage.removeItem(et),localStorage.removeItem(Qt)),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),Do(),window.UserLeap._queue.unpause()},teardown(){va(),window.UserLeap("dismissActiveSurvey",de.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(r){const o=JSON.parse(r);ht.setOptimizelyExperiment(o)}};Object.assign(window.UserLeap,n)};async function La(e){const t=rt(window.UserLeap);let n=await ge(ce("1",[be],"config"),{headers:t});const r="TypeError";if(window.UserLeap.error=n.error,!n.ok&&n.error&&n.error.name===r&&(window.UserLeap._API_URL="https://api.sprig.com",window.UserLeap.reportError("sprigDomainRequest",n.error),n=await ge(ce("1",[be],"config"),{headers:t})),!n.ok)return n.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",n.error),n.error&&window.UserLeap.reportError("applyRemoteConfig",n.error)),Ft("Disabled: failed to fetch configuration"),e;const o=n.json;return o!=null&&o.disabled?(Ft(`Disabled: ${o.disabled}`),{disabled:o.disabled}):Object.assign({},e,o)}async function Ua(e,t){const n=window.__cfg&&window.__cfg.mode,r=hn(),o=window.UserLeap.envId,i=window.document.documentElement,s={mode:n,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:i.clientWidth,clientHeight:i.clientHeight,location:window.location.href,language:window.navigator.language},a={action:e,err:{message:t.message,stack:t.stack},meta:s,vid:r,envId:o};(await _e(ce("1",null,"errors"),{method:"POST",headers:{[le.Error]:window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(a)},0,!0)).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}function Ia(e={}){window.UserLeap.UPDATES=Xt;async function t(){if(window.UserLeap.loaded)return;if(window.UserLeap.reportError=Ua,window.UserLeap.loaded=!0,window.UserLeap._config=Object.assign({},e,window.UserLeap.config),window.UserLeap.delayingSurvey=!1,window.UserLeap._config&&typeof window.UserLeap._config=="object")for(const a in window.UserLeap._config)window.UserLeap[a]=window.UserLeap._config[a];if(!window.UserLeap.envId)if(window.UserLeap.appId)window.UserLeap.envId=window.UserLeap.appId;else throw new Error("Missing Environment id");window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const n=wa();window.UserLeap.localStorageAvailable=n;const r=window.UserLeap.sampleRate;if(r)if(!n)window.UserLeap.debugMode&&console.info("[DEBUG] Sprig cannot sample users without localStorage permissions");else{let a=Le("sampled");if(a===null&&(a=Math.random()<r,Q("sampled",a)),!a)return}else n&&Le("sampled")!==null&&Q("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const o=[...window.UserLeap._queue];window.UserLeap._queue=new da(window.UserLeap,[]),window.UserLeap._queue.pause();for(let a=0;a<o.length;a++)window.UserLeap._queue.push(o[a]);const i=Le("token");i?(window.UserLeap.token=i,window.UserLeap.visitorId=Le("vid"),window.UserLeap.userId=Le("uid"),window.UserLeap.partnerAnonymousId=Le("aid")):(window.UserLeap.localStorageAvailable&&localStorage.removeItem(et),Do());const s=await La(e);Ea(s),await ka(s),window.UserLeap._queue.unpause(),H.emit(M.SDKReady),H.emit(M.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}document.readyState==="complete"?t():window.attachEvent?window.attachEvent("onload",t):window.addEventListener("load",t,!1)}class Ct{constructor(){se(this,"UPDATES",Xt)}displaySurvey(t){window.Sprig("displaySurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,n){window.Sprig("setAttribute",t,n)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,n){window.Sprig("addListener",t,n)}removeListener(t,n){window.Sprig("removeListener",t,n)}removeAllListeners(){window.Sprig("removeAllListeners")}setEmail(t){window.Sprig("setAttribute","!email",t)}setUserId(t){window.Sprig("setUserId",t)}setPartnerAnonymousId(t){window.Sprig("setPartnerAnonymousId",t)}track(t,n={},r={}){window.Sprig("track",t,n,r)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,n){window.Sprig("setWindowDimensions",t,n)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}}const Jt={configure:e=>{if(!e.envId&&!e.environmentId)throw new Error("Initialization Error: Sprig configure requires an environmentId");if(e.envId||(e.envId=e.environmentId||""),e.installationMethod=xe.Npm,window.Sprig)return window.Sprig;window.Sprig=function(){window.Sprig._queue.push(arguments)},Object.getOwnPropertyNames(Ct.prototype).map(n=>{n!=="constructor"&&(window.Sprig[n]=Ct.prototype[n])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,Ia(e),window.Sprig}},Ta={sprig:Jt,SprigAPI:Ct,configure:Jt.configure};exports.DismissReason=de;exports.SprigAPI=Ct;exports.SprigEvent=M;exports.default=Ta;exports.sprig=Jt;