posthog-js
Version:
Posthog-js allows you to automatically capture usage and send events to PostHog.
2 lines • 122 kB
JavaScript
!function(t){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:e,o=null==n?void 0:n.document;var r,i,l,s,u,a,c,d,h,f,p,v,m,g,b;null!=n&&n.XMLHttpRequest&&new n.XMLHttpRequest;var y={},w=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function k(t,e){for(var n in e)t[n]=e[n];return t}function T(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function S(t,e,n,o,r){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++l:r,__i:-1,__u:0};return null==r&&null!=i.vnode&&i.vnode(s),s}function q(t){return t.children}function A(t,e){this.props=t,this.context=e}function $(t,e){if(null==e)return t.__?$(t.__,t.__i+1):null;for(var n;t.__k.length>e;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?$(t):null}function j(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,o=[],r=[],l=k({},e);l.__v=e.__v+1,i.vnode&&i.vnode(l),L(t.__P,l,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,null==n?$(e):n,!!(32&e.__u),r),l.__v=e.__v,l.__.__k[l.__i]=l,F(o,l,r),e.__e=e.__=null,l.__e!=n&&C(l)}}function C(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),C(t)}function E(t){(!t.__d&&(t.__d=!0)&&s.push(t)&&!z.__r++||u!=i.debounceRendering)&&((u=i.debounceRendering)||a)(z)}function z(){try{for(var t,e=1;s.length;)s.length>e&&s.sort(c),t=s.shift(),e=s.length,j(t)}finally{s.length=z.__r=0}}function I(t,e,n,o,r,i,l,s,u,a,c){var d,h,f,p,v,m,g,b=o&&o.__k||w,x=e.length;for(u=M(n,e,b,u,x),d=0;x>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&b[f.__i]||y,f.__i=d,m=L(t,f,h,r,i,l,s,u,a,c),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Q(h.ref,null,f),c.push(f.ref,f.__c||p,f)),null==v&&null!=p&&(v=p),(g=!!(4&f.__u))||h.__k===f.__k?(u=O(f,u,t,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==m?u=m:p&&(u=p.nextSibling),f.__u&=-7);return n.__e=v,u}function M(t,e,n,o,r){var i,l,s,u,a,c=n.length,d=c,h=0;for(t.__k=new Array(r),i=0;r>i;i++)null!=(l=e[i])&&"boolean"!=typeof l&&"function"!=typeof l?("string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?l=t.__k[i]=S(null,l,null,null,null):_(l)?l=t.__k[i]=S(q,{children:l},null,null,null):void 0===l.constructor&&l.__b>0?l=t.__k[i]=S(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):t.__k[i]=l,u=i+h,l.__=t,l.__b=t.__b+1,s=null,-1!=(a=l.__i=P(l,n,u,d))&&(d--,(s=n[a])&&(s.__u|=2)),null==s||null==s.__v?(-1==a&&(r>c?h--:c>r&&h++),"function"!=typeof l.type&&(l.__u|=4)):a!=u&&(a==u-1?h--:a==u+1?h++:(a>u?h--:h++,l.__u|=4))):t.__k[i]=null;if(d)for(i=0;c>i;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==o&&(o=$(s)),U(s,s));return o}function O(t,e,n,o){var r,i;if("function"==typeof t.type){for(r=t.__k,i=0;r&&r.length>i;i++)r[i]&&(r[i].__=t,e=O(r[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=$(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function P(t,e,n,o){var r,i,l,s=t.key,u=t.type,a=e[n],c=null!=a&&!(2&a.__u);if(null===a&&null==s||c&&s==a.key&&u==a.type)return n;if(o>(c?1:0))for(r=n-1,i=n+1;r>=0||e.length>i;)if(null!=(a=e[l=0>r?i++:r--])&&!(2&a.__u)&&s==a.key&&u==a.type)return l;return-1}function D(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||x.test(e)?n:n+"px"}function R(t,e,n,o,r){var i,l;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||D(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||D(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])i=e!=(e=e.replace(p,"$1")),l=e.toLowerCase(),e=l in t||"onFocusOut"==e||"onFocusIn"==e?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n[f]=o[f]:(n[f]=v,t.addEventListener(e,i?g:m,i)):t.removeEventListener(e,i?g:m,i);else{if("http://www.w3.org/2000/svg"==r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function N(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[h])e[h]=v++;else if(n[f]>e[h])return;return n(i.event?i.event(e):e)}}}function L(t,e,n,o,r,l,s,u,a,c){var d,h,f,p,v,m,g,b,y,x,$,S,j,C,E,z,M=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(a=!!(32&n.__u),l=[u=e.__e=n.__e]),(d=i.__b)&&d(e);t:if("function"==typeof M){h=s.length;try{if(y=e.props,x=M.prototype&&M.prototype.render,$=(d=M.contextType)&&o[d.__c],S=d?$?$.props.value:d.__:o,n.__c?b=(f=e.__c=n.__c).__=f.__E:(x?e.__c=f=new M(y,S):(e.__c=f=new A(y,S),f.constructor=M,f.render=W),$&&$.sub(f),f.state||(f.state={}),f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),x&&null==f.__s&&(f.__s=f.state),x&&null!=M.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=k({},f.__s)),k(f.__s,M.getDerivedStateFromProps(y,f.__s))),v=f.props,m=f.state,f.__v=e,p)x&&null==M.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),x&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(x&&null==M.getDerivedStateFromProps&&y!==v&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,S),e.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,S)){e.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),w.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break t}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,S),x&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,m,g)})}if(f.context=S,f.props=y,f.__P=t,f.__e=!1,j=i.__r,C=0,x)f.state=f.__s,f.__d=!1,j&&j(e),d=f.render(f.props,f.state,f.context),w.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,j&&j(e),d=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++C);f.state=f.__s,null!=f.getChildContext&&(o=k(k({},o),f.getChildContext())),x&&!p&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(v,m)),E=null!=d&&d.type===q&&null==d.key?Z(d.props.children):d,u=I(t,_(E)?E:[E],e,n,o,r,l,s,u,a,c),f.base=e.__e,e.__u&=-161,f.__h.length&&s.push(f),b&&(f.__E=f.__=null)}catch(t){if(s.length=h,e.__v=null,a||null!=l)if(t.then){for(e.__u|=a?160:128;u&&8==u.nodeType&&u.nextSibling;)u=u.nextSibling;null!=l&&(l[l.indexOf(u)]=null),e.__e=u}else{if(null!=l)for(z=l.length;z--;)T(l[z]);B(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||B(e);i.__e(t,e,n)}}else null==l&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):u=e.__e=H(n.__e,e,n,o,r,l,s,a,c);return(d=i.diffed)&&d(e),128&e.__u?void 0:u}function B(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(B))}function F(t,e,n){for(var o=0;n.length>o;o++)Q(n[o],n[++o],n[++o]);i.__c&&i.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){i.__e(t,e.__v)}})}function Z(t){return"object"!=typeof t||null==t||t.__b>0?t:_(t)?t.map(Z):void 0!==t.constructor?null:k({},t)}function H(t,e,n,o,l,s,u,a,c){var d,h,f,p,v,m,g,b=n.props||y,w=e.props,x=e.type;if("svg"==x?l="http://www.w3.org/2000/svg":"math"==x?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),null!=s)for(d=0;s.length>d;d++)if((v=s[d])&&"setAttribute"in v==!!x&&(x?v.localName==x:3==v.nodeType)){t=v,s[d]=null;break}if(null==t){if(null==x)return document.createTextNode(w);t=document.createElementNS(l,x,w.is&&w),a&&(i.__m&&i.__m(e,s),a=!1),s=null}if(null==x)b===w||a&&t.data==w||(t.data=w);else{if(s="textarea"==x&&null!=w.defaultValue?null:s&&r.call(t.childNodes),!a&&null!=s)for(b={},d=0;t.attributes.length>d;d++)b[(v=t.attributes[d]).name]=v.value;for(d in b)v=b[d],"dangerouslySetInnerHTML"==d?f=v:"children"==d||d in w||"value"==d&&"defaultValue"in w||"checked"==d&&"defaultChecked"in w||R(t,d,null,v,l);for(d in w)v=w[d],"children"==d?p=v:"dangerouslySetInnerHTML"==d?h=v:"value"==d?m=v:"checked"==d?g=v:a&&"function"!=typeof v||b[d]===v||R(t,d,v,b[d],l);if(h)a||f&&(h.__html==f.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(f&&(t.innerHTML=""),I("template"==e.type?t.content:t,_(p)?p:[p],e,n,o,"foreignObject"==x?"http://www.w3.org/1999/xhtml":l,s,u,s?s[0]:n.__k&&$(n,0),a,c),null!=s)for(d=s.length;d--;)T(s[d]);a&&"textarea"!=x||(d="value","progress"==x&&null==m?t.removeAttribute("value"):null!=m&&(m!==t[d]||"progress"==x&&!m||"option"==x&&m!=b[d])&&R(t,d,m,b[d],l),d="checked",null!=g&&g!=t[d]&&R(t,d,g,b[d],l))}return t}function Q(t,e,n){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){i.__e(t,n)}}function U(t,e,n){var o,r;if(i.unmount&&i.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Q(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){i.__e(t,e)}o.base=o.__P=o.__n=null}if(o=t.__k)for(r=0;o.length>r;r++)o[r]&&U(o[r],e,n||"function"!=typeof t.type);n||T(t.__e),t.__c=t.__=t.__e=void 0}function W(t,e,n){return this.constructor(t,n)}function Y(t,e,n){var o,l,s,u;e==document&&(e=document.documentElement),i.__&&i.__(t,e),l=(o="function"==typeof n)?null:n&&n.__k||e.__k,s=[],u=[],L(e,t=(!o&&n||e).__k=function(t,e,n){var o,i,l,s={};for(l in e)"key"==l?o=e[l]:"ref"==l?i=e[l]:s[l]=e[l];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(l in t.defaultProps)void 0===s[l]&&(s[l]=t.defaultProps[l]);return S(t,s,o,i,null)}(q,null,[t]),l||y,y,e.namespaceURI,!o&&n?[n]:l?null:e.firstChild?r.call(e.childNodes):null,s,!o&&n?n:l?l.__e:e.firstChild,o,u),F(s,t,u),t.props.children=null}r=w.slice,i={__e(t,e,n,o){for(var r,i,l;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(t)),l=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,o||{}),l=r.__d),l)return r.__E=r}catch(e){t=e}throw t}},l=0,A.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=k({},this.state);"function"==typeof t&&(t=t(k({},n),this.props)),t&&k(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),E(this))},A.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),E(this))},A.prototype.render=q,s=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(t,e){return t.__v.__b-e.__v.__b},z.__r=0,d=Math.random().toString(8),h="__d"+d,f="__a"+d,p=/(PointerCapture)$|Capture$/i,v=0,m=N(!1),g=N(!0),b=0;const G={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},K="product tour shown",V="$product_tour_id",J="$product_tour_name",X="$product_tour_iteration",tt="$product_tour_render_reason",et="$product_tour_step_id",nt="$product_tour_step_order",ot="$product_tour_step_type",rt="$product_tour_dismiss_reason",it="$product_tour_button_text",lt="$product_tour_button_action",st="$product_tour_button_link",ut="$product_tour_button_tour_id",at="$product_tour_steps_count",ct="$product_tour_step_selector",dt="$product_tour_step_selector_found",ht="$product_tour_step_element_tag",ft="$product_tour_step_element_id",pt="$product_tour_step_element_classes",vt="$product_tour_step_element_text",mt="$product_tour_error",gt="$product_tour_matches_count",bt="$product_tour_failure_phase",yt="$product_tour_waited_for_element",wt="$product_tour_wait_duration_ms",xt="$product_tour_banner_selector",_t="$product_tour_linked_survey_id",kt="$use_manual_selector",Tt="$inference_data_present",$t="$product_tour_type",St="events",qt="cancelEvents",At="$survey_id",jt="$survey_partially_completed",Ct="$survey_questions",Et="$survey_completed",zt="$product_tour_id",It=Object.prototype,Mt=It.hasOwnProperty,Ot=It.toString,Pt=Array.isArray||function(t){return"[object Array]"===Ot.call(t)},Dt=t=>"function"==typeof t,Rt=t=>void 0===t,Nt=t=>null===t,Lt=t=>Rt(t)||Nt(t),Bt=t=>"[object Number]"==Ot.call(t)&&t==t,Ft=(t,e,n)=>{function o(o,...r){e(()=>{(0,n[o])(t,...r)})}return{debug(...t){o("debug",...t)},info(...t){o("log",...t)},warn(...t){o("warn",...t)},error(...t){o("error",...t)},critical(...e){n.error(t,...e)},createLogger:o=>Ft(`${t} ${o}`,e,n)}},Zt=t=>t(),Ht="Mobile",Qt="Tablet",Ut="Android Tablet",Wt="iPad",Yt="Apple Watch",Gt="Nintendo",Kt="PlayStation",Vt="Xbox",Jt="Nokia",Xt="Ouya",te="Generic "+Ht.toLowerCase(),ee="Generic "+Qt.toLowerCase(),ne=new RegExp(Vt,"i"),oe=new RegExp("PlayStation \\w+","i"),re=new RegExp("Nintendo \\w+","i"),ie=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(Gt,"i"),new RegExp(Kt,"i"),new RegExp("Windows","i");function le(t){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(t)}function se(t,e,n){return(e=function(t){var e=function(t){if("object"!=le(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==le(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ue(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function ae(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ue(Object(n),!0).forEach(function(e){se(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);e>n;n++)o[n]=t[n];return o}function de(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,l,s=[],u=!0,a=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(a)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ce(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const he=Object.entries,fe=Object.setPrototypeOf,pe=Object.isFrozen,ve=Object.getPrototypeOf,me=Object.getOwnPropertyDescriptor;let ge=Object.freeze,be=Object.seal,ye=Object.create,we="undefined"!=typeof Reflect&&Reflect,xe=we.apply,_e=we.construct;ge||(ge=function(t){return t}),be||(be=function(t){return t}),xe||(xe=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;n>r;r++)o[r-2]=arguments[r];return t.apply(e,o)}),_e||(_e=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;e>o;o++)n[o-1]=arguments[o];return new t(...n)});const ke=He([].forEach),Te=He([].lastIndexOf),$e=He([].pop),Se=He([].push),qe=He([].splice),Ae=Array.isArray,je=He("".toLowerCase),Ce=He("".toString),Ee=He("".match),ze=He("".replace),Ie=He("".indexOf),Me=He("".trim),Oe=He((0).toString),Pe=He(Boolean.prototype.toString),De="undefined"==typeof BigInt?null:He(BigInt.prototype.toString),Re="undefined"==typeof Symbol?null:He(Symbol.prototype.toString),Ne=He({}.hasOwnProperty),Le=He({}.toString),Be=He(/t/.test),Fe=(Ze=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return _e(Ze,e)});var Ze;function He(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;n>r;r++)o[r-1]=arguments[r];return xe(t,e,o)}}function Qe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:je;if(fe&&fe(t,null),!Ae(e))return t;let o=e.length;for(;o--;){let r=e[o];if("string"==typeof r){const t=n(r);t!==r&&(pe(e)||(e[o]=t),r=t)}t[r]=!0}return t}function Ue(t){for(let e=0;t.length>e;e++)Ne(t,e)||(t[e]=null);return t}function We(t){const e=ye(null);for(const o of he(t)){var n=de(o,2);const r=n[0],i=n[1];Ne(t,r)&&(e[r]=Ae(i)?Ue(i):i&&"object"==typeof i&&i.constructor===Object?We(i):i)}return e}function Ye(t,e){for(;null!==t;){const n=me(t,e);if(n){if(n.get)return He(n.get);if("function"==typeof n.value)return He(n.value)}t=ve(t)}return function(){return null}}const Ge=ge(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ke=ge(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ve=ge(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Je=ge(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Xe=ge(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),tn=ge(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),en=ge(["#text"]),nn=ge(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),on=ge(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),rn=ge(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ln=ge(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sn=be(/{{[\w\W]*|^[\w\W]*}}/g),un=be(/<%[\w\W]*|^[\w\W]*%>/g),an=be(/\${[\w\W]*/g),cn=be(/^data-[\-\w.\u00B7-\uFFFF]+$/),dn=be(/^aria-[\-\w]+$/),hn=be(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fn=be(/^(?:\w+script|data):/i),pn=be(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vn=be(/^html$/i),mn=be(/^[a-z][.\w]*(-[.\w]+)+$/i),gn=be(/<[/\w!]/g),bn=be(/<[/\w]/g),yn=be(/<\/no(script|embed|frames)/i),wn=be(/\/>/i),xn=function(){return"undefined"==typeof window?null:window},_n=function(t,e,n,o){return Ne(t,e)&&Ae(t[e])?Qe(o.base?We(o.base):{},t[e],o.transform):n};var kn=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xn();const n=e=>t(e);if(n.version="3.4.13",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let o=e.document;const r=o,i=r.currentScript,l=e.HTMLTemplateElement,s=e.Node,u=e.NodeFilter,a=e.DOMParser,c=e.trustedTypes,d=e.Element.prototype,h=Ye(d,"cloneNode"),f=Ye(d,"remove"),p=Ye(d,"nextSibling"),v=Ye(d,"childNodes"),m=Ye(d,"parentNode"),g=Ye(d,"shadowRoot"),b=Ye(d,"attributes"),y=s&&s.prototype?Ye(s.prototype,"nodeType"):null,w=s&&s.prototype?Ye(s.prototype,"nodeName"):null,x=s&&s.prototype?Ye(s.prototype,"ownerDocument"):null;if("function"==typeof l){const t=o.createElement("template");t.content&&t.content.ownerDocument&&(o=t.content.ownerDocument)}let _,k,T="",S=!1,q=0;const A=function(){if(q>0)throw Fe('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},j=function(t){A(),q++;try{return _.createHTML(t)}finally{q--}},C=o.implementation,E=o.createNodeIterator,z=o.createDocumentFragment,I=o.getElementsByTagName,M=r.importNode;let O={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof he&&"function"==typeof m&&C&&void 0!==C.createHTMLDocument;const P=sn,D=un,R=an,N=cn,L=dn,B=fn,F=pn,Z=mn;let H=hn,Q=null;const U=Qe({},[...Ge,...Ke,...Ve,...Xe,...en]);let W=null;const Y=Qe({},[...nn,...on,...rn,...ln]);let G=Object.seal(ye(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),K=null,V=null;const J=Object.seal(ye(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let X=!0,tt=!0,et=!1,nt=!0,ot=!1,rt=!0,it=!1,lt=!1,st=null,ut=null,at=!1,ct=!1,dt=!1,ht=!1,ft=!0,pt=!1;const vt="user-content-";let mt=!0,gt=!1,bt={},yt=null;const wt=Qe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let xt=null;const _t=Qe({},["audio","video","img","source","image","track"]);let kt=null;const Tt=Qe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$t="http://www.w3.org/1998/Math/MathML",St="http://www.w3.org/2000/svg",qt="http://www.w3.org/1999/xhtml";let At=qt,jt=!1,Ct=null;const Et=Qe({},[$t,St,qt],Ce),zt=ge(["mi","mo","mn","ms","mtext"]);let It=Qe({},zt);const Mt=ge(["annotation-xml"]);let Ot=Qe({},Mt);const Pt=Qe({},["title","style","font","a","script"]);let Dt=null;const Rt=["application/xhtml+xml","text/html"];let Nt=null,Lt=null;const Bt=o.createElement("form"),Ft=function(t){return t instanceof RegExp||t instanceof Function},Zt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Lt&&Lt===t)return;t&&"object"==typeof t||(t={}),t=We(t),Dt=-1===Rt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Nt="application/xhtml+xml"===Dt?Ce:je,Q=_n(t,"ALLOWED_TAGS",U,{transform:Nt}),W=_n(t,"ALLOWED_ATTR",Y,{transform:Nt}),Ct=_n(t,"ALLOWED_NAMESPACES",Et,{transform:Ce}),kt=_n(t,"ADD_URI_SAFE_ATTR",Tt,{transform:Nt,base:Tt}),xt=_n(t,"ADD_DATA_URI_TAGS",_t,{transform:Nt,base:_t}),yt=_n(t,"FORBID_CONTENTS",wt,{transform:Nt}),K=_n(t,"FORBID_TAGS",We({}),{transform:Nt}),V=_n(t,"FORBID_ATTR",We({}),{transform:Nt}),bt=!!Ne(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?We(t.USE_PROFILES):t.USE_PROFILES),X=!1!==t.ALLOW_ARIA_ATTR,tt=!1!==t.ALLOW_DATA_ATTR,et=t.ALLOW_UNKNOWN_PROTOCOLS||!1,nt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ot=t.SAFE_FOR_TEMPLATES||!1,rt=!1!==t.SAFE_FOR_XML,it=t.WHOLE_DOCUMENT||!1,ct=t.RETURN_DOM||!1,dt=t.RETURN_DOM_FRAGMENT||!1,ht=t.RETURN_TRUSTED_TYPE||!1,at=t.FORCE_BODY||!1,ft=!1!==t.SANITIZE_DOM,pt=t.SANITIZE_NAMED_PROPS||!1,mt=!1!==t.KEEP_CONTENT,gt=t.IN_PLACE||!1,H=function(t){try{return Be(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:hn,At="string"==typeof t.NAMESPACE?t.NAMESPACE:qt,It=Ne(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof t.MATHML_TEXT_INTEGRATION_POINTS?We(t.MATHML_TEXT_INTEGRATION_POINTS):Qe({},zt),Ot=Ne(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&"object"==typeof t.HTML_INTEGRATION_POINTS?We(t.HTML_INTEGRATION_POINTS):Qe({},Mt);const e=Ne(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&"object"==typeof t.CUSTOM_ELEMENT_HANDLING?We(t.CUSTOM_ELEMENT_HANDLING):ye(null);if(G=ye(null),Ne(e,"tagNameCheck")&&Ft(e.tagNameCheck)&&(G.tagNameCheck=e.tagNameCheck),Ne(e,"attributeNameCheck")&&Ft(e.attributeNameCheck)&&(G.attributeNameCheck=e.attributeNameCheck),Ne(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(G.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),be(G),ot&&(tt=!1),dt&&(ct=!0),bt&&(Q=Qe({},en),W=ye(null),!0===bt.html&&(Qe(Q,Ge),Qe(W,nn)),!0===bt.svg&&(Qe(Q,Ke),Qe(W,on),Qe(W,ln)),!0===bt.svgFilters&&(Qe(Q,Ve),Qe(W,on),Qe(W,ln)),!0===bt.mathMl&&(Qe(Q,Xe),Qe(W,rn),Qe(W,ln))),J.tagCheck=null,J.attributeCheck=null,Ne(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?J.tagCheck=t.ADD_TAGS:Ae(t.ADD_TAGS)&&(Q===U&&(Q=We(Q)),Qe(Q,t.ADD_TAGS,Nt))),Ne(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?J.attributeCheck=t.ADD_ATTR:Ae(t.ADD_ATTR)&&(W===Y&&(W=We(W)),Qe(W,t.ADD_ATTR,Nt))),Ne(t,"ADD_URI_SAFE_ATTR")&&Ae(t.ADD_URI_SAFE_ATTR)&&Qe(kt,t.ADD_URI_SAFE_ATTR,Nt),Ne(t,"FORBID_CONTENTS")&&Ae(t.FORBID_CONTENTS)&&(yt===wt&&(yt=We(yt)),Qe(yt,t.FORBID_CONTENTS,Nt)),Ne(t,"ADD_FORBID_CONTENTS")&&Ae(t.ADD_FORBID_CONTENTS)&&(yt===wt&&(yt=We(yt)),Qe(yt,t.ADD_FORBID_CONTENTS,Nt)),mt&&(Q["#text"]=!0),it&&Qe(Q,["html","head","body"]),Q.table&&(Qe(Q,["tbody"]),delete K.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw Fe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw Fe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=_;_=t.TRUSTED_TYPES_POLICY;try{T=j("")}catch(t){throw _=e,t}}else null===t.TRUSTED_TYPES_POLICY?(_=void 0,T=""):(void 0===_&&(S||(k=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(c,i),S=!0),_=k),_&&"string"==typeof T&&(T=j("")));ge&&ge(t),Lt=t},Ht=Qe({},[...Ke,...Ve,...Je]),Qt=Qe({},[...Xe,...tn]),Ut=function(t){Se(n.removed,{element:t});try{m(t).removeChild(t)}catch(e){if(f(t),!m(t))throw Fe("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Wt=function(t){Kt(t);const e=v(t);if(e){const t=[];ke(e,e=>{Se(t,e)}),ke(t,t=>{try{f(t)}catch(t){}})}const n=b(t);if(n)for(let e=n.length-1;e>=0;--e){const o=n[e],r=o&&o.name;if("string"==typeof r)try{t.removeAttribute(r)}catch(t){}}},Yt=function(t,e){try{Se(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){Se(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(ct||dt)try{Ut(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Gt=function(t){const e=b(t);if(e)for(let n=e.length-1;n>=0;--n){const o=e[n],r=o&&o.name;if("string"==typeof r&&!W[Nt(r)])try{t.removeAttribute(r)}catch(t){}}},Kt=function(t){const e=[t];for(;e.length>0;){const t=e.pop();1===(y?y(t):t.nodeType)&&Gt(t);const n=v(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},Vt=function(t){let e=null,n=null;if(at)t="<remove></remove>"+t;else{const e=Ee(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Dt&&At===qt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=_?j(t):t;if(At===qt)try{e=(new a).parseFromString(r,Dt)}catch(t){}if(!e||!e.documentElement){e=C.createDocument(At,"template",null);try{e.documentElement.innerHTML=jt?T:r}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),At===qt?I.call(e,it?"html":"body")[0]:it?e.documentElement:i},Jt=function(t){const e=x?x(t):t.ownerDocument;return E.call(e||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Xt=function(t){return t=ze(t,P," "),t=ze(t,D," "),ze(t,R," ")},te=function(t){var e;t.normalize();const n=x?x(t):t.ownerDocument,o=E.call(n||t,t,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let r=o.nextNode();for(;r;)r.data=Xt(r.data),r=o.nextNode();const i=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");i&&ke(i,t=>{ne(t.content)&&te(t.content)})},ee=function(t){const e=w?w(t):null;return"string"==typeof e&&"form"===Nt(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==b(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==y(t)||t.childNodes!==v(t))},ne=function(t){if(!y||"object"!=typeof t||null===t)return!1;try{return 11===y(t)}catch(t){return!1}},oe=function(t){if(!y||"object"!=typeof t||null===t)return!1;try{return"number"==typeof y(t)}catch(t){return!1}};function re(t,e,o){0!==t.length&&ke(t,t=>{t.call(n,e,o,Lt)})}const ie=function(t,e,n,o){return 0===t.length?e:e===n||e===o?We(e):e},le=function(t,e){if(re(O.beforeSanitizeElements,t,null),t!==e&&null===m(t))return gt&&Kt(t),!0;if(ee(t))return Ut(t),!0;const o=Nt(w?w(t):t.nodeName);if(Q=ie(O.uponSanitizeElement,Q,U,st),re(O.uponSanitizeElement,t,{tagName:o,allowedTags:Q}),t!==e&&null===m(t))return gt&&Kt(t),!0;if(function(t,e){return!!(rt&&t.hasChildNodes()&&!oe(t.firstElementChild)&&Be(gn,t.textContent)&&Be(gn,t.innerHTML))||!(!rt||t.namespaceURI!==qt||"style"!==e||!oe(t.firstElementChild))||7===t.nodeType||!(!rt||8!==t.nodeType||!Be(bn,t.data))}(t,o))return Ut(t),!0;if(K[o]||!(J.tagCheck instanceof Function&&J.tagCheck(o))&&!Q[o]){const n=function(t,e,n){if(!K[e]&&ae(e)){if(G.tagNameCheck instanceof RegExp&&Be(G.tagNameCheck,e))return!1;if(G.tagNameCheck instanceof Function&&G.tagNameCheck(e))return!1}if(mt&&!yt[e]){const e=m(t),o=v(t);if(o&&e)for(let r=o.length-1;r>=0;--r){const i=t===n?h(o[r],!0):o[r];e.insertBefore(i,p(t))}}return Ut(t),!0}(t,o,e);return!1===n&&re(O.afterSanitizeElements,t,null),n}if(1===(y?y(t):t.nodeType)&&!function(t){let e=m(t);e&&e.tagName||(e={namespaceURI:At,tagName:"template"});const n=je(t.tagName),o=je(e.tagName);return!!Ct[t.namespaceURI]&&(t.namespaceURI===St?function(t,e,n){return e.namespaceURI===qt?"svg"===t:e.namespaceURI===$t?"svg"===t&&("annotation-xml"===n||It[n]):Boolean(Ht[t])}(n,e,o):t.namespaceURI===$t?function(t,e,n){return e.namespaceURI===qt?"math"===t:e.namespaceURI===St?"math"===t&&Ot[n]:Boolean(Qt[t])}(n,e,o):t.namespaceURI===qt?function(t,e,n){return!(e.namespaceURI===St&&!Ot[n])&&!(e.namespaceURI===$t&&!It[n])&&!Qt[t]&&(Pt[t]||!Ht[t])}(n,e,o):!("application/xhtml+xml"!==Dt||!Ct[t.namespaceURI]))}(t))return Ut(t),!0;if(("noscript"===o||"noembed"===o||"noframes"===o)&&Be(yn,t.innerHTML))return Ut(t),!0;if(ot&&3===t.nodeType){const e=Xt(t.textContent);t.textContent!==e&&(Se(n.removed,{element:t.cloneNode()}),t.textContent=e)}return re(O.afterSanitizeElements,t,null),!1},se=function(t,e,n){if(V[e])return!1;if(rt&&"patchsrc"===e)return!1;if(rt&&"for"===e&&"label"!==t&&"output"!==t)return!1;if(ft&&("id"===e||"name"===e)&&(n in o||n in Bt))return!1;const r=W[e]||J.attributeCheck instanceof Function&&J.attributeCheck(e,t);if(tt&&Be(N,e));else if(X&&Be(L,e));else if(r){if(kt[e]);else if(Be(H,ze(n,F,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==Ie(n,"data:")||!xt[t])if(et&&!Be(B,ze(n,F,"")));else if(n)return!1}else if(!(ae(t)&&(G.tagNameCheck instanceof RegExp&&Be(G.tagNameCheck,t)||G.tagNameCheck instanceof Function&&G.tagNameCheck(t))&&(G.attributeNameCheck instanceof RegExp&&Be(G.attributeNameCheck,e)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(e,t))||"is"===e&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&Be(G.tagNameCheck,n)||G.tagNameCheck instanceof Function&&G.tagNameCheck(n))))return!1;return!0},ue=Qe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ae=function(t){return!ue[je(t)]&&Be(Z,t)},ce=function(t,e,n,o){if(_&&"object"==typeof c&&"function"==typeof c.getAttributeType&&!n)switch(c.getAttributeType(t,e)){case"TrustedHTML":return j(o);case"TrustedScriptURL":return function(t){A(),q++;try{return _.createScriptURL(t)}finally{q--}}(o)}return o},de=function(t,e,o,r){try{o?t.setAttributeNS(o,e,r):t.setAttribute(e,r),ee(t)?Ut(t):$e(n.removed)}catch(n){Yt(e,t)}},fe=function(t){re(O.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||ee(t))return;W=ie(O.uponSanitizeAttribute,W,Y,ut);const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let o=e.length;const r=Nt(t.nodeName);for(;o--;){const i=e[o],l=i.name,s=i.namespaceURI,u=i.value,a=Nt(l),c=u;let d="value"===l?c:Me(c);n.attrName=a,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,re(O.uponSanitizeAttribute,t,n),d=n.attrValue,!pt||"id"!==a&&"name"!==a||0===Ie(d,vt)||(Yt(l,t),d=vt+d),rt&&Be(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||"attributename"===a&&Ee(d,"href")?Yt(l,t):n.forceKeepAttr||(!n.keepAttr||!nt&&Be(wn,d)?Yt(l,t):(ot&&(d=Xt(d)),se(r,a,d)?(d=ce(r,a,s,d),d!==c&&de(t,l,s,d)):Yt(l,t)))}re(O.afterSanitizeAttributes,t,null)},pe=function(t){let e=null;const n=Jt(t);for(re(O.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(re(O.uponSanitizeShadowNode,e,null),le(e,t),fe(e),ne(e.content)&&pe(e.content),1===(y?y(e):e.nodeType)){const t=g(e);ne(t)&&(ve(t),pe(t))}re(O.afterSanitizeShadowDOM,t,null)},ve=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){pe(t.shadow);continue}const n=t.node,o=1===(y?y(n):n.nodeType),r=v(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(o){const t=w?w(n):null;if("string"==typeof t&&"template"===Nt(t)){const t=n.content;ne(t)&&e.push({node:t,shadow:null})}}if(o){const t=g(n);ne(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,i=null,l=null,s=null;if(jt=!t,jt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!oe(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return Oe(t);case"boolean":return Pe(t);case"bigint":return De?De(t):"0";case"symbol":return Re?Re(t):"Symbol()";case"undefined":default:return Le(t);case"function":case"object":{if(null===t)return Le(t);const e=t,n=Ye(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:Le(t)}return Le(t)}}}(t)))throw Fe("dirty is not a string, aborting");if(!n.isSupported)return t;lt?(Q=st,W=ut):Zt(e),(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&(Q=We(Q)),O.uponSanitizeAttribute.length>0&&(W=We(W)),n.removed=[];const u=gt&&"string"!=typeof t&&oe(t);if(u){!function(t){if(!rt)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=y?y(t):t.nodeType;if(7===n||8===n&&Be(bn,t.data)){try{f(t)}catch(t){}continue}if(1===n){const e=t,n=Nt(w?w(t):t.nodeName);try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&"label"!==n&&"output"!==n&&e.removeAttribute("for")}catch(t){}}const o=v(t);if(o)for(let t=o.length-1;t>=0;--t)e.push(o[t])}}(t);const e=w?w(t):t.nodeName;if("string"==typeof e){const n=Nt(e);if(!Q[n]||K[n])throw Wt(t),Fe("root node is forbidden and cannot be sanitized in-place")}if(ee(t))throw Wt(t),Fe("root node is clobbered and cannot be sanitized in-place");try{ve(t)}catch(e){throw Wt(t),e}}else if(oe(t))o=Vt("\x3c!----\x3e"),i=o.ownerDocument.importNode(t,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i),ve(i);else{if(!ct&&!ot&&!it&&-1===t.indexOf("<"))return _&&ht?j(t):t;if(o=Vt(t),!o)return ct?null:ht?T:""}o&&at&&Ut(o.firstChild);const a=u?t:o;try{const t=Jt(a);for(;l=t.nextNode();)le(l,a),fe(l),ne(l.content)&&pe(l.content)}catch(e){throw u&&(Wt(t),ke(n.removed,t=>{t.element&&Kt(t.element)})),e}if(u)return ke(n.removed,t=>{t.element&&Kt(t.element)}),ot&&te(t),t;if(ct){if(ot&&te(o),dt)for(s=z.call(o.ownerDocument);o.firstChild;)s.appendChild(o.firstChild);else s=o;return(W.shadowroot||W.shadowrootmode)&&(s=M.call(r,s,!0)),s}let c=it?o.outerHTML:o.innerHTML;return it&&Q["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&Be(vn,o.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+c),ot&&(c=Xt(c)),_&&ht?j(c):c},n.setConfig=function(){Zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),lt=!0,st=Q,ut=W},n.clearConfig=function(){Lt=null,lt=!1,st=null,ut=null,_=k,T=""},n.isValidAttribute=function(t,e,n){Lt||Zt({});const o=Nt(t),r=Nt(e);return se(o,r,n)},n.addHook=function(t,e){"function"==typeof e&&Ne(O,t)&&Se(O[t],e)},n.removeHook=function(t,e){if(Ne(O,t)){if(void 0!==e){const n=Te(O[t],e);return-1===n?void 0:qe(O[t],n,1)[0]}return $e(O[t])}},n.removeHooks=function(t){Ne(O,t)&&(O[t]=[])},n.removeAllHooks=function(){O={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function Tn(t,e){return t.match(/\\?.|^$/g).reduce((t,n)=>('"'!==n||t.sQuote?"'"!==n||t.quote?t.quote||t.sQuote||n!==e?t.a[t.a.length-1]+=n:t.a.push(""):(t.sQuote^=1,t.a[t.a.length-1]+=n):(t.quote^=1,t.a[t.a.length-1]+=n),t),{a:[""]}).a}function $n(t){return t.nodeType===Node.DOCUMENT_FRAGMENT_NODE||t.nodeType===Node.DOCUMENT_NODE}function Sn(t,e){const n=t.parentNode;return n&&n.host&&11===n.nodeType?n.host:n===e?null:n}const qn=e,An=function(t,e=Zt){return Ft("[Element Inference]",e,function(t=console){return{log:t.log.bind(t),warn:t.warn.bind(t),error:t.error.bind(t),debug:t.debug.bind(t)}}())}();function jn(t,e){try{const n=e.get(t);if(!Rt(n))return n;if(t.checkVisibility){const n=t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});return e.set(t,n),n}const o=qn.getComputedStyle(t);if("none"===o.display||"hidden"===o.visibility||0===parseFloat(o.opacity))return e.set(t,!1),!1;let r=t.parentElement;for(;r;){const t=e.get(r);if(!Rt(t)){if(!t)return!1;r=r.parentElement;continue}const n=qn.getComputedStyle(r),o="none"!==n.display&&"hidden"!==n.visibility;if(e.set(r,o),!o)return!1;r=r.parentElement}const i=t.getBoundingClientRect(),l=i.width>0||i.height>0||t.getClientRects().length>0;return e.set(t,l),l}catch(t){return!0}}function Cn(t,e){const n=function(t){var e;const n=null===(e=t.innerText)||void 0===e?void 0:e.trim();return!n||n.length>250?null:n}(t);return(null==n?void 0:n.toLowerCase())===e.toLowerCase()}function*En(t,e,n){let o;try{o=function(t,e=document,n=null){return function(t,e,n,o=null){t=function(t){function e(){o&&(l.length>0&&/^[~+>]$/.test(l[l.length-1])&&l.push(" "),l.push(o))}var n,o,r,i,l=[],s=[0],u=0,a=/(?:[^\\]|(?:^|[^\\])(?:\\\\)+)$/,c=/^\s+$/,d=[/\s+|\/\*|["'>~+[(]/g,/\s+|\/\*|["'[\]()]/g,/\s+|\/\*|["'[\]()]/g,null,/\*\//g];for(t=t.trim();;){if(o="",(r=d[s[s.length-1]]).lastIndex=u,!(n=r.exec(t))){o=t.substr(u),e();break}if(i=u,(u=r.lastIndex)-n[0].length>i&&(o=t.substring(i,u-n[0].length)),3>s[s.length-1]){if(e(),"["===n[0])s.push(1);else if("("===n[0])s.push(2);else if(/^["']$/.test(n[0]))s.push(3),d[3]=new RegExp(n[0],"g");else if("/*"===n[0])s.push(4);else if(/^[\])]$/.test(n[0])&&s.length>0)s.pop();else if(/^(?:\s+|[~+>])$/.test(n[0])&&(l.length>0&&!c.test(l[l.length-1])&&0===s[s.length-1]&&l.push(" "),1===s[s.length-1]&&5===l.length&&"="===l[2].charAt(l[2].length-1)&&(l[4]=" "+l[4]),c.test(n[0])))continue;l.push(n[0])}else l[l.length-1]+=o,a.test(l[l.length-1])&&(4===s[s.length-1]&&(2>l.length||c.test(l[l.length-2])?l.pop():l[l.length-1]=" ",n[0]=""),s.pop()),l[l.length-1]+=n[0]}return l.join("").trim()}(t);let r=n.querySelector(t);return document.head.createShadowRoot||document.head.attachShadow?!e&&r?r:Tn(t,",").reduce((t,r)=>{if(!e&&t)return t;const i=Tn(r.replace(/^\s+/g,"").replace(/\s*([>+~]+)\s*/g,"$1")," ").filter(t=>!!t).map(t=>Tn(t,">")),l=i.length-1,s=function(t=null,e,n=null){let o=[];if(n)o=n;else{const t=function(e){for(let n=0;e.length>n;n++){const r=e[n];o.push(r),r.shadowRoot&&t(r.shadowRoot.querySelectorAll("*"))}};e.shadowRoot&&t(e.shadowRoot.querySelectorAll("*")),t(e.querySelectorAll("*"))}return t?o.filter(e=>e.matches(t)):o}(i[l][i[l].length-1],n,o),u=function(t,e,n){return o=>{let r=e,i=o,l=!1;for(;i&&!$n(i);){let e=!0;if(1===t[r].length)e=i.matches(t[r]);else{const o=[].concat(t[r]).reverse();let l=i;for(const t of o){if(!l||!l.matches(t)){e=!1;break}l=Sn(l,n)}}if(e&&0===r){l=!0;break}e&&r--,i=Sn(i,n)}return l}}(i,l,n);return e?t=t.concat(s.filter(u)):(t=s.find(u))||null},e?[]:null):e?n.querySelectorAll(t):r}(t,!0,e,n)}(t)}catch(t){return}for(const t of o){const o=t;e&&!Cn(o,e)||jn(o,n)&&(yield o)}}function zn(t,e){let n=0;for(const o of t){if(n===e)return o;n++}return null}function In(t){try{const n=JSON.parse(t.autoData);if(!Pt(null==n?void 0:n.textGroups)||!Pt(null==n?void 0:n.notextGroups))return An.error("Invalid autoData structure:",n),null;const{text:o,excludeText:r,precision:i=1}=t,l=null!=o&&!r,s=(l?n.textGroups:n.notextGroups).sort((t,e)=>t.cardinality-e.cardinality);if(0===s.length)return null;const u=Math.max(1,Math.ceil((1-i)*s.length)),a=new WeakMap;for(let t=0;u>t;t++){const n=s[t],r=new Map;let i=null,u=0;for(const{css:t,offset:s}of n.cssSelectors){var e;const c=zn(En(t,l?o:null,a),s);if(!c)continue;const d=(null!==(e=r.get(c))&&void 0!==e?e:0)+1;if(r.set(c,d),d>u&&(u=d,i=c,d>=Math.ceil(n.cssSelectors.length/2)))return i}if(i)return i}return null}catch(t){return An.error("Error finding element:",t),null}}const Mn=(t,{debugEnabled:e}={})=>{const n={N(n,...o){let r;try{r=typeof window>"u"?void 0:window}catch(t){return}r&&(r.POSTHOG_DEBUG||e)&&!Rt(r.console)&&r.console&&("__rrweb_original__"in r.console[n]?r.console[n].__rrweb_original__:r.console[n])(t,...o)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>Mn(`${t} ${e}`,n)};return n},On=Mn("[PostHog.js]"),Pn=On.createLogger,Dn=Pn("[Stylesheet Loader]");const Rn=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},Nn=t=>t.toLowerCase(),Ln={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Rn(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Rn(e,t))),icontains:(t,e)=>e.map(Nn).some(e=>t.map(Nn).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Nn).every(e=>t.map(Nn).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})};function Bn(t,e){return!t||Object.entries(t).every(([t,n])=>{const o=null==e?void 0:e[t];if(null==o)return!1;const r=Ln[n.operator];return!!r&&r(n.values.map(String),[String(o)])})}var Fn,Zn,Hn,Qn,Un=0,Wn=[],Yn=i,Gn=Yn.__b,Kn=Yn.__r,Vn=Yn.diffed,Jn=Yn.__c,Xn=Yn.unmount,to=Yn.__;function eo(t,e){Yn.__h&&Yn.__h(Zn,t,Un||e),Un=0;var n=Zn.__H||(Zn.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function no(t){return Un=1,function(t,e){var n=eo(Fn++,2);if(n.t=t,!n.__c&&(n.__=[po(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],o=n.t(e,t);e!==o&&(n.__N=[o,n.__[1]],n.__c.setState({}))}],n.__c=Zn,!Zn.__f)){var o=function(t,e,o){if(!n.__c.__H)return!0;var i=!1,l=n.__c.props!==t;if(n.__c.__H.__.some(function(t){if(t.__N){i=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(l=!0)}}),r){var s=r.call(this,t,e,o);return i?s||l:s}return!i||l};Zn.__f=!0;var r=Zn.shouldComponentUpdate,i=Zn.componentWillUpdate;Zn.componentWillUpdate=function(t,e,n){if(this.__e){var l=r;r=void 0,o(t,e,n),r=l}i&&i.call(this,t,e,n)},Zn.shouldComponentUpdate=o}return n.__N||n.__}(po,t)}function oo(t,e){var n=eo(Fn++,3);!Yn.__s&&fo(n.__H,e)&&(n.__=t,n.u=e,Zn.__H.__h.push(n))}function ro(t,e){var n=eo(Fn++,4);!Yn.__s&&fo(n.__H,e)&&(n.__=t,n.u=e,Zn.__h.push(n))}function io(t){return Un=5,lo(function(){return{current:t}},[])}function lo(t,e){var n=eo(Fn++,7);return fo(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function so(){for(var t;t=Wn.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(co),e.__h.some(ho),e.__h=[]}catch(n){e.__h=[],Yn.__e(n,t.__v)}}}Yn.__b=function(t){Zn=null,Gn&&Gn(t)},Yn.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),to&&to(t,e)},Yn.__r=function(t){Kn&&Kn(t),Fn=0;var e=(Zn=t.__c).__H;e&&(Hn===Zn?(e.__h=[],Zn.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&so(),Fn=0)),Hn=Zn},Yn.diffed=function(t){Vn&&Vn(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Wn.push(e)&&Qn===Yn.requestAnimationFrame||((Qn=Yn.requestAnimationFrame)||ao)(so)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Hn=Zn=null},Yn.__c=function(t,e){e.some(function(t){try{t.__h.some(co),t.__h=t.__h.filter(function(t){return!t.__||ho(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Yn.__e(n,t.__v)}}),Jn&&Jn(t,e)},Yn.unmount=function(t){Xn&&Xn(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{co(t)}catch(t){e=t}}),n.__H=void 0,e&&Yn.__e(e,n.__v))};var uo="function"==typeof requestAnimationFrame;function ao(t){var e,n=function(){clearTimeout(o),uo&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);uo&&(e=requestAnimationFrame(n))}function co(t){var e=Zn,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Zn=e}function ho(t){var e=Zn;t.__c=t.__(),Zn=e}function fo(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function po(t,e){return"function"==typeof e?e(t):e}const vo="#020617";function mo(t){if(t.startsWith("#")){let e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?`rgb(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function go(t="#eeeded"){let e;"#"===t[0]&&(e=mo(t)),t.startsWith("rgb")&&(e=t);const n={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"}[t.toLowerCase()];if(n&&(e=mo(n)),!e)return vo;const o=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(o){const t=parseInt(o[1]),e=parseInt(o[2]),n=parseInt(o[3]);return Math.sqrt(t*t*.299+e*e*.587+n*n*.114)>127.5?vo:"white"}return vo}function bo(t,e,n,o){const{capture:r=!1,passive:i=!0}=null!=o?o:{};null==t||t.addEventListener(e,n,{capture:r,passive:i})}String(2147483645),function(t){function e(t){var n,o;return this.getChildContext||(n=new Set,(o={})[e.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,E(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}e.__c="__cC"+b++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null});let yo=null;const wo={$t(){if(!Nt(yo))return yo;let t=!0;if(Rt(e))t=!1;else try{const e="__mplssupport__";wo.At(e,"xyz"),'"xyz"'!==wo.Ot(e)&&(t=!1),wo.Pt(e)}catch(e){t=!1}return t||On.error("localStorage unsupported; falling back to cookie store"),yo=t,t},Ft(t){On.error("localStorage error: "+t)},Ot(t){try{return null==e?void 0:e.localStorage.getItem(t)}catch(t){wo.Ft(t)}return null},Lt(t){try{return JSON.parse(wo.Ot(t))||{}}catch(t){}return null},At(t,n){try{return null==e||e.localStorage.setItem(t,JSON.stringify(n)),!0}catch(t){wo.Ft(t)}return!1},Pt(t){try{null==e||e.localStorage.removeItem(t)}catch(t){wo.Ft(t)}}};let xo=null;const _o={$t(){if(!Nt(xo))return xo;if(xo=!0,Rt(e))xo=!1;else try{const t="__support__";_o.At(t,"xyz"),'"xyz"'!==_o.Ot(t)&&(xo=!1),_o.Pt(t)}catch(t){xo=!1}return xo},Ft(t){On.error("sessionStorage error: ",t)},Ot(t){try{return null==e?void 0:e.sessionStorage.getItem(t)}catch(t){_o.Ft(t)}return null},Lt(t){try{return JSON.parse(_o.Ot(t))||null}catch(t){}return null},At(t,n){try{return null==e||e.sessionStorage.setItem(t,JSON.stringify(n)),!0}catch(t){_o.Ft(t)}return!1},Pt(t){try{null==e||e.sessionStorage.removeItem(t)}catch(t){_o.Ft(t)}}},ko="ph_product_tour_shown_",To="ph_product_tour_completed_",$o="ph_product_tour_dismissed_",So="ph_active_product_tour",qo="ph_last_seen_tour_date_",Ao=Pn("[Product Tours]"),jo=o,Co=e;function Eo(t){const e=((t,e,n)=>{let o=t.createElement("style");o.innerText=e;const r=(t=>{var e;return Dt(t)?t:null==t||null===(e=t.config)||void 0===e?void 0:e.prepare_external_dependency_stylesheet})(n);return r&&(o=r(o)),o||(Dn.error("prepare_external_dependency_stylesheet returned null"),null)})(jo,':host{--ph-tour-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-tour-background-color:#fff;--ph-tour-text-color:#1d1f27;--ph-tour-text-secondary-color:#6b7280;--ph-tour-button-color:#1d1f27;--ph-tour-button-text-color:#fff;--ph-tour-button-secondary-color:transparent;--ph-tour-button-secondary-text-color:#1d1f27;--ph-tour-border-color:#e5e7eb;--ph-tour-border-radius:8px;--ph-tour-button-border-radius:6px;--ph-tour-box-shadow:0 4px 12px #00000026;--ph-tour-max-width:320px;--ph-tour-padding:16px;--ph-tour-z-index:calc(2147480000 + 3646);--ph-tour-overlay-color:#00000080;--ph-tour-spotlight-padding:8px;--ph-tour-spotlight-border-radius:4px;--ph-tour-arrow-size:8px}.ph-tour-container *{box-sizing:border-box;font-family:var(--ph-tour-font-family);margin:0;padding:0}.ph-tour-click-overlay{z-index:var(--ph-tour-z-index);pointer-events:auto;position:fixed;inset:0}.ph-tour-spotlight{z-index:var(--ph-tour-z-index);border-radius:var(--ph-tour-spotlight-border-radius);box-shadow:0 0 0 9999px var(--ph-tour-overlay-color);pointer-events:none;position:fixed}.ph-tour-modal-overlay{z-index:var(--ph-tour-z-index);background:var(--ph-tour-overlay-color);pointer-events:none;position:fixed;inset:0}.ph-tour-tooltip{z-index:calc(var(--ph-tour-z-index) + 1);background:var(--ph-tour-background-color);border:1px solid var(--ph-tour-border-color);border-radius:var(--ph-tour-border-radius);box-shadow:var(--ph-tour-box-shadow);min-width:min(280px,100vw - 16px);max-width:min(var(--ph-tour-max-width), calc(100vw - 16px));padding:var(--ph-tour-padding);padding-top:calc(var(--ph-tour-padding) + 8px);pointer-events:auto;position:fixed}.ph-tour-tooltip--modal{box-shadow:var(--ph-tour-box-shadow)}.ph-tour-arrow{--ph-tour-arrow-offset:0px;border:var(--ph-tour-arrow-size) solid transparent;width:0;height:0;position:absolute}.ph-tour-arrow--top{bottom:100%;left:calc(50% + var(--ph-tour-arrow-offset));border-bottom-color:var(--ph-tour-background-color);transform:translate(-50%)}.ph-tour-arrow--bottom{top:100%;left:calc(50% + var(--ph-tour-arrow-offset));border-top-color:var(--ph-tour-background-color);transform:translate(-50%)}.ph-tour-arrow--left{right:100%;top:calc(50% + var(--ph-tour-arrow-offset));border-right-color:var(--ph-tour-background-color);transform:translateY(-50%)}.ph-tour-arrow--right{left:100%;top:calc(50% + var(--ph-tour-arrow-offset));border-left-color:var(--ph-tour-background-color);transform:translateY(-50%)}.ph-tour-content{color:var(--ph-tour-text-color);margin-bottom:16px;padding-right:24px;font-size:14px;line-height:1.5}.ph-tour-content h1,.ph-tour-content h2{margin-bottom:8px;font-weight:600}.ph-tour-content h1{font-size:18px}.ph-tour-content h2{font-size:16px}.ph-tour-content p{margin-bottom:8px}.ph-tour-content p:last-child{margin-bottom:0}.ph-tour-content strong{font-weight:600}.ph-tour-content em{font-style:italic}.ph-tour-content ul,.ph-tour-content ol{margin-bottom:8px;margin-left:20px}.ph-tour-content h3{margin-bottom:8px;font-size:14px;font-weight:600}.ph-tour-content a,.ph-tour-content .ph-tour-link{color:inherit;text-decoration:underline}.ph-tour-content a:hover{opacity:.8}.ph-tour-content code{background:#0000000f;border-radius:4px;padding:2px 6px;font-family:SF Mono,Monaco,Consolas,monospace;font-size:.875em}.ph-tour-content pre{background:#0000000a;border-radius:6px;margin-bottom:8px;padding:12px;font-family:SF Mono,Monaco,Consolas,monospace;font-size:13px;line-height:1.5;overflow-x:auto}.ph-tour-content pre code{font-size:inherit;background:0 0;border-radius:0;padding:0}.ph-tour-content pre *,.ph-tour-content code *{font-family:inherit}.ph-tour-content .hljs-comment,.ph-tour-content .hljs-quote{color:#6a737d;font-style:italic}.ph-tour-content .hljs-keyword,.ph-tour-content .hljs-selector-tag{color:#d73a49}.ph-tour-content .hljs-string,.ph-tour-content .hljs-doctag,.ph-tour-content .hljs-regexp{color:#032f62}.ph-tour-content .hljs-number,.ph-tour-content .hljs-literal,.ph-tour-content .hljs-variable,.ph-tour-content .hljs-template-variable{color:#005cc5}.ph-tour-content .hljs-title,.ph-tour-content .hljs-section,.ph-tour-content .hljs-selector-id,.ph-tour-content .hljs-selector-class,.ph-tour-content .hljs-title.function_{color:#6f42c1}.ph-tour-content .hljs-name,.ph-tour-content .hljs-attribute,.ph-tour-content .hljs-attr,.ph-tour-content .hljs-symbol,.ph-tour-content .hljs-bullet,.ph-tour-content .hljs-built_in,.ph-tour-content .hljs-addition{color:#22863a}.ph-tour-content .hljs-subst,.ph-tour-content .hljs-deletion{color:#b31d28}.ph-tour-content .hljs-meta{color:#032f62}.ph-tour-content .hljs-emphasis{font-style:italic}.ph-tour-content .hljs-strong{font-weight:700}.ph-tour-content img,.ph-tour-content .ph-tour-image{border-radius:6px;max-width:100%;height:auto;margin:8px 0;display:block}.ph-tour-content .ph-tour-embed{margin:8px 0}.ph-tour-content .ph-tour-embed-container{background:#000;border-radius:6px;width:100%;padding-bottom:56.25%;position:relative;overflow:hidden}.ph-tour-content .ph-tour-embed-container iframe{border:none;width:100%;height:100%;position:absolute;top:0;left:0}.ph-tour-content blockquote{border-left:3px solid var(--ph-tour-border-color);color:var(--ph-tour-text-secondary-color);margin:8px 0;padding-left:12px;font-style:italic}.ph-tour-footer{justify-content:space-between;align-items:center;gap:12px;display:flex}.ph-tour-progress{color:var(--ph-tour-text-secondary-color);font-size:12px}.ph-tour-buttons{gap:8px;margin-left:auto;display:flex}.ph-tour-button{border-radius:var(--ph-tour-button-border-radius);cursor:pointer;border:none;justify-content:center;align-items:center;padding:8px 16px;font-size:14px;font-weight:500;text-decoration:none;transition:opacity .15s,transform .1s;display:inline-flex}.ph-tour-button:hover{opacity:.9}.ph-tour-button:active{transform:scale(.98)}.ph-tour-button--primary{background:var(--ph-tour-button-color);color:var(--ph-tour-button-text-color)}.ph-tour-button--secondary{background:var(--ph-tour-button-secondary-color);color:var(--ph-tour-button-secondary-text-color);border:1px solid var(--ph-tour-border-color)}.ph-tour-dismiss{cursor:pointer;width:24px;height:24px;color:var(--ph-tour-text-secondary-color);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;font-size:18px;line-height:1;transition:background .15s,color .15s;display:flex;position:absolute;top:8px;right:8px}.ph-tour-dismiss:hover{color:var(--ph-tour-text-color);background:#00000014}.ph-tour-branding{border-top:1px solid var(--ph-tour-border-color);color:var(--ph-tour-branding-text-color,var(--ph-tour-text-secondary-color));justify-content:center;align-items:center;gap:6px;margin-top:12px;padding-top:12px;font-size:11px;text-decoration:none;display:flex}.ph-tour-branding:hover{color:var(--ph-tour-branding-text-color,var(--ph-tour-text-color))}.ph-tour-branding svg{width:auto;height:14px}.ph-tour-hidden{display:none!important}.ph-tour-survey-step{min-width:min(300px,100vw - 16px)}.ph-tour-survey-question{color:var(--ph-tour-text-color);margin-bottom:16px;padding-right:24px;font-size:15px;font-weight:500;line-height:1.4}.ph-tour-survey-input-container{flex-direction:column;gap:12px;display:flex}.ph-tour-survey-textarea{border:1px solid var(--ph-tour-border-color);width:100%;font-size:14px;font-family:var(--ph-tour-font-family);color:var(--ph-tour-text-color);resize:vertical;box-sizing:border-box;background:#fff;border-radius:6px;min-height:80px;padding:10px 12px}.ph-tour-survey-textarea:focus{border-color:var(--ph-tour-button-color);outline:none;box-shadow:0 0 0 2px #0000000d}.ph-tour-survey-textarea::placeholder{color:var(--ph-tour-text-secondary-color)}.ph-tour-survey-submit{align-self:flex-end}.ph-tour-survey-rating-container{flex-direction:column;gap:8px;margin-bottom:8px;display:flex}.ph-tour-survey-rating-labels{color:var(--ph-tour-text-secondary-color);justify-content:space-between;font-size:11px;display:flex}.ph-tour-survey-rating-emoji{justify-content:center;gap:8px;display:flex}.ph-tour-survey-emoji-button{border:2px solid var(--ph-tour-border-color);background:var(--ph-tour-background-color);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:all .15s;display:flex}.ph-tour-survey-emoji-button:hover{border-color:var(--ph-tour-button-color);background:#00000005}.ph-tour-survey-emoji-button--active{border-color:var(--ph-tour-button-color);background:var(--ph-tour-button-color)}.ph-tour-survey-emoji-button--active svg{fill:var(--ph-tour-button-text-color)}.ph-tour-survey-emoji-button svg{width:28px;height:28px;fill:var(--ph-tour-text-color);transition:fill .15s}.ph-tour-survey-rating-numbers{gap:6px;display:grid}.ph-tour-survey-number-button{border:1px solid var(--ph-tour-border-color);background:var(--ph-tour-background-color);font-size:13px;font-weight:500;font-family:var(--ph-tour-font-family);color:var(--ph-tour-text-color);cursor:pointer;border-radius:4px;justify-content:center;align-items:center;padding:8px 4px;transition:all .15s;display:flex}.ph-tour-survey-number-button:hover{border-color:var(--ph-tour-button-color);background:#00000005}.ph-tour-survey-number-button--active{border-color:var(--ph-tour-button-color);background:var(--ph-tour-button-color);color:var(--ph-tour-button-text-color)}@keyframes ph-tour-banner-slide-in{0%{grid-template-rows:0fr}to{grid-template-rows:1fr}}.ph-tour-banner-wrapper{animation:ph-tour-banner-slide-in var(--ph-tour-banner-animation-duration,.3s) ease-out forwards;display:grid}.ph-tour-banner-slide{min-height:0;overflow:hidden}.ph-tour-banner{background:var(--ph-tour-background-color);border-bottom:1px solid var(--ph-tour-border-color);box-shadow:var(--ph-tour-box-shadow);font-family:var(--ph-tour-font-family);justify-content:center;align-items:center;gap:16px;padding:12px 16px;display:flex}a.ph-tour-banner{color:inherit;text-decoration:none}:host:has(.ph-tour-banner--sticky){z-index:var(--ph-tour-z-index);position:sticky;top:0}.ph-tour-banner-content{min-width:0;color:var(--ph-tour-text-color);text-align:center;flex:1;font-size:14px;line-height:1.5}.ph-tour-banner-content p{margin:0}.ph-tour-banner-content strong{font-weight:600}.ph-tour-banner-content em{font-style:italic}.ph-tour-banner-content a{color:inherit;text-decoration:underline}.ph-tour-banner-dismiss{cursor:pointer;width:24px;height:24px;color:var(--ph-tour-text-secondary-color);background:0 0;border:none;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;transition:background .15s,color .15s;display:flex}.ph-tour-banner-dismiss:hover{color:var(--ph-tour-text-color);background:#00000014}',t);return null==e||e.setAttribute("data-ph-product-tour-style","true"),e}function zo(t){return t.useManualSelector?!!t.selector:!!t.inferenceData}function Io(t){var e;if(null!==(e=t.useManualSelector)&&void 0!==e&&e)return t.selector?function(t){try{const e=jo.querySelectorAll(t);if(0===e.length)return{element:null,error:"not_found",matchCount:0};const n=e[0];return function(t){const e=Co.getComputedStyle(t);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height}(n)?e.length>1?{element:n,error:"multiple_matches",matchCount:e.length}:{element:n,error:null,matchCount:1}:{element:null,error:"not_visible",matchCount:e.length}}catch(t){return{element:null,error:"not_found",matchCount:0}}}(t.selector):{element:null,error:"not_found",matchCount:0};if(!t.inferenceData)return{element:null,error:"not_found",matchCount:0};const n=In(t.inferenceData);return n?{element:n,error:null,matchCount:1}:{element:null,error:"not_found",matchCount:0}}const Mo=12;function Oo(t,e,n){const o=Math.max(8+e/2,Math.min(n-8-e/2,t));return{clamped:o,offset:t-o}}function Po(t,e){const n=ae(ae({},G),e),o=t.style;o.setProperty("--ph-tour-background-color",n.backgroundColor),o.setProperty("--ph-tour-text-color",n.textColor),o.setProperty("--ph-tour-button-color",n.buttonColor),o.setProperty("--ph-tour-border-radius",`${n.borderRadius}px`),o.setProperty("--ph-tour-button-border-radius",`${n.buttonBorderRadius}px`),o.setProperty("--ph-tour-border-color",n.borderColor),o.setProperty("--ph-tour-font-family",function(t){if("inherit"===t)return"inherit";const e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?`${t}, ${e}`:`-apple-system, ${e}`}(n.fontFamily)),o.setProperty("--ph-tour-text-secondary-color",function(t){const e=mo(t).match(/^rgb\((\d+),(\d+),(\d+)\)$/);return e?`rgba(${e[1]}, ${e[2]}, ${e[3]}, 0.6)`:t}(n.textColor)),o.setProperty("--ph-tour-branding-text-color",go(n.backgroundColor)),o.setProperty("--ph-tour-button-text-color",go(n.buttonColor)),o.setProperty("--ph-tour-box-shadow",n.boxShadow),o.setProperty("--ph-tour-overlay-color",n.showOverlay?"rgba(0, 0, 0, 0.5)":"transparent"),o.setProperty("--ph-tour-z-index",String(n.zIndex)),o.setProperty("--ph-tour-button-secondary-color","transparent"),o.setProperty("--ph-tour-button-secondary-text-color",n.textColor),o.setProperty("--ph-tour-max-width","320px"),o.setProperty("--ph-tour-padding","16px")}function Do(t){var e;if(!t)return"";if("string"==typeof t)return No(t);if("text"===t.type){let e=No(t.text||"");if(t.marks)for(const n of t.marks)switch(n.type){case"bold":e=`<strong>${e}</strong>`;break;case"italic":e=`<em>${e}</em>`;break;case"underline":e=`<u>${e}</u>`;break;case"strike":e=`<s>${e}</s>`}return e}const n=(null===(e=t.content)||void 0===e?void 0:e.map(Do).join(""))||"";switch(t.type){case"doc":default:return n;case"paragraph":return`<p>${n}</p>`;case"heading":{var o;const e=(null===(o=t.attrs)||void 0===o?void 0:o.level)||1;return`<h${e}>${n}</h${e}>`}case"bulletList":return`<ul>${n}</ul>`;case"orderedList":return`<ol>${n}</ol>`;case"listItem":return`<li>${n}</li>`;case"hardBreak":return"<br>"}}function Ro(t){return t.endsWith("/")?t.slice(0,-1):t}function No(t){const e=jo.createElement("div");return e.textContent=t,e.innerHTML}function Lo(t){const e=[];return t.content&&function t(n){var o,r;"image"===n.type&&(null===(o=n.attrs)||void 0===o?void 0:o.src)&&e.push(n.attrs.src),null===(r=n.content)||void 0===r||r.forEach(t)}(t.content),e}function Bo(t){const e=t.contentHtml||Do(t.content);return kn.sanitize(e,{ADD_TAGS:["iframe"],ADD_ATTR:["allowfullscreen","frameborder","referrerpolicy"]})}var Fo=0;function Zo(t,e,n,o,r,l){e||(e={});var s,u,a=e;if("ref"in a)for(u in a={},e)"ref"==u?s=e[u]:a[u]=e[u];var c={type:t,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fo,__i:-1,__u:0,__source:r,__self:l};if("function"==typeof t&&(s=t.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return i.vnode&&i.vnode(c),c}const Ho=Zo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zo("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"})}),Qo=Zo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zo("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"})}),Uo=Zo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zo("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"})}),Wo=Zo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zo("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"})}),Yo=Zo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zo("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"})}),Go=({fill:t="currentColor"}={})=>Zo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Zo("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Zo("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:t})]}),Ko=Zo("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Zo("g",{"clip-path":"url(#ph-survey-logo-clip)",children:[Zo("path",{fill:"currentColor",d:"m50 23.34-.35-.05A4.5 4.5 0 0 1 47 21.97L35.56 10.1c-.3-.33-.86-.1-.86.35V27.5c0 .27.22.5.5.5h13.78c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.67-1.89zm-10.81.2a1.8 1.8 0 1 1 0-3.58 1.8 1.8 0 0 1 0 3.58"}),Zo("path",{fill:"#0054ff",d:"M.87 19.13a.5.5 0 0 0-.87.34v5.94a2.6 2.6 0 0 0 2.59 2.58H7.8a.5.5 0 0 0 .37-.84zM.86 8.4c-.3-.32-.86-.1-.86.36v6.73q0 .2.13.34l8.81 9.68 1.8 2.06v-8.82zM4.59.82A2.67 2.67 0 0 0 0 2.68v1.93q0 .4.27.69l10.47 10.95v-9.1z"}),Zo("path",{fill:"#ff5506",d:"M11.36 28h7.08a.5.5 0 0 0 .36-.85l-8.05-8.4v8.8l.23.28q.16.17.38.17m-.61-11.76 8.84 9.25 2.1 2.33q.1.11.27.14V18.7L10.75 7.15zm0-13.7v1.41a2 2 0 0 0 .55 1.28L21.96 16.2V7.65L15.32.8a2.67 2.67 0 0 0-4.57 1.71z"}),Zo("path",{fill:"#ffb70f",d:"M22.06 28h7.76a.5.5 0 0 0 .36-.86l-8.22-8.45v9.27l.09.02zM31 25.49l1.13 1.14c.32.31.85.09.85-.35v-7.3l-.49-.51L21.96 7.64v8.55zM22.52 5.73l9.62 9.89c.3.32.86.1.86-.35V7.46L26.56.82a2.67 2.67 0 0 0-4.59 1.84v1.7c0 .51.2 1 .57 1.37z"})]}),Zo("path",{fill:"currentColor",d:"M64.9 22.88c-.67 0-1.23-.56-1.23-1.24V5.24c0-.69.56-1.24 1.24-1.24h6.55c3.89 0 6.39 2.32 6.39 5.9 0 3.6-2.5 5.91-6.4 5.91h-3.53v5.83c0 .68-.56 1.24-1.24 1.24zm3.02-11.94c0 .68.55 1.23 1.23 1.23h1.88c1.6 0 2.58-.86 2.58-2.26s-.97-2.27-2.58-2.27h-1.88c-.68 0-1.23.55-1.23 1.23zM84.71 23.1c-4.18 0-7.14-2.97-7.14-7.02s2.96-7.01 7.14-7.01c4.14 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.3 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m16.34 7.03a6.2 6.2 0 0 1-5.54-3.01c-.34-.57-.01-1.26.6-1.5l.77-.3c.7-.27 1.45.15 1.92.73a2.8 2.8 0 0 0 2.25 1.08c1.05 0 1.75-.51 1.75-1.27 0-2.13-7.17-.7-7.17-5.85 0-2.13 1.85-3.91 4.83-3.91 2.27 0 4.2.9 5.17 2.31.36.53.05 1.2-.54 1.44l-.85.35c-.68.29-1.45-.14-2-.63a2.5 2.5 0 0 0-1.64-.64c-.89 0-1.5.38-1.5.97 0 2.16 7.27.38 7.27 5.88 0 2.35-2.15 4.34-5.32 4.34m14.64-1.31c.04.57-.3 1.1-.86 1.2q-.6.1-1.27.11c-2.92 0-5.15-1.56-5.15-4.85v-5.66h-.91c-.69 0-1.24-.56-1.24-1.24v-.82c0-.68.55-1.23 1.24-1.23h.91v-2.7c0-.69.55-1.24 1.23-1.24h1.48c.68 0 1.24.55 1.24 1.23v2.7h2.04c.68 0 1.23.56 1.23 1.24v.82c0 .68-.55 1.24-1.23 1.24h-2.04v5.15c0 1.2.64 1.91 1.6 1.91.75 0 1.6.5 1.66 1.25zM125.5 5.23c0-.68.55-1.23 1.23-1.23h1.8c.68 0 1.23.55 1.23 1.23v16.41c0 .68-.55 1.24-1.23 1.24h-1.8c-.68 0-1.23-.56-1.23-1.24v-5.43c0-.68-.56-1.23-1.24-1.23h-5c-.67 0-1.23.55-1.23 1.23v5.43c0 .68-.55 1.24-1.23 1.24h-1.77c-.69 0-1.24-.56-1.24-1.24V5.24c0-.69.55-1.24 1.24-1.24h1.77c.68 0 1.23.55 1.23 1.23v4.87c0 .68.56 1.23 1.24 1.23h5c.67 0 1.23-.55 1.23-1.23zm12.87 17.87c-4.19 0-7.14-2.97-7.14-7.02s2.95-7.01 7.14-7.01c4.13 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.29 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m17.17 6.37c-3.84 0-6.2-2.58-6.2-6.68s2.36-6.69 6.12-6.69c1.58 0 2.82.54 3.54 1.37 0-.64.52-1.15 1.16-1.15h1.5c.68 0 1.24.55 1.24 1.23V21.9c0 3.64-2.77 6.09-6.93 6.09-2.64 0-4.9-1.2-5.85-3.09-.31-.62.16-1.29.85-1.4l1.14-.17c.67-.11 1.29.4 1.78.85.5.46 1.26.7 2.08.7 1.85 0 3.06-1.04 3.06-2.55v-1.3c-.7.9-2.01 1.4-3.49 1.4m-2.36-6.68c0 2.02 1.18 3.31 3 3.31 1.86 0 3.04-1.29 3.04-3.31s-1.18-3.32-3.03-3.32c-1.83 0-3.01 1.3-3.01 3.32"}),Zo("defs",{children:Zo("clipPath",{id:"ph-survey-logo-clip",children:Zo("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})})]});function Vo({button:t,variant:e,onClick:n,cursorStyle:o}){const r=`ph-tour-button ph-tour-button--${e}`;return"link"===t.action&&t.link?Zo("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",class:r,onClick:()=>n(t),children:t.text}):Zo("button",{class:r,onClick:()=>n(t),style:o,children:t.text})}function Jo({step:t,appearance:e,stepIndex:n,totalSteps:o,onNext:r,onPrevious:i,onDismiss:l,onButtonClick:s}){var u,a,c;const d=null!==(u=null==e?void 0:e.whiteLabel)&&void 0!==u&&u,h=n>=o-1,f=0===n,p=!(t.buttons||"button"!==t.progressionTrigger&&zo(t)),v=!!t.buttons,m=!!(r||i||l||s),g=m?void 0:{cursor:"default"},b=!d&&f,y=t=>{s&&s(t)};return Zo(q,{children:[Zo("button",{class:"ph-tour-dismiss",onClick:l,"aria-label":"Close tour",style:g,children:Go()}),Zo("div",{class:"ph-tour-content",dangerouslySetInnerHTML:{__html:Bo(t)}}),Zo("div",{class:"ph-tour-footer",children:[o>1&&Zo("span",{class:"ph-tour-progress",children:[n+1," of ",o]}),Zo("div",{class:"ph-tour-buttons",children:[p&&Zo(q,{children:[!f&&Zo("button",{class:"ph-tour-button ph-tour-button--secondary",onClick:i,style:g,children:"Back"}),Zo("button",{class:"ph-tour-button ph-tour-button--primary",onClick:r,style:g,children:h?"Done":"Next"})]}),v&&Zo(q,{children:[(null===(a=t.buttons)||void 0===a?void 0:a.secondary)&&Zo(Vo,{button:t.buttons.secondary,variant:"secondary",onClick:y,cursorStyle:g}),(null===(c=t.buttons)||void 0===c?void 0:c.primary)&&Zo(Vo,{button:t.buttons.primary,variant:"primary",onClick:y,cursorStyle:g})]})]})]}),b&&Zo("a",{href:m?"https://posthog.com/docs/product-tours":void 0,target:m?"_blank":void 0,rel:m?"noopener noreferrer":void 0,class:"ph-tour-branding",style:m?void 0:{cursor:"default",pointerEvents:"none"},children:["Tour by ",Ko]})]})}const Xo=[Uo,Qo,Ho],tr=[Wo,Uo,Qo,Ho,Yo];function er({value:t,onChange:e,onSubmit:n,isInteractive:o}){const r=io(null);return oo(()=>{o&&setTimeout(()=>{var t;return null===(t=r.current)||void 0===t?void 0:t.focus()},100)},[o]),Zo("textarea",{ref:r,class:"ph-tour-survey-textarea",rows:3,placeholder:"Your feedback (optional)...",value:t,onInput:t=>e(t.target.value),onKeyDown(t){"Enter"===t.key&&t.metaKey&&o&&(t.preventDefault(),null==n||n())},disabled:!o,style:o?void 0:{cursor:"default"}})}function nr({survey:t,onSubmit:e,isInteractive:n}){const[o,r]=no(null),i=t.scale||5,l=t=>{n&&(r(t),null==e||e(t))};if("emoji"===(t.display||"emoji"))return Zo("div",{class:"ph-tour-survey-rating-container",children:[Zo("div",{class:"ph-tour-survey-rating-emoji",children:(3===i?Xo:tr).map((t,e)=>{const r=e+1;return Zo("button",{type:"button",class:"ph-tour-survey-emoji-button "+(o===r?"ph-tour-survey-emoji-button--active":""),onClick:()=>l(r),style:n?void 0:{cursor:"default"},"aria-label":`Rate ${r}`,children:t},e)})}),(t.lowerBoundLabel||t.upperBoundLabel)&&Zo("div",{class:"ph-tour-survey-rating-labels",children:[Zo("span",{children:t.lowerBoundLabel}),Zo("span",{children:t.upperBoundLabel})]})]});const s=function(t){switch(t){case 5:default:return[1,2,3,4,5];case 10:return[0,1,2,3,4,5,6,7,8,9,10]}}(i);return Zo("div",{class:"ph-tour-survey-rating-container",children:[Zo("div",{class:"ph-tour-survey-rating-numbers",style:{gridTemplateColumns:`repeat(${s.length}, minmax(0, 1fr))`},children:s.map(t=>Zo("button",{type:"button",class:"ph-tour-survey-number-button "+(o===t?"ph-tour-survey-number-button--active":""),onClick:()=>l(t),style:n?void 0:{cursor:"default"},"aria-label":`Rate ${t}`,children:t},t))}),(t.lowerBoundLabel||t.upperBoundLabel)&&Zo("div",{class:"ph-tour-survey-rating-labels",children:[Zo("span",{children:t.lowerBoundLabel}),Zo("span",{children:t.upperBoundLabel})]})]})}function or({step:t,appearance:e,stepIndex:n,totalSteps:o,onPrevious:r,onSubmit:i,onDismiss:l}){var s;const[u,a]=no(""),c=t.survey,d=null!==(s=null==e?void 0:e.whiteLabel)&&void 0!==s&&s,h=0===n,f="open"===(null==c?void 0:c.type),p=!!(r||i||l),v=p?void 0:{cursor:"default"},m=()=>{null==i||i(u.trim()||null)};return c?Zo(q,{children:[Zo("button",{class:"ph-tour-dismiss",onClick:l,"aria-label":"Close survey",style:v,children:Go()}),Zo("div",{class:"ph-tour-survey-question",children:c.questionText}),f?Zo(er,{value:u,onChange:a,onSubmit:m,isInteractive:p}):Zo(nr,{survey:c,onSubmit:i,isInteractive:p}),Zo("div",{class:"ph-tour-footer",children:[Zo("span",{class:"ph-tour-progress",children:[n+1," of ",o]}),Zo("div",{class:"ph-tour-buttons",children:[!h&&Zo("button",{class:"ph-tour-button ph-tour-button--secondary",onClick:r,style:v,children:c.backButtonText||"Back"}),f&&Zo("button",{class:"ph-tour-button ph-tour-button--primary",onClick:m,style:v,children:c.submitButtonText||"Submit"})]})]}),!d&&Zo("a",{href:p?"https://posthog.com/product-tours":void 0,target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,class:"ph-tour-branding",style:p?void 0:{cursor:"default",pointerEvents:"none"},children:["Survey by ",Ko]})]}):Zo("div",{})}const rr=e;function ir(t){return{top:"bottom",bottom:"top",left:"right",right:"left"}[t]}function lr({tour:t,step:e,stepIndex:n,totalSteps:o,targetElement:r,onNext:i,onPrevious:l,onDismiss:s,onSurveySubmit:u,onButtonClick:a}){var c;const[d,h]=no("entering"),[f,p]=no(null),[v,m]=no(null),[g,b]=no(!1),[y,w]=no(e),[x,_]=no(n),k=io(null),T=io(n),S=io(!1),q=io(r),A=!zo(y)||"survey"===y.type;ro(()=>{q.current=r},[r]);const j=function(t){return Un=8,lo(function(){return t},[])}(()=>{const t=q.current;if(!t||!k.current)return;const e=k.current.getBoundingClientRect(),n={width:e.width,height:e.height},o=t.getBoundingClientRect();p(function(t,e){const n=Co.innerWidth,o=Co.innerHeight,{width:r,height:i}=e,l=t.top,s=o-t.bottom,u=t.left,a=t.top+t.height/2,c=t.left+t.width/2;if(n-t.right>=r+Mo){const e=t.right+Mo,{clamped:n,offset:r}=Oo(a,i,o);return{position:"right",top:n,left:e,arrowOffset:r}}if(u>=r+Mo){const e=n-t.left+Mo,{clamped:r,offset:l}=Oo(a,i,o);return{position:"left",top:r,right:e,arrowOffset:l}}if(l>=i+Mo&&i+Mo>s){const e=o-t.top+Mo,{clamped:i,offset:l}=Oo(c,r,n);return{position:"top",bottom:e,left:i,arrowOffset:l}}const d=t.bottom+Mo,{clamped:h,offset:f}=Oo(c,r,n);return{position:"bottom",top:d,left:h,arrowOffset:f}}(o,n)),m(function(t,e=8){return{top:t.top-e+"px",left:t.left-e+"px",width:`${t.width+2*e}px`,height:`${t.height+2*e}px`}}(o)),b(!0)});ro(()=>{!A&&!g&&k.current&&r&&j()},[A,g,r,j]),oo(()=>{const t=n,o=()=>{T.current===t&&(h("visible"),S.current=!1)},r=()=>{q.current&&zo(e)&&(q.current.isConnected||(q.current=Io(e).element),q.current)?function(t,e){const n=t.getBoundingClientRect(),o=rr.innerHeight,r=rr.innerWidth,i=o/6,l=r/6;if(!(i>n.top||n.bottom>o-i||l>n.left||n.right>r-l))return void e();t.scrollIntoView({behavior:"smooth",block:"center"});let s=n.top,u=0,a=!1;const c=()=>{if(a)return;const n=t.getBoundingClientRect();if(1>Math.abs(n.top-s)){if(u++,u>=3)return a=!0,void e()}else u=0;s=n.top,setTimeout(c,50)};setTimeout(c,30),setTimeout(()=>{a||(a=!0,e())},500)}(q.current,()=>{T.current===t&&(j(),setTimeout(o,50))}):setTimeout(o,50)};if(T.current===n)return T.current=n,S.current=!0,void r();T.current=n,S.current=!0,h("exiting"),setTimeout(()=>{T.current===t&&(zo(e)&&(p(null),m(null),b(!1)),w(e),_(n),h("entering"),r())},150)},[r,n,e,j]),oo(()=>{if("visible"!==d||A)return;const t=()=>{S.current||j()};return bo(rr,"scroll",t,{capture:!0}),bo(rr,"resize",t),()=>{null==rr||rr.removeEventListener("scroll",t,!0),null==rr||rr.removeEventListener("resize",t)}},[j,d,A]),oo(()=>{const t=t=>{"Escape"===t.key&&s("escape_key")};return bo(rr,"keydown",t),()=>{null==rr||rr.removeEventListener("keydown",t)}},[s]);const C="visible"===d,E="survey"===y.type,z=A||g,I=ae(ae({},y.maxWidth&&{width:`min(${y.maxWidth}px, calc(100vw - 16px))`,maxWidth:`min(${y.maxWidth}px, calc(100vw - 16px))`}),A?ae(ae({},{top:"auto",right:"auto",bottom:"auto",left:"auto",transform:"none"}),(()=>{var t;const e=function(t,e="right",n){if("external_survey"===t)return{};switch(e){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"left":return{left:"30px"};case"center":return{left:"50%",transform:"translateX(-50%)"};default:return{right:"widget"===t&&"tab"===n?"60px":"30px"}}}(void 0,null!==(t=y.modalPosition)&&void 0!==t?t:"middle_center");return"top"in e||"bottom"in e?e:ae(ae({},e),{},{bottom:"30px"})})()):(()=>{if(!f)return{};const t="left"===f.position||"right"===f.position;return{top:Rt(f.top)?"auto":`${f.top}px`,bottom:Rt(f.bottom)?"auto":`${f.bottom}px`,left:Rt(f.left)?"auto":`${f.left}px`,right:Rt(f.right)?"auto":`${f.right}px`,transform:t?"translateY(-50%)":"translateX(-50%)"}})());return Zo("div",{class:"ph-tour-container",children:[!1!==(null===(c=t.appearance)||void 0===c?void 0:c.dismissOnClickOutside)&&Zo("div",{class:"ph-tour-click-overlay",onClick(t){t.stopPropagation(),s("user_clicked_outside")}}),Zo("div",{class:"ph-tour-modal-overlay",style:{opacity:A&&C?1:0,transition:"opacity 150ms ease-out",pointerEvents:"none"}}),Zo("div",{class:"ph-tour-spotlight",style:ae(ae({},C&&z&&v?v:{top:"50%",left:"50%",width:"0px",height:"0px"}),{},{opacity:!A&&C&&z?1:0,transition:"opacity 150ms ease-out"},"click"===y.progressionTrigger&&!A&&{pointerEvents:"auto",cursor:"pointer"}),onClick:"click"!==y.progressionTrigger||A?void 0:t=>{t.stopPropagation(),q.current&&q.current.click(),i()}}),Zo("div",{ref:k,class:`ph-tour-tooltip ${A?"ph-tour-tooltip--modal":""} ${E?"ph-tour-survey-step":""}`,style:ae(ae({},I),{},{opacity:C&&z?1:0,transition:"opacity 150ms ease-out"}),onClick(t){t.stopPropagation()},children:[!A&&f&&Zo("div",{class:`ph-tour-arrow ph-tour-arrow--${ir(f.position)}`,style:0!==f.arrowOffset?{"--ph-tour-arrow-offset":`${f.arrowOffset}px`}:void 0}),E?Zo(or,{step:y,appearance:t.appearance,stepIndex:x,totalSteps:o,onSubmit:u,onPrevious:l,onDismiss:()=>s("user_clicked_skip")}):Zo(Jo,{step:y,appearance:t.appearance,stepIndex:x,totalSteps:o,onNext:i,onPrevious:l,onDismiss:()=>s("user_clicked_skip"),onButtonClick:a})]})]})}function sr({class:t,href:e,onClick:n,children:o}){return Zo("a",{class:t,href:e,target:"_blank",rel:"noopener noreferrer",onClick:n,children:o})}function ur({class:t,onClick:e,children:n}){return Zo("div",{class:t,role:"button",tabIndex:0,onClick:e,onKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},style:{cursor:"pointer"},children:n})}function ar({class:t,children:e}){return Zo("div",{class:t,children:e})}function cr(t){return Zo("div",{class:"ph-tour-banner-wrapper",children:Zo("div",{class:"ph-tour-banner-slide",children:Zo(dr,ae({},t))})})}function dr({step:t,onDismiss:e,onActionClick:n,displayFrequency:o}){var r;const i=null!==(r=t.bannerConfig)&&void 0!==r?r:{behavior:"sticky"},l=i.action,s="always"!==o,u=["ph-tour-banner","sticky"===i.behavior&&"ph-tour-banner--sticky","custom"===i.behavior&&"ph-tour-banner--custom"].filter(Boolean).join(" "),a=Zo(q,{children:[Zo("div",{class:"ph-tour-banner-content",dangerouslySetInnerHTML:{__html:Bo(t)}}),s&&Zo("button",{class:"ph-tour-banner-dismiss",onClick(t){t.stopPropagation(),t.preventDefault(),e()},"aria-label":"Close banner",children:Go()})]});return"link"===(null==l?void 0:l.type)&&l.link?Zo(sr,{class:u,href:l.link,onClick:n,children:a}):"trigger_tour"===(null==l?void 0:l.type)&&n?Zo(ur,{class:u,onClick:n,children:a}):Zo(ar,{class:u,children:a})}function hr(t){var e,n;return!(!(null===(e=t.conditions)||void 0===e?void 0:e.events)||0>=(null===(n=t.conditions.events.values)||void 0===n?void 0:n.length))}function fr(t){var e,n;return!(!(null===(e=t.conditions)||void 0===e?void 0:e.actions)||0>=(null===(n=t.conditions.actions.values)||void 0===n?void 0:n.length))}var pr=class{on(t,e){return this.bo[t]||(this.bo[t]=[]),this.bo[t].push(e),()=>{this.bo[t]=this.bo[t].filter(t=>t!==e)}}emit(t,e){for(const n of this.bo[t]||[])n(e);for(const n of this.bo["*"]||[])n(t,e)}constructor(){this.bo={}}};function vr(t,e,n){if(Lt(t))return!1;switch(n){case"exact":return t===e;case"contains":{const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}var mr=class{constructor(t){this.Ai=t,this._o=new Set,this.wo=new Set,this.ko=new pr,this.So=(t,e)=>this.xo(t,e)&&this.$o(t,e)&&this.Co(t,e)&&this.To(t,e),this.xo=(t,e)=>!(null==e?void 0:e.event)||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Rt(null===(t=this.Ai)||void 0===t?void 0:t.subscribeCapture)||(this.Io=null===(e=this.Ai)||void 0===e?void 0:e.subscribeCapture((t,e)=>{this.on(t,e)}))}dispose(){var t,e,n;null===(t=this.Io)||void 0===t||t.call(this),this.Io=void 0,null===(e=this.Ai)||void 0===e||null===(n=e.setElementSelectors)||void 0===n||n.call(e,new Set,this),this.ko=new pr}register(t){var e,n;if(!Rt(null===(e=this.Ai)||void 0===e?void 0:e.subscribeCapture)&&(t.forEach(t=>{var e;this._o.add(t),null===(e=t.steps)||void 0===e||e.forEach(t=>{this.wo.add((null==t?void 0:t.event)||"")})}),null===(n=this.Ai)||void 0===n?void 0:n.setElementSelectors)){const t=new Set;this._o.forEach(e=>{var n;null===(n=e.steps)||void 0===n||n.forEach(e=>{(null==e?void 0:e.selector)&&t.add(e.selector)})}),this.Ai.setElementSelectors(t,this)}}replace(t){this._o.clear(),this.wo.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.wo.has(t)||this.wo.has(e.event))&&this._o.forEach(t=>{this.Mo(e,t)&&this.ko.emit("actionCaptured",t.name)})}Eo(t){this.onAction("actionCaptured",e=>t(e))}Mo(t,e){if(null==(null==e?void 0:e.steps))return!1;for(const n of e.steps)if(this.So(t,n))return!0;return!1}onAction(t,e){return this.ko.on(t,e)}$o(t,e){if(null==e?void 0:e.url){var n;let i=null==t||null===(n=t.properties)||void 0===n?void 0:n.$current_url;if(!(null==t?void 0:t.properties)||!("$current_url"in t.properties))try{var o,r;i=null===(o=this.Ai)||void 0===o||null===(r=o.getActionUrl)||void 0===r?void 0:r.call(o)}catch(t){return!1}if(!i||"string"!=typeof i)return!1;if(!vr(i,e.url,e.url_matching||"contains"))return!1}return!0}Co(t,e){return!!this.Po(t,e)&&!!this.Ro(t,e)&&!!this.Ao(t,e)}Po(t,e){var n;if(!(null==e?void 0:e.href))return!0;const o=this.Fo(t);if(o.length>0)return o.some(t=>vr(t.href,e.href,e.href_matching||"exact"));const r=(null==t||null===(n=t.properties)||void 0===n?void 0:n.$elements_chain)||"";return!!r&&vr(function(t){const e=t.match(/(?::|")href="(.*?)"/);return e?e[1]:""}(r),e.href,e.href_matching||"exact")}Ro(t,e){var n;if(!(null==e?void 0:e.text))return!0;const o=this.Fo(t);if(o.length>0)return o.some(t=>vr(t.text,e.text,e.text_matching||"exact")||vr(t.$el_text,e.text,e.text_matching||"exact"));const r=(null==t||null===(n=t.properties)||void 0===n?void 0:n.$elements_chain)||"";return!!r&&(i=function(t){const e=[],n=/(?::|")text="(.*?)"/g;let o;for(;!Lt(o=n.exec(t));)e.includes(o[1])||e.push(o[1]);return e}(r),l=e.text,s=e.text_matching||"exact",i.some(t=>vr(t,l,s)));var i,l,s}Ao(t,e){var n,o;if(!(null==e?void 0:e.selector))return!0;const r=null==t||null===(n=t.properties)||void 0===n?void 0:n.$element_selectors;if(null==r?void 0:r.includes(e.selector))return!0;const i=(null==t||null===(o=t.properties)||void 0===o?void 0:o.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch(t){}return!1}Fo(t){var e;return null==(null==t||null===(e=t.properties)||void 0===e?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}To(t,e){return!(null==e?void 0:e.properties)||0===e.properties.length||Bn(e.properties.reduce((t,e)=>{const n=Pt(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:n,operator:e.operator||"exact"},t},{}),null==t?void 0:t.properties)}},gr=class{constructor(t,e){this.Oo=e,this.Do=[],this.Ai=t,this.Lo=new Map,this.No=new Map,this.qo=new Map}jo(){var t,e;this.Bo=null===(t=(e=this.Ai).subscribeSession)||void 0===t?void 0:t.call(e,t=>this.zo(t))}Ho(t){return!1}Uo(){return null}Wo(t){}Vo(){}Go(t,e){return!!t&&Bn(t.propertyFilters,null==e?void 0:e.properties)}Qo(t,e){const n=new Map;return t.forEach(t=>{var o;null===(o=t.conditions)||void 0===o||null===(o=o[e])||void 0===o||null===(o=o.values)||void 0===o||o.forEach(e=>{if(null==e?void 0:e.name){const o=n.get(e.name)||[];o.push(t.id),n.set(e.name,o)}})}),n}Zo(t,e,n){const o=(n===St?this.Lo:this.No).get(t);let r=[];return this.Jo(t=>{r=t.filter(t=>null==o?void 0:o.includes(t.id))}),r.filter(o=>{var r;const i=null===(r=o.conditions)||void 0===r||null===(r=r[n])||void 0===r||null===(r=r.values)||void 0===r?void 0:r.find(e=>e.name===t);return this.Go(i,e)})}register(t){this.Ko(t,!1)}replace(t){this.Ko(t,!0)}Ko(t,e){Rt(this.Ai.subscribeCapture)||(this.Xo(t,e),this.Yo(t,e))}Yo(t,e){const n=t.filter(t=>{var e;return null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length});var o;if(e&&this.qo.clear(),0===n.length)return void(e&&(null===(o=this.ta)||void 0===o||o.replace([])));this.ta||(this.ta=new mr(this.Ai),this.ta.init(),this.ta.Eo(t=>this.onAction(t)));const r=[];n.forEach(t=>{var e;null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||e.values.forEach(e=>{if(r.push(e),e.name){var n;const o=null!==(n=this.qo.get(e.name))&&void 0!==n?n:[];o.includes(t.id)||o.push(t.id),this.qo.set(e.name,o)}})}),e?this.ta.replace(r):this.ta.register(r)}ea(t,e){e.forEach((e,n)=>{var o;const r=null!==(o=t.get(n))&&void 0!==o?o:[];e.forEach(t=>{r.includes(t)||r.push(t)}),t.set(n,r)})}Xo(t,e){var n,o,r;const i=t.filter(t=>{var e,n;return(null===(e=t.conditions)||void 0===e?void 0:e.events)&&(null===(n=t.conditions)||void 0===n||null===(n=n.events)||void 0===n||null===(n=n.values)||void 0===n?void 0:n.length)>0}),l=t.filter(t=>{var e,n;return(null===(e=t.conditions)||void 0===e?void 0:e.cancelEvents)&&(null===(n=t.conditions)||void 0===n||null===(n=n.cancelEvents)||void 0===n||null===(n=n.values)||void 0===n?void 0:n.length)>0}),s=this.Qo(t,St),u=this.Qo(t,qt);e?(this.Lo=s,this.No=u):(this.ea(this.Lo,s),this.ea(this.No,u)),(0!==i.length||0!==l.length||t.some(t=>{var e;return null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length}))&&(null!==(n=this.Io)&&void 0!==n||(this.Io=null===(o=(r=this.Ai).subscribeCapture)||void 0===o?void 0:o.call(r,(t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var n,o;const r=this.ia(),i=(null==e||null===(n=e.properties)||void 0===n?void 0:n.$survey_id)||(null==e||null===(o=e.properties)||void 0===o?void 0:o.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const n=this.na(t,i,e);if("consume"===n)return r.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.sa([i]);if("persist"===n)return r.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.ra(i),void this.oa([i])}if(this.No.has(t)){const n=this.Zo(t,e,qt);n.length>0&&(r.info("cancel event matched, cancelling items",{event:t,itemsToCancel:n.map(t=>t.id)}),this.sa(n.map(t=>t.id)),n.forEach(t=>this.aa(t.id)))}if(!this.Lo.has(t))return;r.info("event name matched",{event:t,eventPayload:e,items:this.Lo.get(t)});const l=this.Zo(t,e,St);this.la(l.map(t=>t.id))}onAction(t){this.qo.has(t)&&this.la(this.qo.get(t)||[])}la(t){if(0===t.length)return;const e=!!this.Ai.getSessionId(),n=[];for(const o of t)e&&this.Ho(o)?this.ra(o)&&this.ua(o):n.push(o);n.length>0&&(this.Do=[...new Set([...this.Do,...n])]),this.ia().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.ca()}ra(t){this.Do=this.Do.filter(e=>e!==t);const e=this.ha();return!e.includes(t)&&(this.da([...e,t]),this.va(),!0)}sa(t){const e=new Set(t);this.Do=this.Do.filter(t=>!e.has(t));const n=this.fa(),o=n.filter(t=>!e.has(t));o.length!==n.length&&(this.da(o),0===o.length&&this.pa()),this.oa(t),this.ca()}ca(){try{var t;null===(t=this.Oo)||void 0===t||t.call(this)}catch(t){this.ia().error("Error while handling activated items change",t)}}ga(){const t=this.Uo();if(!t)return{};const e=this.Ai.getProperty(t);return e&&"object"==typeof e?e:{}}ua(t){if(!this.Uo())return;const e=this.ga();this.Wo(ae(ae({},e),{},{[t]:Date.now()}))}oa(t){if(!this.Uo())return;const e=this.ga(),n={};let o=!1;for(const[r,i]of Object.entries(e))t.includes(r)?o=!0:n[r]=i;o&&((t=>{if((t=>t===Object(t)&&!Pt(t))(t)){for(const e in t)if(Mt.call(t,e))return!1;return!0}return!1})(n)?this.Vo():this.Wo(n))}ma(){this.Uo()&&this.Vo()}getActivationTimestamp(t){if(!this.ha().includes(t))return;const e=this.ga()[t];return Bt(e)?e:void 0}fa(){const t=this.ya();return this.Ai.getProperty(t)||[]}ha(){const t=this.fa();if(0===t.length)return[];const e=this.Ai.getProperty(this.ba()),n=this.Ai.getSessionId();return n&&e===n?t:[]}va(){const t=this.Ai.getSessionId();t&&this._a(t)}pa(){this.wa()}zo(t){const e=this.Ai.getProperty(this.ba());if(e&&e!==t){const t=this.fa(),e=this.ga();t.length>0&&(this.da([]),t.filter(t=>Bt(e[t])).forEach(t=>this.aa(t))),this.pa(),this.ma(),t.length>0&&this.ca()}}getActivatedIds(){return[...new Set([...this.ha(),...this.Do])].filter(t=>!this.ka(t))}dispose(){var t,e,n;null===(t=this.Bo)||void 0===t||t.call(this),this.Bo=void 0,null===(e=this.Io)||void 0===e||e.call(this),this.Io=void 0,null===(n=this.ta)||void 0===n||n.dispose(),this.ta=void 0}reset(){this.Do=[],this.fa().length>0&&this.da([]),this.pa(),this.ma(),this.ca()}getEventToItemsMap(){return this.Lo}Sa(){return this.ta}},br=class extends gr{constructor(t){super((t=>({get subscribeCapture(){return(null==t?void 0:t._addCaptureHook)?e=>t._addCaptureHook(e):void 0},subscribeSession(e){var n,o;return null!==(n=null==t||null===(o=t.onSessionId)||void 0===o?void 0:o.call(t,e))&&void 0!==n?n:()=>{}},getSessionId(){var e;return null==t||null===(e=t.get_session_id)||void 0===e?void 0:e.call(t)},getProperty(e){var n;return null==t||null===(n=t.persistence)||void 0===n?void 0:n.props[e]},setElementSelectors(e,n){var o;return null==t||null===(o=t.autocapture)||void 0===o?void 0:o.setElementSelectors(e,n)}}))(t)),this._instance=t,this.jo()}};const yr=Pn("[Product Tour Event Receiver]");var wr=class extends br{constructor(t){super(t)}ya(){return"$product_tours_activated"}ba(){return"$product_tours_activated_session"}Ca(){return K}Jo(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.productTours)||void 0===e||e.getProductTours(t)}aa(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.productTours)||void 0===e||e.cancelPendingTour(t)}ia(){return yr}da(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||e.register({$product_tours_activated:t})}_a(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||e.register({$product_tours_activated_session:t})}wa(){var t;null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t||t.unregister("$product_tours_activated_session")}ka(t){if(!t)return!0;const e=`${$o}${t}`;return!(!wo.Ot(`${To}${t}`)&&!wo.Ot(e))}na(t){return t===this.Ca()?"consume":"ignore"}getTours(){return this.getActivatedIds()}};const xr=Pn("[Product Tours]"),_r=o,kr=e;let Tr;const $r=new Map;function Sr(t,e){const n=t.conditions;if(!(null==n?void 0:n.url))return!0;const o=function(t){var e;const n=typeof window>"u"?void 0:window,o=null==n||null===(e=n.location)||void 0===e?void 0:e.href;return Rt(o)?void 0:function(t,e){var n;const o=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!Dt(o))return e;try{const t=o(e);return(t=>"[object String]"==Ot.call(t))(t)&&t?t:e}catch(t){return On.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,o)}(e);if(!o)return!1;o!==Tr&&($r.clear(),Tr=o);const r=$r.get(t.id);if(!Rt(r))return r;const i=n.urlMatchType||"icontains";let l;return l="exact"===i?Ro(o)===Ro(n.url):Ln[i]([n.url],[o]),$r.set(t.id,l),l}function qr(t){const e=new Date;return!(t.start_date&&e<new Date(t.start_date)||t.end_date&&e>new Date(t.end_date))}function Ar(t,e){var n;return qr(t)&&Sr(t,e)&&function(t){var e,n,o;if(!t||0===t.length)return!0;const r="u">typeof window?window:void 0,i="u">typeof globalThis?globalThis:r,l=null==i?void 0:i.navigator,s=null==l?void 0:l.userAgent;if(!s)return!1;const u=function(t,e){var n;const o=function(t){return re.test(t)?Gt:oe.test(t)?Kt:ne.test(t)?Vt:new RegExp(Xt,"i").test(t)?Xt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?Wt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Yt:ie.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Jt,"i").test(t)?Jt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Ht).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":Ut:new RegExp("(pda|Mobile)","i").test(t)?te:new RegExp(Qt,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?ee:""}(t);return o===Wt||o===Ut||"Kobo"===o||"Kindle Fire"===o||o===ee?Qt:o===Gt||o===Vt||o===Kt||o===Xt?"Console":o===Yt?"Wearable":o?Ht:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(n=null==e?void 0:e.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(i=null==e?void 0:e.screenHeight)&&void 0!==i?i:0)/(null!==(l=null==e?void 0:e.devicePixelRatio)&&void 0!==l?l:1)?Ht:Qt:"Desktop";var r,i,l}(s,{userAgentDataPlatform:null==l||null===(e=l.userAgentData)||void 0===e?void 0:e.platform,maxTouchPoints:null==l?void 0:l.maxTouchPoints,screenWidth:null==r||null===(n=r.screen)||void 0===n?void 0:n.width,screenHeight:null==r||null===(o=r.screen)||void 0===o?void 0:o.height,devicePixelRatio:null==r?void 0:r.devicePixelRatio});return Ln.icontains(t,[u])}(null===(n=t.conditions)||void 0===n?void 0:n.deviceTypes)}const jr="ph-product-tour-container",Cr="data-ph-tour-trigger";var Er=class{constructor(t){this.Am=null,this.Zm=0,this.Hm=!1,this.Qm=!1,this.Um=null,this.Ym=new Map,this.Gm=new Map,this.Km=new Set,this.Vm=new Set,this.Jm=()=>{_r.hidden&&this.Um?(clearInterval(this.Um),this.Um=null):_r.hidden||this.Um||(this.Um=setInterval(()=>{this.Xm()},1e3),this.Xm())},this.nextStep=()=>{if(!this.Am)return;const t=this.Am.steps[this.Zm];this._l("product tour step completed",{[V]:this.Am.id,[et]:t.id,[nt]:this.Zm}),this.Am.steps.length-1>this.Zm?(this.tb(this.Zm+1),this.eb()):this.nb()},this.previousStep=()=>{this.Am&&0!==this.Zm&&(this.tb(this.Zm-1),this.eb())},this.dismissTour=(t="user_clicked_skip")=>{if(!this.Am)return;const e=this.Am.steps[this.Zm];this._l("product tour dismissed",{[V]:this.Am.id,[et]:e.id,[nt]:this.Zm,[rt]:t}),this.Hm||(wo.At(`${$o}${this.Am.id}`,!0),this._instance.capture("$set",{$set:{[`$product_tour_dismissed/${this.Am.id}`]:!0}})),kr.dispatchEvent(new CustomEvent("PHProductTourDismissed",{detail:{tourId:this.Am.id,reason:t}})),this.ob()},this.rb=()=>{var t;if(!this.Am)return;const e=this.ib();if(!e)return;const n=null===(t=e.bannerConfig)||void 0===t?void 0:t.action;this._l("product tour banner action clicked",{[V]:this.Am.id,[J]:this.Am.name,[X]:this.Am.current_iteration||1,[et]:e.id,[nt]:this.Zm,[lt]:null==n?void 0:n.type,[st]:null==n?void 0:n.link,[ut]:null==n?void 0:n.tourId}),"trigger_tour"===(null==n?void 0:n.type)&&n.tourId&&(this.ob(),this.showTourById(n.tourId))},this.lb=t=>{if(this.Am){const e=this.Am.steps[this.Zm];e&&this._l("product tour button clicked",ae(ae({[V]:this.Am.id,[J]:this.Am.name,[X]:this.Am.current_iteration||1,[et]:e.id,[nt]:this.Zm,[it]:t.text,[lt]:t.action},t.link&&{[st]:t.link}),t.tourId&&{[ut]:t.tourId}))}switch(t.action){case"dismiss":this.dismissTour("user_clicked_skip");break;case"next_step":this.nextStep();break;case"previous_step":this.previousStep();break;case"link":this.nb();break;case"trigger_tour":t.tourId&&(this.nb(),this.showTourById(t.tourId))}},this._instance=t,this.sb=new wr(t)}ub(t){const e=t.filter(t=>!t.disable_image_preload).flatMap(t=>t.steps.flatMap(Lo));for(const t of e)this.Vm.has(t)||(this.Vm.add(t),(new Image).src=t)}ib(){var t;if(!this.Am)return null;const e=this.Am.steps[this.Zm];if(!e)return null;const n=null!==(t=this._instance.config.override_display_language)&&void 0!==t?t:navigator.language||navigator.userLanguage;return function(t,e){var n;if(!e||!t.translations)return t;const o=t.translations,r=null!==(n=o[e])&&void 0!==n?n:o[e.split("-")[0]];if(!r)return Ao.info(`No matching translation for "${e}" in step ${t.id}, using default`),t;const i=ae({},t);return Rt(r.content)||(i.content=r.content),Rt(r.contentHtml)||(i.contentHtml=r.contentHtml),r.buttons&&i.buttons&&(i.buttons={primary:i.buttons.primary&&ae(ae({},i.buttons.primary),r.buttons.primary),secondary:i.buttons.secondary&&ae(ae({},i.buttons.secondary),r.buttons.secondary)}),r.survey&&i.survey&&(i.survey=ae(ae({},i.survey),r.survey)),i}(e,null!=n?n:null)}tb(t){this.Zm=t,this.ab()}ab(){this.Am&&!this.Hm&&_o.At(So,{tourId:this.Am.id,stepIndex:this.Zm})}cb(){_o.Pt(So)}hb(){const t=_o.Ot(So);if(!t)return null;try{return JSON.parse(t)}catch(t){return null}}start(){if(this.Um)return;const t=this.hb();t?this.fb(t.tourId,t.stepIndex,()=>{this.pb()}):this.pb()}pb(){this.Um=setInterval(()=>{this.Xm()},1e3),this.Xm(!0),bo(_r,"visibilitychange",this.Jm)}fb(t,e,n){var o;null===(o=this._instance.productTours)||void 0===o||o.getProductTours(o=>{const r=o.find(e=>e.id===t);r?(this.Am=r,this.Zm=e,this.Qm=!0,this.eb()):o.length>0&&this.cb(),n()})}stop(){this.Um&&(clearInterval(this.Um),this.Um=null),_r.removeEventListener("visibilitychange",this.Jm),this.mb(),this.gb(),this.ob()}Xm(t){var e;(null==_r?void 0:_r.getElementById("__POSTHOG_TOOLBAR__"))||null===(e=this._instance.productTours)||void 0===e||e.getProductTours(t=>{if(0===t.length)return void this.mb();this.ub(t);const e=new Set,n=t.filter(t=>!this.Km.has(t.id)&&(hr(t)||fr(t)));n.length>0&&(this.sb.register(n),n.forEach(t=>this.Km.add(t.id)));const o=this.Am?[]:this.sb.getTours();for(const n of t){var r;const t=null===(r=n.conditions)||void 0===r?void 0:r.selector;if(t&&(e.add(n.id),this.bb(n,t)),this.Am)continue;const i=fr(n)||hr(n);if(n.auto_launch&&this.yb(n)){if(!i){this.wb(n,"auto");continue}o.includes(n.id)&&this.wb(n,"event")}}this.Ym.forEach(({tour:t})=>{e.has(t.id)||this.xb(t.id)})},t)}wb(t,e){var n;const o=(null===(n=t.conditions)||void 0===n?void 0:n.autoShowDelaySeconds)||0;o>0?this.isTourPending(t.id)||this.queueTourWithDelay(t.id,o,e):this.showTour(t,{reason:e})}yb(t){var e,n,o;if(!Ar(t,this._instance))return xr.info(`Tour ${t.id} failed conditions check`),!1;const r=null!==(e=t.display_frequency)&&void 0!==e?e:"until_interacted",i=`${ko}${t.id}`,l=`${To}${t.id}`,s=`${$o}${t.id}`;switch(r){case"show_once":if(wo.Ot(i))return xr.info(`Tour ${t.id} already shown (show_once frequency)`),!1;break;case"until_interacted":if(wo.Ot(l)||wo.Ot(s))return xr.info(`Tour ${t.id} already completed or dismissed`),!1}var u,a;if(!function(t){if(!t)return!0;const{days:e,types:n}=t;if(!e||!n||0===n.length)return!0;let o=null;for(const t of n){const e=wo.Ot(`${qo}${t}`);if(e)try{const t=JSON.parse(e),n=new Date(t);isNaN(n.getTime())||o&&o>=n||(o=n)}catch(t){}}return!o||function(t,e){if(!t||!e)return!0;const n="string"==typeof e?new Date(e):e,o=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(o/864e5)>t}(e,o)}(null===(n=t.conditions)||void 0===n?void 0:n.seenTourWaitPeriod))return xr.info(`Cannot show tour ${t.id}: user has seen a ${null===(u=t.conditions)||void 0===u||null===(u=u.seenTourWaitPeriod)||void 0===u?void 0:u.types} tour within the last ${null===(a=t.conditions)||void 0===a||null===(a=a.seenTourWaitPeriod)||void 0===a?void 0:a.days} days.`),!1;if(!this._b({flagKey:t.internal_targeting_flag_key}))return xr.info(`Tour ${t.id} failed feature flag check: ${t.internal_targeting_flag_key}`),!1;const c=null===(o=t.conditions)||void 0===o?void 0:o.linkedFlagVariant;return!!this._b({flagKey:t.linked_flag_key,flagVariant:c})||(xr.info(`Tour ${t.id} failed feature flag check: ${t.linked_flag_key}, variant: ${c}`),!1)}showTour(t,e){var n;const o=null!==(n=null==e?void 0:e.reason)&&void 0!==n?n:"auto";this.cancelPendingTour(t.id),this.Am=t,this.tb(0);const r=this.eb();return r?(this._l(K,{[V]:t.id,[J]:t.name,[X]:t.current_iteration||1,[tt]:o,[$t]:t.tour_type}),this.Hm||(wo.At(`${ko}${t.id}`,!0),wo.At(`${qo}${t.tour_type}`,(new Date).toISOString()),this._instance.capture("$set",{$set:{[`$product_tour_shown/${t.id}`]:!0}}))):this.ob(),r}showTourById(t,e){var n;xr.info(`showTourById(${t})`),null===(n=this._instance.productTours)||void 0===n||n.getProductTours(n=>{const o=n.find(e=>e.id===t);o?this.showTour(o,{reason:null!=e?e:"api"}):xr.warn("could not find tour",t)})}previewTour(t){xr.info(`Previewing tour ${t.id}`),this.ob(),this.Hm=!0,this.Am=t,this.Zm=0,this.eb()}nb(){this.Am&&(this._l("product tour completed",{[V]:this.Am.id,[at]:this.Am.steps.length}),this.Hm||(wo.At(`${To}${this.Am.id}`,!0),this._instance.capture("$set",{$set:{[`$product_tour_completed/${this.Am.id}`]:!0}})),kr.dispatchEvent(new CustomEvent("PHProductTourCompleted",{detail:{tourId:this.Am.id}})),this.ob())}eb(t=0){var e;if(!this.Am)return!1;const n=this.ib();if(!n)return xr.warn(`Step ${this.Zm} not found in tour ${this.Am.id}`),this.ob(),!1;if("banner"===n.type)return this.kb(),this.Qm=!1,this.Tb(),!0;if("survey"===n.type)return n.survey?(this.$b(),!0):(xr.warn("Unable to render survey step - survey data not found"),!1);if(!zo(n))return this.kb(),this.Qm=!1,this.Sb(null),!0;const o=Io(n),r={[kt]:null!==(e=n.useManualSelector)&&void 0!==e&&e,[Tt]:!!n.inferenceData},i=this.Zm>0?this.Am.steps[this.Zm-1]:null,l="click"===(null==i?void 0:i.progressionTrigger)||this.Qm;if("not_found"===o.error||"not_visible"===o.error){if(l&&20>t)return setTimeout(()=>{this.eb(t+1)},100),!1;const e=100*t;return this.qb(o,ae({[yt]:l,[wt]:e},r)),0!==this.Zm||this.Qm?(xr.warn(`Tour "${this.Am.name}" dismissed: element for step ${this.Zm} became unavailable (${o.error})`+(l?` after waiting ${e}ms`:"")),this.dismissTour("element_unavailable"),!1):(xr.warn(`Tour "${this.Am.name}" failed to show: element for first step not found (${o.error})`),!1)}if("multiple_matches"===o.error&&this.qb(o,r),!o.element)return!1;const s=o.element,u=function(t){var e;return{tag:t.tagName,id:t.id||void 0,classes:t.className||void 0,text:(null===(e=t.innerText)||void 0===e?void 0:e.slice(0,100))||void 0}}(s);return this.kb(ae({[ct]:n.selector,[dt]:!0,[ht]:u.tag,[ft]:u.id,[pt]:u.classes,[vt]:u.text},r)),this.Qm=!1,this.Sb(s),!0}Sb(t,e,n){if(!this.Am)return;const o=this.ib();if(!o)return;const{shadow:r}=function(t,e){const n=`${jr}-${t.id}`,o=_r.querySelector(`.${n}`);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};const r=_r.createElement("div");r.className=n,Po(r,t.appearance);const i=r.attachShadow({mode:"open"}),l=Eo(e);return l&&i.appendChild(l),_r.body.appendChild(r),{shadow:i,isNewlyCreated:!0}}(this.Am,this._instance);Y(Zo(lr,{tour:this.Am,step:o,stepIndex:this.Zm,totalSteps:this.Am.steps.length,targetElement:t,onNext:this.nextStep,onPrevious:this.previousStep,onDismiss:n||this.dismissTour,onSurveySubmit:e,onButtonClick:this.lb}),r)}Tb(){if(!this.Am)return;const t=this.ib();if(!t)return;const e=function(t,e,n){var o;const r=`${jr}-${t.id}`,i=_r.querySelector(`.${r}`);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};const l=_r.createElement("div");l.className=r,Po(l,t.appearance),Rt(null==n||null===(o=n.animation)||void 0===o?void 0:o.duration)||l.style.setProperty("--ph-tour-banner-animation-duration",`${n.animation.duration}ms`);const s=l.attachShadow({mode:"open"}),u=Eo(e);if(u&&s.appendChild(u),"custom"===(null==n?void 0:n.behavior)&&n.selector){const t=_r.querySelector(n.selector);if(!t)return xr.warn(`Custom banner container not found: ${n.selector}. Banner will not be displayed.`),null;t.appendChild(l)}else _r.body.insertBefore(l,_r.body.firstChild);return{shadow:s,isNewlyCreated:!0}}(this.Am,this._instance,t.bannerConfig);var n;if(!e)return this._l("product tour banner container selector failed",{[V]:this.Am.id,[xt]:null==t||null===(n=t.bannerConfig)||void 0===n?void 0:n.selector}),void this.dismissTour("container_unavailable");const{shadow:o}=e;Y(Zo(cr,{step:t,onDismiss:()=>this.dismissTour("user_clicked_skip"),onActionClick:this.rb,displayFrequency:this.Am.display_frequency}),o)}$b(){var t,e,n;if(!this.Am)return;const o=this.Am.id,r=this.ib();if(!r)return;const i=r.linkedSurveyId,l=r.linkedSurveyQuestionId,s=(null===(t=r.survey)||void 0===t?void 0:t.questionText)||"";this.kb({[_t]:i}),this._l("survey shown",{[At]:i,[zt]:o,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)}),this.Sb(null,t=>{var e,n;const r=l?`$survey_response_${l}`:"$survey_response";this._l("survey sent",ae({[At]:i,[zt]:o,[Ct]:[{id:l,question:s,response:t}],[Et]:!0,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)},!Nt(t)&&{[r]:t})),xr.info(`Survey ${i} completed`,Nt(t)?"(skipped)":`with response: ${t}`),this.nextStep()},t=>{var e,n;this._l("survey dismissed",{[At]:i,[zt]:o,[Ct]:[{id:l,question:s,response:null}],[jt]:!1,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)}),xr.info(`Survey ${i} dismissed`),this.dismissTour(t)}),xr.info(`Rendered survey step for tour step ${this.Zm}`)}_b({flagKey:t,flagVariant:e}){var n;if(!t)return!0;const o=!!(null===(n=this._instance.featureFlags)||void 0===n?void 0:n.isFeatureEnabled(t,{send_event:!t.startsWith("product-tour-targeting-")}));let r=!0;var i;return e&&(r=(null===(i=this._instance.featureFlags)||void 0===i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),o&&r}ob(){this.Am&&function(t){const e=_r.querySelector(`.${jr}-${t}`);(null==e?void 0:e.shadowRoot)&&Y(null,e.shadowRoot),null==e||e.remove()}(this.Am.id),this.Am=null,this.Zm=0,this.Hm=!1,this.Qm=!1,this.cb()}bb(t,e){const n=_r.querySelector(e),o=this.Ym.get(t.id);if(n){if(o){if(n===o.element)return;xr.info(`Trigger element changed for tour ${t.id}. Re-attaching listener.`),this.xb(t.id)}if(!n.hasAttribute(Cr)){const o=n=>{var o;if(this.Am)return void xr.info(`Tour ${t.id} trigger clicked but another tour is active`);let r;if(null===(o=this._instance.productTours)||void 0===o||o.getProductTours(e=>{r=e.find(e=>e.id===t.id)}),!r)return xr.warn(`Tour ${t.id} no longer exists. Removing stale listener.`),void this.xb(t.id);qr(r)?(xr.info(`Tour ${t.id} triggered by click on ${e}`),this.showTour(r,{reason:"trigger"})?n.preventDefault():xr.info(`Tour ${t.id} failed to show; not intercepting click.`)):xr.warn(`Tour ${t.id} trigger clicked, but tour is not launched - not showing tour.`)};bo(n,"click",o),n.setAttribute(Cr,t.id),this.Ym.set(t.id,{element:n,listener:o,tour:t}),xr.info(`Attached trigger listener for tour ${t.id} on ${e}`)}}else o&&this.xb(t.id)}xb(t){const e=this.Ym.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Cr),this.Ym.delete(t),xr.info(`Removed trigger listener for tour ${t}`))}mb(){this.Ym.forEach((t,e)=>{this.xb(e)})}_l(t,e){this.Hm||this._instance.capture(t,e)}kb(t){if(!this.Am)return;const e=this.Am.steps[this.Zm];this._l("product tour step shown",ae({[V]:this.Am.id,[et]:e.id,[nt]:this.Zm,[ot]:e.type},t))}qb(t,e){if(!this.Am)return;const n=this.Am.steps[this.Zm];this._l("product tour step selector failed",ae({[V]:this.Am.id,[et]:n.id,[nt]:this.Zm,[ct]:n.selector,[mt]:t.error,[gt]:t.matchCount,[bt]:"runtime"},e))}getActiveProductTours(t){var e;null===(e=this._instance.productTours)||void 0===e||e.getProductTours((e,n)=>{t((null==n?void 0:n.isLoaded)?e.filter(t=>this.yb(t)):[],n)})}resetTour(t){wo.Pt(`${ko}${t}`),wo.Pt(`${To}${t}`),wo.Pt(`${$o}${t}`)}resetAllTours(){const t=null==kr?void 0:kr.localStorage;if(!t)return;const e=[];for(let n=0;t.length>n;n++){const o=t.key(n);((null==o?void 0:o.startsWith("ph_product_tour_shown_"))||(null==o?void 0:o.startsWith("ph_product_tour_completed_"))||(null==o?void 0:o.startsWith("ph_product_tour_dismissed_"))||(null==o?void 0:o.startsWith("ph_last_seen_tour_date_")))&&e.push(o)}e.forEach(t=>wo.Pt(t))}cancelPendingTour(t){const e=this.Gm.get(t);e&&(clearTimeout(e),this.Gm.delete(t),xr.info(`Cancelled pending tour: ${t}`))}gb(){this.Gm.forEach(t=>clearTimeout(t)),this.Gm.clear()}isTourPending(t){return this.Gm.has(t)}queueTourWithDelay(t,e,n){xr.info(`Queueing tour ${t} with ${e}s delay`);const o=setTimeout(()=>{this.Gm.delete(t),xr.info(`Delay elapsed for tour ${t}, showing now`),this.showTourById(t,n)},1e3*e);this.Gm.set(t,o)}};function zr(t,e){if(!o)return;const n=new Er(t);return e&&n.start(),n}const Ir="undefined"!=typeof globalThis?globalThis:e;Ir&&"undefined"==typeof self&&(Ir.self=Ir),Ir&&"undefined"==typeof File&&(Ir.File=function(){});const Mr=null!=e?e:{};Mr.__PosthogExtensions__=Mr.__PosthogExtensions__||{},Mr.__PosthogExtensions__.generateProductTours=zr,t.default=zr,t.elementIsVisible=jn,t.findElement=In,t.getElementPath=function(t,e=4){if(!t)return null;const n=[];let o=t;for(;o&&e>n.length&&"BODY"!==o.tagName;){let t=o.tagName.toLowerCase();o.id?t+=`#${o.id}`:o.classList.length&&(t+=`.${o.classList[0]}`),n.unshift(t),o=o.parentElement}return n.join(" > ")}}({});
//# sourceMappingURL=product-tours.js.map