@mcpjam/inspector 3.12.3 → 3.12.5

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 (37) hide show
  1. package/README.md +29 -21
  2. package/bin/access-link.mjs +53 -0
  3. package/bin/start.js +47 -14
  4. package/dist/client/assets/OAuthDesktopReturnNotice-B_x9xTE-.css +2 -0
  5. package/dist/client/assets/OAuthDesktopReturnNotice-LlC451lX.js +11 -0
  6. package/dist/client/assets/{app-bootstrap-C1Jn01kP.js → app-bootstrap-2jatN7gw.js} +376 -374
  7. package/dist/client/assets/{button-RD2Dghjp.js → button-B2OH2ei2.js} +2 -2
  8. package/dist/client/assets/{chunk-YOKDWASO-DTTU1wSE.js → chunk-YOKDWASO-uJ3KOQV7.js} +5 -5
  9. package/dist/client/assets/{dead-clicks-autocapture-CDkbT21a.js → dead-clicks-autocapture-D055GjVp.js} +2 -2
  10. package/dist/client/assets/{error-reporting-Dg5b1JwS.js → error-reporting-DGP36KLx.js} +57 -57
  11. package/dist/client/assets/{error-reporting-_SEhX6IL.js → error-reporting-FWZKbZxG.js} +1 -1
  12. package/dist/client/assets/{exception-autocapture-CtxHwPtn.js → exception-autocapture-103gdJjL.js} +2 -2
  13. package/dist/client/assets/{failed-request-tracker-kUaJ-sVM.js → failed-request-tracker-Cp9_VFMm.js} +2 -2
  14. package/dist/client/assets/{highlighted-body-KPVGNVTW-CBC2hHHb.js → highlighted-body-KPVGNVTW-Dx70h1nm.js} +2 -2
  15. package/dist/client/assets/index-rskHnM3O.js +4 -0
  16. package/dist/client/assets/{jszip.min-B3Qii_az.js → jszip.min-CwJyI5tb.js} +2 -2
  17. package/dist/client/assets/{mermaid-HWGCJPDP-BzT3-9sO.js → mermaid-HWGCJPDP-Ck3prJKl.js} +1 -1
  18. package/dist/client/assets/{posthog-recorder-B06ULcLl.js → posthog-recorder-tKuMFijV.js} +2 -2
  19. package/dist/client/assets/{preload-helper-DvWwGI6x.js → preload-helper-DrcoTQ49.js} +2 -2
  20. package/dist/client/assets/{rolldown-runtime-DVMSi0Yr.js → rolldown-runtime-7FnpGOz6.js} +1 -1
  21. package/dist/client/assets/{surveys-D941hgn3.js → surveys-BsZYxM6N.js} +2 -2
  22. package/dist/client/assets/{trace-timeline-Bk3hAXNq.js → trace-timeline-BOZvHcOG.js} +1 -1
  23. package/dist/client/assets/{trace-timeline-DVZqlQSW.js → trace-timeline-Bf9Oai70.js} +8 -8
  24. package/dist/client/assets/{web-vitals-DZUBt4dL.js → web-vitals-DdzaVN3H.js} +2 -2
  25. package/dist/client/index.html +7 -7
  26. package/dist/server/chunk-3EDQFXTF.js +4801 -0
  27. package/dist/server/{chunk-5RE7KJ2M.js → chunk-4PYR7GMQ.js} +16 -197
  28. package/dist/server/{chunk-WGJHSGJP.js → chunk-QA6VJT6A.js} +961 -963
  29. package/dist/server/chunk-SH24KJBI.js +194 -0
  30. package/dist/server/{consent-lifetime-PTGAZQSU.js → consent-lifetime-M7PS6RUU.js} +3 -2
  31. package/dist/server/harness-install-cli.js +1 -1
  32. package/dist/server/index.js +15110 -16012
  33. package/dist/server/local-turn-XXOSZHMT.js +12 -0
  34. package/package.json +14 -11
  35. package/dist/client/assets/OAuthDesktopReturnNotice-C5D90OSm.js +0 -11
  36. package/dist/client/assets/OAuthDesktopReturnNotice-C95FI7VH.css +0 -2
  37. package/dist/client/assets/index-yOjxp36p.js +0 -4
