@sprig-technologies/sprig-browser
Version:
npm package for the sprig web sdk
12 lines • 160 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./core-BSewKENy.cjs"),V=require("./metricsReporter-Cdy0iTSw.cjs");var Me,R,wn,ke,Pt,Cn,ct,En,Le={},Sn=[],Ar=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fe=Array.isArray;function he(e,t){for(var n in t)e[n]=t[n];return e}function jn(e){var t=e.parentNode;t&&t.removeChild(e)}function W(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?Me.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 De(e,s,r,o,null)}function De(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,constructor:void 0,__v:o??++wn,__i:-1,__u:0};return o==null&&R.vnode!=null&&R.vnode(i),i}function In(){return{current:null}}function J(e){return e.children}function ae(e,t){this.props=e,this.context=t}function je(e,t){if(t==null)return e.__?je(e.__,e.__i+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"?je(e):null}function Tn(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 Tn(e)}}function ut(e){(!e.__d&&(e.__d=!0)&&ke.push(e)&&!$e.__r++||Pt!==R.debounceRendering)&&((Pt=R.debounceRendering)||Cn)($e)}function $e(){var e,t,n,r,o,i,s,d,l;for(ke.sort(ct);e=ke.shift();)e.__d&&(t=ke.length,r=void 0,i=(o=(n=e).__v).__e,d=[],l=[],(s=n.__P)&&((r=he({},o)).__v=o.__v+1,R.vnode&&R.vnode(r),bt(s,r,o,n.__n,s.ownerSVGElement!==void 0,32&o.__u?[i]:null,d,i??je(o),!!(32&o.__u),l),r.__.__k[r.__i]=r,Dn(d,r,l),r.__e!=i&&Tn(r)),ke.length>t&&ke.sort(ct));$e.__r=0}function Lt(e,t,n,r,o,i,s,d,l,p,h){var c,u,m,g,f,v=r&&r.__k||Sn,k=t.length;for(n.__d=l,function(_,T,j){var E,w,I,D,x,b=T.length,y=j.length,S=y,M=0;for(_.__k=[],E=0;E<b;E++)(w=_.__k[E]=(w=T[E])==null||typeof w=="boolean"||typeof w=="function"?null:typeof w=="string"||typeof w=="number"||typeof w=="bigint"||w.constructor==String?De(null,w,null,null,w):Fe(w)?De(J,{children:w},null,null,null):w.constructor===void 0&&w.__b>0?De(w.type,w.props,w.key,w.ref?w.ref:null,w.__v):w)!=null?(w.__=_,w.__b=_.__b+1,x=Br(w,j,D=E+M,S),w.__i=x,I=null,x!==-1&&(S--,(I=j[x])&&(I.__u|=131072)),I==null||I.__v===null?(x==-1&&M--,typeof w.type!="function"&&(w.__u|=65536)):x!==D&&(x===D+1?M++:x>D?S>b-D?M+=x-D:M--:M=x<D&&x==D-1?x-D:0,x!==E+M&&(w.__u|=65536))):(I=j[E])&&I.key==null&&I.__e&&(I.__e==_.__d&&(_.__d=je(I)),pt(I,I,!1),j[E]=null,S--);if(S)for(E=0;E<y;E++)(I=j[E])!=null&&!(131072&I.__u)&&(I.__e==_.__d&&(_.__d=je(I)),pt(I,I))}(n,t,v),l=n.__d,c=0;c<k;c++)(m=n.__k[c])!=null&&typeof m!="boolean"&&typeof m!="function"&&(u=m.__i===-1?Le:v[m.__i]||Le,m.__i=c,bt(e,m,u,o,i,s,d,l,p,h),g=m.__e,m.ref&&u.ref!=m.ref&&(u.ref&&yt(u.ref,null,m),h.push(m.ref,m.__c||g,m)),f==null&&g!=null&&(f=g),65536&m.__u||u.__k===m.__k?l=Rn(m,l,e):typeof m.type=="function"&&m.__d!==void 0?l=m.__d:g&&(l=g.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=f}function Rn(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Rn(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function me(e,t){return t=t||[],e==null||typeof e=="boolean"||(Fe(e)?e.some(function(n){me(n,t)}):t.push(e)),t}function Br(e,t,n,r){var o=e.key,i=e.type,s=n-1,d=n+1,l=t[n];if(l===null||l&&o==l.key&&i===l.type)return n;if(r>(l==null||131072&l.__u?0:1))for(;s>=0||d<t.length;){if(s>=0){if((l=t[s])&&!(131072&l.__u)&&o==l.key&&i===l.type)return s;s--}if(d<t.length){if((l=t[d])&&!(131072&l.__u)&&o==l.key&&i===l.type)return d;d++}}return-1}function Mt(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ar.test(t)?n:n+"px"}function He(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||Mt(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Mt(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?Ot:Nt,i)):e.removeEventListener(t,i?Ot:Nt,i);else{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!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Nt(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(R.event?R.event(e):e)}function Ot(e){return this.l[e.type+!0](R.event?R.event(e):e)}function bt(e,t,n,r,o,i,s,d,l,p){var h,c,u,m,g,f,v,k,_,T,j,E,w,I,D,x=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[d=t.__e=n.__e]),(h=R.__b)&&h(t);e:if(typeof x=="function")try{if(k=t.props,_=(h=x.contextType)&&r[h.__c],T=h?_?_.props.value:h.__:r,n.__c?v=(c=t.__c=n.__c).__=c.__E:("prototype"in x&&x.prototype.render?t.__c=c=new x(k,T):(t.__c=c=new ae(k,T),c.constructor=x,c.render=qr),_&&_.sub(c),c.props=k,c.state||(c.state={}),c.context=T,c.__n=r,u=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),x.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=he({},c.__s)),he(c.__s,x.getDerivedStateFromProps(k,c.__s))),m=c.props,g=c.state,c.__v=t,u)x.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(x.getDerivedStateFromProps==null&&k!==m&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(k,T),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(k,c.__s,T)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=k,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(b){b&&(b.__=t)}),j=0;j<c._sb.length;j++)c.__h.push(c._sb[j]);c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(k,c.__s,T),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(m,g,f)})}if(c.context=T,c.props=k,c.__P=e,c.__e=!1,E=R.__r,w=0,"prototype"in x&&x.prototype.render){for(c.state=c.__s,c.__d=!1,E&&E(t),h=c.render(c.props,c.state,c.context),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[]}else do c.__d=!1,E&&E(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++w<25);c.state=c.__s,c.getChildContext!=null&&(r=he(he({},r),c.getChildContext())),u||c.getSnapshotBeforeUpdate==null||(f=c.getSnapshotBeforeUpdate(m,g)),Lt(e,Fe(D=h!=null&&h.type===J&&h.key==null?h.props.children:h)?D:[D],t,n,r,o,i,s,d,l,p),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),v&&(c.__E=c.__=null)}catch(b){t.__v=null,l||i!=null?(t.__e=d,t.__u|=l?160:32,i[i.indexOf(d)]=null):(t.__e=n.__e,t.__k=n.__k),R.__e(b,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(b,y,S,M,C,N,A,H,B){var P,$,K,ne,z,X,ye,oe=S.props,ue=y.props,ie=y.type;if(ie==="svg"&&(C=!0),N!=null){for(P=0;P<N.length;P++)if((z=N[P])&&"setAttribute"in z==!!ie&&(ie?z.localName===ie:z.nodeType===3)){b=z,N[P]=null;break}}if(b==null){if(ie===null)return document.createTextNode(ue);b=C?document.createElementNS("http://www.w3.org/2000/svg",ie):document.createElement(ie,ue.is&&ue),N=null,H=!1}if(ie===null)oe===ue||H&&b.data===ue||(b.data=ue);else{if(N=N&&Me.call(b.childNodes),oe=S.props||Le,!H&&N!=null)for(oe={},P=0;P<b.attributes.length;P++)oe[(z=b.attributes[P]).name]=z.value;for(P in oe)z=oe[P],P=="children"||(P=="dangerouslySetInnerHTML"?K=z:P==="key"||P in ue||He(b,P,null,z,C));for(P in ue)z=ue[P],P=="children"?ne=z:P=="dangerouslySetInnerHTML"?$=z:P=="value"?X=z:P=="checked"?ye=z:P==="key"||H&&typeof z!="function"||oe[P]===z||He(b,P,z,oe[P],C);if($)H||K&&($.__html===K.__html||$.__html===b.innerHTML)||(b.innerHTML=$.__html),y.__k=[];else if(K&&(b.innerHTML=""),Lt(b,Fe(ne)?ne:[ne],y,S,M,C&&ie!=="foreignObject",N,A,N?N[0]:S.__k&&je(S,0),H,B),N!=null)for(P=N.length;P--;)N[P]!=null&&jn(N[P]);H||(P="value",X!==void 0&&(X!==b[P]||ie==="progress"&&!X||ie==="option"&&X!==oe[P])&&He(b,P,X,oe[P],!1),P="checked",ye!==void 0&&ye!==b[P]&&He(b,P,ye,oe[P],!1))}return b}(n.__e,t,n,r,o,i,s,l,p);(h=R.diffed)&&h(t)}function Dn(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)yt(n[r],n[++r],n[++r]);R.__c&&R.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){R.__e(i,o.__v)}})}function yt(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){R.__e(r,n)}}function pt(e,t,n){var r,o;if(R.unmount&&R.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||yt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){R.__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]&&pt(r[o],t,n||typeof e.type!="function");n||e.__e==null||jn(e.__e),e.__=e.__e=e.__d=void 0}function qr(e,t,n){return this.constructor(e,n)}function Ie(e,t,n){var r,o,i,s;R.__&&R.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],bt(t,e=(!r&&n||t).__k=W(J,null,[e]),o||Le,Le,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?Me.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Dn(i,e,s)}function Pn(e,t){Ie(e,t,Pn)}function Vr(e,t,n){var r,o,i,s,d=he({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:d[i]=t[i]===void 0&&s!==void 0?s[i]:t[i];return arguments.length>2&&(d.children=arguments.length>3?Me.call(arguments,2):n),De(e.type,d,r||e.key,o||e.ref,null)}function Ln(e,t){var n={__c:t="__cC"+En++,__: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(d){d.__e=!0,ut(d)})},this.sub=function(s){o.push(s);var d=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),d&&d.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Me=Sn.slice,R={__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(d){e=d}throw e}},wn=0,ae.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),ut(this))},ae.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ut(this))},ae.prototype.render=J,ke=[],Cn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ct=function(e,t){return e.__v.__b-t.__v.__b},$e.__r=0,En=0;var ge,F,et,Ut,Te=0,Mn=[],Ae=[],Ht=R.__b,At=R.__r,Bt=R.diffed,qt=R.__c,Vt=R.unmount;function Ce(e,t){R.__h&&R.__h(F,e,Te||t),Te=0;var n=F.__H||(F.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Ae}),n.__[e]}function Z(e){return Te=1,xt(Hn,e)}function xt(e,t,n){var r=Ce(ge++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Hn(void 0,t),function(d){var l=r.__N?r.__N[0]:r.__[0],p=r.t(l,d);l!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=F,!F.u)){var o=function(d,l,p){if(!r.__c.__H)return!0;var h=r.__c.__H.__.filter(function(u){return u.__c});if(h.every(function(u){return!u.__N}))return!i||i.call(this,d,l,p);var c=!1;return h.forEach(function(u){if(u.__N){var m=u.__[0];u.__=u.__N,u.__N=void 0,m!==u.__[0]&&(c=!0)}}),!(!c&&r.__c.props===d)&&(!i||i.call(this,d,l,p))};F.u=!0;var i=F.shouldComponentUpdate,s=F.componentWillUpdate;F.componentWillUpdate=function(d,l,p){if(this.__e){var h=i;i=void 0,o(d,l,p),i=h}s&&s.call(this,d,l,p)},F.shouldComponentUpdate=o}return r.__N||r.__}function Q(e,t){var n=Ce(ge++,3);!R.__s&&wt(n.__H,t)&&(n.__=e,n.i=t,F.__H.__h.push(n))}function Ne(e,t){var n=Ce(ge++,4);!R.__s&&wt(n.__H,t)&&(n.__=e,n.i=t,F.__h.push(n))}function re(e){return Te=5,Oe(function(){return{current:e}},[])}function Nn(e,t,n){Te=6,Ne(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 Oe(e,t){var n=Ce(ge++,7);return wt(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function We(e,t){return Te=8,Oe(function(){return e},t)}function On(e){var t=F.context[e.__c],n=Ce(ge++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(F)),t.props.value):e.__}function kt(e,t){R.useDebugValue&&R.useDebugValue(t?t(e):e)}function Un(){var e=Ce(ge++,11);if(!e.__){for(var t=F.__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 zr(){for(var e;e=Mn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Be),e.__H.__h.forEach(ht),e.__H.__h=[]}catch(t){e.__H.__h=[],R.__e(t,e.__v)}}R.__b=function(e){F=null,Ht&&Ht(e)},R.__r=function(e){At&&At(e),ge=0;var t=(F=e.__c).__H;t&&(et===F?(t.__h=[],F.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Ae,n.__N=n.i=void 0})):(t.__h.forEach(Be),t.__h.forEach(ht),t.__h=[],ge=0)),et=F},R.diffed=function(e){Bt&&Bt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Mn.push(t)!==1&&Ut===R.requestAnimationFrame||((Ut=R.requestAnimationFrame)||Fr)(zr)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Ae&&(n.__=n.__V),n.i=void 0,n.__V=Ae})),et=F=null},R.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Be),n.__h=n.__h.filter(function(r){return!r.__||ht(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],R.__e(r,n.__v)}}),qt&&qt(e,t)},R.unmount=function(e){Vt&&Vt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Be(r)}catch(o){t=o}}),n.__H=void 0,t&&R.__e(t,n.__v))};var zt=typeof requestAnimationFrame=="function";function Fr(e){var t,n=function(){clearTimeout(r),zt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);zt&&(t=requestAnimationFrame(n))}function Be(e){var t=F,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),F=t}function ht(e){var t=F;e.__c=e.__(),F=t}function wt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Hn(e,t){return typeof t=="function"?t(e):t}function An(e,t){for(var n in t)e[n]=t[n];return e}function mt(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 Ze(e){this.props=e}function Bn(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:mt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,W(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Ze.prototype=new ae).isPureReactComponent=!0,Ze.prototype.shouldComponentUpdate=function(e,t){return mt(this.props,e)||mt(this.state,t)};var Ft=R.__b;R.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ft&&Ft(e)};var $r=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Ct(e){function t(n){var r=An({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=$r,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var $t=function(e,t){return e==null?null:me(me(e).map(t))},qn={map:$t,forEach:$t,count:function(e){return e?me(e).length:0},only:function(e){var t=me(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:me},Wr=R.__e;R.__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)}Wr(e,t,n,r)};var Wt=R.unmount;function Vn(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=An({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Vn(r,t,n)})),e}function zn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return zn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Pe(){this.__u=0,this.t=null,this.__b=null}function Fn(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function $n(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 W(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Se(){this.u=null,this.o=null}R.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Wt&&Wt(e)},(Pe.prototype=new ae).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=Fn(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(d):d())};n.__R=s;var d=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=zn(l,l.__c.__P,l.__c.__O)}var p;for(r.setState({__a:r.__b=null});p=r.t.pop();)p.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Pe.prototype.componentWillUnmount=function(){this.t=[]},Pe.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]=Vn(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&W(J,null,e.fallback);return o&&(o.__u&=-33),[W(J,null,t.__a?null:e.children),o]};var Zt=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 Zr(e){return this.getChildContext=function(){return e.context},e.children}function Gr(e){var t=this,n=e.i;t.componentWillUnmount=function(){Ie(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),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)}}),Ie(W(Zr,{context:t.context},e.__v),t.l)}function Wn(e,t){var n=W(Gr,{__v:e,i:t});return n.containerInfo=t,n}(Se.prototype=new ae).__a=function(e){var t=this,n=Fn(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Zt(t,e,r)):o()};n?n(i):i()}},Se.prototype.render=function(e){this.u=null,this.o=new Map;var t=me(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},Se.prototype.componentDidUpdate=Se.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Zt(e,n,t)})};var Zn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Kr=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Yr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Qr=/[A-Z0-9]/g,Jr=typeof document<"u",Xr=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Gn(e,t,n){return t.__k==null&&(t.textContent=""),Ie(e,t),typeof n=="function"&&n(),e?e.__c:null}function Kn(e,t,n){return Pn(e,t),typeof n=="function"&&n(),e?e.__c:null}ae.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ae.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Gt=R.event;function eo(){}function to(){return this.cancelBubble}function no(){return this.defaultPrevented}R.event=function(e){return Gt&&(e=Gt(e)),e.persist=eo,e.isPropagationStopped=to,e.isDefaultPrevented=no,e.nativeEvent=e};var Et,ro={enumerable:!1,configurable:!0,get:function(){return this.class}},Kt=R.vnode;R.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||Jr&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var d=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":d==="ondoubleclick"?i="ondblclick":d!=="onchange"||r!=="input"&&r!=="textarea"||Xr(n.type)?d==="onfocus"?i="onfocusin":d==="onblur"?i="onfocusout":Yr.test(i)?i=d:r.indexOf("-")===-1&&Kr.test(i)?i=i.replace(Qr,"-$&").toLowerCase():s===null&&(s=void 0):d=i="oninput",d==="oninput"&&o[i=d]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=me(n.children).forEach(function(l){l.props.selected=o.value.indexOf(l.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=me(n.children).forEach(function(l){l.props.selected=o.multiple?o.defaultValue.indexOf(l.props.value)!=-1:o.defaultValue==l.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",ro)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Zn,Kt&&Kt(e)};var Yt=R.__r;R.__r=function(e){Yt&&Yt(e),Et=e.__c};var Qt=R.diffed;R.diffed=function(e){Qt&&Qt(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Et=null};var Yn={ReactCurrentDispatcher:{current:{readContext:function(e){return Et.__n[e.__c].props.value}}}};function Qn(e){return W.bind(null,e)}function Ue(e){return!!e&&e.$$typeof===Zn}function Jn(e){return Ue(e)&&e.type===J}function Xn(e){return Ue(e)?Vr.apply(null,arguments):e}function er(e){return!!e.__k&&(Ie(null,e),!0)}function tr(e){return e&&(e.base||e.nodeType===1&&e)||null}var nr=function(e,t){return e(t)},rr=function(e,t){return e(t)},or=J;function St(e){e()}function ir(e){return e}function sr(){return[!1,St]}var ar=Ne,lr=Ue;function dr(e,t){var n=t(),r=Z({h:{__:n,v:t}}),o=r[0].h,i=r[1];return Ne(function(){o.__=n,o.v=t,tt(o)&&i({h:o})},[e,n,t]),Q(function(){return tt(o)&&i({h:o}),e(function(){tt(o)&&i({h:o})})},[e]),n}function tt(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}var oo={useState:Z,useId:Un,useReducer:xt,useEffect:Q,useLayoutEffect:Ne,useInsertionEffect:ar,useTransition:sr,useDeferredValue:ir,useSyncExternalStore:dr,startTransition:St,useRef:re,useImperativeHandle:Nn,useMemo:Oe,useCallback:We,useContext:On,useDebugValue:kt,version:"17.0.2",Children:qn,render:Gn,hydrate:Kn,unmountComponentAtNode:er,createPortal:Wn,createElement:W,createContext:Ln,createFactory:Qn,cloneElement:Xn,createRef:In,Fragment:J,isValidElement:Ue,isElement:lr,isFragment:Jn,findDOMNode:tr,Component:ae,PureComponent:Ze,memo:Bn,forwardRef:Ct,flushSync:rr,unstable_batchedUpdates:nr,StrictMode:or,Suspense:Pe,SuspenseList:Se,lazy:$n,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Yn};const io=Object.freeze(Object.defineProperty({__proto__:null,Children:qn,Component:ae,Fragment:J,PureComponent:Ze,StrictMode:or,Suspense:Pe,SuspenseList:Se,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Yn,cloneElement:Xn,createContext:Ln,createElement:W,createFactory:Qn,createPortal:Wn,createRef:In,default:oo,findDOMNode:tr,flushSync:rr,forwardRef:Ct,hydrate:Kn,isElement:lr,isFragment:Jn,isValidElement:Ue,lazy:$n,memo:Bn,render:Gn,startTransition:St,unmountComponentAtNode:er,unstable_batchedUpdates:nr,useCallback:We,useContext:On,useDebugValue:kt,useDeferredValue:ir,useEffect:Q,useErrorBoundary:function(e){var t=Ce(ge++,10),n=Z();return t.__=e,F.componentDidCatch||(F.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]},useId:Un,useImperativeHandle:Nn,useInsertionEffect:ar,useLayoutEffect:Ne,useMemo:Oe,useReducer:xt,useRef:re,useState:Z,useSyncExternalStore:dr,useTransition:sr,version:"17.0.2"},Symbol.toStringTag,{value:"Module"})),Jt=e=>{let t;const n=new Set,r=(s,d)=>{const l=typeof s=="function"?s(t):s;if(!Object.is(l,t)){const p=t;t=d??typeof l!="object"?l:Object.assign({},t,l),n.forEach(h=>h(t,p))}},o=()=>t,i={setState:r,getState:o,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>n.clear()};return t=e(r,o,i),i};function so(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ao(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):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 cr={exports:{}},Xt={};const ur=ao(io);var pr={exports:{}},en={},Re=ur,lo=typeof Object.is=="function"?Object.is:function(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t},co=Re.useState,uo=Re.useEffect,po=Re.useLayoutEffect,ho=Re.useDebugValue;function nt(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lo(e,n)}catch{return!0}}var mo=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(e,t){return t()}:function(e,t){var n=t(),r=co({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return po(function(){o.value=n,o.getSnapshot=t,nt(o)&&i({inst:o})},[e,n,t]),uo(function(){return nt(o)&&i({inst:o}),e(function(){nt(o)&&i({inst:o})})},[e]),ho(n),n};en.useSyncExternalStore=Re.useSyncExternalStore!==void 0?Re.useSyncExternalStore:mo,pr.exports=en;var Ye=ur,go=pr.exports,vo=typeof Object.is=="function"?Object.is:function(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t},fo=go.useSyncExternalStore,_o=Ye.useRef,bo=Ye.useEffect,yo=Ye.useMemo,xo=Ye.useDebugValue;Xt.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=_o(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=yo(function(){function l(m){if(!c){if(c=!0,p=m,m=r(m),o!==void 0&&s.hasValue){var g=s.value;if(o(g,m))return h=g}return h=m}if(g=h,vo(p,m))return g;var f=r(m);return o!==void 0&&o(g,f)?g:(p=m,h=f)}var p,h,c=!1,u=n===void 0?null:n;return[function(){return l(t())},u===null?void 0:function(){return l(u())}]},[t,n,r,o]);var d=fo(e,i[0],i[1]);return bo(function(){s.hasValue=!0,s.value=d},[d]),xo(d),d},cr.exports=Xt;const ko=so(cr.exports),{useSyncExternalStoreWithSelector:wo}=ko,tn=e=>{const t=typeof e=="function"?(r=>r?Jt(r):Jt)(e):e,n=(r,o)=>function(i,s=i.getState,d){const l=wo(i.subscribe,i.getState,i.getServerState||i.getState,s,d);return kt(l),l}(t,r,o);return Object.assign(n,t),n},hr=e=>e?tn(e):tn,Co=1,Eo=2,jt={eq:(e,t)=>e==t,neq(e,t){return!this.eq(e,t)},gt:(e,t)=>e>t,gte:(e,t)=>e>=t,lt:(e,t)=>e<t,lte:(e,t)=>e<=t,list_exact:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&e.slice().sort().join(",")===t.slice().sort().join(","),list_all:(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&!t.some(n=>e.indexOf(n)===-1),list_alo(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.some(o=>r.has(o))},list_dni(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.every(o=>!r.has(o))},contains(e,t){const n=e.toLowerCase(),r=t.toLowerCase();return n.includes(r)},notcontains(e,t){return!this.contains(e,t)}},So=(e,t,n)=>{switch(t){case"videovoice":return!!(e&&e.value);case"open":return!!n;case"multipleselect":return!!(n&&Object.keys(n).length);case"recordedtask":return(n==null?void 0:n.taskStatus)==="completed";case"texturlprompt":return!e.value;case"consentlegal":case"nps":case"likert":return n!==null;case"multiplechoice":return n!==void 0;case"matrix":return!!(n&&Object.values(n).every(r=>r!==null));default:return!0}},mr=(e,t)=>{if(t==="matrix"){const n=Object.keys(e).length,r=Object.values(e).filter(o=>o!==null).length;return r>0&&r<n}return!1},gr=({cards:e,index:t,hasEndCard:n,allResponses:r,uploadProgress:o={}})=>{if(t>=e.length||t<0)return null;const i=e[t];let s=t+1;const d=i.props.routingOptions||[];for(let h=0;h<d.length;h++){const{group:c,target:u}=d[h];if(!(c!=null&&c.length))continue;const m=c[0];if(m.questionIndex===void 0||m.questionIndex>r.length)continue;let g=nn({comparator:m.comparator,response:r[m.questionIndex],type:i.type,value:m.value});for(let f=1;f<c.length;f+=2){const v=c[f],k=c[f+1],_=nn({comparator:k.comparator,response:r[k.questionIndex],type:e[k.questionIndex].type,value:k.value});v===Co?g&&(g=_):v===Eo&&(g||(g=_))}if(g){s=u===-1&&n?e.length-1:u;break}}const l=e.findIndex(h=>h.type==="uploading");let p;return p=l>0?n?e.length-3:e.length-2:e.length-1,t>=p||s===-1||s!==null&&s>p?l>0&&Object.values(o).some(c=>c.isSubmitted&&!c.isComplete)?l:n?e.length-1:null:s===-1?null:s},nn=({comparator:e,response:t,type:n,value:r})=>{if(e==="answered")switch(n){case"texturlprompt":return t===void 0;case"consentlegal":return t&&t.submitted===!0;case"recordedtask":return"taskStatus"in t&&t.taskStatus==="completed";case"likert":case"nps":return Number.isInteger(t);case"matrix":return Object.values(t).every(o=>o!==null);case"multiplechoice":return t!==void 0;case"multipleselect":return(t==null?void 0:t.length)>0;case"open":return t&&t.length>0;case"videovoice":return!!(t!=null&&t.mediaRecordingUid);default:return!1}if(e==="given_up")return n!=="recordedtask"||"taskStatus"in t&&t.taskStatus==="given.up";if(e==="partial")return n==="matrix"&&mr(t,n);if(e==="skipped")switch(n){case"texturlprompt":return t==null?void 0:t.skipped;case"consentlegal":case"likert":case"nps":case"videovoice":return t===null;case"recordedtask":return"taskStatus"in t&&t.taskStatus==="abandoned";case"open":case"multipleselect":return(t==null?void 0:t.length)===0;case"multiplechoice":return t===void 0;case"matrix":return Object.values(t).every(o=>o===null);default:return!1}return jt[e](t,r)},jo=e=>{var r,o,i;switch(e.type){case"multipleselect":return e&&e.props&&e.props.options?e.props.options.length>13?e.props.options.map(s=>[s.value]):(t=e.props.options.map(s=>s.value),n=!e.props.properties.required,t.reduce((s,d)=>s.concat(s.map(l=>[...l,d])),[[]]).filter(s=>n||s.length>0)):null;case"multiplechoice":{if(!e||!e.props||!e.props.options)return null;const s=e.props.options.map(d=>d.value);return e.props.properties.required||s.push(void 0),s}case"matrix":{if(!((r=e==null?void 0:e.props)!=null&&r.options))return null;const s=e.props.properties.matrixColumn,d=e.props.options,l=d.reduce((h,c)=>(h[c.id]=null,h),{}),p=[{...l,[d[0].id]:s[0].value},d.reduce((h,c)=>(h[c.id]=s[0].value,h),{})];return e.props.properties.required||p.push(l),p}case"likert":{const s=Number((i=(o=e.props)==null?void 0:o.properties)==null?void 0:i.range)||5;return[...Array.from(Array(s).keys()).map(l=>l+1),...e.props.properties.required?[]:[null]]}case"nps":return[0,1,2,3,4,5,6,7,8,9,10,...e.props.properties.required?[]:[null]];case"videovoice":case"open":return["1",...e.props.properties.required?[]:[""]];case"recordedtask":{const s=[{taskStatus:"completed"},{taskStatus:"given.up"}];return e.props.properties.required||s.push({taskStatus:"abandoned"}),s}case"texturlprompt":return[void 0,...e.props.properties.required?[]:[{skipped:!0}]];case"consentlegal":return[1,...e.props.properties.required?[]:[null]];default:return[1]}var t,n},Io=e=>e in jt,To=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,Ro=(e,t=[])=>t.reduce((n,r)=>{const{group:o,target:i}=r;if(!(o!=null&&o.length))return[...n];const s=o.filter(d=>!!Number(d)||typeof d=="object"&&d.questionIndex===e).map(d=>{const{comparator:l,value:p}=d;return{comparator:l,target:i,value:p}});return[...n,...s]},[]),rt=new Set(["thanks","uploading"]),q=hr()((e,t)=>({allResponses:[],answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(n=G.APP_ID)=>{const r=t(),{fadeout:o,remove:i,trackHistory:s,studyType:d}=r;await o(n),ot(r)||s({event:"closed"}),V.breadcrumbsLogger.info("SurveyClosing",{surveyId:r.surveyId}),G.ConflictingWidgets.enable(),i({initiator:V.DismissReason.Closed,studyType:d})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async n=>{const{eventEmitFn:r,fadeout:o,remove:i,studyType:s,surveyId:d}=t();r("survey.complete",d),await o(n),G.ConflictingWidgets.enable(),i({initiator:V.DismissReason.Complete,studyType:s})},endCard:{headline:""},envId:"",eventEmitFn:V.eventEmitter.emit.bind(V.eventEmitter),fadeout:async n=>{const{eventEmitFn:r,headers:o,viewDocument:i}=t();return V.shouldDirectEmbed(o)?Promise.resolve():(r(V.SprigEvent.SurveyFadingOut),new Promise(s=>{const d=i.getElementById(n);d?(d.addEventListener("transitionend",()=>{s()}),d.classList.remove("ul-app--visible")):s()}))},forceBrandedLogo:!1,frame:document.createElement("iframe"),handleClickEmbedButton:n=>{const{cards:r,eventEmitFn:o,index:i}=t();o(n,{qid:r[i].name,props:r[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:n,isComplete:r,progressPct:o,isSubmitted:i})=>{var m,g,f;const{cards:s,destroy:d,index:l,uploadProgress:p}=t(),h=r||((m=p[n])==null?void 0:m.isComplete),c={...p,[n]:{progressPct:h?100:o||((g=p[n])==null?void 0:g.progressPct),isComplete:h,isSubmitted:i||((f=p[n])==null?void 0:f.isSubmitted)}};if(e({uploadProgress:c}),s[l].type!=="uploading")return;const u=Object.entries(p).every(([v,k])=>!k.isSubmitted||k.isComplete||n==v&&r);if(u&&l>=s.length-1)return d(G.APP_ID);e({index:u?l+1:l,uploadingCardViewed:!0})},hasViewedEmbed:!1,headers:{Authorization:"","Content-Type":"","userleap-platform":"web","x-ul-environment-id":"","x-ul-installation-method":"web-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{allResponses:r,cards:o,eventEmitFn:i,index:s,responseGroupUid:d,submit:l,trackHistory:p,uploadProgress:h,viewedCardCount:c}=t();e({minScrollableHeight:void 0});const u=Date.now(),m=[...o],g=m[s],{type:f}=n.data,v={...n.data},k=v.value;(D=>!rt.has(D.type))(g)&&(g.value=k),v.answeredAt=u,delete v.type;const _={response:v,responseGroupUid:d,questionIndex:s};let T=f==="multiplechoice"?Object.values(k).find(D=>D!==!1):k;f==="multipleselect"&&(T=m[s].props.options.reduce((D,x)=>(k[x.id]&&D.push(x.value),D),[]));const j=r.slice(0);j[s]=T,e({allResponses:j});const E=gr({cards:m,index:s,hasEndCard:!!n.endCard,uploadProgress:h,allResponses:j});if(E===null)return _.completedAt=u,l(_),void n.completeSurvey();rt.has(m[E].type)&&(_.completedAt=u);const w=l(_);rt.has(m[E].type)||w.finally(()=>{p({event:"seen",index:E})});const I=m[E];m[E]&&i&&i("survey.question",{qid:I.name,props:I.props}),e({cards:m,hasViewedEmbed:!1,index:E,viewedCardCount:c+1})},pendingRemoveIframeReason:null,previewKey:null,previewMode:void 0,recorder:()=>{},recorderEventEmitter:V.eventEmitter,resolveTrackedPromise:()=>{const{removeIframeIfReady:n}=t();e(r=>({unresolvedRequestCount:r.unresolvedRequestCount-1})),n()},responseGroupUid:"",remove:({initiator:n,studyType:r})=>{const{eventEmitFn:o,removeIframeIfReady:i,surveyId:s}=t();e({pendingRemoveIframeReason:n,studyType:r}),o(V.SprigEvent.SurveyCloseRequested,{name:V.SprigEvent.SurveyCloseRequested,initiator:n,studyType:r,"survey.id":s}),i()},removeIframeIfReady:()=>{const{eventEmitFn:n,pendingRemoveIframeReason:r,unresolvedRequestCount:o,studyType:i,surveyId:s}=t();r&&o===0&&(n(V.SprigEvent.SurveyWillClose,{name:V.SprigEvent.SurveyWillClose,initiator:r,studyType:i,"survey.id":s}),e({pendingRemoveIframeReason:null,studyType:i}))},seen:async()=>{const{trackHistory:n}=t();return n({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:n,questionIndex:r,response:o,responseGroupUid:i})=>{const s=t();if(!i||ot(s))return;const d={responseGroupUid:i,meta:s.meta,customMetadata:s.customMetadata,responses:[o],completedAt:n,previewKey:s.previewKey},l=await s.trackPromise(V.sprigFetch(`${s.apiURL}/sdk/1/environments/${s.envId}/visitors/${s.userId}/responses/submit`,{body:JSON.stringify(d),headers:s.headers,method:"POST"}));l.ok?s.eventEmitFn(V.SprigEvent.QuestionAnswered,{...o,questionIndex:r,"survey.id":s.surveyId}):l.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",l.error),await s.trackPromise(rn(s,"submitResponse",l.error)))},surveyId:0,tabTitle:"",trackHistory:async({event:n,index:r,isNew:o=!1})=>{const i=t();if(ot(i))return;const{cards:s,index:d}=i,l=r!==void 0?s[r]:s[d],p={sid:i.surveyId,qid:l.name,action:n,vid:i.userId,eid:i.envId,isNew:o,responseGroupUid:i.responseGroupUid,previewKey:i.previewKey},h=await i.trackPromise(V.sprigFetch(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`,{body:JSON.stringify(p),headers:i.headers,method:"POST"}));!h.ok&&h.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",h.error),await i.trackPromise(rn(i,"trackHistory",h.error)))},trackPromise:async n=>{const{resolveTrackedPromise:r}=t();return e(o=>({unresolvedRequestCount:o.unresolvedRequestCount+1})),n.then(o=>(r(),o)).catch(o=>{throw r(),o})},unresolvedRequestCount:0,update:()=>{const{cards:n,index:r,headers:o,eventEmitFn:i,frame:s,useMobileStyling:d,surveyId:l,viewDocument:p}=t(),h=o["userleap-platform"]==="web",c=V.shouldDirectEmbed(o),u=n[r],m=u.type==="matrix"&&!(u.props.properties.displayMatrixAsAccordion||d);e({minScrollableHeight:void 0}),setTimeout(()=>{var k,_,T;!c&&!d&&((k=s==null?void 0:s.setWidth)==null||k.call(s,G.DEFAULT_WIDTH_PX));const[g,f,v]=G.calculateFrameDimensions(p,h&&!d,c);c?(i(V.SprigEvent.SurveyHeight,{name:V.SprigEvent.SurveyHeight,contentFrameHeight:g,"survey.id":l}),i(V.SprigEvent.SurveyWidth,{name:V.SprigEvent.SurveyWidth,contentFrameWidth:f,"survey.id":l})):((_=s.setHeight)==null||_.call(s,g),e({minScrollableHeight:v}),!d&&m&&((T=s.setWidth)==null||T.call(s,f)))},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),ot=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview||e.previewMode,rn=async(e,t,n)=>{const{mode:r,userId:o,envId:i,apiURL:s,headers:d,viewDocument:l}=e,p=l.documentElement,h={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:p.clientWidth,clientHeight:p.clientHeight,location:window.location.href,language:window.navigator.language},c={action:t,err:{message:`${n==null?void 0:n.name} - ${n==null?void 0:n.message}`,stack:n==null?void 0:n.stack},meta:h,vid:o,envId:i};(await V.sprigFetch(`${s}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},d),body:JSON.stringify(c)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},vr=e=>W("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},W("path",{d:"M17 10L12 15L7 10",stroke:"#0B2330",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),fr=e=>W("svg",{fill:"none",height:10,viewBox:"0 0 10 10",width:10,xmlns:"http://www.w3.org/2000/svg",...e},W("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:2}));var Do=0;function a(e,t,n,r,o,i){var s,d,l={};for(d in t)d=="ref"?s=t[d]:l[d]=t[d];var p={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Do,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(d in s)l[d]===void 0&&(l[d]=s[d]);return R.vnode&&R.vnode(p),p}const Po=({visible:e})=>a("div",{className:"sprig-check-background",style:{opacity:e?1:0},children:a(fr,{className:"sprig-check"})}),on="250ms",Lo=Ct(({animate:e,children:t,header:n,isOpen:r,onClick:o,showHeaderCheck:i},s)=>{const d=re(null),[l,p]=Z(0),[h,c]=Z("none"),[u,m]=Z(!0);return Q(()=>{var f;const g=(f=d.current)==null?void 0:f.getBoundingClientRect();p(r&&g?g.height:0)},[r]),Q(()=>{!l&&r||!u||m(!1),c(e&&!u?`height ${on} ease`:"none")},[e,u,l,r]),a("div",{className:"sprig-accordion",ref:s,children:[a("button",{className:"sprig-accordion-header-container",onClick:o,type:"button",children:[a("div",{className:"sprig-header-label-container",children:[a("span",{className:"sprig-header-label",children:n}),a(Po,{visible:i})]}),a(vr,{className:"sprig-caret",style:{transitionDuration:e?on:"0",transform:r?"rotate(-180deg)":"none"}})]}),a("div",{className:"sprig-accordion-body",style:{transition:h,height:l},children:a("div",{ref:d,children:t})})]})}),O=(...e)=>e.filter(Boolean).join(" "),Y=(e,t,n)=>{const r=t?"--mobile":"--desktop";return`${e+r} ${e+(n?`${r}_${n}`:"")} ${e}`},Mo=(e,t)=>`${e} ${e}__${t}`,te=e=>a("button",{...e,className:O("ul-card-text__button",e.className),id:"ul-card-text__button"}),_r=()=>{const{viewDocument:e}=q(r=>({viewDocument:r.viewDocument})),[t,n]=Z(!1);return Q(()=>{const r=e.querySelector(".sprig-question-body"),o=new ResizeObserver(()=>{window.requestAnimationFrame(()=>{n(!!(r&&G.isHTMLElement(r)&&r.scrollHeight>r.offsetHeight))})});return r&&o.observe(r),()=>{r&&o.unobserve(r)}},[e]),t},sn=({plainText:e,richText:t,id:n,className:r,isHeader:o})=>t?a("div",{className:r,dangerouslySetInnerHTML:{__html:t},id:n}):e?a(o?"h1":"p",{className:r,id:n,children:e}):null,No=()=>{const{cards:e,close:t,endCard:n,headers:r,index:o}=q(d=>({cards:d.cards,close:d.close,endCard:d.endCard,headers:d.headers,index:d.index,useMobileStyling:d.useMobileStyling})),i=e.length,s=Oe(()=>()=>t(G.APP_ID),[t]);return["email","link"].includes(r["userleap-platform"])||n&&o+1===i?null:a("div",{"aria-label":"Close button",className:"close-btn",onClick:s,onKeyPress:d=>{d.key==="Enter"&&s()},role:"button",tabIndex:0,children:a("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:a("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"})})})},le=({message:e,properties:t})=>{const n=re(null),r=t==null?void 0:t.captionText,o=_r();return a("div",{className:O("question-header-container","sprig-header-container",o?"sprig-border-bottom":null),ref:n,children:[a("div",{className:"question-header-button-container",children:[a(sn,{className:"ul-question",id:"ul-question",isHeader:!0,plainText:e,richText:t==null?void 0:t.questionHtml}),a(No,{})]}),a(sn,{className:"ul-caption",id:"ul-caption",plainText:r,richText:t==null?void 0:t.captionHtml})]})},an=({buttonText:e="View Prototype",handleClick:t})=>a("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),ve=({defaultBody:e,embeddedType:t="prototype",properties:n})=>{var c;const{handleClickEmbedButton:r,hasViewedEmbed:o,headers:i,useDesktopPrototype:s}=q(u=>({handleClickEmbedButton:u.handleClickEmbedButton,hasViewedEmbed:u.hasViewedEmbed,headers:u.headers,useDesktopPrototype:u.useDesktopPrototype})),d=(n==null?void 0:n.conceptUrl)||((c=n==null?void 0:n.consentDocument)==null?void 0:c.url),l=window.innerWidth<G.EMBED_MOBILE_MAX_WIDTH,p=i["userleap-platform"],h=(u,m)=>{u.preventDefault(),r(m)};if(!s&&l&&!o&&d&&["email","link"].includes(p)){if(t==="prototype")return a(an,{handleClick:u=>{h(u,"question.prototype.click")}});if(t==="pdf")return a(an,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:u=>{h(u,"question.agreement.click")}})}return e()},br=({isSelected:e,id:t,divId:n,themeColor:r})=>a("div",{"aria-checked":e,"aria-labelledby":`label-${t}`,className:"select-checkbox",id:n,role:"checkbox",style:e?{backgroundColor:r,borderColor:r,boxShadow:"none"}:{},tabIndex:0,children:e&&a(fr,{})}),yr=(e,t)=>{const n=re(0);return()=>{if(e.current){const r=e.current;r.style.height="1px";const o=r.scrollHeight+(r.offsetHeight-r.clientHeight),i=parseInt(window.getComputedStyle(r).getPropertyValue("max-height")),s=o<=i?o:i;n.current!==s&&t(),n.current=s,r.style.height=`${s}px`}}},Qe=({ariaLabel:e,border:t,choiceStyle:n={},label:r,isSelected:o,value:i,text:s,id:d,isRadio:l,useMobileStyling:p,error:h,allowTextEntry:c,noneOfTheAbove:u,promptText:m,onUserInputChanged:g})=>{const{styleNonce:f,viewDocument:v}=q(S=>({styleNonce:S.styleNonce,viewDocument:S.viewDocument})),[k,_]=Z(!1);Uo(v,t,f);const T=({isSelected:S,userText:M})=>{g&&g({id:d,selected:S,value:i,userText:M,noneOfTheAbove:u})},j=S=>{S.stopPropagation(),T({isSelected:l||!o,userText:s}),_(!1)},E=()=>{k||_(!0)},w=()=>{k&&_(!1)},I={onClick:S=>j(S),onKeyPress:S=>(M=>{M.key!=="Enter"&&M.key!==" "||j(M)})(S)};"ontouchstart"in v.documentElement?(I.onTouchStart=w,I.onTouchCancel=w,I.onTouchEnd=w):(I.onMouseDown=E,I.onMouseLeave=w);const D=l?`radio-${d}`:`checkbox-${d}`,x=o||k?[qe]:[],b=[...h?[xr]:[],...x],y=r?{"aria-labelledby":`label-${d}`}:{"aria-label":e};return a("div",{className:O(Y("choice",p),...b),id:`choice-div-${d}`,style:{...n,...h?{borderColor:G.ERROR_BORDER_COLOR}:{}},...I,children:[a("div",{className:O("choice-label-container"),children:[l?a("div",{...y,className:O("select-radio",...x),id:D,role:"radio",tabIndex:0}):a(br,{divId:D,id:d,isSelected:o,themeColor:t}),r&&a("label",{className:O(Y("select-label",p)),htmlFor:D,id:`label-${d}`,children:r})]}),c&&o&&a("div",{className:O("choice-text-entry-container",...x),children:a(Oo,{onTextChange:S=>T({isSelected:o,userText:S}),promptText:m||"Please specify",textValue:s,useMobileStyling:p})})]})},Oo=({promptText:e,textValue:t,onTextChange:n,useMobileStyling:r})=>{const o=re(null),{update:i}=q(d=>({update:d.update})),s=yr(o,()=>i());return Q(()=>(s(),o.current&&o.current.focus(),()=>{i()}),[]),a("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:O(Y("choice-text-input",r)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:d=>{s(),d.stopPropagation(),n(d.currentTarget.value)},onClick:d=>{d.stopPropagation()},onKeyPress:d=>{d.stopPropagation()},placeholder:e,ref:o,role:"textbox",rows:1,value:t})},ln="ul-select-style-element",qe="ul-select-active-dynamic-style",xr="ul-select-error-dynamic-style",Uo=(e,t,n)=>{let r=e.getElementById(ln),o=!1;r||(r=e.createElement("style"),o=!0),r.tagName.toLowerCase()==="style"&&(r.id=ln,n&&(r.nonce=n),r.textContent=Ho(t),o&&e.head.appendChild(r))},Ho=e=>`
.${qe} {
border-color: ${e};
}
.${qe} .select-radio, .${qe}.select-radio {
border: 6px solid ${e};
box-shadow: none;
}
.${xr} {
border-color: ${G.ERROR_BORDER_COLOR};
}
`,fe=({children:e})=>a("div",{className:"sprig-question-body",children:e}),be=({children:e})=>{const t=_r();return a("div",{className:O("sprig-question-footer-container",t?"sprig-border-top":null),children:e})},Ee=e=>(e==null?void 0:e.buttonText)||"Next",It=e=>(e==null?void 0:e.skipButtonText)||"Skip",Ao=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{useMobileStyling:s,border:d}=q(x=>({useMobileStyling:x.useMobileStyling,border:x.border})),[l,p]=Z(!1),[h,c]=Z(""),[u,m]=Z(!1),g=r==null?void 0:r.collectName,f=(r==null?void 0:r.nameLabelText)||"Full Name",v=(r==null?void 0:r.consentText)||"I agree to the stated conditions",k=(r==null?void 0:r.submitButtonText)||"Submit",_=!!h.trim(),T=l&&(!g||_),j=(x,b=!1)=>{x.preventDefault(),x.stopPropagation();let y=null;if(!b){if(!T)return void m(!0);y={submitted:!0},g&&(y.name=h)}n({value:y,questionId:o,type:i})},E=x=>{x.preventDefault(),x.stopPropagation(),c(x.currentTarget.value)},w=x=>{x.currentTarget.style.borderColor=u&&!_?G.ERROR_BORDER_COLOR:d},I=x=>{x.currentTarget.style.borderColor=u&&!_?G.ERROR_BORDER_COLOR:G.DEFAULT_BORDER_COLOR},D=()=>a(be,{children:[a("div",{className:"sprig-stretch",children:[a(Qe,{allowTextEntry:!1,border:d,error:u&&!l,id:"consent",isRadio:!1,isSelected:l,label:v,onUserInputChanged:({selected:x})=>{x!==l&&p(!l)},useMobileStyling:s}),g&&a("input",{"aria-label":f,"aria-placeholder":f,className:O(Y("ul-consent-legal__name-input",s)),"data-gramm":"false",maxLength:250,name:"name",onBlur:I,onFocus:w,onInput:E,placeholder:f,style:u&&!_?{borderColor:G.ERROR_BORDER_COLOR}:{},tabIndex:0,value:h})]}),a("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[a(te,{className:T?"":"sprig-button-disabled",onClick:j,children:k}),r.required===!1&&a("button",{className:"ul-card-skip__button",onClick:x=>j(x,!0),children:It(r)})]})]});return a("div",{className:O(e,"ul-card__consent-legal","fade-in-transition"),children:[a(le,{message:t,properties:{questionHtml:r.questionHtml}}),a(J,{children:[r!=null&&r.richTextBody?a(fe,{children:a("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:r!=null&&r.richTextBody?{__html:r.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"})}):null,a(ve,{properties:r,defaultBody:D,embeddedType:"pdf"})]})]},o)},Bo=({activeValue:e,border:t,icon:n,isPressed:r,onSubmit:o,range:i,scaleLabelType:s,setActiveValue:d,setIsPressed:l,useMobileStyling:p,value:h,viewDocument:c})=>{const u=`option-${h}`,m=s==="number",g=s==="star",f=m&&h===e,[v,k]=h<=e&&g||h===e?r?[t,1]:[t,.3]:["",1];return a("button",{"aria-label":m?void 0:String(h),className:(()=>{switch(s){case"star":return O(Y("likert-star",p),Y(`likert-star-${h}`,p));case"smiley":return O(Y("likert-smiley",p),Y(`likert-smiley-${h}`,p));default:return h===i?O(Y("likert-number",p),Y(`likert-number-${h}`,p),Y("likert-last-option",p)):O(Y("likert-number",p),Y(`likert-number-${h}`,p))}})(),dangerouslySetInnerHTML:{__html:n},id:u,onClick:()=>o(),onKeyDown:_=>{var E,w;const T=c.querySelectorAll(`.likert-${s??"number"}`),j=h-1;_.key==="ArrowRight"?(E=T[j+1])==null||E.focus():_.key==="ArrowLeft"?(w=T[j-1])==null||w.focus():_.key!=="Enter"&&_.key!==" "||o()},onPointerDown:()=>l(!0),onPointerEnter:()=>d(h),onPointerLeave:()=>{d(-1),l(!1)},style:{color:m?"":v,borderColor:f?v:"",fillOpacity:f?"":k,zIndex:f?3:"auto"},tabIndex:0})},qo=({className:e,labels:t,message:n,next:r,properties:o,questionId:i,type:s})=>{const{border:d,useMo