1var e,t,o,n,r,i;import{o as a}from"./C_JJxWoe.js";import{Vr as s}from"./CGcjPoY7.js";import{a as l}from"./CUGxGGjg.js";function c(e,t,o){var n,r,i,a,s;if(void 0===o&&(o=new WeakMap),e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(o.has(e)&&o.get(e)===t)return!0;if(o.set(e,t),n=Object.keys(e),r=Object.keys(t),n.length!==r.length)return!1;for(i=0,a=n;i<a.length;i++){if(s=a[i],!r.includes(s))return!1;if(!c(e[s],t[s],o))return!1}return!0}function u(o){var n=o.children,r=o.client,i=o.apiKey,a=o.options,s=(0,e.useRef)(null),u=(0,e.useMemo)(function(){return r?(i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),r):(i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),l)},[r,i,JSON.stringify(a)]);return(0,e.useEffect)(function(){if(!r){var e=s.current;e?(i!==e.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!c(a,e.options)&&l.set_config(a),s.current={apiKey:i,options:null!=a?a:{}}):(l.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),l.init(i,a),s.current={apiKey:i,options:null!=a?a:{}})}},[r,i,JSON.stringify(a)]),e.createElement(t.Provider,{value:{client:u}},n)}function p(e){const t=e+"=",o=self.document.cookie.split(";");for(let n=0;n<o.length;n++){let e=o[n];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(t))return e.substring(t.length,e.length)}}function f(e,t,o){let n="";if(o>0){const e=new Date;e.setTime(e.getTime()+1e3*o),n="; expires="+e.toUTCString()}self.document.cookie=`${e}=${t||""}${n}; path=/`}e=a(s()),t=(0,e.createContext)({client:l}),o=function(){return(0,e.useContext)(t).client}
1,n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},n(e,t)},r=function(e){return"function"==typeof e},i={componentStack:null,error:null},function(o){function a(e){var t=o.call(this,e)||this;return t.state=i,t}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)})(a,o),a.prototype.componentDidCatch=function(e,t){var o,n=t.componentStack,i=this.props.additionalProperties;this.setState({error:e,componentStack:n}),r(i)?o=i(e):"object"==typeof i&&(o=i),this.context.client.captureException(e,o)},a.prototype.render=function(){var t,o=this.props,n=o.children,i=o.fallback,a=this.state;return null==a.componentStack?r(n)?n():n:(t=r(i)?e.createElement(i,{error:a.error,componentStack:a.componentStack}):i,e.isValidElement(t)?t:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),e.createElement(e.Fragment,null)))},a.contextType=t}(e.Component);export{o as i,f as n,u as r,p as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.