posthog-js 1.429.2 → 1.429.3

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.
Files changed (61) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.js.map +1 -1
  11. package/dist/array.no-external.js +1 -1
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/conversations.js +1 -1
  14. package/dist/customizations.d.ts +2 -0
  15. package/dist/customizations.full.js +1 -1
  16. package/dist/customizations.js +1 -1
  17. package/dist/dead-clicks-autocapture.js +1 -1
  18. package/dist/default-extensions.js +1 -1
  19. package/dist/default-extensions.js.map +1 -1
  20. package/dist/exception-autocapture.js +1 -1
  21. package/dist/extension-bundles.js +1 -1
  22. package/dist/extension-bundles.js.map +1 -1
  23. package/dist/lazy-recorder.js +1 -1
  24. package/dist/main.d.ts +2 -0
  25. package/dist/main.js +1 -1
  26. package/dist/main.js.map +1 -1
  27. package/dist/module.d.ts +2 -0
  28. package/dist/module.full.d.ts +2 -0
  29. package/dist/module.full.js +1 -1
  30. package/dist/module.full.js.map +1 -1
  31. package/dist/module.full.no-external.d.ts +2 -0
  32. package/dist/module.full.no-external.js +1 -1
  33. package/dist/module.full.no-external.js.map +1 -1
  34. package/dist/module.js +1 -1
  35. package/dist/module.js.map +1 -1
  36. package/dist/module.mjs +1 -1
  37. package/dist/module.mjs.map +1 -1
  38. package/dist/module.no-external.d.ts +2 -0
  39. package/dist/module.no-external.js +1 -1
  40. package/dist/module.no-external.js.map +1 -1
  41. package/dist/module.slim.js +1 -1
  42. package/dist/module.slim.js.map +1 -1
  43. package/dist/module.slim.no-external.d.ts +2 -0
  44. package/dist/module.slim.no-external.js +1 -1
  45. package/dist/module.slim.no-external.js.map +1 -1
  46. package/dist/posthog-recorder.js +1 -1
  47. package/dist/product-tours.js +1 -1
  48. package/dist/src/extensions/surveys.d.ts +2 -0
  49. package/dist/surveys-preview.js.map +1 -1
  50. package/dist/surveys.d.ts +2 -0
  51. package/dist/surveys.js +1 -1
  52. package/dist/surveys.js.map +1 -1
  53. package/lib/package.json +1 -1
  54. package/lib/src/extensions/surveys.d.ts +2 -0
  55. package/lib/src/extensions/surveys.js +18 -1
  56. package/lib/src/extensions/surveys.js.map +1 -1
  57. package/lib/src/feature-flags-config.js +5 -5
  58. package/lib/src/feature-flags-config.js.map +1 -1
  59. package/lib/src/posthog-core.js +3 -7
  60. package/lib/src/posthog-core.js.map +1 -1
  61. package/package.json +4 -4