@@ -1,3 +1,3 @@
1
- (function(){try{var U=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};U.SENTRY_RELEASE={id:"3.12.3"};var E=new U.Error().stack;E&&(U._sentryDebugIds=U._sentryDebugIds||{},U._sentryDebugIds[E]="087ac3cc-4491-4179-996c-ffa72892ccc5",U._sentryDebugIdIdentifier="sentry-dbid-087ac3cc-4491-4179-996c-ffa72892ccc5")}catch{}})();(function(){var U,E,dt,ne,rr,nr,ir,pt,Oe,Te,or,ht,vt,ft,sr,ve,B,yt,ar,je={},Ue=[],Mn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ze=Array.isArray;function Q(e,t){for(var r in t)e[r]=t[r];return e}function gt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ie(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?U.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Ie(e,a,n,i,null)}function Ie(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++dt,__i:-1,__u:0};return i==null&&E.vnode!=null&&E.vnode(o),o}function W(e){return e.children}function Qe(e,t){this.props=e,this.context=t}function fe(e,t){if(t==null)return e.__?fe(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?fe(e):null}function Ln(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],i=[],o=Q({},t);o.__v=t.__v+1,E.vnode&&E.vnode(o),_t(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,r??fe(t),!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,hr(n,o,i),t.__e=t.__=null,o.__e!=r&&lr(o)}}function lr(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),lr(e)}function mt(e){(!e.__d&&(e.__d=!0)&&ne.push(e)&&!ze.__r++||rr!=E.debounceRendering)&&((rr=E.debounceRendering)||nr)(ze)}function ze(){try{for(var e,t=1;ne.length;)ne.length>t&&ne.sort(ir),e=ne.shift(),t=ne.length,Ln(e)}finally{ne.length=ze.__r=0}}function ur(e,t,r,n,i,o,a,u,c,l,d){var p,s,h,g,_,v,m,y=n&&n.__k||Ue,w=t.length;for(c=En(r,t,y,c,w),p=0;w>p;p++)(h=r.__k[p])!=null&&(s=h.__i!=-1&&y[h.__i]||je,h.__i=p,v=_t(e,h,s,i,o,a,u,c,l,d),g=h.__e,h.ref&&s.ref!=h.ref&&(s.ref&&wt(s.ref,null,h),d.push(h.ref,h.__c||g,h)),_==null&&g!=null&&(_=g),(m=!!(4&h.__u))||s.__k===h.__k?(c=cr(h,c,e,m),m&&s.__e&&(s.__e=null)):typeof h.type=="function"&&v!==void 0?c=v:g&&(c=g.nextSibling),h.__u&=-7);return r.__e=_,c}function En(e,t,r,n,i){var o,a,u,c,l,d=r.length,p=d,s=0;for(e.__k=new Array(i),o=0;i>o;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[o]=Ie(null,a,null,null,null):Ze(a)?a=e.__k[o]=Ie(W,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[o]=Ie(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,c=o+s,a.__=e,a.__b=e.__b+1,u=null,(l=a.__i=$n(a,r,c,p))!=-1&&(p--,(u=r[l])&&(u.__u|=2)),u==null||u.__v==null?(l==-1&&(i>d?s--:d>i&&s++),typeof a.type!="function"&&(a.__u|=4)):l!=c&&(l==c-1?s--:l==c+1?s++:(l>c?s--:s++,a.__u|=4))):e.__k[o]=null;if(p)for(o=0;d>o;o++)(u=r[o])!=null&&!(2&u.__u)&&(u.__e==n&&(n=fe(u)),fr(u,u));return n}function cr(e,t,r,n){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&i.length>o;o++)i[o]&&(i[o].__=e,t=cr(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=fe(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function $n(e,t,r,n){var i,o,a,u=e.key,c=e.type,l=t[r],d=l!=null&&!(2&l.__u);if(l===null&&u==null||d&&u==l.key&&c==l.type)return r;if(n>(d?1:0)){for(i=r-1,o=r+1;i>=0||t.length>o;)if((l=t[a=0>i?o++:i--])!=null&&!(2&l.__u)&&u==l.key&&c==l.type)return a}return-1}function dr(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Mn.test(t)?r:r+"px"}function We(e,t,r,n,i){var o,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||dr(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||dr(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(or,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r[Te]=n[Te]:(r[Te]=ht,e.addEventListener(t,o?ft:vt,o)):e.removeEventListener(t,o?ft:vt,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function pr(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[Oe]==null)t[Oe]=ht++;else if(r[Te]>t[Oe])return;return r(E.event?E.event(t):t)}}}function _t(e,t,r,n,i,o,a,u,c,l){var d,p,s,h,g,_,v,m,y,w,P,S,M,D,b,C,k=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),o=[u=t.__e=r.__e]),(d=E.__b)&&d(t);e:if(typeof k=="function"){p=a.length;try{if(y=t.props,w=k.prototype&&k.prototype.render,P=(d=k.contextType)&&n[d.__c],S=d?P?P.props.value:d.__:n,r.__c?m=(s=t.__c=r.__c).__=s.__E:(w?t.__c=s=new k(y,S):(t.__c=s=new Qe(y,S),s.constructor=k,s.render=Dn),P&&P.sub(s),s.state||(s.state={}),s.__n=n,h=s.__d=!0,s.__h=[],s._sb=[]),w&&s.__s==null&&(s.__s=s.state),w&&k.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=Q({},s.__s)),Q(s.__s,k.getDerivedStateFromProps(y,s.__s))),g=s.props,_=s.state,s.__v=t,h)w&&k.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),w&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(w&&k.getDerivedStateFromProps==null&&y!==g&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(y,S),t.__v==r.__v||!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(y,s.__s,S)===!1){t.__v!=r.__v&&(s.props=y,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(q){q&&(q.__=t)}),Ue.push.apply(s.__h,s._sb),s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(y,s.__s,S),w&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(g,_,v)})}if(s.context=S,s.props=y,s.__P=e,s.__e=!1,M=E.__r,D=0,w)s.state=s.__s,s.__d=!1,M&&M(t),d=s.render(s.props,s.state,s.context),Ue.push.apply(s.__h,s._sb),s._sb=[];else do s.__d=!1,M&&M(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&25>++D);s.state=s.__s,s.getChildContext!=null&&(n=Q(Q({},n),s.getChildContext())),w&&!h&&s.getSnapshotBeforeUpdate!=null&&(v=s.getSnapshotBeforeUpdate(g,_)),b=d!=null&&d.type===W&&d.key==null?vr(d.props.children):d,u=ur(e,Ze(b)?b:[b],t,r,n,i,o,a,u,c,l),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),m&&(s.__E=s.__=null)}catch(q){if(a.length=p,t.__v=null,c||o!=null)if(q.then){for(t.__u|=c?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;o!=null&&(o[o.indexOf(u)]=null),t.__e=u}else{if(o!=null)for(C=o.length;C--;)gt(o[C]);bt(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),q.then||bt(t);E.__e(q,t,r)}}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):u=t.__e=Hn(r.__e,t,r,n,i,o,a,c,l);return(d=E.diffed)&&d(t),128&t.__u?void 0:u}function bt(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(bt))}function hr(e,t,r){for(var n=0;r.length>n;n++)wt(r[n],r[++n],r[++n]);E.__c&&E.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){E.__e(o,i.__v)}})}function vr(e){return typeof e!="object"||e==null||e.__b>0?e:Ze(e)?e.map(vr):e.constructor!==void 0?null:Q({},e)}function Hn(e,t,r,n,i,o,a,u,c){var l,d,p,s,h,g,_,v=r.props||je,m=t.props,y=t.type;if(y=="svg"?i="http://www.w3.org/2000/svg":y=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(l=0;o.length>l;l++)if((h=o[l])&&"setAttribute"in h==!!y&&(y?h.localName==y:h.nodeType==3)){e=h,o[l]=null;break}}if(e==null){if(y==null)return document.createTextNode(m);e=document.createElementNS(i,y,m.is&&m),u&&(E.__m&&E.__m(t,o),u=!1),o=null}if(y==null)v===m||u&&e.data==m||(e.data=m);else{if(o=y=="textarea"&&m.defaultValue!=null?null:o&&U.call(e.childNodes),!u&&o!=null)for(v={},l=0;e.attributes.length>l;l++)v[(h=e.attributes[l]).name]=h.value;for(l in v)h=v[l],l=="dangerouslySetInnerHTML"?p=h:l=="children"||l in m||l=="value"&&"defaultValue"in m||l=="checked"&&"defaultChecked"in m||We(e,l,null,h,i);for(l in m)h=m[l],l=="children"?s=h:l=="dangerouslySetInnerHTML"?d=h:l=="value"?g=h:l=="checked"?_=h:u&&typeof h!="function"||v[l]===h||We(e,l,h,v[l],i);if(d)u||p&&(d.__html==p.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),ur(t.type=="template"?e.content:e,Ze(s)?s:[s],t,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&fe(r,0),u,c),o!=null)for(l=o.length;l--;)gt(o[l]);u&&y!="textarea"||(l="value",y=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[l]||y=="progress"&&!g||y=="option"&&g!=v[l])&&We(e,l,g,v[l],i),l="checked",_!=null&&_!=e[l]&&We(e,l,_,v[l],i))}return e}function wt(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){E.__e(i,r)}}function fr(e,t,r){var n,i;if(E.unmount&&E.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||wt(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){E.__e(o,t)}n.base=n.__P=n.__n=null}if(n=e.__k)for(i=0;n.length>i;i++)n[i]&&fr(n[i],t,r||typeof e.type!="function");r||gt(e.__e),e.__c=e.__=e.__e=void 0}function Dn(e,t,r){return this.constructor(e,r)}function oe(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),E.__&&E.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],_t(t,e=(!n&&r||t).__k=ie(W,null,[e]),i||je,je,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?U.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),hr(o,e,a),e.props.children=null}U=Ue.slice,E={__e(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(u){e=u}throw e}},dt=0,Qe.prototype.setState=function(e,t){var r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Q({},this.state);typeof e=="function"&&(e=e(Q({},r),this.props)),e&&Q(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),mt(this))},Qe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),mt(this))},Qe.prototype.render=W,ne=[],nr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ir=function(e,t){return e.__v.__b-t.__v.__b},ze.__r=0,pt=Math.random().toString(8),Oe="__d"+pt,Te="__a"+pt,or=/(PointerCapture)$|Capture$/i,ht=0,vt=pr(!1),ft=pr(!0),sr=0;var Ge=0,yr=[],A=E,gr=A.__b,mr=A.__r,_r=A.diffed,br=A.__c,wr=A.unmount,xr=A.__;function Ke(e,t){A.__h&&A.__h(B,e,Ge||t),Ge=0;var r=B.__H||(B.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function O(e){return Ge=1,(function(t,r){var n=Ke(ve++,2);if(n.t=t,!n.__c&&(n.__=[Pr(void 0,r),function(u){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,u);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=B,!B.__f)){var i=function(u,c,l){if(!n.__c.__H)return!0;var d=!1,p=n.__c.props!==u;if(n.__c.__H.__.some(function(h){if(h.__N){d=!0;var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(p=!0)}}),o){var s=o.call(this,u,c,l);return d?s||p:s}return!d||p};B.__f=!0;var o=B.shouldComponentUpdate,a=B.componentWillUpdate;B.componentWillUpdate=function(u,c,l){if(this.__e){var d=o;o=void 0,i(u,c,l),o=d}a&&a.call(this,u,c,l)},B.shouldComponentUpdate=i}return n.__N||n.__})(Pr,e)}function ye(e,t){var r=Ke(ve++,3);!A.__s&&qr(r.__H,t)&&(r.__=e,r.u=t,B.__H.__h.push(r))}function Me(e){return Ge=5,G(function(){return{current:e}},[])}function G(e,t){var r=Ke(ve++,7);return qr(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ge(e){var t=B.context[e.__c],r=Ke(ve++,9);return r.c=e,t?(r.__??(r.__=!0,t.sub(B)),t.props.value):e.__}function kr(){for(var e;e=yr.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(xt),t.__h.some(Cr),t.__h=[]}catch(r){t.__h=[],A.__e(r,e.__v)}}}A.__b=function(e){B=null,gr&&gr(e)},A.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),xr&&xr(e,t)},A.__r=function(e){mr&&mr(e),ve=0;var t=(B=e.__c).__H;t&&(yt===B?(t.__h=[],B.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.length&&kr(),ve=0)),yt=B},A.diffed=function(e){_r&&_r(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(yr.push(t)!==1&&ar===A.requestAnimationFrame||((ar=A.requestAnimationFrame)||Nn)(kr)),t.__H.__.some(function(r){r.u&&(r.__H=r.u,r.u=void 0)})),yt=B=null},A.__c=function(e,t){t.some(function(r){try{r.__h.some(xt),r.__h=r.__h.filter(function(n){return!n.__||Cr(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],A.__e(n,r.__v)}}),br&&br(e,t)},A.unmount=function(e){wr&&wr(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(n){try{xt(n)}catch(i){t=i}}),r.__H=void 0,t&&A.__e(t,r.__v))};var Sr=typeof requestAnimationFrame=="function";function Nn(e){var t,r=function(){clearTimeout(n),Sr&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Sr&&(t=requestAnimationFrame(r))}function xt(e){var t=B,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),B=t}function Cr(e){var t=B;e.__c=e.__(),B=t}function qr(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Pr(e,t){return typeof t=="function"?t(e):t}const me="tab",Tr="left",Ir="center",kt="right",Mr="next_to_trigger",St="popover",_e="widget",Lr="external_survey",Er="open",Ct="multiple_choice",Le="single_choice",qt="rating",K="end",Pt="always",Tt="$survey_id",It="$survey_name",Mt="$survey_iteration",Lt="$survey_iteration_start_date",$r="$survey_language",Hr="min_length",Dr="max_length",Et=Object.prototype.toString,Y=Array.isArray||function(e){return Et.call(e)==="[object Array]"},Ye=e=>typeof e=="function",$=e=>e===void 0,be=e=>Et.call(e)=="[object String]",se=e=>e===null,Nr=e=>$(e)||se(e),J=e=>Et.call(e)=="[object Number]"&&e==e,Je="Mobile",Xe="Tablet",Br="Android Tablet",Fr="iPad",Ar="Apple Watch",$t="Nintendo",Ht="PlayStation",Dt="Xbox",Vr="Nokia",Nt="Ouya",Bn="Generic "+Je.toLowerCase(),Rr="Generic "+Xe.toLowerCase(),Fn=new RegExp(Dt,"i"),An=new RegExp("PlayStation \\w+","i"),Vn=new RegExp("Nintendo \\w+","i"),Rn=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp($t,"i"),new RegExp(Ht,"i");function Ee(e){return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(e)}function On(e,t,r){return(t=(function(n){var i=(function(o){if(Ee(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var u=a.call(o,"string");if(Ee(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)})(n);return Ee(i)=="symbol"?i:i+""})(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Or(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function x(e){for(var t=1;arguments.length>t;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Or(Object(r),!0).forEach(function(n){On(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jr(e,t){if(!e)return;const r=e.find(n=>n.type===t);return r?.value}const H="u">typeof window?window:void 0,ce="u">typeof globalThis?globalThis:H,we=ce?.navigator,Ur=ce?.document;ce!=null&&ce.XMLHttpRequest&&new ce.XMLHttpRequest;const Zr=we?.userAgent,Qr=(e,{debugEnabled:t}={})=>{const r={N(n,...i){H&&(H.POSTHOG_DEBUG||t)&&!$(H.console)&&H.console&&("__rrweb_original__"in H.console[n]?H.console[n].__rrweb_original__:H.console[n])(e,...i)},debug(...n){r.N("debug",...n)},info(...n){r.N("log",...n)},warn(...n){r.N("warn",...n)},error(...n){r.N("error",...n)},critical(...n){console.error(e,...n)},uninitializedWarning(n){r.error(`You must initialize PostHog before calling ${n}`)},createLogger:(n,i)=>Qr(`${e} ${n}`,i)};return r},Z=Qr("[PostHog.js]"),et=Z.createLogger;function X(e,t,r,n){const{capture:i=!1,passive:o=!0}=n??{};e?.addEventListener(t,r,{capture:i,passive:o})}function de(e){return`$survey_response_${e}`}function zr(e,t){if(!t)return null;const r=e[de(t)];return Y(r)?[...r]:r}function Wr({event:e,survey:t,responses:r={},submissionId:n,completed:i,surveyLanguage:o,questionSnapshots:a}){return x(x(x(x({},!$(n)&&{$survey_submission_id:n}),e==="sent"?!$(i)&&{$survey_completed:i}:{$survey_partially_completed:jn(r)}),o&&{$survey_language:o}),(function(u={},c,l){const d={};return c.questions.forEach(p=>{if($(p.originalQuestionIndex))return;const s=(h=p.originalQuestionIndex)===0?"$survey_response":`$survey_response_${h}`;var h;const g=zr(u,p.id);$(g)||(d[s]=g)}),x(x({$survey_questions:c.questions.map(p=>{var s,h;return{id:p.id,question:(s=l?.[(h=p.id)!==null&&h!==void 0?h:""])!==null&&s!==void 0?s:p.question,response:zr(u,p.id)}})},u),d)})(r,t,a))}function jn(e={}){return Object.values(e).some(t=>!Nr(t))}function Gr(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 Bt(e){return typeof e=="string"&&e.trim()?e.trim():null}function Ft(e){return e.toLowerCase()}function Kr(e,t,r){if(!e||!t)return null;const n=Ft(t),i=Object.keys(e).find(o=>Ft(o)===n);if(i)return r?.debug(`Found exact translation match: ${i}`),i;if(n.includes("-")){const o=n.split("-")[0],a=Object.keys(e).find(u=>Ft(u)===o);if(a)return r?.debug(`Found base language translation match: ${a} (from ${t})`),a}return null}const Yr=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Un(e,t,r){var n;const i=Kr(e.translations,t,r),o=x({},e);let a=!1;if(i){var u;const s=(u=e.translations)===null||u===void 0?void 0:u[i];if(s)if(r?.info(`Applying survey-level translation for language: ${i}`),$(s.name)||(o.name=s.name,a=!0),o.appearance){const h=x({},o.appearance);for(const g of Yr){const _=s[g];$(_)||(h[g]=_,a=!0)}o.appearance=h}else(function(h){return Yr.some(g=>!$(h[g]))})(s)&&(a=!0)}const c=e.questions.map(s=>(function(h,g,_){var v;const m=Kr(h.translations,g,_);if(!m)return{question:h,matchedKey:null,hasChanges:!1};const y=(v=h.translations)===null||v===void 0?void 0:v[m];if(!y)return{question:h,matchedKey:null,hasChanges:!1};const w=x({},h);let P=!1;return $(y.question)||(w.question=y.question,P=!0),$(y.description)||(w.description=y.description,P=!0),$(y.buttonText)||(w.buttonText=y.buttonText,P=!0),"link"in w&&!$(y.link)&&(w.link=y.link,P=!0),"lowerBoundLabel"in w&&!$(y.lowerBoundLabel)&&(w.lowerBoundLabel=y.lowerBoundLabel,P=!0),"upperBoundLabel"in w&&!$(y.upperBoundLabel)&&(w.upperBoundLabel=y.upperBoundLabel,P=!0),"choices"in w&&(function(S){return Y(S.choices)})(y)&&(w.choices=y.choices,P=!0),{question:P?w:h,matchedKey:P?m:null,hasChanges:P}})(s,t,r)),l=c.map(s=>s.question),d=c.some(s=>s.hasChanges);let p=null;return i||(p=((n=c.find(s=>s.matchedKey))===null||n===void 0?void 0:n.matchedKey)||null),d&&(o.questions=l,a=!0,r?.info(`Applied question-level translations for language: ${t}`)),{survey:o,matchedKey:a?i||p:null}}function Jr(e){var t;return!!(!((t=e.conditions)===null||t===void 0||(t=t.events)===null||t===void 0||(t=t.values)===null||t===void 0)&&t.length)}const Xr=(e,t)=>{if(!(r=>{try{new RegExp(r)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},tt=e=>e.toLowerCase(),en={exact:(e,t)=>t.some(r=>e.some(n=>r===n)),is_not:(e,t)=>t.every(r=>e.every(n=>r!==n)),regex:(e,t)=>t.some(r=>e.some(n=>Xr(r,n))),not_regex:(e,t)=>t.every(r=>e.every(n=>!Xr(r,n))),icontains:(e,t)=>t.map(tt).some(r=>e.map(tt).some(n=>r.includes(n))),not_icontains:(e,t)=>t.map(tt).every(r=>e.map(tt).every(n=>!r.includes(n))),gt:(e,t)=>t.some(r=>{const n=parseFloat(r);return!isNaN(n)&&e.some(i=>n>parseFloat(i))}),lt:(e,t)=>t.some(r=>{const n=parseFloat(r);return!isNaN(n)&&e.some(i=>n<parseFloat(i))})},tn=e=>{const t=[...e];for(let r=t.length-1;r>0;r--){const n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t},I=et("[Surveys]");function ee(e){return Ye(e.is_capturing)?e.is_capturing():!e.has_opted_out_capturing()}const At=(e,t)=>`${e}${(function(r){return r.current_iteration&&r.current_iteration>0?`${r.id}_${r.current_iteration}`:r.id})(t)}`,rn=e=>At("seenSurvey_",e),nn=e=>{try{const t=rn(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(t){I.error("Failed to persist survey seen state",t)}},Zn=[St,_e,"api"],on="$surveys";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return J(e)&&isFinite(e)&&Math.floor(e)===e});var Qn=class tr{constructor(t){if(this.bytes=t,t.length!==16)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 tr(o)}toString(){let t="";for(let r=0;this.bytes.length>r;r++)t=t+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),r!==3&&r!==5&&r!==7&&r!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new tr(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let r=0;16>r;r++){const n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}},zn=class{generate(){const e=this.generateOrAbort();if(!$(e))return e;{this.Ct=0;const t=this.generateOrAbort();if($(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const e=(()=>{const t=Date.now();return J(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),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 Qn.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 Wn}};let sn=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};H&&!$(H.crypto)&&crypto.getRandomValues&&(sn=e=>crypto.getRandomValues(e));var Wn=class{nextUint32(){return this.Rt.length>this.$t||(sn(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let an;const ln=()=>Gn().toString(),Gn=()=>(an||(an=new zn)).generate();let Vt=null;const te={Et(){if(!se(Vt))return Vt;let e=!0;if($(H))e=!1;else try{const t="__mplssupport__";te.At(t,"xyz"),te.Ot(t)!=='"xyz"'&&(e=!1),te.Lt(t)}catch{e=!1}return e||Z.error("localStorage unsupported; falling back to cookie store"),Vt=e,e},Pt(e){Z.error("localStorage error: "+e)},Ot(e){try{return H?.localStorage.getItem(e)}catch(t){te.Pt(t)}return null},Dt(e){try{return JSON.parse(te.Ot(e))||{}}catch{}return null},At(e,t){try{return H?.localStorage.setItem(e,JSON.stringify(t)),!0}catch(r){te.Pt(r)}return!1},Lt(e){try{H?.localStorage.removeItem(e)}catch(t){te.Pt(t)}}},Kn=et("[Stylesheet Loader]"),un=H,xe=Ur,rt="#020617",ae={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:kt,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:rt,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Yn=[Ir,Tr,kt];function cn(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 $e(e=ae.backgroundColor){let t;e[0]==="#"&&(t=cn(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=cn(r)),!t)return rt;const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){const i=parseInt(n[1]),o=parseInt(n[2]),a=parseInt(n[3]);return Math.sqrt(i*i*.299+o*o*.587+a*a*.114)>127.5?rt:"white"}return rt}const nt=(e,t,r)=>{const n=zt(e),i=xe.querySelector(`.${n}`);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};const o=xe.createElement("div");((c,l,d)=>{const p=x(x({},ae),d),s=c.style,h=!Yn.includes(p.position)||l===_e&&d?.widgetType===me;s.setProperty("--ph-survey-font-family",(function(m){if(m==="inherit")return"inherit";const y='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return m?`${m}, ${y}`:`-apple-system, ${y}`})(p.fontFamily)),s.setProperty("--ph-survey-box-padding",p.boxPadding),s.setProperty("--ph-survey-max-width",p.maxWidth),s.setProperty("--ph-survey-z-index",p.zIndex),s.setProperty("--ph-survey-border-color",p.borderColor),h?(s.setProperty("--ph-survey-border-radius",p.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",`${p.borderRadius} ${p.borderRadius} 0 0`)),s.setProperty("--ph-survey-background-color",p.backgroundColor),s.setProperty("--ph-survey-box-shadow",p.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",p.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",p.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",d?.submitButtonTextColor||$e(p.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",p.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",p.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",$e(p.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",d?.textColor||$e(p.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",p.textSubtleColor),s.setProperty("--ph-widget-color",p.widgetColor),s.setProperty("--ph-widget-text-color",$e(p.widgetColor)),s.setProperty("--ph-widget-z-index",p.zIndex);const g=d?.inputBackground||d?.inputBackgroundColor;let _=g||p.inputBackground;g||p.backgroundColor!=="white"||(_="#f8f8f8"),s.setProperty("--ph-survey-input-background",_);const v=d?.inputTextColor||$e(_);s.setProperty("--ph-survey-input-text-color",v),s.setProperty("--ph-survey-rating-text-color",v),s.setProperty("--ph-survey-scrollbar-thumb-color",p.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",p.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",p.outlineColor)})(o,e.type,e.appearance),o.className=n;const a=o.attachShadow({mode:"open"}),u=(function(c){const l=((d,p,s)=>{let h=d.createElement("style");h.innerText=p;const g=(_=>{var v;return Ye(_)?_:_==null||(v=_.config)===null||v===void 0?void 0:v.prepare_external_dependency_stylesheet})(s);return g&&(h=g(h)),h||(Kn.error("prepare_external_dependency_stylesheet returned null"),null)})(xe,':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)}}',c);return l?.setAttribute("data-ph-survey-style","true"),l})(t);if(u){const c=a.querySelector("style");c&&a.removeChild(c),a.appendChild(u)}return(r||xe.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},dn=({responses:e,survey:t,surveySubmissionId:r,posthog:n,isSurveyCompleted:i,properties:o,surveyLanguage:a,questionSnapshots:u})=>{var c;n?ee(n)&&(nn(t),n.capture("survey sent",x(x(x({[It]:t.name,[Tt]:t.id,[Mt]:t.current_iteration,[Lt]:t.current_iteration_start_date,sessionRecordingUrl:(c=n.get_session_replay_url)===null||c===void 0?void 0:c.call(n)},Wr({event:"sent",survey:t,responses:e,submissionId:r,completed:i,surveyLanguage:a,questionSnapshots:u})),o),{},{$set:{[Gr(t,"responded")]:!0}})),i&&(un.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:t.id}})),Qt(t),n.reloadFeatureFlags())):I.error("[survey sent] event not captured, PostHog instance not found.")},pn=(e,t,r,n)=>{var i;return x({[It]:t.name,[Tt]:t.id,[Mt]:t.current_iteration,[Lt]:t.current_iteration_start_date,sessionRecordingUrl:(i=n.get_session_replay_url)===null||i===void 0?void 0:i.call(n)},Wr({event:e,survey:t,responses:r?.responses,submissionId:r?.surveySubmissionId,surveyLanguage:r?.surveyLanguage,questionSnapshots:r?.questionSnapshots}))},hn=(e,t,r,n)=>{if(!t)return void I.error("[survey dismissed] event not captured, PostHog instance not found.");if(r)return;const i=he(e),o=i?i.surveyLanguage:n;t.capture("survey dismissed",x(x(x({},pn("dismissed",e,i,t)),o&&{[$r]:o}),{},{$set:{[Gr(e,"dismissed")]:!0}})),Qt(e),nn(e),un.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))},Jn=(e,t)=>{if(!t)return void I.error("[survey abandoned] event not captured, PostHog instance not found.");const r=(i=>At("abandonedSurvey_",i))(e);try{if(localStorage.getItem(r)==="true")return}catch{return}const n=he(e);if(n){try{localStorage.setItem(r,"true")}catch{}t.capture("survey abandoned",pn("abandoned",e,n,t),{transport:"sendBeacon"})}},it=e=>{const t=e.map(r=>r.id);return t.every(r=>!!r)?t:void 0},vn=(e,t)=>{return(o=>o.questions.some(a=>{var u;return!!(!((u=a.branching)===null||u===void 0)&&u.type)}))(e)?e.questions:t?(r=((o,a)=>{if(!a||a.length!==o.questions.length)return null;const u=new Map(o.questions.map(l=>[l.id,l])),c=[];for(const l of a){const d=u.get(l);if(!d)return null;c.push(d)}return c})(e,t.questionOrder))!==null&&r!==void 0?r:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?(n=e.questions,i=tn(e.questions),n.length===i.length&&n.every((o,a)=>o===i[a])?i.reverse():i):e.questions;var r,n,i},fn=e=>(function(t){var r;return Jr(t)&&!!(!((r=t.conditions)===null||r===void 0||(r=r.events)===null||r===void 0)&&r.repeatedActivation)||t.schedule==="always"})(e)||ot(e),pe=(function(e){function t(r){var n,i;return this.getChildContext||(n=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(o){this.props.value!=o.value&&n.forEach(function(a){a.__e=!0,mt(a)})},this.sub=function(o){n.add(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){n&&n.delete(o),a&&a.call(o)}}),r.children}return t.__c="__cC"+sr++,t.__=e,t.Provider=t.__l=(t.Consumer=function(r,n){return r.children(n)}).contextType=t,t})({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Rt=()=>ge(pe),Ot=({component:e,children:t,renderAsHtml:r,style:n})=>(function(i,o,a){var u,c,l,d,p=Q({},i.props);for(l in i.type&&i.type.defaultProps&&(d=i.type.defaultProps),o)l=="key"?u=o[l]:l=="ref"?c=o[l]:p[l]=o[l]===void 0&&d!=null?d[l]:o[l];return arguments.length>2&&(p.children=arguments.length>3?U.call(arguments,2):a),Ie(i.type,p,u||i.key,c||i.ref,null)})(e,r?{dangerouslySetInnerHTML:{__html:t},style:n}:{children:t,style:n});function jt(e,t){var r,n;if(!(!((r=e.conditions)===null||r===void 0)&&r.url))return!0;const i=(function(u){var c;const l=H==null||(c=H.location)===null||c===void 0?void 0:c.href;return $(l)?void 0:(function(d,p){var s;const h=d==null||(s=d.config)===null||s===void 0?void 0:s.get_current_url;if(!Ye(h))return p;try{const g=h(p);return be(g)&&g?g:p}catch(g){return Z.error("Error in get_current_url, falling back to window.location.href",g),p}})(u,l)})(t);if(!i)return!1;const o=[e.conditions.url],a=(function(u){return u??"icontains"})((n=e.conditions)===null||n===void 0?void 0:n.urlMatchType);return en[a](o,[i])}function Xn(e){var t,r;return(function(n,i){var o,a,u;if(!n||n.length===0)return!0;if(!Zr)return!1;const c=(function(l,d){var p;const s=(function(v){return Vn.test(v)?$t:An.test(v)?Ht:Fn.test(v)?Dt:new RegExp(Nt,"i").test(v)?Nt:new RegExp("(Windows Phone|WPDesktop)","i").test(v)?"Windows Phone":/iPad/.test(v)?Fr:/iPod/.test(v)?"iPod Touch":/iPhone/.test(v)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(v)?Ar:Rn.test(v)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(v)?"Kobo":new RegExp(Vr,"i").test(v)?Vr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(v)||/(kf[a-z]+)( bui|\)).+silk\//i.test(v)?"Kindle Fire":/(Android|ZTE)/i.test(v)?new RegExp(Je).test(v)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(v)||/pixel[\daxl ]{1,6}/i.test(v)&&!/pixel c/i.test(v)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(v)||/lmy47v/i.test(v)&&!/QTAQZ3/i.test(v)?"Android":Br:new RegExp("(pda|Mobile)","i").test(v)?Bn:new RegExp(Xe,"i").test(v)&&!new RegExp("Tablet pc","i").test(v)?Rr:""})(l);return s===Fr||s===Br||s==="Kobo"||s==="Kindle Fire"||s===Rr?Xe:s===$t||s===Dt||s===Ht||s===Nt?"Console":s===Ar?"Wearable":s?Je:d?.userAgentDataPlatform==="Android"&&((p=d?.maxTouchPoints)!==null&&p!==void 0?p:0)>0?600>Math.min((h=d?.screenWidth)!==null&&h!==void 0?h:0,(g=d?.screenHeight)!==null&&g!==void 0?g:0)/((_=d?.devicePixelRatio)!==null&&_!==void 0?_:1)?Je:Xe:"Desktop";var h,g,_})(Zr,{userAgentDataPlatform:we==null||(o=we.userAgentData)===null||o===void 0?void 0:o.platform,maxTouchPoints:we?.maxTouchPoints,screenWidth:H==null||(a=H.screen)===null||a===void 0?void 0:a.width,screenHeight:H==null||(u=H.screen)===null||u===void 0?void 0:u.height,devicePixelRatio:H?.devicePixelRatio});return en[i??"icontains"](n,[c])})((t=e.conditions)===null||t===void 0?void 0:t.deviceTypes,(r=e.conditions)===null||r===void 0?void 0:r.deviceTypesMatchType)}const Ut=e=>At("inProgressSurvey_",e),ke={},Zt=(e,t)=>{const r=Ut(e);try{localStorage.setItem(r,JSON.stringify(t)),delete ke[r]}catch(n){I.error("Error setting in-progress survey state in localStorage",n),ke[r]=t}},he=e=>{const t=Ut(e),r=ke[t];if(r)return r;try{const n=localStorage.getItem(t);if(n)return JSON.parse(n)}catch(n){I.error("Error getting in-progress survey state from localStorage",n)}return null},ot=e=>{const t=he(e);return!Nr(t?.surveySubmissionId)},Qt=e=>{const t=Ut(e);delete ke[t];try{localStorage.removeItem(t)}catch(r){I.error("Error clearing in-progress survey state from localStorage",r)}};function zt(e,t=!1){const r=`PostHogSurvey-${e.id}`;return t?`.${r}`:r}function ei(e,t=kt,r){if(e===Lr)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 Tr:return{left:"30px"};case Ir:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===_e&&r===me?"60px":"30px"}}}var ti=0;function f(e,t,r,n,i,o){t||(t={});var a,u,c=t;if("ref"in c)for(u in c={},t)u=="ref"?a=t[u]:c[u]=t[u];var l={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ti,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(u in a)c[u]===void 0&&(c[u]=a[u]);return E.vnode&&E.vnode(l),l}const yn=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),gn=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),mn=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),ri=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),ni=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),ii=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:f("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"})}),oi=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:f("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"})}),si=({fill:e="currentColor"}={})=>f("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:[f("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),f("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})]}),ai=f("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("g",{"clip-path":"url(#clip0_2415_6911)",children:[f("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:f("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),f("g",{mask:"url(#mask0_2415_6911)",children:[f("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"}),f("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"}),f("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"}),f("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"}),f("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"}),f("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"})]})]}),f("defs",{children:f("clipPath",{id:"clip0_2415_6911",children:f("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function li({urlParams:e}){const t=e?Object.entries(e).map(([r,n])=>`${encodeURIComponent(r)}=${encodeURIComponent(n)}`).join("&"):"";return f("a",{href:"https://posthog.com/surveys"+(t?`?${t}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",ai]})}function Se({text:e,submitDisabled:t,appearance:r,onSubmit:n,link:i,onPreviewSubmit:o,skipSubmitButton:a,canGoBack:u,onBack:c}){const{isPreviewMode:l}=ge(pe),d=!!u&&!!c,p=!a&&f("button",{className:"form-submit",disabled:t,"aria-label":"Submit survey",type:"button",onClick(){i&&H?.open(i),l?o?.():n()},children:e});return f("div",{className:"bottom-section",children:[d?f("div",{className:"form-buttons form-buttons-with-back",children:[f("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:c,children:r.backButtonText||"Back"}),p]}):p,!r.whiteLabel&&f(li,{urlParams:{utm_source:"survey-footer"}})]})}function st({question:e,forceDisableHtml:t,htmlFor:r}){return f("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[f(e.type===Er?"label":"h3",{className:"survey-question",htmlFor:r,children:e.question}),e.description&&Ot({component:ie("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!t&&e.descriptionContentType!=="text"})]})}function Wt({onClick:e}){const{isPreviewMode:t}=ge(pe);return f("button",{className:"form-cancel",onClick:e,disabled:t,"aria-label":"Close survey",type:"button",children:si({fill:"black"})})}const _n=H;function ui({header:e,description:t,contentType:r,forceDisableHtml:n,appearance:i,onClose:o}){const{isPopup:a}=ge(pe);return ye(()=>{const u=c=>{c.key!=="Enter"&&c.key!=="Escape"||(c.preventDefault(),o())};return X(_n,"keydown",u),()=>{_n.removeEventListener("keydown",u)}},[o]),f("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&i.hideCancelButton!==!0&&f(Wt,{onClick:()=>o()}),f("h3",{className:"thank-you-message-header",children:e}),t&&Ot({component:ie("p",{className:"thank-you-message-body"}),children:t,renderAsHtml:!n&&r!=="text"}),a&&f(Se,{text:i.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:i,onSubmit:()=>o()})]})}function ci({header:e,description:t,contentType:r,forceDisableHtml:n,appearance:i,onStart:o}){const{isPopup:a,onPreviewSubmit:u,onPopupSurveyDismissed:c}=ge(pe);return f("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&i.hideCancelButton!==!0&&f(Wt,{onClick:()=>c()}),e&&f("h3",{className:"intro-screen-header",children:e}),t&&Ot({component:ie("p",{className:"intro-screen-body"}),children:t,renderAsHtml:!n&&r!=="text"}),f(Se,{text:i.introScreenButtonText||"Get started",submitDisabled:!1,appearance:i,onSubmit:o,onPreviewSubmit:()=>u(null)})]})}const bn=e=>Y(e)&&e.every(t=>be(t));function di({question:e,forceDisableHtml:t,appearance:r,onSubmit:n,onPreviewSubmit:i,displayQuestionIndex:o,initialValue:a,canGoBack:u,onBack:c}){const{isPreviewMode:l}=Rt(),d=Me(null),[p,s]=O(()=>be(a)?a:""),h=r?.disableAutofocus;ye(()=>{h||setTimeout(()=>{var S;l||(S=d.current)===null||S===void 0||S.focus()},100)},[l,h]);const g=`surveyQuestion${o}`,_=G(()=>(function(S,M,D){const b=S.trim();if(!D&&b==="")return"This field is required";if(b==="")return!1;if(M&&M.length>0)for(const q of M)switch(q.type){case Hr:var C;if(q.value!==void 0&&q.value>b.length)return(C=q.errorMessage)!==null&&C!==void 0?C:`Please enter at least ${q.value} characters`;break;case Dr:var k;if(q.value!==void 0&&b.length>q.value)return(k=q.errorMessage)!==null&&k!==void 0?k:`Please enter no more than ${q.value} characters`}return!1})(p,e.validation,e.optional),[p,e.validation,e.optional]),v=jr(e.validation,Hr),m=jr(e.validation,Dr),y=G(()=>(function(S,M){const D=S===1?void 0:S;return D&&M?`Enter ${D}-${M} characters`:D?`Enter at least ${D} ${D===1?"character":"characters"}`:M?`Maximum ${M} ${M===1?"character":"characters"}`:void 0})(v,m),[v,m]),w=()=>{_||n(p.trim())},P=()=>{_||i(p.trim())};return f(W,{children:[f("div",{className:"question-container",children:[f(st,{question:e,forceDisableHtml:t,htmlFor:g}),f("textarea",{ref:d,id:g,rows:4,placeholder:r?.placeholder,minLength:v,maxLength:m,onInput(S){s(S.currentTarget.value),S.stopPropagation()},onKeyDown(S){S.stopPropagation(),S.key!=="Enter"||!S.metaKey&&!S.ctrlKey||_||(S.preventDefault(),l?P():w())},value:p}),y&&f("div",{className:"validation-hint",children:y})]}),f(Se,{text:e.buttonText||"Submit",submitDisabled:!!_,appearance:r,onSubmit:w,onPreviewSubmit:P,canGoBack:u,onBack:c})]})}function pi({question:e,forceDisableHtml:t,appearance:r,onSubmit:n,onPreviewSubmit:i,canGoBack:o,onBack:a}){return f(W,{children:[f("div",{className:"question-container",children:f(st,{question:e,forceDisableHtml:t})}),f(Se,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>i("link clicked"),canGoBack:o,onBack:a})]})}function hi({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:a,canGoBack:u,onBack:c}){var l;const d=e.scale,p=e.scale===10?0:1,[s,h]=O(()=>J(a)?a:Y(a)&&a.length>0&&J(parseInt(a[0]))?parseInt(a[0]):be(a)&&J(parseInt(a))?parseInt(a):null),g=e.display==="emoji"&&e.scale===2,{isPreviewMode:_}=Rt(),v=m=>_?o(m):i(m);return f(W,{children:[f("div",{className:"question-container",children:[f(st,{question:e,forceDisableHtml:t}),f("div",{className:"rating-section",children:[f("div",{className:"rating-options",children:[e.display==="emoji"&&f("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:(l=_i[e.scale])===null||l===void 0?void 0:l.map((m,y)=>f("button",{"aria-label":`Rate ${y+1}`,className:`ratings-emoji question-${r}-rating-${y} ${y+1===s?"rating-active":""}`,value:y+1,type:"button",onClick(){const w=y+1;h(w),e.skipSubmitButton&&v(w)},children:m},y))}),e.display==="number"&&f("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${d-p+1}, minmax(0, 1fr))`},children:bi(e.scale).map((m,y)=>f(vi,{displayQuestionIndex:r,active:s===m,appearance:n,num:m,setActiveNumber(w){h(w),e.skipSubmitButton&&v(w)}},y))})]}),!g&&f("div",{className:"rating-text",children:[f("div",{children:e.lowerBoundLabel}),f("div",{children:e.upperBoundLabel})]})]})]}),f(Se,{text:e.buttonText||n?.submitButtonText||"Submit",submitDisabled:se(s)&&!e.optional,appearance:n,onSubmit:()=>i(s),onPreviewSubmit:()=>o(s),skipSubmitButton:e.skipSubmitButton,canGoBack:u,onBack:c})]})}function vi({num:e,active:t,displayQuestionIndex:r,setActiveNumber:n}){return f("button",{"aria-label":`Rate ${e}`,className:`ratings-number question-${r}-rating-${e} ${t?"rating-active":""}`,type:"button",onClick(){n(e)},children:e})}function fi({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:a,canGoBack:u,onBack:c}){const l=Me(null),d=G(()=>(b=>{var C;if(!b.shuffleOptions)return b.choices;const k=[...b.choices],q=b.hasOpenChoice&&(C=k.pop())!==null&&C!==void 0?C:null,F=(T=k,(L=tn(k)).length>1&&T.every((j,qe)=>j===L[qe])?L.reverse():L);var T,L;return se(q)||F.push(q),F})(e),[e]),[p,s]=O(()=>((b,C)=>be(b)||bn(b)?b:C===Le?null:[])(a,e.type)),[h,g]=O(()=>((b,C)=>{if(be(b)&&!C.includes(b))return{isSelected:!0,inputValue:b};if(bn(b)){const k=b.find(q=>!C.includes(q));if(k)return{isSelected:!0,inputValue:k}}return{isSelected:!1,inputValue:""}})(a,d)),{isPreviewMode:_}=Rt(),v=e.type===Le,m=e.type===Ct,y=e.skipSubmitButton&&v&&!e.hasOpenChoice,w=(b,C)=>{if(C){const k=!h.isSelected;g(q=>x(x({},q),{},{isSelected:k,inputValue:k?q.inputValue:""})),v&&s(""),k&&setTimeout(()=>{var q;return(q=l.current)===null||q===void 0?void 0:q.focus()},75);return}if(v)return s(b),g(k=>x(x({},k),{},{isSelected:!1,inputValue:""})),void(y&&(i(b),_&&o(b)));m&&Y(p)&&(p.includes(b)?s(p.filter(k=>k!==b)):s([...p,b]))},P=b=>{b.stopPropagation();const C=b.currentTarget.value;g(k=>x(x({},k),{},{inputValue:C})),v&&s(C)},S=b=>{b.stopPropagation(),b.key!=="Enter"||M()||(b.preventDefault(),D()),b.key==="Escape"&&(b.preventDefault(),g(C=>x(x({},C),{},{isSelected:!1,inputValue:""})),v&&s(null))},M=()=>!(e.optional||!se(p)&&(!Y(p)||h.isSelected||p.length!==0)&&(!h.isSelected||h.inputValue.trim()!=="")),D=()=>{h.isSelected&&m?Y(p)&&(_?o([...p,h.inputValue]):i([...p,h.inputValue])):_?o(p):i(p)};return f(W,{children:[f("div",{className:"question-container",children:[f(st,{question:e,forceDisableHtml:t}),f("fieldset",{className:"multiple-choice-options limit-height",children:[f("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),d.map((b,C)=>{const k=!!e.hasOpenChoice&&C===e.choices.length-1,q=`surveyQuestion${r}Choice${C}`,F=`${q}Open`,T=k?h.isSelected:v?p===b:Y(p)&&p.includes(b);return f("label",{className:k?"choice-option-open":"",children:[f("div",{className:"response-choice",children:[f("input",{type:v?"radio":"checkbox",name:q,checked:T,onChange:()=>w(b,k),id:q,"aria-controls":F}),f("span",{children:k?`${b}:`:b})]}),k&&f("input",{type:"text",ref:l,id:F,name:`question${r}Open`,value:h.inputValue,onKeyDown:S,onInput:P,onClick(L){h.isSelected||w(b,!0),L.stopPropagation()},"aria-label":`${b} - please specify`})]},C)})]})]}),f(Se,{text:e.buttonText||"Submit",submitDisabled:M(),appearance:n,onSubmit:D,onPreviewSubmit:D,skipSubmitButton:y,canGoBack:u,onBack:c})]})}const yi=[1,2,3,4,5],gi=[1,2,3,4,5,6,7],mi=[0,1,2,3,4,5,6,7,8,9,10],_i={2:[ii,oi],3:[mn,gn,yn],5:[ri,mn,gn,yn,ni]};function bi(e){switch(e){case 5:default:return yi;case 7:return gi;case 10:return mi}}const wi=et("[Surveys]");function wn(e,t,r){var n;const i=e.questions[t],o=t+1;if(!(!((n=i.branching)===null||n===void 0)&&n.type))return t===e.questions.length-1?K:o;if(i.branching.type===K)return K;if(i.branching.type==="specific_question"){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type==="response_based"){if(i.type===Le){var a;let c=i.choices.indexOf(`${r}`);if(c===-1&&i.hasOpenChoice&&(c=i.choices.length-1),(a=i.branching)===null||a===void 0||(a=a.responseValues)===null||a===void 0?void 0:a.hasOwnProperty(c)){const l=i.branching.responseValues[c];return Number.isInteger(l)?l:l===K?K:o}}else if(i.type===qt){var u;if(typeof r!="number"||!Number.isInteger(r))throw new Error("The response type must be an integer");const c=(function(l,d){if(d===2){if(1>l||l>2)throw new Error("The response must be in range 1-2");return l===1?"positive":"negative"}if(d===3){if(1>l||l>3)throw new Error("The response must be in range 1-3");return l===1?"negative":l===2?"neutral":"positive"}if(d===5){if(1>l||l>5)throw new Error("The response must be in range 1-5");return l>2?l===3?"neutral":"positive":"negative"}if(d===7){if(1>l||l>7)throw new Error("The response must be in range 1-7");return l>3?l===4?"neutral":"positive":"negative"}if(d===10){if(0>l||l>10)throw new Error("The response must be in range 0-10");return l>6?l>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")})(r,i.scale);if(!((u=i.branching)===null||u===void 0||(u=u.responseValues)===null||u===void 0)&&u.hasOwnProperty(c)){const l=i.branching.responseValues[c];return Number.isInteger(l)?l:l===K?K:o}}return o}return wi.warn("Falling back to next question index due to unexpected branching type"),o}const Gt=et("[SurveyTranslations]");function xi(e,t){const r=(function(i){return(function({overrideLanguage:o,storedPersonProperties:a,locale:u},c){const l=Bt(o);if(l)return c?.info(`Using override display language: ${l}`),l;const d=(function(s){return s&&typeof s=="object"&&"language"in s?Bt(s.language):null})(a);if(d)return c?.info(`Using person property language: ${d}`),d;const p=Bt(u);return p?(c?.info(`Using detected locale: ${p}`),p):(c?.info("No user language detected"),null)})({overrideLanguage:i.config.override_display_language,storedPersonProperties:Ye(i.get_property)?i.get_property("$stored_person_properties"):void 0,locale:navigator.language||navigator.userLanguage},Gt)})(t);if(!r)return Gt.info("No user language detected"),{survey:e,language:null};const n=Un(e,r,Gt);return{survey:n.survey,language:n.matchedKey}}const N=H,le=Ur,Kt="ph:show_survey_widget",Yt="PHWidgetSurveyClickListener";function xn(e,t){try{const r=e.getBoundingClientRect(),n=N.innerHeight,i=N.innerWidth;let o=r.left+r.width/2-t/2;o+t>i-20&&(o=i-t-20),20>o&&(o=20);const a=n-r.bottom,u=250>a&&r.top>a;return{position:"fixed",top:u?"auto":`${r.bottom+12}px`,left:`${o}px`,right:"auto",bottom:u?n-r.top+12+"px":"auto",zIndex:ae.zIndex}}catch(r){return I.warn("Failed to calculate trigger position:",r),null}}var ki=class{constructor(e){this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Map,this.Mi=new Set,this.Ii=null,this.Ti=!1,this.Ri=null,this.$i=null,this.Ei=null,this.Ai=!1,this.handlePageUnload=()=>{const t=this._posthog.get_property(on);if(t)for(const r of t)ot(r)&&Jn(r,this._posthog)},this.handlePopoverSurvey=(t,r,{resumeDelayFromActivation:n=!1}={})=>{var i,o,a,u,c,l;if(!ee(this._posthog))return;const{survey:d,language:p}=this.Oi(t);this.Ii=p,this.Ei=null,this.Li=r;const s=this.Pi(d,r);this.Di(s.id);const{properties:h,initialResponses:g}=r??{},_=!(!g||0>=Object.keys(g).length)&&this.Fi(s,g,h,p);if(_&&!(!((i=s.appearance)===null||i===void 0)&&i.displayThankYouMessage))return;this.Ni(s);let v={};if(((o=s.appearance)===null||o===void 0?void 0:o.position)===Mr&&(!((a=s.appearance)===null||a===void 0)&&a.widgetSelector)){const q=le.querySelector(s.appearance.widgetSelector);var m;q&&(v=xn(q,parseInt(((m=s.appearance)===null||m===void 0?void 0:m.maxWidth)||ae.maxWidth))||{})}const y=((u=s.appearance)===null||u===void 0?void 0:u.surveyPopupDelaySeconds)||0,{shadow:w}=nt(s,this._posthog);this.Ci.set(w,w.host);const P={posthog:this._posthog,survey:s,removeSurveyFromFocus:this.qi,properties:h,style:v,isSurveyCompleted:_,skipShownEvent:r?.skipShownEvent,surveyLanguage:p};if(this.Ei=P,0>=y)return this.Ti=!0,oe(f(Ce,x({},P)),w);const S=()=>{this.Ti=!0;const{survey:q,language:F}=this.Oi(t);this.Ii=F;const T=this.Pi(q,r),L=x(x({},P),{},{survey:T,surveyLanguage:F});this.Ei=L,oe(f(Ce,x(x({},L),{},{survey:x(x({},T),{},{appearance:x(x({},T.appearance),{},{surveyPopupDelaySeconds:0})})})),w)},M=()=>{if(!ee(this._posthog)||!this.ji(s))return I.info(`Survey ${s.id} no longer eligible when its display delay elapsed; not displaying`),this.qi(s);S()},D=n?(c=this._posthog.surveys)===null||c===void 0||(c=c._surveyEventReceiver)===null||c===void 0||(l=c.getActivationTimestamp)===null||l===void 0?void 0:l.call(c,s.id):void 0,b=J(D)?Math.max(0,Date.now()-D):0,C=Math.max(0,1e3*y-b);if(0>=C)return M();const k=N.setTimeout(()=>{this.ki.delete(s.id),M()},C);this.ki.set(s.id,k)},this.Bi=t=>{var r;const{survey:n,language:i}=this.Oi(t),{shadow:o,isNewlyCreated:a}=nt(n,this._posthog);this.Ci.set(o,o.host),((r=t.appearance)===null||r===void 0?void 0:r.widgetType)===me&&this.xi.set(t.id,t),a&&oe(f(Pi,{posthog:this._posthog,survey:n,surveyLanguage:i},t.id),o)},this.Hi=t=>{const r=this.Si.get(t);r&&(r.element.removeEventListener("click",r.listener),r.element.removeAttribute(Yt),this.Si.delete(t),I.info(`Removed click listener for survey ${t}`))},this.zi=t=>{this.Ui(t)||(this.Wi(t),this.Hi(t.id))},this.Vi=t=>{this.Ui(t)||(this.Wi(t),this.xi.delete(t.id))},this.Ui=t=>{try{var r;const n=le.querySelector(zt(t,!0));return!!(!(n==null||(r=n.shadowRoot)===null||r===void 0)&&r.querySelector(".ph-survey"))}catch{return!1}},this.Zi=(t,r)=>{const n=le.querySelector(r),i=this.Si.get(t.id);if(n){if(this.Bi(t),i){if(n===i.element)return;I.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.Hi(t.id)}if(!n.hasAttribute(Yt)){const o=a=>{var u,c;a.stopPropagation();const l=((u=t.appearance)===null||u===void 0?void 0:u.position)===Mr?xn(a.currentTarget,parseInt(((c=t.appearance)===null||c===void 0?void 0:c.maxWidth)||ae.maxWidth)):{};N.dispatchEvent(new CustomEvent(Kt,{detail:{surveyId:t.id,position:l}}))};X(n,"click",o),n.setAttribute(Yt,"true"),this.Si.set(t.id,{element:n,listener:o,survey:t}),I.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.zi(t)},this.renderPopover=t=>{if(!ee(this._posthog))return;const{survey:r,language:n}=this.Oi(t),{shadow:i}=nt(r,this._posthog);this.Ci.set(i,i.host),oe(f(Ce,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.qi,surveyLanguage:n}),i)},this.renderSurvey=(t,r,n)=>{var i;if(!ee(this._posthog))return;const{survey:o,language:a}=this.Oi(t);let u=!1;(i=this._posthog.config)!==null&&i!==void 0&&(i=i.surveys)!==null&&i!==void 0&&i.prefillFromUrl&&(u=this.Gi(o,a,n)),oe(f(Ce,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.qi,isPopup:!1,properties:n,isSurveyCompleted:u,surveyLanguage:a}),r)},this.getActiveMatchingSurveys=(t,r=!1)=>{var n;(n=this._posthog)===null||n===void 0||(n=n.surveys)===null||n===void 0||n.getSurveys(i=>{t(i.filter(o=>this.ji(o)))},r)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(r=>{const n=ee(this._posthog),i=r.filter(l=>n&&(l.type===St||l.type===_e)),o=new Set(i.map(l=>l.id));for(const l of Array.from(this.ki.keys()))o.has(l)||this.cancelSurvey(l);const a=this.Qi(i),u=new Set,c=new Set;a.forEach(l=>{if(l.type===_e){var d,p,s,h;if(((d=l.appearance)===null||d===void 0?void 0:d.widgetType)===me)return c.add(l.id),void this.Bi(l);((p=l.appearance)===null||p===void 0?void 0:p.widgetType)==="selector"&&(s=l.appearance)!==null&&s!==void 0&&s.widgetSelector&&(u.add(l.id),this.Zi(l,(h=l.appearance)===null||h===void 0?void 0:h.widgetSelector))}se(this.Ji)&&l.type===St&&this.handlePopoverSurvey(l,void 0,{resumeDelayFromActivation:!0})}),this.Si.forEach(({survey:l})=>{u.has(l.id)||this.zi(l)}),this.xi.forEach((l,d)=>{c.has(d)||this.Vi(l)})},t)},this.Ni=t=>{se(this.Ji)||I.error(`Survey ${this.Ji} already in focus. Cannot add survey ${t.id}.`),this.Ji=t.id},this.qi=t=>{this.Ji!==t.id&&I.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Di(t.id),this.Ji=null,this.Ii=null,this.Ti=!1,this.Ei=null,this.Li=void 0,this.Wi(t)},this._posthog=e,this.Ji=null,this.Ri=()=>this.Ki(),X(N,"languagechange",this.Ri),this.$i=e.onFeatureFlags(()=>this.Ki())}Ki(){if(se(this.Ji))return;const e=this._posthog.get_property(on),t=e?.find(a=>a.id===this.Ji);if(!t)return;const{survey:r,language:n}=this.Oi(t);if(n===this.Ii||(this.Ii=n,!this.Ti))return;const i=this.Pi(r,this.Li),{shadow:o}=nt(i,this._posthog);oe(f(Ce,x(x({},this.Ei),{},{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.qi,surveyLanguage:n})),o)}get Xi(){var e,t,r;return(e=(t=(r=this._posthog).getExtension)===null||t===void 0?void 0:t.call(r,"featureFlags"))!==null&&e!==void 0?e:this._posthog.featureFlags}Pi(e,t){return t?.position||t?.selector?x(x({},e),{},{appearance:x(x(x({},e.appearance),t.position&&{position:t.position}),t.selector&&{widgetSelector:t.selector})}):e}Di(e){const t=this.ki.get(e);t&&(clearTimeout(t),this.ki.delete(e))}cancelSurvey(e){this.ki.has(e)&&(I.info(`Cancelled pending survey ${e}`),this.Di(e),this.Ji===e&&(this.Ji=null,this.Ii=null,this.Ti=!1,this.Ei=null,this.Li=void 0))}clearInMemoryInProgressSurveyState(){(()=>{for(const e of Object.keys(ke))delete ke[e]})()}setAutomaticDisplayDispose(e){this.Yi=e}dispose(){var e;(e=this.Yi)===null||e===void 0||e.call(this),this.Yi=void 0,this.Ri&&(N.removeEventListener("languagechange",this.Ri),this.Ri=null),this.$i&&(this.$i(),this.$i=null),this.ki.forEach((t,r)=>this.Di(r)),this.Si.forEach((t,r)=>this.Hi(r)),this.Ci.forEach((t,r)=>{oe(null,r),t?.remove()}),this.Ci.clear(),this.xi.clear(),this.Ji=null}Qi(e){return e.sort((t,r)=>{var n,i;const o=ot(t),a=ot(r);if(o&&!a)return-1;if(!o&&a)return 1;const u=t.schedule===Pt,c=r.schedule===Pt;return u&&!c?1:!u&&c?-1:(((n=t.appearance)===null||n===void 0?void 0:n.surveyPopupDelaySeconds)||0)-(((i=r.appearance)===null||i===void 0?void 0:i.surveyPopupDelaySeconds)||0)})}Oi(e){return xi(e,this._posthog)}Gi(e,t,r){if(this.Mi.has(e.id))return!1;const{params:n}=(function(o){const a={};let u=!1;const c=o.replace(/^\?/,"");if(!c)return{params:a,autoSubmit:u};const l=c.split("&");for(const d of l){const[p,s]=d.split("=");if(!p||$(s))continue;const h=decodeURIComponent(p),g=decodeURIComponent(s);if(h==="auto_submit"&&g==="true"){u=!0;continue}const _=h.match(/^q(\d+)$/);if(_){const v=parseInt(_[1],10);a[v]||(a[v]=[]),a[v].push(g)}}return{params:a,autoSubmit:u}})(N.location.search);if(Object.keys(n).length===0)return!1;I.info("[Survey Prefill] Detected URL prefill parameters");const i=this.tr(e,n,t);return!!i&&(this.er(e,i,r,t),this.Mi.add(e.id),i.isSurveyCompleted)}er(e,t,r,n){const{responses:i,submissionId:o,isSurveyCompleted:a,skippedResponses:u}=t;(Object.keys(u).length>0&&e.enable_partial_responses||a)&&dn({responses:a?i:u,survey:e,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:a,properties:r,surveyLanguage:n})}Fi(e,t,r,n){const i={};for(const[a,u]of Object.entries(t))i[parseInt(a)]=Y(u)?u.map(String):[String(u)];I.info("[Survey] Processing initial responses");const o=this.tr(e,i,n);return!!o&&(this.er(e,o,r,n),o.isSurveyCompleted)}tr(e,t,r){try{const n=(function(l,d){const p={};return l.questions.forEach((s,h)=>{if(!d[h]||!s.id)return;const g=d[h],_=de(s.id);try{switch(s.type){case Le:{if(!s.choices||s.choices.length===0)return void Z.warn(`[Survey Prefill] Question ${h} has no choices`);const v=parseInt(g[0],10);if(isNaN(v)||0>v||v>=s.choices.length)return void Z.warn(`[Survey Prefill] Invalid choice index for q${h}: ${g[0]}`);p[_]=s.choices[v];break}case Ct:{if(!s.choices||s.choices.length===0)return void Z.warn(`[Survey Prefill] Question ${h} has no choices`);const v=g.map(y=>parseInt(y,10)).filter(y=>!isNaN(y)&&y>=0&&s.choices.length>y);if(v.length===0)return void Z.warn(`[Survey Prefill] No valid choices for q${h}`);const m=[...new Set(v.map(y=>s.choices[y]))];v.length>m.length&&Z.warn(`[Survey Prefill] Removed duplicate choices for q${h}`),p[_]=m;break}case qt:{const v=parseInt(g[0],10),m=s.scale||10;if(isNaN(v)||0>v||v>m)return void Z.warn(`[Survey Prefill] Invalid rating for q${h}: ${g[0]} (scale: 0-${m})`);p[_]=v;break}default:Z.info(`[Survey Prefill] Question type ${s.type} does not support prefill`)}}catch(v){Z.error(`[Survey Prefill] Error converting q${h}:`,v)}}),p})(e,t);if(Object.keys(n).length===0)return I.warn("[Survey Prefill] No valid responses after conversion"),null;const i=ln(),{startQuestionIndex:o,skippedResponses:a,skippedIndices:u}=(function(l,d,p){let s=0;const h={},g=[],_=l.questions.length+1;let v=0;for(;l.questions.length>s&&_>v&&(v++,d.includes(s));){const m=l.questions[s];if(!m||!("skipSubmitButton"in m)||!m.skipSubmitButton)break;if(m.id){const w=de(m.id);$(p[w])||(h[w]=p[w])}g.push(s);const y=wn(l,s,m.id?p[de(m.id)]:null);if(y===K)return{startQuestionIndex:l.questions.length,skippedResponses:h,skippedIndices:g};s=y}return{startQuestionIndex:s,skippedResponses:h,skippedIndices:g}})(e,Object.keys(t).map(l=>parseInt(l,10)),n),c=o>=e.questions.length;return Zt(e,{surveySubmissionId:i,responses:n,lastQuestionIndex:o,questionOrder:it(e.questions),visitedIndices:u,surveyLanguage:r}),I.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:n,submissionId:i,startQuestionIndex:o,isSurveyCompleted:c,skippedResponses:a}}catch(n){return I.error("[Survey Prefill] Error handling prefill:",n),null}}nr(e,t=void 0){if(!e)return!0;const r=this.Xi,n=!!r?.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")});let i=!0;t&&(i=r?.getFeatureFlag(e,{send_event:!1})===t||t==="any");const o=n&&i;return o||this.ir(e),o}ir(e){var t;!this.Ai&&(t=this._posthog.config)!==null&&t!==void 0&&t.advanced_disable_feature_flags&&(this.Ai=!0,I.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.`))}rr(e){return!e.conditions||jt(e,this._posthog)&&Xn(e)&&(function(t){var r;return!(!((r=t.conditions)===null||r===void 0)&&r.selector)||!!xe?.querySelector(t.conditions.selector)})(e)}sr(e){var t;return fn(e)?{satisfied:!0}:e.internal_targeting_flag_key&&(function(r){var n;return r.schedule==="recurring"||((n=r.current_iteration)!==null&&n!==void 0?n:0)>0})(e)&&!(!((t=this.Xi)===null||t===void 0)&&t.hasLoadedFlags)?(this.ir(e.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.nr(e.internal_targeting_flag_key)}}checkSurveyEligibility(e){var t,r;const n={eligible:!0,reason:void 0};if(!(function(u){return!(!u.start_date||u.end_date)})(e))return n.eligible=!1,n.reason=`Survey is not running. It was completed on ${e.end_date}`,n;if(!Zn.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=(t=e.conditions)===null||t===void 0?void 0:t.linkedFlagVariant;if(!this.nr(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.nr(e.targeting_flag_key))return n.eligible=!1,n.reason="Survey targeting feature flag is not enabled",n;const o=this.sr(e);var a;return o.satisfied?(function(u,c){if(!u||!c)return!0;const l=typeof c=="string"?new Date(c):c,d=Math.abs(new Date().getTime()-l.getTime());return Math.ceil(d/864e5)>u})((r=e.conditions)===null||r===void 0?void 0:r.seenSurveyWaitPeriodInDays,te.Ot("lastSeenSurveyDate"))?((u=>!!te.Ot(rn(u))&&!fn(u))(e)&&(n.eligible=!1,n.reason="Survey has already been seen and it can't be activated again"),n):(n.eligible=!1,n.reason="Survey wait period has not passed",n):(n.eligible=!1,n.reason=(a=o.reason)!==null&&a!==void 0?a:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",n)}checkSurveyCaptureEligibility(){return ee(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.ar(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}ar(e){var t;if(!Jr(e)&&!(function(n){var i;return!!(!((i=n.conditions)===null||i===void 0||(i=i.actions)===null||i===void 0||(i=i.values)===null||i===void 0)&&i.length)})(e))return!0;const r=(t=this._posthog.surveys)===null||t===void 0||(t=t._surveyEventReceiver)===null||t===void 0?void 0:t.getSurveys();return!!r?.includes(e.id)}lr(e){var t;return!(!((t=e.feature_flag_keys)===null||t===void 0)&&t.length)||e.feature_flag_keys.every(({key:r,value:n})=>!r||!n||this.nr(n))}ji(e){return this.checkSurveyEligibility(e).eligible&&this.rr(e)&&this.ar(e)&&this.lr(e)}Wi(e){try{const t=le.querySelector(zt(e,!0));t!=null&&t.shadowRoot&&(oe(null,t.shadowRoot),this.Ci.delete(t.shadowRoot)),t?.remove()}catch(t){I.warn(`Failed to remove survey ${e.id} from DOM:`,t)}}getTestAPI(){return{addSurveyToFocus:this.Ni,removeSurveyFromFocus:this.qi,surveyInFocus:this.Ji,surveyTimeouts:this.ki,handleWidget:this.Bi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Zi,sortSurveysByAppearanceDelay:this.Qi,checkFlags:this.lr.bind(this),isSurveyFeatureFlagEnabled:this.nr.bind(this),onLanguageChange:this.Ki.bind(this),currentLanguage:this.Ii,surveyIsRendered:this.Ti}}};function kn(e,t){if(!le||!N)return;const r=new ki(e);if(e.config.disable_surveys_automatic_display)return I.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(t===!1)return I.info("There are no surveys to load or Surveys is disabled in the project settings."),r;let n;r.callSurveysAndEvaluateDisplayLogic(!0);const i=()=>{$(n)&&(n=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{$(n)||(clearInterval(n),n=void 0)};i();const a=()=>{le.hidden?o():(r.callSurveysAndEvaluateDisplayLogic(!1),i())};return X(le,"visibilitychange",a),r.setAutomaticDisplayDispose(()=>{o(),le.removeEventListener("visibilitychange",a)}),r}function Sn({survey:e,removeSurveyFromFocus:t=()=>{},setSurveyVisible:r,isPreviewMode:n=!1,posthog:i}){ye(()=>{var o;if(n||!(!((o=e.conditions)===null||o===void 0)&&o.url))return;const a=()=>{var l;const d=e.type===_e,p=jt(e,i),s=((l=e.appearance)===null||l===void 0?void 0:l.widgetType)===me&&d;if(!p)return I.info(`Hiding survey ${e.id} because URL does not match`),r(!1),t(e);s&&(I.info(`Showing survey ${e.id} because it is a feedback button tab and URL matches`),r(!0))};X(N,"popstate",a),X(N,"hashchange",a);const u=N.history.pushState,c=N.history.replaceState;return N.history.pushState=function(...l){u.apply(this,l),a()},N.history.replaceState=function(...l){c.apply(this,l),a()},()=>{N.removeEventListener("popstate",a),N.removeEventListener("hashchange",a),N.history.pushState=u,N.history.replaceState=c}},[n,e,t,r,i])}const Si=200;function Ci(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 Ce({survey:e,forceDisableHtml:t,posthog:r,style:n={},previewPageIndex:i,removeSurveyFromFocus:o=()=>{},isPopup:a=!0,onPreviewSubmit:u=()=>{},onPreviewBack:c=()=>{},onPopupSurveyDismissed:l=()=>{},onCloseConfirmationMessage:d=()=>{},properties:p,isSurveyCompleted:s,skipShownEvent:h,surveyLanguage:g}){var _,v,m,y,w,P,S,M,D,b,C,k;const q=Me(null),F=Number.isInteger(i),{isPopupVisible:T,isSurveySent:L,hidePopupWithAnimation:j}=(function(V,R,re,ue,Cn,Ii,qn,Mi,Pn){const[Li,lt]=O(ue||re===0||V.type===Lr),[Ei,$i]=O(!1),Jt=Me(!1),ut=()=>{const z=()=>{Ii&&Cn(V),lt(!1)};if(Jt.current)return;const Pe=qn?.current;Pe?(Jt.current=!0,Pe.style.transition=`opacity ${Si}ms ease-out`,Pe.style.opacity="0",setTimeout(()=>{Jt.current=!1,z()},250)):z()},Tn=z=>{z.detail.surveyId===V.id&&ut()};return ye(()=>{if(!R)return void I.error("usePopupVisibility hook called without a PostHog instance.");if(ue)return;let z;const Pe=Re=>{var ct,er;if(Re.detail.surveyId===V.id){if(!(!((ct=V.appearance)===null||ct===void 0)&&ct.displayThankYouMessage))return ut();$i(!0),(er=V.appearance)!==null&&er!==void 0&&er.autoDisappear&&(z&&clearTimeout(z),z=setTimeout(ut,5e3))}},In=()=>{if(jt(V,R)){var Re;lt(!0),N.dispatchEvent(new Event("PHSurveyShown")),Mi||R.capture("survey shown",x(x({[It]:V.name,[Tt]:V.id,[Mt]:V.current_iteration,[Lt]:V.current_iteration_start_date},Pn&&{[$r]:Pn}),{},{sessionRecordingUrl:(Re=R.get_session_replay_url)===null||Re===void 0?void 0:Re.call(R)}));try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}};X(N,"PHSurveyClosed",Tn),X(N,"PHSurveySent",Pe);const Xt=re>0?setTimeout(In,re):void 0;return $(Xt)&&In(),()=>{$(Xt)||clearTimeout(Xt),$(z)||clearTimeout(z),N.removeEventListener("PHSurveyClosed",Tn),N.removeEventListener("PHSurveySent",Pe)}},[]),Sn({survey:V,removeSurveyFromFocus:Cn,setSurveyVisible:lt,isPreviewMode:ue,posthog:R}),{isPopupVisible:Li,isSurveySent:Ei,setIsPopupVisible:lt,hidePopupWithAnimation:ut}})(e,r,!((_=e.appearance)===null||_===void 0)&&_.surveyPopupDelaySeconds?1e3*e.appearance.surveyPopupDelaySeconds:0,F,o,a,q,h,g),qe=L||i===e.questions.length||s===!0,[De,Ne]=O(!1),Be=G(()=>!!he(e),[e]),Fe=!(!(!((v=e.appearance)===null||v===void 0)&&v.introScreenHeader)&&!(!((m=e.appearance)===null||m===void 0)&&m.introScreenDescription)),Ae=F?i===-1:!!(!((y=e.appearance)===null||y===void 0)&&y.displayIntroScreen)&&Fe&&!De&&!Be,Ve=G(()=>{const V=he(e),R=V?.surveySubmissionId||ln();return{isPreviewMode:F,previewPageIndex:i,onPopupSurveyDismissed(){g?hn(e,r,F,g):hn(e,r,F),l()},isPopup:a||!1,surveySubmissionId:R,onPreviewSubmit:u,onPreviewBack:c,posthog:r,properties:p,surveyLanguage:g}},[F,i,a,r,e,l,u,c,p,g]);return T?f(pe.Provider,{value:Ve,children:f("div",{className:"ph-survey",style:x(x({},ei(e.type,(w=e.appearance)===null||w===void 0?void 0:w.position,(P=e.appearance)===null||P===void 0?void 0:P.widgetType)),n),ref:q,children:qe?f(ui,{header:((S=e.appearance)===null||S===void 0?void 0:S.thankYouMessageHeader)||"Thank you!",description:((M=e.appearance)===null||M===void 0?void 0:M.thankYouMessageDescription)||"",forceDisableHtml:!!t,contentType:(D=e.appearance)===null||D===void 0?void 0:D.thankYouMessageDescriptionContentType,appearance:e.appearance||ae,onClose(){j(),d()}}):Ae?f(ci,{header:((b=e.appearance)===null||b===void 0?void 0:b.introScreenHeader)||"",description:((C=e.appearance)===null||C===void 0?void 0:C.introScreenDescription)||"",forceDisableHtml:!!t,contentType:(k=e.appearance)===null||k===void 0?void 0:k.introScreenDescriptionContentType,appearance:e.appearance||ae,onStart:()=>Ne(!0)}):f(qi,{survey:e,forceDisableHtml:!!t,posthog:r})})}):null}function qi({survey:e,forceDisableHtml:t,posthog:r}){var n,i;const o=G(()=>{const T=he(e);if(!T)return null;const L=J(T.lastQuestionIndex);return!L||L&&T.lastQuestionIndex>=0&&e.questions.length>T.lastQuestionIndex?T:(Qt(e),null)},[e]),[a,u]=O(()=>(o!=null&&o.responses&&I.info("Survey is already in progress, filling in initial responses"),o?.responses||{})),[c,l]=O(!1),{previewPageIndex:d,onPopupSurveyDismissed:p,isPopup:s,onPreviewSubmit:h,onPreviewBack:g,surveySubmissionId:_,isPreviewMode:v,properties:m,surveyLanguage:y}=ge(pe),[w,P]=O(()=>{const T=o?.lastQuestionIndex,L=J(T)&&T>=0&&e.questions.length>T?T:0;return J(d)&&d>=0?d:L}),[S,M]=O(()=>{var T;return((T=o?.visitedIndices)!==null&&T!==void 0?T:[]).filter(L=>L>=0&&e.questions.length>L)}),[D,b]=O(()=>{var T;const L=he(e);return(T=L?.questionSnapshots)!==null&&T!==void 0?T:{}}),C=G(()=>it(vn(e,o)),[e.id,o]),k=G(()=>{if(!C||new Set(C).size!==C.length)return vn(e,o);const T=new Map(e.questions.map(j=>[j.id,j])),L=C.map(j=>T.get(j)).filter(j=>!!j);return L.length===C.length?L:e.questions},[C,e.questions,e,o]);ye(()=>{!v||$(d)||0>d||P(d)},[d,v]);const q=!!(!((n=e.appearance)===null||n===void 0)&&n.allowGoBack)&&(v?(d??0)>0:S.length>0),F=k.at(w);return F?f("form",{className:"survey-form",name:"surveyForm",children:[s&&((i=e.appearance)===null||i===void 0?void 0:i.hideCancelButton)!==!0&&f(Wt,{onClick(){p()}}),f("div",{className:"survey-box","data-question-index":w,children:[c&&f("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Ti({question:F,forceDisableHtml:t,displayQuestionIndex:w,appearance:e.appearance||ae,onSubmit:T=>(({res:L,displayQuestionIndex:j,questionId:qe})=>{if(!r)return void I.error("onNextButtonClick called without a PostHog instance.");if(!ee(r))return void l(!0);if(l(!1),!qe)return void I.error("onNextButtonClick called without a questionId.");const{responses:De,questionSnapshots:Ne}=(function({responses:Ve,questionSnapshots:V={}},R,re,ue){return{responses:x(x({},Ve),{},{[de(R)]:re}),questionSnapshots:ue?.id?x(x({},V),{},{[ue.id]:ue.question}):V}})({responses:a,questionSnapshots:D},qe,L,k[j]);u(De),b(Ne);const Be=wn(e,j,L),Fe=Be===K,Ae=[...S,j];if(Fe||(M(Ae),P(Be),Zt(e,{surveySubmissionId:_,responses:De,lastQuestionIndex:Be,questionOrder:it(k),visitedIndices:Ae,surveyLanguage:y,questionSnapshots:Ne})),e.enable_partial_responses||Fe){const Ve=new Set(Ae.map(R=>{var re;return(re=k[R])===null||re===void 0?void 0:re.id}).filter(R=>!!R).map(R=>de(R))),V=Object.fromEntries(Object.entries(De).filter(([R])=>Ve.has(R)));dn({responses:V,survey:e,surveySubmissionId:_,isSurveyCompleted:Fe,posthog:r,properties:m,surveyLanguage:y,questionSnapshots:Ne})}})({res:T,displayQuestionIndex:w,questionId:F.id}),onPreviewSubmit:h,initialValue:F.id?a[de(F.id)]:void 0,canGoBack:q,onBack(){if(v)return void g();if(S.length===0)return;const T=S[S.length-1],L=S.slice(0,-1);M(L),P(T),Zt(e,{surveySubmissionId:_,responses:a,lastQuestionIndex:T,questionOrder:it(k),visitedIndices:L,surveyLanguage:y,questionSnapshots:D})}})]})]}):null}function Pi({survey:e,forceDisableHtml:t,posthog:r,readOnly:n,surveyLanguage:i}){var o,a,u,c,l,d,p;const[s,h]=O(!0),[g,_]=O(!1),[v,m]=O({}),y=Me(void 0),w=()=>{(g||!r||n||ee(r))&&_(!g)};if(ye(()=>{var S;if(!r)return void I.error("FeedbackWidget called without a PostHog instance.");if(n)return;((S=e.appearance)===null||S===void 0?void 0:S.widgetType)==="tab"&&m({top:"50%",bottom:"auto"});const M=D=>{var b;const C=D;((b=C.detail)===null||b===void 0?void 0:b.surveyId)===e.id&&(I.info(`Received show event for feedback button survey ${e.id}`),m(C.detail.position||{}),w())};return X(N,Kt,M),()=>{$(y.current)||(clearTimeout(y.current),y.current=void 0),N.removeEventListener(Kt,M)}},[r,n,e.id,(o=e.appearance)===null||o===void 0?void 0:o.widgetType,(a=e.appearance)===null||a===void 0?void 0:a.widgetSelector,(u=e.appearance)===null||u===void 0?void 0:u.borderColor]),Sn({survey:e,setSurveyVisible:h,posthog:r}),!s)return null;const P=()=>{e.schedule!==Pt&&h(!1),$(y.current)||clearTimeout(y.current),y.current=setTimeout(()=>{y.current=void 0,_(!1)},200)};return f(W,{children:[((c=e.appearance)===null||c===void 0?void 0:c.widgetType)==="tab"&&f("button",{className:"ph-survey-widget-tab "+(((l=e.appearance)===null||l===void 0?void 0:l.tabPosition)==="top"?"widget-tab-top":""),onClick:w,disabled:n,style:Ci((d=e.appearance)===null||d===void 0?void 0:d.tabPosition),children:((p=e.appearance)===null||p===void 0?void 0:p.widgetLabel)||""}),g&&f(Ce,{posthog:r,survey:e,forceDisableHtml:t,style:v,onPopupSurveyDismissed:P,onCloseConfirmationMessage:P,surveyLanguage:i})]})}const Ti=({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:a,canGoBack:u,onBack:c})=>{const l={forceDisableHtml:t,appearance:n,onPreviewSubmit(d){o(d)},onSubmit(d){i(d)},initialValue:a,displayQuestionIndex:r,canGoBack:u,onBack:c};switch(e.type){case Er:return ie(di,x(x({},l),{},{question:e,key:e.id}));case"link":return ie(pi,x(x({},l),{},{question:e,key:e.id}));case qt:return ie(hi,x(x({},l),{},{question:e,key:e.id}));case Le:case Ct:return ie(fi,x(x({},l),{},{question:e,key:e.id}));default:return I.error(`Unsupported question type: ${e.type}`),null}},He=typeof globalThis<"u"?globalThis:H;He&&typeof self>"u"&&(He.self=He),He&&typeof File>"u"&&(He.File=function(){});const at=H??{};at.__PosthogExtensions__=at.__PosthogExtensions__||{},at.__PosthogExtensions__.generateSurveys=kn,at.extendPostHogWithSurveys=kn})();
1
+ (function(){try{var U=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};U.SENTRY_RELEASE={id:"3.12.5"};var E=new U.Error().stack;E&&(U._sentryDebugIds=U._sentryDebugIds||{},U._sentryDebugIds[E]="087ac3cc-4491-4179-996c-ffa72892ccc5",U._sentryDebugIdIdentifier="sentry-dbid-087ac3cc-4491-4179-996c-ffa72892ccc5")}catch{}})();(function(){var U,E,dt,ne,rr,nr,ir,pt,Oe,Te,or,ht,vt,ft,sr,ve,B,yt,ar,je={},Ue=[],Mn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ze=Array.isArray;function Q(e,t){for(var r in t)e[r]=t[r];return e}function gt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ie(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?U.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Ie(e,a,n,i,null)}function Ie(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++dt,__i:-1,__u:0};return i==null&&E.vnode!=null&&E.vnode(o),o}function W(e){return e.children}function Qe(e,t){this.props=e,this.context=t}function fe(e,t){if(t==null)return e.__?fe(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?fe(e):null}function Ln(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],i=[],o=Q({},t);o.__v=t.__v+1,E.vnode&&E.vnode(o),_t(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,r??fe(t),!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,hr(n,o,i),t.__e=t.__=null,o.__e!=r&&lr(o)}}function lr(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),lr(e)}function mt(e){(!e.__d&&(e.__d=!0)&&ne.push(e)&&!ze.__r++||rr!=E.debounceRendering)&&((rr=E.debounceRendering)||nr)(ze)}function ze(){try{for(var e,t=1;ne.length;)ne.length>t&&ne.sort(ir),e=ne.shift(),t=ne.length,Ln(e)}finally{ne.length=ze.__r=0}}function ur(e,t,r,n,i,o,a,u,c,l,d){var p,s,h,g,_,v,m,y=n&&n.__k||Ue,w=t.length;for(c=En(r,t,y,c,w),p=0;w>p;p++)(h=r.__k[p])!=null&&(s=h.__i!=-1&&y[h.__i]||je,h.__i=p,v=_t(e,h,s,i,o,a,u,c,l,d),g=h.__e,h.ref&&s.ref!=h.ref&&(s.ref&&wt(s.ref,null,h),d.push(h.ref,h.__c||g,h)),_==null&&g!=null&&(_=g),(m=!!(4&h.__u))||s.__k===h.__k?(c=cr(h,c,e,m),m&&s.__e&&(s.__e=null)):typeof h.type=="function"&&v!==void 0?c=v:g&&(c=g.nextSibling),h.__u&=-7);return r.__e=_,c}function En(e,t,r,n,i){var o,a,u,c,l,d=r.length,p=d,s=0;for(e.__k=new Array(i),o=0;i>o;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[o]=Ie(null,a,null,null,null):Ze(a)?a=e.__k[o]=Ie(W,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[o]=Ie(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,c=o+s,a.__=e,a.__b=e.__b+1,u=null,(l=a.__i=$n(a,r,c,p))!=-1&&(p--,(u=r[l])&&(u.__u|=2)),u==null||u.__v==null?(l==-1&&(i>d?s--:d>i&&s++),typeof a.type!="function"&&(a.__u|=4)):l!=c&&(l==c-1?s--:l==c+1?s++:(l>c?s--:s++,a.__u|=4))):e.__k[o]=null;if(p)for(o=0;d>o;o++)(u=r[o])!=null&&!(2&u.__u)&&(u.__e==n&&(n=fe(u)),fr(u,u));return n}function cr(e,t,r,n){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&i.length>o;o++)i[o]&&(i[o].__=e,t=cr(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=fe(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function $n(e,t,r,n){var i,o,a,u=e.key,c=e.type,l=t[r],d=l!=null&&!(2&l.__u);if(l===null&&u==null||d&&u==l.key&&c==l.type)return r;if(n>(d?1:0)){for(i=r-1,o=r+1;i>=0||t.length>o;)if((l=t[a=0>i?o++:i--])!=null&&!(2&l.__u)&&u==l.key&&c==l.type)return a}return-1}function dr(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Mn.test(t)?r:r+"px"}function We(e,t,r,n,i){var o,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||dr(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||dr(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(or,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r[Te]=n[Te]:(r[Te]=ht,e.addEventListener(t,o?ft:vt,o)):e.removeEventListener(t,o?ft:vt,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function pr(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[Oe]==null)t[Oe]=ht++;else if(r[Te]>t[Oe])return;return r(E.event?E.event(t):t)}}}function _t(e,t,r,n,i,o,a,u,c,l){var d,p,s,h,g,_,v,m,y,w,P,S,M,D,b,C,k=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),o=[u=t.__e=r.__e]),(d=E.__b)&&d(t);e:if(typeof k=="function"){p=a.length;try{if(y=t.props,w=k.prototype&&k.prototype.render,P=(d=k.contextType)&&n[d.__c],S=d?P?P.props.value:d.__:n,r.__c?m=(s=t.__c=r.__c).__=s.__E:(w?t.__c=s=new k(y,S):(t.__c=s=new Qe(y,S),s.constructor=k,s.render=Dn),P&&P.sub(s),s.state||(s.state={}),s.__n=n,h=s.__d=!0,s.__h=[],s._sb=[]),w&&s.__s==null&&(s.__s=s.state),w&&k.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=Q({},s.__s)),Q(s.__s,k.getDerivedStateFromProps(y,s.__s))),g=s.props,_=s.state,s.__v=t,h)w&&k.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),w&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(w&&k.getDerivedStateFromProps==null&&y!==g&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(y,S),t.__v==r.__v||!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(y,s.__s,S)===!1){t.__v!=r.__v&&(s.props=y,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(q){q&&(q.__=t)}),Ue.push.apply(s.__h,s._sb),s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(y,s.__s,S),w&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(g,_,v)})}if(s.context=S,s.props=y,s.__P=e,s.__e=!1,M=E.__r,D=0,w)s.state=s.__s,s.__d=!1,M&&M(t),d=s.render(s.props,s.state,s.context),Ue.push.apply(s.__h,s._sb),s._sb=[];else do s.__d=!1,M&&M(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&25>++D);s.state=s.__s,s.getChildContext!=null&&(n=Q(Q({},n),s.getChildContext())),w&&!h&&s.getSnapshotBeforeUpdate!=null&&(v=s.getSnapshotBeforeUpdate(g,_)),b=d!=null&&d.type===W&&d.key==null?vr(d.props.children):d,u=ur(e,Ze(b)?b:[b],t,r,n,i,o,a,u,c,l),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),m&&(s.__E=s.__=null)}catch(q){if(a.length=p,t.__v=null,c||o!=null)if(q.then){for(t.__u|=c?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;o!=null&&(o[o.indexOf(u)]=null),t.__e=u}else{if(o!=null)for(C=o.length;C--;)gt(o[C]);bt(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),q.then||bt(t);E.__e(q,t,r)}}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):u=t.__e=Hn(r.__e,t,r,n,i,o,a,c,l);return(d=E.diffed)&&d(t),128&t.__u?void 0:u}function bt(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(bt))}function hr(e,t,r){for(var n=0;r.length>n;n++)wt(r[n],r[++n],r[++n]);E.__c&&E.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){E.__e(o,i.__v)}})}function vr(e){return typeof e!="object"||e==null||e.__b>0?e:Ze(e)?e.map(vr):e.constructor!==void 0?null:Q({},e)}function Hn(e,t,r,n,i,o,a,u,c){var l,d,p,s,h,g,_,v=r.props||je,m=t.props,y=t.type;if(y=="svg"?i="http://www.w3.org/2000/svg":y=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(l=0;o.length>l;l++)if((h=o[l])&&"setAttribute"in h==!!y&&(y?h.localName==y:h.nodeType==3)){e=h,o[l]=null;break}}if(e==null){if(y==null)return document.createTextNode(m);e=document.createElementNS(i,y,m.is&&m),u&&(E.__m&&E.__m(t,o),u=!1),o=null}if(y==null)v===m||u&&e.data==m||(e.data=m);else{if(o=y=="textarea"&&m.defaultValue!=null?null:o&&U.call(e.childNodes),!u&&o!=null)for(v={},l=0;e.attributes.length>l;l++)v[(h=e.attributes[l]).name]=h.value;for(l in v)h=v[l],l=="dangerouslySetInnerHTML"?p=h:l=="children"||l in m||l=="value"&&"defaultValue"in m||l=="checked"&&"defaultChecked"in m||We(e,l,null,h,i);for(l in m)h=m[l],l=="children"?s=h:l=="dangerouslySetInnerHTML"?d=h:l=="value"?g=h:l=="checked"?_=h:u&&typeof h!="function"||v[l]===h||We(e,l,h,v[l],i);if(d)u||p&&(d.__html==p.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),ur(t.type=="template"?e.content:e,Ze(s)?s:[s],t,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&fe(r,0),u,c),o!=null)for(l=o.length;l--;)gt(o[l]);u&&y!="textarea"||(l="value",y=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[l]||y=="progress"&&!g||y=="option"&&g!=v[l])&&We(e,l,g,v[l],i),l="checked",_!=null&&_!=e[l]&&We(e,l,_,v[l],i))}return e}function wt(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){E.__e(i,r)}}function fr(e,t,r){var n,i;if(E.unmount&&E.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||wt(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){E.__e(o,t)}n.base=n.__P=n.__n=null}if(n=e.__k)for(i=0;n.length>i;i++)n[i]&&fr(n[i],t,r||typeof e.type!="function");r||gt(e.__e),e.__c=e.__=e.__e=void 0}function Dn(e,t,r){return this.constructor(e,r)}function oe(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),E.__&&E.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],_t(t,e=(!n&&r||t).__k=ie(W,null,[e]),i||je,je,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?U.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),hr(o,e,a),e.props.children=null}U=Ue.slice,E={__e(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(u){e=u}throw e}},dt=0,Qe.prototype.setState=function(e,t){var r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Q({},this.state);typeof e=="function"&&(e=e(Q({},r),this.props)),e&&Q(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),mt(this))},Qe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),mt(this))},Qe.prototype.render=W,ne=[],nr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ir=function(e,t){return e.__v.__b-t.__v.__b},ze.__r=0,pt=Math.random().toString(8),Oe="__d"+pt,Te="__a"+pt,or=/(PointerCapture)$|Capture$/i,ht=0,vt=pr(!1),ft=pr(!0),sr=0;var Ge=0,yr=[],A=E,gr=A.__b,mr=A.__r,_r=A.diffed,br=A.__c,wr=A.unmount,xr=A.__;function Ke(e,t){A.__h&&A.__h(B,e,Ge||t),Ge=0;var r=B.__H||(B.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function O(e){return Ge=1,(function(t,r){var n=Ke(ve++,2);if(n.t=t,!n.__c&&(n.__=[Pr(void 0,r),function(u){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,u);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=B,!B.__f)){var i=function(u,c,l){if(!n.__c.__H)return!0;var d=!1,p=n.__c.props!==u;if(n.__c.__H.__.some(function(h){if(h.__N){d=!0;var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(p=!0)}}),o){var s=o.call(this,u,c,l);return d?s||p:s}return!d||p};B.__f=!0;var o=B.shouldComponentUpdate,a=B.componentWillUpdate;B.componentWillUpdate=function(u,c,l){if(this.__e){var d=o;o=void 0,i(u,c,l),o=d}a&&a.call(this,u,c,l)},B.shouldComponentUpdate=i}return n.__N||n.__})(Pr,e)}function ye(e,t){var r=Ke(ve++,3);!A.__s&&qr(r.__H,t)&&(r.__=e,r.u=t,B.__H.__h.push(r))}function Me(e){return Ge=5,G(function(){return{current:e}},[])}function G(e,t){var r=Ke(ve++,7);return qr(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ge(e){var t=B.context[e.__c],r=Ke(ve++,9);return r.c=e,t?(r.__??(r.__=!0,t.sub(B)),t.props.value):e.__}function kr(){for(var e;e=yr.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(xt),t.__h.some(Cr),t.__h=[]}catch(r){t.__h=[],A.__e(r,e.__v)}}}A.__b=function(e){B=null,gr&&gr(e)},A.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),xr&&xr(e,t)},A.__r=function(e){mr&&mr(e),ve=0;var t=(B=e.__c).__H;t&&(yt===B?(t.__h=[],B.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.length&&kr(),ve=0)),yt=B},A.diffed=function(e){_r&&_r(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(yr.push(t)!==1&&ar===A.requestAnimationFrame||((ar=A.requestAnimationFrame)||Nn)(kr)),t.__H.__.some(function(r){r.u&&(r.__H=r.u,r.u=void 0)})),yt=B=null},A.__c=function(e,t){t.some(function(r){try{r.__h.some(xt),r.__h=r.__h.filter(function(n){return!n.__||Cr(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],A.__e(n,r.__v)}}),br&&br(e,t)},A.unmount=function(e){wr&&wr(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(n){try{xt(n)}catch(i){t=i}}),r.__H=void 0,t&&A.__e(t,r.__v))};var Sr=typeof requestAnimationFrame=="function";function Nn(e){var t,r=function(){clearTimeout(n),Sr&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Sr&&(t=requestAnimationFrame(r))}function xt(e){var t=B,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),B=t}function Cr(e){var t=B;e.__c=e.__(),B=t}function qr(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Pr(e,t){return typeof t=="function"?t(e):t}const me="tab",Tr="left",Ir="center",kt="right",Mr="next_to_trigger",St="popover",_e="widget",Lr="external_survey",Er="open",Ct="multiple_choice",Le="single_choice",qt="rating",K="end",Pt="always",Tt="$survey_id",It="$survey_name",Mt="$survey_iteration",Lt="$survey_iteration_start_date",$r="$survey_language",Hr="min_length",Dr="max_length",Et=Object.prototype.toString,Y=Array.isArray||function(e){return Et.call(e)==="[object Array]"},Ye=e=>typeof e=="function",$=e=>e===void 0,be=e=>Et.call(e)=="[object String]",se=e=>e===null,Nr=e=>$(e)||se(e),J=e=>Et.call(e)=="[object Number]"&&e==e,Je="Mobile",Xe="Tablet",Br="Android Tablet",Fr="iPad",Ar="Apple Watch",$t="Nintendo",Ht="PlayStation",Dt="Xbox",Vr="Nokia",Nt="Ouya",Bn="Generic "+Je.toLowerCase(),Rr="Generic "+Xe.toLowerCase(),Fn=new RegExp(Dt,"i"),An=new RegExp("PlayStation \\w+","i"),Vn=new RegExp("Nintendo \\w+","i"),Rn=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp($t,"i"),new RegExp(Ht,"i");function Ee(e){return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(e)}function On(e,t,r){return(t=(function(n){var i=(function(o){if(Ee(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var u=a.call(o,"string");if(Ee(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)})(n);return Ee(i)=="symbol"?i:i+""})(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Or(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function x(e){for(var t=1;arguments.length>t;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Or(Object(r),!0).forEach(function(n){On(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jr(e,t){if(!e)return;const r=e.find(n=>n.type===t);return r?.value}const H="u">typeof window?window:void 0,ce="u">typeof globalThis?globalThis:H,we=ce?.navigator,Ur=ce?.document;ce!=null&&ce.XMLHttpRequest&&new ce.XMLHttpRequest;const Zr=we?.userAgent,Qr=(e,{debugEnabled:t}={})=>{const r={N(n,...i){H&&(H.POSTHOG_DEBUG||t)&&!$(H.console)&&H.console&&("__rrweb_original__"in H.console[n]?H.console[n].__rrweb_original__:H.console[n])(e,...i)},debug(...n){r.N("debug",...n)},info(...n){r.N("log",...n)},warn(...n){r.N("warn",...n)},error(...n){r.N("error",...n)},critical(...n){console.error(e,...n)},uninitializedWarning(n){r.error(`You must initialize PostHog before calling ${n}`)},createLogger:(n,i)=>Qr(`${e} ${n}`,i)};return r},Z=Qr("[PostHog.js]"),et=Z.createLogger;function X(e,t,r,n){const{capture:i=!1,passive:o=!0}=n??{};e?.addEventListener(t,r,{capture:i,passive:o})}function de(e){return`$survey_response_${e}`}function zr(e,t){if(!t)return null;const r=e[de(t)];return Y(r)?[...r]:r}function Wr({event:e,survey:t,responses:r={},submissionId:n,completed:i,surveyLanguage:o,questionSnapshots:a}){return x(x(x(x({},!$(n)&&{$survey_submission_id:n}),e==="sent"?!$(i)&&{$survey_completed:i}:{$survey_partially_completed:jn(r)}),o&&{$survey_language:o}),(function(u={},c,l){const d={};return c.questions.forEach(p=>{if($(p.originalQuestionIndex))return;const s=(h=p.originalQuestionIndex)===0?"$survey_response":`$survey_response_${h}`;var h;const g=zr(u,p.id);$(g)||(d[s]=g)}),x(x({$survey_questions:c.questions.map(p=>{var s,h;return{id:p.id,question:(s=l?.[(h=p.id)!==null&&h!==void 0?h:""])!==null&&s!==void 0?s:p.question,response:zr(u,p.id)}})},u),d)})(r,t,a))}function jn(e={}){return Object.values(e).some(t=>!Nr(t))}function Gr(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 Bt(e){return typeof e=="string"&&e.trim()?e.trim():null}function Ft(e){return e.toLowerCase()}function Kr(e,t,r){if(!e||!t)return null;const n=Ft(t),i=Object.keys(e).find(o=>Ft(o)===n);if(i)return r?.debug(`Found exact translation match: ${i}`),i;if(n.includes("-")){const o=n.split("-")[0],a=Object.keys(e).find(u=>Ft(u)===o);if(a)return r?.debug(`Found base language translation match: ${a} (from ${t})`),a}return null}const Yr=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Un(e,t,r){var n;const i=Kr(e.translations,t,r),o=x({},e);let a=!1;if(i){var u;const s=(u=e.translations)===null||u===void 0?void 0:u[i];if(s)if(r?.info(`Applying survey-level translation for language: ${i}`),$(s.name)||(o.name=s.name,a=!0),o.appearance){const h=x({},o.appearance);for(const g of Yr){const _=s[g];$(_)||(h[g]=_,a=!0)}o.appearance=h}else(function(h){return Yr.some(g=>!$(h[g]))})(s)&&(a=!0)}const c=e.questions.map(s=>(function(h,g,_){var v;const m=Kr(h.translations,g,_);if(!m)return{question:h,matchedKey:null,hasChanges:!1};const y=(v=h.translations)===null||v===void 0?void 0:v[m];if(!y)return{question:h,matchedKey:null,hasChanges:!1};const w=x({},h);let P=!1;return $(y.question)||(w.question=y.question,P=!0),$(y.description)||(w.description=y.description,P=!0),$(y.buttonText)||(w.buttonText=y.buttonText,P=!0),"link"in w&&!$(y.link)&&(w.link=y.link,P=!0),"lowerBoundLabel"in w&&!$(y.lowerBoundLabel)&&(w.lowerBoundLabel=y.lowerBoundLabel,P=!0),"upperBoundLabel"in w&&!$(y.upperBoundLabel)&&(w.upperBoundLabel=y.upperBoundLabel,P=!0),"choices"in w&&(function(S){return Y(S.choices)})(y)&&(w.choices=y.choices,P=!0),{question:P?w:h,matchedKey:P?m:null,hasChanges:P}})(s,t,r)),l=c.map(s=>s.question),d=c.some(s=>s.hasChanges);let p=null;return i||(p=((n=c.find(s=>s.matchedKey))===null||n===void 0?void 0:n.matchedKey)||null),d&&(o.questions=l,a=!0,r?.info(`Applied question-level translations for language: ${t}`)),{survey:o,matchedKey:a?i||p:null}}function Jr(e){var t;return!!(!((t=e.conditions)===null||t===void 0||(t=t.events)===null||t===void 0||(t=t.values)===null||t===void 0)&&t.length)}const Xr=(e,t)=>{if(!(r=>{try{new RegExp(r)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},tt=e=>e.toLowerCase(),en={exact:(e,t)=>t.some(r=>e.some(n=>r===n)),is_not:(e,t)=>t.every(r=>e.every(n=>r!==n)),regex:(e,t)=>t.some(r=>e.some(n=>Xr(r,n))),not_regex:(e,t)=>t.every(r=>e.every(n=>!Xr(r,n))),icontains:(e,t)=>t.map(tt).some(r=>e.map(tt).some(n=>r.includes(n))),not_icontains:(e,t)=>t.map(tt).every(r=>e.map(tt).every(n=>!r.includes(n))),gt:(e,t)=>t.some(r=>{const n=parseFloat(r);return!isNaN(n)&&e.some(i=>n>parseFloat(i))}),lt:(e,t)=>t.some(r=>{const n=parseFloat(r);return!isNaN(n)&&e.some(i=>n<parseFloat(i))})},tn=e=>{const t=[...e];for(let r=t.length-1;r>0;r--){const n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t},I=et("[Surveys]");function ee(e){return Ye(e.is_capturing)?e.is_capturing():!e.has_opted_out_capturing()}const At=(e,t)=>`${e}${(function(r){return r.current_iteration&&r.current_iteration>0?`${r.id}_${r.current_iteration}`:r.id})(t)}`,rn=e=>At("seenSurvey_",e),nn=e=>{try{const t=rn(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(t){I.error("Failed to persist survey seen state",t)}},Zn=[St,_e,"api"],on="$surveys";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return J(e)&&isFinite(e)&&Math.floor(e)===e});var Qn=class tr{constructor(t){if(this.bytes=t,t.length!==16)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 tr(o)}toString(){let t="";for(let r=0;this.bytes.length>r;r++)t=t+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),r!==3&&r!==5&&r!==7&&r!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new tr(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let r=0;16>r;r++){const n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}},zn=class{generate(){const e=this.generateOrAbort();if(!$(e))return e;{this.Ct=0;const t=this.generateOrAbort();if($(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const e=(()=>{const t=Date.now();return J(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),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 Qn.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 Wn}};let sn=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};H&&!$(H.crypto)&&crypto.getRandomValues&&(sn=e=>crypto.getRandomValues(e));var Wn=class{nextUint32(){return this.Rt.length>this.$t||(sn(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let an;const ln=()=>Gn().toString(),Gn=()=>(an||(an=new zn)).generate();let Vt=null;const te={Et(){if(!se(Vt))return Vt;let e=!0;if($(H))e=!1;else try{const t="__mplssupport__";te.At(t,"xyz"),te.Ot(t)!=='"xyz"'&&(e=!1),te.Lt(t)}catch{e=!1}return e||Z.error("localStorage unsupported; falling back to cookie store"),Vt=e,e},Pt(e){Z.error("localStorage error: "+e)},Ot(e){try{return H?.localStorage.getItem(e)}catch(t){te.Pt(t)}return null},Dt(e){try{return JSON.parse(te.Ot(e))||{}}catch{}return null},At(e,t){try{return H?.localStorage.setItem(e,JSON.stringify(t)),!0}catch(r){te.Pt(r)}return!1},Lt(e){try{H?.localStorage.removeItem(e)}catch(t){te.Pt(t)}}},Kn=et("[Stylesheet Loader]"),un=H,xe=Ur,rt="#020617",ae={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:kt,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:rt,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Yn=[Ir,Tr,kt];function cn(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 $e(e=ae.backgroundColor){let t;e[0]==="#"&&(t=cn(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=cn(r)),!t)return rt;const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){const i=parseInt(n[1]),o=parseInt(n[2]),a=parseInt(n[3]);return Math.sqrt(i*i*.299+o*o*.587+a*a*.114)>127.5?rt:"white"}return rt}const nt=(e,t,r)=>{const n=zt(e),i=xe.querySelector(`.${n}`);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};const o=xe.createElement("div");((c,l,d)=>{const p=x(x({},ae),d),s=c.style,h=!Yn.includes(p.position)||l===_e&&d?.widgetType===me;s.setProperty("--ph-survey-font-family",(function(m){if(m==="inherit")return"inherit";const y='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return m?`${m}, ${y}`:`-apple-system, ${y}`})(p.fontFamily)),s.setProperty("--ph-survey-box-padding",p.boxPadding),s.setProperty("--ph-survey-max-width",p.maxWidth),s.setProperty("--ph-survey-z-index",p.zIndex),s.setProperty("--ph-survey-border-color",p.borderColor),h?(s.setProperty("--ph-survey-border-radius",p.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",`${p.borderRadius} ${p.borderRadius} 0 0`)),s.setProperty("--ph-survey-background-color",p.backgroundColor),s.setProperty("--ph-survey-box-shadow",p.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",p.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",p.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",d?.submitButtonTextColor||$e(p.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",p.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",p.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",$e(p.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",d?.textColor||$e(p.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",p.textSubtleColor),s.setProperty("--ph-widget-color",p.widgetColor),s.setProperty("--ph-widget-text-color",$e(p.widgetColor)),s.setProperty("--ph-widget-z-index",p.zIndex);const g=d?.inputBackground||d?.inputBackgroundColor;let _=g||p.inputBackground;g||p.backgroundColor!=="white"||(_="#f8f8f8"),s.setProperty("--ph-survey-input-background",_);const v=d?.inputTextColor||$e(_);s.setProperty("--ph-survey-input-text-color",v),s.setProperty("--ph-survey-rating-text-color",v),s.setProperty("--ph-survey-scrollbar-thumb-color",p.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",p.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",p.outlineColor)})(o,e.type,e.appearance),o.className=n;const a=o.attachShadow({mode:"open"}),u=(function(c){const l=((d,p,s)=>{let h=d.createElement("style");h.innerText=p;const g=(_=>{var v;return Ye(_)?_:_==null||(v=_.config)===null||v===void 0?void 0:v.prepare_external_dependency_stylesheet})(s);return g&&(h=g(h)),h||(Kn.error("prepare_external_dependency_stylesheet returned null"),null)})(xe,':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)}}',c);return l?.setAttribute("data-ph-survey-style","true"),l})(t);if(u){const c=a.querySelector("style");c&&a.removeChild(c),a.appendChild(u)}return(r||xe.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},dn=({responses:e,survey:t,surveySubmissionId:r,posthog:n,isSurveyCompleted:i,properties:o,surveyLanguage:a,questionSnapshots:u})=>{var c;n?ee(n)&&(nn(t),n.capture("survey sent",x(x(x({[It]:t.name,[Tt]:t.id,[Mt]:t.current_iteration,[Lt]:t.current_iteration_start_date,sessionRecordingUrl:(c=n.get_session_replay_url)===null||c===void 0?void 0:c.call(n)},Wr({event:"sent",survey:t,responses:e,submissionId:r,completed:i,surveyLanguage:a,questionSnapshots:u})),o),{},{$set:{[Gr(t,"responded")]:!0}})),i&&(un.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:t.id}})),Qt(t),n.reloadFeatureFlags())):I.error("[survey sent] event not captured, PostHog instance not found.")},pn=(e,t,r,n)=>{var i;return x({[It]:t.name,[Tt]:t.id,[Mt]:t.current_iteration,[Lt]:t.current_iteration_start_date,sessionRecordingUrl:(i=n.get_session_replay_url)===null||i===void 0?void 0:i.call(n)},Wr({event:e,survey:t,responses:r?.responses,submissionId:r?.surveySubmissionId,surveyLanguage:r?.surveyLanguage,questionSnapshots:r?.questionSnapshots}))},hn=(e,t,r,n)=>{if(!t)return void I.error("[survey dismissed] event not captured, PostHog instance not found.");if(r)return;const i=he(e),o=i?i.surveyLanguage:n;t.capture("survey dismissed",x(x(x({},pn("dismissed",e,i,t)),o&&{[$r]:o}),{},{$set:{[Gr(e,"dismissed")]:!0}})),Qt(e),nn(e),un.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))},Jn=(e,t)=>{if(!t)return void I.error("[survey abandoned] event not captured, PostHog instance not found.");const r=(i=>At("abandonedSurvey_",i))(e);try{if(localStorage.getItem(r)==="true")return}catch{return}const n=he(e);if(n){try{localStorage.setItem(r,"true")}catch{}t.capture("survey abandoned",pn("abandoned",e,n,t),{transport:"sendBeacon"})}},it=e=>{const t=e.map(r=>r.id);return t.every(r=>!!r)?t:void 0},vn=(e,t)=>{return(o=>o.questions.some(a=>{var u;return!!(!((u=a.branching)===null||u===void 0)&&u.type)}))(e)?e.questions:t?(r=((o,a)=>{if(!a||a.length!==o.questions.length)return null;const u=new Map(o.questions.map(l=>[l.id,l])),c=[];for(const l of a){const d=u.get(l);if(!d)return null;c.push(d)}return c})(e,t.questionOrder))!==null&&r!==void 0?r:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?(n=e.questions,i=tn(e.questions),n.length===i.length&&n.every((o,a)=>o===i[a])?i.reverse():i):e.questions;var r,n,i},fn=e=>(function(t){var r;return Jr(t)&&!!(!((r=t.conditions)===null||r===void 0||(r=r.events)===null||r===void 0)&&r.repeatedActivation)||t.schedule==="always"})(e)||ot(e),pe=(function(e){function t(r){var n,i;return this.getChildContext||(n=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(o){this.props.value!=o.value&&n.forEach(function(a){a.__e=!0,mt(a)})},this.sub=function(o){n.add(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){n&&n.delete(o),a&&a.call(o)}}),r.children}return t.__c="__cC"+sr++,t.__=e,t.Provider=t.__l=(t.Consumer=function(r,n){return r.children(n)}).contextType=t,t})({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Rt=()=>ge(pe),Ot=({component:e,children:t,renderAsHtml:r,style:n})=>(function(i,o,a){var u,c,l,d,p=Q({},i.props);for(l in i.type&&i.type.defaultProps&&(d=i.type.defaultProps),o)l=="key"?u=o[l]:l=="ref"?c=o[l]:p[l]=o[l]===void 0&&d!=null?d[l]:o[l];return arguments.length>2&&(p.children=arguments.length>3?U.call(arguments,2):a),Ie(i.type,p,u||i.key,c||i.ref,null)})(e,r?{dangerouslySetInnerHTML:{__html:t},style:n}:{children:t,style:n});function jt(e,t){var r,n;if(!(!((r=e.conditions)===null||r===void 0)&&r.url))return!0;const i=(function(u){var c;const l=H==null||(c=H.location)===null||c===void 0?void 0:c.href;return $(l)?void 0:(function(d,p){var s;const h=d==null||(s=d.config)===null||s===void 0?void 0:s.get_current_url;if(!Ye(h))return p;try{const g=h(p);return be(g)&&g?g:p}catch(g){return Z.error("Error in get_current_url, falling back to window.location.href",g),p}})(u,l)})(t);if(!i)return!1;const o=[e.conditions.url],a=(function(u){return u??"icontains"})((n=e.conditions)===null||n===void 0?void 0:n.urlMatchType);return en[a](o,[i])}function Xn(e){var t,r;return(function(n,i){var o,a,u;if(!n||n.length===0)return!0;if(!Zr)return!1;const c=(function(l,d){var p;const s=(function(v){return Vn.test(v)?$t:An.test(v)?Ht:Fn.test(v)?Dt:new RegExp(Nt,"i").test(v)?Nt:new RegExp("(Windows Phone|WPDesktop)","i").test(v)?"Windows Phone":/iPad/.test(v)?Fr:/iPod/.test(v)?"iPod Touch":/iPhone/.test(v)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(v)?Ar:Rn.test(v)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(v)?"Kobo":new RegExp(Vr,"i").test(v)?Vr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(v)||/(kf[a-z]+)( bui|\)).+silk\//i.test(v)?"Kindle Fire":/(Android|ZTE)/i.test(v)?new RegExp(Je).test(v)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(v)||/pixel[\daxl ]{1,6}/i.test(v)&&!/pixel c/i.test(v)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(v)||/lmy47v/i.test(v)&&!/QTAQZ3/i.test(v)?"Android":Br:new RegExp("(pda|Mobile)","i").test(v)?Bn:new RegExp(Xe,"i").test(v)&&!new RegExp("Tablet pc","i").test(v)?Rr:""})(l);return s===Fr||s===Br||s==="Kobo"||s==="Kindle Fire"||s===Rr?Xe:s===$t||s===Dt||s===Ht||s===Nt?"Console":s===Ar?"Wearable":s?Je:d?.userAgentDataPlatform==="Android"&&((p=d?.maxTouchPoints)!==null&&p!==void 0?p:0)>0?600>Math.min((h=d?.screenWidth)!==null&&h!==void 0?h:0,(g=d?.screenHeight)!==null&&g!==void 0?g:0)/((_=d?.devicePixelRatio)!==null&&_!==void 0?_:1)?Je:Xe:"Desktop";var h,g,_})(Zr,{userAgentDataPlatform:we==null||(o=we.userAgentData)===null||o===void 0?void 0:o.platform,maxTouchPoints:we?.maxTouchPoints,screenWidth:H==null||(a=H.screen)===null||a===void 0?void 0:a.width,screenHeight:H==null||(u=H.screen)===null||u===void 0?void 0:u.height,devicePixelRatio:H?.devicePixelRatio});return en[i??"icontains"](n,[c])})((t=e.conditions)===null||t===void 0?void 0:t.deviceTypes,(r=e.conditions)===null||r===void 0?void 0:r.deviceTypesMatchType)}const Ut=e=>At("inProgressSurvey_",e),ke={},Zt=(e,t)=>{const r=Ut(e);try{localStorage.setItem(r,JSON.stringify(t)),delete ke[r]}catch(n){I.error("Error setting in-progress survey state in localStorage",n),ke[r]=t}},he=e=>{const t=Ut(e),r=ke[t];if(r)return r;try{const n=localStorage.getItem(t);if(n)return JSON.parse(n)}catch(n){I.error("Error getting in-progress survey state from localStorage",n)}return null},ot=e=>{const t=he(e);return!Nr(t?.surveySubmissionId)},Qt=e=>{const t=Ut(e);delete ke[t];try{localStorage.removeItem(t)}catch(r){I.error("Error clearing in-progress survey state from localStorage",r)}};function zt(e,t=!1){const r=`PostHogSurvey-${e.id}`;return t?`.${r}`:r}function ei(e,t=kt,r){if(e===Lr)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 Tr:return{left:"30px"};case Ir:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===_e&&r===me?"60px":"30px"}}}var ti=0;function f(e,t,r,n,i,o){t||(t={});var a,u,c=t;if("ref"in c)for(u in c={},t)u=="ref"?a=t[u]:c[u]=t[u];var l={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ti,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(u in a)c[u]===void 0&&(c[u]=a[u]);return E.vnode&&E.vnode(l),l}const yn=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),gn=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),mn=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),ri=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),ni=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:f("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"})}),ii=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:f("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"})}),oi=f("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:f("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"})}),si=({fill:e="currentColor"}={})=>f("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:[f("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),f("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})]}),ai=f("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("g",{"clip-path":"url(#clip0_2415_6911)",children:[f("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:f("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),f("g",{mask:"url(#mask0_2415_6911)",children:[f("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"}),f("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"}),f("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"}),f("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"}),f("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"}),f("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"})]})]}),f("defs",{children:f("clipPath",{id:"clip0_2415_6911",children:f("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function li({urlParams:e}){const t=e?Object.entries(e).map(([r,n])=>`${encodeURIComponent(r)}=${encodeURIComponent(n)}`).join("&"):"";return f("a",{href:"https://posthog.com/surveys"+(t?`?${t}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",ai]})}function Se({text:e,submitDisabled:t,appearance:r,onSubmit:n,link:i,onPreviewSubmit:o,skipSubmitButton:a,canGoBack:u,onBack:c}){const{isPreviewMode:l}=ge(pe),d=!!u&&!!c,p=!a&&f("button",{className:"form-submit",disabled:t,"aria-label":"Submit survey",type:"button",onClick(){i&&H?.open(i),l?o?.():n()},children:e});return f("div",{className:"bottom-section",children:[d?f("div",{className:"form-buttons form-buttons-with-back",children:[f("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:c,children:r.backButtonText||"Back"}),p]}):p,!r.whiteLabel&&f(li,{urlParams:{utm_source:"survey-footer"}})]})}function st({question:e,forceDisableHtml:t,htmlFor:r}){return f("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[f(e.type===Er?"label":"h3",{className:"survey-question",htmlFor:r,children:e.question}),e.description&&Ot({component:ie("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!t&&e.descriptionContentType!=="text"})]})}function Wt({onClick:e}){const{isPreviewMode:t}=ge(pe);return f("button",{className:"form-cancel",onClick:e,disabled:t,"aria-label":"Close survey",type:"button",children:si({fill:"black"})})}const _n=H;function ui({header:e,description:t,contentType:r,forceDisableHtml:n,appearance:i,onClose:o}){const{isPopup:a}=ge(pe);return ye(()=>{const u=c=>{c.key!=="Enter"&&c.key!=="Escape"||(c.preventDefault(),o())};return X(_n,"keydown",u),()=>{_n.removeEventListener("keydown",u)}},[o]),f("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&i.hideCancelButton!==!0&&f(Wt,{onClick:()=>o()}),f("h3",{className:"thank-you-message-header",children:e}),t&&Ot({component:ie("p",{className:"thank-you-message-body"}),children:t,renderAsHtml:!n&&r!=="text"}),a&&f(Se,{text:i.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:i,onSubmit:()=>o()})]})}function ci({header:e,description:t,contentType:r,forceDisableHtml:n,appearance:i,onStart:o}){const{isPopup:a,onPreviewSubmit:u,onPopupSurveyDismissed:c}=ge(pe);return f("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&i.hideCancelButton!==!0&&f(Wt,{onClick:()=>c()}),e&&f("h3",{className:"intro-screen-header",children:e}),t&&Ot({component:ie("p",{className:"intro-screen-body"}),children:t,renderAsHtml:!n&&r!=="text"}),f(Se,{text:i.introScreenButtonText||"Get started",submitDisabled:!1,appearance:i,onSubmit:o,onPreviewSubmit:()=>u(null)})]})}const bn=e=>Y(e)&&e.every(t=>be(t));function di({question:e,forceDisableHtml:t,appearance:r,onSubmit:n,onPreviewSubmit:i,displayQuestionIndex:o,initialValue:a,canGoBack:u,onBack:c}){const{isPreviewMode:l}=Rt(),d=Me(null),[p,s]=O(()=>be(a)?a:""),h=r?.disableAutofocus;ye(()=>{h||setTimeout(()=>{var S;l||(S=d.current)===null||S===void 0||S.focus()},100)},[l,h]);const g=`surveyQuestion${o}`,_=G(()=>(function(S,M,D){const b=S.trim();if(!D&&b==="")return"This field is required";if(b==="")return!1;if(M&&M.length>0)for(const q of M)switch(q.type){case Hr:var C;if(q.value!==void 0&&q.value>b.length)return(C=q.errorMessage)!==null&&C!==void 0?C:`Please enter at least ${q.value} characters`;break;case Dr:var k;if(q.value!==void 0&&b.length>q.value)return(k=q.errorMessage)!==null&&k!==void 0?k:`Please enter no more than ${q.value} characters`}return!1})(p,e.validation,e.optional),[p,e.validation,e.optional]),v=jr(e.validation,Hr),m=jr(e.validation,Dr),y=G(()=>(function(S,M){const D=S===1?void 0:S;return D&&M?`Enter ${D}-${M} characters`:D?`Enter at least ${D} ${D===1?"character":"characters"}`:M?`Maximum ${M} ${M===1?"character":"characters"}`:void 0})(v,m),[v,m]),w=()=>{_||n(p.trim())},P=()=>{_||i(p.trim())};return f(W,{children:[f("div",{className:"question-container",children:[f(st,{question:e,forceDisableHtml:t,htmlFor:g}),f("textarea",{ref:d,id:g,rows:4,placeholder:r?.placeholder,minLength:v,maxLength:m,onInput(S){s(S.currentTarget.value),S.stopPropagation()},onKeyDown(S){S.stopPropagation(),S.key!=="Enter"||!S.metaKey&&!S.ctrlKey||_||(S.preventDefault(),l?P():w())},value:p}),y&&f("div",{className:"validation-hint",children:y})]}),f(Se,{text:e.buttonText||"Submit",submitDisabled:!!_,appearance:r,onSubmit:w,onPreviewSubmit:P,canGoBack:u,onBack:c})]})}function pi({question:e,forceDisableHtml:t,appearance:r,onSubmit:n,onPreviewSubmit:i,canGoBack:o,onBack:a}){return f(W,{children:[f("div",{className:"question-container",children:f(st,{question:e,forceDisableHtml:t})}),f(Se,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>i("link clicked"),canGoBack:o,onBack:a})]})}function hi({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:a,canGoBack:u,onBack:c}){var l;const d=e.scale,p=e.scale===10?0:1,[s,h]=O(()=>J(a)?a:Y(a)&&a.length>0&&J(parseInt(a[0]))?parseInt(a[0]):be(a)&&J(parseInt(a))?parseInt(a):null),g=e.display==="emoji"&&e.scale===2,{isPreviewMode:_}=Rt(),v=m=>_?o(m):i(m);return f(W,{children:[f("div",{className:"question-container",children:[f(st,{question:e,forceDisableHtml:t}),f("div",{className:"rating-section",children:[f("div",{className:"rating-options",children:[e.display==="emoji"&&f("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:(l=_i[e.scale])===null||l===void 0?void 0:l.map((m,y)=>f("button",{"aria-label":`Rate ${y+1}`,className:`ratings-emoji question-${r}-rating-${y} ${y+1===s?"rating-active":""}`,value:y+1,type:"button",onClick(){const w=y+1;h(w),e.skipSubmitButton&&v(w)},children:m},y))}),e.display==="number"&&f("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${d-p+1}, minmax(0, 1fr))`},children:bi(e.scale).map((m,y)=>f(vi,{displayQuestionIndex:r,active:s===m,appearance:n,num:m,setActiveNumber(w){h(w),e.skipSubmitButton&&v(w)}},y))})]}),!g&&f("div",{className:"rating-text",children:[f("div",{children:e.lowerBoundLabel}),f("div",{children:e.upperBoundLabel})]})]})]}),f(Se,{text:e.buttonText||n?.submitButtonText||"Submit",submitDisabled:se(s)&&!e.optional,appearance:n,onSubmit:()=>i(s),onPreviewSubmit:()=>o(s),skipSubmitButton:e.skipSubmitButton,canGoBack:u,onBack:c})]})}function vi({num:e,active:t,displayQuestionIndex:r,setActiveNumber:n}){return f("button",{"aria-label":`Rate ${e}`,className:`ratings-number question-${r}-rating-${e} ${t?"rating-active":""}`,type:"button",onClick(){n(e)},children:e})}function fi({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:a,canGoBack:u,onBack:c}){const l=Me(null),d=G(()=>(b=>{var C;if(!b.shuffleOptions)return b.choices;const k=[...b.choices],q=b.hasOpenChoice&&(C=k.pop())!==null&&C!==void 0?C:null,F=(T=k,(L=tn(k)).length>1&&T.every((j,qe)=>j===L[qe])?L.reverse():L);var T,L;return se(q)||F.push(q),F})(e),[e]),[p,s]=O(()=>((b,C)=>be(b)||bn(b)?b:C===Le?null:[])(a,e.type)),[h,g]=O(()=>((b,C)=>{if(be(b)&&!C.includes(b))return{isSelected:!0,inputValue:b};if(bn(b)){const k=b.find(q=>!C.includes(q));if(k)return{isSelected:!0,inputValue:k}}return{isSelected:!1,inputValue:""}})(a,d)),{isPreviewMode:_}=Rt(),v=e.type===Le,m=e.type===Ct,y=e.skipSubmitButton&&v&&!e.hasOpenChoice,w=(b,C)=>{if(C){const k=!h.isSelected;g(q=>x(x({},q),{},{isSelected:k,inputValue:k?q.inputValue:""})),v&&s(""),k&&setTimeout(()=>{var q;return(q=l.current)===null||q===void 0?void 0:q.focus()},75);return}if(v)return s(b),g(k=>x(x({},k),{},{isSelected:!1,inputValue:""})),void(y&&(i(b),_&&o(b)));m&&Y(p)&&(p.includes(b)?s(p.filter(k=>k!==b)):s([...p,b]))},P=b=>{b.stopPropagation();const C=b.currentTarget.value;g(k=>x(x({},k),{},{inputValue:C})),v&&s(C)},S=b=>{b.stopPropagation(),b.key!=="Enter"||M()||(b.preventDefault(),D()),b.key==="Escape"&&(b.preventDefault(),g(C=>x(x({},C),{},{isSelected:!1,inputValue:""})),v&&s(null))},M=()=>!(e.optional||!se(p)&&(!Y(p)||h.isSelected||p.length!==0)&&(!h.isSelected||h.inputValue.trim()!=="")),D=()=>{h.isSelected&&m?Y(p)&&(_?o([...p,h.inputValue]):i([...p,h.inputValue])):_?o(p):i(p)};return f(W,{children:[f("div",{className:"question-container",children:[f(st,{question:e,forceDisableHtml:t}),f("fieldset",{className:"multiple-choice-options limit-height",children:[f("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),d.map((b,C)=>{const k=!!e.hasOpenChoice&&C===e.choices.length-1,q=`surveyQuestion${r}Choice${C}`,F=`${q}Open`,T=k?h.isSelected:v?p===b:Y(p)&&p.includes(b);return f("label",{className:k?"choice-option-open":"",children:[f("div",{className:"response-choice",children:[f("input",{type:v?"radio":"checkbox",name:q,checked:T,onChange:()=>w(b,k),id:q,"aria-controls":F}),f("span",{children:k?`${b}:`:b})]}),k&&f("input",{type:"text",ref:l,id:F,name:`question${r}Open`,value:h.inputValue,onKeyDown:S,onInput:P,onClick(L){h.isSelected||w(b,!0),L.stopPropagation()},"aria-label":`${b} - please specify`})]},C)})]})]}),f(Se,{text:e.buttonText||"Submit",submitDisabled:M(),appearance:n,onSubmit:D,onPreviewSubmit:D,skipSubmitButton:y,canGoBack:u,onBack:c})]})}const yi=[1,2,3,4,5],gi=[1,2,3,4,5,6,7],mi=[0,1,2,3,4,5,6,7,8,9,10],_i={2:[ii,oi],3:[mn,gn,yn],5:[ri,mn,gn,yn,ni]};function bi(e){switch(e){case 5:default:return yi;case 7:return gi;case 10:return mi}}const wi=et("[Surveys]");function wn(e,t,r){var n;const i=e.questions[t],o=t+1;if(!(!((n=i.branching)===null||n===void 0)&&n.type))return t===e.questions.length-1?K:o;if(i.branching.type===K)return K;if(i.branching.type==="specific_question"){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type==="response_based"){if(i.type===Le){var a;let c=i.choices.indexOf(`${r}`);if(c===-1&&i.hasOpenChoice&&(c=i.choices.length-1),(a=i.branching)===null||a===void 0||(a=a.responseValues)===null||a===void 0?void 0:a.hasOwnProperty(c)){const l=i.branching.responseValues[c];return Number.isInteger(l)?l:l===K?K:o}}else if(i.type===qt){var u;if(typeof r!="number"||!Number.isInteger(r))throw new Error("The response type must be an integer");const c=(function(l,d){if(d===2){if(1>l||l>2)throw new Error("The response must be in range 1-2");return l===1?"positive":"negative"}if(d===3){if(1>l||l>3)throw new Error("The response must be in range 1-3");return l===1?"negative":l===2?"neutral":"positive"}if(d===5){if(1>l||l>5)throw new Error("The response must be in range 1-5");return l>2?l===3?"neutral":"positive":"negative"}if(d===7){if(1>l||l>7)throw new Error("The response must be in range 1-7");return l>3?l===4?"neutral":"positive":"negative"}if(d===10){if(0>l||l>10)throw new Error("The response must be in range 0-10");return l>6?l>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")})(r,i.scale);if(!((u=i.branching)===null||u===void 0||(u=u.responseValues)===null||u===void 0)&&u.hasOwnProperty(c)){const l=i.branching.responseValues[c];return Number.isInteger(l)?l:l===K?K:o}}return o}return wi.warn("Falling back to next question index due to unexpected branching type"),o}const Gt=et("[SurveyTranslations]");function xi(e,t){const r=(function(i){return(function({overrideLanguage:o,storedPersonProperties:a,locale:u},c){const l=Bt(o);if(l)return c?.info(`Using override display language: ${l}`),l;const d=(function(s){return s&&typeof s=="object"&&"language"in s?Bt(s.language):null})(a);if(d)return c?.info(`Using person property language: ${d}`),d;const p=Bt(u);return p?(c?.info(`Using detected locale: ${p}`),p):(c?.info("No user language detected"),null)})({overrideLanguage:i.config.override_display_language,storedPersonProperties:Ye(i.get_property)?i.get_property("$stored_person_properties"):void 0,locale:navigator.language||navigator.userLanguage},Gt)})(t);if(!r)return Gt.info("No user language detected"),{survey:e,language:null};const n=Un(e,r,Gt);return{survey:n.survey,language:n.matchedKey}}const N=H,le=Ur,Kt="ph:show_survey_widget",Yt="PHWidgetSurveyClickListener";function xn(e,t){try{const r=e.getBoundingClientRect(),n=N.innerHeight,i=N.innerWidth;let o=r.left+r.width/2-t/2;o+t>i-20&&(o=i-t-20),20>o&&(o=20);const a=n-r.bottom,u=250>a&&r.top>a;return{position:"fixed",top:u?"auto":`${r.bottom+12}px`,left:`${o}px`,right:"auto",bottom:u?n-r.top+12+"px":"auto",zIndex:ae.zIndex}}catch(r){return I.warn("Failed to calculate trigger position:",r),null}}var ki=class{constructor(e){this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Map,this.Mi=new Set,this.Ii=null,this.Ti=!1,this.Ri=null,this.$i=null,this.Ei=null,this.Ai=!1,this.handlePageUnload=()=>{const t=this._posthog.get_property(on);if(t)for(const r of t)ot(r)&&Jn(r,this._posthog)},this.handlePopoverSurvey=(t,r,{resumeDelayFromActivation:n=!1}={})=>{var i,o,a,u,c,l;if(!ee(this._posthog))return;const{survey:d,language:p}=this.Oi(t);this.Ii=p,this.Ei=null,this.Li=r;const s=this.Pi(d,r);this.Di(s.id);const{properties:h,initialResponses:g}=r??{},_=!(!g||0>=Object.keys(g).length)&&this.Fi(s,g,h,p);if(_&&!(!((i=s.appearance)===null||i===void 0)&&i.displayThankYouMessage))return;this.Ni(s);let v={};if(((o=s.appearance)===null||o===void 0?void 0:o.position)===Mr&&(!((a=s.appearance)===null||a===void 0)&&a.widgetSelector)){const q=le.querySelector(s.appearance.widgetSelector);var m;q&&(v=xn(q,parseInt(((m=s.appearance)===null||m===void 0?void 0:m.maxWidth)||ae.maxWidth))||{})}const y=((u=s.appearance)===null||u===void 0?void 0:u.surveyPopupDelaySeconds)||0,{shadow:w}=nt(s,this._posthog);this.Ci.set(w,w.host);const P={posthog:this._posthog,survey:s,removeSurveyFromFocus:this.qi,properties:h,style:v,isSurveyCompleted:_,skipShownEvent:r?.skipShownEvent,surveyLanguage:p};if(this.Ei=P,0>=y)return this.Ti=!0,oe(f(Ce,x({},P)),w);const S=()=>{this.Ti=!0;const{survey:q,language:F}=this.Oi(t);this.Ii=F;const T=this.Pi(q,r),L=x(x({},P),{},{survey:T,surveyLanguage:F});this.Ei=L,oe(f(Ce,x(x({},L),{},{survey:x(x({},T),{},{appearance:x(x({},T.appearance),{},{surveyPopupDelaySeconds:0})})})),w)},M=()=>{if(!ee(this._posthog)||!this.ji(s))return I.info(`Survey ${s.id} no longer eligible when its display delay elapsed; not displaying`),this.qi(s);S()},D=n?(c=this._posthog.surveys)===null||c===void 0||(c=c._surveyEventReceiver)===null||c===void 0||(l=c.getActivationTimestamp)===null||l===void 0?void 0:l.call(c,s.id):void 0,b=J(D)?Math.max(0,Date.now()-D):0,C=Math.max(0,1e3*y-b);if(0>=C)return M();const k=N.setTimeout(()=>{this.ki.delete(s.id),M()},C);this.ki.set(s.id,k)},this.Bi=t=>{var r;const{survey:n,language:i}=this.Oi(t),{shadow:o,isNewlyCreated:a}=nt(n,this._posthog);this.Ci.set(o,o.host),((r=t.appearance)===null||r===void 0?void 0:r.widgetType)===me&&this.xi.set(t.id,t),a&&oe(f(Pi,{posthog:this._posthog,survey:n,surveyLanguage:i},t.id),o)},this.Hi=t=>{const r=this.Si.get(t);r&&(r.element.removeEventListener("click",r.listener),r.element.removeAttribute(Yt),this.Si.delete(t),I.info(`Removed click listener for survey ${t}`))},this.zi=t=>{this.Ui(t)||(this.Wi(t),this.Hi(t.id))},this.Vi=t=>{this.Ui(t)||(this.Wi(t),this.xi.delete(t.id))},this.Ui=t=>{try{var r;const n=le.querySelector(zt(t,!0));return!!(!(n==null||(r=n.shadowRoot)===null||r===void 0)&&r.querySelector(".ph-survey"))}catch{return!1}},this.Zi=(t,r)=>{const n=le.querySelector(r),i=this.Si.get(t.id);if(n){if(this.Bi(t),i){if(n===i.element)return;I.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.Hi(t.id)}if(!n.hasAttribute(Yt)){const o=a=>{var u,c;a.stopPropagation();const l=((u=t.appearance)===null||u===void 0?void 0:u.position)===Mr?xn(a.currentTarget,parseInt(((c=t.appearance)===null||c===void 0?void 0:c.maxWidth)||ae.maxWidth)):{};N.dispatchEvent(new CustomEvent(Kt,{detail:{surveyId:t.id,position:l}}))};X(n,"click",o),n.setAttribute(Yt,"true"),this.Si.set(t.id,{element:n,listener:o,survey:t}),I.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.zi(t)},this.renderPopover=t=>{if(!ee(this._posthog))return;const{survey:r,language:n}=this.Oi(t),{shadow:i}=nt(r,this._posthog);this.Ci.set(i,i.host),oe(f(Ce,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.qi,surveyLanguage:n}),i)},this.renderSurvey=(t,r,n)=>{var i;if(!ee(this._posthog))return;const{survey:o,language:a}=this.Oi(t);let u=!1;(i=this._posthog.config)!==null&&i!==void 0&&(i=i.surveys)!==null&&i!==void 0&&i.prefillFromUrl&&(u=this.Gi(o,a,n)),oe(f(Ce,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.qi,isPopup:!1,properties:n,isSurveyCompleted:u,surveyLanguage:a}),r)},this.getActiveMatchingSurveys=(t,r=!1)=>{var n;(n=this._posthog)===null||n===void 0||(n=n.surveys)===null||n===void 0||n.getSurveys(i=>{t(i.filter(o=>this.ji(o)))},r)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(r=>{const n=ee(this._posthog),i=r.filter(l=>n&&(l.type===St||l.type===_e)),o=new Set(i.map(l=>l.id));for(const l of Array.from(this.ki.keys()))o.has(l)||this.cancelSurvey(l);const a=this.Qi(i),u=new Set,c=new Set;a.forEach(l=>{if(l.type===_e){var d,p,s,h;if(((d=l.appearance)===null||d===void 0?void 0:d.widgetType)===me)return c.add(l.id),void this.Bi(l);((p=l.appearance)===null||p===void 0?void 0:p.widgetType)==="selector"&&(s=l.appearance)!==null&&s!==void 0&&s.widgetSelector&&(u.add(l.id),this.Zi(l,(h=l.appearance)===null||h===void 0?void 0:h.widgetSelector))}se(this.Ji)&&l.type===St&&this.handlePopoverSurvey(l,void 0,{resumeDelayFromActivation:!0})}),this.Si.forEach(({survey:l})=>{u.has(l.id)||this.zi(l)}),this.xi.forEach((l,d)=>{c.has(d)||this.Vi(l)})},t)},this.Ni=t=>{se(this.Ji)||I.error(`Survey ${this.Ji} already in focus. Cannot add survey ${t.id}.`),this.Ji=t.id},this.qi=t=>{this.Ji!==t.id&&I.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Di(t.id),this.Ji=null,this.Ii=null,this.Ti=!1,this.Ei=null,this.Li=void 0,this.Wi(t)},this._posthog=e,this.Ji=null,this.Ri=()=>this.Ki(),X(N,"languagechange",this.Ri),this.$i=e.onFeatureFlags(()=>this.Ki())}Ki(){if(se(this.Ji))return;const e=this._posthog.get_property(on),t=e?.find(a=>a.id===this.Ji);if(!t)return;const{survey:r,language:n}=this.Oi(t);if(n===this.Ii||(this.Ii=n,!this.Ti))return;const i=this.Pi(r,this.Li),{shadow:o}=nt(i,this._posthog);oe(f(Ce,x(x({},this.Ei),{},{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.qi,surveyLanguage:n})),o)}get Xi(){var e,t,r;return(e=(t=(r=this._posthog).getExtension)===null||t===void 0?void 0:t.call(r,"featureFlags"))!==null&&e!==void 0?e:this._posthog.featureFlags}Pi(e,t){return t?.position||t?.selector?x(x({},e),{},{appearance:x(x(x({},e.appearance),t.position&&{position:t.position}),t.selector&&{widgetSelector:t.selector})}):e}Di(e){const t=this.ki.get(e);t&&(clearTimeout(t),this.ki.delete(e))}cancelSurvey(e){this.ki.has(e)&&(I.info(`Cancelled pending survey ${e}`),this.Di(e),this.Ji===e&&(this.Ji=null,this.Ii=null,this.Ti=!1,this.Ei=null,this.Li=void 0))}clearInMemoryInProgressSurveyState(){(()=>{for(const e of Object.keys(ke))delete ke[e]})()}setAutomaticDisplayDispose(e){this.Yi=e}dispose(){var e;(e=this.Yi)===null||e===void 0||e.call(this),this.Yi=void 0,this.Ri&&(N.removeEventListener("languagechange",this.Ri),this.Ri=null),this.$i&&(this.$i(),this.$i=null),this.ki.forEach((t,r)=>this.Di(r)),this.Si.forEach((t,r)=>this.Hi(r)),this.Ci.forEach((t,r)=>{oe(null,r),t?.remove()}),this.Ci.clear(),this.xi.clear(),this.Ji=null}Qi(e){return e.sort((t,r)=>{var n,i;const o=ot(t),a=ot(r);if(o&&!a)return-1;if(!o&&a)return 1;const u=t.schedule===Pt,c=r.schedule===Pt;return u&&!c?1:!u&&c?-1:(((n=t.appearance)===null||n===void 0?void 0:n.surveyPopupDelaySeconds)||0)-(((i=r.appearance)===null||i===void 0?void 0:i.surveyPopupDelaySeconds)||0)})}Oi(e){return xi(e,this._posthog)}Gi(e,t,r){if(this.Mi.has(e.id))return!1;const{params:n}=(function(o){const a={};let u=!1;const c=o.replace(/^\?/,"");if(!c)return{params:a,autoSubmit:u};const l=c.split("&");for(const d of l){const[p,s]=d.split("=");if(!p||$(s))continue;const h=decodeURIComponent(p),g=decodeURIComponent(s);if(h==="auto_submit"&&g==="true"){u=!0;continue}const _=h.match(/^q(\d+)$/);if(_){const v=parseInt(_[1],10);a[v]||(a[v]=[]),a[v].push(g)}}return{params:a,autoSubmit:u}})(N.location.search);if(Object.keys(n).length===0)return!1;I.info("[Survey Prefill] Detected URL prefill parameters");const i=this.tr(e,n,t);return!!i&&(this.er(e,i,r,t),this.Mi.add(e.id),i.isSurveyCompleted)}er(e,t,r,n){const{responses:i,submissionId:o,isSurveyCompleted:a,skippedResponses:u}=t;(Object.keys(u).length>0&&e.enable_partial_responses||a)&&dn({responses:a?i:u,survey:e,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:a,properties:r,surveyLanguage:n})}Fi(e,t,r,n){const i={};for(const[a,u]of Object.entries(t))i[parseInt(a)]=Y(u)?u.map(String):[String(u)];I.info("[Survey] Processing initial responses");const o=this.tr(e,i,n);return!!o&&(this.er(e,o,r,n),o.isSurveyCompleted)}tr(e,t,r){try{const n=(function(l,d){const p={};return l.questions.forEach((s,h)=>{if(!d[h]||!s.id)return;const g=d[h],_=de(s.id);try{switch(s.type){case Le:{if(!s.choices||s.choices.length===0)return void Z.warn(`[Survey Prefill] Question ${h} has no choices`);const v=parseInt(g[0],10);if(isNaN(v)||0>v||v>=s.choices.length)return void Z.warn(`[Survey Prefill] Invalid choice index for q${h}: ${g[0]}`);p[_]=s.choices[v];break}case Ct:{if(!s.choices||s.choices.length===0)return void Z.warn(`[Survey Prefill] Question ${h} has no choices`);const v=g.map(y=>parseInt(y,10)).filter(y=>!isNaN(y)&&y>=0&&s.choices.length>y);if(v.length===0)return void Z.warn(`[Survey Prefill] No valid choices for q${h}`);const m=[...new Set(v.map(y=>s.choices[y]))];v.length>m.length&&Z.warn(`[Survey Prefill] Removed duplicate choices for q${h}`),p[_]=m;break}case qt:{const v=parseInt(g[0],10),m=s.scale||10;if(isNaN(v)||0>v||v>m)return void Z.warn(`[Survey Prefill] Invalid rating for q${h}: ${g[0]} (scale: 0-${m})`);p[_]=v;break}default:Z.info(`[Survey Prefill] Question type ${s.type} does not support prefill`)}}catch(v){Z.error(`[Survey Prefill] Error converting q${h}:`,v)}}),p})(e,t);if(Object.keys(n).length===0)return I.warn("[Survey Prefill] No valid responses after conversion"),null;const i=ln(),{startQuestionIndex:o,skippedResponses:a,skippedIndices:u}=(function(l,d,p){let s=0;const h={},g=[],_=l.questions.length+1;let v=0;for(;l.questions.length>s&&_>v&&(v++,d.includes(s));){const m=l.questions[s];if(!m||!("skipSubmitButton"in m)||!m.skipSubmitButton)break;if(m.id){const w=de(m.id);$(p[w])||(h[w]=p[w])}g.push(s);const y=wn(l,s,m.id?p[de(m.id)]:null);if(y===K)return{startQuestionIndex:l.questions.length,skippedResponses:h,skippedIndices:g};s=y}return{startQuestionIndex:s,skippedResponses:h,skippedIndices:g}})(e,Object.keys(t).map(l=>parseInt(l,10)),n),c=o>=e.questions.length;return Zt(e,{surveySubmissionId:i,responses:n,lastQuestionIndex:o,questionOrder:it(e.questions),visitedIndices:u,surveyLanguage:r}),I.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:n,submissionId:i,startQuestionIndex:o,isSurveyCompleted:c,skippedResponses:a}}catch(n){return I.error("[Survey Prefill] Error handling prefill:",n),null}}nr(e,t=void 0){if(!e)return!0;const r=this.Xi,n=!!r?.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")});let i=!0;t&&(i=r?.getFeatureFlag(e,{send_event:!1})===t||t==="any");const o=n&&i;return o||this.ir(e),o}ir(e){var t;!this.Ai&&(t=this._posthog.config)!==null&&t!==void 0&&t.advanced_disable_feature_flags&&(this.Ai=!0,I.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.`))}rr(e){return!e.conditions||jt(e,this._posthog)&&Xn(e)&&(function(t){var r;return!(!((r=t.conditions)===null||r===void 0)&&r.selector)||!!xe?.querySelector(t.conditions.selector)})(e)}sr(e){var t;return fn(e)?{satisfied:!0}:e.internal_targeting_flag_key&&(function(r){var n;return r.schedule==="recurring"||((n=r.current_iteration)!==null&&n!==void 0?n:0)>0})(e)&&!(!((t=this.Xi)===null||t===void 0)&&t.hasLoadedFlags)?(this.ir(e.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.nr(e.internal_targeting_flag_key)}}checkSurveyEligibility(e){var t,r;const n={eligible:!0,reason:void 0};if(!(function(u){return!(!u.start_date||u.end_date)})(e))return n.eligible=!1,n.reason=`Survey is not running. It was completed on ${e.end_date}`,n;if(!Zn.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=(t=e.conditions)===null||t===void 0?void 0:t.linkedFlagVariant;if(!this.nr(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.nr(e.targeting_flag_key))return n.eligible=!1,n.reason="Survey targeting feature flag is not enabled",n;const o=this.sr(e);var a;return o.satisfied?(function(u,c){if(!u||!c)return!0;const l=typeof c=="string"?new Date(c):c,d=Math.abs(new Date().getTime()-l.getTime());return Math.ceil(d/864e5)>u})((r=e.conditions)===null||r===void 0?void 0:r.seenSurveyWaitPeriodInDays,te.Ot("lastSeenSurveyDate"))?((u=>!!te.Ot(rn(u))&&!fn(u))(e)&&(n.eligible=!1,n.reason="Survey has already been seen and it can't be activated again"),n):(n.eligible=!1,n.reason="Survey wait period has not passed",n):(n.eligible=!1,n.reason=(a=o.reason)!==null&&a!==void 0?a:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",n)}checkSurveyCaptureEligibility(){return ee(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.ar(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}ar(e){var t;if(!Jr(e)&&!(function(n){var i;return!!(!((i=n.conditions)===null||i===void 0||(i=i.actions)===null||i===void 0||(i=i.values)===null||i===void 0)&&i.length)})(e))return!0;const r=(t=this._posthog.surveys)===null||t===void 0||(t=t._surveyEventReceiver)===null||t===void 0?void 0:t.getSurveys();return!!r?.includes(e.id)}lr(e){var t;return!(!((t=e.feature_flag_keys)===null||t===void 0)&&t.length)||e.feature_flag_keys.every(({key:r,value:n})=>!r||!n||this.nr(n))}ji(e){return this.checkSurveyEligibility(e).eligible&&this.rr(e)&&this.ar(e)&&this.lr(e)}Wi(e){try{const t=le.querySelector(zt(e,!0));t!=null&&t.shadowRoot&&(oe(null,t.shadowRoot),this.Ci.delete(t.shadowRoot)),t?.remove()}catch(t){I.warn(`Failed to remove survey ${e.id} from DOM:`,t)}}getTestAPI(){return{addSurveyToFocus:this.Ni,removeSurveyFromFocus:this.qi,surveyInFocus:this.Ji,surveyTimeouts:this.ki,handleWidget:this.Bi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Zi,sortSurveysByAppearanceDelay:this.Qi,checkFlags:this.lr.bind(this),isSurveyFeatureFlagEnabled:this.nr.bind(this),onLanguageChange:this.Ki.bind(this),currentLanguage:this.Ii,surveyIsRendered:this.Ti}}};function kn(e,t){if(!le||!N)return;const r=new ki(e);if(e.config.disable_surveys_automatic_display)return I.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(t===!1)return I.info("There are no surveys to load or Surveys is disabled in the project settings."),r;let n;r.callSurveysAndEvaluateDisplayLogic(!0);const i=()=>{$(n)&&(n=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{$(n)||(clearInterval(n),n=void 0)};i();const a=()=>{le.hidden?o():(r.callSurveysAndEvaluateDisplayLogic(!1),i())};return X(le,"visibilitychange",a),r.setAutomaticDisplayDispose(()=>{o(),le.removeEventListener("visibilitychange",a)}),r}function Sn({survey:e,removeSurveyFromFocus:t=()=>{},setSurveyVisible:r,isPreviewMode:n=!1,posthog:i}){ye(()=>{var o;if(n||!(!((o=e.conditions)===null||o===void 0)&&o.url))return;const a=()=>{var l;const d=e.type===_e,p=jt(e,i),s=((l=e.appearance)===null||l===void 0?void 0:l.widgetType)===me&&d;if(!p)return I.info(`Hiding survey ${e.id} because URL does not match`),r(!1),t(e);s&&(I.info(`Showing survey ${e.id} because it is a feedback button tab and URL matches`),r(!0))};X(N,"popstate",a),X(N,"hashchange",a);const u=N.history.pushState,c=N.history.replaceState;return N.history.pushState=function(...l){u.apply(this,l),a()},N.history.replaceState=function(...l){c.apply(this,l),a()},()=>{N.removeEventListener("popstate",a),N.removeEventListener("hashchange",a),N.history.pushState=u,N.history.replaceState=c}},[n,e,t,r,i])}const Si=200;function Ci(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 Ce({survey:e,forceDisableHtml:t,posthog:r,style:n={},previewPageIndex:i,removeSurveyFromFocus:o=()=>{},isPopup:a=!0,onPreviewSubmit:u=()=>{},onPreviewBack:c=()=>{},onPopupSurveyDismissed:l=()=>{},onCloseConfirmationMessage:d=()=>{},properties:p,isSurveyCompleted:s,skipShownEvent:h,surveyLanguage:g}){var _,v,m,y,w,P,S,M,D,b,C,k;const q=Me(null),F=Number.isInteger(i),{isPopupVisible:T,isSurveySent:L,hidePopupWithAnimation:j}=(function(V,R,re,ue,Cn,Ii,qn,Mi,Pn){const[Li,lt]=O(ue||re===0||V.type===Lr),[Ei,$i]=O(!1),Jt=Me(!1),ut=()=>{const z=()=>{Ii&&Cn(V),lt(!1)};if(Jt.current)return;const Pe=qn?.current;Pe?(Jt.current=!0,Pe.style.transition=`opacity ${Si}ms ease-out`,Pe.style.opacity="0",setTimeout(()=>{Jt.current=!1,z()},250)):z()},Tn=z=>{z.detail.surveyId===V.id&&ut()};return ye(()=>{if(!R)return void I.error("usePopupVisibility hook called without a PostHog instance.");if(ue)return;let z;const Pe=Re=>{var ct,er;if(Re.detail.surveyId===V.id){if(!(!((ct=V.appearance)===null||ct===void 0)&&ct.displayThankYouMessage))return ut();$i(!0),(er=V.appearance)!==null&&er!==void 0&&er.autoDisappear&&(z&&clearTimeout(z),z=setTimeout(ut,5e3))}},In=()=>{if(jt(V,R)){var Re;lt(!0),N.dispatchEvent(new Event("PHSurveyShown")),Mi||R.capture("survey shown",x(x({[It]:V.name,[Tt]:V.id,[Mt]:V.current_iteration,[Lt]:V.current_iteration_start_date},Pn&&{[$r]:Pn}),{},{sessionRecordingUrl:(Re=R.get_session_replay_url)===null||Re===void 0?void 0:Re.call(R)}));try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}};X(N,"PHSurveyClosed",Tn),X(N,"PHSurveySent",Pe);const Xt=re>0?setTimeout(In,re):void 0;return $(Xt)&&In(),()=>{$(Xt)||clearTimeout(Xt),$(z)||clearTimeout(z),N.removeEventListener("PHSurveyClosed",Tn),N.removeEventListener("PHSurveySent",Pe)}},[]),Sn({survey:V,removeSurveyFromFocus:Cn,setSurveyVisible:lt,isPreviewMode:ue,posthog:R}),{isPopupVisible:Li,isSurveySent:Ei,setIsPopupVisible:lt,hidePopupWithAnimation:ut}})(e,r,!((_=e.appearance)===null||_===void 0)&&_.surveyPopupDelaySeconds?1e3*e.appearance.surveyPopupDelaySeconds:0,F,o,a,q,h,g),qe=L||i===e.questions.length||s===!0,[De,Ne]=O(!1),Be=G(()=>!!he(e),[e]),Fe=!(!(!((v=e.appearance)===null||v===void 0)&&v.introScreenHeader)&&!(!((m=e.appearance)===null||m===void 0)&&m.introScreenDescription)),Ae=F?i===-1:!!(!((y=e.appearance)===null||y===void 0)&&y.displayIntroScreen)&&Fe&&!De&&!Be,Ve=G(()=>{const V=he(e),R=V?.surveySubmissionId||ln();return{isPreviewMode:F,previewPageIndex:i,onPopupSurveyDismissed(){g?hn(e,r,F,g):hn(e,r,F),l()},isPopup:a||!1,surveySubmissionId:R,onPreviewSubmit:u,onPreviewBack:c,posthog:r,properties:p,surveyLanguage:g}},[F,i,a,r,e,l,u,c,p,g]);return T?f(pe.Provider,{value:Ve,children:f("div",{className:"ph-survey",style:x(x({},ei(e.type,(w=e.appearance)===null||w===void 0?void 0:w.position,(P=e.appearance)===null||P===void 0?void 0:P.widgetType)),n),ref:q,children:qe?f(ui,{header:((S=e.appearance)===null||S===void 0?void 0:S.thankYouMessageHeader)||"Thank you!",description:((M=e.appearance)===null||M===void 0?void 0:M.thankYouMessageDescription)||"",forceDisableHtml:!!t,contentType:(D=e.appearance)===null||D===void 0?void 0:D.thankYouMessageDescriptionContentType,appearance:e.appearance||ae,onClose(){j(),d()}}):Ae?f(ci,{header:((b=e.appearance)===null||b===void 0?void 0:b.introScreenHeader)||"",description:((C=e.appearance)===null||C===void 0?void 0:C.introScreenDescription)||"",forceDisableHtml:!!t,contentType:(k=e.appearance)===null||k===void 0?void 0:k.introScreenDescriptionContentType,appearance:e.appearance||ae,onStart:()=>Ne(!0)}):f(qi,{survey:e,forceDisableHtml:!!t,posthog:r})})}):null}function qi({survey:e,forceDisableHtml:t,posthog:r}){var n,i;const o=G(()=>{const T=he(e);if(!T)return null;const L=J(T.lastQuestionIndex);return!L||L&&T.lastQuestionIndex>=0&&e.questions.length>T.lastQuestionIndex?T:(Qt(e),null)},[e]),[a,u]=O(()=>(o!=null&&o.responses&&I.info("Survey is already in progress, filling in initial responses"),o?.responses||{})),[c,l]=O(!1),{previewPageIndex:d,onPopupSurveyDismissed:p,isPopup:s,onPreviewSubmit:h,onPreviewBack:g,surveySubmissionId:_,isPreviewMode:v,properties:m,surveyLanguage:y}=ge(pe),[w,P]=O(()=>{const T=o?.lastQuestionIndex,L=J(T)&&T>=0&&e.questions.length>T?T:0;return J(d)&&d>=0?d:L}),[S,M]=O(()=>{var T;return((T=o?.visitedIndices)!==null&&T!==void 0?T:[]).filter(L=>L>=0&&e.questions.length>L)}),[D,b]=O(()=>{var T;const L=he(e);return(T=L?.questionSnapshots)!==null&&T!==void 0?T:{}}),C=G(()=>it(vn(e,o)),[e.id,o]),k=G(()=>{if(!C||new Set(C).size!==C.length)return vn(e,o);const T=new Map(e.questions.map(j=>[j.id,j])),L=C.map(j=>T.get(j)).filter(j=>!!j);return L.length===C.length?L:e.questions},[C,e.questions,e,o]);ye(()=>{!v||$(d)||0>d||P(d)},[d,v]);const q=!!(!((n=e.appearance)===null||n===void 0)&&n.allowGoBack)&&(v?(d??0)>0:S.length>0),F=k.at(w);return F?f("form",{className:"survey-form",name:"surveyForm",children:[s&&((i=e.appearance)===null||i===void 0?void 0:i.hideCancelButton)!==!0&&f(Wt,{onClick(){p()}}),f("div",{className:"survey-box","data-question-index":w,children:[c&&f("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Ti({question:F,forceDisableHtml:t,displayQuestionIndex:w,appearance:e.appearance||ae,onSubmit:T=>(({res:L,displayQuestionIndex:j,questionId:qe})=>{if(!r)return void I.error("onNextButtonClick called without a PostHog instance.");if(!ee(r))return void l(!0);if(l(!1),!qe)return void I.error("onNextButtonClick called without a questionId.");const{responses:De,questionSnapshots:Ne}=(function({responses:Ve,questionSnapshots:V={}},R,re,ue){return{responses:x(x({},Ve),{},{[de(R)]:re}),questionSnapshots:ue?.id?x(x({},V),{},{[ue.id]:ue.question}):V}})({responses:a,questionSnapshots:D},qe,L,k[j]);u(De),b(Ne);const Be=wn(e,j,L),Fe=Be===K,Ae=[...S,j];if(Fe||(M(Ae),P(Be),Zt(e,{surveySubmissionId:_,responses:De,lastQuestionIndex:Be,questionOrder:it(k),visitedIndices:Ae,surveyLanguage:y,questionSnapshots:Ne})),e.enable_partial_responses||Fe){const Ve=new Set(Ae.map(R=>{var re;return(re=k[R])===null||re===void 0?void 0:re.id}).filter(R=>!!R).map(R=>de(R))),V=Object.fromEntries(Object.entries(De).filter(([R])=>Ve.has(R)));dn({responses:V,survey:e,surveySubmissionId:_,isSurveyCompleted:Fe,posthog:r,properties:m,surveyLanguage:y,questionSnapshots:Ne})}})({res:T,displayQuestionIndex:w,questionId:F.id}),onPreviewSubmit:h,initialValue:F.id?a[de(F.id)]:void 0,canGoBack:q,onBack(){if(v)return void g();if(S.length===0)return;const T=S[S.length-1],L=S.slice(0,-1);M(L),P(T),Zt(e,{surveySubmissionId:_,responses:a,lastQuestionIndex:T,questionOrder:it(k),visitedIndices:L,surveyLanguage:y,questionSnapshots:D})}})]})]}):null}function Pi({survey:e,forceDisableHtml:t,posthog:r,readOnly:n,surveyLanguage:i}){var o,a,u,c,l,d,p;const[s,h]=O(!0),[g,_]=O(!1),[v,m]=O({}),y=Me(void 0),w=()=>{(g||!r||n||ee(r))&&_(!g)};if(ye(()=>{var S;if(!r)return void I.error("FeedbackWidget called without a PostHog instance.");if(n)return;((S=e.appearance)===null||S===void 0?void 0:S.widgetType)==="tab"&&m({top:"50%",bottom:"auto"});const M=D=>{var b;const C=D;((b=C.detail)===null||b===void 0?void 0:b.surveyId)===e.id&&(I.info(`Received show event for feedback button survey ${e.id}`),m(C.detail.position||{}),w())};return X(N,Kt,M),()=>{$(y.current)||(clearTimeout(y.current),y.current=void 0),N.removeEventListener(Kt,M)}},[r,n,e.id,(o=e.appearance)===null||o===void 0?void 0:o.widgetType,(a=e.appearance)===null||a===void 0?void 0:a.widgetSelector,(u=e.appearance)===null||u===void 0?void 0:u.borderColor]),Sn({survey:e,setSurveyVisible:h,posthog:r}),!s)return null;const P=()=>{e.schedule!==Pt&&h(!1),$(y.current)||clearTimeout(y.current),y.current=setTimeout(()=>{y.current=void 0,_(!1)},200)};return f(W,{children:[((c=e.appearance)===null||c===void 0?void 0:c.widgetType)==="tab"&&f("button",{className:"ph-survey-widget-tab "+(((l=e.appearance)===null||l===void 0?void 0:l.tabPosition)==="top"?"widget-tab-top":""),onClick:w,disabled:n,style:Ci((d=e.appearance)===null||d===void 0?void 0:d.tabPosition),children:((p=e.appearance)===null||p===void 0?void 0:p.widgetLabel)||""}),g&&f(Ce,{posthog:r,survey:e,forceDisableHtml:t,style:v,onPopupSurveyDismissed:P,onCloseConfirmationMessage:P,surveyLanguage:i})]})}const Ti=({question:e,forceDisableHtml:t,displayQuestionIndex:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:a,canGoBack:u,onBack:c})=>{const l={forceDisableHtml:t,appearance:n,onPreviewSubmit(d){o(d)},onSubmit(d){i(d)},initialValue:a,displayQuestionIndex:r,canGoBack:u,onBack:c};switch(e.type){case Er:return ie(di,x(x({},l),{},{question:e,key:e.id}));case"link":return ie(pi,x(x({},l),{},{question:e,key:e.id}));case qt:return ie(hi,x(x({},l),{},{question:e,key:e.id}));case Le:case Ct:return ie(fi,x(x({},l),{},{question:e,key:e.id}));default:return I.error(`Unsupported question type: ${e.type}`),null}},He=typeof globalThis<"u"?globalThis:H;He&&typeof self>"u"&&(He.self=He),He&&typeof File>"u"&&(He.File=function(){});const at=H??{};at.__PosthogExtensions__=at.__PosthogExtensions__||{},at.__PosthogExtensions__.generateSurveys=kn,at.extendPostHogWithSurveys=kn})();
2
2
 
3
- //# sourceMappingURL=surveys-D941hgn3.js.map
3
+ //# sourceMappingURL=surveys-BsZYxM6N.js.map
@@ -1 +1 @@
1
- import{t as a}from"./trace-timeline-DVZqlQSW.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.12.3"};var d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="4e655de5-a2bc-40b9-afc2-9c4107167b00",e._sentryDebugIdIdentifier="sentry-dbid-4e655de5-a2bc-40b9-afc2-9c4107167b00")}catch{}})();export{a as TraceTimeline};
1
+ import{t as a}from"./trace-timeline-Bf9Oai70.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.12.5"};var d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="4e655de5-a2bc-40b9-afc2-9c4107167b00",e._sentryDebugIdIdentifier="sentry-dbid-4e655de5-a2bc-40b9-afc2-9c4107167b00")}catch{}})();export{a as TraceTimeline};