@sprig-technologies/sprig-bundled 2.37.0 → 2.38.1

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.
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./index-BvoTbkev.cjs");var Fe,M,wr,ke,Ot,Sr,ut,Cr,qe={},Tr=[],Un=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ke=Array.isArray;function he(e,t){for(var r in t)e[r]=t[r];return e}function Ir(e){var t=e.parentNode;t&&t.removeChild(e)}function ie(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Fe.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Oe(e,a,n,i,null)}function Oe(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++wr,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function Lr(){return{current:null}}function X(e){return e.children}function ce(e,t){this.props=e,this.context=t}function Ie(e,t){if(t==null)return e.__?Ie(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Ie(e):null}function Nr(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Nr(e)}}function dt(e){(!e.__d&&(e.__d=!0)&&ke.push(e)&&!We.__r++||Ot!==M.debounceRendering)&&((Ot=M.debounceRendering)||Sr)(We)}function We(){var e,t,r,n,i,o,a,l,c;for(ke.sort(ut);e=ke.shift();)e.__d&&(t=ke.length,n=void 0,o=(i=(r=e).__v).__e,l=[],c=[],(a=r.__P)&&((n=he({},i)).__v=i.__v+1,M.vnode&&M.vnode(n),vt(a,n,i,r.__n,a.ownerSVGElement!==void 0,32&i.__u?[o]:null,l,o??Ie(i),!!(32&i.__u),c),n.__.__k[n.__i]=n,Pr(l,n,c),n.__e!=o&&Nr(n)),ke.length>t&&ke.sort(ut));We.__r=0}function Er(e,t,r,n,i,o,a,l,c,d,p){var u,f,h,m,b,v=n&&n.__k||Tr,x=t.length;for(r.__d=c,function(y,I,L){var k,T,_,E,N,D=I.length,g=L.length,S=g,C=0;for(y.__k=[],k=0;k<D;k++)(T=y.__k[k]=(T=I[k])==null||typeof T=="boolean"||typeof T=="function"?null:typeof T=="string"||typeof T=="number"||typeof T=="bigint"||T.constructor==String?Oe(null,T,null,null,T):Ke(T)?Oe(X,{children:T},null,null,null):T.constructor===void 0&&T.__b>0?Oe(T.type,T.props,T.key,T.ref?T.ref:null,T.__v):T)!=null?(T.__=y,T.__b=y.__b+1,N=An(T,L,E=k+C,S),T.__i=N,_=null,N!==-1&&(S--,(_=L[N])&&(_.__u|=131072)),_==null||_.__v===null?(N==-1&&C--,typeof T.type!="function"&&(T.__u|=65536)):N!==E&&(N===E+1?C++:N>E?S>D-E?C+=N-E:C--:C=N<E&&N==E-1?N-E:0,N!==k+C&&(T.__u|=65536))):(_=L[k])&&_.key==null&&_.__e&&(_.__e==y.__d&&(y.__d=Ie(_)),pt(_,_,!1),L[k]=null,S--);if(S)for(k=0;k<g;k++)(_=L[k])!=null&&!(131072&_.__u)&&(_.__e==y.__d&&(y.__d=Ie(_)),pt(_,_))}(r,t,v),c=r.__d,u=0;u<x;u++)(h=r.__k[u])!=null&&typeof h!="boolean"&&typeof h!="function"&&(f=h.__i===-1?qe:v[h.__i]||qe,h.__i=u,vt(e,h,f,i,o,a,l,c,d,p),m=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&yt(f.ref,null,h),p.push(h.ref,h.__c||m,h)),b==null&&m!=null&&(b=m),65536&h.__u||f.__k===h.__k?c=Rr(h,c,e):typeof h.type=="function"&&h.__d!==void 0?c=h.__d:m&&(c=m.nextSibling),h.__d=void 0,h.__u&=-196609);r.__d=c,r.__e=b}function Rr(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Rr(n[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function ge(e,t){return t=t||[],e==null||typeof e=="boolean"||(Ke(e)?e.some(function(r){ge(r,t)}):t.push(e)),t}function An(e,t,r,n){var i=e.key,o=e.type,a=r-1,l=r+1,c=t[r];if(c===null||c&&i==c.key&&o===c.type)return r;if(n>(c==null||131072&c.__u?0:1))for(;a>=0||l<t.length;){if(a>=0){if((c=t[a])&&!(131072&c.__u)&&i==c.key&&o===c.type)return a;a--}if(l<t.length){if((c=t[l])&&!(131072&c.__u)&&i==c.key&&o===c.type)return l;l++}}return-1}function Dt(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Un.test(t)?r:r+"px"}function Ve(e,t,r,n,i){var o;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Dt(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Dt(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")o=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+o]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,o?Ft:qt,o)):e.removeEventListener(t,o?Ft:qt,o);else{if(i)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]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function qt(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(M.event?M.event(e):e)}function Ft(e){return this.l[e.type+!0](M.event?M.event(e):e)}function vt(e,t,r,n,i,o,a,l,c,d){var p,u,f,h,m,b,v,x,y,I,L,k,T,_,E,N=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),o=[l=t.__e=r.__e]),(p=M.__b)&&p(t);e:if(typeof N=="function")try{if(x=t.props,y=(p=N.contextType)&&n[p.__c],I=p?y?y.props.value:p.__:n,r.__c?v=(u=t.__c=r.__c).__=u.__E:("prototype"in N&&N.prototype.render?t.__c=u=new N(x,I):(t.__c=u=new ce(x,I),u.constructor=N,u.render=Bn),y&&y.sub(u),u.props=x,u.state||(u.state={}),u.context=I,u.__n=n,f=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),N.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=he({},u.__s)),he(u.__s,N.getDerivedStateFromProps(x,u.__s))),h=u.props,m=u.state,u.__v=t,f)N.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(N.getDerivedStateFromProps==null&&x!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(x,I),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(x,u.__s,I)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=x,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(D){D&&(D.__=t)}),L=0;L<u._sb.length;L++)u.__h.push(u._sb[L]);u._sb=[],u.__h.length&&a.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(x,u.__s,I),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,m,b)})}if(u.context=I,u.props=x,u.__P=e,u.__e=!1,k=M.__r,T=0,"prototype"in N&&N.prototype.render){for(u.state=u.__s,u.__d=!1,k&&k(t),p=u.render(u.props,u.state,u.context),_=0;_<u._sb.length;_++)u.__h.push(u._sb[_]);u._sb=[]}else do u.__d=!1,k&&k(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++T<25);u.state=u.__s,u.getChildContext!=null&&(n=he(he({},n),u.getChildContext())),f||u.getSnapshotBeforeUpdate==null||(b=u.getSnapshotBeforeUpdate(h,m)),Er(e,Ke(E=p!=null&&p.type===X&&p.key==null?p.props.children:p)?E:[E],t,r,n,i,o,a,l,c,d),u.base=t.__e,t.__u&=-161,u.__h.length&&a.push(u),v&&(u.__E=u.__=null)}catch(D){t.__v=null,c||o!=null?(t.__e=l,t.__u|=c?160:32,o[o.indexOf(l)]=null):(t.__e=r.__e,t.__k=r.__k),M.__e(D,t,r)}else o==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=jn(r.__e,t,r,n,i,o,a,c,d);(p=M.diffed)&&p(t)}function Pr(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)yt(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function jn(e,t,r,n,i,o,a,l,c){var d,p,u,f,h,m,b,v=r.props,x=t.props,y=t.type;if(y==="svg"&&(i=!0),o!=null){for(d=0;d<o.length;d++)if((h=o[d])&&"setAttribute"in h==!!y&&(y?h.localName===y:h.nodeType===3)){e=h,o[d]=null;break}}if(e==null){if(y===null)return document.createTextNode(x);e=i?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,x.is&&x),o=null,l=!1}if(y===null)v===x||l&&e.data===x||(e.data=x);else{if(o=o&&Fe.call(e.childNodes),v=r.props||qe,!l&&o!=null)for(v={},d=0;d<e.attributes.length;d++)v[(h=e.attributes[d]).name]=h.value;for(d in v)h=v[d],d=="children"||(d=="dangerouslySetInnerHTML"?u=h:d==="key"||d in x||Ve(e,d,null,h,i));for(d in x)h=x[d],d=="children"?f=h:d=="dangerouslySetInnerHTML"?p=h:d=="value"?m=h:d=="checked"?b=h:d==="key"||l&&typeof h!="function"||v[d]===h||Ve(e,d,h,v[d],i);if(p)l||u&&(p.__html===u.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(u&&(e.innerHTML=""),Er(e,Ke(f)?f:[f],t,r,n,i&&y!=="foreignObject",o,a,o?o[0]:r.__k&&Ie(r,0),l,c),o!=null)for(d=o.length;d--;)o[d]!=null&&Ir(o[d]);l||(d="value",m!==void 0&&(m!==e[d]||y==="progress"&&!m||y==="option"&&m!==v[d])&&Ve(e,d,m,v[d],!1),d="checked",b!==void 0&&b!==e[d]&&Ve(e,d,b,v[d],!1))}return e}function yt(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){M.__e(n,r)}}function pt(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||yt(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&pt(n[i],t,r||typeof e.type!="function");r||e.__e==null||Ir(e.__e),e.__=e.__e=e.__d=void 0}function Bn(e,t,r){return this.constructor(e,r)}function Le(e,t,r){var n,i,o,a;M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],vt(t,e=(!n&&r||t).__k=ie(X,null,[e]),i||qe,qe,t.ownerSVGElement!==void 0,!n&&r?[r]:i?null:t.firstChild?Fe.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Pr(o,e,a)}function Mr(e,t){Le(e,t,Mr)}function Vn(e,t,r){var n,i,o,a,l=he({},e.props);for(o in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)o=="key"?n=t[o]:o=="ref"?i=t[o]:l[o]=t[o]===void 0&&a!==void 0?a[o]:t[o];return arguments.length>2&&(l.children=arguments.length>3?Fe.call(arguments,2):r),Oe(e.type,l,n||e.key,i||e.ref,null)}function xt(e,t){var r={__c:t="__cC"+Cr++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(l){l.__e=!0,dt(l)})},this.sub=function(a){i.push(a);var l=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),l&&l.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Fe=Tr.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(l){e=l}throw e}},wr=0,ce.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=he({},this.state),typeof e=="function"&&(e=e(he({},r),this.props)),e&&he(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),dt(this))},ce.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),dt(this))},ce.prototype.render=X,ke=[],Sr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ut=function(e,t){return e.__v.__b-t.__v.__b},We.__r=0,Cr=0;var $n=0;function s(e,t,r,n,i,o){var a,l,c={};for(l in t)l=="ref"?a=t[l]:c[l]=t[l];var d={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--$n,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)c[l]===void 0&&(c[l]=a[l]);return M.vnode&&M.vnode(d),d}var _e,z,nt,Ht,Ne=0,Or=[],$e=[],Ut=M.__b,At=M.__r,jt=M.diffed,Bt=M.__c,Vt=M.unmount;function Se(e,t){M.__h&&M.__h(z,e,Ne||t),Ne=0;var r=z.__H||(z.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:$e}),r.__[e]}function V(e){return Ne=1,kt(Fr,e)}function kt(e,t,r){var n=Se(_e++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Fr(void 0,t),function(l){var c=n.__N?n.__N[0]:n.__[0],d=n.t(c,l);c!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=z,!z.u)){var i=function(l,c,d){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(f){return f.__c});if(p.every(function(f){return!f.__N}))return!o||o.call(this,l,c,d);var u=!1;return p.forEach(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(u=!0)}}),!(!u&&n.__c.props===l)&&(!o||o.call(this,l,c,d))};z.u=!0;var o=z.shouldComponentUpdate,a=z.componentWillUpdate;z.componentWillUpdate=function(l,c,d){if(this.__e){var p=o;o=void 0,i(l,c,d),o=p}a&&a.call(this,l,c,d)},z.shouldComponentUpdate=i}return n.__N||n.__}function W(e,t){var r=Se(_e++,3);!M.__s&&Ct(r.__H,t)&&(r.__=e,r.i=t,z.__H.__h.push(r))}function He(e,t){var r=Se(_e++,4);!M.__s&&Ct(r.__H,t)&&(r.__=e,r.i=t,z.__h.push(r))}function J(e){return Ne=5,ue(function(){return{current:e}},[])}function Dr(e,t,r){Ne=6,He(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function ue(e,t){var r=Se(_e++,7);return Ct(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function we(e,t){return Ne=8,ue(function(){return e},t)}function wt(e){var t=z.context[e.__c],r=Se(_e++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(z)),t.props.value):e.__}function St(e,t){M.useDebugValue&&M.useDebugValue(t?t(e):e)}function qr(){var e=Se(_e++,11);if(!e.__){for(var t=z.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function zn(){for(var e;e=Or.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ze),e.__H.__h.forEach(mt),e.__H.__h=[]}catch(t){e.__H.__h=[],M.__e(t,e.__v)}}M.__b=function(e){z=null,Ut&&Ut(e)},M.__r=function(e){At&&At(e),_e=0;var t=(z=e.__c).__H;t&&(nt===z?(t.__h=[],z.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=$e,r.__N=r.i=void 0})):(t.__h.forEach(ze),t.__h.forEach(mt),t.__h=[],_e=0)),nt=z},M.diffed=function(e){jt&&jt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Or.push(t)!==1&&Ht===M.requestAnimationFrame||((Ht=M.requestAnimationFrame)||Qn)(zn)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==$e&&(r.__=r.__V),r.i=void 0,r.__V=$e})),nt=z=null},M.__c=function(e,t){t.some(function(r){try{r.__h.forEach(ze),r.__h=r.__h.filter(function(n){return!n.__||mt(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],M.__e(n,r.__v)}}),Bt&&Bt(e,t)},M.unmount=function(e){Vt&&Vt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ze(n)}catch(i){t=i}}),r.__H=void 0,t&&M.__e(t,r.__v))};var $t=typeof requestAnimationFrame=="function";function Qn(e){var t,r=function(){clearTimeout(n),$t&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);$t&&(t=requestAnimationFrame(r))}function ze(e){var t=z,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),z=t}function mt(e){var t=z;e.__c=e.__(),z=t}function Ct(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Fr(e,t){return typeof t=="function"?t(e):t}function Hr(e,t){for(var r in t)e[r]=t[r];return e}function ft(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Ze(e){this.props=e}function Ur(e,t){function r(i){var o=this.props.ref,a=o==i.ref;return!a&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!a:ft(this.props,i)}function n(i){return this.shouldComponentUpdate=r,ie(e,i)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(Ze.prototype=new ce).isPureReactComponent=!0,Ze.prototype.shouldComponentUpdate=function(e,t){return ft(this.props,e)||ft(this.state,t)};var zt=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),zt&&zt(e)};var Wn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Tt(e){function t(r){var n=Hr({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=Wn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Qt=function(e,t){return e==null?null:ge(ge(e).map(t))},Ar={map:Qt,forEach:Qt,count:function(e){return e?ge(e).length:0},only:function(e){var t=ge(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ge},Zn=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}Zn(e,t,r,n)};var Wt=M.unmount;function jr(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=Hr({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return jr(n,t,r)})),e}function Br(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Br(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function De(){this.__u=0,this.t=null,this.__b=null}function Vr(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function $r(e){var t,r,n;function i(o){if(t||(t=e()).then(function(a){r=a.default||a},function(a){n=a}),n)throw n;if(!r)throw t;return ie(r,o)}return i.displayName="Lazy",i.__f=!0,i}function Te(){this.u=null,this.o=null}M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Wt&&Wt(e)},(De.prototype=new ce).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var i=Vr(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(l):l())};r.__R=a;var l=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=Br(c,c.__c.__P,c.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.t.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},De.prototype.componentWillUnmount=function(){this.t=[]},De.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=jr(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&ie(X,null,e.fallback);return i&&(i.__u&=-33),[ie(X,null,t.__a?null:e.children),i]};var Zt=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function Gn(e){return this.getChildContext=function(){return e.context},e.children}function Kn(e){var t=this,r=e.i;t.componentWillUnmount=function(){Le(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n)},insertBefore:function(n,i){this.childNodes.push(n),t.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n)}}),Le(ie(Gn,{context:t.context},e.__v),t.l)}function zr(e,t){var r=ie(Kn,{__v:e,i:t});return r.containerInfo=t,r}(Te.prototype=new ce).__a=function(e){var t=this,r=Vr(t.__v),n=t.o.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Zt(t,e,n)):i()};r?r(o):o()}},Te.prototype.render=function(e){this.u=null,this.o=new Map;var t=ge(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},Te.prototype.componentDidUpdate=Te.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Zt(e,r,t)})};var Qr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Yn=/^(?: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]/,Jn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xn=/[A-Z0-9]/g,ei=typeof document<"u",ti=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Wr(e,t,r){return t.__k==null&&(t.textContent=""),Le(e,t),typeof r=="function"&&r(),e?e.__c:null}function Zr(e,t,r){return Mr(e,t),typeof r=="function"&&r(),e?e.__c:null}ce.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ce.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=M.event;function ri(){}function ni(){return this.cancelBubble}function ii(){return this.defaultPrevented}M.event=function(e){return Gt&&(e=Gt(e)),e.persist=ri,e.isPropagationStopped=ni,e.isDefaultPrevented=ii,e.nativeEvent=e};var It,oi={enumerable:!1,configurable:!0,get:function(){return this.class}},Kt=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={};for(var o in r){var a=r[o];if(!(o==="value"&&"defaultValue"in r&&a==null||ei&&o==="children"&&n==="noscript"||o==="class"||o==="className")){var l=o.toLowerCase();o==="defaultValue"&&"value"in r&&r.value==null?o="value":o==="download"&&a===!0?a="":l==="ondoubleclick"?o="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||ti(r.type)?l==="onfocus"?o="onfocusin":l==="onblur"?o="onfocusout":Jn.test(o)?o=l:n.indexOf("-")===-1&&Yn.test(o)?o=o.replace(Xn,"-$&").toLowerCase():a===null&&(a=void 0):l=o="oninput",l==="oninput"&&i[o=l]&&(o="oninputCapture"),i[o]=a}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ge(r.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=ge(r.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",oi)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Qr,Kt&&Kt(e)};var Yt=M.__r;M.__r=function(e){Yt&&Yt(e),It=e.__c};var Jt=M.diffed;M.diffed=function(e){Jt&&Jt(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),It=null};var Gr={ReactCurrentDispatcher:{current:{readContext:function(e){return It.__n[e.__c].props.value}}}};function Kr(e){return ie.bind(null,e)}function Ue(e){return!!e&&e.$$typeof===Qr}function Yr(e){return Ue(e)&&e.type===X}function Jr(e){return Ue(e)?Vn.apply(null,arguments):e}function Lt(e){return!!e.__k&&(Le(null,e),!0)}function Xr(e){return e&&(e.base||e.nodeType===1&&e)||null}var en=function(e,t){return e(t)},tn=function(e,t){return e(t)},rn=X;function Nt(e){e()}function nn(e){return e}function on(){return[!1,Nt]}var sn=He,an=Ue;function ln(e,t){var r=t(),n=V({h:{__:r,v:t}}),i=n[0].h,o=n[1];return He(function(){i.__=r,i.v=t,it(i)&&o({h:i})},[e,r,t]),W(function(){return it(i)&&o({h:i}),e(function(){it(i)&&o({h:i})})},[e]),r}function it(e){var t,r,n=e.v,i=e.__;try{var o=n();return!((t=i)===(r=o)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}var si={useState:V,useId:qr,useReducer:kt,useEffect:W,useLayoutEffect:He,useInsertionEffect:sn,useTransition:on,useDeferredValue:nn,useSyncExternalStore:ln,startTransition:Nt,useRef:J,useImperativeHandle:Dr,useMemo:ue,useCallback:we,useContext:wt,useDebugValue:St,version:"17.0.2",Children:Ar,render:Wr,hydrate:Zr,unmountComponentAtNode:Lt,createPortal:zr,createElement:ie,createContext:xt,createFactory:Kr,cloneElement:Jr,createRef:Lr,Fragment:X,isValidElement:Ue,isElement:an,isFragment:Yr,findDOMNode:Xr,Component:ce,PureComponent:Ze,memo:Ur,forwardRef:Tt,flushSync:tn,unstable_batchedUpdates:en,StrictMode:rn,Suspense:De,SuspenseList:Te,lazy:$r,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Gr};const ai=Object.freeze(Object.defineProperty({__proto__:null,Children:Ar,Component:ce,Fragment:X,PureComponent:Ze,StrictMode:rn,Suspense:De,SuspenseList:Te,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Gr,cloneElement:Jr,createContext:xt,createElement:ie,createFactory:Kr,createPortal:zr,createRef:Lr,default:si,findDOMNode:Xr,flushSync:tn,forwardRef:Tt,hydrate:Zr,isElement:an,isFragment:Yr,isValidElement:Ue,lazy:$r,memo:Ur,render:Wr,startTransition:Nt,unmountComponentAtNode:Lt,unstable_batchedUpdates:en,useCallback:we,useContext:wt,useDebugValue:St,useDeferredValue:nn,useEffect:W,useErrorBoundary:function(e){var t=Se(_e++,10),r=V();return t.__=e,z.componentDidCatch||(z.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]},useId:qr,useImperativeHandle:Dr,useInsertionEffect:sn,useLayoutEffect:He,useMemo:ue,useReducer:kt,useRef:J,useState:V,useSyncExternalStore:ln,useTransition:on,version:"17.0.2"},Symbol.toStringTag,{value:"Module"})),Xt=e=>{let t;const r=new Set,n=(a,l)=>{const c=typeof a=="function"?a(t):a;if(!Object.is(c,t)){const d=t;t=l??typeof c!="object"?c:Object.assign({},t,c),r.forEach(p=>p(t,d))}},i=()=>t,o={setState:n,getState:i,subscribe:a=>(r.add(a),()=>r.delete(a)),destroy:()=>r.clear()};return t=e(n,i,o),o};function li(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ci(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var er={exports:{}},ot={};const cn=ci(ai);var tr,rr,nr,ir,or={exports:{}},st={};function ui(){return rr||(rr=1,or.exports=function(){if(tr)return st;tr=1;var e=cn,t=typeof Object.is=="function"?Object.is:function(c,d){return c===d&&(c!==0||1/c==1/d)||c!=c&&d!=d},r=e.useState,n=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function a(c){var d=c.getSnapshot;c=c.value;try{var p=d();return!t(c,p)}catch{return!0}}var l=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(c,d){return d()}:function(c,d){var p=d(),u=r({inst:{value:p,getSnapshot:d}}),f=u[0].inst,h=u[1];return i(function(){f.value=p,f.getSnapshot=d,a(f)&&h({inst:f})},[c,p,d]),n(function(){return a(f)&&h({inst:f}),c(function(){a(f)&&h({inst:f})})},[c]),o(p),p};return st.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,st}()),or.exports}var di=(ir||(ir=1,er.exports=function(){if(nr)return ot;nr=1;var e=cn,t=ui(),r=typeof Object.is=="function"?Object.is:function(c,d){return c===d&&(c!==0||1/c==1/d)||c!=c&&d!=d},n=t.useSyncExternalStore,i=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;return ot.useSyncExternalStoreWithSelector=function(c,d,p,u,f){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=a(function(){function v(k){if(!I){if(I=!0,x=k,k=u(k),f!==void 0&&m.hasValue){var T=m.value;if(f(T,k))return y=T}return y=k}if(T=y,r(x,k))return T;var _=u(k);return f!==void 0&&f(T,_)?T:(x=k,y=_)}var x,y,I=!1,L=p===void 0?null:p;return[function(){return v(d())},L===null?void 0:function(){return v(L())}]},[d,p,u,f]);var b=n(c,h[0],h[1]);return o(function(){m.hasValue=!0,m.value=b},[b]),l(b),b},ot}()),er.exports);const pi=li(di),{useSyncExternalStoreWithSelector:mi}=pi,sr=e=>{const t=typeof e=="function"?(n=>n?Xt(n):Xt)(e):e,r=(n,i)=>function(o,a=o.getState,l){const c=mi(o.subscribe,o.getState,o.getServerState||o.getState,a,l);return St(c),c}(t,n,i);return Object.assign(r,t),r},un=e=>e?sr(e):sr;var le=(e=>(e.RIGHT="right",e.LEFT="left",e))(le||{});const fi=1,hi=2,Et={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(r=>e.indexOf(r)===-1),list_alo(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],n=new Set(r);return t.some(i=>n.has(i))},list_dni(e,t){if(!Array.isArray(t))return!1;const r=Array.isArray(e)?e:[e],n=new Set(r);return t.every(i=>!n.has(i))},contains(e,t){const r=e.toLowerCase(),n=t.toLowerCase();return r.includes(n)},notcontains(e,t){return!this.contains(e,t)}},gi=(e,t,r)=>{switch(t){case"videovoice":return!!(e&&e.value);case"open":return!!r;case"multipleselect":return!!(r&&Object.keys(r).length);case"recordedtask":return(r==null?void 0:r.taskStatus)==="completed";case"texturlprompt":return!e.value;case"consentlegal":case"nps":case"likert":return r!==null;case"multiplechoice":return r!==void 0;case"matrix":return!!(r&&Object.values(r).every(n=>n!==null));default:return!0}},dn=(e,t)=>{if(t==="matrix"){const r=Object.keys(e).length,n=Object.values(e).filter(i=>i!==null).length;return n>0&&n<r}return!1},pn=({cards:e,index:t,hasEndCard:r,allResponses:n,uploadProgress:i={}})=>{if(t>=e.length||t<0)return null;const o=e[t];let a=t+1;const l=o.props.routingOptions||[];for(let p=0;p<l.length;p++){const{group:u,target:f}=l[p];if(!(u!=null&&u.length))continue;const h=u[0];if(h.questionIndex===void 0||h.questionIndex>n.length)continue;let m=ar({comparator:h.comparator,response:n[h.questionIndex],type:o.type,value:h.value});for(let b=1;b<u.length;b+=2){const v=u[b],x=u[b+1],y=ar({comparator:x.comparator,response:n[x.questionIndex],type:e[x.questionIndex].type,value:x.value});v===fi?m&&(m=y):v===hi&&(m||(m=y))}if(m){a=f===-1&&r?e.length-1:f;break}}const c=e.findIndex(p=>p.type==="uploading");let d;return d=c>0?r?e.length-3:e.length-2:e.length-1,t>=d||a===-1||a!==null&&a>d?c>0&&Object.values(i).some(u=>u.isSubmitted&&!u.isComplete)?c:r?e.length-1:null:a===-1?null:a},ar=({comparator:e,response:t,type:r,value:n})=>{if(e==="answered")switch(r){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"rankorder":case"matrix":return Object.values(t).every(i=>i!==null);case"maxdiff":return!(t===null||!Array.isArray(t))&&t.every(i=>{if(!Array.isArray(i))return!1;const o=i.some(l=>l.selected==="left"),a=i.some(l=>l.selected==="right");return o&&a});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 r!=="recordedtask"||"taskStatus"in t&&t.taskStatus==="given.up";if(e==="partial")return r==="matrix"&&dn(t,r);if(e==="skipped")switch(r){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||(t==null?void 0:t.length)===0;case"multiplechoice":return t==null;case"matrix":return t===null||Object.values(t).every(i=>i===null);case"maxdiff":return t===null||!Array.isArray(t)||t.some(i=>{if(!Array.isArray(i))return!0;const o=i.some(l=>l.selected==="left"),a=i.some(l=>l.selected==="right");return!(o&&a)});case"rankorder":return t===null||Object.values(t).some(i=>i===null);default:return!1}return Et[e](t,n)},_i=e=>{var n,i,o;switch(e.type){case"multipleselect":return e&&e.props&&e.props.options?e.props.options.length>13?e.props.options.map(a=>[a.value]):(t=e.props.options.map(a=>a.value),r=!e.props.properties.required,t.reduce((a,l)=>a.concat(a.map(c=>[...c,l])),[[]]).filter(a=>r||a.length>0)):null;case"multiplechoice":{if(!e||!e.props||!e.props.options)return null;const a=e.props.options.map(l=>l.value);return e.props.properties.required||a.push(void 0),a}case"matrix":{if(!((n=e==null?void 0:e.props)!=null&&n.options))return null;const a=e.props.properties.matrixColumn,l=e.props.options,c=l.reduce((p,u)=>(p[u.id]=null,p),{}),d=[{...c,[l[0].id]:a[0].value},l.reduce((p,u)=>(p[u.id]=a[0].value,p),{})];return e.props.properties.required||d.push(c),d}case"likert":{const a=Number((o=(i=e.props)==null?void 0:i.properties)==null?void 0:o.range)||5;return[...Array.from(Array(a).keys()).map(c=>c+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 a=[{taskStatus:"completed"},{taskStatus:"given.up"}];return e.props.properties.required||a.push({taskStatus:"abandoned"}),a}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,r},bi=e=>e in Et,vi=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,yi=(e,t=[])=>t.reduce((r,n)=>{const{group:i,target:o}=n;if(!(i!=null&&i.length))return[...r];const a=i.filter(l=>!!Number(l)||typeof l=="object"&&l.questionIndex===e).map(l=>{const{comparator:c,value:d}=l;return{comparator:c,target:o,value:d}});return[...r,...a]},[]),at=new Set(["thanks","uploading"]),A=un()((e,t)=>({allResponses:[],answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(r=P.APP_ID)=>{const n=t(),{fadeout:i,remove:o,trackHistory:a,studyType:l}=n;await i(r),lt(n)||a({event:"closed"}),P.breadcrumbsLogger.info("SurveyClosing",{surveyId:n.surveyId}),P.ConflictingWidgets.enable(),o({initiator:P.DismissReason.Closed,studyType:l})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async r=>{const{eventEmitFn:n,fadeout:i,remove:o,studyType:a,surveyId:l}=t();n("survey.complete",l),await i(r),P.ConflictingWidgets.enable(),o({initiator:P.DismissReason.Complete,studyType:a})},endCard:{headline:""},envId:"",eventEmitFn:P.eventEmitter.emit.bind(P.eventEmitter),fadeout:async r=>{const{eventEmitFn:n,headers:i,viewDocument:o}=t();return P.shouldDirectEmbed(i)?Promise.resolve():(n(P.SprigEvent.SurveyFadingOut),new Promise(a=>{const l=o.getElementById(r);l?(l.addEventListener("transitionend",()=>{a()}),l.classList.remove("ul-app--visible")):a()}))},forceBrandedLogo:!1,frame:document.createElement("iframe"),handleClickEmbedButton:r=>{const{cards:n,eventEmitFn:i,index:o}=t();i(r,{qid:n[o].name,props:n[o].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:r,isComplete:n,progressPct:i,isSubmitted:o})=>{var h,m,b;const{cards:a,destroy:l,index:c,uploadProgress:d}=t(),p=n||((h=d[r])==null?void 0:h.isComplete),u={...d,[r]:{progressPct:p?100:i||((m=d[r])==null?void 0:m.progressPct),isComplete:p,isSubmitted:o||((b=d[r])==null?void 0:b.isSubmitted)}};if(e({uploadProgress:u}),a[c].type!=="uploading")return;const f=Object.entries(d).every(([v,x])=>!x.isSubmitted||x.isComplete||r==v&&n);if(f&&c>=a.length-1)return l(P.APP_ID);e({index:f?c+1:c,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:r=>{const{allResponses:n,cards:i,eventEmitFn:o,index:a,responseGroupUid:l,submit:c,trackHistory:d,uploadProgress:p,viewedCardCount:u}=t();e({minScrollableHeight:void 0});const f=Array.isArray(r.data)?r.data:[r.data],h=Date.now(),m=[...i],b={response:[],responseGroupUid:l,questionIndex:a};let v=null;const x=n.slice(0);f.forEach((L,k)=>{const T=m[a+k],{type:_,...E}=L,N={...E,answeredAt:h};N.questionId=Math.floor(N.questionId);const D=N.value;(S=>S&&!at.has(S.type))(T)&&(T.value=D,T.secondaryValue=N.secondaryValue||null),b.response.push(N);let g=D;_!=="multipleselect"&&_!=="multiplechoice"||D===null||(g=_==="multiplechoice"?Object.values(D).find(S=>S!==!1):D,_==="multipleselect"&&(g=m[a+k].props.options.reduce((S,C)=>(D[C.id]&&S.push(C.value),S),[]))),x[a+k]=g,v=pn({cards:m,index:a+k,hasEndCard:!!r.endCard,uploadProgress:p,allResponses:x})}),e({allResponses:x}),(v===null||at.has(m[v].type))&&(b.completedAt=h);const y=c(b);if(v===null)return void r.completeSurvey();v&&!at.has(m[v].type)&&y.finally(()=>{d({event:"seen",index:v})});const I=m[v];m[v]&&o&&o("survey.question",{qid:I.name,props:I.props}),e({cards:m,hasViewedEmbed:!1,index:v,viewedCardCount:u+1})},pendingRemoveIframeReason:null,previewKey:null,previewMode:void 0,recorder:()=>{},recorderEventEmitter:P.eventEmitter,resolveTrackedPromise:()=>{const{removeIframeIfReady:r}=t();e(n=>({unresolvedRequestCount:n.unresolvedRequestCount-1})),r()},responseGroupUid:"",remove:({initiator:r,studyType:n})=>{const{eventEmitFn:i,removeIframeIfReady:o,surveyId:a}=t();e({pendingRemoveIframeReason:r,studyType:n}),i(P.SprigEvent.SurveyCloseRequested,{name:P.SprigEvent.SurveyCloseRequested,initiator:r,studyType:n,"survey.id":a}),o()},removeIframeIfReady:()=>{const{eventEmitFn:r,pendingRemoveIframeReason:n,unresolvedRequestCount:i,studyType:o,surveyId:a}=t();n&&i===0&&(r(P.SprigEvent.SurveyWillClose,{name:P.SprigEvent.SurveyWillClose,initiator:n,studyType:o,"survey.id":a}),e({pendingRemoveIframeReason:null,studyType:o}))},seen:async()=>{const{trackHistory:r}=t();return r({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:r,questionIndex:n,response:i,responseGroupUid:o})=>{const a=t();if(!o||lt(a))return;const l={responseGroupUid:o,meta:a.meta,customMetadata:a.customMetadata,responses:i,completedAt:r,previewKey:a.previewKey},c=await a.trackPromise(P.sprigFetch(`${a.apiURL}/sdk/1/environments/${a.envId}/visitors/${a.userId}/responses/submit`,{body:JSON.stringify(l),headers:a.headers,method:"POST"}));c.ok?i.forEach((d,p)=>{a.eventEmitFn(P.SprigEvent.QuestionAnswered,{...d,questionIndex:n?n+p:void 0,"survey.id":a.surveyId})}):c.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",c.error),await a.trackPromise(lr(a,"submitResponse",c.error)))},surveyId:0,tabTitle:"",trackHistory:async({event:r,index:n,isNew:i=!1})=>{const o=t();if(lt(o))return;const{cards:a,index:l}=o;let c=n??l,d=a[c];for(;d;){const p={sid:o.surveyId,qid:Math.floor(d.name),action:r,vid:o.userId,eid:o.envId,isNew:i,responseGroupUid:o.responseGroupUid,previewKey:o.previewKey},u=await o.trackPromise(P.sprigFetch(`${o.apiURL}/sdk/1/visitors/${o.userId}/surveys/${o.surveyId}/history`,{method:"POST",headers:o.headers,body:JSON.stringify(p)}));!u.ok&&u.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",u.error),await o.trackPromise(lr(o,"trackHistory",u.error)));const f=a[c+1];if(!d.groupId||!(f!=null&&f.groupId)||f.groupId!==d.groupId)break;c++,d=f,i=!1}},trackPromise:async r=>{const{resolveTrackedPromise:n}=t();return e(i=>({unresolvedRequestCount:i.unresolvedRequestCount+1})),r.then(i=>(n(),i)).catch(i=>{throw n(),i})},unresolvedRequestCount:0,update:()=>{const{cards:r,index:n,headers:i,eventEmitFn:o,frame:a,useMobileStyling:l,surveyId:c,viewDocument:d}=t(),p=i["userleap-platform"]==="web",u=P.shouldDirectEmbed(i),f=r[n],h=f.type==="matrix"&&!(f.props.properties.displayMatrixAsAccordion||l);e({minScrollableHeight:void 0}),setTimeout(()=>{var x,y,I;!u&&!l&&((x=a==null?void 0:a.setWidth)==null||x.call(a,P.DEFAULT_WIDTH_PX));const[m,b,v]=P.calculateFrameDimensions(d,p&&!l,u);u?(o(P.SprigEvent.SurveyHeight,{name:P.SprigEvent.SurveyHeight,contentFrameHeight:m,"survey.id":c}),o(P.SprigEvent.SurveyWidth,{name:P.SprigEvent.SurveyWidth,contentFrameWidth:b,"survey.id":c})):((y=a.setHeight)==null||y.call(a,m),e({minScrollableHeight:v}),!l&&h&&((I=a.setWidth)==null||I.call(a,b)))},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0,focusedQuestionId:null,setFocusedQuestionId:r=>e({focusedQuestionId:r})})),lt=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview||e.previewMode,lr=async(e,t,r)=>{const{mode:n,userId:i,envId:o,apiURL:a,headers:l,viewDocument:c}=e,d=c.documentElement,p={mode:n,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:d.clientWidth,clientHeight:d.clientHeight,location:window.location.href,language:window.navigator.language},u={action:t,err:{message:`${r==null?void 0:r.name} - ${r==null?void 0:r.message}`,stack:r==null?void 0:r.stack},meta:p,vid:i,envId:o};(await P.sprigFetch(`${a}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},l),body:JSON.stringify(u)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",r)},mn=e=>ie("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},ie("path",{d:"M17 10L12 15L7 10",stroke:"#0B2330",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),fn=e=>ie("svg",{fill:"none",height:10,viewBox:"0 0 10 10",width:10,xmlns:"http://www.w3.org/2000/svg",...e},ie("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:2})),xi=({visible:e})=>s("div",{className:"sprig-check-background",style:{opacity:e?1:0},children:s(fn,{className:"sprig-check"})}),cr="250ms",ki=Tt(({animate:e,children:t,header:r,isOpen:n,onClick:i,showHeaderCheck:o},a)=>{const l=J(null),[c,d]=V(0),[p,u]=V("none"),[f,h]=V(!0);return W(()=>{var b;const m=(b=l.current)==null?void 0:b.getBoundingClientRect();d(n&&m?m.height:0)},[n]),W(()=>{!c&&n||!f||h(!1),u(e&&!f?`height ${cr} ease`:"none")},[e,f,c,n]),s("div",{className:"sprig-accordion",ref:a,children:[s("button",{className:"sprig-accordion-header-container",onClick:i,type:"button",children:[s("div",{className:"sprig-header-label-container",children:[s("span",{className:"sprig-header-label",children:r}),s(xi,{visible:o})]}),s(mn,{className:"sprig-caret",style:{transitionDuration:e?cr:"0",transform:n?"rotate(-180deg)":"none"}})]}),s("div",{className:"sprig-accordion-body",style:{transition:p,height:c},children:s("div",{ref:l,children:t})})]})}),Rt=({style:e,stroke:t="black"})=>s("svg",{fill:"none",height:"10",style:e,viewBox:"0 0 12 10",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[s("path",{d:"M1.47839 5.2085L10.9384 5.2085",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"}),s("path",{d:"M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"})]}),F=(...e)=>e.filter(Boolean).join(" "),te=(e,t,r)=>{const n=t?"--mobile":"--desktop";return`${e+n} ${e+(r?`${n}_${r}`:"")} ${e}`},wi=(e,t)=>`${e} ${e}__${t}`,re=e=>s("button",{...e,className:F("ul-card-text__button",e.className),id:"ul-card-text__button"}),hn=()=>{const{viewDocument:e}=A(n=>({viewDocument:n.viewDocument})),[t,r]=V(!1);return W(()=>{const n=e.querySelector(".sprig-question-body"),i=new ResizeObserver(()=>{window.requestAnimationFrame(()=>{r(!!(n&&P.isHTMLElement(n)&&n.scrollHeight>n.offsetHeight))})});return n&&i.observe(n),()=>{n&&i.disconnect()}},[e]),t},ur=({plainText:e,richText:t,id:r,className:n,isHeader:i})=>t?s("div",{className:n,dangerouslySetInnerHTML:{__html:t},id:r}):e?s(i?"h1":"p",{className:n,id:r,children:e}):null,Si=()=>{const{cards:e,close:t,endCard:r,headers:n,index:i}=A(l=>({cards:l.cards,close:l.close,endCard:l.endCard,headers:l.headers,index:l.index,useMobileStyling:l.useMobileStyling})),o=e.length,a=ue(()=>()=>t(P.APP_ID),[t]);return["email","link"].includes(n["userleap-platform"])||r&&i+1===o?null:s("div",{"aria-label":"Close button",className:"close-btn",onClick:a,onKeyPress:l=>{l.key==="Enter"&&a()},role:"button",tabIndex:0,children:s("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:s("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"})})})},se=({message:e,properties:t})=>{const r=J(null),n=t==null?void 0:t.captionText,i=hn();return s("div",{className:F("question-header-container","sprig-header-container",i?"sprig-border-bottom":null),ref:r,children:[s("div",{className:"question-header-button-container",children:[s(ur,{className:"ul-question",id:"ul-question",isHeader:!0,plainText:e,richText:t==null?void 0:t.questionHtml}),s(Si,{})]}),s(ur,{className:"ul-caption",id:"ul-caption",plainText:n,richText:t==null?void 0:t.captionHtml})]})},Ci=()=>s("svg",{fill:"none",height:"10",viewBox:"0 0 13 10",width:"13",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M11.5 1.5L4.5 8.5L1 5",stroke:"#FFFFFF",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),Ye=({isSubmitDisabled:e,handleSubmit:t})=>s("div",{className:"ul-card-longform__submit-button-container",children:s(re,{className:"ul-card-longform__submit-button",disabled:e,onClick:t,children:["OK ",s(Ci,{})]})}),dr=({buttonText:e="View Prototype",handleClick:t})=>s("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),be=({defaultBody:e,embeddedType:t="prototype",properties:r})=>{var u;const{handleClickEmbedButton:n,hasViewedEmbed:i,headers:o,useDesktopPrototype:a}=A(f=>({handleClickEmbedButton:f.handleClickEmbedButton,hasViewedEmbed:f.hasViewedEmbed,headers:f.headers,useDesktopPrototype:f.useDesktopPrototype})),l=(r==null?void 0:r.conceptUrl)||((u=r==null?void 0:r.consentDocument)==null?void 0:u.url),c=window.innerWidth<P.EMBED_MOBILE_MAX_WIDTH,d=o["userleap-platform"],p=(f,h)=>{f.preventDefault(),n(h)};if(!a&&c&&!i&&l&&["email","link"].includes(d)){if(t==="prototype")return s(dr,{handleClick:f=>{p(f,"question.prototype.click")}});if(t==="pdf")return s(dr,{buttonText:(r==null?void 0:r.viewDocumentText)||"View Document",handleClick:f=>{p(f,"question.agreement.click")}})}return e()},gn=({isSelected:e,id:t,divId:r,themeColor:n,disabled:i=!1})=>s("div",{"aria-checked":e,"aria-disabled":i,"aria-labelledby":`label-${t}`,className:"select-checkbox",id:r,role:"checkbox",style:{...e?{backgroundColor:n,borderColor:n,boxShadow:"none"}:{},...i?{opacity:.5}:{}},tabIndex:i?-1:0,children:e&&s(fn,{})}),_n=(e,t)=>{const r=J(0);return()=>{if(e.current){const n=e.current;n.style.height="1px";const i=n.scrollHeight+(n.offsetHeight-n.clientHeight),o=parseInt(window.getComputedStyle(n).getPropertyValue("max-height")),a=i<=o?i:o;r.current!==a&&t(),r.current=a,n.style.height=`${a}px`}}},Ee=({ariaLabel:e,border:t,choiceStyle:r={},label:n,isSelected:i,value:o,text:a,id:l,isRadio:c,useMobileStyling:d,error:p,allowTextEntry:u,noneOfTheAbove:f,promptText:h,disabled:m=!1,onUserInputChanged:b})=>{const{styleNonce:v,viewDocument:x}=A(C=>({styleNonce:C.styleNonce,viewDocument:C.viewDocument})),[y,I]=V(!1);Ii(x,t,v);const L=({isSelected:C,userText:O})=>{b&&b({id:l,selected:C,value:o,userText:O,noneOfTheAbove:f})},k=C=>{m||(C.stopPropagation(),L({isSelected:c||!i,userText:a}),I(!1))},T=()=>{y||I(!0)},_=()=>{y&&I(!1)},E={onClick:C=>k(C),onKeyPress:C=>(O=>{m||O.key!=="Enter"&&O.key!==" "||k(O)})(C)};"ontouchstart"in x.documentElement?(E.onTouchStart=_,E.onTouchCancel=_,E.onTouchEnd=_):(E.onMouseDown=T,E.onMouseLeave=_);const N=c?`radio-${l}`:`checkbox-${l}`,D=i||y?[Qe]:[],g=[...p?[bn]:[],...D,...m?["ul-choice-disabled"]:[]],S=n?{"aria-labelledby":`label-${l}`}:{"aria-label":e};return s("div",{className:F(te("choice",d),...g),id:`choice-div-${l}`,style:{...r,...p?{borderColor:P.ERROR_BORDER_COLOR}:{},...m?{opacity:.5,cursor:"not-allowed"}:{}},...m?{}:E,"aria-disabled":m,children:[s("div",{className:F("choice-label-container"),children:[c?s("div",{...S,className:F("select-radio",...D),id:N,role:"radio",tabIndex:0}):s(gn,{disabled:m,divId:N,id:l,isSelected:i,themeColor:t}),n&&s("label",{className:F(te("select-label",d)),htmlFor:N,id:`label-${l}`,children:n})]}),u&&i&&s("div",{className:F("choice-text-entry-container",...D),children:s(Ti,{onTextChange:C=>L({isSelected:i,userText:C}),promptText:h||"Please specify",textValue:a,useMobileStyling:d})})]})},Ti=({promptText:e,textValue:t,onTextChange:r,useMobileStyling:n})=>{const i=J(null),{update:o}=A(l=>({update:l.update})),a=_n(i,()=>o());return W(()=>(a(),i.current&&i.current.focus(),()=>{o()}),[]),s("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:F(te("choice-text-input",n)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:l=>{a(),l.stopPropagation(),r(l.currentTarget.value)},onClick:l=>{l.stopPropagation()},onKeyPress:l=>{l.stopPropagation()},placeholder:e,ref:i,role:"textbox",rows:1,value:t})},pr="ul-select-style-element",Qe="ul-select-active-dynamic-style",bn="ul-select-error-dynamic-style",Ii=(e,t,r)=>{let n=e.getElementById(pr),i=!1;n||(n=e.createElement("style"),i=!0),n.tagName.toLowerCase()==="style"&&(n.id=pr,r&&(n.nonce=r),n.textContent=Li(t),i&&e.head.appendChild(n))},Li=e=>`
2
+ .${Qe} {
3
+ border-color: ${e};
4
+ }
5
+ .${Qe} .select-radio, .${Qe}.select-radio {
6
+ border: 6px solid ${e};
7
+ box-shadow: none;
8
+ }
9
+ .${bn} {
10
+ border-color: ${P.ERROR_BORDER_COLOR};
11
+ }
12
+ `,me=({children:e})=>s("div",{className:"sprig-question-body",children:e}),ve=({children:e})=>{const t=hn();return s("div",{className:F("sprig-question-footer-container",t?"sprig-border-top":null),children:e})},vn=({logoOnly:e=!1,style:t={}})=>s("svg",{alt:(e?"Powered by ":"")+"Sprig",fill:"none",height:"15",style:{display:"block",...t},viewBox:e?"79 0 31 15":"0 0 112 15",width:e?"35":"112",xmlns:"http://www.w3.org/2000/svg",children:[!e&&s("path",{d:"M0.648926 12.0181V2.8584H4.21631C6.0127 2.8584 7.25684 4.06445 7.25684 5.86084V5.87354C7.25684 7.66357 6.0127 8.88867 4.21631 8.88867H2.0708V12.0181H0.648926ZM3.86084 4.05811H2.0708V7.69531H3.86084C5.09229 7.69531 5.80957 7.02881 5.80957 5.87988V5.86719C5.80957 4.72461 5.09229 4.05811 3.86084 4.05811ZM11.6621 12.1514C9.63721 12.1514 8.39941 10.7993 8.39941 8.57764V8.56494C8.39941 6.34961 9.64355 4.99121 11.6621 4.99121C13.6743 4.99121 14.9185 6.34326 14.9185 8.56494V8.57764C14.9185 10.7993 13.6807 12.1514 11.6621 12.1514ZM11.6621 11.0024C12.8428 11.0024 13.5156 10.1011 13.5156 8.57764V8.56494C13.5156 7.03516 12.8428 6.14014 11.6621 6.14014C10.4751 6.14014 9.80859 7.03516 9.80859 8.56494V8.57764C9.80859 10.1074 10.4751 11.0024 11.6621 11.0024ZM17.6226 12.0181L15.7183 5.12451H17.1021L18.3398 10.4438H18.4414L19.8633 5.12451H21.1709L22.5928 10.4438H22.7007L23.9321 5.12451H25.2969L23.3989 12.0181H21.9834L20.5552 6.87646H20.4473L19.0254 12.0181H17.6226ZM29.334 12.1514C27.3154 12.1514 26.0967 10.7739 26.0967 8.59033V8.58398C26.0967 6.43213 27.3408 4.99121 29.2642 4.99121C31.1875 4.99121 32.3682 6.38135 32.3682 8.45068V8.93311H27.4805C27.5059 10.2534 28.2295 11.0215 29.3657 11.0215C30.248 11.0215 30.7749 10.5835 30.9399 10.228L30.9653 10.1772L32.292 10.1709L32.2793 10.228C32.0508 11.1357 31.0986 12.1514 29.334 12.1514ZM29.2705 6.12109C28.3311 6.12109 27.6201 6.76221 27.4995 7.94922H31.0034C30.8955 6.71777 30.2036 6.12109 29.2705 6.12109ZM34.0059 12.0181V5.12451H35.3833V6.16553H35.4849C35.7324 5.43555 36.3735 5.00391 37.2939 5.00391C37.5161 5.00391 37.7573 5.03564 37.897 5.06738V6.33691C37.6494 6.28613 37.4146 6.25439 37.1543 6.25439C36.1006 6.25439 35.3833 6.90186 35.3833 7.89844V12.0181H34.0059ZM41.9277 12.1514C39.9092 12.1514 38.6904 10.7739 38.6904 8.59033V8.58398C38.6904 6.43213 39.9346 4.99121 41.8579 4.99121C43.7812 4.99121 44.9619 6.38135 44.9619 8.45068V8.93311H40.0742C40.0996 10.2534 40.8232 11.0215 41.9595 11.0215C42.8418 11.0215 43.3687 10.5835 43.5337 10.228L43.5591 10.1772L44.8857 10.1709L44.873 10.228C44.6445 11.1357 43.6924 12.1514 41.9277 12.1514ZM41.8643 6.12109C40.9248 6.12109 40.2139 6.76221 40.0933 7.94922H43.5972C43.4893 6.71777 42.7974 6.12109 41.8643 6.12109ZM49.1133 12.1323C47.3804 12.1323 46.2568 10.7422 46.2568 8.57764V8.56494C46.2568 6.38135 47.3613 5.00391 49.1133 5.00391C50.0591 5.00391 50.8652 5.47363 51.2334 6.21631H51.3413V2.42041H52.7124V12.0181H51.3413V10.9326H51.2334C50.8335 11.688 50.0781 12.1323 49.1133 12.1323ZM49.5068 10.958C50.6558 10.958 51.3604 10.0503 51.3604 8.57764V8.56494C51.3604 7.09229 50.6494 6.18457 49.5068 6.18457C48.3516 6.18457 47.6597 7.08594 47.6597 8.56494V8.57764C47.6597 10.0566 48.3516 10.958 49.5068 10.958ZM61.98 12.1323C61.0151 12.1323 60.2598 11.688 59.8599 10.9326H59.7583V12.0181H58.3809V2.42041H59.7583V6.21631H59.8599C60.228 5.47363 61.0342 5.00391 61.98 5.00391C63.7319 5.00391 64.8364 6.38135 64.8364 8.56494V8.57764C64.8364 10.7422 63.7192 12.1323 61.98 12.1323ZM61.5928 10.958C62.7417 10.958 63.4336 10.0566 63.4336 8.57764V8.56494C63.4336 7.08594 62.7417 6.18457 61.5928 6.18457C60.4438 6.18457 59.7329 7.09229 59.7329 8.56494V8.57764C59.7329 10.0503 60.4438 10.958 61.5928 10.958ZM66.8867 14.4429C66.7153 14.4429 66.5122 14.4302 66.3345 14.4111V13.3257C66.4678 13.3447 66.6392 13.3511 66.7979 13.3511C67.439 13.3511 67.8262 13.0781 68.0293 12.3799L68.1309 12.0244L65.6299 5.12451H67.1152L68.8418 10.6343H68.9624L70.6826 5.12451H72.1299L69.5654 12.2847C68.9814 13.9287 68.2832 14.4429 66.8867 14.4429Z",fill:"black",fillOpacity:"0.7"}),s("path",{d:"M81.1088 6.63629C79.6878 6.32154 78.9672 5.76865 78.9672 4.99369C78.9672 4.19299 79.736 3.5886 80.7556 3.5886C81.8066 3.5886 82.5995 4.25285 82.5995 5.13336V5.20352H84.0518V5.13336C84.0518 3.52424 82.6405 2.30774 80.7693 2.30774C79.8676 2.30774 79.0414 2.58451 78.4433 3.08655C78.1463 3.33144 77.9077 3.63818 77.7448 3.98479C77.5818 4.33141 77.4984 4.70934 77.5005 5.09153C77.4946 5.44197 77.5675 5.78934 77.714 6.10857C77.8605 6.42779 78.0769 6.71092 78.3475 6.93752C78.8512 7.37584 79.5659 7.70024 80.4709 7.90299C81.9949 8.23898 82.7676 8.81054 82.7676 9.60094C82.7676 10.4576 81.9258 11.1032 80.813 11.1032C79.6571 11.1032 78.7854 10.3856 78.7854 9.43424V9.36408H77.3318V9.43424C77.3318 11.1167 78.8219 12.3847 80.7973 12.3847C81.7421 12.3847 82.6093 12.0983 83.2393 11.5769C83.5519 11.3237 83.8034 11.0048 83.9753 10.6433C84.1472 10.2818 84.2352 9.88702 84.2329 9.48766C84.2329 8.05875 83.1833 7.09907 81.1088 6.63629Z",fill:"black",fillOpacity:"0.7"}),s("path",{d:"M89.2394 4.68276C88.6963 4.67605 88.1596 4.79915 87.6751 5.04156C87.1905 5.28397 86.7725 5.63851 86.4566 6.07497V4.85204H85.0747V14.8479H86.4566V11.0356C86.7725 11.472 87.1906 11.8265 87.6751 12.0688C88.1596 12.3111 88.6963 12.434 89.2394 12.4272C91.3836 12.4272 93 10.7627 93 8.55495C93 6.34723 91.3836 4.68276 89.2394 4.68276ZM91.5608 8.84202C91.5057 9.41605 91.2512 9.95356 90.8406 10.3633C90.4299 10.773 89.8883 11.0296 89.3078 11.0896C88.5363 11.1669 87.8177 10.9461 87.2841 10.4692C86.7505 9.99222 86.4566 9.3106 86.4566 8.55495C86.4566 7.10159 87.5538 6.00546 89.0087 6.00546C89.7619 6.00546 90.4421 6.29124 90.9171 6.81002C91.407 7.34232 91.6357 8.06385 91.5608 8.84202Z",fill:"black",fillOpacity:"0.7"}),s("path",{d:"M109.95 4.85407V6.06349C109.298 5.18298 108.292 4.68286 107.153 4.68286C105.017 4.68286 103.406 6.31709 103.406 8.48426C103.406 10.6514 105.017 12.285 107.153 12.285C108.296 12.285 109.303 11.79 109.95 10.9185V11.1046C109.95 12.6101 108.993 13.5826 107.513 13.5826C106.513 13.5826 105.68 13.1494 105.284 12.424L105.264 12.3867H103.838L103.871 12.48C104.112 13.1892 104.583 13.8001 105.211 14.2179C105.841 14.6324 106.637 14.8512 107.513 14.8512C108.637 14.8512 109.594 14.4972 110.28 13.8285C110.967 13.1597 111.332 12.2194 111.332 11.1213V4.85407H109.95ZM109.175 10.3502C108.588 10.905 107.752 11.138 106.879 10.9887C106.361 10.8984 105.886 10.6475 105.523 10.2725C105.16 9.89751 104.927 9.41787 104.859 8.90328C104.736 8.03757 104.999 7.21756 105.581 6.655C106.069 6.19093 106.723 5.93643 107.401 5.94699C107.565 5.94713 107.729 5.96026 107.891 5.98625C108.946 6.15489 109.781 7.01609 109.921 8.0852C110.039 8.96507 109.766 9.78958 109.175 10.3502Z",fill:"black",fillOpacity:"0.7"}),s("path",{d:"M101.89 2.12378C101.63 2.06766 101.358 2.11486 101.133 2.25518C100.908 2.39551 100.747 2.61769 100.687 2.87371C100.626 3.12973 100.67 3.39902 100.809 3.62339C100.947 3.84775 101.17 4.00917 101.428 4.07275C101.503 4.08936 101.58 4.09778 101.657 4.09786C101.906 4.09824 102.146 4.0083 102.331 3.84518C102.517 3.68206 102.636 3.45714 102.664 3.21327C102.693 2.9694 102.63 2.72361 102.487 2.5227C102.344 2.32179 102.132 2.17981 101.89 2.12378Z",fill:"black",fillOpacity:"0.7"}),s("path",{d:"M100.967 10.934H99.7755C98.9285 10.934 98.4196 10.3644 98.4196 9.40982C98.4196 8.4791 98.8757 7.36945 99.8054 6.01778L99.8178 5.99976V5.61807L95.8571 5.06453C95.8585 4.90331 95.8162 4.74466 95.7346 4.60501C95.653 4.46536 95.5352 4.34979 95.3932 4.27027C95.0381 4.07718 94.6498 4.07717 94.3279 4.26383C94.1667 4.35799 94.035 4.4945 93.9476 4.65816C93.8602 4.82182 93.8205 5.00623 93.8328 5.19087C93.8452 5.37552 93.9092 5.55315 94.0176 5.70402C94.1261 5.85489 94.2748 5.97309 94.4472 6.04546L93.2151 12.258H94.5833L95.7196 6.35891L97.8593 6.7155C97.284 7.73439 96.9921 8.68442 96.9921 9.53919C96.9921 11.1168 97.9577 12.1498 99.5187 12.2496V12.258H102.346V4.87723H100.967V10.934Z",fill:"black",fillOpacity:"0.7"})]}),yn=({forceBrandedLogo:e,marketingUrlLink:t})=>s("div",{className:e?"yellow-footer-logo":"",style:{marginTop:"4px",marginBottom:"4px"},children:s("a",{href:t,rel:"noreferrer",target:"_blank",children:s("div",{style:{display:"flex"},children:[s(vn,{logoOnly:!1}),e&&s(Rt,{style:{display:"block",margin:"auto 0 auto 4px",transform:"rotateY(0deg) rotate(-45deg)"}})]})})}),xn=({marketingUrlLink:e})=>s("a",{dir:"ltr",href:e,rel:"noreferrer",target:"_blank",children:s("div",{className:"thank-you-card-link",children:[s("div",{className:"sprig-box-logo",children:s(vn,{logoOnly:!0,style:{margin:"auto"}})}),s("div",{children:s("p",{children:["Capture insights about your own product",s(Rt,{style:{display:"inline-flex",marginInlineStart:"4px",verticalAlign:"middle"}})]})})]})}),Ce=e=>(e==null?void 0:e.buttonText)||"Next",kn=e=>(e==null?void 0:e.skipButtonText)||"Skip",wn=({marketingUrl:e,slugName:t,surveyId:r,forceBrandedLogo:n})=>`${e}?utm_source=survey_branding&utm_medium=website&utm_campaign=${t}&utm_content=${r}${n?"&utm_term=poweredby_pill":""}`,Ni=({className:e,message:t,next:r,properties:n,questionId:i,type:o})=>{const{useMobileStyling:a,border:l,isLongFormSurvey:c,focusedQuestionId:d}=A(S=>({useMobileStyling:S.useMobileStyling,border:S.border,isLongFormSurvey:P.isLongFormSurvey(S.studyType),focusedQuestionId:S.focusedQuestionId})),[p,u]=V(!1),[f,h]=V(""),[m,b]=V(!1),v=c&&d===i,x=n==null?void 0:n.collectName,y=(n==null?void 0:n.nameLabelText)||"Full Name",I=(n==null?void 0:n.consentText)||"I agree to the stated conditions",L=(n==null?void 0:n.submitButtonText)||"Submit",k=!!f.trim(),T=p&&(!x||k),_=(S,C=!1)=>{S.preventDefault(),S.stopPropagation();let O=null;if(!C){if(!T)return void b(!0);O={submitted:!0},x&&(O.name=f)}r({value:O,questionId:i,type:o},T)},E=S=>{S.preventDefault(),S.stopPropagation(),h(S.currentTarget.value)},N=S=>{S.currentTarget.style.borderColor=m&&!k?P.ERROR_BORDER_COLOR:l},D=S=>{S.currentTarget.style.borderColor=m&&!k?P.ERROR_BORDER_COLOR:P.DEFAULT_BORDER_COLOR},g=()=>s(ve,{children:[s("div",{className:"sprig-stretch",children:[s(Ee,{allowTextEntry:!1,border:l,error:m&&!p,id:"consent",isRadio:!1,isSelected:p,label:I,onUserInputChanged:({selected:S})=>{S!==p&&u(!p)},useMobileStyling:a}),x&&s("input",{"aria-label":y,"aria-placeholder":y,className:F(te("ul-consent-legal__name-input",a)),"data-gramm":"false",maxLength:250,name:"name",onBlur:D,onFocus:N,onInput:E,placeholder:y,style:m&&!k?{borderColor:P.ERROR_BORDER_COLOR}:{},tabIndex:0,value:f})]}),s("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[s(re,{className:T?"":"sprig-button-disabled",onClick:_,children:L}),n.required===!1&&!c&&s("button",{className:"ul-card-skip__button",onClick:S=>_(S,!0),children:kn(n)})]})]});return s("div",{className:F(e,c&&!v&&"ul-card--unfocused","ul-card__consent-legal","fade-in-transition"),children:[s(se,{message:t,properties:{questionHtml:n.questionHtml}}),s(X,{children:[n!=null&&n.richTextBody?s(me,{children:s("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:n!=null&&n.richTextBody?{__html:n.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"})}):null,s(be,{properties:n,defaultBody:g,embeddedType:"pdf"})]})]},i)},Ei=({icon:e,scaleLabelType:t,value:r,selectedValue:n})=>{if(t==="smiley"&&r===n){let i=0;return e.replace(/black/g,()=>++i==1?"black":"white")}return e},Ri=({activeValue:e,border:t,icon:r,isPressed:n,onSubmit:i,range:o,scaleLabelType:a,selectedValue:l,setSelectedValue:c,setActiveValue:d,setIsPressed:p,useMobileStyling:u,value:f,viewDocument:h})=>{const{isLongFormSurvey:m}=A(_=>({isLongFormSurvey:P.isLongFormSurvey(_.studyType)})),b=`option-${f}`,v=a==="number",x=a==="star",y=a==="smiley",I=v&&f===e||f===l,[L,k]=(()=>{const _=x&&l!==null&&f<=l;return x&&f<=e||y&&f===e||_||f===e||f===l?[t,n||_||f===l?1:.3]:["",1]})(),T=ue(()=>{const _={borderColor:I?L:"",fillOpacity:I?"":k,zIndex:I?3:"auto",color:l===f?"#fff":""};return v?{..._,backgroundColor:l===f?L:""}:{..._,color:x||y||l===f?L:""}},[I,L,k,l,f,v,x,y]);return s("button",{"aria-label":v?void 0:String(f),className:(()=>{switch(a){case"star":return F(te("likert-star",u),te(`likert-star-${f}`,u));case"smiley":return F(te("likert-smiley",u),te(`likert-smiley-${f}`,u));default:return f===o?F(te("likert-number",u),te(`likert-number-${f}`,u),te("likert-last-option",u)):F(te("likert-number",u),te(`likert-number-${f}`,u))}})(),dangerouslySetInnerHTML:{__html:Ei({icon:r,scaleLabelType:a,value:f,selectedValue:l})},id:b,onClick:_=>{m&&(_.preventDefault(),_.stopPropagation(),c(f)),i()},onKeyDown:_=>{var D,g;const E=h.querySelectorAll(`.likert-${a??"number"}`),N=f-1;_.key==="ArrowRight"?(D=E[N+1])==null||D.focus():_.key==="ArrowLeft"?(g=E[N-1])==null||g.focus():_.key!=="Enter"&&_.key!==" "||(m&&(_.preventDefault(),_.stopPropagation(),c(f)),i())},onPointerDown:()=>p(!0),onPointerEnter:()=>d(f),onPointerLeave:()=>{d(-1),p(!1)},style:T,tabIndex:0})},Pi=({className:e,labels:t,message:r,next:n,properties:i,questionId:o,type:a})=>{const{border:l,useMobileStyling:c,viewDocument:d,isLongFormSurvey:p,focusedQuestionId:u}=A(C=>({border:C.border,useMobileStyling:C.useMobileStyling,viewDocument:C.viewDocument,isLongFormSurvey:P.isLongFormSurvey(C.studyType),focusedQuestionId:C.focusedQuestionId})),[f,h]=V(-1),[m,b]=V(!1),[v,x]=V(null),y=p&&u===o,I=t&&t.left,L=t&&t.right;let k;const{range:T,scaleLabelType:_,ratingIcons:E}=i;T&&(k=Number(T));const N=k||5,D=C=>{var O,q;switch(_){case"star":return(O=E[0])==null?void 0:O.svg;case"smiley":return(q=E[C])==null?void 0:q.svg;default:return String(C+1)}},g=[...Array(N)].map((C,O)=>{const q=O+1;return s(Ri,{activeValue:f,border:l,icon:D(O),isPressed:m,onSubmit:()=>n({value:q,questionId:o,type:a},!0),range:N,scaleLabelType:_,selectedValue:v,setActiveValue:h,setIsPressed:b,setSelectedValue:x,useMobileStyling:c,value:q,viewDocument:d},O)}),S=C=>{C.preventDefault(),C.stopPropagation(),n({value:null,questionId:o,type:a},!0)};return s("form",{className:F(e,"ul-card--likert","fade-in-transition",p&&!y&&"ul-card--unfocused"),children:[s(se,{message:r,properties:i}),s(be,{properties:i,defaultBody:()=>s(X,{children:[s(me,{children:[s("div",{"aria-label":`Rating (1 - ${N})`,className:"ul-card--likert__numbers",role:"radiogroup",children:g}),s("div",{className:"ul-card--likert__labels",children:[s("span",{children:I}),s("span",{children:L})]})]}),!i.required&&!p&&s(ve,{children:s("div",{className:"ul-vertical-centered-container",children:s(re,{onClick:S,children:Ce(i)})})})]})})]},o)},Sn=e=>e&&(e.scrollHeight>e.offsetHeight?e:Sn(e.parentElement)),Mi=e=>{if(!e||!(r=>r instanceof HTMLElement)(e))return 0;const t=getComputedStyle(e);return parseFloat(t.marginTop)+parseFloat(t.marginBottom)+(parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth))},Oi=({columns:e,onSelect:t,options:r,selectedOptions:n})=>{const i=J([]),{border:o,useMobileStyling:a}=A(f=>({border:f.border,useMobileStyling:f.useMobileStyling})),l=r.findIndex(f=>n[f.id]===null),[c,d]=V(l),p=we((f,h)=>{t(f,h);const m=c+1,b=r[m];if(b&&n[b.id]===null){d(m);const v=i.current[c];if(v!=null&&v.firstElementChild){const x=Sn(v),y=v.firstElementChild,I=Mi(v)+y.clientHeight;x==null||x.scrollTo(0,v.offsetTop+I)}}},[t,r,n,c]),u=we((f,h)=>{const m=c===f;return s(ki,{animate:!0,header:h.label,isOpen:m,onClick:()=>d(m&&!window.UserLeap.isMobileSDK?-1:f),ref:b=>{b&&(i.current[f]=b)},showHeaderCheck:n[h.id]!==null,children:s("div",{style:{paddingTop:"12px"},children:e.map(b=>s(Ee,{allowTextEntry:!1,ariaLabel:`${h.label}-${b.label}`,border:o,error:!1,id:`${h.id}-${b.value}`,isRadio:!0,isSelected:n[h.id]===b.value,label:b.label,onUserInputChanged:()=>p(h.id,b.value),useMobileStyling:a},b.label))})},h.id)},[o,e,c,p,n,a]);return s("div",{children:r.map((f,h)=>u(h,f))})},Di=({columns:e,onSelect:t,options:r,selectedOptions:n})=>{const{border:i,useMobileStyling:o,isLongFormSurvey:a}=A(m=>({border:m.border,useMobileStyling:m.useMobileStyling,isLongFormSurvey:P.isLongFormSurvey(m.studyType)})),l=r.length,c=e.length,d=J(null),[p,u]=V(!1),[f,h]=V(!1);return W(()=>{const m=d.current,b=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{m&&(u(Math.round(v[0].contentRect.width)<m.scrollWidth),h(Math.round(v[0].contentRect.width)<m.scrollWidth))})});return m&&b.observe(m),()=>{m&&b.unobserve(m)}},[]),s("div",{className:"ul-card--matrix_question_container",children:[s("div",{className:F("ul-card--matrix_container",p&&"ul-matrix-scroll-gradient"),onScroll:()=>{(()=>{const m=d.current;m&&u(m.clientWidth+Math.abs(m.scrollLeft)<m.scrollWidth)})()},ref:d,children:s("div",{className:F(a&&"ul-card--matrix_grid_longform","ul-card--matrix_grid"),style:`--numColumns: ${c}; --numRows: ${l+1};`,children:[s("div",{})," ",e.map(m=>s("div",{className:"ul-matrix-column-label",children:m.label},m.label)),r.map(m=>s(X,{children:[s("div",{"aria-label":m.label,className:"ul-matrix-row-label",children:m.label},m.label),s("div",{className:"ul-matrix-row-options",role:"radiogroup",children:e.map((b,v)=>s("div",{className:F("ul-matrix-option-wrapper",v===c-1&&"ul-matrix-last-option"),children:s(Ee,{allowTextEntry:!1,ariaLabel:`${m.label}-${b.label}`,border:i,choiceStyle:{background:"transparent",border:"none",marginBottom:"0",padding:"0"},error:!1,id:`${m.id}-${b.value}`,isRadio:!0,isSelected:n[m.id]===b.value,onUserInputChanged:()=>t(m.id,b.value),useMobileStyling:o})},b.value))})]}))]})}),(p||f)&&s("button",{className:f&&!p?"ul-matrix-scroll-arrow left":"ul-matrix-scroll-arrow",onClick:f&&!p?m=>{m.preventDefault();const b=d.current;if(b){const v=getComputedStyle(b).direction==="rtl";b.scrollTo({left:v?b.scrollWidth-b.clientWidth:0,behavior:"smooth"})}}:m=>{m.preventDefault();const b=d.current;if(b){const v=getComputedStyle(b).direction==="rtl";b.scrollTo({left:v?b.clientWidth-b.scrollWidth:b.scrollWidth,behavior:"smooth"})}},children:s(f&&!p?qi:Fi,{})})]})},qi=()=>s("svg",{fill:"currentColor",height:"32",transform:"matrix(-1,0,0,1,0,0)",version:"1.1",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"})}),Fi=()=>s("svg",{fill:"currentColor",height:"32",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"})}),Hi=({className:e,message:t,next:r,options:n,properties:i,questionId:o,type:a,showIndividualSubmit:l=!1,onSubmitButtonClick:c})=>{const{useMobileStyling:d,isLongFormSurvey:p,focusedQuestionId:u,setFocusedQuestionId:f}=A(_=>({useMobileStyling:_.useMobileStyling,isLongFormSurvey:P.isLongFormSurvey(_.studyType),focusedQuestionId:_.focusedQuestionId,setFocusedQuestionId:_.setFocusedQuestionId})),h=i.matrixColumn,m=i.required,b=p&&u===o,v=_=>{_.preventDefault(),_.stopPropagation(),r({value:y,questionId:o,type:a},!0),c&&c()},x=n.reduce((_,E)=>(_[E.id]=null,_),{}),[y,I]=V(x),L=_=>m&&Object.values(_).every(E=>E==null),k=(_,E)=>{p&&r({value:{...y,[_]:E},questionId:o,type:a},!L({...y,[_]:E})),I(N=>({...N,[_]:E}))},T=i.displayMatrixAsAccordion||d;return s("form",{className:F(e,!p&&"ul-card__matrix","fade-in-transition",p&&!b&&"ul-card--unfocused"),id:"text-form",onClick:()=>{b&&f(o)},onSubmit:v,children:[s(se,{message:t,properties:i}),s(be,{properties:i,defaultBody:()=>s(X,{children:[s(me,{children:[s(T?Oi:Di,{columns:h,onSelect:k,options:n,selectedOptions:y}),l&&s(Ye,{handleSubmit:v,isSubmitDisabled:L(y)})]}),!p&&s(ve,{children:s("div",{className:"ul-card__button-wrapper",children:s(re,{disabled:L(y),children:Ce(i)})})})]})})]},o)};var Cn=(e=>(e.CONTINUE="CONTINUE",e.EXTERNAL="EXTERNAL",e.NO_BUTTON="NO_BUTTON",e))(Cn||{}),Me=(e=>(e.Unlimited="Unlimited",e.Maximum="Maximum",e.Range="Range",e))(Me||{});const Ui=({options:e,selectItem:t,selectedOptions:r,showCheckbox:n,disabledOptions:i,dropdownFooter:o})=>{const{themeColor:a}=A(l=>({doc:l.viewDocument,themeColor:l.border}));return s("div",{className:"select-list",children:[e.map(l=>{return s("div",{"aria-disabled":i==null?void 0:i.includes(l),className:F("select-option",i!=null&&i.includes(l)?"ul-choice-disabled":""),onClick:d=>{i!=null&&i.includes(l)||(t(l),d.stopPropagation())},role:"option",style:{...i!=null&&i.includes(l)?{opacity:.5,cursor:"not-allowed"}:{}},children:[n&&s(gn,{divId:(c=l.id,`checkbox-div-${c}`),id:l.id,isSelected:r.includes(l),themeColor:a}),l.label]},l.id);var c}),o]})},Ai=({isMultiSelect:e=!1,multiselectText:t="choices selected",onChange:r,options:n,placeholderText:i,value:o,disabledOptions:a=[],dropdownFooter:l})=>{const[c,d]=V(!1),{viewDocument:p,update:u}=A(m=>({viewDocument:m.viewDocument,update:m.update})),f=()=>{d(!c),u()};W(()=>{var b;const m=v=>{const x=v.target;(x==null?void 0:x.closest(".select-option.ul-choice-disabled"))||(d(!1),u())};p.addEventListener("click",m);try{(b=window.parent)==null||b.addEventListener("click",m)}catch{window.addEventListener("click",m)}return()=>{var v;p.removeEventListener("click",m);try{(v=window.parent)==null||v.removeEventListener("click",m)}catch{window.removeEventListener("click",m)}}},[p,u]);const h=o.length===0?["select-button-placeholder"]:[];return s(X,{children:[s("button",{"aria-label":"choice dropdown button",className:F("select-button",...h),onClick:m=>{m.stopPropagation(),f()},type:"button",children:[s("span",{children:o.length===0?i:o.length===1?o[0].label:`${o.length} ${t}`}),s(mn,{})]}),c&&s(Ui,{disabledOptions:a,dropdownFooter:l,options:n,selectedOptions:o,selectItem:m=>{var x;const b=o.some(y=>y.id===m.id),v=o.some(y=>{var I;return(I=y.optionProperties)==null?void 0:I.noneOfTheAbove});(x=m.optionProperties)!=null&&x.noneOfTheAbove&&!b?r([m]):e?r(b?o.filter(y=>y.id!==m.id):v?[m]:[...o,m]):b||r([m]),e||f()},showCheckbox:e})]})},Tn=({className:e,message:t,onSubmit:r,options:n=[],properties:i,questionId:o,type:a,showIndividualSubmit:l=!1,onSubmitButtonClick:c})=>{const{border:d,useMobileStyling:p,isLongFormSurvey:u,focusedQuestionId:f,setFocusedQuestionId:h}=A(w=>({border:w.border,useMobileStyling:w.useMobileStyling,isLongFormSurvey:P.isLongFormSurvey(w.studyType),focusedQuestionId:w.focusedQuestionId,setFocusedQuestionId:w.setFocusedQuestionId})),m=u&&f===o,b=n.reduce((w,R)=>(w[R.id]={isSelected:!1},w),{}),[v,x]=V(b),y=a==="multiplechoice",I=i.required,L=n.find(w=>{var R;return(R=w.optionProperties)==null?void 0:R.noneOfTheAbove}),k=w=>Object.entries(w).some(([R,H])=>{var Z;const j=n.find(G=>`${G.id}`===R),B=H.userText===void 0||H.userText.trim()==="";return((Z=j==null?void 0:j.optionProperties)==null?void 0:Z.allowsTextEntry)&&B&&H.isSelected}),T=w=>Object.values(w).filter(R=>R.isSelected).length,_=i.minSelect&&i.minSelect>0&&i.maxSelectMode===Me.Range&&T(v)<i.minSelect&&(I||T(v)>0),E=w=>k(w)||I&&!T(w)||!(R=>{const{minSelect:H=0,maxSelect:j=1/0,maxSelectMode:B}=i,Z=T(R);switch(B){case Me.Maximum:return Z<=j;case Me.Range:return Z===0||Z>=H;default:return!0}})(w),N=Object.entries(v).some(([w,R])=>{var H,j;return R.isSelected&&((j=(H=n.find(B=>`${B.id}`===w))==null?void 0:H.optionProperties)==null?void 0:j.allowsTextEntry)}),D=l&&(!y||N),g=w=>{q(w.id,w.selected,w.userText,w.noneOfTheAbove),w.selected&&u&&!y&&!m&&h(o)},S=w=>{var R;return(i==null?void 0:i.maxSelectMode)!==Me.Unlimited&&T(v)===(i==null?void 0:i.maxSelect)&&!((R=v[w])!=null&&R.isSelected)},C=n.map(({id:w,label:R,value:H,optionProperties:j})=>{var ae,fe;const B=`${w}`,{allowsTextEntry:Z,noneOfTheAbove:G}={allowsTextEntry:!1,noneOfTheAbove:!1,...j};return s(Ee,{allowTextEntry:Z,border:d,disabled:S(B),error:(oe=v,k(oe)),id:B,isRadio:y,isSelected:!!((ae=v[B])!=null&&ae.isSelected),label:R,noneOfTheAbove:G,onUserInputChanged:g,promptText:"Please specify",text:(fe=v[w])==null?void 0:fe.userText,useMobileStyling:p,value:H},B);var oe}),O=w=>{w.preventDefault(),w.stopPropagation(),r(v,!0),c&&c()},q=(w,R,H,j)=>{const B=Object.assign({},v);if((y||j)&&R)for(const oe of Object.values(B))oe.isSelected=!1,delete oe.userText;else L&&!j&&v[L.id].isSelected&&(B[L.id].isSelected=!1);B[w]={isSelected:R,userText:H};const Z=y&&Object.entries(B).some(([oe,ae])=>{var fe,Ae;return ae.isSelected&&((Ae=(fe=n.find(et=>`${et.id}`===oe))==null?void 0:fe.optionProperties)==null?void 0:Ae.allowsTextEntry)}),G=!E(B);u&&(r(B,G),y&&!Z&&G&&c&&c()),x(B)};return s("form",{className:F(e,"ul-card--multiple","fade-in-transition",u&&!m&&"ul-card--unfocused"),id:"text-form",onClick:a==="multipleselect"?()=>{u&&f!==o&&a==="multipleselect"&&h(o)}:void 0,onSubmit:O,children:[s(se,{message:t,properties:i}),s(be,{properties:i,defaultBody:()=>s(X,{children:[s(me,{children:[i.isDropdown?s(Ai,{disabledOptions:n.filter(w=>S(w.id)),dropdownFooter:_?s("div",{className:"ul-card__min-select-counter",style:{marginLeft:"16px"},children:[T(v),"/",i.minSelect]}):void 0,isMultiSelect:!y,multiselectText:i.dropdownMultiselectedText??"choices selected",onChange:w=>{const R={...v};for(const H of n)w.includes(H)?R[H.id].isSelected=!0:R[H.id].isSelected=!1;u&&r(R,!E(R)),x(R)},options:n,placeholderText:i.dropdownPlaceholderText??(y?"Select choice":"Select choice(s)"),value:n.filter(w=>v[w.id].isSelected)}):s("div",{className:F(te("ul-card__choices",p)),role:y?"radiogroup":"group",children:[C,!!_&&s("div",{className:"ul-card__min-select-counter",children:[T(v),"/",i.minSelect]})]}),D&&s(Ye,{handleSubmit:O,isSubmitDisabled:E(v)})]}),!u&&s(ve,{children:s("div",{className:"ul-card__button-wrapper",children:s(re,{disabled:E(v),onClick:O,children:Ce(i)})})})]})})]},o)},ji=e=>{const{questionId:t,type:r,next:n,options:i}=e,{setFocusedQuestionId:o}=A(a=>({setFocusedQuestionId:a.setFocusedQuestionId}));return s(Tn,{...e,onSubmit:(a,l)=>{var h;const c=Object.entries(a).find(([,m])=>m.isSelected)||[void 0,void 0],[d,p]=c,u=i.find(m=>`${m.id}`===d);!((h=u==null?void 0:u.optionProperties)!=null&&h.allowsTextEntry)||p!=null&&p.userText&&p.userText.trim()!==""||o(t);const f=p!=null&&p.userText?{[d]:{userText:p.userText}}:null;n({value:u&&d?{[d]:u.value}:{},secondaryValue:f,questionId:t,type:r},l)}})},Bi=e=>{const{questionId:t,type:r,next:n}=e;return s(Tn,{...e,onSubmit:(i,o)=>{const a=Object.entries(i).reduce((c,[d,p])=>(c[d]=p.isSelected,c),{}),l=Object.entries(i).reduce((c,[d,p])=>{if(!p.userText)return c;const u=c||{};return u[d]={userText:p.userText},u},null);n({value:a,secondaryValue:l,questionId:t,type:r},o)}})},Vi=({className:e,labels:t,message:r,properties:n,next:i,questionId:o,type:a})=>{const[l,c]=V(null),{border:d,useMobileStyling:p,viewDocument:u,isLongFormSurvey:f,focusedQuestionId:h}=A(I=>({border:I.border,useMobileStyling:I.useMobileStyling,viewDocument:I.viewDocument,isLongFormSurvey:P.isLongFormSurvey(I.studyType),focusedQuestionId:I.focusedQuestionId})),m=f&&h===o,b=t&&t.left,v=t&&t.right,x=[...Array(11)].map((I,L)=>s("button",{className:F(te("nps-number",p),te(`nps-number-${L}`,p)),id:`option-${L}`,onClick:k=>{f&&(k.preventDefault(),k.stopPropagation(),c(L)),i({value:L,questionId:o,type:a},!0)},onKeyDown:k=>{var _,E;const T=u.querySelectorAll("button.nps-number");k.key==="ArrowRight"?(_=T[L+1])==null||_.focus():k.key==="ArrowLeft"?(E=T[L-1])==null||E.focus():k.key!=="Enter"&&k.key!==" "||(f&&(k.preventDefault(),k.stopPropagation(),c(L)),i({value:L,questionId:o,type:a},!0))},onPointerDown:k=>{k.currentTarget.style.zIndex="2",k.currentTarget.style.borderColor=d},onPointerLeave:k=>{k.currentTarget.style.zIndex="auto",k.currentTarget.style.borderColor=P.DEFAULT_BORDER_COLOR},style:l===L?{backgroundColor:d,color:"#fff"}:void 0,tabIndex:0,children:L},L)),y=I=>{I.preventDefault(),I.stopPropagation(),i({value:null,questionId:o,type:a},!0)};return s("form",{className:F(e,"ul-card--nps","fade-in-transition",f&&!m&&"ul-card--unfocused"),children:[s(se,{message:r,properties:n}),s(be,{properties:n,defaultBody:()=>s(X,{children:[s(me,{children:[s("div",{className:"ul-card--nps__numbers",children:x}),s("div",{className:"ul-card--nps__labels",children:[s("span",{children:b}),s("span",{children:v})]})]}),!n.required&&!f&&s(ve,{children:s("div",{className:"ul-vertical-centered-container",children:s(re,{onClick:y,children:Ce(n)})})})]})})]},o)},$i=({className:e,message:t,next:r,properties:n,questionId:i,type:o,showIndividualSubmit:a=!1,onSubmitButtonClick:l})=>{const{border:c,useMobileStyling:d,update:p,isLongFormSurvey:u,focusedQuestionId:f,setFocusedQuestionId:h,isPreview:m}=A(g=>({border:g.border,useMobileStyling:g.useMobileStyling,update:g.update,isLongFormSurvey:P.isLongFormSurvey(g.studyType),focusedQuestionId:g.focusedQuestionId,setFocusedQuestionId:g.setFocusedQuestionId,isPreview:g.isPreview})),[b,v]=V(""),x=J(null),y=u&&f===i;W(()=>{var g,S;u&&!m&&(y?(g=x.current)==null||g.focus():(S=x.current)==null||S.blur())},[u,y,m]);const I=b.trim(),L=n.required===!0&&!I,k=_n(x,()=>p()),T=g=>{const{value:S}=g.currentTarget;if(k(),g.preventDefault(),g.stopPropagation(),v(S),u){const C=S.trim().length>0;r({value:S,questionId:i,type:o},C)}},_=g=>{g.preventDefault(),g.stopPropagation(),r({value:b,questionId:i,type:o},!n.required||I.length>0),l&&l()},E=n&&n.openTextPlaceholder?n.openTextPlaceholder:"",N=g=>{g.currentTarget.style.borderColor=c,h(i)},D=g=>{g.currentTarget.style.borderColor=P.DEFAULT_BORDER_COLOR};return s("form",{className:F(e,"ul-card-text","fade-in-transition",u&&!y&&"ul-card--unfocused"),id:"text-form",onClick:()=>{u&&f!==i&&h(i)},children:[s(se,{message:t,properties:n}),s(be,{defaultBody:()=>s("div",{className:"ul-card-text",children:s(me,{children:[s("div",{className:"ul-card-text__container",children:s("textarea",{"aria-describedby":"ul-caption","aria-labelledby":"ul-question","aria-multiline":"true","aria-placeholder":E,className:F(te("ul-card-text__input",d)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:D,onChange:T,onFocus:N,placeholder:E,ref:x,role:"textbox",tabIndex:0})}),n.footerHtml&&s("div",{className:"footer",dangerouslySetInnerHTML:{__html:n.footerHtml}}),a&&s(Ye,{handleSubmit:_,isSubmitDisabled:L}),s(ve,{children:!u&&s(re,{disabled:L,onClick:_,children:Ce(n)})})]})}),properties:n})]},i)},zi=({className:e,labels:t,message:r,next:n,properties:i,questionId:o,type:a,onSubmitButtonClick:l,options:c,showIndividualSubmit:d=!1})=>{const p=J(null),u=J(0),f=J(0),h=J(null),m=J(!1),b=J([]),[v,x]=V(()=>(i==null?void 0:i.required)===!0),[y,I]=V(()=>c.map(U=>({...U,rank:null}))),L=ue(()=>Array.from({length:c.length},(U,Q)=>Q+1),[c.length]),{isLongFormSurvey:k,focusedQuestionId:T,setFocusedQuestionId:_,useMobileStyling:E,isPreview:N,headers:D}=A(U=>({useMobileStyling:U.useMobileStyling,isLongFormSurvey:P.isLongFormSurvey(U.studyType),focusedQuestionId:U.focusedQuestionId,setFocusedQuestionId:U.setFocusedQuestionId,isPreview:U.isPreview,headers:U.headers})),g=E&&!N,S=P.isiOS(D)&&g,C=k&&T===o,O=U=>{U.preventDefault(),Z(y),l&&l()},q=(U,Q)=>{for(let K=0;K<b.current.length;K++){const $=b.current[K];if(!$||$===h.current)continue;const ne=$.getBoundingClientRect();if(U>=ne.left&&U<=ne.right&&Q>=ne.top&&Q<=ne.bottom)return{element:$,index:K}}return null},w=U=>Q=>{if(!g)return;Q.preventDefault(),Q.stopPropagation(),m.current=!0,p.current=U;const K=Q.touches[0];u.current=K.clientY,f.current=K.clientY;const $=Q.currentTarget.closest(".ul-card-rank__option");$&&(h.current=$,$.classList.add("is-dragging"))},R=U=>{if(!g||!m.current||p.current===null)return;U.preventDefault(),U.stopPropagation();const Q=U.touches[0];f.current=Q.clientY;const K=f.current-u.current;h.current&&(h.current.style.transform=`translateY(${K}px)`,h.current.style.zIndex="1000"),b.current.forEach(ne=>{ne&&ne!==h.current&&ne.classList.remove("is-drop-target")});const $=q(Q.clientX,Q.clientY);$&&$.element.classList.add("is-drop-target")},H=U=>{if(!g||!m.current||p.current===null)return;U.preventDefault(),U.stopPropagation();const Q=U.changedTouches[0],K=q(Q.clientX,Q.clientY);h.current&&(h.current.style.transform="",h.current.style.zIndex="",h.current.classList.remove("is-dragging")),b.current.forEach($=>{$&&$.classList.remove("is-drop-target")}),K&&K.index!==p.current&&j(p.current,K.index),p.current=null,h.current=null,m.current=!1},j=(U,Q)=>{I(K=>{const $=K.map(ye=>({...ye})),[ne]=$.splice(U,1);return $.splice(Q,0,ne),$.forEach((ye,ee)=>{ye.rank=ee+1}),G($),$})},B=U=>{U.preventDefault(),U.dataTransfer&&(U.dataTransfer.dropEffect="move")},Z=U=>{const Q={};U.reduce((K,$)=>(K[$.id]=$.rank,K),Q),n({value:Q,questionId:o,type:a},!0)},G=U=>{x(!1),k&&Z(U)},{left:oe,right:ae}=t,fe=c.length,Ae=U=>{U.preventDefault(),U.currentTarget.classList.add("is-drop-target")},et=U=>{U.currentTarget.classList.remove("is-drop-target")},Hn=U=>{p.current=null,U.currentTarget.classList.remove("is-dragging")};return s("form",{className:F(e,"ul-card-rank","fade-in-transition",k&&!C&&"ul-card--unfocused"),onClick:()=>{k&&T!==o&&_(o)},onSubmit:O,children:[s(se,{message:r,properties:i}),s(be,{properties:i,defaultBody:()=>s(X,{children:[s(me,{children:[s("div",{className:"ul-card--rank__question-inner-container",children:[s("div",{className:"ul-card-rank__labels",children:s("span",{children:["1 - ",oe]})}),s("ol",{className:"ul-card-rank__list",onDragOver:B,children:y.map(({id:U,label:Q,rank:K},$)=>{return s("li",{className:"ul-card-rank__option",draggable:!g,onDragEnd:g?void 0:Hn,onDragEnter:g?void 0:Ae,onDragLeave:g?void 0:et,onDragStart:g?void 0:(ye=$,ee=>{p.current=ye,ee.dataTransfer&&(ee.dataTransfer.effectAllowed="move",ee.dataTransfer.setData("text/plain",String(ye)),ee.currentTarget.classList.add("is-dragging"))}),onDrop:g?void 0:(ne=$,ee=>{var je,Re;ee.preventDefault(),ee.currentTarget.classList.remove("is-drop-target");const xe=p.current;p.current=null,(Re=(je=ee.currentTarget.closest(".ul-card-rank__list"))==null?void 0:je.querySelector(".is-dragging"))==null||Re.classList.remove("is-dragging"),xe!=null&&xe!==ne&&j(xe,ne)}),ref:ee=>b.current[$]=ee,children:[s("select",{"aria-label":`Rank for ${Q}`,className:F("ul-card-rank__select",K==null&&"ul-card-rank__select--placeholder"),name:`rank[${U}]`,onChange:ee=>((xe,je)=>{I(Re=>{const Pe=parseInt(je),de=Re.map(Y=>({...Y}));de.some(Y=>Y.rank==null)&&de.forEach((Y,rt)=>Y.rank=rt+1);const tt=de.findIndex(Y=>Y.id===xe);if(tt===-1)return Re;const Be=de[tt].rank;return Pe<Be?de.forEach(Y=>{Y.id!==xe&&Y.rank>=Pe&&Y.rank<Be&&(Y.rank=Y.rank+1)}):Pe>Be&&de.forEach(Y=>{Y.id!==xe&&Y.rank>Be&&Y.rank<=Pe&&(Y.rank=Y.rank-1)}),de[tt].rank=Pe,de.sort((Y,rt)=>Y.rank-rt.rank),G(de),de})})(U,ee.currentTarget.value),value:K??"",children:[K==null&&s("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),L.map(ee=>s("option",{className:"ul-card-rank__select-option",value:ee,children:ee},ee))]}),s("span",{children:Q}),S&&s("button",{"aria-label":`Drag ${Q} to reorder`,className:"ul-card-rank__drag-btn",onTouchEnd:g?H:void 0,onTouchMove:g?R:void 0,onTouchStart:g?w($):void 0,title:"Drag to reorder",type:"button",children:s("svg",{fill:"none",height:"17",viewBox:"0 0 16 17",width:"16",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z",fill:"currentColor"})})})]},U);var ne,ye})}),s("div",{className:"ul-card-rank__labels",children:s("span",{children:[fe," - ",ae]})})]}),d&&s(Ye,{handleSubmit:O,isSubmitDisabled:v})]}),!k&&s(ve,{children:s("div",{className:"ul-card__button-wrapper",children:s(re,{disabled:v,children:Ce(i)})})})]})})]},o)},Qi=new Set(["open","matrix","multipleselect","multiplechoice","rankorder"]),mr=({cardInstance:e,moveToNextQuestion:t,showIndividualSubmit:r,submitQuestion:n,updateCardValues:i})=>{const{isLongFormSurvey:o}=A(f=>({isLongFormSurvey:P.isLongFormSurvey(f.studyType)}));if(!e)return null;const{name:a,type:l,props:c}=e,d=r&&Qi.has(l),p={className:"ul-card",next:(f,h,m=!0)=>n(f,h&&m),questionId:a,type:l,showIndividualSubmit:r,...d?{next:(f,h)=>{i(f.questionId,f,h??!0)},onSubmitButtonClick:()=>t(a)}:{}},u=(()=>{switch(l){case"consentlegal":return s(Ni,{...p,...c});case"likert":return s(Pi,{...p,...c});case"matrix":return s(Hi,{...p,...c});case"maxdiff":return s(fo,{...p,...c});case"multiplechoice":return s(ji,{...p,...c});case"multipleselect":return s(Bi,{...p,...c});case"nps":return s(Vi,{...p,...c});case"open":return s($i,{...p,...c});case"rankorder":return s(zi,{...p,...c});case"recordedtask":return s(ao,{...p,...c});case"texturlprompt":return s(co,{...p,...c});case"thanks":return s(uo,{...p,...c});case"uploading":return s(po,{...p,...c});default:return null}})();return u?o?s("div",{className:"ul-card-scroll-wrapper",children:u},a):u:null},Wi=({isSubmitDisabled:e=!1,onSubmit:t,buttonText:r})=>{var h;const{cards:n,forceBrandedLogo:i,index:o,marketingUrl:a,showSurveyBrand:l,slugName:c,surveyId:d,useMobileStyling:p}=A(m=>({cards:m.cards,forceBrandedLogo:m.forceBrandedLogo,index:m.index,marketingUrl:m.marketingUrl,showSurveyBrand:m.showSurveyBrand,slugName:m.slugName,surveyId:m.surveyId,useMobileStyling:m.useMobileStyling})),u=((h=n[o])==null?void 0:h.type)==="thanks",f=wn({marketingUrl:a,slugName:c,surveyId:d,forceBrandedLogo:i});return s("footer",{className:F("long-form-question-footer-container",p&&"long-form-question-footer-container--mobile",u&&"long-form-question-footer-container-center"),children:[u&&i?s(xn,{marketingUrlLink:f}):s("div",{className:"long-form-question-footer-container-logo",children:l?s(yn,{forceBrandedLogo:i,marketingUrlLink:f}):null}),!u&&s("div",{className:F("ul-card__button-wrapper","ul-card-vertical__button-wrapper","long-form-question-footer-container-actions"),children:s(re,{className:F("long-form-button",e&&"sprig-button-disabled"),disabled:e,onClick:t,children:s("span",{className:"long-form-button-text-container",children:r??s(Rt,{stroke:"white"})})})})]})},In=xt(void 0),Zi=({value:e,children:t})=>s(In.Provider,{value:e,children:t}),Gi=/<piped-value\b([^>]*)>.*?<\/piped-value>/gis,fr=["questionHtml","captionHtml","footerHtml","richTextBody"],Ln=e=>!!e.props&&typeof e.props=="object"&&"properties"in e.props,ct=e=>!!e.props&&typeof e.props=="object"&&"options"in e.props&&Array.isArray(e.props.options),hr=e=>["string","number"].includes(typeof e),gr=e=>e.length===0?"":e.length===1?e[0]:e.join(", "),Ki=e=>{var r,n;const t=(i=>i!=null&&typeof i=="object"&&"value"in i)(e)?e.value:void 0;if(t!=null){if(e.type==="multipleselect"&&ct(e)&&(i=>!!i&&typeof i=="object"&&!Array.isArray(i))(t)){const i=e.secondaryValue??null,o=e.props.options.filter(a=>t[String(a.id)]===!0).map(a=>{var l;return a.label+((l=i==null?void 0:i[String(a.id)])!=null&&l.userText?`: ${i[String(a.id)].userText}`:"")});return o.length?gr(o):"No options selected"}if(e.type==="multiplechoice"&&typeof t=="object"&&t!==null){const i=e.secondaryValue??null,o=Object.keys(t)[0];if(o){const a=e.props.options.find(l=>String(l.id)===o);return(a==null?void 0:a.label)+((r=i==null?void 0:i[o])!=null&&r.userText?`: ${(n=i==null?void 0:i[o])==null?void 0:n.userText}`:"")}}if(e.type==="matrix"&&ct(e)&&(i=>{if(!Ln(i))return!1;const o=i.props.properties;return!!o&&typeof o=="object"&&"matrixColumn"in o})(e)){const i=e.props.options,o=e.props.properties.matrixColumn,a=[];for(const[l,c]of Object.entries(t)){const d=i.find(m=>String(m.id)===l),p=(d==null?void 0:d.label)??l,u=hr(c)?String(c):JSON.stringify(c),f=o.find(m=>m.value===u),h=(f==null?void 0:f.label)??u;a.push(`${p}: ${h}`)}return a.join("; ")}if(e.type==="rankorder"&&ct(e)){const i=e.props.options.reduce((a,l)=>(a[String(l.id)]=l.label,a),{}),o=[];for(const[a,l]of Object.entries(t)){const c=i[a];c&&(o[l-1]=c)}return gr(o)}if(hr(t)){const i=String(t).replaceAll(/[\u200B-\u200D\uFEFF]/g,"").trim();return i===""?void 0:i}try{return JSON.stringify(t)}catch{return String(t)}}},_r=(e,t)=>{const r=new RegExp(`${t}="([^"]*)"`,"i").exec(e);return(r==null?void 0:r[1])??null},Yi=(e,t)=>{if(e==null)return e;let r=!1;const n=e.replace(Gi,(i,o)=>{r=!0;const a=_r(o,"answer-id"),l=_r(o,"fallback-text")??"",c=a?Number(a):Number.NaN;if(Number.isFinite(c)&&Object.hasOwn(t,c)){const d=t[c];return String(d)}return l});return r?n:e},Nn=e=>{const t={};for(const r of e){const n=Ki(r);n!==void 0&&(t[r.name]=n)}return t},Ji=({cards:e,next:t,previousResponses:r})=>{var D;const[n,i]=V({}),[o,a]=V({}),l=ue(()=>({...r,...Nn(e.map(g=>{var S,C;return{...g,value:((S=n[g.name])==null?void 0:S.value)??null,secondaryValue:((C=n[g.name])==null?void 0:C.secondaryValue)??null}}))}),[r,n,e]),c=(d=l,e.map(g=>{if(!Ln(g)||g.props.properties===void 0||g.props.properties===null)return g;const S=g.props.properties;if(S===null||typeof S!="object"||!fr.some(q=>q in S))return g;let C=!1;const O={};for(const q of fr){const w=S[q];if(w!==void 0){const R=Yi(w,d);O[q]=R,R!==w&&(C=!0)}}return C?{...g,props:{...g.props,properties:{...S,...O}}}:g}));var d;const{isLongFormSurvey:p,focusedQuestionId:u,setFocusedQuestionId:f}=A(g=>({isLongFormSurvey:P.isLongFormSurvey(g.studyType),focusedQuestionId:g.focusedQuestionId,setFocusedQuestionId:g.setFocusedQuestionId})),h=J(null),m=J(!1),b=J(null),v=we(g=>{var q,w;m.current=!0;const S=e.findIndex(R=>R.name===g);if(!p||g===null||S===-1)return void(m.current=!1);const C=(q=h.current)==null?void 0:q.querySelectorAll(".ul-card-scroll-wrapper")[S],O=(w=h.current)==null?void 0:w.closest(".ul-card__container");if(C&&O){if(C&&O){const R=C.getBoundingClientRect(),H=O.getBoundingClientRect(),j=R.top-H.top+O.scrollTop,B=j+R.height/2,Z=window.innerHeight-157;let G;R.height>=Z?G=j:G=B-O.clientHeight/2;const oe=O.clientHeight,ae=O.scrollHeight-oe,fe=Math.max(0,Math.min(G,ae));O.scrollTo({top:fe,behavior:"smooth"}),setTimeout(()=>{m.current=!1},500)}}else m.current=!1},[p,e]);function x(g,S){return g.map(C=>S[C.name])}W(()=>{u!==null&&e.findIndex(g=>g.name===u)!==-1||f(e[0].name)},[e,u,f]);const y=g=>{if(!p)return;const S=e.findIndex(C=>C.name===g)+1;if(S<e.length){const C=e[S].name;f(C)}else f(g)};W(()=>{p&&u!==null&&(b.current!==u?v(u):b.current=null)},[u,p,v]);const I=we(()=>{var H,j;if(m.current)return;const g=(H=h.current)==null?void 0:H.closest(".ul-card__container");if(!g)return;const S=(j=h.current)==null?void 0:j.querySelectorAll(".ul-card-scroll-wrapper");if(!S||S.length===0)return;const C=g.getBoundingClientRect(),O=C.top+C.height/2;let q=0,w=1/0;S.forEach((B,Z)=>{const G=B.getBoundingClientRect(),oe=G.top+G.height/2,ae=Math.abs(O-oe);ae<w&&(w=ae,q=Z)});const R=e[q];b.current=R.name,f(R.name)},[e,f]);W(()=>{var S;if(!p)return;const g=((S=h.current)==null?void 0:S.closest(".ul-card__container"))||null;return g&&g.addEventListener("scroll",I,{passive:!0}),()=>{g&&g.removeEventListener("scroll",I)}},[I,p]);const L=ue(()=>Object.values(o).every((g,S)=>{var O;const C=e[S];return!(!(C!=null&&C.props)||!("properties"in C.props)||((O=C.props.properties)==null?void 0:O.required)!==!1)||g}),[o,e]),k=async(g,S,C)=>{return a(q=>({...q,[g]:C})),await(O=q=>({...q,[g]:S}),new Promise(q=>{i(w=>{const R=O(w);return q(R),R})}));var O};W(()=>{if(!p)return;const g={};e.forEach(S=>{var O,q;const C=S;(q=(O=C.props)==null?void 0:O.properties)!=null&&q.required||(g[C.name]={value:null,questionId:C.name,type:C.type})}),i(g),a({})},[e,p]);const T=async(g,S)=>{if(p){const C=await k(g.questionId,g,S),O=_(g.type),q=E(g.type);if(O&&y(g.questionId),q&&S){const w=x(e,C);t(w)}}else t([g])},_=g=>new Set(["nps","likert","multiplechoice"]).has(g),E=g=>new Set(["videovoice","consentlegal","texturlprompt","maxdiff"]).has(g),N=((D=e[0])==null?void 0:D.type)==="thanks";return p?s("div",{className:"ul-card-list-container--longform",ref:h,children:[s(Zi,{value:r,children:c.map((g,S)=>s(mr,{cardInstance:g,moveToNextQuestion:y,showIndividualSubmit:p&&e.length>1&&S<e.length-1,submitQuestion:T,updateCardValues:k},(g==null?void 0:g.name)||S))}),!N&&s(Wi,{isSubmitDisabled:Object.keys(n).length<e.length||!L,onSubmit:function(){const g=x(e,n);t(g)}})]}):s(X,{children:c.map((g,S)=>s(mr,{cardInstance:g,moveToNextQuestion:y,showIndividualSubmit:p&&e.length>1&&S<e.length-1,submitQuestion:T,updateCardValues:k},(g==null?void 0:g.name)||S))})},ht=1,En=2,Rn=3,Ge=e=>e.type==="av_permission",br=e=>e.type==="screen_permission",Pn=(e,t)=>e===void 0?ht:e?((r,n)=>!(Ge(n)?n.permissionDescriptors:[]).includes("camera")||r.getVideoTracks().length>0)(e,t)?Rn:ht:En,vr={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},pe=un(e=>({...vr,reset:()=>{e(vr)},updatePage:t=>{e(t)}}));function gt({currentPage:e,pages:t}){const{avStream:r,recordingMediaTypes:n,updatePage:i}=pe.getState(),{recorderEventEmitter:o}=A.getState();o.emit("av.permission",{"permission.descriptors":e.permissionDescriptors,"stream.ready":(a,l)=>{if(r===a)return;let c=e;if(a&&!e.permissionDescriptors.includes("camera")){const d=t.indexOf(e),p=l!=null&&l.active?d+2:d+1;l!=null&&l.active&&n&&o.emit("begin.recording",{"recording.media.types":n,"start.recording.callback":u=>i({mediaRecordingUids:u})}),c=t[p]}i({currentPage:c,avStream:a})}})}function _t({status:e}){const{nextQuestion:t,passthroughData:r,mediaRecordingUids:n,reset:i}=pe.getState(),{recorderEventEmitter:o,handleUploadUpdate:a,index:l}=A.getState(),c={value:{taskStatus:e},type:"recordedtask",questionId:(r==null?void 0:r.questionId)||1};r&&o.emit("finish.task",{"begin.callback":d=>{a({mediaRecordingUid:d,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(d,p)=>{a({mediaRecordingUid:d,progressPct:p.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":d=>{d&&a({mediaRecordingUid:d,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":r,"current.index":l,"task.response":c,"task.complete.callback":d=>{c.value.taskDurationMillisecond=d,n&&(c.value.mediaRecordingUids=n),i(),t(c)}})}function Pt({pages:e,setIsRequestingPermission:t}){const{recorderEventEmitter:r,eventEmitFn:n}=A.getState(),{updatePage:i,currentPage:o,recordingMediaTypes:a,screenPermissionRequested:l}=pe.getState();if(!o)return;const c=e.indexOf(o);switch(o.type){case"av_permission":{const d=l?c+2:c+1;return l&&a&&r.emit("begin.recording",{"recording.media.types":a,"start.recording.callback":p=>{i({mediaRecordingUids:p})}}),void i({currentPage:e[d]})}case"screen_permission":return void r.emit("screen.permission",{"screen.permission.requested":t,"stream.ready.callback":(d,p)=>{const u=p?e[c+1]:o;p&&a&&r.emit("begin.recording",{"recording.media.types":a,"start.recording.callback":f=>{i({captureStream:p,mediaRecordingUids:f})}}),i({currentPage:u,screenPermissionRequested:!0,captureStream:p})}});case"start_task":return n("recorded.task.start"),r.emit("recorded.task.start"),r.emit("start.task"),void i({currentPage:e[c+1],screenPermissionRequested:!0});case"complete_task":return}}const Mn="ul-permission-graphics-container",On="ul-permission-body",Dn=F(Mn,"ul_recorded-task-inset-spacing"),Je=F("ul-horizontal-button-container","ul-horizontal-button-container-left"),qn=({richTextBody:e})=>s("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),Xe=({required:e,skipButtonText:t,bottom:r=!1})=>e?null:s(re,{className:F(r&&"ul-skip-button-below","ul-button-inactive"),onClick:_t.bind(null,{status:"abandoned"}),children:t||"Skip"}),Mt=e=>{const{avStream:t,captureStream:r,recordingMediaTypes:n,updatePage:i}=pe.getState(),o=(n==null?void 0:n.includes("audio"))||(n==null?void 0:n.includes("video"));W(()=>{const a=setInterval(()=>{o&&t&&!t.active?i({avStream:null,currentPage:e[0]}):r&&r.active||i({captureStream:void 0,currentPage:e[o?1:0]})},1e3);return()=>clearInterval(a)},[t,r,o,e,n,i])},Xi=({content:e,pages:t,required:r})=>{const{buttonText:n,skipButtonText:i,taskDetail:o}=e;return Mt(t),s("div",{className:"ul-task-page",children:[o&&s(qn,{richTextBody:o}),s("div",{className:Je,children:[s(re,{onClick:Pt.bind(null,{pages:t}),children:n}),s(Xe,{required:r,skipButtonText:i})]})]},"start-task")},eo=({content:e,pages:t,properties:r})=>{const{buttonText:n,skipButtonText:i}=e;Mt(t);const o=s(be,{properties:r,defaultBody:()=>s("div",{className:Je,children:[s(re,{className:"ul-complete-task-button",onClick:_t.bind(null,{status:"completed"}),children:n}),s(re,{className:F("ul-button-inactive"),onClick:_t.bind(null,{status:"given.up"}),children:i})]})});return s("div",{className:"ul-task-page",children:[e.taskDetail&&s(qn,{richTextBody:e.taskDetail}),o]},"complete-task")},to=({content:e,pages:t,required:r})=>{const{buttonText:n,skipButtonText:i}=e,[o]=A(c=>[c.tabTitle]),[a,l]=V(!1);return s("div",{children:[s("div",{className:Dn,children:[s("p",{style:{marginTop:"auto"},children:e.selectTabText}),s("div",{className:"ul-select-tab-container",children:s("p",{className:On,children:o})})]}),s("div",{className:r?"":Je,children:[s(re,{disabled:a,onClick:Pt.bind(null,{pages:t,setIsRequestingPermission:l}),children:n}),s(Xe,{required:r,skipButtonText:i})]})]})},ro=({content:e})=>s("div",{className:F(Mn,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),no=({content:e,pages:t,required:r})=>{const{permissionDeniedHeadline:n,permissionDeniedBody:i,skipButtonText:o,tryAgainButtonText:a}=e,l=Ge(t[0])?t[0]:null;return W(()=>{const c=setInterval(()=>{l!==null&&gt({currentPage:l,pages:t})},1e3);return()=>clearInterval(c)},[l,t]),l?s("div",{children:[s("div",{className:Dn,children:s("p",{className:"ul-av-permission-denied-paragraph",children:[s("span",{className:"ul-av-permission-denied-headline",children:n}),s("span",{className:On,children:i})]})}),s("div",{className:Je,children:[s(re,{onClick:gt.bind(null,{currentPage:l,pages:t}),children:a}),s(Xe,{required:r,skipButtonText:o})]})]}):null},io=({stream:e})=>s("video",{autoPlay:!0,className:F("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),oo=({content:e,pages:t,required:r})=>{const{skipButtonText:n}=e,{avStream:i}=pe.getState();return Mt(t),s("div",{children:[s(io,{stream:i}),s("div",{className:"ul-vertical-button-container-center",children:[s(re,{onClick:Pt.bind(null,{pages:t}),children:e.buttonText}),s(Xe,{bottom:!0,required:r,skipButtonText:n})]})]})},so=({properties:e})=>{const{pages:t,required:r}=e,{avStream:n,currentPage:i}=pe.getState();if(i===void 0)return null;switch(i==null?void 0:i.type){case"av_permission":{const o=Pn(n,i);return o===ht?s(ro,{content:i}):s(o===En?no:oo,{content:i,pages:t,required:r})}case"screen_permission":return s(to,{content:i,pages:t,required:r});case"start_task":return s(Xi,{content:i,pages:t,required:r});case"complete_task":return s(eo,{content:i,pages:t,properties:e});default:return null}},ao=({className:e,properties:t,next:r,questionId:n})=>{const i=A(),{surveyId:o,responseGroupUid:a,userId:l}=i,c=pe(),{screenPermissionRequested:d}=c,p=pe(b=>b.avStream);let u=pe(b=>b.currentPage);u||(u=function({pages:b,userId:v,responseGroupUid:x,surveyId:y,questionId:I,next:L}){const{updatePage:k}=pe.getState(),{eventEmitFn:T,recorderEventEmitter:_}=A.getState(),E={questionId:I,surveyId:y,visitorId:v,responseGroupUid:x};let N=0;_.emit("recorded.task.permission.screen"),T("recorded.task.permission.screen"),_.emit("permission.status",{"permission.status.callback":(g,S,C,O)=>{const q=b[N],{type:w}=q,R=["screen"];if(Ge(q)){const{permissionDescriptors:H}=q,j=H==null?void 0:H.includes("microphone"),B=H==null?void 0:H.includes("camera");j&&R.push("audio"),B&&R.push("video"),(g!=null&&g.active&&!B||g!=null&&g.active&&S)&&N++}br(b[N])&&C&&(N++,_.emit("begin.recording",{"recording.media.types":R,"start.recording.callback":H=>k({mediaRecordingUids:H})})),k({currentPage:b[N],avStream:g,screenPermissionRequested:C,nextQuestion:L,type:w,passthroughData:E,recordingMediaTypes:R,captureStream:O})}});const D=b[N];return D.type==="av_permission"&&gt({currentPage:D,pages:b}),D}({questionId:n,surveyId:o,next:b=>{r(b,!0)},pages:t.pages,responseGroupUid:a,userId:l}));let f=u.headline,h=u.captionText;const m=Pn(p,u);return br(u)&&d&&(f=u.permissionDeniedHeadline,h=u.permissionDeniedCaptionText),Ge(u)&&m===Rn&&(f=u.permissionGrantedHeadline,h=u.permissionGrantedCaptionText),s("div",{className:F(e,"ul-center-horizontally","fade-in-transition"),children:[s(se,{message:f,properties:{captionText:h}}),s(me,{children:s(so,{properties:t})})]})},lo={"{{user_id}}":"externalUserId","{{email}}":"email"},co=({className:e,message:t,next:r,properties:n,questionId:i,type:o})=>{const{visitorAttributes:a,isLongFormSurvey:l}=A(m=>({visitorAttributes:m.visitorAttributes,isLongFormSurvey:P.isLongFormSurvey(m.studyType)})),c=(m,b=!1)=>{r({value:b?{skipped:!0}:void 0,questionId:i,type:o},!0)},d=m=>{m.key!=="Enter"&&m.key!==" "||r({value:void 0,questionId:i,type:o},!0)},p=((m,b={})=>{if(!m)return m;try{/^https?:\/\//i.test(m)||(m=`http://${m}`);const L=new URL(m);if(!L.protocol||L.protocol!=="http:"&&L.protocol!=="https:")return}catch{return}let v=m;const x=[];for(const[L,k]of Object.entries(lo))if(v.toLowerCase().includes(L))if(b[k]){const T=new RegExp(L,"gi");v=v.replace(T,b[k])}else x.push(L);if(x.length===0||!v.includes("?"))return v;const y=v.slice(0,v.indexOf("?")),I=v.slice(v.indexOf("?")+1).split("&").map(L=>L.split("=")).filter(L=>!x.includes(L[1]));return I.length===0?y:`${y}?${I.map(L=>L.join("=")).join("&")}`})(n&&n.buttonUrl,a),u=l&&n.promptActionType===Cn.NO_BUTTON?()=>s(X,{}):()=>s(ve,{children:s("div",{className:"ul-card-button-group",children:[s("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:p,id:"ul-card-text__button",onClick:c,onKeyPress:d,rel:"noreferrer",role:p?"link":"button",tabIndex:0,target:"_blank",children:Ce(n)}),n.required===!1&&s("button",{className:"ul-card-skip__button",onClick:m=>c(0,!0),children:kn(n)})]})});return s("div",{className:F(e,"ul-card__text-url-prompt","fade-in-transition"),children:[s(se,{message:t,properties:{questionHtml:n.questionHtml}}),s(me,{children:(f=n==null?void 0:n.richTextBody,h=n==null?void 0:n.body,f?s("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:f},id:"ul-card__text-url-body-container"}):h?s("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(h?h.split(/\n\s*\n/g):[]).map((m,b)=>s("p",{children:m},b))}):null)}),s(be,{defaultBody:u,properties:n})]},i);var f,h},uo=({className:e,questionId:t})=>{const{border:r,destroy:n,endCard:i,forceBrandedLogo:o}=A(c=>({border:c.border,destroy:c.destroy,endCard:c.endCard,forceBrandedLogo:c.forceBrandedLogo}));W(()=>{setTimeout(()=>{n(P.APP_ID)},o?4e3:2e3)},[n,o]);const a=i&&i.subheader?s("p",{className:"ul-caption",children:i.subheader}):null,l=i&&i.headline?i.headline:"";return s("div",{className:F(e,"ul-card--thanks","fade-in-transition"),children:s("div",{children:s("div",{className:"ul-card--thanks-content",children:[s("div",{className:"ul-thanks-check",children:s("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[s("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:r,fillRule:"evenodd"}),s("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:r,fillRule:"evenodd"}),s("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"})]})}),s(se,{message:l}),a]})})},t)},po=({className:e})=>{const{uploadProgress:t}=A(o=>({uploadProgress:o.uploadProgress}));let r,n;Object.values(t).filter(o=>o.isSubmitted).length>1?(r="Your responses are processing",n="Please keep this tab open until your responses are fully processed."):(r="Your response is processing",n="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(t).filter(o=>o.isSubmitted).map(o=>o.progressPct||0)));return s("div",{className:F(e,"ul-card--uploading","fade-in-transition"),children:[s("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:"ul-loading-spinner-container",role:"progressbar",children:s("div",{className:"ul-loading-spinner",children:[s("div",{className:"first"}),s("div",{className:"second"}),s("div",{className:"third"}),s("div",{className:"fourth"})]})}),s(se,{message:`${r} (${i}% complete)`}),s("p",{className:"ul-caption",children:n})]})},mo=({isRightLabel:e,isLeftLabel:t})=>e?le.RIGHT:t?le.LEFT:null,fo=({className:e,labels:t,message:r,properties:n,options:i,questionId:o,type:a,next:l})=>{var I,L,k,T;const[c,d]=V(i.map((_,E)=>({..._,label:_.label===""?`Item ${E+1}`:_.label,isRightLabel:!1,isLeftLabel:!1}))),p=(()=>{const _=wt(In);if(_===void 0)throw new Error("usePreviousResponses must be used within a PreviousResponsesProvider");return _})(),u={padding:"12px",display:"flex",cursor:"pointer",width:"86px"},[f,h]=V(!1);W(()=>{const _=c.findIndex(q=>q.isRightLabel),E=c.findIndex(q=>q.isLeftLabel),N=_!==-1&&E!==-1;h(N);const D=!n.required||n.required&&N,g=c.map(q=>({id:q.id,option:q.label,selected:mo(q)})),S=Math.floor(o),C=Object.keys(p).filter(q=>q.startsWith(S.toString())).map(Number).sort((q,w)=>q-w).at(-1),O=[];if(typeof C=="number"){const q=p[C],w=JSON.parse(q);O.push(...w)}O.push(g),setTimeout(()=>{l({value:O,questionId:o,type:a},D,N),h(!1)},N?500:0)},[c]);const{border:m,useMobileStyling:b}=A(_=>({border:_.border,useMobileStyling:_.useMobileStyling})),v=(_,E)=>()=>{f||d(N=>((D,g,S)=>D.map(C=>C.id===g?{...C,isRightLabel:S===le.RIGHT,isLeftLabel:S===le.LEFT}:S===le.RIGHT&&C.isRightLabel||S===le.LEFT&&C.isLeftLabel?{...C,isRightLabel:!1,isLeftLabel:!1}:C))(N,_,E))},x=(I=n.ratingIcons)==null?void 0:I[0].svg,y=(L=n.ratingIcons)==null?void 0:L[1].svg;return s("form",{className:F(e,"ul-card-maxdiff","fade-in-transition"),children:[s(se,{message:r,properties:n}),s(me,{children:s("div",{className:"ul-card--maxdiff__question-inner-container",children:[s("div",{className:"ul-card-maxdiff__labels-row",children:[s("div",{className:"ul-card-maxdiff__label",children:(t==null?void 0:t.left)||((k=n==null?void 0:n.labels)==null?void 0:k.left)||"Most important"}),s("div",{className:"ul-card-maxdiff__label",children:(t==null?void 0:t.right)||((T=n==null?void 0:n.labels)==null?void 0:T.right)||"Least important"})]}),c.map(({id:_,label:E,isLeftLabel:N,isRightLabel:D})=>s("div",{className:"ul-card-maxdiff__option-row",children:[s("div",{className:"ul-card-maxdiff__option-control "+(y?"smiley":""),children:y?s("span",{"aria-pressed":N,className:N?"ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected good":"ul-card-maxdiff__option-btn",dangerouslySetInnerHTML:{__html:y},id:`smiley-good-${_}`,onClick:v(_,le.LEFT),tabIndex:0,type:"button"}):s(Ee,{allowTextEntry:!1,ariaLabel:`leftLabel-${E}`,border:m,choiceStyle:u,error:!1,id:`${_}`,isRadio:!0,isSelected:N,onUserInputChanged:v(_,le.LEFT),useMobileStyling:b})}),s("div",{className:"ul-card-maxdiff__option-label",children:E}),s("div",{className:"ul-card-maxdiff__option-control "+(x?"smiley":""),children:x?s("span",{"aria-pressed":D,className:D?"ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected bad":"ul-card-maxdiff__option-btn",dangerouslySetInnerHTML:{__html:x},id:`smiley-bad-${_}`,onClick:v(_,le.RIGHT),tabIndex:0,type:"button"}):s(Ee,{allowTextEntry:!1,ariaLabel:`rightLabel-${E}`,border:m,choiceStyle:u,error:!1,id:`${_}`,isRadio:!0,isSelected:D,onUserInputChanged:v(_,le.RIGHT),useMobileStyling:b})})]},_))]})})]},o)},ho=()=>{var x;const{border:e,cards:t,forceBrandedLogo:r,headers:n,index:i,marketingUrl:o,showSurveyBrand:a,slugName:l,surveyId:c,viewedCardCount:d}=A(y=>({border:y.border,cards:y.cards,forceBrandedLogo:y.forceBrandedLogo,headers:y.headers,index:y.index,marketingUrl:y.marketingUrl,showSurveyBrand:y.showSurveyBrand,slugName:y.slugName,surveyId:y.surveyId,viewedCardCount:y.viewedCardCount})),p=J(null),u=t.filter(y=>y.type!=="uploading"&&y.type!=="thanks"),f=((y,I)=>{const L=new Set(["thanks","uploading"]);if(I>=y.length||I<0||L.has(y[I].type))return 0;const k=y.filter(_=>!L.has(_.type));if(I===k.length-1)return 1;const T={[k.length-1]:1,[-1]:0};for(let _=k.length-2;_>=I;_--){const E=k[_],N=yi(_,E.props.routingOptions);if(N.length===0){T[_]=T[_+1]+1;continue}let D=0,g=_i(E);if(g===null)return k.length-1-I;for(let S=0;S<N.length&&g.length!==0;S++){const{comparator:C,target:O,value:q}=N[S],w=g.filter(R=>{const H=gi({value:R},E.type,R),j=dn(R,E.type);return!(H&&C==="answered"||j&&C==="partial"||!H&&!j&&C==="skipped"||C==="given_up"&&vi(R)&&R.taskStatus==="given.up"||H&&E.type==="open"&&(C==="contains"||C==="notcontains")||H&&bi(C)&&Et[C](R,q))});if(w.length<g.length){const R=parseInt(String(O),10);if(R!==-1&&R<=_||R>=k.length)return k.length-1-I;D=Math.max(T[R]+1,D)}g=w}g.length>0&&(D=Math.max(T[_+1]+1,D)),T[_]=D}return T[I]})(t,i),h=d+1,m=h/(h+f),b=wn({marketingUrl:o,slugName:l,surveyId:c,forceBrandedLogo:r});W(()=>{p.current&&(p.current.style.width=100*m+"%")},[m]);const v=((x=t[i])==null?void 0:x.type)==="thanks";return s("footer",{className:"ul-footer "+(n["userleap-platform"]==="link"?"ul-footer__link":""),children:v&&r?s(xn,{marketingUrlLink:b}):s(X,{children:[u.length>1&&s("div",{className:"ul-progress-bar-container ul-progress-bar-container__footer",children:s("div",{className:"ul-progress-bar-current",ref:p,style:{border:`1px solid ${e||"#000"}`}})}),a?s(yn,{forceBrandedLogo:r,marketingUrlLink:b}):null]})})},go=()=>{const e=A(a=>a.border),t=A(a=>a.cards),r=A(a=>a.index),n=A(a=>a.focusedQuestionId),{totalQuestions:i,fraction:o}=ue(()=>{var d;const a=t.filter(p=>p.type!=="uploading"&&p.type!=="thanks"),l=a.length;if(l<=1)return{totalQuestions:l,fraction:0};if(((d=t[r])==null?void 0:d.type)==="thanks")return{totalQuestions:l,fraction:1};const c=a.findIndex(p=>p.name===n);return{totalQuestions:l,fraction:(c>=0?c:0)/l}},[t,r,n]);return i<=1?null:s("div",{className:"ul-progress-bar-container ul-progress-bar-container__header",children:s("div",{className:"ul-progress-bar-current",style:{width:100*o+"%",border:`1px solid ${e??"#000"}`}})})},_o=()=>{const{answers:e,border:t,cards:r,close:n,configureExitOnOverlayClick:i,destroy:o,endCard:a,eventEmitFn:l,fontFamily:c,headers:d,index:p,minScrollableHeight:u,next:f,previewMode:h,productConfig:m,seen:b,showStripes:v,studyType:x,surveyId:y,update:I,useMobileStyling:L,viewDocument:k}=A(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,previewMode:w.previewMode,productConfig:w.productConfig,minScrollableHeight:w.minScrollableHeight,next:w.next,seen:w.seen,showStripes:w.showStripes,studyType:w.studyType,surveyId:w.surveyId,update:w.update,useMobileStyling:w.useMobileStyling,viewDocument:w.viewDocument})),T=J(null),_=J(!1),E=d["userleap-platform"],{props:N,type:D,name:g}=r[p];W(()=>{if(window.Sprig)return window.Sprig.trackHistory=w=>A.getState().trackHistory(w),()=>{window.Sprig.trackHistory=void 0}},[]),W(()=>{T.current&&(T.current.classList.contains("ul-app--visible")||T.current.classList.add("ul-app--visible"),!_.current&&l&&(_.current=!0,l(P.SprigEvent.SurveyAppeared,{name:P.SprigEvent.SurveyAppeared,"survey.id":y})))},[l,y]),W(()=>{const w=()=>{k.visibilityState==="visible"&&(b(),k.removeEventListener("visibilitychange",w))};return k.addEventListener("visibilitychange",w),w(),()=>{k.removeEventListener("visibilitychange",w)}},[b,k]),W(()=>{I()},[p,I]),W(()=>{i(()=>n())},[n,i]);const S=ue(()=>P.groupCards(r,p),[r,p]),C=Nn(r),O=we(w=>{f({data:w,completeSurvey:()=>o(P.APP_ID),endCard:a}),P.resetScrollPosition(k)},[f,o,a,k]);if(e){for(const w of e)if(w.questionId===g){let R;if(D==="multiplechoice"){const H=N.options.find(({value:j})=>j===w.value);if(!H)break;R={[H.id]:H.value}}else R=w.value;O({value:R,type:D,questionId:w.questionId});break}}const q=!L&&((m==null?void 0:m.framePosition)==="center"||(m==null?void 0:m.desktopDisplay)==="center-modal"||((m==null?void 0:m.placement)||"").includes("center"));return s("div",{className:F("ul-app",P.shouldDirectEmbed(d)?"ul-app--visible":"ul-app--overlay"),dir:"auto",id:P.APP_ID,onClick:w=>{var B;const R=window.sprigAPI,H=w.target;if(!R||!H)return;const j=[H,H.parentElement];for(const Z of j)if(((B=Z==null?void 0:Z.tagName)==null?void 0:B.toLowerCase())==="a"){w.preventDefault();try{const G=new URL(Z.href);G.protocol!=="http:"&&G.protocol!=="https:"||(R==null||R.openUrl(G.toString()))}catch(G){console.error(G)}return}},ref:T,style:{"--theme":t,...c?{fontFamily:c.replace(";","")}:{},...q?{position:"relative"}:{}},children:s("div",{className:"ul-app__container",children:s("div",{className:F(te("ul-card__container",L,x)),style:{...x!=="feedbackButton"||(m==null?void 0:m.desktopDisplay)==="center-modal"?{borderColor:t}:{},...(m==null?void 0:m.desktopDisplay)==="slider"?{margin:"0px"}:{}},children:s("div",{className:"sprig-container",style:{minHeight:u},children:[v&&s("div",{className:"ul-header__container",dir:"ltr",children:s("div",{className:"ul-header",children:"For development purposes only"})}),h&&s("div",{className:"ul-header__container",dir:"ltr",children:s("div",{className:"ul-header",children:"Preview Mode: Response will not be recorded."})}),P.isLongFormSurvey(x)&&s(go,{}),s("div",{className:F(wi("ul-card-main-content",E)),children:s(Ji,{cards:S,next:O,previousResponses:C})}),!P.isLongFormSurvey(x)&&s(ho,{})]})})})})},Fn=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",yr=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:Fn()};return new MediaRecorder(e,t)},xr=(e,t,r)=>{r[t]=[],e.ondataavailable=function(n){r[t].push(n.data)},e.currentMediaRecordingUid=t,e.start()};function kr(e,t,r,n,i,o){if(e&&e.state!=="inactive"){const{"begin.callback":a}=n,l=e.currentMediaRecordingUid;if(!l)return;a&&a(l),e.onstop=()=>async function(c,d,p,u,f,h,m){const b=A.getState().viewDocument,{"upload.callback":v,"progress.callback":x}=u,y={mediaType:p,updatedAt:new Date().toISOString(),mediaRecordingUid:f,...u["passthrough.data"]},I=await(async(_,E)=>{var D;const N=await fetch(E,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)});if(N.ok){const g=await N.json();return(D=g==null?void 0:g.upload)==null?void 0:D.url}return null})(y,c);if(!I)return void(v&&v(null,{message:"failed to get upload url"}));const L=new Blob(m,{type:Fn()});if(!b.defaultView)return;const k=new b.defaultView.File([L],`recording video ${Date.now()}`),T=h.createUpload({endpoint:I,file:k,chunkSize:5120});T.on("error",_=>{v&&v(null,_)}),T.on("progress",_=>{x&&x(f,_)}),T.on("success",()=>{v&&v(f,!0)})}(t,0,r,n,l,i,o),e.stop()}}const bo={state:{chunks:{}},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:r,screenRecorder:n,UpChunk:i}=this.state,o=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?"video":"audio";this.state.chunks&&t&&i&&(r!=null&&r.currentMediaRecordingUid&&kr(r,t,o,e,i,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]),n!=null&&n.currentMediaRecordingUid&&kr(n,t,"screen",e,i,this.state.chunks[n==null?void 0:n.currentMediaRecordingUid]))},handleCancelledStream(e){const t=e.getVideoTracks(),r=e.getAudioTracks();let n=t.length&&t[0];n=n||r.length&&r[0],n&&n.addEventListener("ended",()=>{[this.state.avRecorder,this.state.screenRecorder].map(i=>{i&&(i.state==="recording"&&i.stop(),i.stream.getTracks().map(o=>{o.readyState==="live"&&o.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("permission.status",this.permissionStatusCallback.bind(this)),e.on("av.permission",async r=>{this.avPermissionCallback(r)}),e.on("begin.recording",this.beginRecordingCallback.bind(this)),e.on("start.task",this.startTaskCallback.bind(this)),e.on("screen.permission",async r=>{this.screenPermissionCallback(r)}),e.on("finish.task",async r=>{this.finishTaskCallback(r)})},async avPermissionCallback(e){var n,i,o;const{"stream.ready":t,"permission.descriptors":r}=e;try{(n=this.state.avStream)!=null&&n.active&&(this.state.avStream.getTracks().map(a=>a.readyState==="live"&&a.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("camera"),audio:!0}),((o=this.state.captureStream)==null?void 0:o.getAudioTracks().length)===0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.avStream)}catch(a){return console.warn("Error: failed to get permissions: "+a),void(t&&t(null,null))}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{"screen.permission.requested":t,"stream.ready.callback":r}=e;t==null||t(!0);try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(n){return t==null||t(!1),console.warn("Error: failed to get permissions: "+n),void(r&&r(null,null))}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),r&&r(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{"recording.media.types":t,"start.recording.callback":r=()=>{}}=e;if(!t)return;const n=[];if(t.includes("video")&&this.state.avStream){this.state.avRecorder=yr(this.state.avStream);const i=P.v4();xr(this.state.avRecorder,i,this.state.chunks),n.push(i)}if(t.includes("screen")&&this.state.captureStream){this.state.screenRecorder=yr(this.state.captureStream);const i=P.v4();xr(this.state.screenRecorder,i,this.state.chunks),n.push(i)}n&&r&&r(n)},async finishTaskCallback(e){const{"current.index":t,"task.response":r,"task.complete.callback":n}=e;await this.stopRecording(e),n&&n(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,r,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var n;const{"permission.status.callback":t}=e,r=this.state.avStream;t&&t(r,!!r&&(r==null?void 0:r.getVideoTracks().length)>0,!!((n=this.state.captureStream)!=null&&n.active),this.state.captureStream)},lookAheadAndStopStream(e,t,r,n){const{avRecorder:i,screenRecorder:o}=this.state,{allResponses:a}=A.getState(),l=pn({cards:r,index:e,hasEndCard:n,allResponses:a});l!==null&&r[l].type==="recordedtask"||[i,o].map(c=>{c&&(c.state==="recording"&&c.stop(),c.stream.getTracks().map(d=>{d.readyState==="live"&&d.stop()}))})}},bt=Object.create(bo);Object.freeze(bt);const vo=({mode:e=null,viewWindow:t,viewDocument:r,trackPageViewUrl:n})=>{const i=r.documentElement;let o;try{o=t.parent.location.href}catch{o=t.location.href}return{mode:e,sw:t.screen.width,sh:t.screen.height,cw:i.clientWidth,ch:i.clientHeight,p:n??o,l:t.navigator.language}},yo={configure:function(e,t=!0){var x;const{answers:r,apiURL:n,endCard:i,eventEmitFn:o,fontFamilyURL:a,frame:l,previewKey:c,viewDocument:d,viewWindow:p}=e,u=P.shouldDirectEmbed(e.headers)?e.frame:d.body,f=e.UpChunk||window.UpChunk,h=P.eventEmitter,m=((y,I)=>{const L=[...y],k=new Set(["videovoice","recordedtask"]);return y.some(T=>k.has(T.type))&&L.push({name:-2,props:{routingOptions:[]},type:"uploading"}),I&&L.push({name:-1,props:{routingOptions:[]},type:"thanks"}),L})(e.cards,!!i);bt.configure(h,{cards:m,hasEndCard:!!i,apiURL:n,UpChunk:f}),A.setState({apiURL:n,answers:r,border:e.border,index:e.startingQuestionIdx||0,cards:m,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:o,fontFamily:e.fontFamily,forceBrandedLogo:e.forceBrandedLogo,frame:l,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:vo({mode:e.mode,viewWindow:p,viewDocument:d,trackPageViewUrl:e.trackPageViewUrl}),mode:e.mode,previewKey:c,previewMode:e.previewMode,productConfig:e.productConfig,recorder:bt,recorderEventEmitter:h,responseGroupUid:e.responseGroupUid,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,styleNonce:e.styleNonce,studyType:e.studyType,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{head:b}=d;if(P.setSurveyStyles({document:d,elementId:"sprig-style",styleString:`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}ol,ul{padding-inline-start:1em}.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)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:start;min-width:200px;justify-content:center;animation:enable-transitions 0s .3s forwards;min-height:0}@keyframes enable-transitions{to{transition:opacity .2s ease-in-out}}.ul-focus-transitions-active .ul-card,.ul-card--with-transitions{transition:opacity .2s ease-in-out}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026;margin:15px}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container--desktop_longFormSurvey,.ul-card__container--mobile_longFormSurvey{margin:0}.sprig-container{display:flex;flex-direction:column;width:100%;height:fit-content;flex:1 1 auto;min-height:0;justify-content:center}.ul-card__container{background:#fff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;padding:0;min-height:0;position:relative;text-align:center;word-break:normal;overflow:auto}.ul-card__container--desktop_feedbackButton{box-shadow:unset}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;display:flex;gap:16px;justify-content:center;align-self:stretch}.sprig-question-footer-container{align-items:center;width:100%;height:fit-content;display:flex;flex-direction:column;padding:12px 20px 0}.long-form-question-footer-container{position:fixed;bottom:0;left:0;width:100%;display:flex;justify-content:space-between;align-items:center;overflow:visible;z-index:1000;pointer-events:none;padding:32px}.long-form-question-footer-container--mobile{background-color:#fff;border-top:1px solid #e6e6e6;padding:16px 24px}.long-form-question-footer-container-center{justify-content:center}.long-form-question-footer-container .long-form-question-footer-container-logo{width:auto;pointer-events:auto}.long-form-question-footer-container-center .long-form-question-footer-container-logo{margin-left:0}.long-form-question-footer-container .long-form-question-footer-container-actions{display:flex;gap:8px;pointer-events:auto}.long-form-question-footer-container .long-form-question-footer-container-actions .long-form-button{display:flex;justify-content:center;align-items:center;gap:8px;padding:12px;border-radius:8px;height:40px;width:40px}.long-form-question-footer-container .long-form-question-footer-container-actions .long-form-button .long-form-button-text-container{display:flex;align-items: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}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:start;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,.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;z-index:2;height:fit-content}.sprig-border-bottom{border-bottom:1px solid rgba(0,0,0,.1)}.sprig-border-top{border-top:1px solid rgba(0,0,0,.1)}.question-header-container{z-index:1}.sprig-header-container{padding:16px}.question-header-button-container{display:grid;grid-template-columns:97fr 3fr;align-items:center;justify-content:space-between;width:100%;height:fit-content}.ul-card--thanks-content .question-header-button-container{justify-content:center}.sprig-question-body{padding:0 20px;min-height:0;flex-shrink:1;overflow:auto;position:relative;align-self:stretch;width:100%}.sprig-stretch{align-self:stretch}.ul-question{color:#343442;display:block;font-size:17px;line-height:125%;font-weight:500;cursor:default;text-align:start}.ul-question ol,.ul-question ul,.ul-caption ol,.ul-caption ul{margin-left:1em}.ul-caption{flex:1 0 auto;font-size:14px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:start;margin-top:4px}.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{align-items:center;display:flex;flex-direction:row;flex:0 0 fit-content;gap:15px;height:fit-content;justify-content:flex-start;width:100%}.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;-webkit-hyphens:auto;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}.select-checkbox{height:16px;width:16px;display:flex;box-sizing:border-box;background-color:"transparent";align-items:center;justify-content:center;border-radius:4px;border:1px solid #b0b5b7;flex-shrink:0}.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}.footer{width:100%;margin-top:12px;font-size:12px;line-height:12px;color:#000000b3}[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{align-self:center;box-shadow:unset;border-radius:unset;border:none!important;position:unset;width:100%}@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;align-self:stretch}.sprig-accordion{width:100%;margin-bottom:8px}.sprig-accordion-body{width:100%;overflow:hidden}.sprig-accordion-header-container{background:transparent;border:none;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;cursor:pointer;margin:8px 0 0;padding:0;font-family:inherit}.sprig-header-label-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;flex:1 1 0}.sprig-header-label{color:#343442;font-size:15px;font-weight:590;line-height:21px;text-align:start;overflow:hidden}.sprig-check-background{flex:0 0 16px;height:16px;width:16px;border-radius:8px;margin-right:8px;background-color:#efefee;display:flex;align-items:center;justify-content:center}.sprig-check{height:9px;width:9px;margin-left:-1px}.sprig-check path{stroke:#506067;stroke-width:1.5}.sprig-caret{height:20px;width:20px;transition-property:transform}.sprig-caret path{stroke:#000}.ul-card-longform__submit-button-container{display:flex;justify-content:flex-end}.ul-card-longform__submit-button-container .ul-card-longform__submit-button{display:flex;flex-direction:row;align-items:center;white-space:nowrap;gap:4px;border-radius:8px;color:#fff;cursor:pointer}.ul-card-longform__submit-button-container .ul-card-longform__submit-button:disabled{opacity:.5;cursor:not-allowed}.ul-card-list-container--longform{display:flex;flex-direction:column;gap:2rem;width:100%;align-items:center;padding-block-start:calc(40vh - 100px);padding-block-end:calc(50vh - 100px);height:auto}@media (min-height: 1200px){.ul-card-list-container--longform{padding-block-start:calc(50vh - 100px)}}.ul-card-scroll-wrapper{width:100%;max-width:100vw;position:relative;display:flex;justify-content:center}.ul-card--unfocused{opacity:.3;transition:opacity .3s ease-in-out}.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:#00000003;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:#fff}.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}.ul-card--likert__numbers>button{padding:unset}.likert-number--mobile{border:2px solid #e6e6e6}.likert-number--mobile:not(:first-child){margin-inline-start:-2px}.likert-number--desktop{border:1px solid #e6e6e6}.likert-number--desktop:not(:first-child){margin-inline-start:-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:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.likert-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-star--mobile:not(:first-child){margin-inline-start:-2px}.likert-star--desktop:not(:first-child){margin-inline-start:-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;background:unset;border:unset}.likert-smiley--mobile:not(:first-child){margin-inline-start:-2px}.likert-smiley--desktop:not(:first-child){margin-inline-start:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px;background:unset;border:unset}.likert-smiley>svg{margin:0 auto}.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{margin-left:auto;flex:1 1 auto;min-width:0;text-align:right}.ul-card--matrix_grid{display:grid;grid-template-columns:max-content repeat(var(--numColumns),minmax(107px,1fr));grid-template-rows:repeat(var(--numRows),min-content);margin:0 auto;row-gap:4px;width:max-content}.ul-card--matrix_grid_longform{width:100%}.ul-matrix-row-options{display:grid;grid-column:2/-1;grid-template-columns:subgrid}.ul-matrix-column-label{font-size:15px;max-width:150px;padding:10px 12px;text-align:center}.ul-card--matrix_container{margin-bottom:16px;overflow:auto}.ul-card--matrix_question_container{display:flex;flex-direction:column}.ul-matrix-scroll-gradient{-webkit-mask-image:linear-gradient(90deg,#000 90%,transparent);mask-image:linear-gradient(90deg,#000 90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl){-webkit-mask-image:linear-gradient(270deg,#000,90%,transparent);mask-image:linear-gradient(270deg,#000,90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl)+.ul-matrix-scroll-arrow{rotate:180deg}.ul-matrix-scroll-arrow{align-self:flex-end;background:none;border:none;color:#000;padding:0;position:absolute;top:45%}.ul-matrix-scroll-arrow:hover{cursor:pointer}.ul-matrix-option-wrapper{align-items:center;background:#f9f9f8;display:flex;justify-content:center;padding:10px 12px}.ul-matrix-last-option{border-start-end-radius:4px;border-end-end-radius:4px}.ul-matrix-row-label{align-items:center;background:#f9f9f8;border-end-start-radius:4px;border-start-start-radius:4px;display:flex;font-size:15px;left:0;right:0;max-width:200px;min-width:100px;padding:10px 12px;position:sticky}.ul-matrix-option-selected{border:6px solid var(--border);box-shadow:none}.ul-card__matrix{max-width:100%}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.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}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid #e6e6e6}.nps-number--desktop:not(:first-child){margin-inline-start:-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;padding:unset}.nps-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.nps-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.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-rank__labels{font-size:14px;font-style:normal;font-weight:600;line-height:150%}.ul-card--rank__question-inner-container{padding:0 16px}.ul-card-rank__list{list-style-type:none;padding-inline-start:0;margin:4px 0}.ul-card-rank__option{display:flex;align-items:center;padding:8px;gap:8px;align-self:stretch;border:1px solid #e2e3e1;border-radius:8px;margin-bottom:4px}.ul-card-rank__option:last-child{margin-bottom:0}.ul-card-rank__drag-btn{display:inline-flex;align-items:center;justify-content:center;line-height:0;padding:0;width:25px;height:25px;margin-left:auto;color:#0b2330;cursor:grab;background:transparent;border:0}.ul-card-rank__drag-btn:active,.ul-card-rank__option:active{cursor:grabbing}.ul-card-rank__option svg{display:block}.ul-card-rank__option.is-dragging{opacity:1;box-shadow:0 8px 25px #00000026,0 3px 10px #0000001a;z-index:1000;background:#fff;border-color:#0b2330;transition:none}.ul-card-rank__option.is-drop-target{background:#0b23301a;border-radius:8px;border-color:#0b23301a}.ul-card-rank__option.is-drop-target select,.ul-card-rank__option.is-drop-target span,.ul-card-rank__option.is-drop-target button{visibility:hidden}.ul-card-rank__option span{font-size:14px;font-weight:400;pointer-events:none}.ul-card-rank__select{appearance:none;-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;height:25px;min-height:25px;border:1px solid #E2E3E1;border-radius:4px;font-size:14px;line-height:1.4;padding:2px 28px 2px 8px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='13' viewBox='0 0 12 13' fill='none'><path d='M9.75 5L6 8.75L2.25 5' stroke='%230B2330' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 8px center;background-size:12px 12px;background-color:#fff;cursor:pointer;pointer-events:auto}.ul-card-rank__select.ul-card-rank__select--placeholder{color:#b0b5b7}.ul-card-text{margin-top:2px;margin-bottom:3px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.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:#00000003;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:#fff}.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;max-width:-webkit-fill-available}#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:#fff;border-radius:5px;text-align:start;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:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:#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:15px;justify-content:center;flex-direction:column}.select-button{align-items:center;background-color:transparent;border-radius:8px;border:1px solid #0b2330;box-shadow:0 0 0 2px #c8cccc;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:#f3f3f3}.select-button:active{background-color:#eee}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:#fff;border:1px solid #E2E3E1;box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:scroll;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:16px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:#f3f3f3}.ul-card-maxdiff__labels-row{display:flex;justify-content:space-between;margin-bottom:8px;column-gap:50%}@media (max-width: 600px){.ul-card-maxdiff__labels-row{column-gap:30%}}.ul-card-maxdiff__label{font-weight:600;text-align:center;margin:auto;flex:1;padding:8px;overflow:auto;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto}.ul-card-maxdiff__label-spacer{flex:6}.ul-card-maxdiff .ul-question{text-align:center}.ul-card-maxdiff__option-row{display:flex;justify-content:space-between;margin-bottom:8px;padding:0 24px}.ul-card-maxdiff__option-label{flex:6;align-self:center;padding:12px;text-align:center}.ul-card-maxdiff__option-control.smiley{display:flex;justify-content:center;align-items:center;flex:1;padding:12px;border-radius:none;border:none;background:none;cursor:pointer}.ul-card-maxdiff__option-control .choice-label-container{justify-content:center}.ul-card-maxdiff p.ul-caption{text-align:center}.ul-card-maxdiff .question-header-button-container{display:flex;justify-content:center}.ul-card-maxdiff__option-selected{border-radius:100px}.ul-card-maxdiff__option-selected.good{background:#90ee90}.ul-card-maxdiff__option-selected.bad{background:#f08080}.ul-card-maxdiff__option-btn{width:42px;height:42px;justify-content:center;align-items:center}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}form{margin-block-end:0;margin-block-start:0}#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;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;margin-top:auto;flex-grow:0;width:100%;min-height:10px;height:fit-content;flex-shrink:0}.ul-footer>.yellow-footer-logo{background:#fad133;border:1px solid #f9c600;border-radius:14px;padding:6px 12px}.ul-footer>.yellow-footer-logo:hover{background:#f9c600}.ul-footer .thank-you-card-link{background:#00000003;border:1px solid #e6e6e6;border-radius:8px;cursor:pointer;display:inline-flex;font-size:14px;gap:12px;margin-bottom:15px;padding:12px;text-align:initial;width:280px}.ul-footer .thank-you-card-link:hover{background:#00000008}.ul-footer>a{color:inherit}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.sprig-box-logo{background:#f9c600;border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%;height:0}.close-btn{cursor:pointer;height:16px;margin-inline-end:-10px;position:relative;top:-10px;width:16px;z-index:1;align-self:flex-start;justify-self:end;flex-shrink:0}.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}.ul-progress-bar-container__footer{max-width:250px;margin:16px 0}.ul-progress-bar-container__header{position:fixed;top:80px;max-width:unset;margin:0;z-index:3}.ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{align-self:stretch;background:#00000003;border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:0;height:fit-content;line-height:16.5px;margin:0 20px;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}`}),e.customStyles&&P.setSurveyStyles({document:d,elementId:"ul-custom-style",styleString:e.customStyles,nonce:e.styleNonce}),e.fontFamily&&a&&parent){const y=d.createElement("link");y.rel="stylesheet",y.href=a,b.appendChild(y)}const v=o||((x=l.eventEmitter)==null?void 0:x.emit);v==null||v("verify.view.version",{"view.version":"2.38.1"}),u&&t&&(Le(s(_o,{}),u),P.eventEmitter.once(P.SprigEvent.SurveyClosed,()=>{Lt(u)}))}};exports.default=yo;
package/package.json CHANGED
@@ -30,5 +30,5 @@
30
30
  ],
31
31
  "author": "Sprig",
32
32
  "license": "SEE LICENSE IN LICENSE.md",
33
- "version": "2.37.0"
33
+ "version": "2.38.1"
34
34
  }