package/dist/surveys.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var e,t,r,n,o,i,s,u,a,l,c,d,p,v,h,f,y,b,m,g={},w=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,k=Array.isArray;function S(e,t){for(var r in t)e[r]=t[r];return e}function C(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function q(t,r,n){var o,i,s,u={};for(s in r)"key"==s?o=r[s]:"ref"==s?i=r[s]:u[s]=r[s];if(arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===u[s]&&(u[s]=t.defaultProps[s]);return _(t,u,o,i,null)}function _(e,n,o,i,s){var u={type:e,props:n,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++r:s,__i:-1,__u:0};return null==s&&null!=t.vnode&&t.vnode(u),u}function T(e){return e.children}function P(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?$(e):null}function M(e){if(e.__P&&e.__d){var r=e.__v,n=r.__e,o=[],i=[],s=S({},r);s.__v=r.__v+1,t.vnode&&t.vnode(s),Z(e.__P,s,r,e.__n,e.__P.namespaceURI,32&r.__u?[n]:null,o,null==n?$(r):n,!!(32&r.__u),i),s.__v=r.__v,s.__.__k[s.__i]=s,R(o,s,i),r.__e=r.__=null,s.__e!=n&&I(s)}}function I(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),I(e)}function N(e){(!e.__d&&(e.__d=!0)&&n.push(e)&&!H.__r++||o!=t.debounceRendering)&&((o=t.debounceRendering)||i)(H)}function H(){try{for(var e,t=1;n.length;)n.length>t&&n.sort(s),e=n.shift(),t=n.length,M(e)}finally{n.length=H.__r=0}}function L(e,t,r,n,o,i,s,u,a,l,c){var d,p,v,h,f,y,b,m=n&&n.__k||w,x=t.length;for(a=B(r,t,m,a,x),d=0;x>d;d++)null!=(v=r.__k[d])&&(p=-1!=v.__i&&m[v.__i]||g,v.__i=d,y=Z(e,v,p,o,i,s,u,a,l,c),h=v.__e,v.ref&&p.ref!=v.ref&&(p.ref&&z(p.ref,null,v),c.push(v.ref,v.__c||h,v)),null==f&&null!=h&&(f=h),(b=!!(4&v.__u))||p.__k===v.__k?(a=D(v,a,e,b),b&&p.__e&&(p.__e=null)):"function"==typeof v.type&&void 0!==y?a=y:h&&(a=h.nextSibling),v.__u&=-7);return r.__e=f,a}function B(e,t,r,n,o){var i,s,u,a,l,c=r.length,d=c,p=0;for(e.__k=new Array(o),i=0;o>i;i++)null!=(s=t[i])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[i]=_(null,s,null,null,null):k(s)?s=e.__k[i]=_(T,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[i]=_(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,a=i+p,s.__=e,s.__b=e.__b+1,u=null,-1!=(l=s.__i=F(s,r,a,d))&&(d--,(u=r[l])&&(u.__u|=2)),null==u||null==u.__v?(-1==l&&(o>c?p--:c>o&&p++),"function"!=typeof s.type&&(s.__u|=4)):l!=a&&(l==a-1?p--:l==a+1?p++:(l>a?p--:p++,s.__u|=4))):e.__k[i]=null;if(d)for(i=0;c>i;i++)null!=(u=r[i])&&!(2&u.__u)&&(u.__e==n&&(n=$(u)),U(u,u));return n}function D(e,t,r,n){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&o.length>i;i++)o[i]&&(o[i].__=e,t=D(o[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=$(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function F(e,t,r,n){var o,i,s,u=e.key,a=e.type,l=t[r],c=null!=l&&!(2&l.__u);if(null===l&&null==u||c&&u==l.key&&a==l.type)return r;if(n>(c?1:0))for(o=r-1,i=r+1;o>=0||t.length>i;)if(null!=(l=t[s=0>o?i++:o--])&&!(2&l.__u)&&u==l.key&&a==l.type)return s;return-1}function V(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||x.test(t)?r:r+"px"}function E(e,t,r,n,o){var i,s;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||V(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||V(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(c,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r[l]=n[l]:(r[l]=d,e.addEventListener(t,i?v:p,i)):e.removeEventListener(t,i?v:p,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function j(e){return function(r){if(this.l){var n=this.l[r.type+e];if(null==r[a])r[a]=d++;else if(n[l]>r[a])return;return n(t.event?t.event(r):r)}}}function Z(e,r,n,o,i,s,u,a,l,c){var d,p,v,h,f,y,b,m,g,x,$,q,_,M,I,N,H=r.type;if(void 0!==r.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[a=r.__e=n.__e]),(d=t.__b)&&d(r);e:if("function"==typeof H){p=u.length;try{if(g=r.props,x=H.prototype&&H.prototype.render,$=(d=H.contextType)&&o[d.__c],q=d?$?$.props.value:d.__:o,n.__c?m=(v=r.__c=n.__c).__=v.__E:(x?r.__c=v=new H(g,q):(r.__c=v=new P(g,q),v.constructor=H,v.render=G),$&&$.sub(v),v.state||(v.state={}),v.__n=o,h=v.__d=!0,v.__h=[],v._sb=[]),x&&null==v.__s&&(v.__s=v.state),x&&null!=H.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=S({},v.__s)),S(v.__s,H.getDerivedStateFromProps(g,v.__s))),f=v.props,y=v.state,v.__v=r,h)x&&null==H.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),x&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(x&&null==H.getDerivedStateFromProps&&g!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(g,q),r.__v==n.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(g,v.__s,q)){r.__v!=n.__v&&(v.props=g,v.state=v.__s,v.__d=!1),r.__e=n.__e,r.__k=n.__k,r.__k.some(function(e){e&&(e.__=r)}),w.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&u.push(v);break e}null!=v.componentWillUpdate&&v.componentWillUpdate(g,v.__s,q),x&&null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(f,y,b)})}if(v.context=q,v.props=g,v.__P=e,v.__e=!1,_=t.__r,M=0,x)v.state=v.__s,v.__d=!1,_&&_(r),d=v.render(v.props,v.state,v.context),w.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,_&&_(r),d=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++M);v.state=v.__s,null!=v.getChildContext&&(o=S(S({},o),v.getChildContext())),x&&!h&&null!=v.getSnapshotBeforeUpdate&&(b=v.getSnapshotBeforeUpdate(f,y)),I=null!=d&&d.type===T&&null==d.key?Q(d.props.children):d,a=L(e,k(I)?I:[I],r,n,o,i,s,u,a,l,c),v.base=r.__e,r.__u&=-161,v.__h.length&&u.push(v),m&&(v.__E=v.__=null)}catch(e){if(u.length=p,r.__v=null,l||null!=s)if(e.then){for(r.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),r.__e=a}else{if(null!=s)for(N=s.length;N--;)C(s[N]);A(r)}else r.__e=n.__e,!r.__k&&n.__k&&(r.__k=n.__k),e.then||A(r);t.__e(e,r,n)}}else null==s&&r.__v==n.__v?(r.__k=n.__k,r.__e=n.__e):a=r.__e=O(n.__e,r,n,o,i,s,u,l,c);return(d=t.diffed)&&d(r),128&r.__u?void 0:a}function A(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(A))}function R(e,r,n){for(var o=0;n.length>o;o++)z(n[o],n[++o],n[++o]);t.__c&&t.__c(r,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(e){e.call(r)})}catch(e){t.__e(e,r.__v)}})}function Q(e){return"object"!=typeof e||null==e||e.__b>0?e:k(e)?e.map(Q):void 0!==e.constructor?null:S({},e)}function O(r,n,o,i,s,u,a,l,c){var d,p,v,h,f,y,b,m=o.props||g,w=n.props,x=n.type;if("svg"==x?s="http://www.w3.org/2000/svg":"math"==x?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=u)for(d=0;u.length>d;d++)if((f=u[d])&&"setAttribute"in f==!!x&&(x?f.localName==x:3==f.nodeType)){r=f,u[d]=null;break}if(null==r){if(null==x)return document.createTextNode(w);r=document.createElementNS(s,x,w.is&&w),l&&(t.__m&&t.__m(n,u),l=!1),u=null}if(null==x)m===w||l&&r.data==w||(r.data=w);else{if(u="textarea"==x&&null!=w.defaultValue?null:u&&e.call(r.childNodes),!l&&null!=u)for(m={},d=0;r.attributes.length>d;d++)m[(f=r.attributes[d]).name]=f.value;for(d in m)f=m[d],"dangerouslySetInnerHTML"==d?v=f:"children"==d||d in w||"value"==d&&"defaultValue"in w||"checked"==d&&"defaultChecked"in w||E(r,d,null,f,s);for(d in w)f=w[d],"children"==d?h=f:"dangerouslySetInnerHTML"==d?p=f:"value"==d?y=f:"checked"==d?b=f:l&&"function"!=typeof f||m[d]===f||E(r,d,f,m[d],s);if(p)l||v&&(p.__html==v.__html||p.__html==r.innerHTML)||(r.innerHTML=p.__html),n.__k=[];else if(v&&(r.innerHTML=""),L("template"==n.type?r.content:r,k(h)?h:[h],n,o,i,"foreignObject"==x?"http://www.w3.org/1999/xhtml":s,u,a,u?u[0]:o.__k&&$(o,0),l,c),null!=u)for(d=u.length;d--;)C(u[d]);l&&"textarea"!=x||(d="value","progress"==x&&null==y?r.removeAttribute("value"):null!=y&&(y!==r[d]||"progress"==x&&!y||"option"==x&&y!=m[d])&&E(r,d,y,m[d],s),d="checked",null!=b&&b!=r[d]&&E(r,d,b,m[d],s))}return r}function z(e,r,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==r||(e.__u=e(r))}else e.current=r}catch(e){t.__e(e,n)}}function U(e,r,n){var o,i;if(t.unmount&&t.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||z(o,null,r)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){t.__e(e,r)}o.base=o.__P=o.__n=null}if(o=e.__k)for(i=0;o.length>i;i++)o[i]&&U(o[i],r,n||"function"!=typeof e.type);n||C(e.__e),e.__c=e.__=e.__e=void 0}function G(e,t,r){return this.constructor(e,r)}function W(r,n,o){var i,s,u,a;n==document&&(n=document.documentElement),t.__&&t.__(r,n),s=(i="function"==typeof o)?null:o&&o.__k||n.__k,u=[],a=[],Z(n,r=(!i&&o||n).__k=q(T,null,[r]),s||g,g,n.namespaceURI,!i&&o?[o]:s?null:n.firstChild?e.call(n.childNodes):null,u,!i&&o?o:s?s.__e:n.firstChild,i,a),R(u,r,a),r.props.children=null}e=w.slice,t={__e(e,t,r,n){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,n||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},r=0,P.prototype.setState=function(e,t){var r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=S({},this.state);"function"==typeof e&&(e=e(S({},r),this.props)),e&&S(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),N(this))},P.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},P.prototype.render=T,n=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(e,t){return e.__v.__b-t.__v.__b},H.__r=0,u=Math.random().toString(8),a="__d"+u,l="__a"+u,c=/(PointerCapture)$|Capture$/i,d=0,p=j(!1),v=j(!0),h=0;var K=0,Y=[],J=t,X=J.__b,ee=J.__r,te=J.diffed,re=J.__c,ne=J.unmount,oe=J.__;function ie(e,t){J.__h&&J.__h(y,e,K||t),K=0;var r=y.__H||(y.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function se(e){return K=1,function(e,t){var r=ie(f++,2);if(r.t=e,!r.__c&&(r.__=[be(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var n=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,s=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),o){var u=o.call(this,e,t,n);return i?u||s:u}return!i||s};y.__f=!0;var o=y.shouldComponentUpdate,i=y.componentWillUpdate;y.componentWillUpdate=function(e,t,r){if(this.__e){var s=o;o=void 0,n(e,t,r),o=s}i&&i.call(this,e,t,r)},y.shouldComponentUpdate=n}return r.__N||r.__}(be,e)}function ue(e,t){var r=ie(f++,3);!J.__s&&ye(r.__H,t)&&(r.__=e,r.u=t,y.__H.__h.push(r))}function ae(e){return K=5,le(function(){return{current:e}},[])}function le(e,t){var r=ie(f++,7);return ye(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ce(e){var t=y.context[e.__c],r=ie(f++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(y)),t.props.value):e.__}function de(){for(var e;e=Y.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(he),t.__h.some(fe),t.__h=[]}catch(r){t.__h=[],J.__e(r,e.__v)}}}J.__b=function(e){y=null,X&&X(e)},J.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),oe&&oe(e,t)},J.__r=function(e){ee&&ee(e),f=0;var t=(y=e.__c).__H;t&&(b===y?(t.__h=[],y.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.length&&de(),f=0)),b=y},J.diffed=function(e){te&&te(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Y.push(t)&&m===J.requestAnimationFrame||((m=J.requestAnimationFrame)||ve)(de)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),b=y=null},J.__c=function(e,t){t.some(function(e){try{e.__h.some(he),e.__h=e.__h.filter(function(e){return!e.__||fe(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],J.__e(r,e.__v)}}),re&&re(e,t)},J.unmount=function(e){ne&&ne(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(e){try{he(e)}catch(e){t=e}}),r.__H=void 0,t&&J.__e(t,r.__v))};var pe="function"==typeof requestAnimationFrame;function ve(e){var t,r=function(){clearTimeout(n),pe&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);pe&&(t=requestAnimationFrame(r))}function he(e){var t=y,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),y=t}function fe(e){var t=y;e.__c=e.__(),y=t}function ye(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function be(e,t){return"function"==typeof t?t(e):t}const me="tab",ge="left",we="center",xe="right",ke="next_to_trigger",Se="popover",Ce="widget",qe="external_survey",_e="open",Te="multiple_choice",Pe="single_choice",$e="rating",Me="end",Ie="always",Ne="$survey_id",He="$survey_name",Le="$survey_iteration",Be="$survey_iteration_start_date",De="$survey_partially_completed",Fe="$survey_submission_id",Ve="$survey_completed",Ee="$survey_language",je="min_length",Ze="max_length",Ae=Object.prototype.toString,Re=Array.isArray||function(e){return"[object Array]"===Ae.call(e)},Qe=e=>"function"==typeof e,Oe=e=>void 0===e,ze=e=>"[object String]"==Ae.call(e),Ue=e=>null===e,Ge=e=>Oe(e)||Ue(e),We=e=>"[object Number]"==Ae.call(e)&&e==e,Ke="Mobile",Ye="Tablet",Je="Android Tablet",Xe="iPad",et="Apple Watch",tt="Nintendo",rt="PlayStation",nt="Xbox",ot="Nokia",it="Ouya",st="Generic "+Ke.toLowerCase(),ut="Generic "+Ye.toLowerCase(),at=new RegExp(nt,"i"),lt=new RegExp("PlayStation \\w+","i"),ct=new RegExp("Nintendo \\w+","i"),dt=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(tt,"i"),new RegExp(rt,"i"),new RegExp("Windows","i");function pt(e){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(e)}function vt(e,t,r){return(t=function(e){var t=function(e){if("object"!=pt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=pt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ht(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ft(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(r),!0).forEach(function(t){vt(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function yt(e,t){if(!e)return;const r=e.find(e=>e.type===t);return null==r?void 0:r.value}const bt="u">typeof window?window:void 0,mt="u">typeof globalThis?globalThis:bt,gt=null==mt?void 0:mt.navigator,wt=null==mt?void 0:mt.document;null!=mt&&mt.XMLHttpRequest&&new mt.XMLHttpRequest;const xt=null==gt?void 0:gt.userAgent,kt=(e,{debugEnabled:t}={})=>{const r={N(r,...n){bt&&(bt.POSTHOG_DEBUG||t)&&!Oe(bt.console)&&bt.console&&("__rrweb_original__"in bt.console[r]?bt.console[r].__rrweb_original__:bt.console[r])(e,...n)},debug(...e){r.N("debug",...e)},info(...e){r.N("log",...e)},warn(...e){r.N("warn",...e)},error(...e){r.N("error",...e)},critical(...t){console.error(e,...t)},uninitializedWarning(e){r.error(`You must initialize PostHog before calling ${e}`)},createLogger:(t,r)=>kt(`${e} ${t}`,r)};return r},St=kt("[PostHog.js]"),Ct=St.createLogger;function qt(e,t,r,n){const{capture:o=!1,passive:i=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:o,passive:i})}function _t(e){return`$survey_response_${e}`}function Tt(e,t){if(!t)return null;const r=e[_t(t)];return Re(r)?[...r]:r}function Pt(e={},t,r){const n={};return t.questions.forEach(t=>{if(Oe(t.originalQuestionIndex))return;const r=0===(o=t.originalQuestionIndex)?"$survey_response":`$survey_response_${o}`;var o;const i=Tt(e,t.id);Oe(i)||(n[r]=i)}),ft(ft({$survey_questions:t.questions.map(t=>{var n,o;return{id:t.id,question:null!==(n=null==r?void 0:r[null!==(o=t.id)&&void 0!==o?o:""])&&void 0!==n?n:t.question,response:Tt(e,t.id)}})},e),n)}function $t(e={}){return Object.values(e).some(e=>!Ge(e))}function Mt(e,t){let r=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(r=`$survey_${t}/${e.id}/${e.current_iteration}`),r}function It(e){return"string"==typeof e&&e.trim()?e.trim():null}function Nt(e){return e.toLowerCase()}function Ht(e,t,r){if(!e||!t)return null;const n=Nt(t),o=Object.keys(e).find(e=>Nt(e)===n);if(o)return null==r||r.debug(`Found exact translation match: ${o}`),o;if(n.includes("-")){const o=n.split("-")[0],i=Object.keys(e).find(e=>Nt(e)===o);if(i)return null==r||r.debug(`Found base language translation match: ${i} (from ${t})`),i}return null}const Lt=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Bt(e,t,r){var n;const o=Ht(e.translations,t,r),i=ft({},e);let s=!1;if(o){var u;const t=null===(u=e.translations)||void 0===u?void 0:u[o];if(t)if(null==r||r.info(`Applying survey-level translation for language: ${o}`),Oe(t.name)||(i.name=t.name,s=!0),i.appearance){const e=ft({},i.appearance);for(const r of Lt){const n=t[r];Oe(n)||(e[r]=n,s=!0)}i.appearance=e}else(function(e){return Lt.some(t=>!Oe(e[t]))})(t)&&(s=!0)}const a=e.questions.map(e=>function(e,t,r){var n;const o=Ht(e.translations,t,r);if(!o)return{question:e,matchedKey:null,hasChanges:!1};const i=null===(n=e.translations)||void 0===n?void 0:n[o];if(!i)return{question:e,matchedKey:null,hasChanges:!1};const s=ft({},e);let u=!1;return Oe(i.question)||(s.question=i.question,u=!0),Oe(i.description)||(s.description=i.description,u=!0),Oe(i.buttonText)||(s.buttonText=i.buttonText,u=!0),"link"in s&&!Oe(i.link)&&(s.link=i.link,u=!0),"lowerBoundLabel"in s&&!Oe(i.lowerBoundLabel)&&(s.lowerBoundLabel=i.lowerBoundLabel,u=!0),"upperBoundLabel"in s&&!Oe(i.upperBoundLabel)&&(s.upperBoundLabel=i.upperBoundLabel,u=!0),"choices"in s&&function(e){return Re(e.choices)}(i)&&(s.choices=i.choices,u=!0),{question:u?s:e,matchedKey:u?o:null,hasChanges:u}}(e,t,r)),l=a.map(e=>e.question),c=a.some(e=>e.hasChanges);let d=null;return o||(d=(null===(n=a.find(e=>e.matchedKey))||void 0===n?void 0:n.matchedKey)||null),c&&(i.questions=l,s=!0,null==r||r.info(`Applied question-level translations for language: ${t}`)),{survey:i,matchedKey:s?o||d:null}}function Dt(e){var t;return!!(null===(t=e.conditions)||void 0===t||null===(t=t.events)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)}const Ft=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},Vt=e=>e.toLowerCase(),Et={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>Ft(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Ft(t,e))),icontains:(e,t)=>t.map(Vt).some(t=>e.map(Vt).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(Vt).every(t=>e.map(Vt).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{const r=parseFloat(t);return!isNaN(r)&&e.some(e=>r>parseFloat(e))}),lt:(e,t)=>t.some(t=>{const r=parseFloat(t);return!isNaN(r)&&e.some(e=>r<parseFloat(e))})},jt=Ct("[Surveys]");function Zt(e){return Qe(e.is_capturing)?e.is_capturing():!e.has_opted_out_capturing()}const At=(e,t)=>`${e}${function(e){return e.current_iteration&&e.current_iteration>0?`${e.id}_${e.current_iteration}`:e.id}(t)}`,Rt=e=>At("seenSurvey_",e),Qt=e=>{try{const t=Rt(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){jt.error("Failed to persist survey seen state",e)}},Ot=[Se,Ce,"api"],zt="$surveys";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return We(e)&&isFinite(e)&&Math.floor(e)===e});var Ut=class e{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,r,n,o){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(o)||0>t||0>r||0>n||0>o||t>0xffffffffffff||r>4095||n>1073741823||o>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/256,i[5]=t,i[6]=112|r>>>8,i[7]=r,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=o>>>24,i[13]=o>>>16,i[14]=o>>>8,i[15]=o,new e(i)}toString(){let e="";for(let t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;16>t;t++){const r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}},Gt=class{generate(){const e=this.generateOrAbort();if(!Oe(e))return e;{this.Ct=0;const e=this.generateOrAbort();if(Oe(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const e=(()=>{const e=Date.now();return We(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return Ut.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new Kt}};let Wt=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};bt&&!Oe(bt.crypto)&&crypto.getRandomValues&&(Wt=e=>crypto.getRandomValues(e));var Kt=class{nextUint32(){return this.Rt.length>this.$t||(Wt(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let Yt;const Jt=()=>Xt().toString(),Xt=()=>(Yt||(Yt=new Gt)).generate();let er=null;const tr={Et(){if(!Ue(er))return er;let e=!0;if(Oe(bt))e=!1;else try{const t="__mplssupport__";tr.At(t,"xyz"),'"xyz"'!==tr.Ot(t)&&(e=!1),tr.Lt(t)}catch(t){e=!1}return e||St.error("localStorage unsupported; falling back to cookie store"),er=e,e},Pt(e){St.error("localStorage error: "+e)},Ot(e){try{return null==bt?void 0:bt.localStorage.getItem(e)}catch(e){tr.Pt(e)}return null},Dt(e){try{return JSON.parse(tr.Ot(e))||{}}catch(e){}return null},At(e,t){try{return null==bt||bt.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){tr.Pt(e)}return!1},Lt(e){try{null==bt||bt.localStorage.removeItem(e)}catch(e){tr.Pt(e)}}},rr=Ct("[Stylesheet Loader]"),nr=bt,or=wt,ir="#020617",sr={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:xe,widgetType:me,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:ir,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},ur=[we,ge,xe];function ar(e){if(e.startsWith("#")){let t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?`rgb(${parseInt(t.slice(0,2),16)},${parseInt(t.slice(2,4),16)},${parseInt(t.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function lr(e=sr.backgroundColor){let t;"#"===e[0]&&(t=ar(e)),e.startsWith("rgb")&&(t=e);const r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=ar(r)),!t)return ir;const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){const e=parseInt(n[1]),t=parseInt(n[2]),r=parseInt(n[3]);return Math.sqrt(e*e*.299+t*t*.587+r*r*.114)>127.5?ir:"white"}return ir}const cr=(e,t,r)=>{const n=Mr(e),o=or.querySelector(`.${n}`);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};const i=or.createElement("div");((e,t,r)=>{const n=ft(ft({},sr),r),o=e.style,i=!ur.includes(n.position)||t===Ce&&(null==r?void 0:r.widgetType)===me;o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";const t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?`${e}, ${t}`:`-apple-system, ${t}`}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),i?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",`${n.borderRadius} ${n.borderRadius} 0 0`)),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||lr(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",lr(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||lr(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",lr(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);const s=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor);let u=s||n.inputBackground;s||"white"!==n.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);const a=(null==r?void 0:r.inputTextColor)||lr(u);o.setProperty("--ph-survey-input-text-color",a),o.setProperty("--ph-survey-rating-text-color",a),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(i,e.type,e.appearance),i.className=n;const s=i.attachShadow({mode:"open"}),u=function(e){const t=((e,t,r)=>{let n=e.createElement("style");n.innerText=t;const o=(e=>{var t;return Qe(e)?e:null==e||null===(t=e.config)||void 0===t?void 0:t.prepare_external_dependency_stylesheet})(r);return o&&(n=o(n)),n||(rr.error("prepare_external_dependency_stylesheet returned null"),null)})(or,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(u){const e=s.querySelector("style");e&&s.removeChild(e),s.appendChild(u)}return(r||or.body).appendChild(i),{shadow:s,isNewlyCreated:!0}},dr=({responses:e,survey:t,surveySubmissionId:r,posthog:n,isSurveyCompleted:o,properties:i,surveyLanguage:s,questionSnapshots:u})=>{var a;n?Zt(n)&&(Qt(t),n.capture("survey sent",ft(ft(ft(ft({[He]:t.name,[Ne]:t.id,[Le]:t.current_iteration,[Be]:t.current_iteration_start_date,[Fe]:r,[Ve]:o},s&&{[Ee]:s}),{},{sessionRecordingUrl:null===(a=n.get_session_replay_url)||void 0===a?void 0:a.call(n)},Pt(e,t,u)),i),{},{$set:{[Mt(t,"responded")]:!0}})),o&&(nr.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:t.id}})),$r(t),n.reloadFeatureFlags())):jt.error("[survey sent] event not captured, PostHog instance not found.")},pr=(e,t,r)=>{var n;return ft(ft({[He]:e.name,[Ne]:e.id,[Le]:e.current_iteration,[Be]:e.current_iteration_start_date,[De]:$t(null==t?void 0:t.responses)},(null==t?void 0:t.surveyLanguage)&&{[Ee]:t.surveyLanguage}),{},{sessionRecordingUrl:null===(n=r.get_session_replay_url)||void 0===n?void 0:n.call(r),[Fe]:null==t?void 0:t.surveySubmissionId},Pt(null==t?void 0:t.responses,e,null==t?void 0:t.questionSnapshots))},vr=(e,t,r,n)=>{if(!t)return void jt.error("[survey dismissed] event not captured, PostHog instance not found.");if(r)return;const o=Tr(e),i=o?o.surveyLanguage:n;t.capture("survey dismissed",ft(ft(ft({},pr(e,o,t)),i&&{[Ee]:i}),{},{$set:{[Mt(e,"dismissed")]:!0}})),$r(e),Qt(e),nr.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))},hr=(e,t)=>{if(!t)return void jt.error("[survey abandoned] event not captured, PostHog instance not found.");const r=(e=>At("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}const n=Tr(e);if(n){try{localStorage.setItem(r,"true")}catch(e){}t.capture("survey abandoned",pr(e,n,t),{transport:"sendBeacon"})}},fr=e=>e.map(e=>({sort:Math.floor(10*Math.random()),value:e})).sort((e,t)=>e.sort-t.sort).map(e=>e.value),yr=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r])?t.reverse():t,br=e=>{const t=e.map(e=>e.id);return t.every(e=>!!e)?t:void 0},mr=(e,t)=>{return(e=>e.questions.some(e=>{var t;return!!(null===(t=e.branching)||void 0===t?void 0:t.type)}))(e)?e.questions:t?null!==(r=((e,t)=>{if(!t||t.length!==e.questions.length)return null;const r=new Map(e.questions.map(e=>[e.id,e])),n=[];for(const e of t){const t=r.get(e);if(!t)return null;n.push(t)}return n})(e,t.questionOrder))&&void 0!==r?r:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?yr(e.questions,fr(e.questions)):e.questions;var r},gr=e=>function(e){var t;return Dt(e)&&!!(null===(t=e.conditions)||void 0===t||null===(t=t.events)||void 0===t?void 0:t.repeatedActivation)||"always"===e.schedule}(e)||Pr(e),wr=function(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(function(e){e.__e=!0,N(e)})},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+h++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),xr=()=>ce(wr),kr=({component:t,children:r,renderAsHtml:n,style:o})=>function(t,r,n){var o,i,s,u,a=S({},t.props);for(s in t.type&&t.type.defaultProps&&(u=t.type.defaultProps),r)"key"==s?o=r[s]:"ref"==s?i=r[s]:a[s]=void 0===r[s]&&null!=u?u[s]:r[s];return arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):n),_(t.type,a,o||t.key,i||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:r},style:o}:{children:r,style:o});function Sr(e,t){var r,n;if(!(null===(r=e.conditions)||void 0===r?void 0:r.url))return!0;const o=function(e){var t;const r=null==bt||null===(t=bt.location)||void 0===t?void 0:t.href;return Oe(r)?void 0:function(e,t){var r;const n=null==e||null===(r=e.config)||void 0===r?void 0:r.get_current_url;if(!Qe(n))return t;try{const e=n(t);return ze(e)&&e?e:t}catch(e){return St.error("Error in get_current_url, falling back to window.location.href",e),t}}(e,r)}(t);if(!o)return!1;const i=[e.conditions.url],s=function(e){return null!=e?e:"icontains"}(null===(n=e.conditions)||void 0===n?void 0:n.urlMatchType);return Et[s](i,[o])}function Cr(e){var t,r;return function(e,t){var r,n,o;if(!e||0===e.length)return!0;if(!xt)return!1;const i=function(e,t){var r;const n=function(e){return ct.test(e)?tt:lt.test(e)?rt:at.test(e)?nt:new RegExp(it,"i").test(e)?it:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?"Windows Phone":/iPad/.test(e)?Xe:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?et:dt.test(e)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ot,"i").test(e)?ot:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Ke).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?"Android":Je:new RegExp("(pda|Mobile)","i").test(e)?st:new RegExp(Ye,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?ut:""}(e);return n===Xe||n===Je||"Kobo"===n||"Kindle Fire"===n||n===ut?Ye:n===tt||n===nt||n===rt||n===it?"Console":n===et?"Wearable":n?Ke:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(o=null==t?void 0:t.screenWidth)&&void 0!==o?o:0,null!==(i=null==t?void 0:t.screenHeight)&&void 0!==i?i:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?Ke:Ye:"Desktop";var o,i,s}(xt,{userAgentDataPlatform:null==gt||null===(r=gt.userAgentData)||void 0===r?void 0:r.platform,maxTouchPoints:null==gt?void 0:gt.maxTouchPoints,screenWidth:null==bt||null===(n=bt.screen)||void 0===n?void 0:n.width,screenHeight:null==bt||null===(o=bt.screen)||void 0===o?void 0:o.height,devicePixelRatio:null==bt?void 0:bt.devicePixelRatio});return Et[null!=t?t:"icontains"](e,[i])}(null===(t=e.conditions)||void 0===t?void 0:t.deviceTypes,null===(r=e.conditions)||void 0===r?void 0:r.deviceTypesMatchType)}const qr=e=>At("inProgressSurvey_",e),_r=(e,t)=>{try{localStorage.setItem(qr(e),JSON.stringify(t))}catch(e){jt.error("Error setting in-progress survey state in localStorage",e)}},Tr=e=>{try{const t=localStorage.getItem(qr(e));if(t)return JSON.parse(t)}catch(e){jt.error("Error getting in-progress survey state from localStorage",e)}return null},Pr=e=>{const t=Tr(e);return!Ge(null==t?void 0:t.surveySubmissionId)},$r=e=>{try{localStorage.removeItem(qr(e))}catch(e){jt.error("Error clearing in-progress survey state from localStorage",e)}};function Mr(e,t=!1){const r=`PostHogSurvey-${e.id}`;return t?`.${r}`:r}function Ir(e,t=xe,r){if(e===qe)return{};switch(t){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case ge:return{left:"30px"};case we:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Ce&&r===me?"60px":"30px"}}}var Nr=0;function Hr(e,r,n,o,i,s){r||(r={});var u,a,l=r;if("ref"in l)for(a in l={},r)"ref"==a?u=r[a]:l[a]=r[a];var c={type:e,props:l,key:n,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nr,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof e&&(u=e.defaultProps))for(a in u)void 0===l[a]&&(l[a]=u[a]);return t.vnode&&t.vnode(c),c}const Lr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Br=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Dr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Vr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Er=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Hr("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),jr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Hr("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Zr=({fill:e="currentColor"}={})=>Hr("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Hr("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Hr("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:e})]}),Ar=Hr("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Hr("g",{"clip-path":"url(#clip0_2415_6911)",children:[Hr("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Hr("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Hr("g",{mask:"url(#mask0_2415_6911)",children:[Hr("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Hr("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Hr("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Hr("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Hr("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Hr("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Hr("defs",{children:Hr("clipPath",{id:"clip0_2415_6911",children:Hr("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Rr({urlParams:e}){const t=e?Object.entries(e).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&"):"";return Hr("a",{href:"https://posthog.com/surveys"+(t?`?${t}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ar]})}function Qr({text:e,submitDisabled:t,appearance:r,onSubmit:n,link:o,onPreviewSubmit:i,skipSubmitButton:s,canGoBack:u,onBack:a}){const{isPreviewMode:l}=ce(wr),c=!!u&&!!a,d=!s&&Hr("button",{className:"form-submit",disabled:t,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==bt||bt.open(o)),l?null==i||i():n()},children:e});return Hr("div",{className:"bottom-section",children:[c?Hr("div",{className:"form-buttons form-buttons-with-back",children:[Hr("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:a,children:r.backButtonText||"Back"}),d]}):d,!r.whiteLabel&&Hr(Rr,{urlParams:{utm_source:"survey-footer"}})]})}function Or({question:e,forceDisableHtml:t,htmlFor:r}){return Hr("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Hr(e.type===_e?"label":"h3",{className:"survey-question",htmlFor:r,children:e.question}),e.description&&kr({component:q("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!t&&"text"!==e.descriptionContentType})]})}function zr({onClick:e}){const{isPreviewMode:t}=ce(wr);return Hr("button",{className:"form-cancel",onClick:e,disabled:t,"aria-label":"Close survey",type:"button",children:Zr({fill:"black"})})}const Ur=bt;function Gr({header:e,description:t,contentType:r,forceDisableHtml:n,appearance:o,onClose:i}){const{isPopup:s}=ce(wr);return ue(()=>{const e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),i())};return qt(Ur,"keydown",e),()=>{Ur.removeEventListener("keydown",e)}},[i]),Hr("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==o.hideCancelButton&&Hr(zr,{onClick:()=>i()}),Hr("h3",{className:"thank-you-message-header",children:e}),t&&kr({component:q("p",{className:"thank-you-message-body"}),children:t,renderAsHtml:!n&&"text"!==r}),s&&Hr(Qr,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>i()})]})}function Wr({header:e,description:t,contentType:r,forceDisableHtml:n,appearance:o,onStart:i}){const{isPopup:s,onPreviewSubmit:u,onPopupSurveyDismissed:a}=ce(wr);return Hr("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==o.hideCancelButton&&Hr(zr,{onClick:()=>a()}),e&&Hr("h3",{className:"intro-screen-header",children:e}),t&&kr({component:q("p",{className:"intro-screen-body"}),children:t,renderAsHtml:!n&&"text"!==r}),Hr(Qr,{text:o.introScreenButtonText||"Get started",submitDisabled:!1,appearance:o,onSubmit:i,onPreviewSubmit:()=>u(null)})]})}const Kr=e=>Re(e)&&e.every(e=>ze(e));function Yr({question:e,forceDisableHtml:t,appearance:r,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:i,initialValue:s,canGoBack:u,onBack:a}){const{isPreviewMode:l}=xr(),c=ae(null),[d,p]=se(()=>ze(s)?s:""),v=null==r?void 0:r.disableAutofocus;ue(()=>{v||setTimeout(()=>{var e;l||null===(e=c.current)||void 0===e||e.focus()},100)},[l,v]);const h=`surveyQuestion${i}`,f=le(()=>function(e,t,r){const n=e.trim();if(!r&&""===n)return"This field is required";if(""===n)return!1;if(t&&t.length>0)for(const e of t)switch(e.type){case je:var o;if(void 0!==e.value&&e.value>n.length)return null!==(o=e.errorMessage)&&void 0!==o?o:`Please enter at least ${e.value} characters`;break;case Ze:var i;if(void 0!==e.value&&n.length>e.value)return null!==(i=e.errorMessage)&&void 0!==i?i:`Please enter no more than ${e.value} characters`}return!1}(d,e.validation,e.optional),[d,e.validation,e.optional]),y=yt(e.validation,je),b=yt(e.validation,Ze),m=le(()=>function(e,t){const r=1===e?void 0:e;return r&&t?`Enter ${r}-${t} characters`:r?`Enter at least ${r} ${1===r?"character":"characters"}`:t?`Maximum ${t} ${1===t?"character":"characters"}`:void 0}(y,b),[y,b]),g=()=>{f||n(d.trim())},w=()=>{f||o(d.trim())};return Hr(T,{children:[Hr("div",{className:"question-container",children:[Hr(Or,{question:e,forceDisableHtml:t,htmlFor:h}),Hr("textarea",{ref:c,id:h,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(e){p(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||f||(e.preventDefault(),l?w():g())},value:d}),m&&Hr("div",{className:"validation-hint",children:m})]}),Hr(Qr,{text:e.buttonText||"Submit",submitDisabled:!!f,appearance:r,onSubmit:g,onPreviewSubmit:w,canGoBack:u,onBack:a})]})}function Jr({question:e,forceDisableHtml:t,appearance:r,onSubmit:n,onPreviewSubmit:o,canGoBack:i,onBack:s}){return Hr(T,{children:[Hr("div",{className:"question-container",children:Hr(Or,{question:e,forceDisableHtml:t})}),Hr(Qr,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked"),canGoBack:i,onBack:s})]})}function Xr({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:o,onPreviewSubmit:i,initialValue:s,canGoBack:u,onBack:a}){var l;const c=e.scale,d=10===e.scale?0:1,[p,v]=se(()=>We(s)?s:Re(s)&&s.length>0&&We(parseInt(s[0]))?parseInt(s[0]):ze(s)&&We(parseInt(s))?parseInt(s):null),h="emoji"===e.display&&2===e.scale,{isPreviewMode:f}=xr(),y=e=>f?i(e):o(e);return Hr(T,{children:[Hr("div",{className:"question-container",children:[Hr(Or,{question:e,forceDisableHtml:t}),Hr("div",{className:"rating-section",children:[Hr("div",{className:"rating-options",children:["emoji"===e.display&&Hr("div",{className:"rating-options-emoji"+(h?" rating-options-emoji-2":""),children:null===(l=sn[e.scale])||void 0===l?void 0:l.map((t,n)=>Hr("button",{"aria-label":`Rate ${n+1}`,className:`ratings-emoji question-${r}-rating-${n} ${n+1===p?"rating-active":""}`,value:n+1,type:"button",onClick(){const t=n+1;v(t),e.skipSubmitButton&&y(t)},children:t},n))}),"number"===e.display&&Hr("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:un(e.scale).map((t,o)=>Hr(en,{displayQuestionIndex:r,active:p===t,appearance:n,num:t,setActiveNumber(t){v(t),e.skipSubmitButton&&y(t)}},o))})]}),!h&&Hr("div",{className:"rating-text",children:[Hr("div",{children:e.lowerBoundLabel}),Hr("div",{children:e.upperBoundLabel})]})]})]}),Hr(Qr,{text:e.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:Ue(p)&&!e.optional,appearance:n,onSubmit:()=>o(p),onPreviewSubmit:()=>i(p),skipSubmitButton:e.skipSubmitButton,canGoBack:u,onBack:a})]})}function en({num:e,active:t,displayQuestionIndex:r,setActiveNumber:n}){return Hr("button",{"aria-label":`Rate ${e}`,className:`ratings-number question-${r}-rating-${e} ${t?"rating-active":""}`,type:"button",onClick(){n(e)},children:e})}function tn({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:o,onPreviewSubmit:i,initialValue:s,canGoBack:u,onBack:a}){const l=ae(null),c=le(()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let r="";e.hasOpenChoice&&(r=t.pop());const n=yr(t,fr(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(e),[e]),[d,p]=se(()=>((e,t)=>ze(e)||Kr(e)?e:t===Pe?null:[])(s,e.type)),[v,h]=se(()=>((e,t)=>{if(ze(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Kr(e)){const r=e.find(e=>!t.includes(e));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:f}=xr(),y=e.type===Pe,b=e.type===Te,m=e.skipSubmitButton&&y&&!e.hasOpenChoice,g=(e,t)=>{if(t){const e=!v.isSelected;return h(t=>ft(ft({},t),{},{isSelected:e,inputValue:e?t.inputValue:""})),y&&p(""),void(e&&setTimeout(()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()},75))}if(y)return p(e),h(e=>ft(ft({},e),{},{isSelected:!1,inputValue:""})),void(m&&(o(e),f&&i(e)));b&&Re(d)&&(d.includes(e)?p(d.filter(t=>t!==e)):p([...d,e]))},w=e=>{e.stopPropagation();const t=e.currentTarget.value;h(e=>ft(ft({},e),{},{inputValue:t})),y&&p(t)},x=e=>{e.stopPropagation(),"Enter"!==e.key||k()||(e.preventDefault(),S()),"Escape"===e.key&&(e.preventDefault(),h(e=>ft(ft({},e),{},{isSelected:!1,inputValue:""})),y&&p(null))},k=()=>!(e.optional||!Ue(d)&&(!Re(d)||v.isSelected||0!==d.length)&&(!v.isSelected||""!==v.inputValue.trim())),S=()=>{v.isSelected&&b?Re(d)&&(f?i([...d,v.inputValue]):o([...d,v.inputValue])):f?i(d):o(d)};return Hr(T,{children:[Hr("div",{className:"question-container",children:[Hr(Or,{question:e,forceDisableHtml:t}),Hr("fieldset",{className:"multiple-choice-options limit-height",children:[Hr("legend",{className:"sr-only",children:b?" Select all that apply":" Select one"}),c.map((t,n)=>{const o=!!e.hasOpenChoice&&n===e.choices.length-1,i=`surveyQuestion${r}Choice${n}`,s=`${i}Open`,u=o?v.isSelected:y?d===t:Re(d)&&d.includes(t);return Hr("label",{className:o?"choice-option-open":"",children:[Hr("div",{className:"response-choice",children:[Hr("input",{type:y?"radio":"checkbox",name:i,checked:u,onChange:()=>g(t,o),id:i,"aria-controls":s}),Hr("span",{children:o?`${t}:`:t})]}),o&&Hr("input",{type:"text",ref:l,id:s,name:`question${r}Open`,value:v.inputValue,onKeyDown:x,onInput:w,onClick(e){v.isSelected||g(t,!0),e.stopPropagation()},"aria-label":`${t} - please specify`})]},n)})]})]}),Hr(Qr,{text:e.buttonText||"Submit",submitDisabled:k(),appearance:n,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:m,canGoBack:u,onBack:a})]})}const rn=[1,2,3,4,5],nn=[1,2,3,4,5,6,7],on=[0,1,2,3,4,5,6,7,8,9,10],sn={2:[Er,jr],3:[Dr,Br,Lr],5:[Fr,Dr,Br,Lr,Vr]};function un(e){switch(e){case 5:default:return rn;case 7:return nn;case 10:return on}}const an=Ct("[Surveys]");function ln(e,t,r){var n;const o=e.questions[t],i=t+1;if(!(null===(n=o.branching)||void 0===n?void 0:n.type))return t===e.questions.length-1?Me:i;if(o.branching.type===Me)return Me;if("specific_question"===o.branching.type){if(Number.isInteger(o.branching.index))return o.branching.index}else if("response_based"===o.branching.type){if(o.type===Pe){var s;let e=o.choices.indexOf(`${r}`);if(-1===e&&o.hasOpenChoice&&(e=o.choices.length-1),null===(s=o.branching)||void 0===s||null===(s=s.responseValues)||void 0===s?void 0:s.hasOwnProperty(e)){const t=o.branching.responseValues[e];return Number.isInteger(t)?t:t===Me?Me:i}}else if(o.type===$e){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");const e=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,o.scale);if(null===(u=o.branching)||void 0===u||null===(u=u.responseValues)||void 0===u?void 0:u.hasOwnProperty(e)){const t=o.branching.responseValues[e];return Number.isInteger(t)?t:t===Me?Me:i}}return i}return an.warn("Falling back to next question index due to unexpected branching type"),i}const cn=Ct("[SurveyTranslations]");function dn(e,t){const r=function(e){return function({overrideLanguage:e,storedPersonProperties:t,locale:r},n){const o=It(e);if(o)return null==n||n.info(`Using override display language: ${o}`),o;const i=function(e){return e&&"object"==typeof e&&"language"in e?It(e.language):null}(t);if(i)return null==n||n.info(`Using person property language: ${i}`),i;const s=It(r);return s?(null==n||n.info(`Using detected locale: ${s}`),s):(null==n||n.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:Qe(e.get_property)?e.get_property("$stored_person_properties"):void 0,locale:navigator.language||navigator.userLanguage},cn)}(t);if(!r)return cn.info("No user language detected"),{survey:e,language:null};const n=Bt(e,r,cn);return{survey:n.survey,language:n.matchedKey}}const pn=bt,vn=wt,hn="ph:show_survey_widget",fn="PHWidgetSurveyClickListener";function yn(e,t){try{const r=e.getBoundingClientRect(),n=pn.innerHeight,o=pn.innerWidth;let i=r.left+r.width/2-t/2;i+t>o-20&&(i=o-t-20),20>i&&(i=20);const s=n-r.bottom,u=250>s&&r.top>s;return{position:"fixed",top:u?"auto":`${r.bottom+12}px`,left:`${i}px`,right:"auto",bottom:u?n-r.top+12+"px":"auto",zIndex:sr.zIndex}}catch(e){return jt.warn("Failed to calculate trigger position:",e),null}}var bn=class{constructor(e){this.wi=new Map,this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Set,this.Mi=null,this.Ii=!1,this.Ti=null,this.Ri=null,this.$i=null,this.handlePageUnload=()=>{const e=this._posthog.get_property(zt);if(e)for(const t of e)Pr(t)&&hr(t,this._posthog)},this.handlePopoverSurvey=(e,t,{resumeDelayFromActivation:r=!1}={})=>{var n,o,i,s,u,a;if(!Zt(this._posthog))return;const{survey:l,language:c}=this.Ei(e);this.Mi=c,this.$i=null,this.Ai=t;const d=this.Oi(l,t);this.Li(d.id);const{properties:p,initialResponses:v}=null!=t?t:{},h=!(!v||0>=Object.keys(v).length)&&this.Pi(d,v,p,c);if(h&&!(null===(n=d.appearance)||void 0===n?void 0:n.displayThankYouMessage))return;this.Di(d);let f={};if((null===(o=d.appearance)||void 0===o?void 0:o.position)===ke&&(null===(i=d.appearance)||void 0===i?void 0:i.widgetSelector)){const e=vn.querySelector(d.appearance.widgetSelector);var y;e&&(f=yn(e,parseInt((null===(y=d.appearance)||void 0===y?void 0:y.maxWidth)||sr.maxWidth))||{})}const b=(null===(s=d.appearance)||void 0===s?void 0:s.surveyPopupDelaySeconds)||0,{shadow:m}=cr(d,this._posthog);this.xi.set(m,m.host);const g={posthog:this._posthog,survey:d,removeSurveyFromFocus:this.Fi,properties:p,style:f,isSurveyCompleted:h,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:c};if(this.$i=g,0>=b)return this.Ii=!0,W(Hr(kn,ft({},g)),m);const w=()=>{this.Ii=!0;const{survey:r,language:n}=this.Ei(e);this.Mi=n;const o=this.Oi(r,t),i=ft(ft({},g),{},{survey:o,surveyLanguage:n});this.$i=i,W(Hr(kn,ft(ft({},i),{},{survey:ft(ft({},o),{},{appearance:ft(ft({},o.appearance),{},{surveyPopupDelaySeconds:0})})})),m)},x=()=>{if(!Zt(this._posthog)||!this.Ni(d))return jt.info(`Survey ${d.id} no longer eligible when its display delay elapsed; not displaying`),this.Fi(d);w()},k=r?null===(u=this._posthog.surveys)||void 0===u||null===(u=u._surveyEventReceiver)||void 0===u||null===(a=u.getActivationTimestamp)||void 0===a?void 0:a.call(u,d.id):void 0,S=We(k)?Math.max(0,Date.now()-k):0,C=Math.max(0,1e3*b-S);if(0>=C)return x();const q=pn.setTimeout(()=>{this.wi.delete(d.id),x()},C);this.wi.set(d.id,q)},this.qi=e=>{var t;const{survey:r,language:n}=this.Ei(e),{shadow:o,isNewlyCreated:i}=cr(r,this._posthog);this.xi.set(o,o.host),(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)===me&&this.Si.set(e.id,e),i&&W(Hr(Cn,{posthog:this._posthog,survey:r,surveyLanguage:n},e.id),o)},this.ji=e=>{const t=this.ki.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(fn),this.ki.delete(e),jt.info(`Removed click listener for survey ${e}`))},this.Bi=e=>{this.Hi(e)||(this.Ui(e),this.ji(e.id))},this.zi=e=>{this.Hi(e)||(this.Ui(e),this.Si.delete(e.id))},this.Hi=e=>{try{var t;const r=vn.querySelector(Mr(e,!0));return!!(null==r||null===(t=r.shadowRoot)||void 0===t?void 0:t.querySelector(".ph-survey"))}catch(e){return!1}},this.Wi=(e,t)=>{const r=vn.querySelector(t),n=this.ki.get(e.id);if(r){if(this.qi(e),n){if(r===n.element)return;jt.info(`Selector element changed for survey ${e.id}. Re-attaching listener.`),this.ji(e.id)}if(!r.hasAttribute(fn)){const t=t=>{var r,n;t.stopPropagation();const o=(null===(r=e.appearance)||void 0===r?void 0:r.position)===ke?yn(t.currentTarget,parseInt((null===(n=e.appearance)||void 0===n?void 0:n.maxWidth)||sr.maxWidth)):{};pn.dispatchEvent(new CustomEvent(hn,{detail:{surveyId:e.id,position:o}}))};qt(r,"click",t),r.setAttribute(fn,"true"),this.ki.set(e.id,{element:r,listener:t,survey:e}),jt.info(`Attached click listener for feedback button survey ${e.id}`)}}else n&&this.Bi(e)},this.renderPopover=e=>{if(!Zt(this._posthog))return;const{survey:t,language:r}=this.Ei(e),{shadow:n}=cr(t,this._posthog);this.xi.set(n,n.host),W(Hr(kn,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Fi,surveyLanguage:r}),n)},this.renderSurvey=(e,t,r)=>{var n;if(!Zt(this._posthog))return;const{survey:o,language:i}=this.Ei(e);let s=!1;(null===(n=this._posthog.config)||void 0===n||null===(n=n.surveys)||void 0===n?void 0:n.prefillFromUrl)&&(s=this.Vi(o,i,r)),W(Hr(kn,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Fi,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:i}),t)},this.getActiveMatchingSurveys=(e,t=!1)=>{var r;null===(r=this._posthog)||void 0===r||null===(r=r.surveys)||void 0===r||r.getSurveys(t=>{e(t.filter(e=>this.Ni(e)))},t)},this.callSurveysAndEvaluateDisplayLogic=(e=!1)=>{this.getActiveMatchingSurveys(e=>{const t=Zt(this._posthog),r=e.filter(e=>t&&(e.type===Se||e.type===Ce)),n=new Set(r.map(e=>e.id));for(const e of Array.from(this.wi.keys()))n.has(e)||this.cancelSurvey(e);const o=this.Zi(r),i=new Set,s=new Set;o.forEach(e=>{if(e.type===Ce){var t,r,n,o;if((null===(t=e.appearance)||void 0===t?void 0:t.widgetType)===me)return s.add(e.id),void this.qi(e);"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&(null===(n=e.appearance)||void 0===n?void 0:n.widgetSelector)&&(i.add(e.id),this.Wi(e,null===(o=e.appearance)||void 0===o?void 0:o.widgetSelector))}Ue(this.Gi)&&e.type===Se&&this.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})}),this.ki.forEach(({survey:e})=>{i.has(e.id)||this.Bi(e)}),this.Si.forEach((e,t)=>{s.has(t)||this.zi(e)})},e)},this.Di=e=>{Ue(this.Gi)||jt.error(`Survey ${this.Gi} already in focus. Cannot add survey ${e.id}.`),this.Gi=e.id},this.Fi=e=>{this.Gi!==e.id&&jt.error(`Survey ${e.id} is not in focus. Cannot remove survey ${e.id}.`),this.Li(e.id),this.Gi=null,this.Mi=null,this.Ii=!1,this.$i=null,this.Ai=void 0,this.Ui(e)},this._posthog=e,this.Gi=null,this.Ti=()=>this.Qi(),qt(pn,"languagechange",this.Ti),this.Ri=e.onFeatureFlags(()=>this.Qi())}Qi(){if(Ue(this.Gi))return;const e=this._posthog.get_property(zt),t=null==e?void 0:e.find(e=>e.id===this.Gi);if(!t)return;const{survey:r,language:n}=this.Ei(t);if(n===this.Mi)return;if(this.Mi=n,!this.Ii)return;const o=this.Oi(r,this.Ai),{shadow:i}=cr(o,this._posthog);W(Hr(kn,ft(ft({},this.$i),{},{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Fi,surveyLanguage:n})),i)}get Ji(){var e,t,r;return null!==(e=null===(t=(r=this._posthog).getExtension)||void 0===t?void 0:t.call(r,"featureFlags"))&&void 0!==e?e:this._posthog.featureFlags}Oi(e,t){return(null==t?void 0:t.position)||(null==t?void 0:t.selector)?ft(ft({},e),{},{appearance:ft(ft(ft({},e.appearance),t.position&&{position:t.position}),t.selector&&{widgetSelector:t.selector})}):e}Li(e){const t=this.wi.get(e);t&&(clearTimeout(t),this.wi.delete(e))}cancelSurvey(e){this.wi.has(e)&&(jt.info(`Cancelled pending survey ${e}`),this.Li(e),this.Gi===e&&(this.Gi=null,this.Mi=null,this.Ii=!1,this.$i=null,this.Ai=void 0))}setAutomaticDisplayDispose(e){this.Ki=e}dispose(){var e;null===(e=this.Ki)||void 0===e||e.call(this),this.Ki=void 0,this.Ti&&(pn.removeEventListener("languagechange",this.Ti),this.Ti=null),this.Ri&&(this.Ri(),this.Ri=null),this.wi.forEach((e,t)=>this.Li(t)),this.ki.forEach((e,t)=>this.ji(t)),this.xi.forEach((e,t)=>{W(null,t),null==e||e.remove()}),this.xi.clear(),this.Si.clear(),this.Gi=null}Zi(e){return e.sort((e,t)=>{var r,n;const o=Pr(e),i=Pr(t);if(o&&!i)return-1;if(!o&&i)return 1;const s=e.schedule===Ie,u=t.schedule===Ie;return s&&!u?1:!s&&u?-1:((null===(r=e.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)-((null===(n=t.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)})}Ei(e){return dn(e,this._posthog)}Vi(e,t,r){if(this.Ci.has(e.id))return!1;const{params:n}=function(e){const t={};let r=!1;const n=e.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:r};const o=n.split("&");for(const e of o){const[n,o]=e.split("=");if(!n||Oe(o))continue;const i=decodeURIComponent(n),s=decodeURIComponent(o);if("auto_submit"===i&&"true"===s){r=!0;continue}const u=i.match(/^q(\d+)$/);if(u){const e=parseInt(u[1],10);t[e]||(t[e]=[]),t[e].push(s)}}return{params:t,autoSubmit:r}}(pn.location.search);if(0===Object.keys(n).length)return!1;jt.info("[Survey Prefill] Detected URL prefill parameters");const o=this.Xi(e,n,t);return!!o&&(this.Yi(e,o,r,t),this.Ci.add(e.id),o.isSurveyCompleted)}Yi(e,t,r,n){const{responses:o,submissionId:i,isSurveyCompleted:s,skippedResponses:u}=t;(Object.keys(u).length>0&&e.enable_partial_responses||s)&&dr({responses:s?o:u,survey:e,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:s,properties:r,surveyLanguage:n})}Pi(e,t,r,n){const o={};for(const[e,r]of Object.entries(t))o[parseInt(e)]=Re(r)?r.map(String):[String(r)];jt.info("[Survey] Processing initial responses");const i=this.Xi(e,o,n);return!!i&&(this.Yi(e,i,r,n),i.isSurveyCompleted)}Xi(e,t,r){try{const n=function(e,t){const r={};return e.questions.forEach((e,n)=>{if(!t[n]||!e.id)return;const o=t[n],i=_t(e.id);try{switch(e.type){case Pe:{if(!e.choices||0===e.choices.length)return void St.warn(`[Survey Prefill] Question ${n} has no choices`);const t=parseInt(o[0],10);if(isNaN(t)||0>t||t>=e.choices.length)return void St.warn(`[Survey Prefill] Invalid choice index for q${n}: ${o[0]}`);r[i]=e.choices[t];break}case Te:{if(!e.choices||0===e.choices.length)return void St.warn(`[Survey Prefill] Question ${n} has no choices`);const t=o.map(e=>parseInt(e,10)).filter(t=>!isNaN(t)&&t>=0&&e.choices.length>t);if(0===t.length)return void St.warn(`[Survey Prefill] No valid choices for q${n}`);const s=[...new Set(t.map(t=>e.choices[t]))];t.length>s.length&&St.warn(`[Survey Prefill] Removed duplicate choices for q${n}`),r[i]=s;break}case $e:{const t=parseInt(o[0],10),s=e.scale||10;if(isNaN(t)||0>t||t>s)return void St.warn(`[Survey Prefill] Invalid rating for q${n}: ${o[0]} (scale: 0-${s})`);r[i]=t;break}default:St.info(`[Survey Prefill] Question type ${e.type} does not support prefill`)}}catch(e){St.error(`[Survey Prefill] Error converting q${n}:`,e)}}),r}(e,t);if(0===Object.keys(n).length)return jt.warn("[Survey Prefill] No valid responses after conversion"),null;const o=Jt(),{startQuestionIndex:i,skippedResponses:s,skippedIndices:u}=function(e,t,r){let n=0;const o={},i=[],s=e.questions.length+1;let u=0;for(;e.questions.length>n&&s>u&&(u++,t.includes(n));){const t=e.questions[n];if(!t||!("skipSubmitButton"in t)||!t.skipSubmitButton)break;if(t.id){const e=_t(t.id);Oe(r[e])||(o[e]=r[e])}i.push(n);const s=ln(e,n,t.id?r[_t(t.id)]:null);if(s===Me)return{startQuestionIndex:e.questions.length,skippedResponses:o,skippedIndices:i};n=s}return{startQuestionIndex:n,skippedResponses:o,skippedIndices:i}}(e,Object.keys(t).map(e=>parseInt(e,10)),n),a=i>=e.questions.length;return _r(e,{surveySubmissionId:o,responses:n,lastQuestionIndex:i,questionOrder:br(e.questions),visitedIndices:u,surveyLanguage:r}),jt.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:n,submissionId:o,startQuestionIndex:i,isSurveyCompleted:a,skippedResponses:s}}catch(e){return jt.error("[Survey Prefill] Error handling prefill:",e),null}}tr(e,t=void 0){if(!e)return!0;const r=this.Ji,n=!!(null==r?void 0:r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}));let o=!0;return t&&(o=(null==r?void 0:r.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&o}er(e){return!e.conditions||Sr(e,this._posthog)&&Cr(e)&&function(e){var t;return!(null===(t=e.conditions)||void 0===t?void 0:t.selector)||!!(null==or?void 0:or.querySelector(e.conditions.selector))}(e)}nr(e){var t;return gr(e)?{satisfied:!0}:e.internal_targeting_flag_key&&function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)&&!(null===(t=this.Ji)||void 0===t?void 0:t.hasLoadedFlags)?{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}:{satisfied:this.tr(e.internal_targeting_flag_key)}}checkSurveyEligibility(e){var t,r;const n={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return n.eligible=!1,n.reason=`Survey is not running. It was completed on ${e.end_date}`,n;if(!Ot.includes(e.type))return n.eligible=!1,n.reason=`Surveys of type ${e.type} are never eligible to be shown in the app`,n;const o=null===(t=e.conditions)||void 0===t?void 0:t.linkedFlagVariant;if(!this.tr(e.linked_flag_key,o))return n.eligible=!1,n.reason=o?`Survey linked feature flag is not enabled for variant ${o}`:"Survey linked feature flag is not enabled",n;if(!this.tr(e.targeting_flag_key))return n.eligible=!1,n.reason="Survey targeting feature flag is not enabled",n;const i=this.nr(e);var s;return i.satisfied?function(e,t){if(!e||!t)return!0;const r="string"==typeof t?new Date(t):t,n=Math.abs((new Date).getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null===(r=e.conditions)||void 0===r?void 0:r.seenSurveyWaitPeriodInDays,tr.Ot("lastSeenSurveyDate"))?(e=>!!tr.Ot(Rt(e))&&!gr(e))(e)?(n.eligible=!1,n.reason="Survey has already been seen and it can't be activated again",n):n:(n.eligible=!1,n.reason="Survey wait period has not passed",n):(n.eligible=!1,n.reason=null!==(s=i.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",n)}checkSurveyCaptureEligibility(){return Zt(this._posthog)?{eligible:!0}:{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"}}checkSurveyDisplayEligibility(e){const t=this.checkSurveyCaptureEligibility();return t.eligible?this.checkSurveyEligibility(e):t}checkSurveyRenderability(e){const t=this.checkSurveyDisplayEligibility(e);return t.eligible&&!this.ir(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}ir(e){var t;if(!Dt(e)&&!function(e){var t;return!!(null===(t=e.conditions)||void 0===t||null===(t=t.actions)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)}(e))return!0;const r=null===(t=this._posthog.surveys)||void 0===t||null===(t=t._surveyEventReceiver)||void 0===t?void 0:t.getSurveys();return!!(null==r?void 0:r.includes(e.id))}rr(e){var t;return!(null===(t=e.feature_flag_keys)||void 0===t?void 0:t.length)||e.feature_flag_keys.every(({key:e,value:t})=>!e||!t||this.tr(t))}Ni(e){return this.checkSurveyEligibility(e).eligible&&this.er(e)&&this.ir(e)&&this.rr(e)}Ui(e){try{const t=vn.querySelector(Mr(e,!0));(null==t?void 0:t.shadowRoot)&&(W(null,t.shadowRoot),this.xi.delete(t.shadowRoot)),null==t||t.remove()}catch(t){jt.warn(`Failed to remove survey ${e.id} from DOM:`,t)}}getTestAPI(){return{addSurveyToFocus:this.Di,removeSurveyFromFocus:this.Fi,surveyInFocus:this.Gi,surveyTimeouts:this.wi,handleWidget:this.qi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Wi,sortSurveysByAppearanceDelay:this.Zi,checkFlags:this.rr.bind(this),isSurveyFeatureFlagEnabled:this.tr.bind(this),onLanguageChange:this.Qi.bind(this),currentLanguage:this.Mi,surveyIsRendered:this.Ii}}};function mn(e,t){if(!vn||!pn)return;const r=new bn(e);if(e.config.disable_surveys_automatic_display)return jt.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===t)return jt.info("There are no surveys to load or Surveys is disabled in the project settings."),r;let n;r.callSurveysAndEvaluateDisplayLogic(!0);const o=()=>{Oe(n)&&(n=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},i=()=>{Oe(n)||(clearInterval(n),n=void 0)};o();const s=()=>{vn.hidden?i():(r.callSurveysAndEvaluateDisplayLogic(!1),o())};return qt(vn,"visibilitychange",s),r.setAutomaticDisplayDispose(()=>{i(),vn.removeEventListener("visibilitychange",s)}),r}function gn({survey:e,removeSurveyFromFocus:t=()=>{},setSurveyVisible:r,isPreviewMode:n=!1,posthog:o}){ue(()=>{var i;if(n||!(null===(i=e.conditions)||void 0===i?void 0:i.url))return;const s=()=>{var n;const i=e.type===Ce,s=Sr(e,o),u=(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)===me&&i;if(!s)return jt.info(`Hiding survey ${e.id} because URL does not match`),r(!1),t(e);u&&(jt.info(`Showing survey ${e.id} because it is a feedback button tab and URL matches`),r(!0))};qt(pn,"popstate",s),qt(pn,"hashchange",s);const u=pn.history.pushState,a=pn.history.replaceState;return pn.history.pushState=function(...e){u.apply(this,e),s()},pn.history.replaceState=function(...e){a.apply(this,e),s()},()=>{pn.removeEventListener("popstate",s),pn.removeEventListener("hashchange",s),pn.history.pushState=u,pn.history.replaceState=a}},[n,e,t,r,o])}const wn=200;function xn(e="right"){switch(e){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function kn({survey:e,forceDisableHtml:t,posthog:r,style:n={},previewPageIndex:o,removeSurveyFromFocus:i=()=>{},isPopup:s=!0,onPreviewSubmit:u=()=>{},onPreviewBack:a=()=>{},onPopupSurveyDismissed:l=()=>{},onCloseConfirmationMessage:c=()=>{},properties:d,isSurveyCompleted:p,skipShownEvent:v,surveyLanguage:h}){var f,y,b,m,g,w,x,k,S,C,q,_;const T=ae(null),P=Number.isInteger(o),{isPopupVisible:M,isSurveySent:I,hidePopupWithAnimation:N}=function(e,t,r,n,o,i,s,u,a){const[l,c]=se(n||0===r||e.type===qe),[d,p]=se(!1),v=ae(!1),h=()=>{const t=()=>{i&&o(e),c(!1)};if(v.current)return;const r=null==s?void 0:s.current;r?(v.current=!0,r.style.transition=`opacity ${wn}ms ease-out`,r.style.opacity="0",setTimeout(()=>{v.current=!1,t()},250)):t()},f=t=>{t.detail.surveyId===e.id&&h()};return ue(()=>{if(!t)return void jt.error("usePopupVisibility hook called without a PostHog instance.");if(n)return;let o;const i=t=>{var r,n;if(t.detail.surveyId===e.id){if(!(null===(r=e.appearance)||void 0===r?void 0:r.displayThankYouMessage))return h();p(!0),(null===(n=e.appearance)||void 0===n?void 0:n.autoDisappear)&&(o&&clearTimeout(o),o=setTimeout(h,5e3))}},s=()=>{if(Sr(e,t)){var r;c(!0),pn.dispatchEvent(new Event("PHSurveyShown")),u||t.capture("survey shown",ft(ft({[He]:e.name,[Ne]:e.id,[Le]:e.current_iteration,[Be]:e.current_iteration_start_date},a&&{[Ee]:a}),{},{sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t)}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};qt(pn,"PHSurveyClosed",f),qt(pn,"PHSurveySent",i);const l=r>0?setTimeout(s,r):void 0;return Oe(l)&&s(),()=>{Oe(l)||clearTimeout(l),Oe(o)||clearTimeout(o),pn.removeEventListener("PHSurveyClosed",f),pn.removeEventListener("PHSurveySent",i)}},[]),gn({survey:e,removeSurveyFromFocus:o,setSurveyVisible:c,isPreviewMode:n,posthog:t}),{isPopupVisible:l,isSurveySent:d,setIsPopupVisible:c,hidePopupWithAnimation:h}}(e,r,(null===(f=e.appearance)||void 0===f?void 0:f.surveyPopupDelaySeconds)?1e3*e.appearance.surveyPopupDelaySeconds:0,P,i,s,T,v,h),H=I||o===e.questions.length||!0===p,[L,B]=se(!1),D=le(()=>!!Tr(e),[e]),F=!(!(null===(y=e.appearance)||void 0===y?void 0:y.introScreenHeader)&&!(null===(b=e.appearance)||void 0===b?void 0:b.introScreenDescription)),V=P?-1===o:!!(null===(m=e.appearance)||void 0===m?void 0:m.displayIntroScreen)&&F&&!L&&!D,E=le(()=>{const t=Tr(e),n=(null==t?void 0:t.surveySubmissionId)||Jt();return{isPreviewMode:P,previewPageIndex:o,onPopupSurveyDismissed(){h?vr(e,r,P,h):vr(e,r,P),l()},isPopup:s||!1,surveySubmissionId:n,onPreviewSubmit:u,onPreviewBack:a,posthog:r,properties:d,surveyLanguage:h}},[P,o,s,r,e,l,u,a,d,h]);return M?Hr(wr.Provider,{value:E,children:Hr("div",{className:"ph-survey",style:ft(ft({},Ir(e.type,null===(g=e.appearance)||void 0===g?void 0:g.position,null===(w=e.appearance)||void 0===w?void 0:w.widgetType)),n),ref:T,children:H?Hr(Gr,{header:(null===(x=e.appearance)||void 0===x?void 0:x.thankYouMessageHeader)||"Thank you!",description:(null===(k=e.appearance)||void 0===k?void 0:k.thankYouMessageDescription)||"",forceDisableHtml:!!t,contentType:null===(S=e.appearance)||void 0===S?void 0:S.thankYouMessageDescriptionContentType,appearance:e.appearance||sr,onClose(){N(),c()}}):V?Hr(Wr,{header:(null===(C=e.appearance)||void 0===C?void 0:C.introScreenHeader)||"",description:(null===(q=e.appearance)||void 0===q?void 0:q.introScreenDescription)||"",forceDisableHtml:!!t,contentType:null===(_=e.appearance)||void 0===_?void 0:_.introScreenDescriptionContentType,appearance:e.appearance||sr,onStart:()=>B(!0)}):Hr(Sn,{survey:e,forceDisableHtml:!!t,posthog:r})})}):null}function Sn({survey:e,forceDisableHtml:t,posthog:r}){var n,o;const i=le(()=>{const t=Tr(e);if(!t)return null;const r=We(t.lastQuestionIndex);return!r||r&&t.lastQuestionIndex>=0&&e.questions.length>t.lastQuestionIndex?t:($r(e),null)},[e]),[s,u]=se(()=>((null==i?void 0:i.responses)&&jt.info("Survey is already in progress, filling in initial responses"),(null==i?void 0:i.responses)||{})),[a,l]=se(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:p,onPreviewSubmit:v,onPreviewBack:h,surveySubmissionId:f,isPreviewMode:y,properties:b,surveyLanguage:m}=ce(wr),[g,w]=se(()=>{const t=null==i?void 0:i.lastQuestionIndex,r=We(t)&&t>=0&&e.questions.length>t?t:0;return We(c)&&c>=0?c:r}),[x,k]=se(()=>{var t;return(null!==(t=null==i?void 0:i.visitedIndices)&&void 0!==t?t:[]).filter(t=>t>=0&&e.questions.length>t)}),[S,C]=se(()=>{var t;const r=Tr(e);return null!==(t=null==r?void 0:r.questionSnapshots)&&void 0!==t?t:{}}),q=le(()=>br(mr(e,i)),[e.id,i]),_=le(()=>{if(!q||new Set(q).size!==q.length)return mr(e,i);const t=new Map(e.questions.map(e=>[e.id,e])),r=q.map(e=>t.get(e)).filter(e=>!!e);return r.length===q.length?r:e.questions},[q,e.questions,e,i]);ue(()=>{!y||Oe(c)||0>c||w(c)},[c,y]);const T=!!(null===(n=e.appearance)||void 0===n?void 0:n.allowGoBack)&&(y?(null!=c?c:0)>0:x.length>0),P=_.at(g);return P?Hr("form",{className:"survey-form",name:"surveyForm",children:[p&&!0!==(null===(o=e.appearance)||void 0===o?void 0:o.hideCancelButton)&&Hr(zr,{onClick(){d()}}),Hr("div",{className:"survey-box","data-question-index":g,children:[a&&Hr("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),qn({question:P,forceDisableHtml:t,displayQuestionIndex:g,appearance:e.appearance||sr,onSubmit:t=>(({res:t,displayQuestionIndex:n,questionId:o})=>{if(!r)return void jt.error("onNextButtonClick called without a PostHog instance.");if(!Zt(r))return void l(!0);if(l(!1),!o)return void jt.error("onNextButtonClick called without a questionId.");const i=_t(o),a=ft(ft({},s),{},{[i]:t});u(a);const c=_[n],d=(null==c?void 0:c.id)?ft(ft({},S),{},{[c.id]:c.question}):S;C(d);const p=ln(e,n,t),v=p===Me,h=[...x,n];if(v||(k(h),w(p),_r(e,{surveySubmissionId:f,responses:a,lastQuestionIndex:p,questionOrder:br(_),visitedIndices:h,surveyLanguage:m,questionSnapshots:d})),e.enable_partial_responses||v){const t=new Set(h.map(e=>{var t;return null===(t=_[e])||void 0===t?void 0:t.id}).filter(e=>!!e).map(e=>_t(e))),n=Object.fromEntries(Object.entries(a).filter(([e])=>t.has(e)));dr({responses:n,survey:e,surveySubmissionId:f,isSurveyCompleted:v,posthog:r,properties:b,surveyLanguage:m,questionSnapshots:d})}})({res:t,displayQuestionIndex:g,questionId:P.id}),onPreviewSubmit:v,initialValue:P.id?s[_t(P.id)]:void 0,canGoBack:T,onBack(){if(y)return void h();if(0===x.length)return;const t=x[x.length-1],r=x.slice(0,-1);k(r),w(t),_r(e,{surveySubmissionId:f,responses:s,lastQuestionIndex:t,questionOrder:br(_),visitedIndices:r,surveyLanguage:m,questionSnapshots:S})}})]})]}):null}function Cn({survey:e,forceDisableHtml:t,posthog:r,readOnly:n,surveyLanguage:o}){var i,s,u,a,l,c,d;const[p,v]=se(!0),[h,f]=se(!1),[y,b]=se({}),m=ae(void 0),g=()=>{(h||!r||n||Zt(r))&&f(!h)};if(ue(()=>{var t;if(!r)return void jt.error("FeedbackWidget called without a PostHog instance.");if(n)return;"tab"===(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)&&b({top:"50%",bottom:"auto"});const o=t=>{var r;const n=t;(null===(r=n.detail)||void 0===r?void 0:r.surveyId)===e.id&&(jt.info(`Received show event for feedback button survey ${e.id}`),b(n.detail.position||{}),g())};return qt(pn,hn,o),()=>{Oe(m.current)||(clearTimeout(m.current),m.current=void 0),pn.removeEventListener(hn,o)}},[r,n,e.id,null===(i=e.appearance)||void 0===i?void 0:i.widgetType,null===(s=e.appearance)||void 0===s?void 0:s.widgetSelector,null===(u=e.appearance)||void 0===u?void 0:u.borderColor]),gn({survey:e,setSurveyVisible:v,posthog:r}),!p)return null;const w=()=>{e.schedule!==Ie&&v(!1),Oe(m.current)||clearTimeout(m.current),m.current=setTimeout(()=>{m.current=void 0,f(!1)},200)};return Hr(T,{children:["tab"===(null===(a=e.appearance)||void 0===a?void 0:a.widgetType)&&Hr("button",{className:"ph-survey-widget-tab "+("top"===(null===(l=e.appearance)||void 0===l?void 0:l.tabPosition)?"widget-tab-top":""),onClick:g,disabled:n,style:xn(null===(c=e.appearance)||void 0===c?void 0:c.tabPosition),children:(null===(d=e.appearance)||void 0===d?void 0:d.widgetLabel)||""}),h&&Hr(kn,{posthog:r,survey:e,forceDisableHtml:t,style:y,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:o})]})}const qn=({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:o,onPreviewSubmit:i,initialValue:s,canGoBack:u,onBack:a})=>{const l={forceDisableHtml:t,appearance:n,onPreviewSubmit(e){i(e)},onSubmit(e){o(e)},initialValue:s,displayQuestionIndex:r,canGoBack:u,onBack:a};switch(e.type){case _e:return q(Yr,ft(ft({},l),{},{question:e,key:e.id}));case"link":return q(Jr,ft(ft({},l),{},{question:e,key:e.id}));case $e:return q(Xr,ft(ft({},l),{},{question:e,key:e.id}));case Pe:case Te:return q(tn,ft(ft({},l),{},{question:e,key:e.id}));default:return jt.error(`Unsupported question type: ${e.type}`),null}},_n="undefined"!=typeof globalThis?globalThis:bt;_n&&"undefined"==typeof self&&(_n.self=_n),_n&&"undefined"==typeof File&&(_n.File=function(){});const Tn=null!=bt?bt:{};Tn.__PosthogExtensions__=Tn.__PosthogExtensions__||{},Tn.__PosthogExtensions__.generateSurveys=mn,Tn.extendPostHogWithSurveys=mn}();
1
+ !function(){var e,t,r,n,i,o,s,a,u,l,c,d,p,v,h,f,y,b,g,m={},w=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,k=Array.isArray;function S(e,t){for(var r in t)e[r]=t[r];return e}function C(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function q(t,r,n){var i,o,s,a={};for(s in r)"key"==s?i=r[s]:"ref"==s?o=r[s]:a[s]=r[s];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return _(t,a,i,o,null)}function _(e,n,i,o,s){var a={type:e,props:n,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++r:s,__i:-1,__u:0};return null==s&&null!=t.vnode&&t.vnode(a),a}function T(e){return e.children}function P(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?$(e):null}function M(e){if(e.__P&&e.__d){var r=e.__v,n=r.__e,i=[],o=[],s=S({},r);s.__v=r.__v+1,t.vnode&&t.vnode(s),Z(e.__P,s,r,e.__n,e.__P.namespaceURI,32&r.__u?[n]:null,i,null==n?$(r):n,!!(32&r.__u),o),s.__v=r.__v,s.__.__k[s.__i]=s,R(i,s,o),r.__e=r.__=null,s.__e!=n&&I(s)}}function I(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),I(e)}function N(e){(!e.__d&&(e.__d=!0)&&n.push(e)&&!H.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||o)(H)}function H(){try{for(var e,t=1;n.length;)n.length>t&&n.sort(s),e=n.shift(),t=n.length,M(e)}finally{n.length=H.__r=0}}function L(e,t,r,n,i,o,s,a,u,l,c){var d,p,v,h,f,y,b,g=n&&n.__k||w,x=t.length;for(u=B(r,t,g,u,x),d=0;x>d;d++)null!=(v=r.__k[d])&&(p=-1!=v.__i&&g[v.__i]||m,v.__i=d,y=Z(e,v,p,i,o,s,a,u,l,c),h=v.__e,v.ref&&p.ref!=v.ref&&(p.ref&&z(p.ref,null,v),c.push(v.ref,v.__c||h,v)),null==f&&null!=h&&(f=h),(b=!!(4&v.__u))||p.__k===v.__k?(u=D(v,u,e,b),b&&p.__e&&(p.__e=null)):"function"==typeof v.type&&void 0!==y?u=y:h&&(u=h.nextSibling),v.__u&=-7);return r.__e=f,u}function B(e,t,r,n,i){var o,s,a,u,l,c=r.length,d=c,p=0;for(e.__k=new Array(i),o=0;i>o;o++)null!=(s=t[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[o]=_(null,s,null,null,null):k(s)?s=e.__k[o]=_(T,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[o]=_(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,u=o+p,s.__=e,s.__b=e.__b+1,a=null,-1!=(l=s.__i=F(s,r,u,d))&&(d--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(i>c?p--:c>i&&p++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?p--:l==u+1?p++:(l>u?p--:p++,s.__u|=4))):e.__k[o]=null;if(d)for(o=0;c>o;o++)null!=(a=r[o])&&!(2&a.__u)&&(a.__e==n&&(n=$(a)),U(a,a));return n}function D(e,t,r,n){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&i.length>o;o++)i[o]&&(i[o].__=e,t=D(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=$(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function F(e,t,r,n){var i,o,s,a=e.key,u=e.type,l=t[r],c=null!=l&&!(2&l.__u);if(null===l&&null==a||c&&a==l.key&&u==l.type)return r;if(n>(c?1:0))for(i=r-1,o=r+1;i>=0||t.length>o;)if(null!=(l=t[s=0>i?o++:i--])&&!(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function V(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||x.test(t)?r:r+"px"}function E(e,t,r,n,i){var o,s;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||V(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||V(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(c,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r[l]=n[l]:(r[l]=d,e.addEventListener(t,o?v:p,o)):e.removeEventListener(t,o?v:p,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function j(e){return function(r){if(this.l){var n=this.l[r.type+e];if(null==r[u])r[u]=d++;else if(n[l]>r[u])return;return n(t.event?t.event(r):r)}}}function Z(e,r,n,i,o,s,a,u,l,c){var d,p,v,h,f,y,b,g,m,x,$,q,_,M,I,N,H=r.type;if(void 0!==r.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[u=r.__e=n.__e]),(d=t.__b)&&d(r);e:if("function"==typeof H){p=a.length;try{if(m=r.props,x=H.prototype&&H.prototype.render,$=(d=H.contextType)&&i[d.__c],q=d?$?$.props.value:d.__:i,n.__c?g=(v=r.__c=n.__c).__=v.__E:(x?r.__c=v=new H(m,q):(r.__c=v=new P(m,q),v.constructor=H,v.render=G),$&&$.sub(v),v.state||(v.state={}),v.__n=i,h=v.__d=!0,v.__h=[],v._sb=[]),x&&null==v.__s&&(v.__s=v.state),x&&null!=H.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=S({},v.__s)),S(v.__s,H.getDerivedStateFromProps(m,v.__s))),f=v.props,y=v.state,v.__v=r,h)x&&null==H.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),x&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(x&&null==H.getDerivedStateFromProps&&m!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(m,q),r.__v==n.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(m,v.__s,q)){r.__v!=n.__v&&(v.props=m,v.state=v.__s,v.__d=!1),r.__e=n.__e,r.__k=n.__k,r.__k.some(function(e){e&&(e.__=r)}),w.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.push(v);break e}null!=v.componentWillUpdate&&v.componentWillUpdate(m,v.__s,q),x&&null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(f,y,b)})}if(v.context=q,v.props=m,v.__P=e,v.__e=!1,_=t.__r,M=0,x)v.state=v.__s,v.__d=!1,_&&_(r),d=v.render(v.props,v.state,v.context),w.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,_&&_(r),d=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++M);v.state=v.__s,null!=v.getChildContext&&(i=S(S({},i),v.getChildContext())),x&&!h&&null!=v.getSnapshotBeforeUpdate&&(b=v.getSnapshotBeforeUpdate(f,y)),I=null!=d&&d.type===T&&null==d.key?Q(d.props.children):d,u=L(e,k(I)?I:[I],r,n,i,o,s,a,u,l,c),v.base=r.__e,r.__u&=-161,v.__h.length&&a.push(v),g&&(v.__E=v.__=null)}catch(e){if(a.length=p,r.__v=null,l||null!=s)if(e.then){for(r.__u|=l?160:128;u&&8==u.nodeType&&u.nextSibling;)u=u.nextSibling;null!=s&&(s[s.indexOf(u)]=null),r.__e=u}else{if(null!=s)for(N=s.length;N--;)C(s[N]);A(r)}else r.__e=n.__e,!r.__k&&n.__k&&(r.__k=n.__k),e.then||A(r);t.__e(e,r,n)}}else null==s&&r.__v==n.__v?(r.__k=n.__k,r.__e=n.__e):u=r.__e=O(n.__e,r,n,i,o,s,a,l,c);return(d=t.diffed)&&d(r),128&r.__u?void 0:u}function A(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(A))}function R(e,r,n){for(var i=0;n.length>i;i++)z(n[i],n[++i],n[++i]);t.__c&&t.__c(r,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(e){e.call(r)})}catch(e){t.__e(e,r.__v)}})}function Q(e){return"object"!=typeof e||null==e||e.__b>0?e:k(e)?e.map(Q):void 0!==e.constructor?null:S({},e)}function O(r,n,i,o,s,a,u,l,c){var d,p,v,h,f,y,b,g=i.props||m,w=n.props,x=n.type;if("svg"==x?s="http://www.w3.org/2000/svg":"math"==x?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a)for(d=0;a.length>d;d++)if((f=a[d])&&"setAttribute"in f==!!x&&(x?f.localName==x:3==f.nodeType)){r=f,a[d]=null;break}if(null==r){if(null==x)return document.createTextNode(w);r=document.createElementNS(s,x,w.is&&w),l&&(t.__m&&t.__m(n,a),l=!1),a=null}if(null==x)g===w||l&&r.data==w||(r.data=w);else{if(a="textarea"==x&&null!=w.defaultValue?null:a&&e.call(r.childNodes),!l&&null!=a)for(g={},d=0;r.attributes.length>d;d++)g[(f=r.attributes[d]).name]=f.value;for(d in g)f=g[d],"dangerouslySetInnerHTML"==d?v=f:"children"==d||d in w||"value"==d&&"defaultValue"in w||"checked"==d&&"defaultChecked"in w||E(r,d,null,f,s);for(d in w)f=w[d],"children"==d?h=f:"dangerouslySetInnerHTML"==d?p=f:"value"==d?y=f:"checked"==d?b=f:l&&"function"!=typeof f||g[d]===f||E(r,d,f,g[d],s);if(p)l||v&&(p.__html==v.__html||p.__html==r.innerHTML)||(r.innerHTML=p.__html),n.__k=[];else if(v&&(r.innerHTML=""),L("template"==n.type?r.content:r,k(h)?h:[h],n,i,o,"foreignObject"==x?"http://www.w3.org/1999/xhtml":s,a,u,a?a[0]:i.__k&&$(i,0),l,c),null!=a)for(d=a.length;d--;)C(a[d]);l&&"textarea"!=x||(d="value","progress"==x&&null==y?r.removeAttribute("value"):null!=y&&(y!==r[d]||"progress"==x&&!y||"option"==x&&y!=g[d])&&E(r,d,y,g[d],s),d="checked",null!=b&&b!=r[d]&&E(r,d,b,g[d],s))}return r}function z(e,r,n){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==r||(e.__u=e(r))}else e.current=r}catch(e){t.__e(e,n)}}function U(e,r,n){var i,o;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||z(i,null,r)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,r)}i.base=i.__P=i.__n=null}if(i=e.__k)for(o=0;i.length>o;o++)i[o]&&U(i[o],r,n||"function"!=typeof e.type);n||C(e.__e),e.__c=e.__=e.__e=void 0}function G(e,t,r){return this.constructor(e,r)}function W(r,n,i){var o,s,a,u;n==document&&(n=document.documentElement),t.__&&t.__(r,n),s=(o="function"==typeof i)?null:i&&i.__k||n.__k,a=[],u=[],Z(n,r=(!o&&i||n).__k=q(T,null,[r]),s||m,m,n.namespaceURI,!o&&i?[i]:s?null:n.firstChild?e.call(n.childNodes):null,a,!o&&i?i:s?s.__e:n.firstChild,o,u),R(a,r,u),r.props.children=null}e=w.slice,t={__e(e,t,r,n){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},r=0,P.prototype.setState=function(e,t){var r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=S({},this.state);"function"==typeof e&&(e=e(S({},r),this.props)),e&&S(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),N(this))},P.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},P.prototype.render=T,n=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(e,t){return e.__v.__b-t.__v.__b},H.__r=0,a=Math.random().toString(8),u="__d"+a,l="__a"+a,c=/(PointerCapture)$|Capture$/i,d=0,p=j(!1),v=j(!0),h=0;var K=0,Y=[],J=t,X=J.__b,ee=J.__r,te=J.diffed,re=J.__c,ne=J.unmount,ie=J.__;function oe(e,t){J.__h&&J.__h(y,e,K||t),K=0;var r=y.__H||(y.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function se(e){return K=1,function(e,t){var r=oe(f++,2);if(r.t=e,!r.__c&&(r.__=[be(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var n=function(e,t,n){if(!r.__c.__H)return!0;var o=!1,s=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){o=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),i){var a=i.call(this,e,t,n);return o?a||s:a}return!o||s};y.__f=!0;var i=y.shouldComponentUpdate,o=y.componentWillUpdate;y.componentWillUpdate=function(e,t,r){if(this.__e){var s=i;i=void 0,n(e,t,r),i=s}o&&o.call(this,e,t,r)},y.shouldComponentUpdate=n}return r.__N||r.__}(be,e)}function ae(e,t){var r=oe(f++,3);!J.__s&&ye(r.__H,t)&&(r.__=e,r.u=t,y.__H.__h.push(r))}function ue(e){return K=5,le(function(){return{current:e}},[])}function le(e,t){var r=oe(f++,7);return ye(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ce(e){var t=y.context[e.__c],r=oe(f++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(y)),t.props.value):e.__}function de(){for(var e;e=Y.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(he),t.__h.some(fe),t.__h=[]}catch(r){t.__h=[],J.__e(r,e.__v)}}}J.__b=function(e){y=null,X&&X(e)},J.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ie&&ie(e,t)},J.__r=function(e){ee&&ee(e),f=0;var t=(y=e.__c).__H;t&&(b===y?(t.__h=[],y.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.length&&de(),f=0)),b=y},J.diffed=function(e){te&&te(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Y.push(t)&&g===J.requestAnimationFrame||((g=J.requestAnimationFrame)||ve)(de)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),b=y=null},J.__c=function(e,t){t.some(function(e){try{e.__h.some(he),e.__h=e.__h.filter(function(e){return!e.__||fe(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],J.__e(r,e.__v)}}),re&&re(e,t)},J.unmount=function(e){ne&&ne(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(e){try{he(e)}catch(e){t=e}}),r.__H=void 0,t&&J.__e(t,r.__v))};var pe="function"==typeof requestAnimationFrame;function ve(e){var t,r=function(){clearTimeout(n),pe&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);pe&&(t=requestAnimationFrame(r))}function he(e){var t=y,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),y=t}function fe(e){var t=y;e.__c=e.__(),y=t}function ye(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function be(e,t){return"function"==typeof t?t(e):t}const ge="tab",me="left",we="center",xe="right",ke="next_to_trigger",Se="popover",Ce="widget",qe="external_survey",_e="open",Te="multiple_choice",Pe="single_choice",$e="rating",Me="end",Ie="always",Ne="$survey_id",He="$survey_name",Le="$survey_iteration",Be="$survey_iteration_start_date",De="$survey_partially_completed",Fe="$survey_submission_id",Ve="$survey_completed",Ee="$survey_language",je="min_length",Ze="max_length",Ae=Object.prototype.toString,Re=Array.isArray||function(e){return"[object Array]"===Ae.call(e)},Qe=e=>"function"==typeof e,Oe=e=>void 0===e,ze=e=>"[object String]"==Ae.call(e),Ue=e=>null===e,Ge=e=>Oe(e)||Ue(e),We=e=>"[object Number]"==Ae.call(e)&&e==e,Ke="Mobile",Ye="Tablet",Je="Android Tablet",Xe="iPad",et="Apple Watch",tt="Nintendo",rt="PlayStation",nt="Xbox",it="Nokia",ot="Ouya",st="Generic "+Ke.toLowerCase(),at="Generic "+Ye.toLowerCase(),ut=new RegExp(nt,"i"),lt=new RegExp("PlayStation \\w+","i"),ct=new RegExp("Nintendo \\w+","i"),dt=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(tt,"i"),new RegExp(rt,"i"),new RegExp("Windows","i");function pt(e){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(e)}function vt(e,t,r){return(t=function(e){var t=function(e){if("object"!=pt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=pt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ht(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ft(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(r),!0).forEach(function(t){vt(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function yt(e,t){if(!e)return;const r=e.find(e=>e.type===t);return null==r?void 0:r.value}const bt="u">typeof window?window:void 0,gt="u">typeof globalThis?globalThis:bt,mt=null==gt?void 0:gt.navigator,wt=null==gt?void 0:gt.document;null!=gt&&gt.XMLHttpRequest&&new gt.XMLHttpRequest;const xt=null==mt?void 0:mt.userAgent,kt=(e,{debugEnabled:t}={})=>{const r={N(r,...n){bt&&(bt.POSTHOG_DEBUG||t)&&!Oe(bt.console)&&bt.console&&("__rrweb_original__"in bt.console[r]?bt.console[r].__rrweb_original__:bt.console[r])(e,...n)},debug(...e){r.N("debug",...e)},info(...e){r.N("log",...e)},warn(...e){r.N("warn",...e)},error(...e){r.N("error",...e)},critical(...t){console.error(e,...t)},uninitializedWarning(e){r.error(`You must initialize PostHog before calling ${e}`)},createLogger:(t,r)=>kt(`${e} ${t}`,r)};return r},St=kt("[PostHog.js]"),Ct=St.createLogger;function qt(e,t,r,n){const{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}function _t(e){return`$survey_response_${e}`}function Tt(e,t){if(!t)return null;const r=e[_t(t)];return Re(r)?[...r]:r}function Pt(e={},t,r){const n={};return t.questions.forEach(t=>{if(Oe(t.originalQuestionIndex))return;const r=0===(i=t.originalQuestionIndex)?"$survey_response":`$survey_response_${i}`;var i;const o=Tt(e,t.id);Oe(o)||(n[r]=o)}),ft(ft({$survey_questions:t.questions.map(t=>{var n,i;return{id:t.id,question:null!==(n=null==r?void 0:r[null!==(i=t.id)&&void 0!==i?i:""])&&void 0!==n?n:t.question,response:Tt(e,t.id)}})},e),n)}function $t(e={}){return Object.values(e).some(e=>!Ge(e))}function Mt(e,t){let r=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(r=`$survey_${t}/${e.id}/${e.current_iteration}`),r}function It(e){return"string"==typeof e&&e.trim()?e.trim():null}function Nt(e){return e.toLowerCase()}function Ht(e,t,r){if(!e||!t)return null;const n=Nt(t),i=Object.keys(e).find(e=>Nt(e)===n);if(i)return null==r||r.debug(`Found exact translation match: ${i}`),i;if(n.includes("-")){const i=n.split("-")[0],o=Object.keys(e).find(e=>Nt(e)===i);if(o)return null==r||r.debug(`Found base language translation match: ${o} (from ${t})`),o}return null}const Lt=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Bt(e,t,r){var n;const i=Ht(e.translations,t,r),o=ft({},e);let s=!1;if(i){var a;const t=null===(a=e.translations)||void 0===a?void 0:a[i];if(t)if(null==r||r.info(`Applying survey-level translation for language: ${i}`),Oe(t.name)||(o.name=t.name,s=!0),o.appearance){const e=ft({},o.appearance);for(const r of Lt){const n=t[r];Oe(n)||(e[r]=n,s=!0)}o.appearance=e}else(function(e){return Lt.some(t=>!Oe(e[t]))})(t)&&(s=!0)}const u=e.questions.map(e=>function(e,t,r){var n;const i=Ht(e.translations,t,r);if(!i)return{question:e,matchedKey:null,hasChanges:!1};const o=null===(n=e.translations)||void 0===n?void 0:n[i];if(!o)return{question:e,matchedKey:null,hasChanges:!1};const s=ft({},e);let a=!1;return Oe(o.question)||(s.question=o.question,a=!0),Oe(o.description)||(s.description=o.description,a=!0),Oe(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!Oe(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!Oe(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!Oe(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(e){return Re(e.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:e,matchedKey:a?i:null,hasChanges:a}}(e,t,r)),l=u.map(e=>e.question),c=u.some(e=>e.hasChanges);let d=null;return i||(d=(null===(n=u.find(e=>e.matchedKey))||void 0===n?void 0:n.matchedKey)||null),c&&(o.questions=l,s=!0,null==r||r.info(`Applied question-level translations for language: ${t}`)),{survey:o,matchedKey:s?i||d:null}}function Dt(e){var t;return!!(null===(t=e.conditions)||void 0===t||null===(t=t.events)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)}const Ft=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},Vt=e=>e.toLowerCase(),Et={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>Ft(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Ft(t,e))),icontains:(e,t)=>t.map(Vt).some(t=>e.map(Vt).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(Vt).every(t=>e.map(Vt).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{const r=parseFloat(t);return!isNaN(r)&&e.some(e=>r>parseFloat(e))}),lt:(e,t)=>t.some(t=>{const r=parseFloat(t);return!isNaN(r)&&e.some(e=>r<parseFloat(e))})},jt=Ct("[Surveys]");function Zt(e){return Qe(e.is_capturing)?e.is_capturing():!e.has_opted_out_capturing()}const At=(e,t)=>`${e}${function(e){return e.current_iteration&&e.current_iteration>0?`${e.id}_${e.current_iteration}`:e.id}(t)}`,Rt=e=>At("seenSurvey_",e),Qt=e=>{try{const t=Rt(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){jt.error("Failed to persist survey seen state",e)}},Ot=[Se,Ce,"api"],zt="$surveys";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return We(e)&&isFinite(e)&&Math.floor(e)===e});var Ut=class e{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,r,n,i){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||0>t||0>r||0>n||0>i||t>0xffffffffffff||r>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");const o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/256,o[5]=t,o[6]=112|r>>>8,o[7]=r,o[8]=128|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}toString(){let e="";for(let t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;16>t;t++){const r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}},Gt=class{generate(){const e=this.generateOrAbort();if(!Oe(e))return e;{this.Ct=0;const e=this.generateOrAbort();if(Oe(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const e=(()=>{const e=Date.now();return We(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return Ut.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new Kt}};let Wt=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};bt&&!Oe(bt.crypto)&&crypto.getRandomValues&&(Wt=e=>crypto.getRandomValues(e));var Kt=class{nextUint32(){return this.Rt.length>this.$t||(Wt(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let Yt;const Jt=()=>Xt().toString(),Xt=()=>(Yt||(Yt=new Gt)).generate();let er=null;const tr={Et(){if(!Ue(er))return er;let e=!0;if(Oe(bt))e=!1;else try{const t="__mplssupport__";tr.At(t,"xyz"),'"xyz"'!==tr.Ot(t)&&(e=!1),tr.Lt(t)}catch(t){e=!1}return e||St.error("localStorage unsupported; falling back to cookie store"),er=e,e},Pt(e){St.error("localStorage error: "+e)},Ot(e){try{return null==bt?void 0:bt.localStorage.getItem(e)}catch(e){tr.Pt(e)}return null},Dt(e){try{return JSON.parse(tr.Ot(e))||{}}catch(e){}return null},At(e,t){try{return null==bt||bt.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){tr.Pt(e)}return!1},Lt(e){try{null==bt||bt.localStorage.removeItem(e)}catch(e){tr.Pt(e)}}},rr=Ct("[Stylesheet Loader]"),nr=bt,ir=wt,or="#020617",sr={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:xe,widgetType:ge,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:or,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},ar=[we,me,xe];function ur(e){if(e.startsWith("#")){let t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?`rgb(${parseInt(t.slice(0,2),16)},${parseInt(t.slice(2,4),16)},${parseInt(t.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function lr(e=sr.backgroundColor){let t;"#"===e[0]&&(t=ur(e)),e.startsWith("rgb")&&(t=e);const r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=ur(r)),!t)return or;const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){const e=parseInt(n[1]),t=parseInt(n[2]),r=parseInt(n[3]);return Math.sqrt(e*e*.299+t*t*.587+r*r*.114)>127.5?or:"white"}return or}const cr=(e,t,r)=>{const n=Mr(e),i=ir.querySelector(`.${n}`);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};const o=ir.createElement("div");((e,t,r)=>{const n=ft(ft({},sr),r),i=e.style,o=!ar.includes(n.position)||t===Ce&&(null==r?void 0:r.widgetType)===ge;i.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";const t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?`${e}, ${t}`:`-apple-system, ${t}`}(n.fontFamily)),i.setProperty("--ph-survey-box-padding",n.boxPadding),i.setProperty("--ph-survey-max-width",n.maxWidth),i.setProperty("--ph-survey-z-index",n.zIndex),i.setProperty("--ph-survey-border-color",n.borderColor),o?(i.setProperty("--ph-survey-border-radius",n.borderRadius),i.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(i.setProperty("--ph-survey-border-bottom","none"),i.setProperty("--ph-survey-border-radius",`${n.borderRadius} ${n.borderRadius} 0 0`)),i.setProperty("--ph-survey-background-color",n.backgroundColor),i.setProperty("--ph-survey-box-shadow",n.boxShadow),i.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),i.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),i.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||lr(n.submitButtonColor)),i.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),i.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),i.setProperty("--ph-survey-rating-active-text-color",lr(n.ratingButtonActiveColor)),i.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||lr(n.backgroundColor)),i.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),i.setProperty("--ph-widget-color",n.widgetColor),i.setProperty("--ph-widget-text-color",lr(n.widgetColor)),i.setProperty("--ph-widget-z-index",n.zIndex);const s=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor);let a=s||n.inputBackground;s||"white"!==n.backgroundColor||(a="#f8f8f8"),i.setProperty("--ph-survey-input-background",a);const u=(null==r?void 0:r.inputTextColor)||lr(a);i.setProperty("--ph-survey-input-text-color",u),i.setProperty("--ph-survey-rating-text-color",u),i.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),i.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),i.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;const s=o.attachShadow({mode:"open"}),a=function(e){const t=((e,t,r)=>{let n=e.createElement("style");n.innerText=t;const i=(e=>{var t;return Qe(e)?e:null==e||null===(t=e.config)||void 0===t?void 0:t.prepare_external_dependency_stylesheet})(r);return i&&(n=i(n)),n||(rr.error("prepare_external_dependency_stylesheet returned null"),null)})(ir,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(a){const e=s.querySelector("style");e&&s.removeChild(e),s.appendChild(a)}return(r||ir.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},dr=({responses:e,survey:t,surveySubmissionId:r,posthog:n,isSurveyCompleted:i,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var u;n?Zt(n)&&(Qt(t),n.capture("survey sent",ft(ft(ft(ft({[He]:t.name,[Ne]:t.id,[Le]:t.current_iteration,[Be]:t.current_iteration_start_date,[Fe]:r,[Ve]:i},s&&{[Ee]:s}),{},{sessionRecordingUrl:null===(u=n.get_session_replay_url)||void 0===u?void 0:u.call(n)},Pt(e,t,a)),o),{},{$set:{[Mt(t,"responded")]:!0}})),i&&(nr.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:t.id}})),$r(t),n.reloadFeatureFlags())):jt.error("[survey sent] event not captured, PostHog instance not found.")},pr=(e,t,r)=>{var n;return ft(ft({[He]:e.name,[Ne]:e.id,[Le]:e.current_iteration,[Be]:e.current_iteration_start_date,[De]:$t(null==t?void 0:t.responses)},(null==t?void 0:t.surveyLanguage)&&{[Ee]:t.surveyLanguage}),{},{sessionRecordingUrl:null===(n=r.get_session_replay_url)||void 0===n?void 0:n.call(r),[Fe]:null==t?void 0:t.surveySubmissionId},Pt(null==t?void 0:t.responses,e,null==t?void 0:t.questionSnapshots))},vr=(e,t,r,n)=>{if(!t)return void jt.error("[survey dismissed] event not captured, PostHog instance not found.");if(r)return;const i=Tr(e),o=i?i.surveyLanguage:n;t.capture("survey dismissed",ft(ft(ft({},pr(e,i,t)),o&&{[Ee]:o}),{},{$set:{[Mt(e,"dismissed")]:!0}})),$r(e),Qt(e),nr.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))},hr=(e,t)=>{if(!t)return void jt.error("[survey abandoned] event not captured, PostHog instance not found.");const r=(e=>At("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}const n=Tr(e);if(n){try{localStorage.setItem(r,"true")}catch(e){}t.capture("survey abandoned",pr(e,n,t),{transport:"sendBeacon"})}},fr=e=>e.map(e=>({sort:Math.floor(10*Math.random()),value:e})).sort((e,t)=>e.sort-t.sort).map(e=>e.value),yr=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r])?t.reverse():t,br=e=>{const t=e.map(e=>e.id);return t.every(e=>!!e)?t:void 0},gr=(e,t)=>{return(e=>e.questions.some(e=>{var t;return!!(null===(t=e.branching)||void 0===t?void 0:t.type)}))(e)?e.questions:t?null!==(r=((e,t)=>{if(!t||t.length!==e.questions.length)return null;const r=new Map(e.questions.map(e=>[e.id,e])),n=[];for(const e of t){const t=r.get(e);if(!t)return null;n.push(t)}return n})(e,t.questionOrder))&&void 0!==r?r:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?yr(e.questions,fr(e.questions)):e.questions;var r},mr=e=>function(e){var t;return Dt(e)&&!!(null===(t=e.conditions)||void 0===t||null===(t=t.events)||void 0===t?void 0:t.repeatedActivation)||"always"===e.schedule}(e)||Pr(e),wr=function(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(function(e){e.__e=!0,N(e)})},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+h++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),xr=()=>ce(wr),kr=({component:t,children:r,renderAsHtml:n,style:i})=>function(t,r,n){var i,o,s,a,u=S({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),r)"key"==s?i=r[s]:"ref"==s?o=r[s]:u[s]=void 0===r[s]&&null!=a?a[s]:r[s];return arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):n),_(t.type,u,i||t.key,o||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i});function Sr(e,t){var r,n;if(!(null===(r=e.conditions)||void 0===r?void 0:r.url))return!0;const i=function(e){var t;const r=null==bt||null===(t=bt.location)||void 0===t?void 0:t.href;return Oe(r)?void 0:function(e,t){var r;const n=null==e||null===(r=e.config)||void 0===r?void 0:r.get_current_url;if(!Qe(n))return t;try{const e=n(t);return ze(e)&&e?e:t}catch(e){return St.error("Error in get_current_url, falling back to window.location.href",e),t}}(e,r)}(t);if(!i)return!1;const o=[e.conditions.url],s=function(e){return null!=e?e:"icontains"}(null===(n=e.conditions)||void 0===n?void 0:n.urlMatchType);return Et[s](o,[i])}function Cr(e){var t,r;return function(e,t){var r,n,i;if(!e||0===e.length)return!0;if(!xt)return!1;const o=function(e,t){var r;const n=function(e){return ct.test(e)?tt:lt.test(e)?rt:ut.test(e)?nt:new RegExp(ot,"i").test(e)?ot:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?"Windows Phone":/iPad/.test(e)?Xe:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?et:dt.test(e)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(it,"i").test(e)?it:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Ke).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?"Android":Je:new RegExp("(pda|Mobile)","i").test(e)?st:new RegExp(Ye,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?at:""}(e);return n===Xe||n===Je||"Kobo"===n||"Kindle Fire"===n||n===at?Ye:n===tt||n===nt||n===rt||n===ot?"Console":n===et?"Wearable":n?Ke:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(o=null==t?void 0:t.screenHeight)&&void 0!==o?o:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?Ke:Ye:"Desktop";var i,o,s}(xt,{userAgentDataPlatform:null==mt||null===(r=mt.userAgentData)||void 0===r?void 0:r.platform,maxTouchPoints:null==mt?void 0:mt.maxTouchPoints,screenWidth:null==bt||null===(n=bt.screen)||void 0===n?void 0:n.width,screenHeight:null==bt||null===(i=bt.screen)||void 0===i?void 0:i.height,devicePixelRatio:null==bt?void 0:bt.devicePixelRatio});return Et[null!=t?t:"icontains"](e,[o])}(null===(t=e.conditions)||void 0===t?void 0:t.deviceTypes,null===(r=e.conditions)||void 0===r?void 0:r.deviceTypesMatchType)}const qr=e=>At("inProgressSurvey_",e),_r=(e,t)=>{try{localStorage.setItem(qr(e),JSON.stringify(t))}catch(e){jt.error("Error setting in-progress survey state in localStorage",e)}},Tr=e=>{try{const t=localStorage.getItem(qr(e));if(t)return JSON.parse(t)}catch(e){jt.error("Error getting in-progress survey state from localStorage",e)}return null},Pr=e=>{const t=Tr(e);return!Ge(null==t?void 0:t.surveySubmissionId)},$r=e=>{try{localStorage.removeItem(qr(e))}catch(e){jt.error("Error clearing in-progress survey state from localStorage",e)}};function Mr(e,t=!1){const r=`PostHogSurvey-${e.id}`;return t?`.${r}`:r}function Ir(e,t=xe,r){if(e===qe)return{};switch(t){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case me:return{left:"30px"};case we:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Ce&&r===ge?"60px":"30px"}}}var Nr=0;function Hr(e,r,n,i,o,s){r||(r={});var a,u,l=r;if("ref"in l)for(u in l={},r)"ref"==u?a=r[u]:l[u]=r[u];var c={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nr,__i:-1,__u:0,__source:o,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(u in a)void 0===l[u]&&(l[u]=a[u]);return t.vnode&&t.vnode(c),c}const Lr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Br=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Dr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Vr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Hr("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Er=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Hr("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),jr=Hr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Hr("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Zr=({fill:e="currentColor"}={})=>Hr("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Hr("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Hr("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:e})]}),Ar=Hr("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Hr("g",{"clip-path":"url(#clip0_2415_6911)",children:[Hr("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Hr("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Hr("g",{mask:"url(#mask0_2415_6911)",children:[Hr("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Hr("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Hr("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Hr("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Hr("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Hr("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Hr("defs",{children:Hr("clipPath",{id:"clip0_2415_6911",children:Hr("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Rr({urlParams:e}){const t=e?Object.entries(e).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&"):"";return Hr("a",{href:"https://posthog.com/surveys"+(t?`?${t}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ar]})}function Qr({text:e,submitDisabled:t,appearance:r,onSubmit:n,link:i,onPreviewSubmit:o,skipSubmitButton:s,canGoBack:a,onBack:u}){const{isPreviewMode:l}=ce(wr),c=!!a&&!!u,d=!s&&Hr("button",{className:"form-submit",disabled:t,"aria-label":"Submit survey",type:"button",onClick(){i&&(null==bt||bt.open(i)),l?null==o||o():n()},children:e});return Hr("div",{className:"bottom-section",children:[c?Hr("div",{className:"form-buttons form-buttons-with-back",children:[Hr("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:r.backButtonText||"Back"}),d]}):d,!r.whiteLabel&&Hr(Rr,{urlParams:{utm_source:"survey-footer"}})]})}function Or({question:e,forceDisableHtml:t,htmlFor:r}){return Hr("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Hr(e.type===_e?"label":"h3",{className:"survey-question",htmlFor:r,children:e.question}),e.description&&kr({component:q("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!t&&"text"!==e.descriptionContentType})]})}function zr({onClick:e}){const{isPreviewMode:t}=ce(wr);return Hr("button",{className:"form-cancel",onClick:e,disabled:t,"aria-label":"Close survey",type:"button",children:Zr({fill:"black"})})}const Ur=bt;function Gr({header:e,description:t,contentType:r,forceDisableHtml:n,appearance:i,onClose:o}){const{isPopup:s}=ce(wr);return ae(()=>{const e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return qt(Ur,"keydown",e),()=>{Ur.removeEventListener("keydown",e)}},[o]),Hr("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==i.hideCancelButton&&Hr(zr,{onClick:()=>o()}),Hr("h3",{className:"thank-you-message-header",children:e}),t&&kr({component:q("p",{className:"thank-you-message-body"}),children:t,renderAsHtml:!n&&"text"!==r}),s&&Hr(Qr,{text:i.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:i,onSubmit:()=>o()})]})}function Wr({header:e,description:t,contentType:r,forceDisableHtml:n,appearance:i,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:u}=ce(wr);return Hr("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==i.hideCancelButton&&Hr(zr,{onClick:()=>u()}),e&&Hr("h3",{className:"intro-screen-header",children:e}),t&&kr({component:q("p",{className:"intro-screen-body"}),children:t,renderAsHtml:!n&&"text"!==r}),Hr(Qr,{text:i.introScreenButtonText||"Get started",submitDisabled:!1,appearance:i,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const Kr=e=>Re(e)&&e.every(e=>ze(e));function Yr({question:e,forceDisableHtml:t,appearance:r,onSubmit:n,onPreviewSubmit:i,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:u}){const{isPreviewMode:l}=xr(),c=ue(null),[d,p]=se(()=>ze(s)?s:""),v=null==r?void 0:r.disableAutofocus;ae(()=>{v||setTimeout(()=>{var e;l||null===(e=c.current)||void 0===e||e.focus()},100)},[l,v]);const h=`surveyQuestion${o}`,f=le(()=>function(e,t,r){const n=e.trim();if(!r&&""===n)return"This field is required";if(""===n)return!1;if(t&&t.length>0)for(const e of t)switch(e.type){case je:var i;if(void 0!==e.value&&e.value>n.length)return null!==(i=e.errorMessage)&&void 0!==i?i:`Please enter at least ${e.value} characters`;break;case Ze:var o;if(void 0!==e.value&&n.length>e.value)return null!==(o=e.errorMessage)&&void 0!==o?o:`Please enter no more than ${e.value} characters`}return!1}(d,e.validation,e.optional),[d,e.validation,e.optional]),y=yt(e.validation,je),b=yt(e.validation,Ze),g=le(()=>function(e,t){const r=1===e?void 0:e;return r&&t?`Enter ${r}-${t} characters`:r?`Enter at least ${r} ${1===r?"character":"characters"}`:t?`Maximum ${t} ${1===t?"character":"characters"}`:void 0}(y,b),[y,b]),m=()=>{f||n(d.trim())},w=()=>{f||i(d.trim())};return Hr(T,{children:[Hr("div",{className:"question-container",children:[Hr(Or,{question:e,forceDisableHtml:t,htmlFor:h}),Hr("textarea",{ref:c,id:h,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(e){p(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||f||(e.preventDefault(),l?w():m())},value:d}),g&&Hr("div",{className:"validation-hint",children:g})]}),Hr(Qr,{text:e.buttonText||"Submit",submitDisabled:!!f,appearance:r,onSubmit:m,onPreviewSubmit:w,canGoBack:a,onBack:u})]})}function Jr({question:e,forceDisableHtml:t,appearance:r,onSubmit:n,onPreviewSubmit:i,canGoBack:o,onBack:s}){return Hr(T,{children:[Hr("div",{className:"question-container",children:Hr(Or,{question:e,forceDisableHtml:t})}),Hr(Qr,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>i("link clicked"),canGoBack:o,onBack:s})]})}function Xr({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:u}){var l;const c=e.scale,d=10===e.scale?0:1,[p,v]=se(()=>We(s)?s:Re(s)&&s.length>0&&We(parseInt(s[0]))?parseInt(s[0]):ze(s)&&We(parseInt(s))?parseInt(s):null),h="emoji"===e.display&&2===e.scale,{isPreviewMode:f}=xr(),y=e=>f?o(e):i(e);return Hr(T,{children:[Hr("div",{className:"question-container",children:[Hr(Or,{question:e,forceDisableHtml:t}),Hr("div",{className:"rating-section",children:[Hr("div",{className:"rating-options",children:["emoji"===e.display&&Hr("div",{className:"rating-options-emoji"+(h?" rating-options-emoji-2":""),children:null===(l=sn[e.scale])||void 0===l?void 0:l.map((t,n)=>Hr("button",{"aria-label":`Rate ${n+1}`,className:`ratings-emoji question-${r}-rating-${n} ${n+1===p?"rating-active":""}`,value:n+1,type:"button",onClick(){const t=n+1;v(t),e.skipSubmitButton&&y(t)},children:t},n))}),"number"===e.display&&Hr("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:an(e.scale).map((t,i)=>Hr(en,{displayQuestionIndex:r,active:p===t,appearance:n,num:t,setActiveNumber(t){v(t),e.skipSubmitButton&&y(t)}},i))})]}),!h&&Hr("div",{className:"rating-text",children:[Hr("div",{children:e.lowerBoundLabel}),Hr("div",{children:e.upperBoundLabel})]})]})]}),Hr(Qr,{text:e.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:Ue(p)&&!e.optional,appearance:n,onSubmit:()=>i(p),onPreviewSubmit:()=>o(p),skipSubmitButton:e.skipSubmitButton,canGoBack:a,onBack:u})]})}function en({num:e,active:t,displayQuestionIndex:r,setActiveNumber:n}){return Hr("button",{"aria-label":`Rate ${e}`,className:`ratings-number question-${r}-rating-${e} ${t?"rating-active":""}`,type:"button",onClick(){n(e)},children:e})}function tn({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:u}){const l=ue(null),c=le(()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let r="";e.hasOpenChoice&&(r=t.pop());const n=yr(t,fr(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(e),[e]),[d,p]=se(()=>((e,t)=>ze(e)||Kr(e)?e:t===Pe?null:[])(s,e.type)),[v,h]=se(()=>((e,t)=>{if(ze(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Kr(e)){const r=e.find(e=>!t.includes(e));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:f}=xr(),y=e.type===Pe,b=e.type===Te,g=e.skipSubmitButton&&y&&!e.hasOpenChoice,m=(e,t)=>{if(t){const e=!v.isSelected;return h(t=>ft(ft({},t),{},{isSelected:e,inputValue:e?t.inputValue:""})),y&&p(""),void(e&&setTimeout(()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()},75))}if(y)return p(e),h(e=>ft(ft({},e),{},{isSelected:!1,inputValue:""})),void(g&&(i(e),f&&o(e)));b&&Re(d)&&(d.includes(e)?p(d.filter(t=>t!==e)):p([...d,e]))},w=e=>{e.stopPropagation();const t=e.currentTarget.value;h(e=>ft(ft({},e),{},{inputValue:t})),y&&p(t)},x=e=>{e.stopPropagation(),"Enter"!==e.key||k()||(e.preventDefault(),S()),"Escape"===e.key&&(e.preventDefault(),h(e=>ft(ft({},e),{},{isSelected:!1,inputValue:""})),y&&p(null))},k=()=>!(e.optional||!Ue(d)&&(!Re(d)||v.isSelected||0!==d.length)&&(!v.isSelected||""!==v.inputValue.trim())),S=()=>{v.isSelected&&b?Re(d)&&(f?o([...d,v.inputValue]):i([...d,v.inputValue])):f?o(d):i(d)};return Hr(T,{children:[Hr("div",{className:"question-container",children:[Hr(Or,{question:e,forceDisableHtml:t}),Hr("fieldset",{className:"multiple-choice-options limit-height",children:[Hr("legend",{className:"sr-only",children:b?" Select all that apply":" Select one"}),c.map((t,n)=>{const i=!!e.hasOpenChoice&&n===e.choices.length-1,o=`surveyQuestion${r}Choice${n}`,s=`${o}Open`,a=i?v.isSelected:y?d===t:Re(d)&&d.includes(t);return Hr("label",{className:i?"choice-option-open":"",children:[Hr("div",{className:"response-choice",children:[Hr("input",{type:y?"radio":"checkbox",name:o,checked:a,onChange:()=>m(t,i),id:o,"aria-controls":s}),Hr("span",{children:i?`${t}:`:t})]}),i&&Hr("input",{type:"text",ref:l,id:s,name:`question${r}Open`,value:v.inputValue,onKeyDown:x,onInput:w,onClick(e){v.isSelected||m(t,!0),e.stopPropagation()},"aria-label":`${t} - please specify`})]},n)})]})]}),Hr(Qr,{text:e.buttonText||"Submit",submitDisabled:k(),appearance:n,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:g,canGoBack:a,onBack:u})]})}const rn=[1,2,3,4,5],nn=[1,2,3,4,5,6,7],on=[0,1,2,3,4,5,6,7,8,9,10],sn={2:[Er,jr],3:[Dr,Br,Lr],5:[Fr,Dr,Br,Lr,Vr]};function an(e){switch(e){case 5:default:return rn;case 7:return nn;case 10:return on}}const un=Ct("[Surveys]");function ln(e,t,r){var n;const i=e.questions[t],o=t+1;if(!(null===(n=i.branching)||void 0===n?void 0:n.type))return t===e.questions.length-1?Me:o;if(i.branching.type===Me)return Me;if("specific_question"===i.branching.type){if(Number.isInteger(i.branching.index))return i.branching.index}else if("response_based"===i.branching.type){if(i.type===Pe){var s;let e=i.choices.indexOf(`${r}`);if(-1===e&&i.hasOpenChoice&&(e=i.choices.length-1),null===(s=i.branching)||void 0===s||null===(s=s.responseValues)||void 0===s?void 0:s.hasOwnProperty(e)){const t=i.branching.responseValues[e];return Number.isInteger(t)?t:t===Me?Me:o}}else if(i.type===$e){var a;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");const e=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,i.scale);if(null===(a=i.branching)||void 0===a||null===(a=a.responseValues)||void 0===a?void 0:a.hasOwnProperty(e)){const t=i.branching.responseValues[e];return Number.isInteger(t)?t:t===Me?Me:o}}return o}return un.warn("Falling back to next question index due to unexpected branching type"),o}const cn=Ct("[SurveyTranslations]");function dn(e,t){const r=function(e){return function({overrideLanguage:e,storedPersonProperties:t,locale:r},n){const i=It(e);if(i)return null==n||n.info(`Using override display language: ${i}`),i;const o=function(e){return e&&"object"==typeof e&&"language"in e?It(e.language):null}(t);if(o)return null==n||n.info(`Using person property language: ${o}`),o;const s=It(r);return s?(null==n||n.info(`Using detected locale: ${s}`),s):(null==n||n.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:Qe(e.get_property)?e.get_property("$stored_person_properties"):void 0,locale:navigator.language||navigator.userLanguage},cn)}(t);if(!r)return cn.info("No user language detected"),{survey:e,language:null};const n=Bt(e,r,cn);return{survey:n.survey,language:n.matchedKey}}const pn=bt,vn=wt,hn="ph:show_survey_widget",fn="PHWidgetSurveyClickListener";function yn(e,t){try{const r=e.getBoundingClientRect(),n=pn.innerHeight,i=pn.innerWidth;let o=r.left+r.width/2-t/2;o+t>i-20&&(o=i-t-20),20>o&&(o=20);const s=n-r.bottom,a=250>s&&r.top>s;return{position:"fixed",top:a?"auto":`${r.bottom+12}px`,left:`${o}px`,right:"auto",bottom:a?n-r.top+12+"px":"auto",zIndex:sr.zIndex}}catch(e){return jt.warn("Failed to calculate trigger position:",e),null}}var bn=class{constructor(e){this.wi=new Map,this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Set,this.Mi=null,this.Ii=!1,this.Ti=null,this.Ri=null,this.$i=null,this.Ei=!1,this.handlePageUnload=()=>{const e=this._posthog.get_property(zt);if(e)for(const t of e)Pr(t)&&hr(t,this._posthog)},this.handlePopoverSurvey=(e,t,{resumeDelayFromActivation:r=!1}={})=>{var n,i,o,s,a,u;if(!Zt(this._posthog))return;const{survey:l,language:c}=this.Ai(e);this.Mi=c,this.$i=null,this.Oi=t;const d=this.Li(l,t);this.Pi(d.id);const{properties:p,initialResponses:v}=null!=t?t:{},h=!(!v||0>=Object.keys(v).length)&&this.Di(d,v,p,c);if(h&&!(null===(n=d.appearance)||void 0===n?void 0:n.displayThankYouMessage))return;this.Fi(d);let f={};if((null===(i=d.appearance)||void 0===i?void 0:i.position)===ke&&(null===(o=d.appearance)||void 0===o?void 0:o.widgetSelector)){const e=vn.querySelector(d.appearance.widgetSelector);var y;e&&(f=yn(e,parseInt((null===(y=d.appearance)||void 0===y?void 0:y.maxWidth)||sr.maxWidth))||{})}const b=(null===(s=d.appearance)||void 0===s?void 0:s.surveyPopupDelaySeconds)||0,{shadow:g}=cr(d,this._posthog);this.xi.set(g,g.host);const m={posthog:this._posthog,survey:d,removeSurveyFromFocus:this.Ni,properties:p,style:f,isSurveyCompleted:h,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:c};if(this.$i=m,0>=b)return this.Ii=!0,W(Hr(kn,ft({},m)),g);const w=()=>{this.Ii=!0;const{survey:r,language:n}=this.Ai(e);this.Mi=n;const i=this.Li(r,t),o=ft(ft({},m),{},{survey:i,surveyLanguage:n});this.$i=o,W(Hr(kn,ft(ft({},o),{},{survey:ft(ft({},i),{},{appearance:ft(ft({},i.appearance),{},{surveyPopupDelaySeconds:0})})})),g)},x=()=>{if(!Zt(this._posthog)||!this.qi(d))return jt.info(`Survey ${d.id} no longer eligible when its display delay elapsed; not displaying`),this.Ni(d);w()},k=r?null===(a=this._posthog.surveys)||void 0===a||null===(a=a._surveyEventReceiver)||void 0===a||null===(u=a.getActivationTimestamp)||void 0===u?void 0:u.call(a,d.id):void 0,S=We(k)?Math.max(0,Date.now()-k):0,C=Math.max(0,1e3*b-S);if(0>=C)return x();const q=pn.setTimeout(()=>{this.wi.delete(d.id),x()},C);this.wi.set(d.id,q)},this.ji=e=>{var t;const{survey:r,language:n}=this.Ai(e),{shadow:i,isNewlyCreated:o}=cr(r,this._posthog);this.xi.set(i,i.host),(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)===ge&&this.Si.set(e.id,e),o&&W(Hr(Cn,{posthog:this._posthog,survey:r,surveyLanguage:n},e.id),i)},this.Bi=e=>{const t=this.ki.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(fn),this.ki.delete(e),jt.info(`Removed click listener for survey ${e}`))},this.Hi=e=>{this.Ui(e)||(this.zi(e),this.Bi(e.id))},this.Wi=e=>{this.Ui(e)||(this.zi(e),this.Si.delete(e.id))},this.Ui=e=>{try{var t;const r=vn.querySelector(Mr(e,!0));return!!(null==r||null===(t=r.shadowRoot)||void 0===t?void 0:t.querySelector(".ph-survey"))}catch(e){return!1}},this.Vi=(e,t)=>{const r=vn.querySelector(t),n=this.ki.get(e.id);if(r){if(this.ji(e),n){if(r===n.element)return;jt.info(`Selector element changed for survey ${e.id}. Re-attaching listener.`),this.Bi(e.id)}if(!r.hasAttribute(fn)){const t=t=>{var r,n;t.stopPropagation();const i=(null===(r=e.appearance)||void 0===r?void 0:r.position)===ke?yn(t.currentTarget,parseInt((null===(n=e.appearance)||void 0===n?void 0:n.maxWidth)||sr.maxWidth)):{};pn.dispatchEvent(new CustomEvent(hn,{detail:{surveyId:e.id,position:i}}))};qt(r,"click",t),r.setAttribute(fn,"true"),this.ki.set(e.id,{element:r,listener:t,survey:e}),jt.info(`Attached click listener for feedback button survey ${e.id}`)}}else n&&this.Hi(e)},this.renderPopover=e=>{if(!Zt(this._posthog))return;const{survey:t,language:r}=this.Ai(e),{shadow:n}=cr(t,this._posthog);this.xi.set(n,n.host),W(Hr(kn,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Ni,surveyLanguage:r}),n)},this.renderSurvey=(e,t,r)=>{var n;if(!Zt(this._posthog))return;const{survey:i,language:o}=this.Ai(e);let s=!1;(null===(n=this._posthog.config)||void 0===n||null===(n=n.surveys)||void 0===n?void 0:n.prefillFromUrl)&&(s=this.Zi(i,o,r)),W(Hr(kn,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Ni,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:o}),t)},this.getActiveMatchingSurveys=(e,t=!1)=>{var r;null===(r=this._posthog)||void 0===r||null===(r=r.surveys)||void 0===r||r.getSurveys(t=>{e(t.filter(e=>this.qi(e)))},t)},this.callSurveysAndEvaluateDisplayLogic=(e=!1)=>{this.getActiveMatchingSurveys(e=>{const t=Zt(this._posthog),r=e.filter(e=>t&&(e.type===Se||e.type===Ce)),n=new Set(r.map(e=>e.id));for(const e of Array.from(this.wi.keys()))n.has(e)||this.cancelSurvey(e);const i=this.Gi(r),o=new Set,s=new Set;i.forEach(e=>{if(e.type===Ce){var t,r,n,i;if((null===(t=e.appearance)||void 0===t?void 0:t.widgetType)===ge)return s.add(e.id),void this.ji(e);"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&(null===(n=e.appearance)||void 0===n?void 0:n.widgetSelector)&&(o.add(e.id),this.Vi(e,null===(i=e.appearance)||void 0===i?void 0:i.widgetSelector))}Ue(this.Qi)&&e.type===Se&&this.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})}),this.ki.forEach(({survey:e})=>{o.has(e.id)||this.Hi(e)}),this.Si.forEach((e,t)=>{s.has(t)||this.Wi(e)})},e)},this.Fi=e=>{Ue(this.Qi)||jt.error(`Survey ${this.Qi} already in focus. Cannot add survey ${e.id}.`),this.Qi=e.id},this.Ni=e=>{this.Qi!==e.id&&jt.error(`Survey ${e.id} is not in focus. Cannot remove survey ${e.id}.`),this.Pi(e.id),this.Qi=null,this.Mi=null,this.Ii=!1,this.$i=null,this.Oi=void 0,this.zi(e)},this._posthog=e,this.Qi=null,this.Ti=()=>this.Ji(),qt(pn,"languagechange",this.Ti),this.Ri=e.onFeatureFlags(()=>this.Ji())}Ji(){if(Ue(this.Qi))return;const e=this._posthog.get_property(zt),t=null==e?void 0:e.find(e=>e.id===this.Qi);if(!t)return;const{survey:r,language:n}=this.Ai(t);if(n===this.Mi)return;if(this.Mi=n,!this.Ii)return;const i=this.Li(r,this.Oi),{shadow:o}=cr(i,this._posthog);W(Hr(kn,ft(ft({},this.$i),{},{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Ni,surveyLanguage:n})),o)}get Ki(){var e,t,r;return null!==(e=null===(t=(r=this._posthog).getExtension)||void 0===t?void 0:t.call(r,"featureFlags"))&&void 0!==e?e:this._posthog.featureFlags}Li(e,t){return(null==t?void 0:t.position)||(null==t?void 0:t.selector)?ft(ft({},e),{},{appearance:ft(ft(ft({},e.appearance),t.position&&{position:t.position}),t.selector&&{widgetSelector:t.selector})}):e}Pi(e){const t=this.wi.get(e);t&&(clearTimeout(t),this.wi.delete(e))}cancelSurvey(e){this.wi.has(e)&&(jt.info(`Cancelled pending survey ${e}`),this.Pi(e),this.Qi===e&&(this.Qi=null,this.Mi=null,this.Ii=!1,this.$i=null,this.Oi=void 0))}setAutomaticDisplayDispose(e){this.Xi=e}dispose(){var e;null===(e=this.Xi)||void 0===e||e.call(this),this.Xi=void 0,this.Ti&&(pn.removeEventListener("languagechange",this.Ti),this.Ti=null),this.Ri&&(this.Ri(),this.Ri=null),this.wi.forEach((e,t)=>this.Pi(t)),this.ki.forEach((e,t)=>this.Bi(t)),this.xi.forEach((e,t)=>{W(null,t),null==e||e.remove()}),this.xi.clear(),this.Si.clear(),this.Qi=null}Gi(e){return e.sort((e,t)=>{var r,n;const i=Pr(e),o=Pr(t);if(i&&!o)return-1;if(!i&&o)return 1;const s=e.schedule===Ie,a=t.schedule===Ie;return s&&!a?1:!s&&a?-1:((null===(r=e.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)-((null===(n=t.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)})}Ai(e){return dn(e,this._posthog)}Zi(e,t,r){if(this.Ci.has(e.id))return!1;const{params:n}=function(e){const t={};let r=!1;const n=e.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:r};const i=n.split("&");for(const e of i){const[n,i]=e.split("=");if(!n||Oe(i))continue;const o=decodeURIComponent(n),s=decodeURIComponent(i);if("auto_submit"===o&&"true"===s){r=!0;continue}const a=o.match(/^q(\d+)$/);if(a){const e=parseInt(a[1],10);t[e]||(t[e]=[]),t[e].push(s)}}return{params:t,autoSubmit:r}}(pn.location.search);if(0===Object.keys(n).length)return!1;jt.info("[Survey Prefill] Detected URL prefill parameters");const i=this.Yi(e,n,t);return!!i&&(this.tr(e,i,r,t),this.Ci.add(e.id),i.isSurveyCompleted)}tr(e,t,r,n){const{responses:i,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=t;(Object.keys(a).length>0&&e.enable_partial_responses||s)&&dr({responses:s?i:a,survey:e,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:s,properties:r,surveyLanguage:n})}Di(e,t,r,n){const i={};for(const[e,r]of Object.entries(t))i[parseInt(e)]=Re(r)?r.map(String):[String(r)];jt.info("[Survey] Processing initial responses");const o=this.Yi(e,i,n);return!!o&&(this.tr(e,o,r,n),o.isSurveyCompleted)}Yi(e,t,r){try{const n=function(e,t){const r={};return e.questions.forEach((e,n)=>{if(!t[n]||!e.id)return;const i=t[n],o=_t(e.id);try{switch(e.type){case Pe:{if(!e.choices||0===e.choices.length)return void St.warn(`[Survey Prefill] Question ${n} has no choices`);const t=parseInt(i[0],10);if(isNaN(t)||0>t||t>=e.choices.length)return void St.warn(`[Survey Prefill] Invalid choice index for q${n}: ${i[0]}`);r[o]=e.choices[t];break}case Te:{if(!e.choices||0===e.choices.length)return void St.warn(`[Survey Prefill] Question ${n} has no choices`);const t=i.map(e=>parseInt(e,10)).filter(t=>!isNaN(t)&&t>=0&&e.choices.length>t);if(0===t.length)return void St.warn(`[Survey Prefill] No valid choices for q${n}`);const s=[...new Set(t.map(t=>e.choices[t]))];t.length>s.length&&St.warn(`[Survey Prefill] Removed duplicate choices for q${n}`),r[o]=s;break}case $e:{const t=parseInt(i[0],10),s=e.scale||10;if(isNaN(t)||0>t||t>s)return void St.warn(`[Survey Prefill] Invalid rating for q${n}: ${i[0]} (scale: 0-${s})`);r[o]=t;break}default:St.info(`[Survey Prefill] Question type ${e.type} does not support prefill`)}}catch(e){St.error(`[Survey Prefill] Error converting q${n}:`,e)}}),r}(e,t);if(0===Object.keys(n).length)return jt.warn("[Survey Prefill] No valid responses after conversion"),null;const i=Jt(),{startQuestionIndex:o,skippedResponses:s,skippedIndices:a}=function(e,t,r){let n=0;const i={},o=[],s=e.questions.length+1;let a=0;for(;e.questions.length>n&&s>a&&(a++,t.includes(n));){const t=e.questions[n];if(!t||!("skipSubmitButton"in t)||!t.skipSubmitButton)break;if(t.id){const e=_t(t.id);Oe(r[e])||(i[e]=r[e])}o.push(n);const s=ln(e,n,t.id?r[_t(t.id)]:null);if(s===Me)return{startQuestionIndex:e.questions.length,skippedResponses:i,skippedIndices:o};n=s}return{startQuestionIndex:n,skippedResponses:i,skippedIndices:o}}(e,Object.keys(t).map(e=>parseInt(e,10)),n),u=o>=e.questions.length;return _r(e,{surveySubmissionId:i,responses:n,lastQuestionIndex:o,questionOrder:br(e.questions),visitedIndices:a,surveyLanguage:r}),jt.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:n,submissionId:i,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:s}}catch(e){return jt.error("[Survey Prefill] Error handling prefill:",e),null}}er(e,t=void 0){if(!e)return!0;const r=this.Ki,n=!!(null==r?void 0:r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}));let i=!0;t&&(i=(null==r?void 0:r.getFeatureFlag(e,{send_event:!1}))===t||"any"===t);const o=n&&i;return o||this.nr(e),o}nr(e){var t;!this.Ei&&(null===(t=this._posthog.config)||void 0===t?void 0:t.advanced_disable_feature_flags)&&(this.Ei=!0,jt.warn(`Survey feature flag "${e}" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.`))}ir(e){return!e.conditions||Sr(e,this._posthog)&&Cr(e)&&function(e){var t;return!(null===(t=e.conditions)||void 0===t?void 0:t.selector)||!!(null==ir?void 0:ir.querySelector(e.conditions.selector))}(e)}rr(e){var t;return mr(e)?{satisfied:!0}:e.internal_targeting_flag_key&&function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)&&!(null===(t=this.Ki)||void 0===t?void 0:t.hasLoadedFlags)?(this.nr(e.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.er(e.internal_targeting_flag_key)}}checkSurveyEligibility(e){var t,r;const n={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return n.eligible=!1,n.reason=`Survey is not running. It was completed on ${e.end_date}`,n;if(!Ot.includes(e.type))return n.eligible=!1,n.reason=`Surveys of type ${e.type} are never eligible to be shown in the app`,n;const i=null===(t=e.conditions)||void 0===t?void 0:t.linkedFlagVariant;if(!this.er(e.linked_flag_key,i))return n.eligible=!1,n.reason=i?`Survey linked feature flag is not enabled for variant ${i}`:"Survey linked feature flag is not enabled",n;if(!this.er(e.targeting_flag_key))return n.eligible=!1,n.reason="Survey targeting feature flag is not enabled",n;const o=this.rr(e);var s;return o.satisfied?function(e,t){if(!e||!t)return!0;const r="string"==typeof t?new Date(t):t,n=Math.abs((new Date).getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null===(r=e.conditions)||void 0===r?void 0:r.seenSurveyWaitPeriodInDays,tr.Ot("lastSeenSurveyDate"))?(e=>!!tr.Ot(Rt(e))&&!mr(e))(e)?(n.eligible=!1,n.reason="Survey has already been seen and it can't be activated again",n):n:(n.eligible=!1,n.reason="Survey wait period has not passed",n):(n.eligible=!1,n.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",n)}checkSurveyCaptureEligibility(){return Zt(this._posthog)?{eligible:!0}:{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"}}checkSurveyDisplayEligibility(e){const t=this.checkSurveyCaptureEligibility();return t.eligible?this.checkSurveyEligibility(e):t}checkSurveyRenderability(e){const t=this.checkSurveyDisplayEligibility(e);return t.eligible&&!this.sr(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}sr(e){var t;if(!Dt(e)&&!function(e){var t;return!!(null===(t=e.conditions)||void 0===t||null===(t=t.actions)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)}(e))return!0;const r=null===(t=this._posthog.surveys)||void 0===t||null===(t=t._surveyEventReceiver)||void 0===t?void 0:t.getSurveys();return!!(null==r?void 0:r.includes(e.id))}ar(e){var t;return!(null===(t=e.feature_flag_keys)||void 0===t?void 0:t.length)||e.feature_flag_keys.every(({key:e,value:t})=>!e||!t||this.er(t))}qi(e){return this.checkSurveyEligibility(e).eligible&&this.ir(e)&&this.sr(e)&&this.ar(e)}zi(e){try{const t=vn.querySelector(Mr(e,!0));(null==t?void 0:t.shadowRoot)&&(W(null,t.shadowRoot),this.xi.delete(t.shadowRoot)),null==t||t.remove()}catch(t){jt.warn(`Failed to remove survey ${e.id} from DOM:`,t)}}getTestAPI(){return{addSurveyToFocus:this.Fi,removeSurveyFromFocus:this.Ni,surveyInFocus:this.Qi,surveyTimeouts:this.wi,handleWidget:this.ji,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Vi,sortSurveysByAppearanceDelay:this.Gi,checkFlags:this.ar.bind(this),isSurveyFeatureFlagEnabled:this.er.bind(this),onLanguageChange:this.Ji.bind(this),currentLanguage:this.Mi,surveyIsRendered:this.Ii}}};function gn(e,t){if(!vn||!pn)return;const r=new bn(e);if(e.config.disable_surveys_automatic_display)return jt.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===t)return jt.info("There are no surveys to load or Surveys is disabled in the project settings."),r;let n;r.callSurveysAndEvaluateDisplayLogic(!0);const i=()=>{Oe(n)&&(n=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{Oe(n)||(clearInterval(n),n=void 0)};i();const s=()=>{vn.hidden?o():(r.callSurveysAndEvaluateDisplayLogic(!1),i())};return qt(vn,"visibilitychange",s),r.setAutomaticDisplayDispose(()=>{o(),vn.removeEventListener("visibilitychange",s)}),r}function mn({survey:e,removeSurveyFromFocus:t=()=>{},setSurveyVisible:r,isPreviewMode:n=!1,posthog:i}){ae(()=>{var o;if(n||!(null===(o=e.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var n;const o=e.type===Ce,s=Sr(e,i),a=(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)===ge&&o;if(!s)return jt.info(`Hiding survey ${e.id} because URL does not match`),r(!1),t(e);a&&(jt.info(`Showing survey ${e.id} because it is a feedback button tab and URL matches`),r(!0))};qt(pn,"popstate",s),qt(pn,"hashchange",s);const a=pn.history.pushState,u=pn.history.replaceState;return pn.history.pushState=function(...e){a.apply(this,e),s()},pn.history.replaceState=function(...e){u.apply(this,e),s()},()=>{pn.removeEventListener("popstate",s),pn.removeEventListener("hashchange",s),pn.history.pushState=a,pn.history.replaceState=u}},[n,e,t,r,i])}const wn=200;function xn(e="right"){switch(e){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function kn({survey:e,forceDisableHtml:t,posthog:r,style:n={},previewPageIndex:i,removeSurveyFromFocus:o=()=>{},isPopup:s=!0,onPreviewSubmit:a=()=>{},onPreviewBack:u=()=>{},onPopupSurveyDismissed:l=()=>{},onCloseConfirmationMessage:c=()=>{},properties:d,isSurveyCompleted:p,skipShownEvent:v,surveyLanguage:h}){var f,y,b,g,m,w,x,k,S,C,q,_;const T=ue(null),P=Number.isInteger(i),{isPopupVisible:M,isSurveySent:I,hidePopupWithAnimation:N}=function(e,t,r,n,i,o,s,a,u){const[l,c]=se(n||0===r||e.type===qe),[d,p]=se(!1),v=ue(!1),h=()=>{const t=()=>{o&&i(e),c(!1)};if(v.current)return;const r=null==s?void 0:s.current;r?(v.current=!0,r.style.transition=`opacity ${wn}ms ease-out`,r.style.opacity="0",setTimeout(()=>{v.current=!1,t()},250)):t()},f=t=>{t.detail.surveyId===e.id&&h()};return ae(()=>{if(!t)return void jt.error("usePopupVisibility hook called without a PostHog instance.");if(n)return;let i;const o=t=>{var r,n;if(t.detail.surveyId===e.id){if(!(null===(r=e.appearance)||void 0===r?void 0:r.displayThankYouMessage))return h();p(!0),(null===(n=e.appearance)||void 0===n?void 0:n.autoDisappear)&&(i&&clearTimeout(i),i=setTimeout(h,5e3))}},s=()=>{if(Sr(e,t)){var r;c(!0),pn.dispatchEvent(new Event("PHSurveyShown")),a||t.capture("survey shown",ft(ft({[He]:e.name,[Ne]:e.id,[Le]:e.current_iteration,[Be]:e.current_iteration_start_date},u&&{[Ee]:u}),{},{sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t)}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};qt(pn,"PHSurveyClosed",f),qt(pn,"PHSurveySent",o);const l=r>0?setTimeout(s,r):void 0;return Oe(l)&&s(),()=>{Oe(l)||clearTimeout(l),Oe(i)||clearTimeout(i),pn.removeEventListener("PHSurveyClosed",f),pn.removeEventListener("PHSurveySent",o)}},[]),mn({survey:e,removeSurveyFromFocus:i,setSurveyVisible:c,isPreviewMode:n,posthog:t}),{isPopupVisible:l,isSurveySent:d,setIsPopupVisible:c,hidePopupWithAnimation:h}}(e,r,(null===(f=e.appearance)||void 0===f?void 0:f.surveyPopupDelaySeconds)?1e3*e.appearance.surveyPopupDelaySeconds:0,P,o,s,T,v,h),H=I||i===e.questions.length||!0===p,[L,B]=se(!1),D=le(()=>!!Tr(e),[e]),F=!(!(null===(y=e.appearance)||void 0===y?void 0:y.introScreenHeader)&&!(null===(b=e.appearance)||void 0===b?void 0:b.introScreenDescription)),V=P?-1===i:!!(null===(g=e.appearance)||void 0===g?void 0:g.displayIntroScreen)&&F&&!L&&!D,E=le(()=>{const t=Tr(e),n=(null==t?void 0:t.surveySubmissionId)||Jt();return{isPreviewMode:P,previewPageIndex:i,onPopupSurveyDismissed(){h?vr(e,r,P,h):vr(e,r,P),l()},isPopup:s||!1,surveySubmissionId:n,onPreviewSubmit:a,onPreviewBack:u,posthog:r,properties:d,surveyLanguage:h}},[P,i,s,r,e,l,a,u,d,h]);return M?Hr(wr.Provider,{value:E,children:Hr("div",{className:"ph-survey",style:ft(ft({},Ir(e.type,null===(m=e.appearance)||void 0===m?void 0:m.position,null===(w=e.appearance)||void 0===w?void 0:w.widgetType)),n),ref:T,children:H?Hr(Gr,{header:(null===(x=e.appearance)||void 0===x?void 0:x.thankYouMessageHeader)||"Thank you!",description:(null===(k=e.appearance)||void 0===k?void 0:k.thankYouMessageDescription)||"",forceDisableHtml:!!t,contentType:null===(S=e.appearance)||void 0===S?void 0:S.thankYouMessageDescriptionContentType,appearance:e.appearance||sr,onClose(){N(),c()}}):V?Hr(Wr,{header:(null===(C=e.appearance)||void 0===C?void 0:C.introScreenHeader)||"",description:(null===(q=e.appearance)||void 0===q?void 0:q.introScreenDescription)||"",forceDisableHtml:!!t,contentType:null===(_=e.appearance)||void 0===_?void 0:_.introScreenDescriptionContentType,appearance:e.appearance||sr,onStart:()=>B(!0)}):Hr(Sn,{survey:e,forceDisableHtml:!!t,posthog:r})})}):null}function Sn({survey:e,forceDisableHtml:t,posthog:r}){var n,i;const o=le(()=>{const t=Tr(e);if(!t)return null;const r=We(t.lastQuestionIndex);return!r||r&&t.lastQuestionIndex>=0&&e.questions.length>t.lastQuestionIndex?t:($r(e),null)},[e]),[s,a]=se(()=>((null==o?void 0:o.responses)&&jt.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{})),[u,l]=se(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:p,onPreviewSubmit:v,onPreviewBack:h,surveySubmissionId:f,isPreviewMode:y,properties:b,surveyLanguage:g}=ce(wr),[m,w]=se(()=>{const t=null==o?void 0:o.lastQuestionIndex,r=We(t)&&t>=0&&e.questions.length>t?t:0;return We(c)&&c>=0?c:r}),[x,k]=se(()=>{var t;return(null!==(t=null==o?void 0:o.visitedIndices)&&void 0!==t?t:[]).filter(t=>t>=0&&e.questions.length>t)}),[S,C]=se(()=>{var t;const r=Tr(e);return null!==(t=null==r?void 0:r.questionSnapshots)&&void 0!==t?t:{}}),q=le(()=>br(gr(e,o)),[e.id,o]),_=le(()=>{if(!q||new Set(q).size!==q.length)return gr(e,o);const t=new Map(e.questions.map(e=>[e.id,e])),r=q.map(e=>t.get(e)).filter(e=>!!e);return r.length===q.length?r:e.questions},[q,e.questions,e,o]);ae(()=>{!y||Oe(c)||0>c||w(c)},[c,y]);const T=!!(null===(n=e.appearance)||void 0===n?void 0:n.allowGoBack)&&(y?(null!=c?c:0)>0:x.length>0),P=_.at(m);return P?Hr("form",{className:"survey-form",name:"surveyForm",children:[p&&!0!==(null===(i=e.appearance)||void 0===i?void 0:i.hideCancelButton)&&Hr(zr,{onClick(){d()}}),Hr("div",{className:"survey-box","data-question-index":m,children:[u&&Hr("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),qn({question:P,forceDisableHtml:t,displayQuestionIndex:m,appearance:e.appearance||sr,onSubmit:t=>(({res:t,displayQuestionIndex:n,questionId:i})=>{if(!r)return void jt.error("onNextButtonClick called without a PostHog instance.");if(!Zt(r))return void l(!0);if(l(!1),!i)return void jt.error("onNextButtonClick called without a questionId.");const o=_t(i),u=ft(ft({},s),{},{[o]:t});a(u);const c=_[n],d=(null==c?void 0:c.id)?ft(ft({},S),{},{[c.id]:c.question}):S;C(d);const p=ln(e,n,t),v=p===Me,h=[...x,n];if(v||(k(h),w(p),_r(e,{surveySubmissionId:f,responses:u,lastQuestionIndex:p,questionOrder:br(_),visitedIndices:h,surveyLanguage:g,questionSnapshots:d})),e.enable_partial_responses||v){const t=new Set(h.map(e=>{var t;return null===(t=_[e])||void 0===t?void 0:t.id}).filter(e=>!!e).map(e=>_t(e))),n=Object.fromEntries(Object.entries(u).filter(([e])=>t.has(e)));dr({responses:n,survey:e,surveySubmissionId:f,isSurveyCompleted:v,posthog:r,properties:b,surveyLanguage:g,questionSnapshots:d})}})({res:t,displayQuestionIndex:m,questionId:P.id}),onPreviewSubmit:v,initialValue:P.id?s[_t(P.id)]:void 0,canGoBack:T,onBack(){if(y)return void h();if(0===x.length)return;const t=x[x.length-1],r=x.slice(0,-1);k(r),w(t),_r(e,{surveySubmissionId:f,responses:s,lastQuestionIndex:t,questionOrder:br(_),visitedIndices:r,surveyLanguage:g,questionSnapshots:S})}})]})]}):null}function Cn({survey:e,forceDisableHtml:t,posthog:r,readOnly:n,surveyLanguage:i}){var o,s,a,u,l,c,d;const[p,v]=se(!0),[h,f]=se(!1),[y,b]=se({}),g=ue(void 0),m=()=>{(h||!r||n||Zt(r))&&f(!h)};if(ae(()=>{var t;if(!r)return void jt.error("FeedbackWidget called without a PostHog instance.");if(n)return;"tab"===(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)&&b({top:"50%",bottom:"auto"});const i=t=>{var r;const n=t;(null===(r=n.detail)||void 0===r?void 0:r.surveyId)===e.id&&(jt.info(`Received show event for feedback button survey ${e.id}`),b(n.detail.position||{}),m())};return qt(pn,hn,i),()=>{Oe(g.current)||(clearTimeout(g.current),g.current=void 0),pn.removeEventListener(hn,i)}},[r,n,e.id,null===(o=e.appearance)||void 0===o?void 0:o.widgetType,null===(s=e.appearance)||void 0===s?void 0:s.widgetSelector,null===(a=e.appearance)||void 0===a?void 0:a.borderColor]),mn({survey:e,setSurveyVisible:v,posthog:r}),!p)return null;const w=()=>{e.schedule!==Ie&&v(!1),Oe(g.current)||clearTimeout(g.current),g.current=setTimeout(()=>{g.current=void 0,f(!1)},200)};return Hr(T,{children:["tab"===(null===(u=e.appearance)||void 0===u?void 0:u.widgetType)&&Hr("button",{className:"ph-survey-widget-tab "+("top"===(null===(l=e.appearance)||void 0===l?void 0:l.tabPosition)?"widget-tab-top":""),onClick:m,disabled:n,style:xn(null===(c=e.appearance)||void 0===c?void 0:c.tabPosition),children:(null===(d=e.appearance)||void 0===d?void 0:d.widgetLabel)||""}),h&&Hr(kn,{posthog:r,survey:e,forceDisableHtml:t,style:y,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:i})]})}const qn=({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:u})=>{const l={forceDisableHtml:t,appearance:n,onPreviewSubmit(e){o(e)},onSubmit(e){i(e)},initialValue:s,displayQuestionIndex:r,canGoBack:a,onBack:u};switch(e.type){case _e:return q(Yr,ft(ft({},l),{},{question:e,key:e.id}));case"link":return q(Jr,ft(ft({},l),{},{question:e,key:e.id}));case $e:return q(Xr,ft(ft({},l),{},{question:e,key:e.id}));case Pe:case Te:return q(tn,ft(ft({},l),{},{question:e,key:e.id}));default:return jt.error(`Unsupported question type: ${e.type}`),null}},_n="undefined"!=typeof globalThis?globalThis:bt;_n&&"undefined"==typeof self&&(_n.self=_n),_n&&"undefined"==typeof File&&(_n.File=function(){});const Tn=null!=bt?bt:{};Tn.__PosthogExtensions__=Tn.__PosthogExtensions__||{},Tn.__PosthogExtensions__.generateSurveys=gn,Tn.extendPostHogWithSurveys=gn}();
2
2
  //# sourceMappingURL=surveys.js.map