@molin.ai/shop-ai 0.4.15 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/molin-shop-ai.min.js +17 -6
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ad=Object.defineProperty;var Cd=(t,e,r)=>e in t?Ad(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ye=(t,e,r)=>(Cd(t,typeof e!="symbol"?e+"":e,r),r),Ha=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var N=(t,e,r)=>(Ha(t,e,"read from private field"),r?r.call(t):e.get(t)),ee=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},ke=(t,e,r,i)=>(Ha(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r);var ih=(t,e,r,i)=>({set _(n){ke(t,e,n,r)},get _(){return N(t,e,i)}}),ce=(t,e,r)=>(Ha(t,e,"access private method"),r);var ve;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let s={};for(let a of n)s[a]=a;return s},t.getValidEnumValues=n=>{let s=t.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),a={};for(let o of s)a[o]=n[o];return t.objectValues(a)},t.objectValues=n=>t.objectKeys(n).map(function(s){return n[s]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.push(a);return s},t.find=(n,s)=>{for(let a of n)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,s=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(ve||(ve={}));var Ua;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ua||(Ua={}));var j=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hr=t=>{switch(typeof t){case"undefined":return j.undefined;case"string":return j.string;case"number":return isNaN(t)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(t)?j.array:t===null?j.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?j.promise:typeof Map<"u"&&t instanceof Map?j.map:typeof Set<"u"&&t instanceof Set?j.set:typeof Date<"u"&&t instanceof Date?j.date:j.object;default:return j.unknown}},L=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Td=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),gt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},i={_errors:[]},n=s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let o=i,l=0;for(;l<a.path.length;){let h=a.path[l];l===a.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(r(a))):o[h]=o[h]||{_errors:[]},o=o[h],l++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};gt.create=t=>new gt(t);var Ji=(t,e)=>{let r;switch(t.code){case L.invalid_type:t.received===j.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ve.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:r=`Unrecognized key(s) in object: ${ve.joinValues(t.keys,", ")}`;break;case L.invalid_union:r="Invalid input";break;case L.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ve.joinValues(t.options)}`;break;case L.invalid_enum_value:r=`Invalid enum value. Expected ${ve.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:r="Invalid function arguments";break;case L.invalid_return_type:r="Invalid function return type";break;case L.invalid_date:r="Invalid date";break;case L.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ve.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case L.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case L.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case L.custom:r="Invalid input";break;case L.invalid_intersection_types:r="Intersection results could not be merged";break;case L.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:r="Number must be finite";break;default:r=e.defaultError,ve.assertNever(t)}return{message:r}},ah=Ji;function Id(t){ah=t}function Un(){return ah}var Wn=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],a={...n,path:s},o="",l=i.filter(h=>!!h).slice().reverse();for(let h of l)o=h(a,{data:e,defaultError:o}).message;return{...n,path:s,message:n.message||o}},Md=[];function H(t,e){let r=Wn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Un(),Ji].filter(i=>!!i)});t.common.issues.push(r)}var Je=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return ae;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:a}=n;if(s.status==="aborted"||a.status==="aborted")return ae;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[s.value]=a.value)}return{status:e.value,value:i}}},ae=Object.freeze({status:"aborted"}),oh=t=>({status:"dirty",value:t}),et=t=>({status:"valid",value:t}),Wa=t=>t.status==="aborted",Za=t=>t.status==="dirty",Xi=t=>t.status==="valid",Zn=t=>typeof Promise<"u"&&t instanceof Promise,te;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(te||(te={}));var Pt=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},nh=(t,e)=>{if(Xi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new gt(t.common.issues);return this._error=r,this._error}}};function oe(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,o)=>a.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:i??o.defaultError}:{message:r??o.defaultError},description:n}}var le=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return hr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Je,ctx:{common:e.parent.common,data:e.data,parsedType:hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Zn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hr(e)},s=this._parseSync({data:e,path:n.path,parent:n});return nh(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hr(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(Zn(n)?n:Promise.resolve(n));return nh(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let a=e(n),o=()=>s.addIssue({code:L.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new yt({schema:this,typeName:ne.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $t.create(this,this._def)}nullable(){return Jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yt.create(this,this._def)}promise(){return pr.create(this,this._def)}or(e){return Ir.create([this,e],this._def)}and(e){return Mr.create(this,e,this._def)}transform(e){return new yt({...oe(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Rr({...oe(this._def),innerType:this,defaultValue:r,typeName:ne.ZodDefault})}brand(){return new Kn({typeName:ne.ZodBranded,type:this,...oe(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new hi({...oe(this._def),innerType:this,catchValue:r,typeName:ne.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ki.create(this,e)}readonly(){return ui.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Dd=/^c[^\s-]{8,}$/i,Fd=/^[a-z][a-z0-9]*$/,Od=/^[0-9A-HJKMNP-TV-Z]{26}$/,$d=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rd=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ld="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qa,Bd=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Vd=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Nd=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function zd(t,e){return!!((e==="v4"||!e)&&Bd.test(t)||(e==="v6"||!e)&&Vd.test(t))}var cr=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:j.string,received:s.parsedType}),ae}let i=new Je,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(n=this._getOrReturnCtx(e,n),a?H(n,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&H(n,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Rd.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"email",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")qa||(qa=new RegExp(Ld,"u")),qa.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"emoji",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")$d.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"uuid",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Dd.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Fd.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid2",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Od.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ulid",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),H(n,{validation:"url",code:L.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"regex",code:L.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),H(n,{code:L.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:L.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:L.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Nd(s).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:L.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?zd(e.data,s.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ip",code:L.invalid_string,message:s.message}),i.dirty()):ve.assertNever(s);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:L.invalid_string,...te.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...te.errToObj(e)})}url(e){return this._addCheck({kind:"url",...te.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...te.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...te.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...te.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...te.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...te.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...te.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...te.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...te.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...te.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...te.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...te.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...te.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...te.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...te.errToObj(r)})}nonempty(e){return this.min(1,te.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cr.create=t=>{var e;return new cr({checks:[],typeName:ne.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...oe(t)})};function jd(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return s%a/Math.pow(10,n)}var kr=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==j.number){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:j.number,received:s.parsedType}),ae}let i,n=new Je;for(let s of this._def.checks)s.kind==="int"?ve.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:L.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?jd(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:L.not_finite,message:s.message}),n.dirty()):ve.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,te.toString(r))}gt(e,r){return this.setLimit("min",e,!1,te.toString(r))}lte(e,r){return this.setLimit("max",e,!0,te.toString(r))}lt(e,r){return this.setLimit("max",e,!1,te.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:te.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:te.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:te.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:te.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ve.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};kr.create=t=>new kr({checks:[],typeName:ne.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Er=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==j.bigint){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:j.bigint,received:s.parsedType}),ae}let i,n=new Je;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):ve.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,te.toString(r))}gt(e,r){return this.setLimit("min",e,!1,te.toString(r))}lte(e,r){return this.setLimit("max",e,!0,te.toString(r))}lt(e,r){return this.setLimit("max",e,!1,te.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:te.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:te.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Er.create=t=>{var e;return new Er({checks:[],typeName:ne.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...oe(t)})};var Pr=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.boolean,received:i.parsedType}),ae}return et(e.data)}};Pr.create=t=>new Pr({typeName:ne.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var Ar=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:j.date,received:s.parsedType}),ae}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_date}),ae}let i=new Je,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:L.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:L.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):ve.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:te.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:te.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Ar.create=t=>new Ar({checks:[],coerce:t?.coerce||!1,typeName:ne.ZodDate,...oe(t)});var si=class extends le{_parse(e){if(this._getType(e)!==j.symbol){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.symbol,received:i.parsedType}),ae}return et(e.data)}};si.create=t=>new si({typeName:ne.ZodSymbol,...oe(t)});var Cr=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.undefined,received:i.parsedType}),ae}return et(e.data)}};Cr.create=t=>new Cr({typeName:ne.ZodUndefined,...oe(t)});var Tr=class extends le{_parse(e){if(this._getType(e)!==j.null){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.null,received:i.parsedType}),ae}return et(e.data)}};Tr.create=t=>new Tr({typeName:ne.ZodNull,...oe(t)});var ur=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return et(e.data)}};ur.create=t=>new ur({typeName:ne.ZodAny,...oe(t)});var Zt=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return et(e.data)}};Zt.create=t=>new Zt({typeName:ne.ZodUnknown,...oe(t)});var Rt=class extends le{_parse(e){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:j.never,received:r.parsedType}),ae}};Rt.create=t=>new Rt({typeName:ne.ZodNever,...oe(t)});var ai=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.void,received:i.parsedType}),ae}return et(e.data)}};ai.create=t=>new ai({typeName:ne.ZodVoid,...oe(t)});var Yt=class t extends le{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==j.array)return H(r,{code:L.invalid_type,expected:j.array,received:r.parsedType}),ae;if(n.exactLength!==null){let a=r.data.length>n.exactLength.value,o=r.data.length<n.exactLength.value;(a||o)&&(H(r,{code:a?L.too_big:L.too_small,minimum:o?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(H(r,{code:L.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(H(r,{code:L.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>n.type._parseAsync(new Pt(r,a,r.path,o)))).then(a=>Je.mergeArray(i,a));let s=[...r.data].map((a,o)=>n.type._parseSync(new Pt(r,a,r.path,o)));return Je.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:te.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:te.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:te.toString(r)}})}nonempty(e){return this.min(1,e)}};Yt.create=(t,e)=>new Yt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...oe(e)});function ni(t){if(t instanceof ot){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=$t.create(ni(i))}return new ot({...t._def,shape:()=>e})}else return t instanceof Yt?new Yt({...t._def,type:ni(t.element)}):t instanceof $t?$t.create(ni(t.unwrap())):t instanceof Jt?Jt.create(ni(t.unwrap())):t instanceof Vt?Vt.create(t.items.map(e=>ni(e))):t}var ot=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ve.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==j.object){let h=this._getOrReturnCtx(e);return H(h,{code:L.invalid_type,expected:j.object,received:h.parsedType}),ae}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Rt&&this._def.unknownKeys==="strip"))for(let h in n.data)a.includes(h)||o.push(h);let l=[];for(let h of a){let c=s[h],u=n.data[h];l.push({key:{status:"valid",value:h},value:c._parse(new Pt(n,u,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Rt){let h=this._def.unknownKeys;if(h==="passthrough")for(let c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(h==="strict")o.length>0&&(H(n,{code:L.unrecognized_keys,keys:o}),i.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let c of o){let u=n.data[c];l.push({key:{status:"valid",value:c},value:h._parse(new Pt(n,u,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let h=[];for(let c of l){let u=await c.key;h.push({key:u,value:await c.value,alwaysSet:c.alwaysSet})}return h}).then(h=>Je.mergeObjectSync(i,h)):Je.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return te.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,a,o;let l=(a=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&a!==void 0?a:i.defaultError;return r.code==="unrecognized_keys"?{message:(o=te.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ne.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return ve.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return ve.objectKeys(this.shape).forEach(i=>{e[i]||(r[i]=this.shape[i])}),new t({...this._def,shape:()=>r})}deepPartial(){return ni(this)}partial(e){let r={};return ve.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return ve.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof $t;)s=s._def.innerType;r[i]=s}}),new t({...this._def,shape:()=>r})}keyof(){return lh(ve.objectKeys(this.shape))}};ot.create=(t,e)=>new ot({shape:()=>t,unknownKeys:"strip",catchall:Rt.create(),typeName:ne.ZodObject,...oe(e)});ot.strictCreate=(t,e)=>new ot({shape:()=>t,unknownKeys:"strict",catchall:Rt.create(),typeName:ne.ZodObject,...oe(e)});ot.lazycreate=(t,e)=>new ot({shape:t,unknownKeys:"strip",catchall:Rt.create(),typeName:ne.ZodObject,...oe(e)});var Ir=class extends le{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(o=>new gt(o.ctx.common.issues));return H(r,{code:L.invalid_union,unionErrors:a}),ae}if(r.common.async)return Promise.all(i.map(async s=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let s,a=[];for(let l of i){let h={...r,common:{...r.common,issues:[]},parent:null},c=l._parseSync({data:r.data,path:r.path,parent:h});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:h}),h.common.issues.length&&a.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(l=>new gt(l));return H(r,{code:L.invalid_union,unionErrors:o}),ae}}get options(){return this._def.options}};Ir.create=(t,e)=>new Ir({options:t,typeName:ne.ZodUnion,...oe(e)});var qn=t=>t instanceof Dr?qn(t.schema):t instanceof yt?qn(t.innerType()):t instanceof Fr?[t.value]:t instanceof Or?t.options:t instanceof $r?Object.keys(t.enum):t instanceof Rr?qn(t._def.innerType):t instanceof Cr?[void 0]:t instanceof Tr?[null]:null,Yn=class t extends le{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==j.object)return H(r,{code:L.invalid_type,expected:j.object,received:r.parsedType}),ae;let i=this.discriminator,n=r.data[i],s=this.optionsMap.get(n);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(H(r,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let s of r){let a=qn(s.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,s)}}return new t({typeName:ne.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...oe(i)})}};function Ya(t,e){let r=hr(t),i=hr(e);if(t===e)return{valid:!0,data:t};if(r===j.object&&i===j.object){let n=ve.objectKeys(e),s=ve.objectKeys(t).filter(o=>n.indexOf(o)!==-1),a={...t,...e};for(let o of s){let l=Ya(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(r===j.array&&i===j.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let a=t[s],o=e[s],l=Ya(a,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===j.date&&i===j.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Mr=class extends le{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,a)=>{if(Wa(s)||Wa(a))return ae;let o=Ya(s.value,a.value);return o.valid?((Za(s)||Za(a))&&r.dirty(),{status:r.value,value:o.data}):(H(i,{code:L.invalid_intersection_types}),ae)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>n(s,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Mr.create=(t,e,r)=>new Mr({left:t,right:e,typeName:ne.ZodIntersection,...oe(r)});var Vt=class t extends le{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.array)return H(i,{code:L.invalid_type,expected:j.array,received:i.parsedType}),ae;if(i.data.length<this._def.items.length)return H(i,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&i.data.length>this._def.items.length&&(H(i,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((a,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new Pt(i,a,i.path,o)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>Je.mergeArray(r,a)):Je.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Vt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vt({items:t,typeName:ne.ZodTuple,rest:null,...oe(e)})};var Jn=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.object)return H(i,{code:L.invalid_type,expected:j.object,received:i.parsedType}),ae;let n=[],s=this._def.keyType,a=this._def.valueType;for(let o in i.data)n.push({key:s._parse(new Pt(i,o,i.path,o)),value:a._parse(new Pt(i,i.data[o],i.path,o))});return i.common.async?Je.mergeObjectAsync(r,n):Je.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof le?new t({keyType:e,valueType:r,typeName:ne.ZodRecord,...oe(i)}):new t({keyType:cr.create(),valueType:e,typeName:ne.ZodRecord,...oe(r)})}},oi=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.map)return H(i,{code:L.invalid_type,expected:j.map,received:i.parsedType}),ae;let n=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([o,l],h)=>({key:n._parse(new Pt(i,o,i.path,[h,"key"])),value:s._parse(new Pt(i,l,i.path,[h,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of a){let h=await l.key,c=await l.value;if(h.status==="aborted"||c.status==="aborted")return ae;(h.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(h.value,c.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of a){let h=l.key,c=l.value;if(h.status==="aborted"||c.status==="aborted")return ae;(h.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(h.value,c.value)}return{status:r.value,value:o}}}};oi.create=(t,e,r)=>new oi({valueType:e,keyType:t,typeName:ne.ZodMap,...oe(r)});var li=class t extends le{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.set)return H(i,{code:L.invalid_type,expected:j.set,received:i.parsedType}),ae;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(H(i,{code:L.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(H(i,{code:L.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let s=this._def.valueType;function a(l){let h=new Set;for(let c of l){if(c.status==="aborted")return ae;c.status==="dirty"&&r.dirty(),h.add(c.value)}return{status:r.value,value:h}}let o=[...i.data.values()].map((l,h)=>s._parse(new Pt(i,l,i.path,h)));return i.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:te.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:te.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};li.create=(t,e)=>new li({valueType:t,minSize:null,maxSize:null,typeName:ne.ZodSet,...oe(e)});var Xn=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==j.function)return H(r,{code:L.invalid_type,expected:j.function,received:r.parsedType}),ae;function i(o,l){return Wn({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Un(),Ji].filter(h=>!!h),issueData:{code:L.invalid_arguments,argumentsError:l}})}function n(o,l){return Wn({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Un(),Ji].filter(h=>!!h),issueData:{code:L.invalid_return_type,returnTypeError:l}})}let s={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof pr){let o=this;return et(async function(...l){let h=new gt([]),c=await o._def.args.parseAsync(l,s).catch(p=>{throw h.addIssue(i(l,p)),h}),u=await Reflect.apply(a,this,c);return await o._def.returns._def.type.parseAsync(u,s).catch(p=>{throw h.addIssue(n(u,p)),h})})}else{let o=this;return et(function(...l){let h=o._def.args.safeParse(l,s);if(!h.success)throw new gt([i(l,h.error)]);let c=Reflect.apply(a,this,h.data),u=o._def.returns.safeParse(c,s);if(!u.success)throw new gt([n(c,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Vt.create(e).rest(Zt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new t({args:e||Vt.create([]).rest(Zt.create()),returns:r||Zt.create(),typeName:ne.ZodFunction,...oe(i)})}},Dr=class extends le{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Dr.create=(t,e)=>new Dr({getter:t,typeName:ne.ZodLazy,...oe(e)});var Fr=class extends le{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return H(r,{received:r.data,code:L.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:e.data}}get value(){return this._def.value}};Fr.create=(t,e)=>new Fr({value:t,typeName:ne.ZodLiteral,...oe(e)});function lh(t,e){return new Or({values:t,typeName:ne.ZodEnum,...oe(e)})}var Or=class t extends le{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return H(r,{expected:ve.joinValues(i),received:r.parsedType,code:L.invalid_type}),ae}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return H(r,{received:r.data,code:L.invalid_enum_value,options:i}),ae}return et(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(r=>!e.includes(r)))}};Or.create=lh;var $r=class extends le{_parse(e){let r=ve.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==j.string&&i.parsedType!==j.number){let n=ve.objectValues(r);return H(i,{expected:ve.joinValues(n),received:i.parsedType,code:L.invalid_type}),ae}if(r.indexOf(e.data)===-1){let n=ve.objectValues(r);return H(i,{received:i.data,code:L.invalid_enum_value,options:n}),ae}return et(e.data)}get enum(){return this._def.values}};$r.create=(t,e)=>new $r({values:t,typeName:ne.ZodNativeEnum,...oe(e)});var pr=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==j.promise&&r.common.async===!1)return H(r,{code:L.invalid_type,expected:j.promise,received:r.parsedType}),ae;let i=r.parsedType===j.promise?r.data:Promise.resolve(r.data);return et(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};pr.create=(t,e)=>new pr({type:t,typeName:ne.ZodPromise,...oe(e)});var yt=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:a=>{H(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let a=n.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:i.path,parent:i})):this._def.schema._parseSync({data:a,path:i.path,parent:i})}if(n.type==="refinement"){let a=o=>{let l=n.refinement(o,s);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?ae:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?ae:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Xi(a))return a;let o=n.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Xi(a)?Promise.resolve(n.transform(a.value,s)).then(o=>({status:r.value,value:o})):a);ve.assertNever(n)}};yt.create=(t,e,r)=>new yt({schema:t,typeName:ne.ZodEffects,effect:e,...oe(r)});yt.createWithPreprocess=(t,e,r)=>new yt({schema:e,effect:{type:"preprocess",transform:t},typeName:ne.ZodEffects,...oe(r)});var $t=class extends le{_parse(e){return this._getType(e)===j.undefined?et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$t.create=(t,e)=>new $t({innerType:t,typeName:ne.ZodOptional,...oe(e)});var Jt=class extends le{_parse(e){return this._getType(e)===j.null?et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Jt.create=(t,e)=>new Jt({innerType:t,typeName:ne.ZodNullable,...oe(e)});var Rr=class extends le{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===j.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rr.create=(t,e)=>new Rr({innerType:t,typeName:ne.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var hi=class extends le{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Zn(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};hi.create=(t,e)=>new hi({innerType:t,typeName:ne.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var ci=class extends le{_parse(e){if(this._getType(e)!==j.nan){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.nan,received:i.parsedType}),ae}return{status:"valid",value:e.data}}};ci.create=t=>new ci({typeName:ne.ZodNaN,...oe(t)});var Gd=Symbol("zod_brand"),Kn=class extends le{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},Ki=class t extends le{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?ae:s.status==="dirty"?(r.dirty(),oh(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?ae:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:ne.ZodPipeline})}},ui=class extends le{_parse(e){let r=this._def.innerType._parse(e);return Xi(r)&&(r.value=Object.freeze(r.value)),r}};ui.create=(t,e)=>new ui({innerType:t,typeName:ne.ZodReadonly,...oe(e)});var hh=(t,e={},r)=>t?ur.create().superRefine((i,n)=>{var s,a;if(!t(i)){let o=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,l=(a=(s=o.fatal)!==null&&s!==void 0?s:r)!==null&&a!==void 0?a:!0,h=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...h,fatal:l})}}):ur.create(),Hd={object:ot.lazycreate},ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));var qd=(t,e={message:`Input not instance of ${t.name}`})=>hh(r=>r instanceof t,e),ch=cr.create,uh=kr.create,Ud=ci.create,Wd=Er.create,ph=Pr.create,Zd=Ar.create,Yd=si.create,Jd=Cr.create,Xd=Tr.create,Kd=ur.create,Qd=Zt.create,ef=Rt.create,tf=ai.create,rf=Yt.create,nf=ot.create,sf=ot.strictCreate,af=Ir.create,of=Yn.create,lf=Mr.create,hf=Vt.create,cf=Jn.create,uf=oi.create,pf=li.create,df=Xn.create,ff=Dr.create,mf=Fr.create,gf=Or.create,yf=$r.create,vf=pr.create,sh=yt.create,bf=$t.create,_f=Jt.create,wf=yt.createWithPreprocess,xf=Ki.create,Sf=()=>ch().optional(),kf=()=>uh().optional(),Ef=()=>ph().optional(),Pf={string:t=>cr.create({...t,coerce:!0}),number:t=>kr.create({...t,coerce:!0}),boolean:t=>Pr.create({...t,coerce:!0}),bigint:t=>Er.create({...t,coerce:!0}),date:t=>Ar.create({...t,coerce:!0})},Af=ae,me=Object.freeze({__proto__:null,defaultErrorMap:Ji,setErrorMap:Id,getErrorMap:Un,makeIssue:Wn,EMPTY_PATH:Md,addIssueToContext:H,ParseStatus:Je,INVALID:ae,DIRTY:oh,OK:et,isAborted:Wa,isDirty:Za,isValid:Xi,isAsync:Zn,get util(){return ve},get objectUtil(){return Ua},ZodParsedType:j,getParsedType:hr,ZodType:le,ZodString:cr,ZodNumber:kr,ZodBigInt:Er,ZodBoolean:Pr,ZodDate:Ar,ZodSymbol:si,ZodUndefined:Cr,ZodNull:Tr,ZodAny:ur,ZodUnknown:Zt,ZodNever:Rt,ZodVoid:ai,ZodArray:Yt,ZodObject:ot,ZodUnion:Ir,ZodDiscriminatedUnion:Yn,ZodIntersection:Mr,ZodTuple:Vt,ZodRecord:Jn,ZodMap:oi,ZodSet:li,ZodFunction:Xn,ZodLazy:Dr,ZodLiteral:Fr,ZodEnum:Or,ZodNativeEnum:$r,ZodPromise:pr,ZodEffects:yt,ZodTransformer:yt,ZodOptional:$t,ZodNullable:Jt,ZodDefault:Rr,ZodCatch:hi,ZodNaN:ci,BRAND:Gd,ZodBranded:Kn,ZodPipeline:Ki,ZodReadonly:ui,custom:hh,Schema:le,ZodSchema:le,late:Hd,get ZodFirstPartyTypeKind(){return ne},coerce:Pf,any:Kd,array:rf,bigint:Wd,boolean:ph,date:Zd,discriminatedUnion:of,effect:sh,enum:gf,function:df,instanceof:qd,intersection:lf,lazy:ff,literal:mf,map:uf,nan:Ud,nativeEnum:yf,never:ef,null:Xd,nullable:_f,number:uh,object:nf,oboolean:Ef,onumber:kf,optional:bf,ostring:Sf,pipeline:xf,preprocess:wf,promise:vf,record:cf,set:pf,strictObject:sf,string:ch,symbol:Yd,transformer:sh,tuple:hf,undefined:Jd,union:af,unknown:Qd,void:tf,NEVER:Af,ZodIssueCode:L,quotelessJson:Td,ZodError:gt});var ly=me.object({wsApiUrl:me.string(),url:me.string(),logoSvg:me.string().optional(),logoUrl:me.string().optional(),title:me.string(),status:me.string(),color:me.string(),input:me.object({placeholder:me.string()}),bubble:me.object({imageUrl:me.string().optional(),position:me.object({bottom:me.string().optional(),right:me.string().optional(),left:me.string().optional()})}),header:me.object({background:me.string()}),limitations:me.object({title:me.string(),items:me.array(me.string())}),examples:me.object({title:me.string(),items:me.array(me.string())}),instructions:me.object({items:me.array(me.string())}),popup:me.object({enabled:me.boolean().optional(),delayMs:me.number().optional(),text:me.string().optional()}).optional()});function Cf(t){return t.replace(/[^A-Za-z0-9_-]/gi,"")}window.__INIT_MOLIN_SHOP_AI=function(e){if(!e)throw new Error("options is required");let{widgetId:r,config:i}=e;if(!r)throw new Error("widgetId is required");if(!i)throw new Error("config is required");r=Cf(r);let n=document.createElement("molin-shop-ai");n.setAttribute("widget",r),n.config=i,document.body.appendChild(n)};var Qn=window,es=Qn.ShadowRoot&&(Qn.ShadyCSS===void 0||Qn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ja=Symbol(),dh=new WeakMap,Qi=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ja)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(es&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=dh.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&dh.set(r,e))}return e}toString(){return this.cssText}},fh=t=>new Qi(typeof t=="string"?t:t+"",void 0,Ja),Xa=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new Qi(r,t,Ja)},Ka=(t,e)=>{es?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let i=document.createElement("style"),n=Qn.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},ts=es?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return fh(r)})(t):t;var Qa,rs=window,mh=rs.trustedTypes,Tf=mh?mh.emptyScript:"",gh=rs.reactiveElementPolyfillSupport,to={toAttribute(t,e){switch(e){case Boolean:t=t?Tf:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},yh=(t,e)=>e!==t&&(e==e||t==t),eo={attribute:!0,type:String,converter:to,reflect:!1,hasChanged:yh},ro="finalized",Xt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,i)=>{let n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=eo){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){let s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||eo}static finalize(){if(this.hasOwnProperty(ro))return!1;this[ro]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(ts(n))}else e!==void 0&&r.push(ts(e));return r}static _$Ep(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ka(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=eo){var n;let s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){let a=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:to).toAttribute(r,i.type);this._$El=e,a==null?this.removeAttribute(s):this.setAttribute(s,a),this._$El=null}}_$AK(e,r){var i;let n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){let a=n.getPropertyOptions(s),o=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:to;this._$El=s,this[s]=o.fromAttribute(r,a.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||yh)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Xt[ro]=!0,Xt.elementProperties=new Map,Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},gh?.({ReactiveElement:Xt}),((Qa=rs.reactiveElementVersions)!==null&&Qa!==void 0?Qa:rs.reactiveElementVersions=[]).push("1.6.3");var io,is=window,pi=is.trustedTypes,vh=pi?pi.createPolicy("lit-html",{createHTML:t=>t}):void 0,ns="$lit$",Kt=`lit$${(Math.random()+"").slice(9)}$`,so="?"+Kt,If=`<${so}>`,Vr=document,tn=()=>Vr.createComment(""),rn=t=>t===null||typeof t!="object"&&typeof t!="function",Eh=Array.isArray,Ph=t=>Eh(t)||typeof t?.[Symbol.iterator]=="function",no=`[
|
|
1
|
+
var Ad=Object.defineProperty;var Cd=(t,e,r)=>e in t?Ad(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ye=(t,e,r)=>(Cd(t,typeof e!="symbol"?e+"":e,r),r),Ha=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var N=(t,e,r)=>(Ha(t,e,"read from private field"),r?r.call(t):e.get(t)),ee=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},ke=(t,e,r,i)=>(Ha(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r);var ih=(t,e,r,i)=>({set _(n){ke(t,e,n,r)},get _(){return N(t,e,i)}}),ce=(t,e,r)=>(Ha(t,e,"access private method"),r);var ve;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let s={};for(let a of n)s[a]=a;return s},t.getValidEnumValues=n=>{let s=t.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),a={};for(let o of s)a[o]=n[o];return t.objectValues(a)},t.objectValues=n=>t.objectKeys(n).map(function(s){return n[s]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.push(a);return s},t.find=(n,s)=>{for(let a of n)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,s=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(ve||(ve={}));var Ua;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ua||(Ua={}));var j=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hr=t=>{switch(typeof t){case"undefined":return j.undefined;case"string":return j.string;case"number":return isNaN(t)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(t)?j.array:t===null?j.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?j.promise:typeof Map<"u"&&t instanceof Map?j.map:typeof Set<"u"&&t instanceof Set?j.set:typeof Date<"u"&&t instanceof Date?j.date:j.object;default:return j.unknown}},L=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Td=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),gt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},i={_errors:[]},n=s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let o=i,l=0;for(;l<a.path.length;){let h=a.path[l];l===a.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(r(a))):o[h]=o[h]||{_errors:[]},o=o[h],l++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};gt.create=t=>new gt(t);var Ji=(t,e)=>{let r;switch(t.code){case L.invalid_type:t.received===j.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ve.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:r=`Unrecognized key(s) in object: ${ve.joinValues(t.keys,", ")}`;break;case L.invalid_union:r="Invalid input";break;case L.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ve.joinValues(t.options)}`;break;case L.invalid_enum_value:r=`Invalid enum value. Expected ${ve.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:r="Invalid function arguments";break;case L.invalid_return_type:r="Invalid function return type";break;case L.invalid_date:r="Invalid date";break;case L.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ve.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case L.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case L.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case L.custom:r="Invalid input";break;case L.invalid_intersection_types:r="Intersection results could not be merged";break;case L.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:r="Number must be finite";break;default:r=e.defaultError,ve.assertNever(t)}return{message:r}},ah=Ji;function Id(t){ah=t}function Un(){return ah}var Wn=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],a={...n,path:s},o="",l=i.filter(h=>!!h).slice().reverse();for(let h of l)o=h(a,{data:e,defaultError:o}).message;return{...n,path:s,message:n.message||o}},Md=[];function H(t,e){let r=Wn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Un(),Ji].filter(i=>!!i)});t.common.issues.push(r)}var Je=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return ae;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:a}=n;if(s.status==="aborted"||a.status==="aborted")return ae;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[s.value]=a.value)}return{status:e.value,value:i}}},ae=Object.freeze({status:"aborted"}),oh=t=>({status:"dirty",value:t}),et=t=>({status:"valid",value:t}),Wa=t=>t.status==="aborted",Za=t=>t.status==="dirty",Xi=t=>t.status==="valid",Zn=t=>typeof Promise<"u"&&t instanceof Promise,te;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(te||(te={}));var Pt=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},nh=(t,e)=>{if(Xi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new gt(t.common.issues);return this._error=r,this._error}}};function oe(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,o)=>a.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:i??o.defaultError}:{message:r??o.defaultError},description:n}}var le=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return hr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Je,ctx:{common:e.parent.common,data:e.data,parsedType:hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Zn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hr(e)},s=this._parseSync({data:e,path:n.path,parent:n});return nh(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hr(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(Zn(n)?n:Promise.resolve(n));return nh(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let a=e(n),o=()=>s.addIssue({code:L.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new yt({schema:this,typeName:ne.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $t.create(this,this._def)}nullable(){return Jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yt.create(this,this._def)}promise(){return pr.create(this,this._def)}or(e){return Ir.create([this,e],this._def)}and(e){return Mr.create(this,e,this._def)}transform(e){return new yt({...oe(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Rr({...oe(this._def),innerType:this,defaultValue:r,typeName:ne.ZodDefault})}brand(){return new Kn({typeName:ne.ZodBranded,type:this,...oe(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new hi({...oe(this._def),innerType:this,catchValue:r,typeName:ne.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ki.create(this,e)}readonly(){return ui.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Dd=/^c[^\s-]{8,}$/i,Fd=/^[a-z][a-z0-9]*$/,Od=/^[0-9A-HJKMNP-TV-Z]{26}$/,$d=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rd=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ld="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qa,Bd=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Vd=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Nd=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function zd(t,e){return!!((e==="v4"||!e)&&Bd.test(t)||(e==="v6"||!e)&&Vd.test(t))}var cr=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:j.string,received:s.parsedType}),ae}let i=new Je,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(n=this._getOrReturnCtx(e,n),a?H(n,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&H(n,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Rd.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"email",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")qa||(qa=new RegExp(Ld,"u")),qa.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"emoji",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")$d.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"uuid",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Dd.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Fd.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid2",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Od.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ulid",code:L.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),H(n,{validation:"url",code:L.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"regex",code:L.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),H(n,{code:L.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:L.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:L.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Nd(s).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:L.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?zd(e.data,s.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ip",code:L.invalid_string,message:s.message}),i.dirty()):ve.assertNever(s);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:L.invalid_string,...te.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...te.errToObj(e)})}url(e){return this._addCheck({kind:"url",...te.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...te.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...te.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...te.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...te.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...te.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...te.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...te.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...te.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...te.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...te.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...te.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...te.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...te.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...te.errToObj(r)})}nonempty(e){return this.min(1,te.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cr.create=t=>{var e;return new cr({checks:[],typeName:ne.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...oe(t)})};function jd(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return s%a/Math.pow(10,n)}var kr=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==j.number){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:j.number,received:s.parsedType}),ae}let i,n=new Je;for(let s of this._def.checks)s.kind==="int"?ve.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:L.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?jd(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:L.not_finite,message:s.message}),n.dirty()):ve.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,te.toString(r))}gt(e,r){return this.setLimit("min",e,!1,te.toString(r))}lte(e,r){return this.setLimit("max",e,!0,te.toString(r))}lt(e,r){return this.setLimit("max",e,!1,te.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:te.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:te.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:te.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:te.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ve.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};kr.create=t=>new kr({checks:[],typeName:ne.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Er=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==j.bigint){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:j.bigint,received:s.parsedType}),ae}let i,n=new Je;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),H(i,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):ve.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,te.toString(r))}gt(e,r){return this.setLimit("min",e,!1,te.toString(r))}lte(e,r){return this.setLimit("max",e,!0,te.toString(r))}lt(e,r){return this.setLimit("max",e,!1,te.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:te.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:te.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Er.create=t=>{var e;return new Er({checks:[],typeName:ne.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...oe(t)})};var Pr=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.boolean,received:i.parsedType}),ae}return et(e.data)}};Pr.create=t=>new Pr({typeName:ne.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var Ar=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:j.date,received:s.parsedType}),ae}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_date}),ae}let i=new Je,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:L.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:L.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):ve.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:te.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:te.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Ar.create=t=>new Ar({checks:[],coerce:t?.coerce||!1,typeName:ne.ZodDate,...oe(t)});var si=class extends le{_parse(e){if(this._getType(e)!==j.symbol){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.symbol,received:i.parsedType}),ae}return et(e.data)}};si.create=t=>new si({typeName:ne.ZodSymbol,...oe(t)});var Cr=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.undefined,received:i.parsedType}),ae}return et(e.data)}};Cr.create=t=>new Cr({typeName:ne.ZodUndefined,...oe(t)});var Tr=class extends le{_parse(e){if(this._getType(e)!==j.null){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.null,received:i.parsedType}),ae}return et(e.data)}};Tr.create=t=>new Tr({typeName:ne.ZodNull,...oe(t)});var ur=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return et(e.data)}};ur.create=t=>new ur({typeName:ne.ZodAny,...oe(t)});var Zt=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return et(e.data)}};Zt.create=t=>new Zt({typeName:ne.ZodUnknown,...oe(t)});var Rt=class extends le{_parse(e){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:j.never,received:r.parsedType}),ae}};Rt.create=t=>new Rt({typeName:ne.ZodNever,...oe(t)});var ai=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.void,received:i.parsedType}),ae}return et(e.data)}};ai.create=t=>new ai({typeName:ne.ZodVoid,...oe(t)});var Yt=class t extends le{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==j.array)return H(r,{code:L.invalid_type,expected:j.array,received:r.parsedType}),ae;if(n.exactLength!==null){let a=r.data.length>n.exactLength.value,o=r.data.length<n.exactLength.value;(a||o)&&(H(r,{code:a?L.too_big:L.too_small,minimum:o?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(H(r,{code:L.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(H(r,{code:L.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>n.type._parseAsync(new Pt(r,a,r.path,o)))).then(a=>Je.mergeArray(i,a));let s=[...r.data].map((a,o)=>n.type._parseSync(new Pt(r,a,r.path,o)));return Je.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:te.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:te.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:te.toString(r)}})}nonempty(e){return this.min(1,e)}};Yt.create=(t,e)=>new Yt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...oe(e)});function ni(t){if(t instanceof ot){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=$t.create(ni(i))}return new ot({...t._def,shape:()=>e})}else return t instanceof Yt?new Yt({...t._def,type:ni(t.element)}):t instanceof $t?$t.create(ni(t.unwrap())):t instanceof Jt?Jt.create(ni(t.unwrap())):t instanceof Vt?Vt.create(t.items.map(e=>ni(e))):t}var ot=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ve.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==j.object){let h=this._getOrReturnCtx(e);return H(h,{code:L.invalid_type,expected:j.object,received:h.parsedType}),ae}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Rt&&this._def.unknownKeys==="strip"))for(let h in n.data)a.includes(h)||o.push(h);let l=[];for(let h of a){let c=s[h],u=n.data[h];l.push({key:{status:"valid",value:h},value:c._parse(new Pt(n,u,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Rt){let h=this._def.unknownKeys;if(h==="passthrough")for(let c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(h==="strict")o.length>0&&(H(n,{code:L.unrecognized_keys,keys:o}),i.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let c of o){let u=n.data[c];l.push({key:{status:"valid",value:c},value:h._parse(new Pt(n,u,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let h=[];for(let c of l){let u=await c.key;h.push({key:u,value:await c.value,alwaysSet:c.alwaysSet})}return h}).then(h=>Je.mergeObjectSync(i,h)):Je.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return te.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,a,o;let l=(a=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&a!==void 0?a:i.defaultError;return r.code==="unrecognized_keys"?{message:(o=te.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ne.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return ve.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return ve.objectKeys(this.shape).forEach(i=>{e[i]||(r[i]=this.shape[i])}),new t({...this._def,shape:()=>r})}deepPartial(){return ni(this)}partial(e){let r={};return ve.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return ve.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof $t;)s=s._def.innerType;r[i]=s}}),new t({...this._def,shape:()=>r})}keyof(){return lh(ve.objectKeys(this.shape))}};ot.create=(t,e)=>new ot({shape:()=>t,unknownKeys:"strip",catchall:Rt.create(),typeName:ne.ZodObject,...oe(e)});ot.strictCreate=(t,e)=>new ot({shape:()=>t,unknownKeys:"strict",catchall:Rt.create(),typeName:ne.ZodObject,...oe(e)});ot.lazycreate=(t,e)=>new ot({shape:t,unknownKeys:"strip",catchall:Rt.create(),typeName:ne.ZodObject,...oe(e)});var Ir=class extends le{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(o=>new gt(o.ctx.common.issues));return H(r,{code:L.invalid_union,unionErrors:a}),ae}if(r.common.async)return Promise.all(i.map(async s=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let s,a=[];for(let l of i){let h={...r,common:{...r.common,issues:[]},parent:null},c=l._parseSync({data:r.data,path:r.path,parent:h});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:h}),h.common.issues.length&&a.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(l=>new gt(l));return H(r,{code:L.invalid_union,unionErrors:o}),ae}}get options(){return this._def.options}};Ir.create=(t,e)=>new Ir({options:t,typeName:ne.ZodUnion,...oe(e)});var qn=t=>t instanceof Dr?qn(t.schema):t instanceof yt?qn(t.innerType()):t instanceof Fr?[t.value]:t instanceof Or?t.options:t instanceof $r?Object.keys(t.enum):t instanceof Rr?qn(t._def.innerType):t instanceof Cr?[void 0]:t instanceof Tr?[null]:null,Yn=class t extends le{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==j.object)return H(r,{code:L.invalid_type,expected:j.object,received:r.parsedType}),ae;let i=this.discriminator,n=r.data[i],s=this.optionsMap.get(n);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(H(r,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let s of r){let a=qn(s.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,s)}}return new t({typeName:ne.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...oe(i)})}};function Ya(t,e){let r=hr(t),i=hr(e);if(t===e)return{valid:!0,data:t};if(r===j.object&&i===j.object){let n=ve.objectKeys(e),s=ve.objectKeys(t).filter(o=>n.indexOf(o)!==-1),a={...t,...e};for(let o of s){let l=Ya(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(r===j.array&&i===j.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let a=t[s],o=e[s],l=Ya(a,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===j.date&&i===j.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Mr=class extends le{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,a)=>{if(Wa(s)||Wa(a))return ae;let o=Ya(s.value,a.value);return o.valid?((Za(s)||Za(a))&&r.dirty(),{status:r.value,value:o.data}):(H(i,{code:L.invalid_intersection_types}),ae)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>n(s,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Mr.create=(t,e,r)=>new Mr({left:t,right:e,typeName:ne.ZodIntersection,...oe(r)});var Vt=class t extends le{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.array)return H(i,{code:L.invalid_type,expected:j.array,received:i.parsedType}),ae;if(i.data.length<this._def.items.length)return H(i,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&i.data.length>this._def.items.length&&(H(i,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((a,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new Pt(i,a,i.path,o)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>Je.mergeArray(r,a)):Je.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Vt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vt({items:t,typeName:ne.ZodTuple,rest:null,...oe(e)})};var Jn=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.object)return H(i,{code:L.invalid_type,expected:j.object,received:i.parsedType}),ae;let n=[],s=this._def.keyType,a=this._def.valueType;for(let o in i.data)n.push({key:s._parse(new Pt(i,o,i.path,o)),value:a._parse(new Pt(i,i.data[o],i.path,o))});return i.common.async?Je.mergeObjectAsync(r,n):Je.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof le?new t({keyType:e,valueType:r,typeName:ne.ZodRecord,...oe(i)}):new t({keyType:cr.create(),valueType:e,typeName:ne.ZodRecord,...oe(r)})}},oi=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.map)return H(i,{code:L.invalid_type,expected:j.map,received:i.parsedType}),ae;let n=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([o,l],h)=>({key:n._parse(new Pt(i,o,i.path,[h,"key"])),value:s._parse(new Pt(i,l,i.path,[h,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of a){let h=await l.key,c=await l.value;if(h.status==="aborted"||c.status==="aborted")return ae;(h.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(h.value,c.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of a){let h=l.key,c=l.value;if(h.status==="aborted"||c.status==="aborted")return ae;(h.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(h.value,c.value)}return{status:r.value,value:o}}}};oi.create=(t,e,r)=>new oi({valueType:e,keyType:t,typeName:ne.ZodMap,...oe(r)});var li=class t extends le{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.set)return H(i,{code:L.invalid_type,expected:j.set,received:i.parsedType}),ae;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(H(i,{code:L.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(H(i,{code:L.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let s=this._def.valueType;function a(l){let h=new Set;for(let c of l){if(c.status==="aborted")return ae;c.status==="dirty"&&r.dirty(),h.add(c.value)}return{status:r.value,value:h}}let o=[...i.data.values()].map((l,h)=>s._parse(new Pt(i,l,i.path,h)));return i.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:te.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:te.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};li.create=(t,e)=>new li({valueType:t,minSize:null,maxSize:null,typeName:ne.ZodSet,...oe(e)});var Xn=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==j.function)return H(r,{code:L.invalid_type,expected:j.function,received:r.parsedType}),ae;function i(o,l){return Wn({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Un(),Ji].filter(h=>!!h),issueData:{code:L.invalid_arguments,argumentsError:l}})}function n(o,l){return Wn({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Un(),Ji].filter(h=>!!h),issueData:{code:L.invalid_return_type,returnTypeError:l}})}let s={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof pr){let o=this;return et(async function(...l){let h=new gt([]),c=await o._def.args.parseAsync(l,s).catch(p=>{throw h.addIssue(i(l,p)),h}),u=await Reflect.apply(a,this,c);return await o._def.returns._def.type.parseAsync(u,s).catch(p=>{throw h.addIssue(n(u,p)),h})})}else{let o=this;return et(function(...l){let h=o._def.args.safeParse(l,s);if(!h.success)throw new gt([i(l,h.error)]);let c=Reflect.apply(a,this,h.data),u=o._def.returns.safeParse(c,s);if(!u.success)throw new gt([n(c,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Vt.create(e).rest(Zt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new t({args:e||Vt.create([]).rest(Zt.create()),returns:r||Zt.create(),typeName:ne.ZodFunction,...oe(i)})}},Dr=class extends le{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Dr.create=(t,e)=>new Dr({getter:t,typeName:ne.ZodLazy,...oe(e)});var Fr=class extends le{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return H(r,{received:r.data,code:L.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:e.data}}get value(){return this._def.value}};Fr.create=(t,e)=>new Fr({value:t,typeName:ne.ZodLiteral,...oe(e)});function lh(t,e){return new Or({values:t,typeName:ne.ZodEnum,...oe(e)})}var Or=class t extends le{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return H(r,{expected:ve.joinValues(i),received:r.parsedType,code:L.invalid_type}),ae}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return H(r,{received:r.data,code:L.invalid_enum_value,options:i}),ae}return et(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(r=>!e.includes(r)))}};Or.create=lh;var $r=class extends le{_parse(e){let r=ve.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==j.string&&i.parsedType!==j.number){let n=ve.objectValues(r);return H(i,{expected:ve.joinValues(n),received:i.parsedType,code:L.invalid_type}),ae}if(r.indexOf(e.data)===-1){let n=ve.objectValues(r);return H(i,{received:i.data,code:L.invalid_enum_value,options:n}),ae}return et(e.data)}get enum(){return this._def.values}};$r.create=(t,e)=>new $r({values:t,typeName:ne.ZodNativeEnum,...oe(e)});var pr=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==j.promise&&r.common.async===!1)return H(r,{code:L.invalid_type,expected:j.promise,received:r.parsedType}),ae;let i=r.parsedType===j.promise?r.data:Promise.resolve(r.data);return et(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};pr.create=(t,e)=>new pr({type:t,typeName:ne.ZodPromise,...oe(e)});var yt=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:a=>{H(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let a=n.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:i.path,parent:i})):this._def.schema._parseSync({data:a,path:i.path,parent:i})}if(n.type==="refinement"){let a=o=>{let l=n.refinement(o,s);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?ae:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?ae:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Xi(a))return a;let o=n.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Xi(a)?Promise.resolve(n.transform(a.value,s)).then(o=>({status:r.value,value:o})):a);ve.assertNever(n)}};yt.create=(t,e,r)=>new yt({schema:t,typeName:ne.ZodEffects,effect:e,...oe(r)});yt.createWithPreprocess=(t,e,r)=>new yt({schema:e,effect:{type:"preprocess",transform:t},typeName:ne.ZodEffects,...oe(r)});var $t=class extends le{_parse(e){return this._getType(e)===j.undefined?et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$t.create=(t,e)=>new $t({innerType:t,typeName:ne.ZodOptional,...oe(e)});var Jt=class extends le{_parse(e){return this._getType(e)===j.null?et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Jt.create=(t,e)=>new Jt({innerType:t,typeName:ne.ZodNullable,...oe(e)});var Rr=class extends le{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===j.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rr.create=(t,e)=>new Rr({innerType:t,typeName:ne.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var hi=class extends le{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Zn(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};hi.create=(t,e)=>new hi({innerType:t,typeName:ne.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var ci=class extends le{_parse(e){if(this._getType(e)!==j.nan){let i=this._getOrReturnCtx(e);return H(i,{code:L.invalid_type,expected:j.nan,received:i.parsedType}),ae}return{status:"valid",value:e.data}}};ci.create=t=>new ci({typeName:ne.ZodNaN,...oe(t)});var Gd=Symbol("zod_brand"),Kn=class extends le{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},Ki=class t extends le{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?ae:s.status==="dirty"?(r.dirty(),oh(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?ae:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:ne.ZodPipeline})}},ui=class extends le{_parse(e){let r=this._def.innerType._parse(e);return Xi(r)&&(r.value=Object.freeze(r.value)),r}};ui.create=(t,e)=>new ui({innerType:t,typeName:ne.ZodReadonly,...oe(e)});var hh=(t,e={},r)=>t?ur.create().superRefine((i,n)=>{var s,a;if(!t(i)){let o=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,l=(a=(s=o.fatal)!==null&&s!==void 0?s:r)!==null&&a!==void 0?a:!0,h=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...h,fatal:l})}}):ur.create(),Hd={object:ot.lazycreate},ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));var qd=(t,e={message:`Input not instance of ${t.name}`})=>hh(r=>r instanceof t,e),ch=cr.create,uh=kr.create,Ud=ci.create,Wd=Er.create,ph=Pr.create,Zd=Ar.create,Yd=si.create,Jd=Cr.create,Xd=Tr.create,Kd=ur.create,Qd=Zt.create,ef=Rt.create,tf=ai.create,rf=Yt.create,nf=ot.create,sf=ot.strictCreate,af=Ir.create,of=Yn.create,lf=Mr.create,hf=Vt.create,cf=Jn.create,uf=oi.create,pf=li.create,df=Xn.create,ff=Dr.create,mf=Fr.create,gf=Or.create,yf=$r.create,vf=pr.create,sh=yt.create,bf=$t.create,_f=Jt.create,wf=yt.createWithPreprocess,xf=Ki.create,Sf=()=>ch().optional(),kf=()=>uh().optional(),Ef=()=>ph().optional(),Pf={string:t=>cr.create({...t,coerce:!0}),number:t=>kr.create({...t,coerce:!0}),boolean:t=>Pr.create({...t,coerce:!0}),bigint:t=>Er.create({...t,coerce:!0}),date:t=>Ar.create({...t,coerce:!0})},Af=ae,fe=Object.freeze({__proto__:null,defaultErrorMap:Ji,setErrorMap:Id,getErrorMap:Un,makeIssue:Wn,EMPTY_PATH:Md,addIssueToContext:H,ParseStatus:Je,INVALID:ae,DIRTY:oh,OK:et,isAborted:Wa,isDirty:Za,isValid:Xi,isAsync:Zn,get util(){return ve},get objectUtil(){return Ua},ZodParsedType:j,getParsedType:hr,ZodType:le,ZodString:cr,ZodNumber:kr,ZodBigInt:Er,ZodBoolean:Pr,ZodDate:Ar,ZodSymbol:si,ZodUndefined:Cr,ZodNull:Tr,ZodAny:ur,ZodUnknown:Zt,ZodNever:Rt,ZodVoid:ai,ZodArray:Yt,ZodObject:ot,ZodUnion:Ir,ZodDiscriminatedUnion:Yn,ZodIntersection:Mr,ZodTuple:Vt,ZodRecord:Jn,ZodMap:oi,ZodSet:li,ZodFunction:Xn,ZodLazy:Dr,ZodLiteral:Fr,ZodEnum:Or,ZodNativeEnum:$r,ZodPromise:pr,ZodEffects:yt,ZodTransformer:yt,ZodOptional:$t,ZodNullable:Jt,ZodDefault:Rr,ZodCatch:hi,ZodNaN:ci,BRAND:Gd,ZodBranded:Kn,ZodPipeline:Ki,ZodReadonly:ui,custom:hh,Schema:le,ZodSchema:le,late:Hd,get ZodFirstPartyTypeKind(){return ne},coerce:Pf,any:Kd,array:rf,bigint:Wd,boolean:ph,date:Zd,discriminatedUnion:of,effect:sh,enum:gf,function:df,instanceof:qd,intersection:lf,lazy:ff,literal:mf,map:uf,nan:Ud,nativeEnum:yf,never:ef,null:Xd,nullable:_f,number:uh,object:nf,oboolean:Ef,onumber:kf,optional:bf,ostring:Sf,pipeline:xf,preprocess:wf,promise:vf,record:cf,set:pf,strictObject:sf,string:ch,symbol:Yd,transformer:sh,tuple:hf,undefined:Jd,union:af,unknown:Qd,void:tf,NEVER:Af,ZodIssueCode:L,quotelessJson:Td,ZodError:gt});var ly=fe.object({wsApiUrl:fe.string(),url:fe.string(),logoSvg:fe.string().optional(),logoUrl:fe.string().optional(),title:fe.string(),status:fe.string(),color:fe.string(),showStillLearningBanner:fe.boolean().optional(),input:fe.object({placeholder:fe.string()}),bubble:fe.object({imageUrl:fe.string().optional(),position:fe.object({bottom:fe.string().optional(),right:fe.string().optional(),left:fe.string().optional()})}),header:fe.object({background:fe.string()}),limitations:fe.object({title:fe.string(),items:fe.array(fe.string())}),examples:fe.object({title:fe.string(),items:fe.array(fe.string())}),instructions:fe.object({items:fe.array(fe.string())}),popup:fe.object({enabled:fe.boolean().optional(),delayMs:fe.number().optional(),text:fe.string().optional()}).optional()});function Cf(t){return t.replace(/[^A-Za-z0-9_-]/gi,"")}window.__INIT_MOLIN_SHOP_AI=function(e){if(!e)throw new Error("options is required");let{widgetId:r,config:i}=e;if(!r)throw new Error("widgetId is required");if(!i)throw new Error("config is required");r=Cf(r);let n=document.createElement("molin-shop-ai");n.setAttribute("widget",r),n.config=i,document.body.appendChild(n)};var Qn=window,es=Qn.ShadowRoot&&(Qn.ShadyCSS===void 0||Qn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ja=Symbol(),dh=new WeakMap,Qi=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ja)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(es&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=dh.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&dh.set(r,e))}return e}toString(){return this.cssText}},fh=t=>new Qi(typeof t=="string"?t:t+"",void 0,Ja),Xa=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new Qi(r,t,Ja)},Ka=(t,e)=>{es?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let i=document.createElement("style"),n=Qn.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},ts=es?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return fh(r)})(t):t;var Qa,rs=window,mh=rs.trustedTypes,Tf=mh?mh.emptyScript:"",gh=rs.reactiveElementPolyfillSupport,to={toAttribute(t,e){switch(e){case Boolean:t=t?Tf:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},yh=(t,e)=>e!==t&&(e==e||t==t),eo={attribute:!0,type:String,converter:to,reflect:!1,hasChanged:yh},ro="finalized",Xt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,i)=>{let n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=eo){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){let s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||eo}static finalize(){if(this.hasOwnProperty(ro))return!1;this[ro]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(ts(n))}else e!==void 0&&r.push(ts(e));return r}static _$Ep(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ka(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=eo){var n;let s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){let a=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:to).toAttribute(r,i.type);this._$El=e,a==null?this.removeAttribute(s):this.setAttribute(s,a),this._$El=null}}_$AK(e,r){var i;let n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){let a=n.getPropertyOptions(s),o=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:to;this._$El=s,this[s]=o.fromAttribute(r,a.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||yh)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Xt[ro]=!0,Xt.elementProperties=new Map,Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},gh?.({ReactiveElement:Xt}),((Qa=rs.reactiveElementVersions)!==null&&Qa!==void 0?Qa:rs.reactiveElementVersions=[]).push("1.6.3");var io,is=window,pi=is.trustedTypes,vh=pi?pi.createPolicy("lit-html",{createHTML:t=>t}):void 0,ns="$lit$",Kt=`lit$${(Math.random()+"").slice(9)}$`,so="?"+Kt,If=`<${so}>`,Vr=document,tn=()=>Vr.createComment(""),rn=t=>t===null||typeof t!="object"&&typeof t!="function",Eh=Array.isArray,Ph=t=>Eh(t)||typeof t?.[Symbol.iterator]=="function",no=`[
|
|
2
2
|
\f\r]`,en=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bh=/-->/g,_h=/>/g,Lr=RegExp(`>|${no}(?:([^\\s"'>=/]+)(${no}*=${no}*(?:[^
|
|
3
3
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),wh=/'/g,xh=/"/g,Ah=/^(?:script|style|textarea|title)$/i,Ch=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),pe=Ch(1),vy=Ch(2),vt=Symbol.for("lit-noChange"),Me=Symbol.for("lit-nothing"),Sh=new WeakMap,Br=Vr.createTreeWalker(Vr,129,null,!1);function Th(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return vh!==void 0?vh.createHTML(e):e}var Ih=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":"",a=en;for(let o=0;o<r;o++){let l=t[o],h,c,u=-1,f=0;for(;f<l.length&&(a.lastIndex=f,c=a.exec(l),c!==null);)f=a.lastIndex,a===en?c[1]==="!--"?a=bh:c[1]!==void 0?a=_h:c[2]!==void 0?(Ah.test(c[2])&&(n=RegExp("</"+c[2],"g")),a=Lr):c[3]!==void 0&&(a=Lr):a===Lr?c[0]===">"?(a=n??en,u=-1):c[1]===void 0?u=-2:(u=a.lastIndex-c[2].length,h=c[1],a=c[3]===void 0?Lr:c[3]==='"'?xh:wh):a===xh||a===wh?a=Lr:a===bh||a===_h?a=en:(a=Lr,n=void 0);let p=a===Lr&&t[o+1].startsWith("/>")?" ":"";s+=a===en?l+If:u>=0?(i.push(h),l.slice(0,u)+ns+l.slice(u)+Kt+p):l+Kt+(u===-2?(i.push(void 0),o):p)}return[Th(t,s+(t[r]||"<?>")+(e===2?"</svg>":"")),i]},nn=class t{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,a=0,o=e.length-1,l=this.parts,[h,c]=Ih(e,r);if(this.el=t.createElement(h,i),Br.currentNode=this.el.content,r===2){let u=this.el.content,f=u.firstChild;f.remove(),u.append(...f.childNodes)}for(;(n=Br.nextNode())!==null&&l.length<o;){if(n.nodeType===1){if(n.hasAttributes()){let u=[];for(let f of n.getAttributeNames())if(f.endsWith(ns)||f.startsWith(Kt)){let p=c[a++];if(u.push(f),p!==void 0){let m=n.getAttribute(p.toLowerCase()+ns).split(Kt),g=/([.?@])?(.*)/.exec(p);l.push({type:1,index:s,name:g[2],strings:m,ctor:g[1]==="."?as:g[1]==="?"?os:g[1]==="@"?ls:zr})}else l.push({type:6,index:s})}for(let f of u)n.removeAttribute(f)}if(Ah.test(n.tagName)){let u=n.textContent.split(Kt),f=u.length-1;if(f>0){n.textContent=pi?pi.emptyScript:"";for(let p=0;p<f;p++)n.append(u[p],tn()),Br.nextNode(),l.push({type:2,index:++s});n.append(u[f],tn())}}}else if(n.nodeType===8)if(n.data===so)l.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(Kt,u+1))!==-1;)l.push({type:7,index:s}),u+=Kt.length-1}s++}}static createElement(e,r){let i=Vr.createElement("template");return i.innerHTML=e,i}};function Nr(t,e,r=t,i){var n,s,a,o;if(e===vt)return e;let l=i!==void 0?(n=r._$Co)===null||n===void 0?void 0:n[i]:r._$Cl,h=rn(e)?void 0:e._$litDirective$;return l?.constructor!==h&&((s=l?._$AO)===null||s===void 0||s.call(l,!1),h===void 0?l=void 0:(l=new h(t),l._$AT(t,r,i)),i!==void 0?((a=(o=r)._$Co)!==null&&a!==void 0?a:o._$Co=[])[i]=l:r._$Cl=l),l!==void 0&&(e=Nr(t,l._$AS(t,e.values),l,i)),e}var ss=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:i},parts:n}=this._$AD,s=((r=e?.creationScope)!==null&&r!==void 0?r:Vr).importNode(i,!0);Br.currentNode=s;let a=Br.nextNode(),o=0,l=0,h=n[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new di(a,a.nextSibling,this,e):h.type===1?c=new h.ctor(a,h.name,h.strings,this,e):h.type===6&&(c=new hs(a,this,e)),this._$AV.push(c),h=n[++l]}o!==h?.index&&(a=Br.nextNode(),o++)}return Br.currentNode=Vr,s}v(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},di=class t{constructor(e,r,i,n){var s;this.type=2,this._$AH=Me,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cp=(s=n?.isConnected)===null||s===void 0||s}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Nr(this,e,r),rn(e)?e===Me||e==null||e===""?(this._$AH!==Me&&this._$AR(),this._$AH=Me):e!==this._$AH&&e!==vt&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Ph(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Me&&rn(this._$AH)?this._$AA.nextSibling.data=e:this.$(Vr.createTextNode(e)),this._$AH=e}g(e){var r;let{values:i,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=nn.createElement(Th(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===s)this._$AH.v(i);else{let a=new ss(s,this),o=a.u(this.options);a.v(i),this.$(o),this._$AH=a}}_$AC(e){let r=Sh.get(e.strings);return r===void 0&&Sh.set(e.strings,r=new nn(e)),r}T(e){Eh(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let s of e)n===r.length?r.push(i=new t(this.k(tn()),this.k(tn()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,r);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},zr=class{constructor(e,r,i,n,s){this.type=1,this._$AH=Me,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Me}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){let s=this.strings,a=!1;if(s===void 0)e=Nr(this,e,r,0),a=!rn(e)||e!==this._$AH&&e!==vt,a&&(this._$AH=e);else{let o=e,l,h;for(e=s[0],l=0;l<s.length-1;l++)h=Nr(this,o[i+l],r,l),h===vt&&(h=this._$AH[l]),a||(a=!rn(h)||h!==this._$AH[l]),h===Me?e=Me:e!==Me&&(e+=(h??"")+s[l+1]),this._$AH[l]=h}a&&!n&&this.j(e)}j(e){e===Me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},as=class extends zr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Me?void 0:e}},Mf=pi?pi.emptyScript:"",os=class extends zr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Me?this.element.setAttribute(this.name,Mf):this.element.removeAttribute(this.name)}},ls=class extends zr{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){var i;if((e=(i=Nr(this,e,r,0))!==null&&i!==void 0?i:Me)===vt)return;let n=this._$AH,s=e===Me&&n!==Me||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,a=e!==Me&&(n===Me||s);s&&this.element.removeEventListener(this.name,this,n),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,i;typeof this._$AH=="function"?this._$AH.call((i=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}},hs=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Nr(this,e)}},Mh={O:ns,P:Kt,A:so,C:1,M:Ih,L:ss,R:Ph,D:Nr,I:di,V:zr,H:os,N:ls,U:as,F:hs},kh=is.litHtmlPolyfillSupport;kh?.(nn,di),((io=is.litHtmlVersions)!==null&&io!==void 0?io:is.litHtmlVersions=[]).push("2.8.0");var Dh=(t,e,r)=>{var i,n;let s=(i=r?.renderBefore)!==null&&i!==void 0?i:e,a=s._$litPart$;if(a===void 0){let o=(n=r?.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=a=new di(e.insertBefore(tn(),o),o,void 0,r??{})}return a._$AI(t),a};var ao,oo;var Ae=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dh(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return vt}};Ae.finalized=!0,Ae._$litElement$=!0,(ao=globalThis.litElementHydrateSupport)===null||ao===void 0||ao.call(globalThis,{LitElement:Ae});var Fh=globalThis.litElementPolyfillSupport;Fh?.({LitElement:Ae});((oo=globalThis.litElementVersions)!==null&&oo!==void 0?oo:globalThis.litElementVersions=[]).push("3.3.3");var fi={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},mi=t=>(...e)=>({_$litDirective$:t,values:e}),dr=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:Df}=Mh;var Oh=()=>document.createComment(""),gi=(t,e,r)=>{var i;let n=t._$AA.parentNode,s=e===void 0?t._$AB:e._$AA;if(r===void 0){let a=n.insertBefore(Oh(),s),o=n.insertBefore(Oh(),s);r=new Df(a,o,t,t.options)}else{let a=r._$AB.nextSibling,o=r._$AM,l=o!==t;if(l){let h;(i=r._$AQ)===null||i===void 0||i.call(r,t),r._$AM=t,r._$AP!==void 0&&(h=t._$AU)!==o._$AU&&r._$AP(h)}if(a!==s||l){let h=r._$AA;for(;h!==a;){let c=h.nextSibling;n.insertBefore(h,s),h=c}}}return r},fr=(t,e,r=t)=>(t._$AI(e,r),t),Ff={},$h=(t,e=Ff)=>t._$AH=e,Rh=t=>t._$AH,cs=t=>{var e;(e=t._$AP)===null||e===void 0||e.call(t,!1,!0);let r=t._$AA,i=t._$AB.nextSibling;for(;r!==i;){let n=r.nextSibling;r.remove(),r=n}};var Lh=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},sn=mi(class extends dr{constructor(t){if(super(t),t.type!==fi.CHILD)throw Error("repeat() can only be used in text expressions")}ct(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);let n=[],s=[],a=0;for(let o of t)n[a]=i?i(o,a):a,s[a]=r(o,a),a++;return{values:s,keys:n}}render(t,e,r){return this.ct(t,e,r).values}update(t,[e,r,i]){var n;let s=Rh(t),{values:a,keys:o}=this.ct(e,r,i);if(!Array.isArray(s))return this.ut=o,a;let l=(n=this.ut)!==null&&n!==void 0?n:this.ut=[],h=[],c,u,f=0,p=s.length-1,m=0,g=a.length-1;for(;f<=p&&m<=g;)if(s[f]===null)f++;else if(s[p]===null)p--;else if(l[f]===o[m])h[m]=fr(s[f],a[m]),f++,m++;else if(l[p]===o[g])h[g]=fr(s[p],a[g]),p--,g--;else if(l[f]===o[g])h[g]=fr(s[f],a[g]),gi(t,h[g+1],s[f]),f++,g--;else if(l[p]===o[m])h[m]=fr(s[p],a[m]),gi(t,s[f],s[p]),p--,m++;else if(c===void 0&&(c=Lh(o,m,g),u=Lh(l,f,p)),c.has(l[f]))if(c.has(l[p])){let d=u.get(o[m]),y=d!==void 0?s[d]:null;if(y===null){let v=gi(t,s[f]);fr(v,a[m]),h[m]=v}else h[m]=fr(y,a[m]),gi(t,s[f],y),s[d]=null;m++}else cs(s[p]),p--;else cs(s[f]),f++;for(;m<=g;){let d=gi(t,h[g+1]);fr(d,a[m]),h[m++]=d}for(;f<=p;){let d=s[f++];d!==null&&cs(d)}return this.ut=o,$h(t,h),vt}});function vo(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Of(t,e=","){return t.map(vo).join(e)}var Hh=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function us(t){for(var e=9,r=t.length;r--;)e=Math.imul(e^t.charCodeAt(r),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function fs(t,e="@media "){return e+Ce(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function Ce(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function Bh(t){return t}function ms(){}var Ne={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function qh(t){return t.match(/[-=:;]/g)?.length||0}function po(t){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(t)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(qh(t),15)<<18}var $f=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function bo({n:t,i:e,v:r=[]},i,n,s){t&&(t=vo({n:t,i:e,v:r})),s=[...Ce(s)];for(let o of r){let l=i.theme("screens",o);for(let h of Ce(l&&fs(l)||i.v(o))){var a;s.push(h),n|=l?67108864|po(h):o=="dark"?1073741824:h[0]=="@"?po(h):(a=h,1<<~(/:([a-z-]+)/.test(a)&&~$f.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var Uh=new Map;function fo(t){if(t.d){let e=[],r=lo(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?lo(i,s=>lo(n,a=>{let o=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(a);if(o){let l=s.indexOf(o[1]);return~l?s.slice(0,l)+o[0]+s.slice(l+o[1].length):ho(s,a)}return ho(a,s)})):i,"&"),i=>ho(i,t.n?"."+Hh(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function lo(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function ho(t,e){return t.replace(/&/g,e)}var Vh=new Intl.Collator("en",{numeric:!0});function Wh(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=Zh(t[n],e)?r=n+1:i=n}return i}function Zh(t,e){let r=t.p&Ne.o;return r==(e.p&Ne.o)&&(r==Ne.b||r==Ne.o)?0:t.p-e.p||t.o-e.o||Vh.compare(Nh(t.n),Nh(e.n))||Vh.compare(zh(t.n),zh(e.n))}function Nh(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function zh(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function co(t,e){return Math.round(parseInt(t,16)*e)}function At(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:i}=e,n=i?`var(${i})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",n);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,a=[17,1,.062272][s-1];return`rgba(${[co(t.substr(1,s),a),co(t.substr(1+s,s),a),co(t.substr(1+2*s,s),a),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function Yh(t,e,r,i,n=[]){return function s(a,{n:o,p:l,r:h=[],i:c},u){let f=[],p="",m=0,g=0;for(let v in a||{}){var d,y;let b=a[v];if(v[0]=="@"){if(!b)continue;if(v[1]=="a"){f.push(...wo(o,l,ds(""+b),u,l,h,c,!0));continue}if(v[1]=="l"){for(let _ of Ce(b))f.push(...s(_,{n:o,p:(d=Ne[v[7]],l&~Ne.o|d),r:v[7]=="d"?[]:h,i:c},u));continue}if(v[1]=="i"){f.push(...Ce(b).map(_=>({p:-1,o:0,r:[],d:v+" "+_})));continue}if(v[1]=="k"){f.push({p:Ne.d,o:0,r:[v],d:s(b,{p:Ne.d},u).map(fo).join("")});continue}if(v[1]=="f"){f.push(...Ce(b).map(_=>({p:Ne.d,o:0,r:[v],d:s(_,{p:Ne.d},u).map(fo).join("")})));continue}}if(typeof b!="object"||Array.isArray(b))v=="label"&&b?o=b+us(JSON.stringify([l,c,a])):(b||b===0)&&(v=v.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),g+=1,m=Math.max(m,(y=v)[0]=="-"?0:qh(y)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(y)?+!!RegExp.$1||-!!RegExp.$2:0)+1),p+=(p?";":"")+Ce(b).map(_=>u.s(v,_o(""+_,u.theme)+(c?" !important":""))).join(";"));else if(v[0]=="@"||v.includes("&")){let _=l;v[0]=="@"&&(v=v.replace(/\bscreen\(([^)]+)\)/g,(x,T)=>{let S=u.theme("screens",T);return S?(_|=67108864,fs(S,"")):x}),_|=po(v)),f.push(...s(b,{n:o,p:_,r:[...h,v],i:c},u))}else f.push(...s(b,{p:l,r:[...h,v]},u))}return f.unshift({n:o,p:l,o:Math.max(0,15-g)+1.5*Math.min(m||15,15),r:h,d:p}),f.sort(Zh)}(t,bo(e,r,i,n),r)}function _o(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,i,n,s,a="")=>{let o=e(n,a);return typeof o=="function"&&/color|fill|stroke/i.test(n)?At(o):""+Ce(o).filter(l=>Object(l)!==l)})}function Jh(t,e){let r,i=[];for(let n of t)n.d&&n.n?r?.p==n.p&&""+r.r==""+n.r?(r.c=[r.c,n.c].filter(Boolean).join(" "),r.d=r.d+";"+n.d):i.push(r={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function ps(t,e,r=Ne.u,i,n){let s=[];for(let a of t)for(let o of function(l,h,c,u,f){l={...l,i:l.i||f};let p=function(m,g){let d=Uh.get(m.n);return d?d(m,g):g.r(m.n,m.v[0]=="dark")}(l,h);return p?typeof p=="string"?({r:u,p:c}=bo(l,h,c,u),Jh(ps(ds(p),h,c,u,l.i),l.n)):Array.isArray(p)?p.map(m=>{var g,d;return{o:0,...m,r:[...Ce(u),...Ce(m.r)],p:(g=c,d=m.p??c,g&~Ne.o|d)}}):Yh(p,l,h,c,u):[{c:vo(l),p:0,o:0,r:[]}]}(a,e,r,i,n))s.splice(Wh(s,o),0,o);return s}function wo(t,e,r,i,n,s,a,o){return Jh((o?r.flatMap(l=>ps([l],i,n,s,a)):ps(r,i,n,s,a)).map(l=>l.p&Ne.o&&(l.n||e==Ne.b)?{...l,p:l.p&~Ne.o|e,o:0}:l),t)}function Rf(t,e,r,i){var n;return n=(s,a)=>{let{n:o,p:l,r:h,i:c}=bo(s,a,e);return r&&wo(o,e,r,a,l,h,c,i)},Uh.set(t,n),t}function uo(t,e,r){if(t[t.length-1]!="("){let i=[],n=!1,s=!1,a="";for(let o of t)if(!(o=="("||/[~@]$/.test(o))){if(o[0]=="!"&&(o=o.slice(1),n=!n),o.endsWith(":")){i[o=="dark:"?"unshift":"push"](o.slice(0,-1));continue}o[0]=="-"&&(o=o.slice(1),s=!s),o.endsWith("-")&&(o=o.slice(0,-1)),o&&o!="&"&&(a+=(a&&"-")+o)}a&&(s&&(a="-"+a),e[0].push({n:a,v:i.filter(Lf),i:n}))}}function Lf(t,e,r){return r.indexOf(t)==e}var jh=new Map;function ds(t){let e=jh.get(t);if(!e){let r=[],i=[[]],n=0,s=0,a=null,o=0,l=(h,c=0)=>{n!=o&&(r.push(t.slice(n,o+c)),h&&uo(r,i)),n=o+1};for(;o<t.length;o++){let h=t[o];if(s)t[o-1]!="\\"&&(s+=+(h=="[")||-(h=="]"));else if(h=="[")s+=1;else if(a)t[o-1]!="\\"&&a.test(t.slice(o))&&(a=null,n=o+RegExp.lastMatch.length);else if(h=="/"&&t[o-1]!="\\"&&(t[o+1]=="*"||t[o+1]=="/"))a=t[o+1]=="*"?/^\*\//:/^[\r\n]/;else if(h=="(")l(),r.push(h);else if(h==":")t[o+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(h)){l(!0);let c=r.lastIndexOf("(");if(h==")"){let u=r[c-1];if(/[~@]$/.test(u)){let f=i.shift();r.length=c,uo([...r,"#"],i);let{v:p}=i[0].pop();for(let m of f)m.v.splice(+(m.v[0]=="dark")-+(p[0]=="dark"),p.length);uo([...r,Rf(u.length>1?u.slice(0,-1)+us(JSON.stringify([u,f])):u+"("+Of(f)+")",Ne.a,f,/@$/.test(u))],i)}c=r.lastIndexOf("(",c-1)}r.length=c+1}else/[~@]/.test(h)&&t[o+1]=="("&&i.unshift([])}l(!0),jh.set(t,e=i[0])}return e}function B(t,e,r){return[t,mo(e,r)]}function mo(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):go(r,1)}):r=>t||{[r[1]]:go(r,2)}}function go(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function V(t,e,r,i){return[t,xo(e,r,i)]}function xo(t,e,r){let i=typeof e=="string"?(n,s)=>({[e]:r?r(n,s):n._}):e||(({1:n,_:s},a,o)=>({[n||o]:s}));return(n,s)=>{let a=Xh(t||n[1]),o=s.theme(a,n.$$)??Nt(n.$$,a,s);if(o!=null)return n._=go(n,0,o),i(n,s,a)}}function ze(t,e={},r){return[t,Bf(e,r)]}function Bf(t={},e){return(r,i)=>{let{section:n=Xh(r[0]).replace("-","")+"Color"}=t,[s,a]=Vf(r.$$);if(!s)return;let o=i.theme(n,s)||Nt(s,n,i);if(!o||typeof o=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:h=n.replace("Color","Opacity"),property:c=n,selector:u}=t,f=i.theme(h,a||"DEFAULT")||a&&Nt(a,h,i),p=e||(({_:g})=>{let d=an(c,g);return u?{[u]:d}:d});r._={value:At(o,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:g=>At(o,g),opacityVariable:l||void 0,opacityValue:f||void 0};let m=p(r,i);if(!r.dark){let g=i.d(n,s,o);g&&g!==o&&(r._={value:At(g,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:d=>At(g,d),opacityVariable:l||void 0,opacityValue:f||void 0},m={"&":m,[i.v("dark")]:p(r,i)})}return m}}function Vf(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function an(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function Nt(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=yi(_o(t.slice(1,-1),r.theme)),!e)return t;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(t)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(t))||/image/i.test(e)&&!(/^image:/.test(t)||/^[a-z-]+\(/.test(t))||/weight/i.test(e)&&!(/^(number|any):/.test(t)||/^\d+$/.test(t))||/position/i.test(e)&&/^(length|size):/.test(t)))return t.replace(/^[a-z-]+:/,"")}}function Xh(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function yi(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>yi(r)+i+yi(n)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function So({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Ce(e.variants),rules:Ce(e.rules),ignorelist:Ce(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of Ce([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Ce(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=r.darkMode,darkColor:a=r.darkColor,theme:o,variants:l,rules:h,ignorelist:c,hash:u=r.hash,stringify:f=r.stringify,finalize:p}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...Ce(n)],darkMode:s,darkColor:a,theme:{...r.theme,...o,extend:{...r.theme.extend,...o?.extend}},variants:[...r.variants,...Ce(l)],rules:[...r.rules,...Ce(h)],ignorelist:[...r.ignorelist,...Ce(c)],hash:u,stringify:f,finalize:[...r.finalize,...Ce(p)]}}return r}function Gh(t,e,r,i,n,s){for(let a of e){let o=r.get(a);o||r.set(a,o=i(a));let l=o(t,n,s);if(l)return l}}function Nf(t){var e;return yo(t[0],typeof(e=t[1])=="function"?e:()=>e)}function zf(t){var e,r;return Array.isArray(t)?yo(t[0],mo(t[1],t[2])):yo(t,mo(e,r))}function yo(t,e){return Kh(t,(r,i,n,s)=>{let a=i.exec(r);if(a)return a.$$=r.slice(a[0].length),a.dark=s,e(a,n)})}function Kh(t,e){let r=Ce(t).map(jf);return(i,n,s)=>{for(let a of r){let o=e(i,a,n,s);if(o)return o}}}function jf(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function Qh(t,e){let r=So(t),i=function({theme:l,darkMode:h,darkColor:c=ms,variants:u,rules:f,hash:p,stringify:m,ignorelist:g,finalize:d}){let y=new Map,v=new Map,b=new Map,_=new Map,x=Kh(g,(w,M)=>M.test(w));u.push(["dark",Array.isArray(h)||h=="class"?`${Ce(h)[1]||".dark"} &`:typeof h=="string"&&h!="media"?h:"@media (prefers-color-scheme:dark)"]);let T=typeof p=="function"?w=>p(w,us):p?us:Bh;T!==Bh&&d.push(w=>({...w,n:w.n&&T(w.n),d:w.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(M,k)=>"--"+T(k).replace("#",""))}));let S={theme:function({extend:w={},...M}){let k={},I={get colors(){return P("colors")},theme:P,negative(){return{}},breakpoints(E){let F={};for(let O in E)typeof E[O]=="string"&&(F["screen-"+O]=E[O]);return F}};return P;function P(E,F,O,D){if(E){if({1:E,2:D}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(E)||[,E],/[.[]/.test(E)){let q=[];E.replace(/\[([^\]]+)\]|([^.[]+)/g,(U,Y,G=Y)=>q.push(G)),E=q.shift(),O=F,F=q.join("-")}let $=k[E]||Object.assign(Object.assign(k[E]={},A(M,E)),A(w,E));if(F==null)return $;F||(F="DEFAULT");let R=$[F]??F.split("-").reduce((q,U)=>q?.[U],$)??O;return D?At(R,{opacityValue:_o(D,P)}):R}let C={};for(let $ of[...Object.keys(M),...Object.keys(w)])C[$]=P($);return C}function A(E,F){let O=E[F];return typeof O=="function"&&(O=O(I)),O&&/color|fill|stroke/i.test(F)?function D(C,$=[]){let R={};for(let q in C){let U=C[q],Y=[...$,q];R[Y.join("-")]=U,q=="DEFAULT"&&(Y=$,R[$.join("-")]=U),typeof U=="object"&&Object.assign(R,D(U,Y))}return R}(O):O}}(l),e:Hh,h:T,s(w,M){return m(w,M,S)},d(w,M,k){return c(w,M,S,k)},v(w){return y.has(w)||y.set(w,Gh(w,u,v,Nf,S)||"&:"+w),y.get(w)},r(w,M){let k=JSON.stringify([w,M]);return b.has(k)||b.set(k,!x(w,S)&&Gh(w,f,_,zf,S,M)),b.get(k)},f(w){return d.reduce((M,k)=>k(M,S),w)}};return S}(r),n=new Map,s=[],a=new Set;e.resume(l=>n.set(l,l),(l,h)=>{e.insert(l,s.length,h),s.push(h),a.add(l)});function o(l){let h=i.f(l),c=fo(h);if(c&&!a.has(c)){a.add(c);let u=Wh(s,l);e.insert(c,u,l),s.splice(u,0,l)}return h.n}return Object.defineProperties(function(h){if(!n.size)for(let u of Ce(r.preflight))typeof u=="function"&&(u=u(i)),u&&(typeof u=="string"?wo("",Ne.b,ds(u),i,Ne.b,[],!1,!0):Yh(u,{},i,Ne.b)).forEach(o);h=""+h;let c=n.get(h);if(!c){let u=new Set;for(let f of ps(ds(h),i))u.add(f.c).add(o(f));c=[...u].filter(Boolean).join(" "),n.set(h,c).set(c,c)}return c},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:r,snapshot(){let l=e.snapshot(),h=new Set(a),c=new Map(n),u=[...s];return()=>{l(),a=h,n=c,s=u}},clear(){e.clear(),a=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Gf(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function ec(t){let e=new MutationObserver(r);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),r([{target:n,type:""}])},disconnect(){e.disconnect()}};function r(n){for(let{type:s,target:a}of n)if(s[0]=="a")i(a);else for(let o of a.querySelectorAll("[class]"))i(o);e.takeRecords()}function i(n){let s,a=n.getAttribute?.("class");a&&Gf(a,s=t(a))&&n.setAttribute("class",s)}}function Hf(t){let e=document.querySelector(t||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function gs(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Hf(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,i){try{e.insertRule(r,i)}catch{e.insertRule(":root{}",i)}},resume:ms}}var qf=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function tc(t){return qf.get(t)}function rc(t){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(t);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function ic(t,e){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(t);return r?r[1]?/^sti/i.test(e)?1:0:r[2]?/^pat/i.test(e)?1:0:r[3]?/^image-/i.test(e)?1:0:r[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Uf=[["-webkit-",1],["-moz-",2],["-ms-",4]];function nc(){return({stringify:t})=>({stringify(e,r,i){let n="",s=tc(e);s&&(n+=t(s,r,i)+";");let a=rc(e),o=ic(e,r);for(let l of Uf)a&l[1]&&(n+=t(l[0]+e,r,i)+";"),o&l[1]&&(n+=t(e,l[0]+r,i)+";");return n+t(e,r,i)}})}function ac(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",xo("lineClamp",({_:t})=>sc(t))],["line-clamp-(\\d+)",({1:t})=>sc(t)]]}}function sc(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var ln={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...bt(4,"rem",4,.5,.5),...bt(12,"rem",4,5),14:"3.5rem",...bt(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:ge("blur"),backdropBrightness:ge("brightness"),backdropContrast:ge("contrast"),backdropGrayscale:ge("grayscale"),backdropHueRotate:ge("hueRotate"),backdropInvert:ge("invert"),backdropOpacity:ge("opacity"),backdropSaturate:ge("saturate"),backdropSepia:ge("sepia"),backgroundColor:ge("colors"),backgroundImage:{none:"none"},backgroundOpacity:ge("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...bt(200,"",100,0,50),...bt(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:ge("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:ge("spacing"),borderWidth:{DEFAULT:"1px",...Ct(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:ge("colors"),caretColor:ge("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...bt(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:ge("borderColor"),divideOpacity:ge("borderOpacity"),divideWidth:ge("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:t})=>({...t("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({...t("spacing"),...on(2,6),...on(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:ge("spacing"),gradientColorStops:ge("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:t})=>({...t("spacing"),...on(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...on(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...bt(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:t})=>({auto:"auto",...t("spacing")}),maxHeight:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...t("spacing")}),maxWidth:({theme:t,breakpoints:e})=>({...e(t("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...bt(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:ge("spacing"),placeholderColor:ge("colors"),placeholderOpacity:ge("opacity"),outlineColor:ge("colors"),outlineOffset:Ct(8,"px"),outlineWidth:Ct(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:ge("colors"),ringOffsetWidth:Ct(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ct(8,"px")},rotate:{...Ct(2,"deg"),...Ct(12,"deg",3),...Ct(180,"deg",45)},saturate:bt(200,"",100,0,50),scale:{...bt(150,"",100,0,50),...bt(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:ge("spacing"),scrollPadding:ge("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ct(2,"deg"),...Ct(12,"deg",3)},space:ge("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:bt(2),textColor:ge("colors"),textDecorationColor:ge("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ct(8,"px")},textUnderlineOffset:{auto:"auto",...Ct(8,"px")},textIndent:ge("spacing"),textOpacity:ge("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:ge("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:t})=>({...t("spacing"),...on(2,4),full:"100%"}),width:({theme:t})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...t("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...bt(50,"",1,0,10),auto:"auto"}};function on(t,e){let r={};do for(var i=1;i<t;i++)r[`${i}/${t}`]=Number((i/t*100).toFixed(6))+"%";while(++t<=e);return r}function Ct(t,e,r=0){let i={};for(;r<=t;r=2*r||1)i[r]=r+e;return i}function bt(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function ge(t){return({theme:e})=>e(t)}var oc={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${ln.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${ln.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var dc=[B("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:Nt(`[${e}]`,"",r)}}})),B("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),V("aspect-","aspectRatio"),B("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...a("xs")};for(let o in r){let l=r[o];typeof l=="string"&&(s[fs(l)]={"&":{maxWidth:l,...a(o)}})}return s;function a(o){let l=n&&(typeof n=="string"?n:n[o]||n.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),V("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),B("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),B("box-(border|content)","boxSizing",({1:t})=>t+"-box"),B("hidden",{display:"none"}),B("table-(auto|fixed)","tableLayout"),B(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",B("isolate","isolation"),B("object-(contain|cover|fill|none|scale-down)","objectFit"),V("object-","objectPosition"),B("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",ys),B("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),B("(static|fixed|absolute|relative|sticky)","position"),V("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),V("-?(top|bottom|left|right)(?:$|-)","inset"),B("(visible|collapse)","visibility"),B("invisible",{visibility:"hidden"}),V("-?z-","zIndex"),B("flex-((row|col)(-reverse)?)","flexDirection",lc),B("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),V("(flex-(?:grow|shrink))(?:$|-)"),V("(flex)-"),V("grow(?:$|-)","flexGrow"),V("shrink(?:$|-)","flexShrink"),V("basis-","flexBasis"),V("-?(order)-"),"-?(order)-(\\d+)",V("grid-cols-","gridTemplateColumns"),B("grid-cols-(\\d+)","gridTemplateColumns",pc),V("col-","gridColumn"),B("col-(span)-(\\d+)","gridColumn",uc),V("col-start-","gridColumnStart"),B("col-start-(auto|\\d+)","gridColumnStart"),V("col-end-","gridColumnEnd"),B("col-end-(auto|\\d+)","gridColumnEnd"),V("grid-rows-","gridTemplateRows"),B("grid-rows-(\\d+)","gridTemplateRows",pc),V("row-","gridRow"),B("row-(span)-(\\d+)","gridRow",uc),V("row-start-","gridRowStart"),B("row-start-(auto|\\d+)","gridRowStart"),V("row-end-","gridRowEnd"),B("row-end-(auto|\\d+)","gridRowEnd"),B("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>ys(lc(t))),B("grid-flow-(dense)","gridAutoFlow"),V("auto-cols-","gridAutoColumns"),V("auto-rows-","gridAutoRows"),V("gap-x(?:$|-)","gap","columnGap"),V("gap-y(?:$|-)","gap","rowGap"),V("gap(?:$|-)","gap"),"(justify-(?:items|self))-",B("justify-","justifyContent",hc),B("(content|items|self)-",t=>({["align-"+t[1]]:hc(t)})),B("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),V("p([xytrbl])?(?:$|-)","padding",vi("padding")),V("-?m([xytrbl])?(?:$|-)","margin",vi("margin")),V("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),B("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),V("w-","width"),V("min-w-","minWidth"),V("max-w-","maxWidth"),V("h-","height"),V("min-h-","minHeight"),V("max-h-","maxHeight"),V("font-","fontWeight"),V("font-","fontFamily",({_:t})=>typeof(t=Ce(t))[1]=="string"?{fontFamily:Lt(t)}:{fontFamily:Lt(t[0]),...t[1]}),B("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),B("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),B("italic","fontStyle"),B("not-italic",{fontStyle:"normal"}),B("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...mr({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),V("tracking-","letterSpacing"),V("leading-","lineHeight"),B("list-(inside|outside)","listStylePosition"),V("list-","listStyleType"),B("list-","listStyleType"),V("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),ze("placeholder-",{property:"color",selector:"&::placeholder"}),B("text-(left|center|right|justify|start|end)","textAlign"),B("text-(ellipsis|clip)","textOverflow"),V("text-opacity-","textOpacity","--tw-text-opacity"),ze("text-",{property:"color"}),V("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),V("indent-","textIndent"),B("(overline|underline|line-through)","textDecorationLine"),B("no-underline",{textDecorationLine:"none"}),V("underline-offset-","textUnderlineOffset"),ze("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),V("decoration-","textDecorationThickness"),B("decoration-","textDecorationStyle"),B("(uppercase|lowercase|capitalize)","textTransform"),B("normal-case",{textTransform:"none"}),B("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),B("align-","verticalAlign"),B("whitespace-","whiteSpace"),B("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),B("break-words",{overflowWrap:"break-word"}),B("break-all",{wordBreak:"break-all"}),B("break-keep",{wordBreak:"keep-all"}),ze("caret-",{opacityVariable:!1,opacitySection:"opacity"}),ze("accent-",{opacityVariable:!1,opacitySection:"opacity"}),B("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${jr(t," ")},var(--tw-gradient-stops))`),ze("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),ze("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),ze("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),B("bg-(fixed|local|scroll)","backgroundAttachment"),B("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),B(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),B("bg-blend-","backgroundBlendMode"),B("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),V("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),ze("bg-",{section:"backgroundColor"}),V("bg-","backgroundImage"),V("bg-","backgroundPosition"),B("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",ys),V("bg-","backgroundSize"),V("rounded(?:$|-)","borderRadius"),V("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${jr(r[0])}-radius`]:e,[`border-${jr(r[1])}-radius`]:e}}),B("border-(collapse|separate)","borderCollapse"),V("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),B("border-(solid|dashed|dotted|double|none)","borderStyle"),V("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...mr({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),ze("border-([xytrbl])-",{section:"borderColor"},vi("border","Color")),ze("border-"),V("border-([xytrbl])(?:$|-)","borderWidth",vi("border","Width")),V("border(?:$|-)","borderWidth"),V("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),B("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),B("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),V("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${jr(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${jr(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),ze("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),V("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),ze("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),V("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),B("ring-inset",{"--tw-ring-inset":"inset"}),ze("ring-",{property:"--tw-ring-color"}),V("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...mr({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":At(e("ringOffsetColor","","#fff")),"--tw-ring-color":At(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),ze("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),V("shadow(?:$|-)","boxShadow",({_:t})=>({...mr({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":Lt(t),"--tw-shadow-colored":Lt(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),V("(opacity)-"),B("mix-blend-","mixBlendMode"),...cc(),...cc("backdrop-"),V("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:Lt(t),transitionTimingFunction:t._=="none"?void 0:Lt(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:Lt(e("transitionDuration",""))})),V("duration(?:$|-)","transitionDuration","transitionDuration",Lt),V("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Lt),V("delay(?:$|-)","transitionDelay","transitionDelay",Lt),V("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=Lt(t),s=n.split(" "),a=e("keyframes",s[0]);return a?{["@keyframes "+(s[0]=i(r(s[0])))]:a,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",B("transform",Eo),B("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":fc(t=="gpu")})),V("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...Eo()})),V("-?(rotate)-","rotate",ko),V("-?(translate-[xy])-","translate",ko),V("-?(skew-[xy])-","skew",ko),B("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",ys),"(appearance)-",V("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",V("(cursor)-"),"(cursor)-",B("snap-(none)","scroll-snap-type"),B("snap-(x|y|both)",({1:t})=>({...mr({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),B("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),B("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),B("snap-(normal|always)","scroll-snap-stop"),B("scroll-(auto|smooth)","scroll-behavior"),V("scroll-p([xytrbl])?(?:$|-)","padding",vi("scroll-padding")),V("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",vi("scroll-margin")),B("touch-(auto|none|manipulation)","touch-action"),B("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...mr({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),B("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),B("outline",{outlineStyle:"solid"}),B("outline-(dashed|dotted|double)","outlineStyle"),V("-?(outline-offset)-"),ze("outline-",{opacityVariable:!1,opacitySection:"opacity"}),V("outline-","outlineWidth"),"(pointer-events)-",V("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],B("select-(none|text|all|auto)","userSelect"),ze("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),ze("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),V("stroke-","strokeWidth"),B("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),B("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function ys(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function lc(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function jr(t,e="-"){let r=[];for(let i of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return r.join(e)}function Lt(t){return t&&""+(t._||t)}function hc({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function vi(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...an(t+"-"+jr(n[0])+e,i),...an(t+"-"+jr(n[1])+e,i)}:an(t+e,i)}}function cc(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let i of e)r[`--tw-${t}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...mr(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,B(`${t}filter`,r),...e.map(i=>V(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:Ce(s).map(a=>`${i}(${a})`).join(" "),...r})))]}function ko({1:t,_:e}){return{["--tw-"+t]:e,...Eo()}}function Eo(){return{...mr({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":fc()}),transform:"var(--tw-transform)"}}function fc(t){return[t?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function uc({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function pc({1:t}){return`repeat(${t},minmax(0,1fr))`}function mr(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var mc=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||Nt(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:i="",6:n=e},{e:s,h:a,v:o})=>{let l=yi(i)||(r[0]=="["?r:o(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(a(t+n))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||Nt(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||Nt(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=Nt(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&yi(t).replace(/[}]+$/,"").split("{")]];function gc({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:oc,theme:{...ln,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:mc,rules:dc,finalize(r){return r.n&&r.d&&r.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Wf={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Zf={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Yf={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Jf={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Xf={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Kf={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Qf={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},em={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},tm={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},rm={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},im={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},nm={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},sm={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},am={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},om={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},lm={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},hm={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},cm={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},um={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},pm={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},dm={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},fm={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},yc={__proto__:null,slate:Wf,gray:Zf,zinc:Yf,neutral:Jf,stone:Xf,red:Kf,orange:Qf,amber:em,yellow:tm,lime:rm,green:im,emerald:nm,teal:sm,cyan:am,sky:om,blue:lm,indigo:hm,violet:cm,purple:um,fuchsia:pm,pink:dm,rose:fm};function vc({disablePreflight:t}={}){return gc({colors:yc,disablePreflight:t})}function wc({className:t="prose",defaultColor:e="gray",extend:r={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,a=s])=>[`${t}-${s}`,(o,l)=>xc(t,a[0]=="."?"."+l.e(l.h(a.slice(1))):a,l,h=>`& :is(${h.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:a})=>[{c:a(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},a)=>{let o=_c(a.theme("fontSize",s));return o&&{"@layer components":o}}],[t+"-",({$$:s},a)=>n(s,a)],[t,(s,a)=>({...n(e,a),"@layer base":[bc(t,a,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:X(20,16),marginBottom:X(20,16),paddingLeft:X(26,16)},li:{marginTop:X(8,16),marginBottom:X(8,16)},"ol>li,ul>li":{paddingLeft:X(6,16)},">ul>li p":{marginTop:X(12,16),marginBottom:X(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:X(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:X(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:X(12,16),marginBottom:X(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:X(48,16),marginBottom:X(48,16)},blockquote:{marginTop:X(32,20),marginBottom:X(32,20),paddingLeft:X(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:X(20,16),marginBottom:X(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:X(36,16),marginTop:"0",marginBottom:X(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:X(24,16),marginTop:X(48,24),marginBottom:X(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:X(20,16),marginTop:X(32,20),marginBottom:X(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:X(24,16),marginBottom:X(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:X(32,16),marginBottom:X(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:X(14,16),lineHeight:"1.4",marginTop:X(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:X(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:X(21,24)},"h3 code":{fontSize:X(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:X(14,16),lineHeight:"1.7",marginTop:X(24,14),marginBottom:X(24,14),borderRadius:"0.375rem",paddingTop:X(12,14),paddingRight:X(16,14),paddingBottom:X(12,14),paddingLeft:X(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:X(32,16),marginBottom:X(32,16),fontSize:X(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:X(8,14),paddingBottom:X(8,14),paddingLeft:X(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:X(8,14),paddingRight:X(8,14),paddingBottom:X(8,14),paddingLeft:X(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${a.e(a.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:X(20,16),lineHeight:"1.6",marginTop:X(24,20),marginBottom:X(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),bc(t,a,r)],"@layer components":{..._c(a.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,a){let o={},l={},h=(c,u,f)=>{let p=a.theme(`colors.${s}.${u}`,u);f["--tw-prose-"+c]=At(p);let m=f!=l&&a.d("colors",`${s}-${u}`,p);m&&(l["--tw-prose-"+c]=At(m))};for(let c in i){let u=i[c];c!="dark"&&u&&h(c,u,o)}for(let c in i.dark||{}){let u=i.dark[c];u&&(i.dark?h("invert-"+c,u,o):h(c,u,l))}return Object.keys(o).length?{"@layer defaults":{"&":o,[a.v("dark")]:l}}:void 0}}function bc(t,e,r){let i={};for(let n in r)i[xc(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function xc(t,e,{e:r,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,a=" ",o=s,l="")=>n(`${a}:where(${o}):not(:where(.${r(i("not-"+t))} *))${l}`))}function _c(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function X(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Po=So({darkMode:"class",theme:{extend:{spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]},fontFamily:{sans:["system-ui","Roboto","Helvetica","Arial","sans-serif"],serif:["ui-serif","Georgia","Cambria","serif"],mono:["ui-monospace","Menlo","Monaco","monospace"]}}},presets:[vc(),nc(),ac(),wc()],hash:!1});function Sc(t,e=!0){let r=function(){if(mm)try{let l=gs(new CSSStyleSheet);return l.connect=h=>{let c=Ao(h);c.adoptedStyleSheets=[...c.adoptedStyleSheets,l.target]},l.disconnect=ms,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let a=[gs(s)],o=new WeakMap;return{get target(){return a[0].target},snapshot(){let l=a.map(h=>h.snapshot());return()=>l.forEach(h=>h())},clear(){a.forEach(l=>l.clear())},destroy(){a.forEach(l=>l.destroy())},insert(l,h,c){a[0].insert(l,h,c);let u=this.target.cssRules[h];a.forEach((f,p)=>p&&f.target.insertRule(u.cssText,h))},resume(l,h){return a[0].resume(l,h)},connect(l){let h=document.createElement("style");Ao(l).appendChild(h);let c=gs(h),{cssRules:u}=this.target;for(let f=0;f<u.length;f++)c.target.insertRule(u[f].cssText,f);a.push(c),o.set(l,c)},disconnect(l){let h=a.indexOf(o.get(l));h>=0&&a.splice(h,1)}}}(),i=Qh({...t,hash:t.hash??e},r),n=ec(i);return function(a){return class extends a{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(Ao(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var mm=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Ao(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var De=t=>Sc(Po)(t);var bs,kc,_s,Ec,vs=class extends De(Ae){constructor(){super();ee(this,bs);ee(this,_s);ye(this,"render",()=>pe`
|
|
4
4
|
<div class="${N(this,bs,kc)?"block":"hidden"} flex h-full w-full flex-col items-stretch justify-center space-y-8 px-4">
|
|
@@ -350,7 +350,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
350
350
|
<div class="flex flex-grow flex-col items-start justify-center">
|
|
351
351
|
<h1 class="font-semibold text-gray-800">${this.config.title}</h1>
|
|
352
352
|
<!--<p class="text-sm text-gray-600"><code class="rounded bg-gray-500 px-[2px] text-xs text-white">AI</code> Bot</p>-->
|
|
353
|
-
<p class="text-
|
|
353
|
+
<p class="${this.config.status==="Still learning"?`text-[${this.config.color}]`:"text-green-500"} text-sm">${this.config.status}</p>
|
|
354
354
|
</div>
|
|
355
355
|
|
|
356
356
|
<div class="flex-grow"></div>
|
|
@@ -397,7 +397,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
397
397
|
|
|
398
398
|
<mw-powered-by class="sm:hidden"></mw-powered-by>
|
|
399
399
|
</div>
|
|
400
|
-
`}updated(r){let i=r.has("dialogShown"),n=this.dialogShown;i&&n===!0&&N(this,Gt)&&(ke(this,Gt,!1),this.requestUpdate())}firstUpdated(){ke(this,aa,new na(this,this.popupDelayMs,()=>{this.dialogShown
|
|
400
|
+
`}updated(r){let i=r.has("dialogShown"),n=this.dialogShown;i&&n===!0&&N(this,Gt)&&(ke(this,Gt,!1),this.requestUpdate())}firstUpdated(){ke(this,aa,new na(this,this.popupDelayMs,()=>{let r=!this.dialogShown,i=sessionStorage.getItem("_molin_popup")!=="user_dismissed";r&&i&&ce(this,oa,dp).call(this)}))}};aa=new WeakMap,Gt=new WeakMap,oa=new WeakSet,dp=function(){new Audio("https://molin.ai/sounds/widget/popup.aac").play().then(()=>{console.log("Audio played successfully.")}).catch(i=>{console.error("Error playing audio:",i)}),ke(this,Gt,!0),this.requestUpdate()},la=new WeakSet,fp=function(r){r.preventDefault(),r.stopPropagation(),ke(this,Gt,!1),sessionStorage.setItem("_molin_popup","user_dismissed"),this.requestUpdate()},ha=new WeakSet,mp=function(){ke(this,Gt,!1),this.dispatchEvent(new CustomEvent("popup-chat-open",{})),this.requestUpdate()},ye(sa,"properties",{position:{type:Object},aiName:{type:String,attribute:"ai-name"},dialogShown:{type:Boolean,attribute:"dialog-shown"},popupDelayMs:{type:Number,attribute:"popup-delay-ms"},popupText:{type:String,attribute:"popup-text"}});customElements.define("mw-popup",sa);var yl=class extends De(Ae){constructor(){super(...arguments);ye(this,"render",()=>pe`
|
|
401
401
|
<p class="flex items-center justify-center space-x-1 text-xs text-gray-400">
|
|
402
402
|
<span class="pointer-events-none">Powered by</span>
|
|
403
403
|
<a class="inline-flex items-center space-x-1 text-gray-600 underline" href="https://molin.ai/" target="_blank">
|
|
@@ -425,9 +425,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
425
425
|
`}};ua=new WeakSet,gp=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:return""}},ye(ca,"properties",{color:{type:String,attribute:"color"},animated:{type:Boolean,attribute:"animated"},position:{type:String,attribute:"position"}});customElements.define("mw-pulse-dot",ca);var yp=mi(class extends dr{constructor(t){var e;if(super(t),t.type!==fi.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,i;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in e)e[s]&&!(!((r=this.nt)===null||r===void 0)&&r.has(s))&&this.it.add(s);return this.render(e)}let n=t.element.classList;this.it.forEach(s=>{s in e||(n.remove(s),this.it.delete(s))});for(let s in e){let a=!!e[s];a===this.it.has(s)||!((i=this.nt)===null||i===void 0)&&i.has(s)||(a?(n.add(s),this.it.add(s)):(n.remove(s),this.it.delete(s)))}return vt}});var vl=t=>t??Me;var Pn,ht,Bt,An,bl,pa=class{constructor(e,r){ee(this,An);ee(this,Pn,void 0);ee(this,ht,void 0);ee(this,Bt,void 0);if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");ke(this,Pn,e),N(this,Pn).addController(this),ke(this,ht,r)}reconnect(e){ke(this,ht,e),N(this,Bt)?.close(),ke(this,Bt,ce(this,An,bl).call(this))}hostConnected(){ke(this,Bt,ce(this,An,bl).call(this))}hostDisconnected(){N(this,Bt)?.close(),ke(this,Bt,void 0)}send(e){N(this,Bt)?.send(e)}close(){N(this,Bt)?.close(1e3,"new_chat")}render(e={}){switch(N(this,Bt)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}};Pn=new WeakMap,ht=new WeakMap,Bt=new WeakMap,An=new WeakSet,bl=function(){let e=new WebSocket(N(this,ht).url());return N(this,ht).onClose&&(e.onclose=N(this,ht).onClose),N(this,ht).onOpen&&(e.onopen=N(this,ht).onOpen),N(this,ht).onError&&(e.onerror=N(this,ht).onError),N(this,ht).onMessage&&(e.onmessage=N(this,ht).onMessage),e};var Ht,Ke,Jr,zi,Cn,ji,da,Tn,_l,In,wl,Mn,xl,Dn,Sl,ma,vp,fa=class{constructor(e,r){ee(this,ji);ee(this,Tn);ee(this,In);ee(this,Mn);ee(this,Dn);ee(this,ma);ee(this,Ht,void 0);ee(this,Ke,void 0);ee(this,Jr,void 0);ee(this,zi,!1);ye(this,"isStreaming",!1);ye(this,"messages",[]);ye(this,"conversationId","");ee(this,Cn,0);e.addController(this),ke(this,Ht,e),ke(this,Ke,r),ke(this,Jr,new pa(e,{url:()=>N(this,Ke).url(this.conversationId,{}),onOpen:i=>ce(this,Tn,_l).call(this,i),onMessage:i=>ce(this,In,wl).call(this,JSON.parse(i.data)),onError:i=>ce(this,Mn,xl).call(this,i),onClose:i=>ce(this,Dn,Sl).call(this,i)}))}sendUserInput(e){ce(this,ji,da).call(this,{type:"USER_INPUT",value:e},{expectStreaming:!0})}sendUserCancel(){ce(this,ji,da).call(this,{type:"USER_CANCEL"})}reconnect(){ih(this,Cn)._++,setTimeout(()=>{N(this,Ke).onReconnect?.(),N(this,Jr).reconnect({url:()=>N(this,Ke).url(this.conversationId,{resume:!0}),onOpen:e=>ce(this,Tn,_l).call(this,e),onMessage:e=>ce(this,In,wl).call(this,JSON.parse(e.data)),onError:e=>ce(this,Mn,xl).call(this,e),onClose:e=>ce(this,Dn,Sl).call(this,e)})},1e3*N(this,Cn))}hostConnected(){let e=N(this,Ke).restoreConversationState?.()||{conversationId:crypto.randomUUID(),messages:[]};this.messages=e.messages,this.conversationId=e.conversationId,ke(this,zi,!0)}hostDisconnected(){ke(this,zi,!1)}reset(){N(this,Jr).close(),N(this,Ke).onReset?.(),this.isStreaming=!1,this.messages=[],this.conversationId=crypto.randomUUID(),N(this,Ht).requestUpdate()}};Ht=new WeakMap,Ke=new WeakMap,Jr=new WeakMap,zi=new WeakMap,Cn=new WeakMap,ji=new WeakSet,da=function(e,{expectStreaming:r=!1}={}){r&&(this.isStreaming=!0,N(this,Ht).requestUpdate()),N(this,Jr).send(JSON.stringify(e))},Tn=new WeakSet,_l=function(e){this.messages.length>0&&setTimeout(()=>{ce(this,ji,da).call(this,{type:"RESUME",messages:ce(this,ma,vp).call(this)})},10)},In=new WeakSet,wl=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages.push(e.message),N(this,Ht).requestUpdate(),N(this,Ke).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let r=this.messages.find(i=>i.id===e.message.id);if(r)Object.assign(r,e.message),N(this,Ht).requestUpdate(),N(this,Ke).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);if(r?.content==="\xB7 \xB7 \xB7")this.messages=this.messages.filter(i=>i.id!==e.message.id);else if(r)Object.assign(r,e.message);else throw new Error(`Message with id ${e.message.id} not found`);N(this,Ke).persistConversationState?.(this.conversationId,this.messages),this.isStreaming=!1,N(this,Ht).requestUpdate(),N(this,Ke).onMessageDone?.(e);break}case"ERROR":{N(this,Ke).onMessageError?.(e);break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Mn=new WeakSet,xl=function(e){N(this,Ke).onError?.(e)},Dn=new WeakSet,Sl=function(e){this.isStreaming=!1,N(this,Ht).requestUpdate(),N(this,zi)&&this.reconnect(),N(this,Ke).onClose?.()},ma=new WeakSet,vp=function(){return this.messages.map(({id:e,role:r,content:i,timestamp:n})=>({id:e,role:r,content:i,timestamp:n}))};function bp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function he(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bp(Object(r),!0).forEach(function(i){Z(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bp(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Tl(t){return Tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tl(t)}function Re(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _p(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Le(t,e,r){return e&&_p(t.prototype,e),r&&_p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Z(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Il(t,e)}function Pa(t){return Pa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pa(t)}function Il(t,e){return Il=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Il(t,e)}function Ng(t,e){if(t==null)return{};var r,i,n=function(a,o){if(a==null)return{};var l,h,c={},u=Object.keys(a);for(h=0;h<u.length;h++)l=u[h],o.indexOf(l)>=0||(c[l]=a[l]);return c}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zg(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(t)}function Zp(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var r,i=Pa(t);if(e){var n=Pa(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return zg(this,r)}}function Nn(t,e){return function(r){if(Array.isArray(r))return r}(t)||function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var s,a,o=[],l=!0,h=!1;try{for(n=n.call(r);!(l=(s=n.next()).done)&&(o.push(s.value),!i||o.length!==i);l=!0);}catch(c){h=!0,a=c}finally{try{l||n.return==null||n.return()}finally{if(h)throw a}}return o}}(t,e)||Wl(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
426
426
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ml(t){return function(e){if(Array.isArray(e))return Dl(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||Wl(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
427
427
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Wl(t,e){if(t){if(typeof t=="string")return Dl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dl(t,e):void 0}}function Dl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function ei(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Wl(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
428
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{a||r.return==null||r.return()}finally{if(o)throw s}}}}var ti={DEBUG:!1,LIB_VERSION:"1.87.6"},jg=Array.isArray,Yp=Object.prototype,Jp=Yp.hasOwnProperty,zn=Yp.toString,Ye=jg||function(t){return zn.call(t)==="[object Array]"},wp=function(t){return zn.call(t)==="[object Uint8Array]"},ri=function(t){try{return/^\s*\bfunction\b/.test(t)}catch{return!1}},xr=function(t){return t===Object(t)&&!Ye(t)},Gg=function(t){if(xr(t)){for(var e in t)if(Jp.call(t,e))return!1;return!0}return!1},
|
|
428
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{a||r.return==null||r.return()}finally{if(o)throw s}}}}var ti={DEBUG:!1,LIB_VERSION:"1.87.6"},jg=Array.isArray,Yp=Object.prototype,Jp=Yp.hasOwnProperty,zn=Yp.toString,Ye=jg||function(t){return zn.call(t)==="[object Array]"},wp=function(t){return zn.call(t)==="[object Uint8Array]"},ri=function(t){try{return/^\s*\bfunction\b/.test(t)}catch{return!1}},xr=function(t){return t===Object(t)&&!Ye(t)},Gg=function(t){if(xr(t)){for(var e in t)if(Jp.call(t,e))return!1;return!0}return!1},me=function(t){return t===void 0},xt=function(t){return zn.call(t)=="[object String]"},Wt=function(t){return t===null},ar=function(t){return zn.call(t)=="[object Number]"},Fl=function(t){return zn.call(t)==="[object Boolean]"},Xp=Array.prototype,xp=Xp.forEach,Sp=Xp.indexOf,J=typeof window<"u"?window:{},Hg=J.navigator||{userAgent:""},Oe=J.document||{},ct=Hg.userAgent,kp="[PostHog.js]",z={_log:function(t){if((ti.DEBUG||J.POSTHOG_DEBUG)&&!me(J.console)&&J.console){for(var e=("__rrweb_original__"in J.console[t])?J.console[t].__rrweb_original__:J.console[t],r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];e.apply(void 0,[kp].concat(i))}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];z._log.apply(z,["log"].concat(e))},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];z._log.apply(z,["warn"].concat(e))},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];z._log.apply(z,["error"].concat(e))},critical:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];(t=console).error.apply(t,[kp].concat(r))},uninitializedWarning:function(t){z.error("You must initialize PostHog before calling ".concat(t))}},Zl={},Ol=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Wi(t,e,r){if(Ye(t)){if(xp&&t.forEach===xp)t.forEach(e,r);else if("length"in t&&t.length===+t.length){for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===Zl)return}}}function Pe(t,e,r){if(!Wt(t)&&!me(t)){if(Ye(t))return Wi(t,e,r);for(var i in t)if(Jp.call(t,i)&&e.call(r,t[i],i)===Zl)return}}var Qe=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Wi(r,function(n){for(var s in n)n[s]!==void 0&&(t[s]=n[s])}),t};function _e(t,e){return t.indexOf(e)!==-1}var Kp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Ep=function(t){try{return t()}catch{return}},Qp=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(n){z.critical("Implementation error. Please turn on debug and contact support@posthog.com."),z.critical(n)}}},$l=function(t){var e={};return Pe(t,function(r,i){xt(r)&&r.length>0&&(e[i]=r)}),e},qg=["$performance_raw"];function Ug(t,e){return r=t,i=function(s,a){return a&&qg.indexOf(a)>-1?s:xt(s)&&!Wt(e)?s.slice(0,e):s},n=new Set,function s(a,o){return a!==Object(a)?i?i(a,o):a:n.has(a)?void 0:(n.add(a),Ye(a)?(l=[],Wi(a,function(h){l.push(s(h))})):(l={},Pe(a,function(h,c){n.has(h)||(l[c]=s(h,c))})),l);var l}(r);var r,i,n}function Yl(t){var e,r,i,n,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=0,l=0,h="",c=[];if(!t)return t;t=Wg(t);do e=(s=t.charCodeAt(o++)<<16|t.charCodeAt(o++)<<8|t.charCodeAt(o++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,c[l++]=a.charAt(e)+a.charAt(r)+a.charAt(i)+a.charAt(n);while(o<t.length);switch(h=c.join(""),t.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"="}return h}var Wg=function(t){var e,r,i,n,s="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,`
|
|
429
429
|
`).replace(/\r/g,`
|
|
430
|
-
`)).length,n=0;n<i;n++){var a=t.charCodeAt(n),o=null;a<128?r++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Wt(o)||(r>e&&(s+=t.substring(e,r)),s+=o,e=r=n+1)}return r>e&&(s+=t.substring(e,t.length)),s},Zg=["ahrefsbot","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","hubspot","linkedinbot","mj12bot","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","twitterbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],Yg=function(t,e){if(!t)return!1;var r=t.toLowerCase();return Zg.concat(e||[]).some(function(i){var n=i.toLowerCase();return r.includes?r.includes(n):r.indexOf(n)!==-1})},Rn=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation),e}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},function(e,r,i,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(r,i,!!s);else{var a="on"+r,o=e[a];e[a]=function(l,h,c){return function(u){if(u=u||t(window.event)){var f,p=!0;ri(c)&&(f=c(u));var m=h.call(l,u);return f!==!1&&m!==!1||(p=!1),p}}}(e,i,o)}else z.error("No valid element provided to register_event")}}();function Ln(t,e){var r=function(){var i=Oe.createElement("script");i.type="text/javascript",i.src=t,i.onload=function(a){return e(void 0,a)},i.onerror=function(a){return e(a)};var n,s=Oe.querySelectorAll("body > script");s.length>0?(n=s[0].parentNode)===null||n===void 0||n.insertBefore(i,s[0]):Oe.body.appendChild(i)};Oe.body?r():Oe.addEventListener("DOMContentLoaded",r)}function Aa(t){switch(Tl(t.className)){case"string":return t.className;case"object":return("baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";default:return""}}function Ca(t){var e="";return wa(t)&&!td(t)&&t.childNodes&&t.childNodes.length&&Pe(t.childNodes,function(r){ed(r)&&r.textContent&&(e+=Ol(r.textContent).split(/(\s+)/).filter(Gi).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Ol(e)}function Pp(t){return!!t&&t.nodeType===1}function Qr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function ed(t){return!!t&&t.nodeType===3}function Ap(t){return!!t&&t.nodeType===11}var kl=["a","button","form","input","select","textarea","label"];function wa(t){for(var e=t;e.parentNode&&!Qr(e,"body");e=e.parentNode){var r=Aa(e).split(" ");if(_e(r,"ph-sensitive")||_e(r,"ph-no-capture"))return!1}if(_e(Aa(t).split(" "),"ph-include"))return!0;var i=t.type||"";if(xt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(xt(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function td(t){return!!(Qr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Qr(t,"select")||Qr(t,"textarea")||t.getAttribute("contenteditable")==="true")}function Gi(t){return!(Wt(t)||fe(t)||xt(t)&&(t=Ol(t),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(t)))}function Cp(t){var e=Ca(t);return Gi(e="".concat(e," ").concat(rd(t)).trim())?e:""}function rd(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Pe(t.childNodes,function(r){var i;if(r&&((i=r.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var n=Ca(r);e="".concat(e," ").concat(n).trim(),r.childNodes&&r.childNodes.length&&(e="".concat(e," ").concat(rd(r)).trim())}catch(s){z.error(s)}}),e}var Jg=function(){function t(e){Re(this,t),this.clicks=[],this.enabled=e}return Le(t,[{key:"isRageClick",value:function(e,r,i){if(!this.enabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(r-n.y)<30&&i-n.timestamp<1e3){if(this.clicks.push({x:e,y:r,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:r,timestamp:i}];return!1}}]),t}(),id="$people_distinct_id",xa="__alias",$n="__timers",Tp="$autocapture_disabled_server_side",Rl="$session_recording_enabled_server_side",Ip="$console_log_recording_enabled_server_side",Mp="$session_recording_recorder_version_server_side",Ta="$sesid",Sa="$session_is_sampled",Hi="$enabled_feature_flags",Ll="$early_access_features",qi="$stored_person_properties",_r="$stored_group_properties",Bl="$surveys",Ia="$flag_call_reported",Vl="$user_state",Nl="$posthog_quota_limited",Xg=[id,xa,"__cmpns",$n,Rl,Ta,Hi,Vl,Nl,Ll,_r,qi,Bl,Ia];function El(t,e){return e.length>t?e.slice(0,t)+"...":e}var wr={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(t){var e,r=Wt(this._isDisabledServerSide)?!((e=t.persistence)===null||e===void 0||!e.props[Tp]):this._isDisabledServerSide,i=!!t.config.autocapture;this._isAutocaptureEnabled=i&&!r},_previousElementSibling:function(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Pp(e));return e},_getAugmentPropertiesFromElement:function(t){if(!wa(t))return{};var e={};return Pe(t.attributes,function(r){if(r.name.indexOf("data-ph-capture-attribute")===0){var i=r.name.replace("data-ph-capture-attribute-",""),n=r.value;i&&n&&Gi(n)&&(e[i]=n)}}),e},_getPropertiesFromElement:function(t,e,r){var i,n=t.tagName.toLowerCase(),s={tag_name:n};kl.indexOf(n)>-1&&!r&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=El(1024,Cp(t)):s.$el_text=El(1024,Ca(t)));var a=Aa(t);a.length>0&&(s.classes=a.split(" ").filter(function(u){return u!==""}));var o=(i=this.config)===null||i===void 0?void 0:i.element_attribute_ignorelist;Pe(t.attributes,function(u){var f;td(t)&&["name","id","class"].indexOf(u.name)===-1||o!=null&&o.includes(u.name)||!e&&Gi(u.value)&&(f=u.name,!xt(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")&&(s["attr__"+u.name]=El(1024,u.value))});for(var l=1,h=1,c=t;c=this._previousElementSibling(c);)l++,c.tagName===t.tagName&&h++;return s.nth_child=l,s.nth_of_type=h,s},_getDefaultProperties:function(t){return{$event_type:t,$ce_version:1}},_extractCustomPropertyValue:function(t){var e=[];return Pe(document.querySelectorAll(t.css_selector),function(r){var i;["input","select"].indexOf(r.tagName.toLowerCase())>-1?i=r.value:r.textContent&&(i=r.textContent),Gi(i)&&e.push(i)}),e.join(", ")},_getCustomProperties:function(t){var e=this,r={};return Pe(this._customProperties,function(i){Pe(i.event_selectors,function(n){Pe(document.querySelectorAll(n),function(s){_e(t,s)&&wa(s)&&(r[i.name]=e._extractCustomPropertyValue(i))})})}),r},_getEventTarget:function(t){return fe(t.target)?t.srcElement||null:(e=t.target)!==null&&e!==void 0&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e},_captureEvent:function(t,e){var r,i=this,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",s=this._getEventTarget(t);if(ed(s)&&(s=s.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,e,"$rageclick"),s&&function(g,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!g||Qr(g,"html")||!Pp(g))return!1;if(y!=null&&y.url_allowlist){var v=window.location.href,b=y.url_allowlist;if(b&&!b.some(function(E){return v.match(E)}))return!1}if(y!=null&&y.dom_event_allowlist){var _=y.dom_event_allowlist;if(_&&!_.some(function(E){return d.type===E}))return!1}if(y!=null&&y.element_allowlist){var x=y.element_allowlist;if(x&&!x.some(function(E){return g.tagName.toLowerCase()===E}))return!1}if(y!=null&&y.css_selector_allowlist){var T=y.css_selector_allowlist;if(T&&!T.some(function(E){return g.matches(E)}))return!1}for(var S=!1,w=[g],M=!0,k=g;k.parentNode&&!Qr(k,"body");)if(Ap(k.parentNode))w.push(k.parentNode.host),k=k.parentNode.host;else{if(!(M=k.parentNode||!1))break;if(kl.indexOf(M.tagName.toLowerCase())>-1)S=!0;else{var I=window.getComputedStyle(M);I&&I.getPropertyValue("cursor")==="pointer"&&(S=!0)}w.push(M),k=M}var P=window.getComputedStyle(g);if(P&&P.getPropertyValue("cursor")==="pointer"&&d.type==="click")return!0;var A=g.tagName.toLowerCase();switch(A){case"html":return!1;case"form":return d.type==="submit";case"input":case"select":case"textarea":return d.type==="change"||d.type==="click";default:return S?d.type==="click":d.type==="click"&&(kl.indexOf(A)>-1||g.getAttribute("contenteditable")==="true")}}(s,t,this.config)){for(var a,o,l=[s],h=s;h.parentNode&&!Qr(h,"body");)Ap(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,u=[],f={},p=!1;if(Pe(l,function(g){var d=wa(g);g.tagName.toLowerCase()==="a"&&(c=g.getAttribute("href"),c=d&&Gi(c)&&c),_e(Aa(g).split(" "),"ph-no-capture")&&(p=!0),u.push(i._getPropertiesFromElement(g,e.config.mask_all_element_attributes,e.config.mask_all_text));var y=i._getAugmentPropertiesFromElement(g);Qe(f,y)}),e.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?u[0].$el_text=Cp(s):u[0].$el_text=Ca(s)),c&&(u[0].attr__href=c),p)return!1;var m=Qe(this._getDefaultProperties(t.type),{$elements:u},(a=u[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(o=u[0])===null||o===void 0?void 0:o.$el_text}:{},this._getCustomProperties(l),f);return e.capture(n,m),!0}},_navigate:function(t){window.location.href=t},_addDomEventHandlers:function(t){var e=this,r=function(i){i=i||window.event,e._captureEvent(i,t)};Rn(document,"submit",r,!1,!0),Rn(document,"change",r,!1,!0),Rn(document,"click",r,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(t){var e;Fl(t.__autocapture)||(this.config=t.__autocapture),(e=this.config)!==null&&e!==void 0&&e.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(r){return new RegExp(r)})),this.rageclicks=new Jg(t.config.rageclick)},afterDecideResponse:function(t,e){var r=e.config.token;this._initializedTokens.indexOf(r)>-1?z.info('autocapture already initialized for token "'+r+'"'):(e.persistence&&e.persistence.register(Z({},Tp,!!t.autocapture_opt_out)),this._isDisabledServerSide=!!t.autocapture_opt_out,this._setIsAutocaptureEnabled(e),this._initializedTokens.push(r),t&&t.config&&t.config.enable_collect_everything&&this._isAutocaptureEnabled?(t.custom_properties&&(this._customProperties=t.custom_properties),this._addDomEventHandlers(e)):e.__autocapture=!1)},enabledForProject:function(t,e,r){if(!t)return!0;e=fe(e)?10:e,r=fe(r)?10:r;for(var i=0,n=0;n<t.length;n++)i+=t.charCodeAt(n);return i%e<r},isBrowserSupported:function(){return ri(document.querySelectorAll)}};(function(t){for(var e in t)ri(t[e])&&(t[e]=t[e].bind(t))})(wr),function(t){for(var e in t)ri(t[e])&&(t[e]=Qp(t[e]))}(wr);var Pl="$active_feature_flags",ga="$override_feature_flags",Dp="$feature_flag_payloads",Fp=function(t){var e,r={},i=ei(function(o){for(var l=Object.keys(o),h=l.length,c=new Array(h);h--;)c[h]=[l[h],o[l[h]]];return c}(t||{}));try{for(i.s();!(e=i.n()).done;){var n=Nn(e.value,2),s=n[0],a=n[1];a&&(r[s]=a)}}catch(o){i.e(o)}finally{i.f()}return r},Kg=function(){function t(e){Re(this,t),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Le(t,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Hi),r=this.instance.get_property(ga);if(!r)return e||{};for(var i=Qe({},e),n=Object.keys(r),s=0;s<n.length;s++)r[n[s]]===!1?delete i[n[s]]:i[n[s]]=r[n[s]];return this._override_warning||(z.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:r,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Dp)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var r=this.instance.config.token,i=this.instance.get_property(qi),n=this.instance.get_property(_r),s=Yl(JSON.stringify({token:r,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:s},{method:"POST"},this.instance._prepare_callback(function(a){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(a),e.setReloadingPaused(!1),e._startReloadTimer()}))}},{key:"getFeatureFlag",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,n=this.getFlagVariants()[e],s="".concat(n),a=this.instance.get_property(Ia)||{};return(r.send_event||!("send_event"in r))&&(!(e in a)||!a[e].includes(s))&&(Ye(a[e])?a[e].push(s):a[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(Z({},Ia,a)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}z.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,r);z.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(r){return r!==e})}},{key:"receivedFeatureFlags",value:function(e){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();(function(n,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=n.featureFlags,h=n.featureFlagPayloads;if(l)if(Ye(l)){var c,u={};if(l)for(var f=0;f<l.length;f++)u[l[f]]=!0;s&&s.register((Z(c={},Pl,l),Z(c,Hi,u),c))}else{var p,m=l,g=h;n.errorsWhileComputingFlags&&(m=he(he({},a),m),g=he(he({},o),g)),s&&s.register((Z(p={},Pl,Object.keys(Fp(m))),Z(p,Hi,m||{}),Z(p,Dp,g||{}),p))}})(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return z.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(ga);else if(Ye(e)){for(var r={},i=0;i<e.length;i++)r[e[i]]=!0;this.instance.persistence.register(Z({},ga,r))}else this.instance.persistence.register(Z({},ga,e))}},{key:"onFeatureFlags",value:function(e){var r=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),n=i.flags,s=i.flagVariants;e(n,s)}return function(){return r.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,r){var i,n,s=Z({},"$feature_enrollment/".concat(e),r);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:r,$set:s}),this.setPersonPropertiesForFlags(s,!1);var a=he(he({},this.getFlagVariants()),{},Z({},e,r));(i=this.instance.persistence)===null||i===void 0||i.register((Z(n={},Pl,Object.keys(Fp(a))),Z(n,Hi,a),n)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(Ll);if(n&&!i)return e(n);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var a,o=s.earlyAccessFeatures;return(a=r.instance.persistence)===null||a===void 0||a.register(Z({},Ll,o)),e(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),r=this.getFlagVariants();return{flags:e.filter(function(i){return r[i]}),flagVariants:Object.keys(r).filter(function(i){return r[i]}).reduce(function(i,n){return i[n]=r[n],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach(function(n){return n(r,i)})}},{key:"setPersonPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(qi)||{};this.instance.register(Z({},qi,he(he({},i),e))),r&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(qi)}},{key:"setGroupPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(_r)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(n){i[n]=he(he({},i[n]),e[n]),delete e[n]}),this.instance.register(Z({},_r,he(he({},i),e))),r&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var r=this.instance.get_property(_r)||{};this.instance.register(Z({},_r,he(he({},r),{},Z({},e,{}))))}else this.instance.unregister(_r)}}]),t}(),Qg=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,or={is_supported:function(){return!0},error:function(t){z.error("cookieStore error: "+t)},get:function(t){try{for(var e=t+"=",r=document.cookie.split(";").filter(function(s){return s.length}),i=0;i<r.length;i++){for(var n=r[i];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null},parse:function(t){var e;try{e=JSON.parse(or.get(t))||{}}catch{}return e},set:function(t,e,r,i,n){try{var s="",a="",o="";if(i){var l=document.location.hostname.match(Qg),h=l?l[0]:"";s=h?"; domain=."+h:""}if(r){var c=new Date;c.setTime(c.getTime()+24*r*60*60*1e3),a="; expires="+c.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+s+o;return document.cookie=u,u}catch{return}},remove:function(t,e){try{or.set(t,"",-1,e)}catch{return}}},Al=null,$e={is_supported:function(){if(!Wt(Al))return Al;var t=!0;if(fe(window))t=!1;else try{var e="__mplssupport__";$e.set(e,"xyz"),$e.get(e)!=='"xyz"'&&(t=!1),$e.remove(e)}catch{t=!1}return t||z.error("localStorage unsupported; falling back to cookie store"),Al=t,t},error:function(t){z.error("localStorage error: "+t)},get:function(t){try{return window.localStorage.getItem(t)}catch(e){$e.error(e)}return null},parse:function(t){try{return JSON.parse($e.get(t))||{}}catch{}return null},set:function(t,e){try{window.localStorage.setItem(t,JSON.stringify(e))}catch(r){$e.error(r)}},remove:function(t){try{window.localStorage.removeItem(t)}catch(e){$e.error(e)}}},e0=["distinct_id",Ta,Sa],zl=he(he({},$e),{},{parse:function(t){try{var e={};try{e=or.parse(t)||{}}catch{}var r=Qe(e,JSON.parse($e.get(t)||"{}"));return $e.set(t,r),r}catch{}return null},set:function(t,e,r,i,n){try{$e.set(t,e);var s={};e0.forEach(function(a){e[a]&&(s[a]=e[a])}),Object.keys(s).length&&or.set(t,s,r,i,n)}catch(a){$e.error(a)}},remove:function(t,e){try{window.localStorage.removeItem(t),or.remove(t,e)}catch(r){$e.error(r)}}}),ya={},t0={is_supported:function(){return!0},error:function(t){z.error("memoryStorage error: "+t)},get:function(t){return ya[t]||null},parse:function(t){return ya[t]||null},set:function(t,e){ya[t]=e},remove:function(t){delete ya[t]}},Xr=null,Ze={is_supported:function(){if(!Wt(Xr))return Xr;if(Xr=!0,fe(window))Xr=!1;else try{var t="__support__";Ze.set(t,"xyz"),Ze.get(t)!=='"xyz"'&&(Xr=!1),Ze.remove(t)}catch{Xr=!1}return Xr},error:function(t){z.error("sessionStorage error: ",t)},get:function(t){try{return window.sessionStorage.getItem(t)}catch(e){Ze.error(e)}return null},parse:function(t){try{return JSON.parse(Ze.get(t))||null}catch{}return null},set:function(t,e){try{window.sessionStorage.setItem(t,JSON.stringify(e))}catch(r){Ze.error(r)}},remove:function(t){try{window.sessionStorage.removeItem(t)}catch(e){Ze.error(e)}}},r0=["localhost","127.0.0.1"],i0=function(t,e){return!!function(r){try{new RegExp(r)}catch{return!1}return!0}(e)&&new RegExp(e).test(t)},Op=function(t,e){for(var r,i=((t.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Ye(r)||r.length<2)return"";var a=r[1];try{a=decodeURIComponent(a)}catch{z.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Ma=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},Ue={campaignParams:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(t||[]),r={};return Pe(e,function(i){var n=Op(Oe.URL,i);n.length&&(r[i]=n)}),r},searchEngine:function(){var t=Oe.referrer;return t?t.search("https?://(.*)google.([^/?]*)")===0?"google":t.search("https?://(.*)bing.com")===0?"bing":t.search("https?://(.*)yahoo.com")===0?"yahoo":t.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var t=Ue.searchEngine(),e=t!="yahoo"?"q":"p",r={};if(!Wt(t)){r.$search_engine=t;var i=Op(Oe.referrer,e);i.length&&(r.ph_keyword=i)}return r},browser:function(t,e,r){return e=e||"",r||_e(t," OPR/")?_e(t,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":_e(t,"IEMobile")||_e(t,"WPDesktop")?"Internet Explorer Mobile":_e(t,"SamsungBrowser/")?"Samsung Internet":_e(t,"Edge")||_e(t,"Edg/")?"Microsoft Edge":_e(t,"FBIOS")?"Facebook Mobile":_e(t,"Chrome")?"Chrome":_e(t,"CriOS")?"Chrome iOS":_e(t,"UCWEB")||_e(t,"UCBrowser")?"UC Browser":_e(t,"FxiOS")?"Firefox iOS":_e(e,"Apple")||function(i){return _e(i,"Safari")&&!_e(i,"Chrome")&&!_e(i,"Android")}(t)?_e(t,"Mobile")?"Mobile Safari":"Safari":_e(t,"Android")?"Android Mobile":_e(t,"Konqueror")||_e(t,"konqueror")?"Konqueror":_e(t,"Firefox")?"Firefox":_e(t,"MSIE")||_e(t,"Trident/")?"Internet Explorer":_e(t,"Gecko")?"Mozilla":""},browserVersion:function(t,e,r){var i={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[Ue.browser(t,e,r)];if(fe(i))return null;for(var n=0;n<i.length;n++){var s=i[n],a=t.match(s);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(t){if(/Windows/i.test(t)){if(/Phone/.test(t)||/WPDesktop/.test(t))return{os_name:"Windows Phone",os_version:""};var e=/Windows NT ([0-9.]+)/i.exec(t);return e&&e[1]?{os_name:"Windows",os_version:e[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(t)){var r=/OS (\d+)_(\d+)_?(\d+)?/i.exec(t);return r&&r[1]?{os_name:"iOS",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(t)){var i=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(t);return i&&i[1]?{os_name:"Android",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(t))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(t)){var n=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(t);return n&&n[1]?{os_name:"Mac OS X",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(t)?{os_name:"Linux",os_version:""}:/CrOS/.test(t)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(t){return/Windows Phone/i.test(t)||/WPDesktop/.test(t)?"Windows Phone":/iPad/.test(t)?"iPad":/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Android/.test(t)&&!/Mobile/.test(t)?"Android Tablet":/Android/.test(t)?"Android":""},deviceType:function(t){var e=this.device(t);return e==="iPad"||e==="Android Tablet"?"Tablet":e?"Mobile":"Desktop"},referrer:function(){return Oe.referrer||"$direct"},referringDomain:function(){if(!Oe.referrer)return"$direct";var t=Oe.createElement("a");return t.href=Oe.referrer,t.host},properties:function(){var t,e,r,i,n,s,a,o=Ue.os(ct),l=o.os_name,h=o.os_version;return Qe($l({$os:l,$os_version:h,$browser:Ue.browser(ct,navigator.vendor,window.opera),$device:Ue.device(ct),$device_type:Ue.deviceType(ct)}),{$current_url:(t=window)===null||t===void 0?void 0:t.location.href,$host:(e=window)===null||e===void 0?void 0:e.location.host,$pathname:(r=window)===null||r===void 0?void 0:r.location.pathname,$raw_user_agent:ct.length>1e3?ct.substring(0,997)+"...":ct,$browser_version:Ue.browserVersion(ct,navigator.vendor,window.opera),$browser_language:Ue.browserLanguage(),$screen_height:(i=window)===null||i===void 0?void 0:i.screen.height,$screen_width:(n=window)===null||n===void 0?void 0:n.screen.width,$viewport_height:(s=window)===null||s===void 0?void 0:s.innerHeight,$viewport_width:(a=window)===null||a===void 0?void 0:a.innerWidth,$lib:"web",$lib_version:ti.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Kp()/1e3})},people_properties:function(){var t=Ue.os(ct),e=t.os_name,r=t.os_version;return Qe($l({$os:e,$os_version:r,$browser:Ue.browser(ct,navigator.vendor,window.opera)}),{$browser_version:Ue.browserVersion(ct,navigator.vendor,window.opera)})}},n0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],$p=function(){function t(e){Re(this,t);var r="";e.token&&(r=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=e.custom_campaign_params||[],e.persistence_name?this.name="ph_"+e.persistence_name:this.name="ph_"+r+"_posthog",n0.indexOf(e.persistence.toLowerCase())===-1&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to cookie"),e.persistence="cookie");var i=e.persistence.toLowerCase();i==="localstorage"&&$e.is_supported()?this.storage=$e:i==="localstorage+cookie"&&zl.is_supported()?this.storage=zl:i==="sessionstorage"&&Ze.is_supported()?this.storage=Ze:this.storage=i==="memory"?t0:or,this.user_state="anonymous",this.load(),this.update_config(e),this.save()}return Le(t,[{key:"properties",value:function(){var e={};return Pe(this.props,function(r,i){if(i===Hi&&xr(r))for(var n=Object.keys(r),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=r[n[s]];else o=i,l=!1,(Wt(a=Xg)?l:Sp&&a.indexOf===Sp?a.indexOf(o)!=-1:(Pe(a,function(h){if(l||(l=h===o))return Zl}),l))||(e[i]=r);var a,o,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Qe({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,r,i){var n=this;if(xr(e)){fe(r)&&(r="None"),this.expire_days=fe(i)?this.default_expiry:i;var s=!1;if(Pe(e,function(a,o){n.props.hasOwnProperty(o)&&n.props[o]!==r||(n.props[o]=a,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,r){var i=this;if(xr(e)){this.expire_days=fe(r)?this.default_expiry:r;var n=!1;if(Pe(e,function(s,a){e.hasOwnProperty(a)&&i.props[a]!==s&&(i.props[a]=s,n=!0)}),n)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(Ue.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(Ue.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||Ue.referrer(),$referring_domain:this.props.$referring_domain||Ue.referringDomain()})}},{key:"get_referrer_info",value:function(){return $l({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Pe(this.props,function(r,i){i in e||(e[i]=r)}),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,r){var i=this.props[$n]||{};i[e]=r,this.props[$n]=i,this.save()}},{key:"remove_event_timer",value:function(e){var r=(this.props[$n]||{})[e];return fe(r)||(delete this.props[$n][e],this.save()),r}},{key:"get_user_state",value:function(){return this.props[Vl]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Vl]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[Nl]||{}}},{key:"set_quota_limits",value:function(e){this.props[Nl]=e,this.save()}}]),t}(),Rp=2,s0=4,nd=3,a0=6,o0=0,l0="rrweb/console@1",Ut,h0=Le(function t(e){var r,i,n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Re(this,t),Z(this,"bucketSize",100),Z(this,"refillRate",10),Z(this,"mutationBuckets",{}),Z(this,"loggedTracker",{}),Z(this,"refillBuckets",function(){Object.keys(n.mutationBuckets).forEach(function(a){n.mutationBuckets[a]=n.mutationBuckets[a]+n.refillRate,n.mutationBuckets[a]>=n.bucketSize&&delete n.mutationBuckets[a]})}),Z(this,"getNodeOrRelevantParent",function(a){var o=n.rrweb.mirror.getNode(a);if(o?.nodeName!=="svg"&&o instanceof Element){var l=o.closest("svg");if(l)return[n.rrweb.mirror.getId(l),l]}return[a,o]}),Z(this,"numberOfChanges",function(a){var o,l,h,c,u,f,p,m;return((o=(l=a.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((h=(c=a.attributes)===null||c===void 0?void 0:c.length)!==null&&h!==void 0?h:0)+((u=(f=a.texts)===null||f===void 0?void 0:f.length)!==null&&u!==void 0?u:0)+((p=(m=a.adds)===null||m===void 0?void 0:m.length)!==null&&p!==void 0?p:0)}),Z(this,"throttleMutations",function(a){if(a.type!==nd||a.data.source!==o0)return a;var o=a.data,l=n.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter(function(c){var u,f,p,m=Nn(n.getNodeOrRelevantParent(c.id),2),g=m[0],d=m[1];return n.mutationBuckets[g]===0?!1:(n.mutationBuckets[g]=(u=n.mutationBuckets[g])!==null&&u!==void 0?u:n.bucketSize,n.mutationBuckets[g]=Math.max(n.mutationBuckets[g]-1,0),n.mutationBuckets[g]===0&&(n.loggedTracker[g]||(n.loggedTracker[g]=!0,(f=(p=n.options).onBlockedNode)===null||f===void 0||f.call(p,g,d))),c)}));var h=n.numberOfChanges(o);return h!==0||l===h?a:void 0}),this.rrweb=e,this.options=s,this.refillRate=(r=this.options.refillRate)!==null&&r!==void 0?r:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){n.refillBuckets()},1e3)}),sd=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}(sd||{}),c0="/s/";(function(t){t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(Ut||(Ut={}));var u0=[Ut.MouseMove,Ut.MouseInteraction,Ut.Scroll,Ut.ViewportResize,Ut.Input,Ut.TouchMove,Ut.MediaInteraction,Ut.Drag],p0=function(){function t(e){var r=this;if(Re(this,t),Z(this,"_linkedFlagSeen",!1),Z(this,"_lastActivityTimestamp",Date.now()),Z(this,"isIdle",!1),Z(this,"_linkedFlag",null),Z(this,"_sampleRate",null),Z(this,"_minimumDuration",null),this.instance=e,this._captureStarted=!1,this._endpoint=c0,this.stopRrweb=void 0,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){r._flushBuffer()}),!this.instance.sessionManager)throw z.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=i.sessionId,s=i.windowId;this.windowId=s,this.sessionId=n,this.buffer=this.clearBuffer()}return Le(t,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw z.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return ar(this._sampleRate)?this.instance.get_property(Sa):null}},{key:"sessionDuration",get:function(){var e,r,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((r=this.buffer)===null||r===void 0?void 0:r.data.length)-1],n=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-n:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Rl),r=!this.instance.config.disable_session_recording;return e&&r}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Ip),r=this.instance.config.enable_recording_console_log;return r??e}},{key:"recordingVersion",get:function(){var e,r=this.instance.get_property(Mp);return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recorderVersion)||r||"v1"}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?xt(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":Fl(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?this.startCaptureAndTrySendingQueuedSnapshots():(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1)}},{key:"makeSamplingDecision",value:function(e){var r,i=this.sessionId!==e;if(ar(this._sampleRate)){var n,s=this.isSampled;i||!Fl(s)?n=Math.random()<this._sampleRate:n=s,n||z.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),(r=this.instance.persistence)===null||r===void 0||r.register(Z({},Sa,n))}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register(Z({},Sa,null))}}},{key:"afterDecideResponse",value:function(e){var r,i,n,s,a,o,l,h=this;this.instance.persistence&&this.instance.persistence.register((Z(l={},Rl,!!e.sessionRecording),Z(l,Ip,(a=e.sessionRecording)===null||a===void 0?void 0:a.consoleLogRecordingEnabled),Z(l,Mp,(o=e.sessionRecording)===null||o===void 0?void 0:o.recorderVersion),l));var c=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate;this._sampleRate=fe(c)||Wt(c)?null:parseFloat(c);var u,f=(i=e.sessionRecording)===null||i===void 0?void 0:i.minimumDurationMilliseconds;if(this._minimumDuration=fe(f)?null:f,this._linkedFlag=((n=e.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(s=e.sessionRecording)!==null&&s!==void 0&&s.endpoint&&(this._endpoint=(u=e.sessionRecording)===null||u===void 0?void 0:u.endpoint),ar(this._sampleRate)&&this.sessionManager.onSessionId(function(m){h.makeSamplingDecision(m)}),xt(this._linkedFlag)){var p=this._linkedFlag;this.instance.onFeatureFlags(function(m){h._linkedFlagSeen=m.includes(p)})}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:Kp()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var e=this;if(!fe(Object.assign)&&!this._captureStarted&&!this.instance.config.disable_session_recording){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var r=this.recordingVersion==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Ln(this.instance.config.api_host+"/static/".concat(r,"?v=").concat(ti.LIB_VERSION),function(i){if(i)return z.error("Could not load ".concat(r),i);e._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var r;return e.type===nd&&u0.indexOf((r=e.data)===null||r===void 0?void 0:r.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var r=this._isInteractiveEvent(e);if(r||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0),r&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var i=this.sessionManager.checkAndGetSessionAndWindowId(!r,e.timestamp),n=i.windowId,s=i.sessionId,a=this.sessionId!==s,o=this.windowId!==n;this.windowId=n,this.sessionId=s,[Rp,s0].indexOf(e.type)===-1&&(o||a)&&this._tryTakeFullSnapshot()}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this._captureStarted)return!1;try{var e;return(e=this.rrwebRecord)===null||e===void 0||e.takeFullSnapshot(),!0}catch(r){return z.error("Error taking full snapshot.",r),!1}}},{key:"_onScriptLoaded",value:function(){var e,r=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var n=this.instance.config.session_recording,s=0,a=Object.entries(n||{});s<a.length;s++){var o=Nn(a[s],2),l=o[0],h=o[1];l in i&&(i[l]=h)}this.rrwebRecord?(this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new h0(this.rrwebRecord,{onBlockedNode:function(c,u){var f="Too many mutations on node '".concat(c,"'. Rate limiting. This could be due to SVG animations or something similar");z.info(f,{node:u}),r.log("[PostHog Recorder] "+f,"warn")}}),this.stopRrweb=this.rrwebRecord(he({emit:function(c){r.onRRwebEmit(c)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},i)),this.instance._addCaptureHook(function(c){try{if(c==="$pageview"){var u,f=r._maskUrl(window.location.href);if(!f)return;(u=r.rrwebRecord)===null||u===void 0||u.addCustomEvent("$pageview",{href:f})}}catch(p){z.error("Could not add $pageview to rrweb session",p)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):z.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(e){if(e&&xr(e)){if(e.type===sd.Meta){var r=this._maskUrl(e.data.href);if(!r)return;e.data.href=r}var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var n=function(a){var o=a;if(o&&xr(o)&&o.type===a0&&xr(o.data)&&o.data.plugin===l0){o.data.payload.payload.length>10&&(o.data.payload.payload=o.data.payload.payload.slice(0,10),o.data.payload.payload.push("...[truncated]"));for(var l=[],h=0;h<o.data.payload.payload.length;h++)o.data.payload.payload[h]&&o.data.payload.payload[h].length>2e3?l.push(o.data.payload.payload[h].slice(0,2e3)+"...[truncated]"):l.push(o.data.payload.payload[h]);return o.data.payload.payload=l,a}return a}(i),s={$snapshot_bytes:JSON.stringify(n).length,$snapshot_data:n,$session_id:this.sessionId,$window_id:this.windowId};this._updateWindowAndSessionIds(n),this.isIdle||(this.status!=="disabled"?this._captureSnapshotBuffered(s):this.clearBuffer())}}}},{key:"_maskUrl",value:function(e){var r=this.instance.config.session_recording;if(r.maskNetworkRequestFn){var i,n={url:e};return(i=n=r.maskNetworkRequestFn(n))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var r=this._minimumDuration,i=this.sessionDuration,n=ar(r)&&ar(i)&&i<r;return this.status==="buffering"||n?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer||this.clearBuffer()):this.buffer&&this.buffer.data.length!==0?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var r,i=this,n=2+(((r=this.buffer)===null||r===void 0?void 0:r.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===Rp}})}}]),t}(),qt={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},d0=["first-input","navigation","paint","resource"],f0=["/s/","/e/"],m0=function(){function t(e){Re(this,t),Z(this,"_forceAllowLocalhost",!1),this.instance=e}return Le(t,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e,r,i=this;if(!this.observer)if(fe((e=window)===null||e===void 0||(r=e.PerformanceObserver)===null||r===void 0?void 0:r.supportedEntryTypes))z.info("[PerformanceObserver] not started because PerformanceObserver is not supported by this browser.");else if(!r0.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(s){s.getEntries().forEach(function(a){i._capturePerformanceEvent(a)})});var n=PerformanceObserver.supportedEntryTypes.filter(function(s){return d0.includes(s)});n.forEach(function(s){var a;(a=i.observer)===null||a===void 0||a.observe({type:s,buffered:!0})})}catch(s){z.error("PostHog failed to start performance observer",s),this.stopObserving()}else z.info("[PerformanceObserver] not started because we are on localhost.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,r;return(e=(r=this.instance.config.capture_performance)!==null&&r!==void 0?r:this.remoteEnabled)!==null&&e!==void 0&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(e.name.indexOf(this.instance.config.api_host)===0){var r=e.name.replace(this.instance.config.api_host,"");if(f0.find(function(p){return r.indexOf(p)===0}))return}var i={url:e.name},n=this.instance.config.session_recording;if(n.maskNetworkRequestFn&&(i=n.maskNetworkRequestFn(i)),i){var s=e.toJSON();s.name=i.url;var a={},o=Math.floor(Date.now()-performance.now());for(var l in a[qt.timeOrigin]=o,a[qt.timestamp]=Math.floor(o+e.startTime),qt)fe(s[l])||(a[qt[l]]=s[l]);if(this.capturePerformanceEvent(a),g0(e)){var h,c=ei(e.serverTiming||[]);try{for(c.s();!(h=c.n()).done;){var u,f=h.value;this.capturePerformanceEvent((Z(u={},qt.timeOrigin,o),Z(u,qt.timestamp,Math.floor(o+e.startTime)),Z(u,qt.name,f.name),Z(u,qt.duration,f.duration),Z(u,qt.entryType,"serverTiming"),u))}}catch(p){c.e(p)}finally{c.f()}}}}},{key:"capturePerformanceEvent",value:function(e){var r,i=e[qt.timestamp];(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:e},timestamp:i})}}]),t}(),g0=function(t){return t.entryType==="navigation"||t.entryType==="resource"},y0=function(){function t(e){Re(this,t),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Le(t,[{key:"call",value:function(){var e=this,r=Yl(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(qi),group_properties:this.instance.get_property(_r),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:r,verbose:!0},{method:"POST"},function(i){return e.parseDecideResponse(i)})}},{key:"parseDecideResponse",value:function(e){var r,i,n,s,a=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),e?.status!==0){if(!document||!document.body)return z.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){a.parseDecideResponse(e)},500);this.instance.toolbar.afterDecideResponse(e),(r=this.instance.sessionRecording)===null||r===void 0||r.afterDecideResponse(e),wr.afterDecideResponse(e,this.instance),(i=this.instance.webPerformance)===null||i===void 0||i.afterDecideResponse(e),this.instance._afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.featureFlags.receivedFeatureFlags(e);var o=(n=window)===null||n===void 0?void 0:n.extendPostHogWithSurveys;e.surveys&&!o&&Ln(this.instance.config.api_host+"/static/surveys.js",function(p){if(p)return z.error("Could not load surveys script",p);window.extendPostHogWithSurveys(a.instance)});var l=(s=window)===null||s===void 0?void 0:s.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&fe(l)&&Ln(this.instance.config.api_host+"/static/exception-autocapture.js",function(p){if(p)return z.error("Could not load exception autocapture script",p);window.extendPostHogWithExceptionAutocapture(a.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var h,c=this.instance.config.api_host,u=ei(e.siteApps);try{var f=function(){var p=h.value,m=p.id,g=p.url,d=[c,c[c.length-1]==="/"&&g[0]==="/"?g.substring(1):g].join("");window["__$$ph_site_app_".concat(m)]=a.instance,Ln(d,function(y){y&&z.error("Error while initializing PostHog app with config id ".concat(m),y)})};for(u.s();!(h=u.n()).done;)f()}catch(p){u.e(p)}finally{u.f()}}else e.siteApps.length>0&&z.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else z.error("Failed to fetch feature flags from PostHog.")}}]),t}(),v0=["https://app.posthog.com","https://eu.posthog.com"],b0=["source"],_0=J.location?Ma(J.location.hash,"__posthog")||Ma(location.hash,"state"):null,w0=function(){function t(e){Re(this,t),this.instance=e}return Le(t,[{key:"afterDecideResponse",value:function(e){var r=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&r.toolbarVersion&&r.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(he({},r))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J.location,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:J.history;try{if(!r){try{J.localStorage.setItem("test","test"),J.localStorage.removeItem("test")}catch{return!1}r=J.localStorage}var n,s=_0||Ma(e.hash,"__posthog")||Ma(e.hash,"state"),a=s?Ep(function(){return JSON.parse(atob(decodeURIComponent(s)))})||Ep(function(){return JSON.parse(decodeURIComponent(s))}):null;return a&&a.action==="ph_authorize"?((n=a).source="url",n&&Object.keys(n).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState("",document.title,e.pathname+e.search):e.hash="")):((n=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}},{key:"loadToolbar",value:function(e){var r=this;if(J._postHogToolbarLoaded)return!1;J._postHogToolbarLoaded=!0;var i=this.instance.config.api_host,n=3e5,s=Math.floor(Date.now()/n)*n,a="".concat(i).concat(i.endsWith("/")?"":"/","static/toolbar.js?t=").concat(s),o=!v0.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,l=he(he({token:this.instance.config.token},e),{},{apiURL:i},o?{instrument:!1}:{});l.source;var h=Ng(l,b0);return J.localStorage.setItem("_postHogToolbarParams",JSON.stringify(h)),Ln(a,function(c){c?z.error("Failed to load toolbar",c):(J.ph_load_toolbar||J.ph_load_editor)(l,r.instance)}),Rn(J,"turbolinks:load",function(){J._postHogToolbarLoaded=!1,r.loadToolbar(l)}),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J.location,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:J.history;return this.maybeLoadToolbar(e,r,i)}}]),t}(),x0="__ph_opt_in_out_";function S0(t,e){od(!0,t,e)}function k0(t,e){od(!1,t,e)}function E0(t,e){return ad(t,e)==="1"}function Lp(t,e){return!!function(r){if(r&&r.respectDnt){var i=r&&r.window||J,n=i.navigator||{},s=!1;return Pe([n.doNotTrack,n.msDoNotTrack,i.doNotTrack],function(a){_e([!0,1,"1","yes"],a)&&(s=!0)}),s}return!1}(e)||ad(t,e)==="0"}function P0(t,e){Jl(e=e||{}).remove(Xl(t,e),!!e.crossSubdomainCookie)}function Jl(t){return(t=t||{}).persistenceType==="localStorage"?$e:t.persistenceType==="localStorage+cookie"?zl:or}function Xl(t,e){return((e=e||{}).persistencePrefix||x0)+t}function ad(t,e){return Jl(e).get(Xl(t,e))}function od(t,e,r){xt(e)&&e.length?(Jl(r=r||{}).set(Xl(e,r),t?1:0,ar(r.cookieExpiration)?r.cookieExpiration:null,r.crossSubdomainCookie,r.secureCookie),r.capture&&t&&r.capture(r.captureEventName||"$opt_in",r.captureProperties||{},{send_instantly:!0})):z.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token")}var ld=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Re(this,t),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=e}return Le(t,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),t}(),A0=function(t){Wp(r,ld);var e=Zp(r);function r(i){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e3;return Re(this,r),(n=e.call(this,s)).handlePollRequest=i,n}return Le(r,[{key:"enqueue",value:function(i,n,s){this._event_queue.push({url:i,data:n,options:s}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var i=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(i._event_queue.length>0){var n=i.formatQueue(),s=function(o){var l=n[o],h=l.url,c=l.data,u=l.options;Pe(c,function(f,p){c[p].offset=Math.abs(c[p].timestamp-i.getTime()),delete c[p].timestamp}),i.handlePollRequest(h,c,u)};for(var a in n)s(a);i._event_queue.length=0,i._empty_queue_count=0}else i._empty_queue_count++;i._empty_queue_count>4&&(i.isPolling=!1,i._empty_queue_count=0),i.isPolling&&i.poll()},this._pollInterval)}},{key:"unload",value:function(){var i=this;clearTimeout(this._poller);var n=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var s=Object.values(n);[].concat(Ml(s.filter(function(a){return a.url.indexOf("/e")===0})),Ml(s.filter(function(a){return a.url.indexOf("/e")!==0}))).map(function(a){var o=a.url,l=a.data,h=a.options;i.handlePollRequest(o,l,he(he({},h),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var i={};return Pe(this._event_queue,function(n){var s=n.url,a=n.data,o=n.options,l=(o?o._batchKey:null)||s;fe(i[l])&&(i[l]={data:[],url:s,options:o}),o&&i[l].options&&i[l].options._metrics&&!i[l].options._metrics.rrweb_full_snapshot&&(i[l].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),i[l].data.push(a)}),i}}]),r}(),St=Uint8Array,nt=Uint16Array,Zi=Uint32Array,Kl=new St([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ql=new St([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bp=new St([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hd=function(t,e){for(var r=new nt(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new Zi(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},cd=hd(Kl,2),C0=cd[0],jl=cd[1];C0[28]=258,jl[258]=28;for(Gl=hd(Ql,0)[1],Da=new nt(32768),Te=0;Te<32768;++Te)vr=(43690&Te)>>>1|(21845&Te)<<1,vr=(61680&(vr=(52428&vr)>>>2|(13107&vr)<<2))>>>4|(3855&vr)<<4,Da[Te]=((65280&vr)>>>8|(255&vr)<<8)>>>1;var vr,Gl,Da,Te,Bn=function(t,e,r){for(var i=t.length,n=0,s=new nt(e);n<i;++n)++s[t[n]-1];var a,o=new nt(e);for(n=0;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new nt(1<<e);var l=15-e;for(n=0;n<i;++n)if(t[n])for(var h=n<<4|t[n],c=e-t[n],u=o[t[n]-1]++<<c,f=u|(1<<c)-1;u<=f;++u)a[Da[u]>>>l]=h}else for(a=new nt(i),n=0;n<i;++n)a[n]=Da[o[t[n]-1]++]>>>15-t[n];return a},ii=new St(288);for(Te=0;Te<144;++Te)ii[Te]=8;for(Te=144;Te<256;++Te)ii[Te]=9;for(Te=256;Te<280;++Te)ii[Te]=7;for(Te=280;Te<288;++Te)ii[Te]=8;var Fa=new St(32);for(Te=0;Te<32;++Te)Fa[Te]=5;var Kr,T0=Bn(ii,9,0),I0=Bn(Fa,5,0),ud=function(t){return(t/8>>0)+(7&t&&1)},pd=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var i=new(t instanceof nt?nt:t instanceof Zi?Zi:St)(r-e);return i.set(t.subarray(e,r)),i},sr=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},Fn=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Cl=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new St(0),0];if(n==1){var a=new St(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(x,T){return x.f-T.f}),r.push({s:-1,f:25001});var o=r[0],l=r[1],h=0,c=1,u=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=n-1;)o=r[r[h].f<r[u].f?h++:u++],l=r[h!=c&&r[h].f<r[u].f?h++:u++],r[c++]={s:-1,f:o.f+l.f,l:o,r:l};var f=s[0].s;for(i=1;i<n;++i)s[i].s>f&&(f=s[i].s);var p=new nt(f+1),m=M0(r[c-1],p,0);if(m>e){i=0;var g=0,d=m-e,y=1<<d;for(s.sort(function(x,T){return p[T.s]-p[x.s]||x.f-T.f});i<n;++i){var v=s[i].s;if(!(p[v]>e))break;g+=y-(1<<m-p[v]),p[v]=e}for(g>>>=d;g>0;){var b=s[i].s;p[b]<e?g-=1<<e-p[b]++-1:++i}for(;i>=0&&g;--i){var _=s[i].s;p[_]==e&&(--p[_],++g)}m=e}return[new St(p),m]},M0=function t(e,r,i){return e.s==-1?Math.max(t(e.l,r,i+1),t(e.r,r,i+1)):r[e.s]=i},Vp=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new nt(++e),i=0,n=t[0],s=1,a=function(l){r[i++]=l},o=1;o<=e;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},On=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},ka=function(t,e,r){var i=r.length,n=ud(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<i;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Np=function(t,e,r,i,n,s,a,o,l,h,c){sr(e,c++,r),++n[256];for(var u=Cl(n,15),f=u[0],p=u[1],m=Cl(s,15),g=m[0],d=m[1],y=Vp(f),v=y[0],b=y[1],_=Vp(g),x=_[0],T=_[1],S=new nt(19),w=0;w<v.length;++w)S[31&v[w]]++;for(w=0;w<x.length;++w)S[31&x[w]]++;for(var M=Cl(S,7),k=M[0],I=M[1],P=19;P>4&&!k[Bp[P-1]];--P);var A,E,F,O,D=h+5<<3,C=On(n,ii)+On(s,Fa)+a,$=On(n,f)+On(s,g)+a+14+3*P+On(S,k)+(2*S[16]+3*S[17]+7*S[18]);if(D<=C&&D<=$)return ka(e,c,t.subarray(l,l+h));if(sr(e,c,1+($<C)),c+=2,$<C){A=Bn(f,p,0),E=f,F=Bn(g,d,0),O=g;var R=Bn(k,I,0);for(sr(e,c,b-257),sr(e,c+5,T-1),sr(e,c+10,P-4),c+=14,w=0;w<P;++w)sr(e,c+3*w,k[Bp[w]]);c+=3*P;for(var q=[v,x],U=0;U<2;++U){var Y=q[U];for(w=0;w<Y.length;++w){var G=31&Y[w];sr(e,c,R[G]),c+=k[G],G>15&&(sr(e,c,Y[w]>>>5&127),c+=Y[w]>>>12)}}}else A=T0,E=ii,F=I0,O=Fa;for(w=0;w<o;++w)if(i[w]>255){G=i[w]>>>18&31,Fn(e,c,A[G+257]),c+=E[G+257],G>7&&(sr(e,c,i[w]>>>23&31),c+=Kl[G]);var re=31&i[w];Fn(e,c,F[re]),c+=O[re],re>3&&(Fn(e,c,i[w]>>>5&8191),c+=Ql[re])}else Fn(e,c,A[i[w]]),c+=E[i[w]];return Fn(e,c,A[256]),c+E[256]},D0=new Zi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F0=new St(0),O0=function(){for(var t=new Zi(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),$0=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=O0[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}},R0=function(t,e,r,i,n){return function(s,a,o,l,h,c){var u=s.length,f=new St(l+u+5*(1+Math.floor(u/7e3))+h),p=f.subarray(l,f.length-h),m=0;if(!a||u<8)for(var g=0;g<=u;g+=65535){var d=g+65535;d<u?m=ka(p,m,s.subarray(g,d)):(p[g]=c,m=ka(p,m,s.subarray(g,u)))}else{for(var y=D0[a-1],v=y>>>13,b=8191&y,_=(1<<o)-1,x=new nt(32768),T=new nt(_+1),S=Math.ceil(o/3),w=2*S,M=function(st){return(s[st]^s[st+1]<<S^s[st+2]<<w)&_},k=new Zi(25e3),I=new nt(288),P=new nt(32),A=0,E=0,F=(g=0,0),O=0,D=0;g<u;++g){var C=M(g),$=32767&g,R=T[C];if(x[$]=R,T[C]=$,O<=g){var q=u-g;if((A>7e3||F>24576)&&q>423){m=Np(s,p,0,k,I,P,E,F,D,g-D,m),F=A=E=0,D=g;for(var U=0;U<286;++U)I[U]=0;for(U=0;U<30;++U)P[U]=0}var Y=2,G=0,re=b,se=$-R&32767;if(q>2&&C==M(g-se))for(var ie=Math.min(v,q)-1,Q=Math.min(32767,g),xe=Math.min(258,q);se<=Q&&--re&&$!=R;){if(s[g+Y]==s[g+Y-se]){for(var ue=0;ue<xe&&s[g+ue]==s[g+ue-se];++ue);if(ue>Y){if(Y=ue,G=se,ue>ie)break;var Ie=Math.min(se,ue-2),Se=0;for(U=0;U<Ie;++U){var W=g-se+U+32768&32767,qe=W-x[W]+32768&32767;qe>Se&&(Se=qe,R=W)}}}se+=($=R)-(R=x[$])+32768&32767}if(G){k[F++]=268435456|jl[Y]<<18|Gl[G];var kt=31&jl[Y],Et=31&Gl[G];E+=Kl[kt]+Ql[Et],++I[257+kt],++P[Et],O=g+Y,++A}else k[F++]=s[g],++I[s[g]]}}m=Np(s,p,c,k,I,P,E,F,D,g-D,m),c||(m=ka(p,m,F0))}return pd(f,0,l+ud(m)+h)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!n)},Hl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},L0=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Hl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}},B0=function(t){return 10+(t.filename&&t.filename.length+1||0)};function V0(t,e){e===void 0&&(e={});var r=$0(),i=t.length;r.p(t);var n=R0(t,e,B0(e),8),s=n.length;return L0(n,e),Hl(n,s-8,r.d()),Hl(n,s-4,i),n}function N0(t,e){var r=t.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(t);for(var i=new St(t.length+(t.length>>>1)),n=0,s=function(h){i[n++]=h},a=0;a<r;++a){if(n+5>i.length){var o=new St(n+8+(r-a<<1));o.set(i),i=o}var l=t.charCodeAt(a);l<128||e?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++a))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return pd(i,0,n)}(function(t){t.GZipJS="gzip-js",t.Base64="base64"})(Kr||(Kr={}));var dd=function(t,e,r){var i=e||{};i.ip=r.ip?1:0,i._=new Date().getTime().toString(),i.ver=ti.LIB_VERSION;var n=t.split("?");if(n.length>1){var s,a=ei(n[1].split("&"));try{for(a.s();!(s=a.n()).done;){var o=s.value.split("=")[0];fe(i[o])||delete i[o]}}catch(h){a.e(h)}finally{a.f()}}var l=t.indexOf("?")>-1?"&":"?";return t+l+function(h){var c,u,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",p=[];return Pe(h,function(m,g){fe(m)||fe(g)||g==="undefined"||(c=encodeURIComponent(m.toString()),u=encodeURIComponent(g),p[p.length]=u+"="+c)}),p.join(f)}(i)},eh=function t(e,r){if(r.blob&&e.buffer)return new Blob([wp(e)?e:e.buffer],{type:"text/plain"});if(r.sendBeacon||r.blob){var i=t(e,{method:"POST"});return new Blob([i],{type:"application/x-www-form-urlencoded"})}return r.method!=="POST"?null:(n=Ye(e)||wp(e)?"data="+encodeURIComponent(e):"data="+encodeURIComponent(e.data),"compression"in e&&e.compression&&(n+="&compression="+e.compression),n);var n},fd=function(t){var e=t.url,r=t.data,i=t.headers,n=t.options,s=t.callback,a=t.retriesPerformedSoFar,o=t.retryQueue,l=t.onXHRError,h=t.timeout,c=h===void 0?6e4:h,u=t.onResponse;ar(a)&&a>0&&(e=dd(e,{retry_count:a},{}));var f=new XMLHttpRequest;f.open(n.method||"GET",e,!0);var p=eh(r,n);Pe(i,function(m,g){f.setRequestHeader(g,m)}),n.method!=="POST"||n.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=c,f.withCredentials=!0,f.onreadystatechange=function(){if(f.readyState===4)if(u?.(f),f.status===200){if(s){var m;try{m=JSON.parse(f.responseText)}catch(g){return void z.error(g)}s(m)}}else ri(l)&&l(f),(f.status<400||f.status>500)&&o.enqueue({url:e,data:r,options:n,headers:i,retriesPerformedSoFar:(a||0)+1,callback:s}),s?.({status:0})},f.send(p)},z0=18e5,j0=function(t){Wp(r,ld);var e=Zp(r);function r(i,n){var s;return Re(this,r),(s=e.call(this)).isPolling=!1,s.queue=[],s.areWeOnline=!0,s.onXHRError=i,s.rateLimiter=n,!fe(window)&&"onLine"in window.navigator&&(s.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){s._handleWeAreNowOnline()}),window.addEventListener("offline",function(){s.areWeOnline=!1})),s}return Le(r,[{key:"enqueue",value:function(i){var n=i.retriesPerformedSoFar||0;if(!(n>=10)){var s=function(l){var h=3e3*Math.pow(2,l),c=h/2,u=Math.min(z0,h),f=(Math.random()-.5)*(u-c);return Math.ceil(u+f)}(n),a=new Date(Date.now()+s);this.queue.push({retryAt:a,requestData:i});var o="Enqueued failed request for retry in ".concat(s);navigator.onLine||(o+=" (Browser is offline)"),z.warn(o),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var i=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){i.areWeOnline&&i.queue.length>0&&i.flush(),i.poll()},this._pollInterval)}},{key:"flush",value:function(){var i=new Date(Date.now()),n=this.queue.filter(function(l){return l.retryAt<i});if(n.length>0){this.queue=this.queue.filter(function(l){return l.retryAt>=i});var s,a=ei(n);try{for(a.s();!(s=a.n()).done;){var o=s.value.requestData;this._executeXhrRequest(o)}}catch(l){a.e(l)}finally{a.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var i,n=ei(this.queue);try{for(n.s();!(i=n.n()).done;){var s=i.value.requestData,a=s.url,o=s.data,l=s.options;if(this.rateLimiter.isRateLimited(l._batchKey))z.warn("[RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(a,eh(o,he(he({},l),{},{sendBeacon:!0})))}catch(h){z.error(h)}}}catch(h){n.e(h)}finally{n.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(i){var n=i.url,s=i.data,a=i.options,o=i.headers,l=i.callback,h=i.retriesPerformedSoFar;this.rateLimiter.isRateLimited(a._batchKey)||fd({url:n,data:s||{},options:a||{},headers:o||{},retriesPerformedSoFar:h||0,callback:l,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}();Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ar(t)&&isFinite(t)&&Math.floor(t)===t});var zp="0123456789abcdef",G0=function(){function t(e){if(Re(this,t),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return Le(t,[{key:"toString",value:function(){for(var e="",r=0;r<this.bytes.length;r++)e=e+zp.charAt(this.bytes[r]>>>4)+zp.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new t(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var r=0;r<16;r++){var i=this.bytes[r]-e.bytes[r];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,r,i,n){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||e<0||r<0||i<0||n<0||e>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|r>>>8,s[7]=r,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}}]),t}(),H0=function(){function t(){Re(this,t),Z(this,"timestamp",0),Z(this,"counter",0),Z(this,"random",new q0)}return Le(t,[{key:"generate",value:function(){var e=this.generateOrAbort();if(fe(e)){this.timestamp=0;var r=this.generateOrAbort();if(fe(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return G0.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),t}(),md=function(t){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};!fe(J.crypto)&&crypto.getRandomValues&&(md=function(t){return crypto.getRandomValues(t)});var jp,q0=function(){function t(){Re(this,t),Z(this,"buffer",new Uint32Array(8)),Z(this,"cursor",1/0)}return Le(t,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(md(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),t}(),Ui=function(){return U0().toString()},U0=function(){return(jp||(jp=new H0)).generate()},va=1800,Gp=60,W0=864e5,Z0=function(){function t(e,r,i,n){Re(this,t),Z(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=r,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||Ui,this._windowIdGenerator=n||Ui;var s=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||va;if(ar(a)?a>va?z.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<Gp&&z.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(z.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=va),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,Gp),va),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var o=Ze.parse(this._window_id_storage_key),l=Ze.parse(this._primary_window_exists_storage_key);o&&!l?this._windowId=o:Ze.remove(this._window_id_storage_key),Ze.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return Le(t,[{key:"onSessionId",value:function(e){var r=this;return fe(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){r._sessionIdChangedHandlers=r._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Ze.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ze.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ze.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,r,i){e===this._sessionId&&r===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=r,this._sessionId=e,this.persistence.register(Z({},Ta,[r,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Ta];return Ye(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;J.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&Ze.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),i=Nn(this._getSessionId(),3),n=i[0],s=i[1],a=i[2],o=this._getWindowId(),l=a&&a>0&&Math.abs(r-a)>W0,h=!1,c=!s,u=!e&&Math.abs(r-n)>this._sessionTimeoutMs;c||u||l?(s=this._sessionIdGenerator(),o=this._windowIdGenerator(),a=r,h=!0):o||(o=this._windowIdGenerator(),h=!0);var f=n===0||!e||l?r:n,p=a===0?new Date().getTime():a;return this._setWindowId(o),this._setSessionId(s,f,p),h&&this._sessionIdChangedHandlers.forEach(function(m){return m(s,o)}),{sessionId:s,windowId:o,sessionStartTimestamp:p}}}]),t}(),Y0=Le(function t(e,r,i,n){Re(this,t),this.name="posthog-js",this.setupOnce=function(s){s(function(a){var o,l,h,c,u;if(a.level!=="error"||!e.__loaded)return a;a.tags||(a.tags={});var f=e.config.ui_host||e.config.api_host;a.tags["PostHog Person URL"]=f+"/person/"+e.get_distinct_id(),e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=((o=a.exception)===null||o===void 0?void 0:o.values)||[],m={$exception_message:(l=p[0])===null||l===void 0?void 0:l.value,$exception_type:(h=p[0])===null||h===void 0?void 0:h.type,$exception_personURL:f+"/person/"+e.get_distinct_id(),$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:(c=p[0])===null||c===void 0?void 0:c.value,$sentry_exception_type:(u=p[0])===null||u===void 0?void 0:u.type,$sentry_tags:a.tags};return r&&i&&(m.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+a.event_id),e.capture("$exception",m),a})}}),J0=function(t){Promise&&Promise.resolve||z.warn("This browser does not have Promise support, and can not use the segment integration");var e=function(r,i){r.event.userId||r.event.anonymousId===t.get_distinct_id()||t.reset(),r.event.userId&&r.event.userId!==t.get_distinct_id()&&(t.register({distinct_id:r.event.userId}),t.reloadFeatureFlags());var n=t._calculate_event_properties(i,r.event.properties);return r.event.properties=Object.assign({},n,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(r){return e(r,r.event.event)},page:function(r){return e(r,"$pageview")},identify:function(r){return e(r,"$identify")},screen:function(r){return e(r,"$screen")}}},X0=function(){function t(){var e=this;Re(this,t),Z(this,"_hasSeenPageView",!1),Z(this,"_updateScrollData",function(){var r,i,n,s;e._pageViewData||(e._pageViewData=e._createPageViewData());var a=e._pageViewData,o=e._scrollY(),l=e._scrollHeight(),h=e._contentY(),c=e._contentHeight();a.lastScrollY=o,a.maxScrollY=Math.max(o,(r=a.maxScrollY)!==null&&r!==void 0?r:0),a.maxScrollHeight=Math.max(l,(i=a.maxScrollHeight)!==null&&i!==void 0?i:0),a.lastContentY=h,a.maxContentY=Math.max(h,(n=a.maxContentY)!==null&&n!==void 0?n:0),a.maxContentHeight=Math.max(c,(s=a.maxContentHeight)!==null&&s!==void 0?s:0)})}return Le(t,[{key:"_createPageViewData",value:function(){return{pathname:J.location.pathname}}},{key:"doPageView",value:function(){var e,r;return this._hasSeenPageView?(r=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,r=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),he({$prev_pageview_pathname:(e=r)===null||e===void 0?void 0:e.pathname},this._calculatePrevPageScrollProperties(r))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return he({$prev_pageview_pathname:e?.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||e.maxScrollHeight==null||e.lastScrollY==null||e.maxScrollY==null||e.maxContentHeight==null||e.lastContentY==null||e.maxContentY==null)return{};var r=e.maxScrollHeight,i=e.lastScrollY,n=e.maxScrollY,s=e.maxContentHeight,a=e.lastContentY,o=e.maxContentY;return r=Math.ceil(r),i=Math.ceil(i),n=Math.ceil(n),s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),{$prev_pageview_last_scroll:i,$prev_pageview_last_scroll_percentage:r<=1?1:ba(i/r,0,1),$prev_pageview_max_scroll:n,$prev_pageview_max_scroll_percentage:r<=1?1:ba(n/r,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:s<=1?1:ba(a/s,0,1),$prev_pageview_max_content:o,$prev_pageview_max_content_percentage:s<=1?1:ba(o/s,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){J.addEventListener("scroll",this._updateScrollData),J.addEventListener("scrollend",this._updateScrollData),J.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){J.removeEventListener("scroll",this._updateScrollData),J.removeEventListener("scrollend",this._updateScrollData),J.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return Math.max(0,J.document.documentElement.scrollHeight-J.document.documentElement.clientHeight)}},{key:"_scrollY",value:function(){return J.scrollY||J.pageYOffset||J.document.documentElement.scrollTop||0}},{key:"_contentHeight",value:function(){return J.document.documentElement.scrollHeight||0}},{key:"_contentY",value:function(){var e=J.document.documentElement.clientHeight||0;return this._scrollY()+e}}]),t}();function ba(t,e,r){return Math.max(e,Math.min(t,r))}var Vn,th,We,K0={icontains:function(t){return window.location.href.toLowerCase().indexOf(t.toLowerCase())>-1},regex:function(t){return i0(window.location.href,t)},exact:function(t){return window.location.href===t}},Q0=function(){function t(e){Re(this,t),this.instance=e}return Le(t,[{key:"getSurveys",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(Bl);if(n&&!i)return e(n);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var a,o=s.surveys||[];return(a=r.instance.persistence)===null||a===void 0||a.register(Z({},Bl,o)),e(o)})}},{key:"getActiveMatchingSurveys",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(n){var s=n.filter(function(a){return!(!a.start_date||a.end_date)}).filter(function(a){var o,l,h,c;if(!a.conditions)return!0;var u=(o=a.conditions)===null||o===void 0||!o.url||K0[(l=(h=a.conditions)===null||h===void 0?void 0:h.urlMatchType)!==null&&l!==void 0?l:"icontains"](a.conditions.url),f=(c=a.conditions)===null||c===void 0||!c.selector||document.querySelector(a.conditions.selector);return u&&f}).filter(function(a){if(!a.linked_flag_key&&!a.targeting_flag_key)return!0;var o=!a.linked_flag_key||r.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),l=!a.targeting_flag_key||r.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key);return o&&l});return e(s)},i)}}]),t}(),ey=6e4,ty=function(){function t(){var e=this;Re(this,t),Z(this,"limits",{}),Z(this,"checkForLimiting",function(r){try{var i=r.responseText;if(!i||!i.length)return;(JSON.parse(i).quota_limited||[]).forEach(function(n){z.info("[RateLimiter] ".concat(n||"events"," is quota limited.")),e.limits[n]=new Date().getTime()+ey})}catch(n){return void z.error(n)}})}return Le(t,[{key:"isRateLimited",value:function(e){var r=this.limits[e||"events"]||!1;return r!==!1&&new Date().getTime()<r}}]),t}();(function(t){t[t.INIT_MODULE=0]="INIT_MODULE",t[t.INIT_SNIPPET=1]="INIT_SNIPPET"})(Vn||(Vn={}));var ql=function(){},_a={},ut="posthog",Ea=J.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,gd=!Ea&&ct.indexOf("MSIE")===-1&&ct.indexOf("Mozilla")===-1,Hp=function(){var t,e,r;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=Oe?.location,r=e?.hostname,!!xt(r)&&r.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:ql,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:(J==null||(t=J.location)===null||t===void 0?void 0:t.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(i){var n="Bad HTTP status: "+i.status+" "+i.statusText;z.error(n)},get_device_id:function(i){return i},_onCapture:ql,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},Ul=function(t,e,r,i){var n,s=r!==ut&&We?r?We[r]:void 0:We,a={initComplete:!1,syncCode:!1},o=function(l){return function(h){a[l]||(a[l]=!0,a.initComplete&&a.syncCode&&i?.(h))}};if(s&&th===Vn.INIT_MODULE)n=s;else{if(s&&!Ye(s))return void z.error("You have already initialized "+r);n=new rh}return n._init(t,e,r,o("initComplete")),n.toolbar.maybeLoadToolbar(),n.sessionRecording=new p0(n),n.sessionRecording.startRecordingIfEnabled(),n.webPerformance=new m0(n),n.webPerformance.startObservingIfEnabled(),n.config.__preview_measure_pageview_stats&&n.pageViewManager.startMeasuringScrollPosition(),n.__autocapture=n.config.autocapture,wr._setIsAutocaptureEnabled(n),wr._isAutocaptureEnabled&&(n.__autocapture=n.config.autocapture,wr.enabledForProject(n.config.token,100,100)?wr.isBrowserSupported()?wr.init(n):(n.__autocapture=!1,z.info("Disabling Automatic Event Collection because this browser is not supported")):(n.__autocapture=!1,z.info("Not in active bucket: disabling Automatic Event Collection."))),ti.DEBUG=ti.DEBUG||n.config.debug,!fe(s)&&Ye(s)&&(n._execute_array.call(n.people,s.people),n._execute_array(s)),o("syncCode")(n),n},rh=function(){function t(){var e=this;Re(this,t),this.config=Hp(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Y0,this.segmentIntegration=function(){return J0(e)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.featureFlags=new Kg(this),this.toolbar=new w0(this),this.pageViewManager=new X0,this.surveys=new Q0(this),this.rateLimiter=new ty,this.people={set:function(r,i,n){var s=xt(r)?Z({},r,i):r;e.setPersonProperties(s),n?.({})},set_once:function(r,i,n){var s=xt(r)?Z({},r,i):r;e.setPersonProperties(void 0,s),n?.({})}}}return Le(t,[{key:"init",value:function(e,r,i){if(fe(i))z.critical("You must name your new library: init(token, config, name)");else{if(i!==ut){var n=Ul(e,r,i,function(s){We[i]=s,s._loaded()});return We[i]=n,n}z.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var r,i,n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var l,h={segmentRegister:!1,syncCode:!1},c=function(_){return function(){h[_]||(h[_]=!0,h.segmentRegister&&h.syncCode&&o?.(n))}};if(this.set_config(Qe({},Hp(),s,{name:a,token:e,callback_fn:(a===ut?a:ut+"."+a)+"._jsc"})),this._jsc=function(){},(J!=null&&(r=J.rrweb)!==null&&r!==void 0&&r.record||J!=null&&J.rrwebRecord)&&(this.__loaded_recorder_version=J==null||(l=J.rrweb)===null||l===void 0?void 0:l.version),this.persistence=new $p(this.config),this._requestQueue=new A0(this._handle_queued_event.bind(this)),this._retryQueue=new j0(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Z0(this.config,this.persistence),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new $p(he(he({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),s.segment?(this.config.get_device_id=function(){return s.segment.user().anonymousId()},s.segment.user().id()&&(this.register({distinct_id:s.segment.user().id()}),this.persistence.set_user_state("identified")),s.segment.register(this.segmentIntegration()).then(c("segmentRegister"))):c("segmentRegister")(),((i=s.bootstrap)===null||i===void 0?void 0:i.distinctID)!==void 0){var u,f,p=this.config.get_device_id(Ui()),m=(u=s.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?p:s.bootstrap.distinctID;this.persistence.set_user_state((f=s.bootstrap)!==null&&f!==void 0&&f.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:m})}if(this._hasBootstrappedFeatureFlags()){var g,d,y=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlags)||{}).filter(function(_){var x,T;return!((x=s.bootstrap)===null||x===void 0||(T=x.featureFlags)===null||T===void 0||!T[_])}).reduce(function(_,x){var T,S;return _[x]=((T=s.bootstrap)===null||T===void 0||(S=T.featureFlags)===null||S===void 0?void 0:S[x])||!1,_},{}),v=Object.keys(((d=s.bootstrap)===null||d===void 0?void 0:d.featureFlagPayloads)||{}).filter(function(_){return y[_]}).reduce(function(_,x){var T,S,w,M;return(T=s.bootstrap)!==null&&T!==void 0&&(S=T.featureFlagPayloads)!==null&&S!==void 0&&S[x]&&(_[x]=(w=s.bootstrap)===null||w===void 0||(M=w.featureFlagPayloads)===null||M===void 0?void 0:M[x]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:v})}if(!this.get_distinct_id()){var b=this.config.get_device_id(Ui());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_user_state("anonymous")}J.addEventListener&&J.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),c("syncCode")()}},{key:"_afterDecideResponse",value:function(e){var r;if(this.compression={},e.supportedCompression&&!this.config.disable_compression){var i,n={},s=ei(e.supportedCompression);try{for(s.s();!(i=s.n()).done;)n[i.value]=!0}catch(a){s.e(a)}finally{s.f()}this.compression=n}(r=e.analytics)!==null&&r!==void 0&&r.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint)}},{key:"_loaded",value:function(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(r){z.critical("`loaded` function failed",r)}this._start_queue_if_opted_in(),this.config.capture_pageview&&this.capture("$pageview",{title:Oe.title},{send_instantly:!0}),e||(new y0(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.poll())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Wi(this.__request_queue,function(r){e._send_request.apply(e,Ml(r))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,r){if(fe(e))return null;if(Ea)return function(a){e(a,r)};var i=this._jsc,n=""+Math.floor(1e8*Math.random()),s=this.config.callback_fn+"["+n+"]";return i[n]=function(a){delete i[n],e(a,r)},s}},{key:"_handle_unload",value:function(){var e,r;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(r=this._retryQueue)===null||r===void 0||r.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,r,i){var n=JSON.stringify(r);this.__compress_and_send_json_request(e,n,i||_a,ql)}},{key:"__compress_and_send_json_request",value:function(e,r,i,n){var s=function(h,c,u){return h===Kr.GZipJS?[V0(N0(c),{mtime:0}),he(he({},u),{},{blob:!0,urlQueryArgs:{compression:Kr.GZipJS}})]:[{data:Yl(c)},u]}(this.compression[Kr.GZipJS]?Kr.GZipJS:Kr.Base64,r,i),a=Nn(s,2),o=a[0],l=a[1];this._send_request(e,o,l,n)}},{key:"_send_request",value:function(e,r,i,n){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(i._batchKey))if(gd)this.__request_queue.push([e,r,i,n]);else{var s={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};i=Qe(s,i||{}),Ea||(i.method="GET");var a="sendBeacon"in J.navigator&&i.transport==="sendBeacon";if(e=dd(e,i.urlQueryArgs||{},{ip:this.config.ip}),a)try{J.navigator.sendBeacon(e,eh(r,he(he({},i),{},{sendBeacon:!0})))}catch{}else if(Ea)try{fd({url:e,data:r,headers:this.config.xhr_headers,options:i,callback:n,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(c){z.error(c)}else{var o,l=Oe.createElement("script");l.type="text/javascript",l.async=!0,l.defer=!0,l.src=e;var h=Oe.getElementsByTagName("script")[0];(o=h.parentNode)===null||o===void 0||o.insertBefore(l,h)}}}},{key:"_execute_array",value:function(e){var r,i=this,n=[],s=[],a=[];Wi(e,function(l){l&&(r=l[0],Ye(r)?a.push(l):ri(l)?l.call(i):Ye(l)&&r==="alias"?n.push(l):Ye(l)&&r.indexOf("capture")!==-1&&ri(i[r])?a.push(l):s.push(l))});var o=function(l,h){Wi(l,function(c){if(Ye(c[0])){var u=h;Pe(c,function(f){u=u[f[0]].apply(u,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},h)};o(n,this),o(s,this),o(a,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,r;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((r=this.config.bootstrap)===null||r===void 0?void 0:r.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_a;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return z.uninitializedWarning("posthog.capture");if(!function(c){var u=!1;try{var f=c.config.token,p=c.config.respect_dnt,m=c.config.opt_out_capturing_persistence_type,g=c.config.opt_out_capturing_cookie_prefix||void 0,d=c.config.window;f&&(u=Lp(f,{respectDnt:p,persistenceType:m,persistencePrefix:g,window:d}))}catch(y){z.error("Unexpected error when checking capturing opt-out status: "+y)}return u}(this)){var n=(i=i||_a).transport;if(n&&(i.transport=n),!fe(e)&&xt(e)){if(!Yg(ct,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var s={uuid:Ui(),event:e,properties:this._calculate_event_properties(e,r||{})};e==="$identify"&&(s.$set=i.$set,s.$set_once=i.$set_once),(s=Ug(s,i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i.timestamp||new Date;var a=he(he({},s.properties.$set),s.$set);Gg(a)||this.setPersonPropertiesForFlags(a),z.info("send",s);var o=JSON.stringify(s),l=this.config.api_host+(i.endpoint||this.analyticsDefaultEndpoint),h=i!==_a;return!this.config.request_batching||h&&!i._batchKey||i.send_instantly?this.__compress_and_send_json_request(l,o,i):this._requestQueue.enqueue(l,s,i),this._invokeCaptureHooks(e,s),s}}else z.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,r){this.config._onCapture(e,r),Pe(this.__captureHooks,function(i){return i(e)})}},{key:"_calculate_event_properties",value:function(e,r){if(!this.persistence||!this.sessionPersistence)return r;var i=this.persistence.remove_event_timer(e),n=he({},r);if(n.token=this.config.token,e==="$snapshot"){var s=he(he({},this.persistence.properties()),this.sessionPersistence.properties());return n.distinct_id=s.distinct_id,n}var a=Ue.properties();if(this.sessionManager){var o=this.sessionManager.checkAndGetSessionAndWindowId(),l=o.sessionId,h=o.windowId;n.$session_id=l,n.$window_id=h}if(this.config.__preview_measure_pageview_stats){var c={};e==="$pageview"?c=this.pageViewManager.doPageView():e==="$pageleave"&&(c=this.pageViewManager.doPageLeave()),n=Qe(n,c)}if(e==="$pageview"&&(n.title=Oe.title),e==="$performance_event"){var u=this.persistence.properties();return n.distinct_id=u.distinct_id,n.$current_url=a.$current_url,n}if(!fe(i)){var f=new Date().getTime()-i;n.$duration=parseFloat((f/1e3).toFixed(3))}n=Qe({},Ue.properties(),this.persistence.properties(),this.sessionPersistence.properties(),n);var p=this.config.property_blacklist;Ye(p)?Pe(p,function(g){delete n[g]}):z.error("Invalid value for property_blacklist config: "+p);var m=this.config.sanitize_properties;return m&&(n=m(n,e)),n}},{key:"register",value:function(e,r){var i;(i=this.persistence)===null||i===void 0||i.register(e,r)}},{key:"register_once",value:function(e,r,i){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,r,i)}},{key:"register_for_session",value:function(e){var r;(r=this.sessionPersistence)===null||r===void 0||r.register(e)}},{key:"unregister",value:function(e){var r;(r=this.persistence)===null||r===void 0||r.unregister(e)}},{key:"unregister_for_session",value:function(e){var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(e)}},{key:"_register_single",value:function(e,r){this.register(Z({},e,r))}},{key:"getFeatureFlag",value:function(e,r){return this.featureFlags.getFeatureFlag(e,r)}},{key:"getFeatureFlagPayload",value:function(e){var r=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(r)}catch{return r}}},{key:"isFeatureEnabled",value:function(e,r){return this.featureFlags.isFeatureEnabled(e,r)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,r)}},{key:"getEarlyAccessFeatures",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,r)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var r,i;return(r=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&r!==void 0?r:function(){}}},{key:"getSurveys",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,r)}},{key:"getActiveMatchingSurveys",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,r)}},{key:"identify",value:function(e,r,i){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(e){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(xa)&&(this.unregister(xa),this.register({distinct_id:e}));var a=this.persistence.get_user_state()==="anonymous";e!==n&&a?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(r||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:r||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(n)):(r||i)&&this.setPersonProperties(r,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(Ia))}else z.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,r){(e||r)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:r||{}}))}},{key:"group",value:function(e,r,i){if(e&&r){var n=this.getGroups();n[e]!==r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:he(he({},n),{},Z({},e,r))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:r,$group_set:i}),this.setGroupPropertiesForFlags(Z({},e,i))),n[e]===r||i||this.reloadFeatureFlags()}else z.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,r)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,r)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var r,i,n,s;if(!this.__loaded)return z.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");(r=this.persistence)===null||r===void 0||r.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(n=this.persistence)===null||n===void 0||n.set_user_state("anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var o=this.config.get_device_id(Ui());this.register_once({distinct_id:o,$device_id:e?o:a},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,r;return(e=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var r=this.config.ui_host||this.config.api_host,i=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=i.sessionId,s=i.sessionStartTimestamp,a=r+"/replay/"+n;if(e!=null&&e.withTimestamp&&s){var o,l=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!s)return a;var h=Math.max(Math.floor((new Date().getTime()-s)/1e3)-l,0);a+="?t=".concat(h)}return a}},{key:"alias",value:function(e,r){return e===this.get_property(id)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):(fe(r)&&(r=this.get_distinct_id()),e!==r?(this._register_single(xa,e),this.capture("$create_alias",{alias:e,distinct_id:r})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var r,i,n=he({},this.config);xr(e)&&(Qe(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),(r=this.persistence)===null||r===void 0||r.update_config(this.config),(i=this.sessionPersistence)===null||i===void 0||i.update_config(this.config),$e.is_supported()&&$e.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(ti.DEBUG=!0),this.sessionRecording&&!fe(e.disable_session_recording)&&n.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var r;return(r=this.persistence)===null||r===void 0?void 0:r.props[e]}},{key:"getSessionProperty",value:function(e){var r;return(r=this.sessionPersistence)===null||r===void 0?void 0:r.props[e]}},{key:"toString",value:function(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:ut;return r!==ut&&(r=ut+"."+r),r}},{key:"_gdpr_init",value:function(){this.config.opt_out_capturing_persistence_type==="localStorage"&&$e.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!or.get("ph_optout")||(or.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var r,i,n,s,a;if(e&&e.clear_persistence)n=!0;else{if(!e||!e.enable_persistence)return;n=!1}this.config.disable_persistence||((r=this.persistence)===null||r===void 0?void 0:r.disabled)===n||(s=this.persistence)===null||s===void 0||s.set_disabled(n),this.config.disable_persistence||((i=this.sessionPersistence)===null||i===void 0?void 0:i.disabled)===n||(a=this.sessionPersistence)===null||a===void 0||a.set_disabled(n)}},{key:"_gdpr_call_func",value:function(e,r){return r=Qe({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},r||{}),$e.is_supported()||r.persistence_type!=="localStorage"||(r.persistence_type="cookie"),e(this.config.token,{capture:r.capture,captureEventName:r.capture_event_name,captureProperties:r.capture_properties,persistenceType:r.persistence_type,persistencePrefix:r.cookie_prefix,cookieExpiration:r.cookie_expiration,crossSubdomainCookie:r.cross_subdomain_cookie,secureCookie:r.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=Qe({enable_persistence:!0},e||{}),this._gdpr_call_func(S0,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var r=Qe({clear_persistence:!0},e||{});this._gdpr_call_func(k0,r),this._gdpr_update_persistence(r)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(E0,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Lp,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var r=Qe({enable_persistence:!0},e??{});this._gdpr_call_func(P0,r),this._gdpr_update_persistence(r)}},{key:"debug",value:function(e){e===!1?(J.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(J.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),t}();(function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=Qp(t.prototype[e[r]])})(rh,["identify"]);var qp,Up,br={},ry=function(){We.init=function(t,e,r){if(r)return We[r]||(We[r]=br[r]=Ul(t||"",e||{},r,function(n){We[r]=br[r]=n,n._loaded()})),We[r];var i=We;return br[ut]?i=br[ut]:t&&(i=Ul(t,e||{},ut,function(n){br[ut]=n,n._loaded()}),br[ut]=i),We=i,th===Vn.INIT_SNIPPET&&(J[ut]=We),Pe(br,function(n,s){s!==ut&&(We[s]=n)}),i}},iy=function(){function t(){t.done||(t.done=!0,gd=!1,Pe(br,function(e){e._dom_loaded()}))}Oe.addEventListener&&(Oe.readyState==="complete"?t():Oe.addEventListener("DOMContentLoaded",t,!1)),Rn(J,"load",t,!0)};(function(t){t.Popover="popover",t.API="api"})(qp||(qp={})),function(t){t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link"}(Up||(Up={}));var yd=(th=Vn.INIT_MODULE,We=new rh,ry(),We.init(),iy(),We);var vd=yd.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://ph-eu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!0,disable_session_recording:!0},"MolinShopAI");function pt(t,e){if(!vd)throw new Error("Failed to initialize PostHog");vd.capture(t,e)}var Yi,$a,Dt,Be,Ra,bd,La,_d,Ba,wd,Va,xd,Na,Sd,za,kd,ja,Ed,Ga,Pd,Oa=class extends De(Ae){constructor(){super();ee(this,Yi);ee(this,Ra);ee(this,La);ee(this,Ba);ee(this,Va);ee(this,Na);ee(this,za);ee(this,ja);ee(this,Ga);ee(this,Dt,new fa(this,{url:(r,{resume:i}={})=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("resume",i?"1":""),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r),pt("ShopAssistant: error",{widgetId:this.widgetId,error:"websocket onError"})},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&pt("ShopAssistant: user received bot message (streaming started)",{widgetId:this.widgetId,message:r})},onUpdateMessage:r=>{},onMessageDone:r=>{let i={...N(this,Dt)?.messages.find(n=>n.id===r.message?.id)};Object.assign(i,r.message),i.role==="assistant"&&pt("ShopAssistant: user received bot message (streaming ended)",{widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION})},onMessageError:r=>{console.error("ws message error",r),r.message&&N(this,Be)&&alert(r.message),pt("ShopAssistant: error",{widgetId:this.widgetId,error:"websocket ERROR message type: "+r.message})},persistConversationState:(r,i)=>{let n={conversationId:r,messages:i};localStorage.setItem(N(this,Yi,$a),JSON.stringify(n))},restoreConversationState:()=>{try{let r=JSON.parse(localStorage.getItem(N(this,Yi,$a))||"{}");return!(typeof r.conversationId=="string"&&r.conversationId)||!(Array.isArray(r.messages)&&r.messages.every(i=>typeof i=="object"&&i))?void 0:{conversationId:r.conversationId,messages:r.messages}}catch(r){console.error(r)}},onReset:()=>{localStorage.removeItem(N(this,Yi,$a))}}));ee(this,Be,!1);this.widgetId="",this.config}render(){console.assert(this.widgetId,"widget id is required"),console.assert(this.config,"config is required");let r=Object.entries(this.config.bubble.position).filter(([a,o])=>o).map(([a,o])=>`${a}-[${o}]`).reduce((a,o)=>(a[o]=!0,a),{}),i={bottom:"72px"},n=Object.entries(this.config.bubble.position).filter(([a,o])=>o).map(([a,o])=>`sm:${a}-[calc(${[i[a],o].filter(l=>!!l).join("+")})]`).reduce((a,o)=>(a[o]=!0,a),{}),s=n;return pe`
|
|
430
|
+
`)).length,n=0;n<i;n++){var a=t.charCodeAt(n),o=null;a<128?r++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Wt(o)||(r>e&&(s+=t.substring(e,r)),s+=o,e=r=n+1)}return r>e&&(s+=t.substring(e,t.length)),s},Zg=["ahrefsbot","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","hubspot","linkedinbot","mj12bot","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","twitterbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],Yg=function(t,e){if(!t)return!1;var r=t.toLowerCase();return Zg.concat(e||[]).some(function(i){var n=i.toLowerCase();return r.includes?r.includes(n):r.indexOf(n)!==-1})},Rn=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation),e}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},function(e,r,i,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(r,i,!!s);else{var a="on"+r,o=e[a];e[a]=function(l,h,c){return function(u){if(u=u||t(window.event)){var f,p=!0;ri(c)&&(f=c(u));var m=h.call(l,u);return f!==!1&&m!==!1||(p=!1),p}}}(e,i,o)}else z.error("No valid element provided to register_event")}}();function Ln(t,e){var r=function(){var i=Oe.createElement("script");i.type="text/javascript",i.src=t,i.onload=function(a){return e(void 0,a)},i.onerror=function(a){return e(a)};var n,s=Oe.querySelectorAll("body > script");s.length>0?(n=s[0].parentNode)===null||n===void 0||n.insertBefore(i,s[0]):Oe.body.appendChild(i)};Oe.body?r():Oe.addEventListener("DOMContentLoaded",r)}function Aa(t){switch(Tl(t.className)){case"string":return t.className;case"object":return("baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";default:return""}}function Ca(t){var e="";return wa(t)&&!td(t)&&t.childNodes&&t.childNodes.length&&Pe(t.childNodes,function(r){ed(r)&&r.textContent&&(e+=Ol(r.textContent).split(/(\s+)/).filter(Gi).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Ol(e)}function Pp(t){return!!t&&t.nodeType===1}function Qr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function ed(t){return!!t&&t.nodeType===3}function Ap(t){return!!t&&t.nodeType===11}var kl=["a","button","form","input","select","textarea","label"];function wa(t){for(var e=t;e.parentNode&&!Qr(e,"body");e=e.parentNode){var r=Aa(e).split(" ");if(_e(r,"ph-sensitive")||_e(r,"ph-no-capture"))return!1}if(_e(Aa(t).split(" "),"ph-include"))return!0;var i=t.type||"";if(xt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(xt(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function td(t){return!!(Qr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Qr(t,"select")||Qr(t,"textarea")||t.getAttribute("contenteditable")==="true")}function Gi(t){return!(Wt(t)||me(t)||xt(t)&&(t=Ol(t),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(t)))}function Cp(t){var e=Ca(t);return Gi(e="".concat(e," ").concat(rd(t)).trim())?e:""}function rd(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Pe(t.childNodes,function(r){var i;if(r&&((i=r.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var n=Ca(r);e="".concat(e," ").concat(n).trim(),r.childNodes&&r.childNodes.length&&(e="".concat(e," ").concat(rd(r)).trim())}catch(s){z.error(s)}}),e}var Jg=function(){function t(e){Re(this,t),this.clicks=[],this.enabled=e}return Le(t,[{key:"isRageClick",value:function(e,r,i){if(!this.enabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(r-n.y)<30&&i-n.timestamp<1e3){if(this.clicks.push({x:e,y:r,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:r,timestamp:i}];return!1}}]),t}(),id="$people_distinct_id",xa="__alias",$n="__timers",Tp="$autocapture_disabled_server_side",Rl="$session_recording_enabled_server_side",Ip="$console_log_recording_enabled_server_side",Mp="$session_recording_recorder_version_server_side",Ta="$sesid",Sa="$session_is_sampled",Hi="$enabled_feature_flags",Ll="$early_access_features",qi="$stored_person_properties",_r="$stored_group_properties",Bl="$surveys",Ia="$flag_call_reported",Vl="$user_state",Nl="$posthog_quota_limited",Xg=[id,xa,"__cmpns",$n,Rl,Ta,Hi,Vl,Nl,Ll,_r,qi,Bl,Ia];function El(t,e){return e.length>t?e.slice(0,t)+"...":e}var wr={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(t){var e,r=Wt(this._isDisabledServerSide)?!((e=t.persistence)===null||e===void 0||!e.props[Tp]):this._isDisabledServerSide,i=!!t.config.autocapture;this._isAutocaptureEnabled=i&&!r},_previousElementSibling:function(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Pp(e));return e},_getAugmentPropertiesFromElement:function(t){if(!wa(t))return{};var e={};return Pe(t.attributes,function(r){if(r.name.indexOf("data-ph-capture-attribute")===0){var i=r.name.replace("data-ph-capture-attribute-",""),n=r.value;i&&n&&Gi(n)&&(e[i]=n)}}),e},_getPropertiesFromElement:function(t,e,r){var i,n=t.tagName.toLowerCase(),s={tag_name:n};kl.indexOf(n)>-1&&!r&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=El(1024,Cp(t)):s.$el_text=El(1024,Ca(t)));var a=Aa(t);a.length>0&&(s.classes=a.split(" ").filter(function(u){return u!==""}));var o=(i=this.config)===null||i===void 0?void 0:i.element_attribute_ignorelist;Pe(t.attributes,function(u){var f;td(t)&&["name","id","class"].indexOf(u.name)===-1||o!=null&&o.includes(u.name)||!e&&Gi(u.value)&&(f=u.name,!xt(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")&&(s["attr__"+u.name]=El(1024,u.value))});for(var l=1,h=1,c=t;c=this._previousElementSibling(c);)l++,c.tagName===t.tagName&&h++;return s.nth_child=l,s.nth_of_type=h,s},_getDefaultProperties:function(t){return{$event_type:t,$ce_version:1}},_extractCustomPropertyValue:function(t){var e=[];return Pe(document.querySelectorAll(t.css_selector),function(r){var i;["input","select"].indexOf(r.tagName.toLowerCase())>-1?i=r.value:r.textContent&&(i=r.textContent),Gi(i)&&e.push(i)}),e.join(", ")},_getCustomProperties:function(t){var e=this,r={};return Pe(this._customProperties,function(i){Pe(i.event_selectors,function(n){Pe(document.querySelectorAll(n),function(s){_e(t,s)&&wa(s)&&(r[i.name]=e._extractCustomPropertyValue(i))})})}),r},_getEventTarget:function(t){return me(t.target)?t.srcElement||null:(e=t.target)!==null&&e!==void 0&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e},_captureEvent:function(t,e){var r,i=this,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",s=this._getEventTarget(t);if(ed(s)&&(s=s.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,e,"$rageclick"),s&&function(g,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!g||Qr(g,"html")||!Pp(g))return!1;if(y!=null&&y.url_allowlist){var v=window.location.href,b=y.url_allowlist;if(b&&!b.some(function(E){return v.match(E)}))return!1}if(y!=null&&y.dom_event_allowlist){var _=y.dom_event_allowlist;if(_&&!_.some(function(E){return d.type===E}))return!1}if(y!=null&&y.element_allowlist){var x=y.element_allowlist;if(x&&!x.some(function(E){return g.tagName.toLowerCase()===E}))return!1}if(y!=null&&y.css_selector_allowlist){var T=y.css_selector_allowlist;if(T&&!T.some(function(E){return g.matches(E)}))return!1}for(var S=!1,w=[g],M=!0,k=g;k.parentNode&&!Qr(k,"body");)if(Ap(k.parentNode))w.push(k.parentNode.host),k=k.parentNode.host;else{if(!(M=k.parentNode||!1))break;if(kl.indexOf(M.tagName.toLowerCase())>-1)S=!0;else{var I=window.getComputedStyle(M);I&&I.getPropertyValue("cursor")==="pointer"&&(S=!0)}w.push(M),k=M}var P=window.getComputedStyle(g);if(P&&P.getPropertyValue("cursor")==="pointer"&&d.type==="click")return!0;var A=g.tagName.toLowerCase();switch(A){case"html":return!1;case"form":return d.type==="submit";case"input":case"select":case"textarea":return d.type==="change"||d.type==="click";default:return S?d.type==="click":d.type==="click"&&(kl.indexOf(A)>-1||g.getAttribute("contenteditable")==="true")}}(s,t,this.config)){for(var a,o,l=[s],h=s;h.parentNode&&!Qr(h,"body");)Ap(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,u=[],f={},p=!1;if(Pe(l,function(g){var d=wa(g);g.tagName.toLowerCase()==="a"&&(c=g.getAttribute("href"),c=d&&Gi(c)&&c),_e(Aa(g).split(" "),"ph-no-capture")&&(p=!0),u.push(i._getPropertiesFromElement(g,e.config.mask_all_element_attributes,e.config.mask_all_text));var y=i._getAugmentPropertiesFromElement(g);Qe(f,y)}),e.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?u[0].$el_text=Cp(s):u[0].$el_text=Ca(s)),c&&(u[0].attr__href=c),p)return!1;var m=Qe(this._getDefaultProperties(t.type),{$elements:u},(a=u[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(o=u[0])===null||o===void 0?void 0:o.$el_text}:{},this._getCustomProperties(l),f);return e.capture(n,m),!0}},_navigate:function(t){window.location.href=t},_addDomEventHandlers:function(t){var e=this,r=function(i){i=i||window.event,e._captureEvent(i,t)};Rn(document,"submit",r,!1,!0),Rn(document,"change",r,!1,!0),Rn(document,"click",r,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(t){var e;Fl(t.__autocapture)||(this.config=t.__autocapture),(e=this.config)!==null&&e!==void 0&&e.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(r){return new RegExp(r)})),this.rageclicks=new Jg(t.config.rageclick)},afterDecideResponse:function(t,e){var r=e.config.token;this._initializedTokens.indexOf(r)>-1?z.info('autocapture already initialized for token "'+r+'"'):(e.persistence&&e.persistence.register(Z({},Tp,!!t.autocapture_opt_out)),this._isDisabledServerSide=!!t.autocapture_opt_out,this._setIsAutocaptureEnabled(e),this._initializedTokens.push(r),t&&t.config&&t.config.enable_collect_everything&&this._isAutocaptureEnabled?(t.custom_properties&&(this._customProperties=t.custom_properties),this._addDomEventHandlers(e)):e.__autocapture=!1)},enabledForProject:function(t,e,r){if(!t)return!0;e=me(e)?10:e,r=me(r)?10:r;for(var i=0,n=0;n<t.length;n++)i+=t.charCodeAt(n);return i%e<r},isBrowserSupported:function(){return ri(document.querySelectorAll)}};(function(t){for(var e in t)ri(t[e])&&(t[e]=t[e].bind(t))})(wr),function(t){for(var e in t)ri(t[e])&&(t[e]=Qp(t[e]))}(wr);var Pl="$active_feature_flags",ga="$override_feature_flags",Dp="$feature_flag_payloads",Fp=function(t){var e,r={},i=ei(function(o){for(var l=Object.keys(o),h=l.length,c=new Array(h);h--;)c[h]=[l[h],o[l[h]]];return c}(t||{}));try{for(i.s();!(e=i.n()).done;){var n=Nn(e.value,2),s=n[0],a=n[1];a&&(r[s]=a)}}catch(o){i.e(o)}finally{i.f()}return r},Kg=function(){function t(e){Re(this,t),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Le(t,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Hi),r=this.instance.get_property(ga);if(!r)return e||{};for(var i=Qe({},e),n=Object.keys(r),s=0;s<n.length;s++)r[n[s]]===!1?delete i[n[s]]:i[n[s]]=r[n[s]];return this._override_warning||(z.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:r,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Dp)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var r=this.instance.config.token,i=this.instance.get_property(qi),n=this.instance.get_property(_r),s=Yl(JSON.stringify({token:r,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:s},{method:"POST"},this.instance._prepare_callback(function(a){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(a),e.setReloadingPaused(!1),e._startReloadTimer()}))}},{key:"getFeatureFlag",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,n=this.getFlagVariants()[e],s="".concat(n),a=this.instance.get_property(Ia)||{};return(r.send_event||!("send_event"in r))&&(!(e in a)||!a[e].includes(s))&&(Ye(a[e])?a[e].push(s):a[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(Z({},Ia,a)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}z.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,r);z.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(r){return r!==e})}},{key:"receivedFeatureFlags",value:function(e){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();(function(n,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=n.featureFlags,h=n.featureFlagPayloads;if(l)if(Ye(l)){var c,u={};if(l)for(var f=0;f<l.length;f++)u[l[f]]=!0;s&&s.register((Z(c={},Pl,l),Z(c,Hi,u),c))}else{var p,m=l,g=h;n.errorsWhileComputingFlags&&(m=he(he({},a),m),g=he(he({},o),g)),s&&s.register((Z(p={},Pl,Object.keys(Fp(m))),Z(p,Hi,m||{}),Z(p,Dp,g||{}),p))}})(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return z.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(ga);else if(Ye(e)){for(var r={},i=0;i<e.length;i++)r[e[i]]=!0;this.instance.persistence.register(Z({},ga,r))}else this.instance.persistence.register(Z({},ga,e))}},{key:"onFeatureFlags",value:function(e){var r=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),n=i.flags,s=i.flagVariants;e(n,s)}return function(){return r.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,r){var i,n,s=Z({},"$feature_enrollment/".concat(e),r);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:r,$set:s}),this.setPersonPropertiesForFlags(s,!1);var a=he(he({},this.getFlagVariants()),{},Z({},e,r));(i=this.instance.persistence)===null||i===void 0||i.register((Z(n={},Pl,Object.keys(Fp(a))),Z(n,Hi,a),n)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(Ll);if(n&&!i)return e(n);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var a,o=s.earlyAccessFeatures;return(a=r.instance.persistence)===null||a===void 0||a.register(Z({},Ll,o)),e(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),r=this.getFlagVariants();return{flags:e.filter(function(i){return r[i]}),flagVariants:Object.keys(r).filter(function(i){return r[i]}).reduce(function(i,n){return i[n]=r[n],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach(function(n){return n(r,i)})}},{key:"setPersonPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(qi)||{};this.instance.register(Z({},qi,he(he({},i),e))),r&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(qi)}},{key:"setGroupPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(_r)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(n){i[n]=he(he({},i[n]),e[n]),delete e[n]}),this.instance.register(Z({},_r,he(he({},i),e))),r&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var r=this.instance.get_property(_r)||{};this.instance.register(Z({},_r,he(he({},r),{},Z({},e,{}))))}else this.instance.unregister(_r)}}]),t}(),Qg=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,or={is_supported:function(){return!0},error:function(t){z.error("cookieStore error: "+t)},get:function(t){try{for(var e=t+"=",r=document.cookie.split(";").filter(function(s){return s.length}),i=0;i<r.length;i++){for(var n=r[i];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null},parse:function(t){var e;try{e=JSON.parse(or.get(t))||{}}catch{}return e},set:function(t,e,r,i,n){try{var s="",a="",o="";if(i){var l=document.location.hostname.match(Qg),h=l?l[0]:"";s=h?"; domain=."+h:""}if(r){var c=new Date;c.setTime(c.getTime()+24*r*60*60*1e3),a="; expires="+c.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+s+o;return document.cookie=u,u}catch{return}},remove:function(t,e){try{or.set(t,"",-1,e)}catch{return}}},Al=null,$e={is_supported:function(){if(!Wt(Al))return Al;var t=!0;if(me(window))t=!1;else try{var e="__mplssupport__";$e.set(e,"xyz"),$e.get(e)!=='"xyz"'&&(t=!1),$e.remove(e)}catch{t=!1}return t||z.error("localStorage unsupported; falling back to cookie store"),Al=t,t},error:function(t){z.error("localStorage error: "+t)},get:function(t){try{return window.localStorage.getItem(t)}catch(e){$e.error(e)}return null},parse:function(t){try{return JSON.parse($e.get(t))||{}}catch{}return null},set:function(t,e){try{window.localStorage.setItem(t,JSON.stringify(e))}catch(r){$e.error(r)}},remove:function(t){try{window.localStorage.removeItem(t)}catch(e){$e.error(e)}}},e0=["distinct_id",Ta,Sa],zl=he(he({},$e),{},{parse:function(t){try{var e={};try{e=or.parse(t)||{}}catch{}var r=Qe(e,JSON.parse($e.get(t)||"{}"));return $e.set(t,r),r}catch{}return null},set:function(t,e,r,i,n){try{$e.set(t,e);var s={};e0.forEach(function(a){e[a]&&(s[a]=e[a])}),Object.keys(s).length&&or.set(t,s,r,i,n)}catch(a){$e.error(a)}},remove:function(t,e){try{window.localStorage.removeItem(t),or.remove(t,e)}catch(r){$e.error(r)}}}),ya={},t0={is_supported:function(){return!0},error:function(t){z.error("memoryStorage error: "+t)},get:function(t){return ya[t]||null},parse:function(t){return ya[t]||null},set:function(t,e){ya[t]=e},remove:function(t){delete ya[t]}},Xr=null,Ze={is_supported:function(){if(!Wt(Xr))return Xr;if(Xr=!0,me(window))Xr=!1;else try{var t="__support__";Ze.set(t,"xyz"),Ze.get(t)!=='"xyz"'&&(Xr=!1),Ze.remove(t)}catch{Xr=!1}return Xr},error:function(t){z.error("sessionStorage error: ",t)},get:function(t){try{return window.sessionStorage.getItem(t)}catch(e){Ze.error(e)}return null},parse:function(t){try{return JSON.parse(Ze.get(t))||null}catch{}return null},set:function(t,e){try{window.sessionStorage.setItem(t,JSON.stringify(e))}catch(r){Ze.error(r)}},remove:function(t){try{window.sessionStorage.removeItem(t)}catch(e){Ze.error(e)}}},r0=["localhost","127.0.0.1"],i0=function(t,e){return!!function(r){try{new RegExp(r)}catch{return!1}return!0}(e)&&new RegExp(e).test(t)},Op=function(t,e){for(var r,i=((t.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Ye(r)||r.length<2)return"";var a=r[1];try{a=decodeURIComponent(a)}catch{z.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Ma=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},Ue={campaignParams:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(t||[]),r={};return Pe(e,function(i){var n=Op(Oe.URL,i);n.length&&(r[i]=n)}),r},searchEngine:function(){var t=Oe.referrer;return t?t.search("https?://(.*)google.([^/?]*)")===0?"google":t.search("https?://(.*)bing.com")===0?"bing":t.search("https?://(.*)yahoo.com")===0?"yahoo":t.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var t=Ue.searchEngine(),e=t!="yahoo"?"q":"p",r={};if(!Wt(t)){r.$search_engine=t;var i=Op(Oe.referrer,e);i.length&&(r.ph_keyword=i)}return r},browser:function(t,e,r){return e=e||"",r||_e(t," OPR/")?_e(t,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":_e(t,"IEMobile")||_e(t,"WPDesktop")?"Internet Explorer Mobile":_e(t,"SamsungBrowser/")?"Samsung Internet":_e(t,"Edge")||_e(t,"Edg/")?"Microsoft Edge":_e(t,"FBIOS")?"Facebook Mobile":_e(t,"Chrome")?"Chrome":_e(t,"CriOS")?"Chrome iOS":_e(t,"UCWEB")||_e(t,"UCBrowser")?"UC Browser":_e(t,"FxiOS")?"Firefox iOS":_e(e,"Apple")||function(i){return _e(i,"Safari")&&!_e(i,"Chrome")&&!_e(i,"Android")}(t)?_e(t,"Mobile")?"Mobile Safari":"Safari":_e(t,"Android")?"Android Mobile":_e(t,"Konqueror")||_e(t,"konqueror")?"Konqueror":_e(t,"Firefox")?"Firefox":_e(t,"MSIE")||_e(t,"Trident/")?"Internet Explorer":_e(t,"Gecko")?"Mozilla":""},browserVersion:function(t,e,r){var i={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[Ue.browser(t,e,r)];if(me(i))return null;for(var n=0;n<i.length;n++){var s=i[n],a=t.match(s);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(t){if(/Windows/i.test(t)){if(/Phone/.test(t)||/WPDesktop/.test(t))return{os_name:"Windows Phone",os_version:""};var e=/Windows NT ([0-9.]+)/i.exec(t);return e&&e[1]?{os_name:"Windows",os_version:e[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(t)){var r=/OS (\d+)_(\d+)_?(\d+)?/i.exec(t);return r&&r[1]?{os_name:"iOS",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(t)){var i=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(t);return i&&i[1]?{os_name:"Android",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(t))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(t)){var n=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(t);return n&&n[1]?{os_name:"Mac OS X",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(t)?{os_name:"Linux",os_version:""}:/CrOS/.test(t)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(t){return/Windows Phone/i.test(t)||/WPDesktop/.test(t)?"Windows Phone":/iPad/.test(t)?"iPad":/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Android/.test(t)&&!/Mobile/.test(t)?"Android Tablet":/Android/.test(t)?"Android":""},deviceType:function(t){var e=this.device(t);return e==="iPad"||e==="Android Tablet"?"Tablet":e?"Mobile":"Desktop"},referrer:function(){return Oe.referrer||"$direct"},referringDomain:function(){if(!Oe.referrer)return"$direct";var t=Oe.createElement("a");return t.href=Oe.referrer,t.host},properties:function(){var t,e,r,i,n,s,a,o=Ue.os(ct),l=o.os_name,h=o.os_version;return Qe($l({$os:l,$os_version:h,$browser:Ue.browser(ct,navigator.vendor,window.opera),$device:Ue.device(ct),$device_type:Ue.deviceType(ct)}),{$current_url:(t=window)===null||t===void 0?void 0:t.location.href,$host:(e=window)===null||e===void 0?void 0:e.location.host,$pathname:(r=window)===null||r===void 0?void 0:r.location.pathname,$raw_user_agent:ct.length>1e3?ct.substring(0,997)+"...":ct,$browser_version:Ue.browserVersion(ct,navigator.vendor,window.opera),$browser_language:Ue.browserLanguage(),$screen_height:(i=window)===null||i===void 0?void 0:i.screen.height,$screen_width:(n=window)===null||n===void 0?void 0:n.screen.width,$viewport_height:(s=window)===null||s===void 0?void 0:s.innerHeight,$viewport_width:(a=window)===null||a===void 0?void 0:a.innerWidth,$lib:"web",$lib_version:ti.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Kp()/1e3})},people_properties:function(){var t=Ue.os(ct),e=t.os_name,r=t.os_version;return Qe($l({$os:e,$os_version:r,$browser:Ue.browser(ct,navigator.vendor,window.opera)}),{$browser_version:Ue.browserVersion(ct,navigator.vendor,window.opera)})}},n0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],$p=function(){function t(e){Re(this,t);var r="";e.token&&(r=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=e.custom_campaign_params||[],e.persistence_name?this.name="ph_"+e.persistence_name:this.name="ph_"+r+"_posthog",n0.indexOf(e.persistence.toLowerCase())===-1&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to cookie"),e.persistence="cookie");var i=e.persistence.toLowerCase();i==="localstorage"&&$e.is_supported()?this.storage=$e:i==="localstorage+cookie"&&zl.is_supported()?this.storage=zl:i==="sessionstorage"&&Ze.is_supported()?this.storage=Ze:this.storage=i==="memory"?t0:or,this.user_state="anonymous",this.load(),this.update_config(e),this.save()}return Le(t,[{key:"properties",value:function(){var e={};return Pe(this.props,function(r,i){if(i===Hi&&xr(r))for(var n=Object.keys(r),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=r[n[s]];else o=i,l=!1,(Wt(a=Xg)?l:Sp&&a.indexOf===Sp?a.indexOf(o)!=-1:(Pe(a,function(h){if(l||(l=h===o))return Zl}),l))||(e[i]=r);var a,o,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Qe({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,r,i){var n=this;if(xr(e)){me(r)&&(r="None"),this.expire_days=me(i)?this.default_expiry:i;var s=!1;if(Pe(e,function(a,o){n.props.hasOwnProperty(o)&&n.props[o]!==r||(n.props[o]=a,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,r){var i=this;if(xr(e)){this.expire_days=me(r)?this.default_expiry:r;var n=!1;if(Pe(e,function(s,a){e.hasOwnProperty(a)&&i.props[a]!==s&&(i.props[a]=s,n=!0)}),n)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(Ue.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(Ue.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||Ue.referrer(),$referring_domain:this.props.$referring_domain||Ue.referringDomain()})}},{key:"get_referrer_info",value:function(){return $l({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Pe(this.props,function(r,i){i in e||(e[i]=r)}),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,r){var i=this.props[$n]||{};i[e]=r,this.props[$n]=i,this.save()}},{key:"remove_event_timer",value:function(e){var r=(this.props[$n]||{})[e];return me(r)||(delete this.props[$n][e],this.save()),r}},{key:"get_user_state",value:function(){return this.props[Vl]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Vl]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[Nl]||{}}},{key:"set_quota_limits",value:function(e){this.props[Nl]=e,this.save()}}]),t}(),Rp=2,s0=4,nd=3,a0=6,o0=0,l0="rrweb/console@1",Ut,h0=Le(function t(e){var r,i,n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Re(this,t),Z(this,"bucketSize",100),Z(this,"refillRate",10),Z(this,"mutationBuckets",{}),Z(this,"loggedTracker",{}),Z(this,"refillBuckets",function(){Object.keys(n.mutationBuckets).forEach(function(a){n.mutationBuckets[a]=n.mutationBuckets[a]+n.refillRate,n.mutationBuckets[a]>=n.bucketSize&&delete n.mutationBuckets[a]})}),Z(this,"getNodeOrRelevantParent",function(a){var o=n.rrweb.mirror.getNode(a);if(o?.nodeName!=="svg"&&o instanceof Element){var l=o.closest("svg");if(l)return[n.rrweb.mirror.getId(l),l]}return[a,o]}),Z(this,"numberOfChanges",function(a){var o,l,h,c,u,f,p,m;return((o=(l=a.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((h=(c=a.attributes)===null||c===void 0?void 0:c.length)!==null&&h!==void 0?h:0)+((u=(f=a.texts)===null||f===void 0?void 0:f.length)!==null&&u!==void 0?u:0)+((p=(m=a.adds)===null||m===void 0?void 0:m.length)!==null&&p!==void 0?p:0)}),Z(this,"throttleMutations",function(a){if(a.type!==nd||a.data.source!==o0)return a;var o=a.data,l=n.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter(function(c){var u,f,p,m=Nn(n.getNodeOrRelevantParent(c.id),2),g=m[0],d=m[1];return n.mutationBuckets[g]===0?!1:(n.mutationBuckets[g]=(u=n.mutationBuckets[g])!==null&&u!==void 0?u:n.bucketSize,n.mutationBuckets[g]=Math.max(n.mutationBuckets[g]-1,0),n.mutationBuckets[g]===0&&(n.loggedTracker[g]||(n.loggedTracker[g]=!0,(f=(p=n.options).onBlockedNode)===null||f===void 0||f.call(p,g,d))),c)}));var h=n.numberOfChanges(o);return h!==0||l===h?a:void 0}),this.rrweb=e,this.options=s,this.refillRate=(r=this.options.refillRate)!==null&&r!==void 0?r:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){n.refillBuckets()},1e3)}),sd=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}(sd||{}),c0="/s/";(function(t){t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(Ut||(Ut={}));var u0=[Ut.MouseMove,Ut.MouseInteraction,Ut.Scroll,Ut.ViewportResize,Ut.Input,Ut.TouchMove,Ut.MediaInteraction,Ut.Drag],p0=function(){function t(e){var r=this;if(Re(this,t),Z(this,"_linkedFlagSeen",!1),Z(this,"_lastActivityTimestamp",Date.now()),Z(this,"isIdle",!1),Z(this,"_linkedFlag",null),Z(this,"_sampleRate",null),Z(this,"_minimumDuration",null),this.instance=e,this._captureStarted=!1,this._endpoint=c0,this.stopRrweb=void 0,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){r._flushBuffer()}),!this.instance.sessionManager)throw z.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=i.sessionId,s=i.windowId;this.windowId=s,this.sessionId=n,this.buffer=this.clearBuffer()}return Le(t,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw z.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return ar(this._sampleRate)?this.instance.get_property(Sa):null}},{key:"sessionDuration",get:function(){var e,r,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((r=this.buffer)===null||r===void 0?void 0:r.data.length)-1],n=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-n:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Rl),r=!this.instance.config.disable_session_recording;return e&&r}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Ip),r=this.instance.config.enable_recording_console_log;return r??e}},{key:"recordingVersion",get:function(){var e,r=this.instance.get_property(Mp);return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recorderVersion)||r||"v1"}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?xt(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":Fl(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?this.startCaptureAndTrySendingQueuedSnapshots():(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1)}},{key:"makeSamplingDecision",value:function(e){var r,i=this.sessionId!==e;if(ar(this._sampleRate)){var n,s=this.isSampled;i||!Fl(s)?n=Math.random()<this._sampleRate:n=s,n||z.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),(r=this.instance.persistence)===null||r===void 0||r.register(Z({},Sa,n))}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register(Z({},Sa,null))}}},{key:"afterDecideResponse",value:function(e){var r,i,n,s,a,o,l,h=this;this.instance.persistence&&this.instance.persistence.register((Z(l={},Rl,!!e.sessionRecording),Z(l,Ip,(a=e.sessionRecording)===null||a===void 0?void 0:a.consoleLogRecordingEnabled),Z(l,Mp,(o=e.sessionRecording)===null||o===void 0?void 0:o.recorderVersion),l));var c=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate;this._sampleRate=me(c)||Wt(c)?null:parseFloat(c);var u,f=(i=e.sessionRecording)===null||i===void 0?void 0:i.minimumDurationMilliseconds;if(this._minimumDuration=me(f)?null:f,this._linkedFlag=((n=e.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(s=e.sessionRecording)!==null&&s!==void 0&&s.endpoint&&(this._endpoint=(u=e.sessionRecording)===null||u===void 0?void 0:u.endpoint),ar(this._sampleRate)&&this.sessionManager.onSessionId(function(m){h.makeSamplingDecision(m)}),xt(this._linkedFlag)){var p=this._linkedFlag;this.instance.onFeatureFlags(function(m){h._linkedFlagSeen=m.includes(p)})}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:Kp()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var e=this;if(!me(Object.assign)&&!this._captureStarted&&!this.instance.config.disable_session_recording){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var r=this.recordingVersion==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Ln(this.instance.config.api_host+"/static/".concat(r,"?v=").concat(ti.LIB_VERSION),function(i){if(i)return z.error("Could not load ".concat(r),i);e._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var r;return e.type===nd&&u0.indexOf((r=e.data)===null||r===void 0?void 0:r.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var r=this._isInteractiveEvent(e);if(r||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0),r&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var i=this.sessionManager.checkAndGetSessionAndWindowId(!r,e.timestamp),n=i.windowId,s=i.sessionId,a=this.sessionId!==s,o=this.windowId!==n;this.windowId=n,this.sessionId=s,[Rp,s0].indexOf(e.type)===-1&&(o||a)&&this._tryTakeFullSnapshot()}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this._captureStarted)return!1;try{var e;return(e=this.rrwebRecord)===null||e===void 0||e.takeFullSnapshot(),!0}catch(r){return z.error("Error taking full snapshot.",r),!1}}},{key:"_onScriptLoaded",value:function(){var e,r=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var n=this.instance.config.session_recording,s=0,a=Object.entries(n||{});s<a.length;s++){var o=Nn(a[s],2),l=o[0],h=o[1];l in i&&(i[l]=h)}this.rrwebRecord?(this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new h0(this.rrwebRecord,{onBlockedNode:function(c,u){var f="Too many mutations on node '".concat(c,"'. Rate limiting. This could be due to SVG animations or something similar");z.info(f,{node:u}),r.log("[PostHog Recorder] "+f,"warn")}}),this.stopRrweb=this.rrwebRecord(he({emit:function(c){r.onRRwebEmit(c)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},i)),this.instance._addCaptureHook(function(c){try{if(c==="$pageview"){var u,f=r._maskUrl(window.location.href);if(!f)return;(u=r.rrwebRecord)===null||u===void 0||u.addCustomEvent("$pageview",{href:f})}}catch(p){z.error("Could not add $pageview to rrweb session",p)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):z.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(e){if(e&&xr(e)){if(e.type===sd.Meta){var r=this._maskUrl(e.data.href);if(!r)return;e.data.href=r}var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var n=function(a){var o=a;if(o&&xr(o)&&o.type===a0&&xr(o.data)&&o.data.plugin===l0){o.data.payload.payload.length>10&&(o.data.payload.payload=o.data.payload.payload.slice(0,10),o.data.payload.payload.push("...[truncated]"));for(var l=[],h=0;h<o.data.payload.payload.length;h++)o.data.payload.payload[h]&&o.data.payload.payload[h].length>2e3?l.push(o.data.payload.payload[h].slice(0,2e3)+"...[truncated]"):l.push(o.data.payload.payload[h]);return o.data.payload.payload=l,a}return a}(i),s={$snapshot_bytes:JSON.stringify(n).length,$snapshot_data:n,$session_id:this.sessionId,$window_id:this.windowId};this._updateWindowAndSessionIds(n),this.isIdle||(this.status!=="disabled"?this._captureSnapshotBuffered(s):this.clearBuffer())}}}},{key:"_maskUrl",value:function(e){var r=this.instance.config.session_recording;if(r.maskNetworkRequestFn){var i,n={url:e};return(i=n=r.maskNetworkRequestFn(n))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var r=this._minimumDuration,i=this.sessionDuration,n=ar(r)&&ar(i)&&i<r;return this.status==="buffering"||n?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer||this.clearBuffer()):this.buffer&&this.buffer.data.length!==0?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var r,i=this,n=2+(((r=this.buffer)===null||r===void 0?void 0:r.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===Rp}})}}]),t}(),qt={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},d0=["first-input","navigation","paint","resource"],f0=["/s/","/e/"],m0=function(){function t(e){Re(this,t),Z(this,"_forceAllowLocalhost",!1),this.instance=e}return Le(t,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e,r,i=this;if(!this.observer)if(me((e=window)===null||e===void 0||(r=e.PerformanceObserver)===null||r===void 0?void 0:r.supportedEntryTypes))z.info("[PerformanceObserver] not started because PerformanceObserver is not supported by this browser.");else if(!r0.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(s){s.getEntries().forEach(function(a){i._capturePerformanceEvent(a)})});var n=PerformanceObserver.supportedEntryTypes.filter(function(s){return d0.includes(s)});n.forEach(function(s){var a;(a=i.observer)===null||a===void 0||a.observe({type:s,buffered:!0})})}catch(s){z.error("PostHog failed to start performance observer",s),this.stopObserving()}else z.info("[PerformanceObserver] not started because we are on localhost.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,r;return(e=(r=this.instance.config.capture_performance)!==null&&r!==void 0?r:this.remoteEnabled)!==null&&e!==void 0&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(e.name.indexOf(this.instance.config.api_host)===0){var r=e.name.replace(this.instance.config.api_host,"");if(f0.find(function(p){return r.indexOf(p)===0}))return}var i={url:e.name},n=this.instance.config.session_recording;if(n.maskNetworkRequestFn&&(i=n.maskNetworkRequestFn(i)),i){var s=e.toJSON();s.name=i.url;var a={},o=Math.floor(Date.now()-performance.now());for(var l in a[qt.timeOrigin]=o,a[qt.timestamp]=Math.floor(o+e.startTime),qt)me(s[l])||(a[qt[l]]=s[l]);if(this.capturePerformanceEvent(a),g0(e)){var h,c=ei(e.serverTiming||[]);try{for(c.s();!(h=c.n()).done;){var u,f=h.value;this.capturePerformanceEvent((Z(u={},qt.timeOrigin,o),Z(u,qt.timestamp,Math.floor(o+e.startTime)),Z(u,qt.name,f.name),Z(u,qt.duration,f.duration),Z(u,qt.entryType,"serverTiming"),u))}}catch(p){c.e(p)}finally{c.f()}}}}},{key:"capturePerformanceEvent",value:function(e){var r,i=e[qt.timestamp];(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:e},timestamp:i})}}]),t}(),g0=function(t){return t.entryType==="navigation"||t.entryType==="resource"},y0=function(){function t(e){Re(this,t),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Le(t,[{key:"call",value:function(){var e=this,r=Yl(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(qi),group_properties:this.instance.get_property(_r),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:r,verbose:!0},{method:"POST"},function(i){return e.parseDecideResponse(i)})}},{key:"parseDecideResponse",value:function(e){var r,i,n,s,a=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),e?.status!==0){if(!document||!document.body)return z.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){a.parseDecideResponse(e)},500);this.instance.toolbar.afterDecideResponse(e),(r=this.instance.sessionRecording)===null||r===void 0||r.afterDecideResponse(e),wr.afterDecideResponse(e,this.instance),(i=this.instance.webPerformance)===null||i===void 0||i.afterDecideResponse(e),this.instance._afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.featureFlags.receivedFeatureFlags(e);var o=(n=window)===null||n===void 0?void 0:n.extendPostHogWithSurveys;e.surveys&&!o&&Ln(this.instance.config.api_host+"/static/surveys.js",function(p){if(p)return z.error("Could not load surveys script",p);window.extendPostHogWithSurveys(a.instance)});var l=(s=window)===null||s===void 0?void 0:s.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&me(l)&&Ln(this.instance.config.api_host+"/static/exception-autocapture.js",function(p){if(p)return z.error("Could not load exception autocapture script",p);window.extendPostHogWithExceptionAutocapture(a.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var h,c=this.instance.config.api_host,u=ei(e.siteApps);try{var f=function(){var p=h.value,m=p.id,g=p.url,d=[c,c[c.length-1]==="/"&&g[0]==="/"?g.substring(1):g].join("");window["__$$ph_site_app_".concat(m)]=a.instance,Ln(d,function(y){y&&z.error("Error while initializing PostHog app with config id ".concat(m),y)})};for(u.s();!(h=u.n()).done;)f()}catch(p){u.e(p)}finally{u.f()}}else e.siteApps.length>0&&z.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else z.error("Failed to fetch feature flags from PostHog.")}}]),t}(),v0=["https://app.posthog.com","https://eu.posthog.com"],b0=["source"],_0=J.location?Ma(J.location.hash,"__posthog")||Ma(location.hash,"state"):null,w0=function(){function t(e){Re(this,t),this.instance=e}return Le(t,[{key:"afterDecideResponse",value:function(e){var r=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&r.toolbarVersion&&r.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(he({},r))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J.location,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:J.history;try{if(!r){try{J.localStorage.setItem("test","test"),J.localStorage.removeItem("test")}catch{return!1}r=J.localStorage}var n,s=_0||Ma(e.hash,"__posthog")||Ma(e.hash,"state"),a=s?Ep(function(){return JSON.parse(atob(decodeURIComponent(s)))})||Ep(function(){return JSON.parse(decodeURIComponent(s))}):null;return a&&a.action==="ph_authorize"?((n=a).source="url",n&&Object.keys(n).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState("",document.title,e.pathname+e.search):e.hash="")):((n=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}},{key:"loadToolbar",value:function(e){var r=this;if(J._postHogToolbarLoaded)return!1;J._postHogToolbarLoaded=!0;var i=this.instance.config.api_host,n=3e5,s=Math.floor(Date.now()/n)*n,a="".concat(i).concat(i.endsWith("/")?"":"/","static/toolbar.js?t=").concat(s),o=!v0.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,l=he(he({token:this.instance.config.token},e),{},{apiURL:i},o?{instrument:!1}:{});l.source;var h=Ng(l,b0);return J.localStorage.setItem("_postHogToolbarParams",JSON.stringify(h)),Ln(a,function(c){c?z.error("Failed to load toolbar",c):(J.ph_load_toolbar||J.ph_load_editor)(l,r.instance)}),Rn(J,"turbolinks:load",function(){J._postHogToolbarLoaded=!1,r.loadToolbar(l)}),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J.location,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:J.history;return this.maybeLoadToolbar(e,r,i)}}]),t}(),x0="__ph_opt_in_out_";function S0(t,e){od(!0,t,e)}function k0(t,e){od(!1,t,e)}function E0(t,e){return ad(t,e)==="1"}function Lp(t,e){return!!function(r){if(r&&r.respectDnt){var i=r&&r.window||J,n=i.navigator||{},s=!1;return Pe([n.doNotTrack,n.msDoNotTrack,i.doNotTrack],function(a){_e([!0,1,"1","yes"],a)&&(s=!0)}),s}return!1}(e)||ad(t,e)==="0"}function P0(t,e){Jl(e=e||{}).remove(Xl(t,e),!!e.crossSubdomainCookie)}function Jl(t){return(t=t||{}).persistenceType==="localStorage"?$e:t.persistenceType==="localStorage+cookie"?zl:or}function Xl(t,e){return((e=e||{}).persistencePrefix||x0)+t}function ad(t,e){return Jl(e).get(Xl(t,e))}function od(t,e,r){xt(e)&&e.length?(Jl(r=r||{}).set(Xl(e,r),t?1:0,ar(r.cookieExpiration)?r.cookieExpiration:null,r.crossSubdomainCookie,r.secureCookie),r.capture&&t&&r.capture(r.captureEventName||"$opt_in",r.captureProperties||{},{send_instantly:!0})):z.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token")}var ld=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Re(this,t),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=e}return Le(t,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),t}(),A0=function(t){Wp(r,ld);var e=Zp(r);function r(i){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e3;return Re(this,r),(n=e.call(this,s)).handlePollRequest=i,n}return Le(r,[{key:"enqueue",value:function(i,n,s){this._event_queue.push({url:i,data:n,options:s}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var i=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(i._event_queue.length>0){var n=i.formatQueue(),s=function(o){var l=n[o],h=l.url,c=l.data,u=l.options;Pe(c,function(f,p){c[p].offset=Math.abs(c[p].timestamp-i.getTime()),delete c[p].timestamp}),i.handlePollRequest(h,c,u)};for(var a in n)s(a);i._event_queue.length=0,i._empty_queue_count=0}else i._empty_queue_count++;i._empty_queue_count>4&&(i.isPolling=!1,i._empty_queue_count=0),i.isPolling&&i.poll()},this._pollInterval)}},{key:"unload",value:function(){var i=this;clearTimeout(this._poller);var n=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var s=Object.values(n);[].concat(Ml(s.filter(function(a){return a.url.indexOf("/e")===0})),Ml(s.filter(function(a){return a.url.indexOf("/e")!==0}))).map(function(a){var o=a.url,l=a.data,h=a.options;i.handlePollRequest(o,l,he(he({},h),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var i={};return Pe(this._event_queue,function(n){var s=n.url,a=n.data,o=n.options,l=(o?o._batchKey:null)||s;me(i[l])&&(i[l]={data:[],url:s,options:o}),o&&i[l].options&&i[l].options._metrics&&!i[l].options._metrics.rrweb_full_snapshot&&(i[l].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),i[l].data.push(a)}),i}}]),r}(),St=Uint8Array,nt=Uint16Array,Zi=Uint32Array,Kl=new St([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ql=new St([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bp=new St([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hd=function(t,e){for(var r=new nt(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new Zi(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},cd=hd(Kl,2),C0=cd[0],jl=cd[1];C0[28]=258,jl[258]=28;for(Gl=hd(Ql,0)[1],Da=new nt(32768),Te=0;Te<32768;++Te)vr=(43690&Te)>>>1|(21845&Te)<<1,vr=(61680&(vr=(52428&vr)>>>2|(13107&vr)<<2))>>>4|(3855&vr)<<4,Da[Te]=((65280&vr)>>>8|(255&vr)<<8)>>>1;var vr,Gl,Da,Te,Bn=function(t,e,r){for(var i=t.length,n=0,s=new nt(e);n<i;++n)++s[t[n]-1];var a,o=new nt(e);for(n=0;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new nt(1<<e);var l=15-e;for(n=0;n<i;++n)if(t[n])for(var h=n<<4|t[n],c=e-t[n],u=o[t[n]-1]++<<c,f=u|(1<<c)-1;u<=f;++u)a[Da[u]>>>l]=h}else for(a=new nt(i),n=0;n<i;++n)a[n]=Da[o[t[n]-1]++]>>>15-t[n];return a},ii=new St(288);for(Te=0;Te<144;++Te)ii[Te]=8;for(Te=144;Te<256;++Te)ii[Te]=9;for(Te=256;Te<280;++Te)ii[Te]=7;for(Te=280;Te<288;++Te)ii[Te]=8;var Fa=new St(32);for(Te=0;Te<32;++Te)Fa[Te]=5;var Kr,T0=Bn(ii,9,0),I0=Bn(Fa,5,0),ud=function(t){return(t/8>>0)+(7&t&&1)},pd=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var i=new(t instanceof nt?nt:t instanceof Zi?Zi:St)(r-e);return i.set(t.subarray(e,r)),i},sr=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},Fn=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Cl=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new St(0),0];if(n==1){var a=new St(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(x,T){return x.f-T.f}),r.push({s:-1,f:25001});var o=r[0],l=r[1],h=0,c=1,u=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=n-1;)o=r[r[h].f<r[u].f?h++:u++],l=r[h!=c&&r[h].f<r[u].f?h++:u++],r[c++]={s:-1,f:o.f+l.f,l:o,r:l};var f=s[0].s;for(i=1;i<n;++i)s[i].s>f&&(f=s[i].s);var p=new nt(f+1),m=M0(r[c-1],p,0);if(m>e){i=0;var g=0,d=m-e,y=1<<d;for(s.sort(function(x,T){return p[T.s]-p[x.s]||x.f-T.f});i<n;++i){var v=s[i].s;if(!(p[v]>e))break;g+=y-(1<<m-p[v]),p[v]=e}for(g>>>=d;g>0;){var b=s[i].s;p[b]<e?g-=1<<e-p[b]++-1:++i}for(;i>=0&&g;--i){var _=s[i].s;p[_]==e&&(--p[_],++g)}m=e}return[new St(p),m]},M0=function t(e,r,i){return e.s==-1?Math.max(t(e.l,r,i+1),t(e.r,r,i+1)):r[e.s]=i},Vp=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new nt(++e),i=0,n=t[0],s=1,a=function(l){r[i++]=l},o=1;o<=e;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},On=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},ka=function(t,e,r){var i=r.length,n=ud(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<i;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Np=function(t,e,r,i,n,s,a,o,l,h,c){sr(e,c++,r),++n[256];for(var u=Cl(n,15),f=u[0],p=u[1],m=Cl(s,15),g=m[0],d=m[1],y=Vp(f),v=y[0],b=y[1],_=Vp(g),x=_[0],T=_[1],S=new nt(19),w=0;w<v.length;++w)S[31&v[w]]++;for(w=0;w<x.length;++w)S[31&x[w]]++;for(var M=Cl(S,7),k=M[0],I=M[1],P=19;P>4&&!k[Bp[P-1]];--P);var A,E,F,O,D=h+5<<3,C=On(n,ii)+On(s,Fa)+a,$=On(n,f)+On(s,g)+a+14+3*P+On(S,k)+(2*S[16]+3*S[17]+7*S[18]);if(D<=C&&D<=$)return ka(e,c,t.subarray(l,l+h));if(sr(e,c,1+($<C)),c+=2,$<C){A=Bn(f,p,0),E=f,F=Bn(g,d,0),O=g;var R=Bn(k,I,0);for(sr(e,c,b-257),sr(e,c+5,T-1),sr(e,c+10,P-4),c+=14,w=0;w<P;++w)sr(e,c+3*w,k[Bp[w]]);c+=3*P;for(var q=[v,x],U=0;U<2;++U){var Y=q[U];for(w=0;w<Y.length;++w){var G=31&Y[w];sr(e,c,R[G]),c+=k[G],G>15&&(sr(e,c,Y[w]>>>5&127),c+=Y[w]>>>12)}}}else A=T0,E=ii,F=I0,O=Fa;for(w=0;w<o;++w)if(i[w]>255){G=i[w]>>>18&31,Fn(e,c,A[G+257]),c+=E[G+257],G>7&&(sr(e,c,i[w]>>>23&31),c+=Kl[G]);var re=31&i[w];Fn(e,c,F[re]),c+=O[re],re>3&&(Fn(e,c,i[w]>>>5&8191),c+=Ql[re])}else Fn(e,c,A[i[w]]),c+=E[i[w]];return Fn(e,c,A[256]),c+E[256]},D0=new Zi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F0=new St(0),O0=function(){for(var t=new Zi(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),$0=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=O0[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}},R0=function(t,e,r,i,n){return function(s,a,o,l,h,c){var u=s.length,f=new St(l+u+5*(1+Math.floor(u/7e3))+h),p=f.subarray(l,f.length-h),m=0;if(!a||u<8)for(var g=0;g<=u;g+=65535){var d=g+65535;d<u?m=ka(p,m,s.subarray(g,d)):(p[g]=c,m=ka(p,m,s.subarray(g,u)))}else{for(var y=D0[a-1],v=y>>>13,b=8191&y,_=(1<<o)-1,x=new nt(32768),T=new nt(_+1),S=Math.ceil(o/3),w=2*S,M=function(st){return(s[st]^s[st+1]<<S^s[st+2]<<w)&_},k=new Zi(25e3),I=new nt(288),P=new nt(32),A=0,E=0,F=(g=0,0),O=0,D=0;g<u;++g){var C=M(g),$=32767&g,R=T[C];if(x[$]=R,T[C]=$,O<=g){var q=u-g;if((A>7e3||F>24576)&&q>423){m=Np(s,p,0,k,I,P,E,F,D,g-D,m),F=A=E=0,D=g;for(var U=0;U<286;++U)I[U]=0;for(U=0;U<30;++U)P[U]=0}var Y=2,G=0,re=b,se=$-R&32767;if(q>2&&C==M(g-se))for(var ie=Math.min(v,q)-1,Q=Math.min(32767,g),xe=Math.min(258,q);se<=Q&&--re&&$!=R;){if(s[g+Y]==s[g+Y-se]){for(var ue=0;ue<xe&&s[g+ue]==s[g+ue-se];++ue);if(ue>Y){if(Y=ue,G=se,ue>ie)break;var Ie=Math.min(se,ue-2),Se=0;for(U=0;U<Ie;++U){var W=g-se+U+32768&32767,qe=W-x[W]+32768&32767;qe>Se&&(Se=qe,R=W)}}}se+=($=R)-(R=x[$])+32768&32767}if(G){k[F++]=268435456|jl[Y]<<18|Gl[G];var kt=31&jl[Y],Et=31&Gl[G];E+=Kl[kt]+Ql[Et],++I[257+kt],++P[Et],O=g+Y,++A}else k[F++]=s[g],++I[s[g]]}}m=Np(s,p,c,k,I,P,E,F,D,g-D,m),c||(m=ka(p,m,F0))}return pd(f,0,l+ud(m)+h)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!n)},Hl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},L0=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Hl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}},B0=function(t){return 10+(t.filename&&t.filename.length+1||0)};function V0(t,e){e===void 0&&(e={});var r=$0(),i=t.length;r.p(t);var n=R0(t,e,B0(e),8),s=n.length;return L0(n,e),Hl(n,s-8,r.d()),Hl(n,s-4,i),n}function N0(t,e){var r=t.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(t);for(var i=new St(t.length+(t.length>>>1)),n=0,s=function(h){i[n++]=h},a=0;a<r;++a){if(n+5>i.length){var o=new St(n+8+(r-a<<1));o.set(i),i=o}var l=t.charCodeAt(a);l<128||e?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++a))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return pd(i,0,n)}(function(t){t.GZipJS="gzip-js",t.Base64="base64"})(Kr||(Kr={}));var dd=function(t,e,r){var i=e||{};i.ip=r.ip?1:0,i._=new Date().getTime().toString(),i.ver=ti.LIB_VERSION;var n=t.split("?");if(n.length>1){var s,a=ei(n[1].split("&"));try{for(a.s();!(s=a.n()).done;){var o=s.value.split("=")[0];me(i[o])||delete i[o]}}catch(h){a.e(h)}finally{a.f()}}var l=t.indexOf("?")>-1?"&":"?";return t+l+function(h){var c,u,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",p=[];return Pe(h,function(m,g){me(m)||me(g)||g==="undefined"||(c=encodeURIComponent(m.toString()),u=encodeURIComponent(g),p[p.length]=u+"="+c)}),p.join(f)}(i)},eh=function t(e,r){if(r.blob&&e.buffer)return new Blob([wp(e)?e:e.buffer],{type:"text/plain"});if(r.sendBeacon||r.blob){var i=t(e,{method:"POST"});return new Blob([i],{type:"application/x-www-form-urlencoded"})}return r.method!=="POST"?null:(n=Ye(e)||wp(e)?"data="+encodeURIComponent(e):"data="+encodeURIComponent(e.data),"compression"in e&&e.compression&&(n+="&compression="+e.compression),n);var n},fd=function(t){var e=t.url,r=t.data,i=t.headers,n=t.options,s=t.callback,a=t.retriesPerformedSoFar,o=t.retryQueue,l=t.onXHRError,h=t.timeout,c=h===void 0?6e4:h,u=t.onResponse;ar(a)&&a>0&&(e=dd(e,{retry_count:a},{}));var f=new XMLHttpRequest;f.open(n.method||"GET",e,!0);var p=eh(r,n);Pe(i,function(m,g){f.setRequestHeader(g,m)}),n.method!=="POST"||n.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=c,f.withCredentials=!0,f.onreadystatechange=function(){if(f.readyState===4)if(u?.(f),f.status===200){if(s){var m;try{m=JSON.parse(f.responseText)}catch(g){return void z.error(g)}s(m)}}else ri(l)&&l(f),(f.status<400||f.status>500)&&o.enqueue({url:e,data:r,options:n,headers:i,retriesPerformedSoFar:(a||0)+1,callback:s}),s?.({status:0})},f.send(p)},z0=18e5,j0=function(t){Wp(r,ld);var e=Zp(r);function r(i,n){var s;return Re(this,r),(s=e.call(this)).isPolling=!1,s.queue=[],s.areWeOnline=!0,s.onXHRError=i,s.rateLimiter=n,!me(window)&&"onLine"in window.navigator&&(s.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){s._handleWeAreNowOnline()}),window.addEventListener("offline",function(){s.areWeOnline=!1})),s}return Le(r,[{key:"enqueue",value:function(i){var n=i.retriesPerformedSoFar||0;if(!(n>=10)){var s=function(l){var h=3e3*Math.pow(2,l),c=h/2,u=Math.min(z0,h),f=(Math.random()-.5)*(u-c);return Math.ceil(u+f)}(n),a=new Date(Date.now()+s);this.queue.push({retryAt:a,requestData:i});var o="Enqueued failed request for retry in ".concat(s);navigator.onLine||(o+=" (Browser is offline)"),z.warn(o),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var i=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){i.areWeOnline&&i.queue.length>0&&i.flush(),i.poll()},this._pollInterval)}},{key:"flush",value:function(){var i=new Date(Date.now()),n=this.queue.filter(function(l){return l.retryAt<i});if(n.length>0){this.queue=this.queue.filter(function(l){return l.retryAt>=i});var s,a=ei(n);try{for(a.s();!(s=a.n()).done;){var o=s.value.requestData;this._executeXhrRequest(o)}}catch(l){a.e(l)}finally{a.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var i,n=ei(this.queue);try{for(n.s();!(i=n.n()).done;){var s=i.value.requestData,a=s.url,o=s.data,l=s.options;if(this.rateLimiter.isRateLimited(l._batchKey))z.warn("[RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(a,eh(o,he(he({},l),{},{sendBeacon:!0})))}catch(h){z.error(h)}}}catch(h){n.e(h)}finally{n.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(i){var n=i.url,s=i.data,a=i.options,o=i.headers,l=i.callback,h=i.retriesPerformedSoFar;this.rateLimiter.isRateLimited(a._batchKey)||fd({url:n,data:s||{},options:a||{},headers:o||{},retriesPerformedSoFar:h||0,callback:l,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}();Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ar(t)&&isFinite(t)&&Math.floor(t)===t});var zp="0123456789abcdef",G0=function(){function t(e){if(Re(this,t),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return Le(t,[{key:"toString",value:function(){for(var e="",r=0;r<this.bytes.length;r++)e=e+zp.charAt(this.bytes[r]>>>4)+zp.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new t(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var r=0;r<16;r++){var i=this.bytes[r]-e.bytes[r];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,r,i,n){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||e<0||r<0||i<0||n<0||e>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|r>>>8,s[7]=r,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}}]),t}(),H0=function(){function t(){Re(this,t),Z(this,"timestamp",0),Z(this,"counter",0),Z(this,"random",new q0)}return Le(t,[{key:"generate",value:function(){var e=this.generateOrAbort();if(me(e)){this.timestamp=0;var r=this.generateOrAbort();if(me(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return G0.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),t}(),md=function(t){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};!me(J.crypto)&&crypto.getRandomValues&&(md=function(t){return crypto.getRandomValues(t)});var jp,q0=function(){function t(){Re(this,t),Z(this,"buffer",new Uint32Array(8)),Z(this,"cursor",1/0)}return Le(t,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(md(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),t}(),Ui=function(){return U0().toString()},U0=function(){return(jp||(jp=new H0)).generate()},va=1800,Gp=60,W0=864e5,Z0=function(){function t(e,r,i,n){Re(this,t),Z(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=r,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||Ui,this._windowIdGenerator=n||Ui;var s=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||va;if(ar(a)?a>va?z.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<Gp&&z.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(z.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=va),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,Gp),va),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var o=Ze.parse(this._window_id_storage_key),l=Ze.parse(this._primary_window_exists_storage_key);o&&!l?this._windowId=o:Ze.remove(this._window_id_storage_key),Ze.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return Le(t,[{key:"onSessionId",value:function(e){var r=this;return me(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){r._sessionIdChangedHandlers=r._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Ze.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ze.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ze.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,r,i){e===this._sessionId&&r===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=r,this._sessionId=e,this.persistence.register(Z({},Ta,[r,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Ta];return Ye(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;J.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&Ze.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),i=Nn(this._getSessionId(),3),n=i[0],s=i[1],a=i[2],o=this._getWindowId(),l=a&&a>0&&Math.abs(r-a)>W0,h=!1,c=!s,u=!e&&Math.abs(r-n)>this._sessionTimeoutMs;c||u||l?(s=this._sessionIdGenerator(),o=this._windowIdGenerator(),a=r,h=!0):o||(o=this._windowIdGenerator(),h=!0);var f=n===0||!e||l?r:n,p=a===0?new Date().getTime():a;return this._setWindowId(o),this._setSessionId(s,f,p),h&&this._sessionIdChangedHandlers.forEach(function(m){return m(s,o)}),{sessionId:s,windowId:o,sessionStartTimestamp:p}}}]),t}(),Y0=Le(function t(e,r,i,n){Re(this,t),this.name="posthog-js",this.setupOnce=function(s){s(function(a){var o,l,h,c,u;if(a.level!=="error"||!e.__loaded)return a;a.tags||(a.tags={});var f=e.config.ui_host||e.config.api_host;a.tags["PostHog Person URL"]=f+"/person/"+e.get_distinct_id(),e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=((o=a.exception)===null||o===void 0?void 0:o.values)||[],m={$exception_message:(l=p[0])===null||l===void 0?void 0:l.value,$exception_type:(h=p[0])===null||h===void 0?void 0:h.type,$exception_personURL:f+"/person/"+e.get_distinct_id(),$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:(c=p[0])===null||c===void 0?void 0:c.value,$sentry_exception_type:(u=p[0])===null||u===void 0?void 0:u.type,$sentry_tags:a.tags};return r&&i&&(m.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+a.event_id),e.capture("$exception",m),a})}}),J0=function(t){Promise&&Promise.resolve||z.warn("This browser does not have Promise support, and can not use the segment integration");var e=function(r,i){r.event.userId||r.event.anonymousId===t.get_distinct_id()||t.reset(),r.event.userId&&r.event.userId!==t.get_distinct_id()&&(t.register({distinct_id:r.event.userId}),t.reloadFeatureFlags());var n=t._calculate_event_properties(i,r.event.properties);return r.event.properties=Object.assign({},n,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(r){return e(r,r.event.event)},page:function(r){return e(r,"$pageview")},identify:function(r){return e(r,"$identify")},screen:function(r){return e(r,"$screen")}}},X0=function(){function t(){var e=this;Re(this,t),Z(this,"_hasSeenPageView",!1),Z(this,"_updateScrollData",function(){var r,i,n,s;e._pageViewData||(e._pageViewData=e._createPageViewData());var a=e._pageViewData,o=e._scrollY(),l=e._scrollHeight(),h=e._contentY(),c=e._contentHeight();a.lastScrollY=o,a.maxScrollY=Math.max(o,(r=a.maxScrollY)!==null&&r!==void 0?r:0),a.maxScrollHeight=Math.max(l,(i=a.maxScrollHeight)!==null&&i!==void 0?i:0),a.lastContentY=h,a.maxContentY=Math.max(h,(n=a.maxContentY)!==null&&n!==void 0?n:0),a.maxContentHeight=Math.max(c,(s=a.maxContentHeight)!==null&&s!==void 0?s:0)})}return Le(t,[{key:"_createPageViewData",value:function(){return{pathname:J.location.pathname}}},{key:"doPageView",value:function(){var e,r;return this._hasSeenPageView?(r=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,r=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),he({$prev_pageview_pathname:(e=r)===null||e===void 0?void 0:e.pathname},this._calculatePrevPageScrollProperties(r))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return he({$prev_pageview_pathname:e?.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||e.maxScrollHeight==null||e.lastScrollY==null||e.maxScrollY==null||e.maxContentHeight==null||e.lastContentY==null||e.maxContentY==null)return{};var r=e.maxScrollHeight,i=e.lastScrollY,n=e.maxScrollY,s=e.maxContentHeight,a=e.lastContentY,o=e.maxContentY;return r=Math.ceil(r),i=Math.ceil(i),n=Math.ceil(n),s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),{$prev_pageview_last_scroll:i,$prev_pageview_last_scroll_percentage:r<=1?1:ba(i/r,0,1),$prev_pageview_max_scroll:n,$prev_pageview_max_scroll_percentage:r<=1?1:ba(n/r,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:s<=1?1:ba(a/s,0,1),$prev_pageview_max_content:o,$prev_pageview_max_content_percentage:s<=1?1:ba(o/s,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){J.addEventListener("scroll",this._updateScrollData),J.addEventListener("scrollend",this._updateScrollData),J.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){J.removeEventListener("scroll",this._updateScrollData),J.removeEventListener("scrollend",this._updateScrollData),J.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return Math.max(0,J.document.documentElement.scrollHeight-J.document.documentElement.clientHeight)}},{key:"_scrollY",value:function(){return J.scrollY||J.pageYOffset||J.document.documentElement.scrollTop||0}},{key:"_contentHeight",value:function(){return J.document.documentElement.scrollHeight||0}},{key:"_contentY",value:function(){var e=J.document.documentElement.clientHeight||0;return this._scrollY()+e}}]),t}();function ba(t,e,r){return Math.max(e,Math.min(t,r))}var Vn,th,We,K0={icontains:function(t){return window.location.href.toLowerCase().indexOf(t.toLowerCase())>-1},regex:function(t){return i0(window.location.href,t)},exact:function(t){return window.location.href===t}},Q0=function(){function t(e){Re(this,t),this.instance=e}return Le(t,[{key:"getSurveys",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(Bl);if(n&&!i)return e(n);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var a,o=s.surveys||[];return(a=r.instance.persistence)===null||a===void 0||a.register(Z({},Bl,o)),e(o)})}},{key:"getActiveMatchingSurveys",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(n){var s=n.filter(function(a){return!(!a.start_date||a.end_date)}).filter(function(a){var o,l,h,c;if(!a.conditions)return!0;var u=(o=a.conditions)===null||o===void 0||!o.url||K0[(l=(h=a.conditions)===null||h===void 0?void 0:h.urlMatchType)!==null&&l!==void 0?l:"icontains"](a.conditions.url),f=(c=a.conditions)===null||c===void 0||!c.selector||document.querySelector(a.conditions.selector);return u&&f}).filter(function(a){if(!a.linked_flag_key&&!a.targeting_flag_key)return!0;var o=!a.linked_flag_key||r.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),l=!a.targeting_flag_key||r.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key);return o&&l});return e(s)},i)}}]),t}(),ey=6e4,ty=function(){function t(){var e=this;Re(this,t),Z(this,"limits",{}),Z(this,"checkForLimiting",function(r){try{var i=r.responseText;if(!i||!i.length)return;(JSON.parse(i).quota_limited||[]).forEach(function(n){z.info("[RateLimiter] ".concat(n||"events"," is quota limited.")),e.limits[n]=new Date().getTime()+ey})}catch(n){return void z.error(n)}})}return Le(t,[{key:"isRateLimited",value:function(e){var r=this.limits[e||"events"]||!1;return r!==!1&&new Date().getTime()<r}}]),t}();(function(t){t[t.INIT_MODULE=0]="INIT_MODULE",t[t.INIT_SNIPPET=1]="INIT_SNIPPET"})(Vn||(Vn={}));var ql=function(){},_a={},ut="posthog",Ea=J.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,gd=!Ea&&ct.indexOf("MSIE")===-1&&ct.indexOf("Mozilla")===-1,Hp=function(){var t,e,r;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=Oe?.location,r=e?.hostname,!!xt(r)&&r.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:ql,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:(J==null||(t=J.location)===null||t===void 0?void 0:t.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(i){var n="Bad HTTP status: "+i.status+" "+i.statusText;z.error(n)},get_device_id:function(i){return i},_onCapture:ql,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},Ul=function(t,e,r,i){var n,s=r!==ut&&We?r?We[r]:void 0:We,a={initComplete:!1,syncCode:!1},o=function(l){return function(h){a[l]||(a[l]=!0,a.initComplete&&a.syncCode&&i?.(h))}};if(s&&th===Vn.INIT_MODULE)n=s;else{if(s&&!Ye(s))return void z.error("You have already initialized "+r);n=new rh}return n._init(t,e,r,o("initComplete")),n.toolbar.maybeLoadToolbar(),n.sessionRecording=new p0(n),n.sessionRecording.startRecordingIfEnabled(),n.webPerformance=new m0(n),n.webPerformance.startObservingIfEnabled(),n.config.__preview_measure_pageview_stats&&n.pageViewManager.startMeasuringScrollPosition(),n.__autocapture=n.config.autocapture,wr._setIsAutocaptureEnabled(n),wr._isAutocaptureEnabled&&(n.__autocapture=n.config.autocapture,wr.enabledForProject(n.config.token,100,100)?wr.isBrowserSupported()?wr.init(n):(n.__autocapture=!1,z.info("Disabling Automatic Event Collection because this browser is not supported")):(n.__autocapture=!1,z.info("Not in active bucket: disabling Automatic Event Collection."))),ti.DEBUG=ti.DEBUG||n.config.debug,!me(s)&&Ye(s)&&(n._execute_array.call(n.people,s.people),n._execute_array(s)),o("syncCode")(n),n},rh=function(){function t(){var e=this;Re(this,t),this.config=Hp(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Y0,this.segmentIntegration=function(){return J0(e)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.featureFlags=new Kg(this),this.toolbar=new w0(this),this.pageViewManager=new X0,this.surveys=new Q0(this),this.rateLimiter=new ty,this.people={set:function(r,i,n){var s=xt(r)?Z({},r,i):r;e.setPersonProperties(s),n?.({})},set_once:function(r,i,n){var s=xt(r)?Z({},r,i):r;e.setPersonProperties(void 0,s),n?.({})}}}return Le(t,[{key:"init",value:function(e,r,i){if(me(i))z.critical("You must name your new library: init(token, config, name)");else{if(i!==ut){var n=Ul(e,r,i,function(s){We[i]=s,s._loaded()});return We[i]=n,n}z.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var r,i,n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var l,h={segmentRegister:!1,syncCode:!1},c=function(_){return function(){h[_]||(h[_]=!0,h.segmentRegister&&h.syncCode&&o?.(n))}};if(this.set_config(Qe({},Hp(),s,{name:a,token:e,callback_fn:(a===ut?a:ut+"."+a)+"._jsc"})),this._jsc=function(){},(J!=null&&(r=J.rrweb)!==null&&r!==void 0&&r.record||J!=null&&J.rrwebRecord)&&(this.__loaded_recorder_version=J==null||(l=J.rrweb)===null||l===void 0?void 0:l.version),this.persistence=new $p(this.config),this._requestQueue=new A0(this._handle_queued_event.bind(this)),this._retryQueue=new j0(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Z0(this.config,this.persistence),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new $p(he(he({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),s.segment?(this.config.get_device_id=function(){return s.segment.user().anonymousId()},s.segment.user().id()&&(this.register({distinct_id:s.segment.user().id()}),this.persistence.set_user_state("identified")),s.segment.register(this.segmentIntegration()).then(c("segmentRegister"))):c("segmentRegister")(),((i=s.bootstrap)===null||i===void 0?void 0:i.distinctID)!==void 0){var u,f,p=this.config.get_device_id(Ui()),m=(u=s.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?p:s.bootstrap.distinctID;this.persistence.set_user_state((f=s.bootstrap)!==null&&f!==void 0&&f.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:m})}if(this._hasBootstrappedFeatureFlags()){var g,d,y=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlags)||{}).filter(function(_){var x,T;return!((x=s.bootstrap)===null||x===void 0||(T=x.featureFlags)===null||T===void 0||!T[_])}).reduce(function(_,x){var T,S;return _[x]=((T=s.bootstrap)===null||T===void 0||(S=T.featureFlags)===null||S===void 0?void 0:S[x])||!1,_},{}),v=Object.keys(((d=s.bootstrap)===null||d===void 0?void 0:d.featureFlagPayloads)||{}).filter(function(_){return y[_]}).reduce(function(_,x){var T,S,w,M;return(T=s.bootstrap)!==null&&T!==void 0&&(S=T.featureFlagPayloads)!==null&&S!==void 0&&S[x]&&(_[x]=(w=s.bootstrap)===null||w===void 0||(M=w.featureFlagPayloads)===null||M===void 0?void 0:M[x]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:v})}if(!this.get_distinct_id()){var b=this.config.get_device_id(Ui());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_user_state("anonymous")}J.addEventListener&&J.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),c("syncCode")()}},{key:"_afterDecideResponse",value:function(e){var r;if(this.compression={},e.supportedCompression&&!this.config.disable_compression){var i,n={},s=ei(e.supportedCompression);try{for(s.s();!(i=s.n()).done;)n[i.value]=!0}catch(a){s.e(a)}finally{s.f()}this.compression=n}(r=e.analytics)!==null&&r!==void 0&&r.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint)}},{key:"_loaded",value:function(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(r){z.critical("`loaded` function failed",r)}this._start_queue_if_opted_in(),this.config.capture_pageview&&this.capture("$pageview",{title:Oe.title},{send_instantly:!0}),e||(new y0(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.poll())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Wi(this.__request_queue,function(r){e._send_request.apply(e,Ml(r))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,r){if(me(e))return null;if(Ea)return function(a){e(a,r)};var i=this._jsc,n=""+Math.floor(1e8*Math.random()),s=this.config.callback_fn+"["+n+"]";return i[n]=function(a){delete i[n],e(a,r)},s}},{key:"_handle_unload",value:function(){var e,r;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(r=this._retryQueue)===null||r===void 0||r.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,r,i){var n=JSON.stringify(r);this.__compress_and_send_json_request(e,n,i||_a,ql)}},{key:"__compress_and_send_json_request",value:function(e,r,i,n){var s=function(h,c,u){return h===Kr.GZipJS?[V0(N0(c),{mtime:0}),he(he({},u),{},{blob:!0,urlQueryArgs:{compression:Kr.GZipJS}})]:[{data:Yl(c)},u]}(this.compression[Kr.GZipJS]?Kr.GZipJS:Kr.Base64,r,i),a=Nn(s,2),o=a[0],l=a[1];this._send_request(e,o,l,n)}},{key:"_send_request",value:function(e,r,i,n){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(i._batchKey))if(gd)this.__request_queue.push([e,r,i,n]);else{var s={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};i=Qe(s,i||{}),Ea||(i.method="GET");var a="sendBeacon"in J.navigator&&i.transport==="sendBeacon";if(e=dd(e,i.urlQueryArgs||{},{ip:this.config.ip}),a)try{J.navigator.sendBeacon(e,eh(r,he(he({},i),{},{sendBeacon:!0})))}catch{}else if(Ea)try{fd({url:e,data:r,headers:this.config.xhr_headers,options:i,callback:n,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(c){z.error(c)}else{var o,l=Oe.createElement("script");l.type="text/javascript",l.async=!0,l.defer=!0,l.src=e;var h=Oe.getElementsByTagName("script")[0];(o=h.parentNode)===null||o===void 0||o.insertBefore(l,h)}}}},{key:"_execute_array",value:function(e){var r,i=this,n=[],s=[],a=[];Wi(e,function(l){l&&(r=l[0],Ye(r)?a.push(l):ri(l)?l.call(i):Ye(l)&&r==="alias"?n.push(l):Ye(l)&&r.indexOf("capture")!==-1&&ri(i[r])?a.push(l):s.push(l))});var o=function(l,h){Wi(l,function(c){if(Ye(c[0])){var u=h;Pe(c,function(f){u=u[f[0]].apply(u,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},h)};o(n,this),o(s,this),o(a,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,r;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((r=this.config.bootstrap)===null||r===void 0?void 0:r.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_a;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return z.uninitializedWarning("posthog.capture");if(!function(c){var u=!1;try{var f=c.config.token,p=c.config.respect_dnt,m=c.config.opt_out_capturing_persistence_type,g=c.config.opt_out_capturing_cookie_prefix||void 0,d=c.config.window;f&&(u=Lp(f,{respectDnt:p,persistenceType:m,persistencePrefix:g,window:d}))}catch(y){z.error("Unexpected error when checking capturing opt-out status: "+y)}return u}(this)){var n=(i=i||_a).transport;if(n&&(i.transport=n),!me(e)&&xt(e)){if(!Yg(ct,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var s={uuid:Ui(),event:e,properties:this._calculate_event_properties(e,r||{})};e==="$identify"&&(s.$set=i.$set,s.$set_once=i.$set_once),(s=Ug(s,i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i.timestamp||new Date;var a=he(he({},s.properties.$set),s.$set);Gg(a)||this.setPersonPropertiesForFlags(a),z.info("send",s);var o=JSON.stringify(s),l=this.config.api_host+(i.endpoint||this.analyticsDefaultEndpoint),h=i!==_a;return!this.config.request_batching||h&&!i._batchKey||i.send_instantly?this.__compress_and_send_json_request(l,o,i):this._requestQueue.enqueue(l,s,i),this._invokeCaptureHooks(e,s),s}}else z.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,r){this.config._onCapture(e,r),Pe(this.__captureHooks,function(i){return i(e)})}},{key:"_calculate_event_properties",value:function(e,r){if(!this.persistence||!this.sessionPersistence)return r;var i=this.persistence.remove_event_timer(e),n=he({},r);if(n.token=this.config.token,e==="$snapshot"){var s=he(he({},this.persistence.properties()),this.sessionPersistence.properties());return n.distinct_id=s.distinct_id,n}var a=Ue.properties();if(this.sessionManager){var o=this.sessionManager.checkAndGetSessionAndWindowId(),l=o.sessionId,h=o.windowId;n.$session_id=l,n.$window_id=h}if(this.config.__preview_measure_pageview_stats){var c={};e==="$pageview"?c=this.pageViewManager.doPageView():e==="$pageleave"&&(c=this.pageViewManager.doPageLeave()),n=Qe(n,c)}if(e==="$pageview"&&(n.title=Oe.title),e==="$performance_event"){var u=this.persistence.properties();return n.distinct_id=u.distinct_id,n.$current_url=a.$current_url,n}if(!me(i)){var f=new Date().getTime()-i;n.$duration=parseFloat((f/1e3).toFixed(3))}n=Qe({},Ue.properties(),this.persistence.properties(),this.sessionPersistence.properties(),n);var p=this.config.property_blacklist;Ye(p)?Pe(p,function(g){delete n[g]}):z.error("Invalid value for property_blacklist config: "+p);var m=this.config.sanitize_properties;return m&&(n=m(n,e)),n}},{key:"register",value:function(e,r){var i;(i=this.persistence)===null||i===void 0||i.register(e,r)}},{key:"register_once",value:function(e,r,i){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,r,i)}},{key:"register_for_session",value:function(e){var r;(r=this.sessionPersistence)===null||r===void 0||r.register(e)}},{key:"unregister",value:function(e){var r;(r=this.persistence)===null||r===void 0||r.unregister(e)}},{key:"unregister_for_session",value:function(e){var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(e)}},{key:"_register_single",value:function(e,r){this.register(Z({},e,r))}},{key:"getFeatureFlag",value:function(e,r){return this.featureFlags.getFeatureFlag(e,r)}},{key:"getFeatureFlagPayload",value:function(e){var r=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(r)}catch{return r}}},{key:"isFeatureEnabled",value:function(e,r){return this.featureFlags.isFeatureEnabled(e,r)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,r)}},{key:"getEarlyAccessFeatures",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,r)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var r,i;return(r=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&r!==void 0?r:function(){}}},{key:"getSurveys",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,r)}},{key:"getActiveMatchingSurveys",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,r)}},{key:"identify",value:function(e,r,i){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(e){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(xa)&&(this.unregister(xa),this.register({distinct_id:e}));var a=this.persistence.get_user_state()==="anonymous";e!==n&&a?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(r||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:r||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(n)):(r||i)&&this.setPersonProperties(r,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(Ia))}else z.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,r){(e||r)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:r||{}}))}},{key:"group",value:function(e,r,i){if(e&&r){var n=this.getGroups();n[e]!==r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:he(he({},n),{},Z({},e,r))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:r,$group_set:i}),this.setGroupPropertiesForFlags(Z({},e,i))),n[e]===r||i||this.reloadFeatureFlags()}else z.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,r)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,r)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var r,i,n,s;if(!this.__loaded)return z.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");(r=this.persistence)===null||r===void 0||r.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(n=this.persistence)===null||n===void 0||n.set_user_state("anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var o=this.config.get_device_id(Ui());this.register_once({distinct_id:o,$device_id:e?o:a},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,r;return(e=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var r=this.config.ui_host||this.config.api_host,i=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=i.sessionId,s=i.sessionStartTimestamp,a=r+"/replay/"+n;if(e!=null&&e.withTimestamp&&s){var o,l=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!s)return a;var h=Math.max(Math.floor((new Date().getTime()-s)/1e3)-l,0);a+="?t=".concat(h)}return a}},{key:"alias",value:function(e,r){return e===this.get_property(id)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):(me(r)&&(r=this.get_distinct_id()),e!==r?(this._register_single(xa,e),this.capture("$create_alias",{alias:e,distinct_id:r})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var r,i,n=he({},this.config);xr(e)&&(Qe(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),(r=this.persistence)===null||r===void 0||r.update_config(this.config),(i=this.sessionPersistence)===null||i===void 0||i.update_config(this.config),$e.is_supported()&&$e.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(ti.DEBUG=!0),this.sessionRecording&&!me(e.disable_session_recording)&&n.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var r;return(r=this.persistence)===null||r===void 0?void 0:r.props[e]}},{key:"getSessionProperty",value:function(e){var r;return(r=this.sessionPersistence)===null||r===void 0?void 0:r.props[e]}},{key:"toString",value:function(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:ut;return r!==ut&&(r=ut+"."+r),r}},{key:"_gdpr_init",value:function(){this.config.opt_out_capturing_persistence_type==="localStorage"&&$e.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!or.get("ph_optout")||(or.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var r,i,n,s,a;if(e&&e.clear_persistence)n=!0;else{if(!e||!e.enable_persistence)return;n=!1}this.config.disable_persistence||((r=this.persistence)===null||r===void 0?void 0:r.disabled)===n||(s=this.persistence)===null||s===void 0||s.set_disabled(n),this.config.disable_persistence||((i=this.sessionPersistence)===null||i===void 0?void 0:i.disabled)===n||(a=this.sessionPersistence)===null||a===void 0||a.set_disabled(n)}},{key:"_gdpr_call_func",value:function(e,r){return r=Qe({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},r||{}),$e.is_supported()||r.persistence_type!=="localStorage"||(r.persistence_type="cookie"),e(this.config.token,{capture:r.capture,captureEventName:r.capture_event_name,captureProperties:r.capture_properties,persistenceType:r.persistence_type,persistencePrefix:r.cookie_prefix,cookieExpiration:r.cookie_expiration,crossSubdomainCookie:r.cross_subdomain_cookie,secureCookie:r.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=Qe({enable_persistence:!0},e||{}),this._gdpr_call_func(S0,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var r=Qe({clear_persistence:!0},e||{});this._gdpr_call_func(k0,r),this._gdpr_update_persistence(r)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(E0,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Lp,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var r=Qe({enable_persistence:!0},e??{});this._gdpr_call_func(P0,r),this._gdpr_update_persistence(r)}},{key:"debug",value:function(e){e===!1?(J.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(J.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),t}();(function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=Qp(t.prototype[e[r]])})(rh,["identify"]);var qp,Up,br={},ry=function(){We.init=function(t,e,r){if(r)return We[r]||(We[r]=br[r]=Ul(t||"",e||{},r,function(n){We[r]=br[r]=n,n._loaded()})),We[r];var i=We;return br[ut]?i=br[ut]:t&&(i=Ul(t,e||{},ut,function(n){br[ut]=n,n._loaded()}),br[ut]=i),We=i,th===Vn.INIT_SNIPPET&&(J[ut]=We),Pe(br,function(n,s){s!==ut&&(We[s]=n)}),i}},iy=function(){function t(){t.done||(t.done=!0,gd=!1,Pe(br,function(e){e._dom_loaded()}))}Oe.addEventListener&&(Oe.readyState==="complete"?t():Oe.addEventListener("DOMContentLoaded",t,!1)),Rn(J,"load",t,!0)};(function(t){t.Popover="popover",t.API="api"})(qp||(qp={})),function(t){t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link"}(Up||(Up={}));var yd=(th=Vn.INIT_MODULE,We=new rh,ry(),We.init(),iy(),We);var vd=yd.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://ph-eu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!0,disable_session_recording:!0},"MolinShopAI");function pt(t,e){if(!vd)throw new Error("Failed to initialize PostHog");vd.capture(t,e)}var Yi,$a,Dt,Be,Ra,bd,La,_d,Ba,wd,Va,xd,Na,Sd,za,kd,ja,Ed,Ga,Pd,Oa=class extends De(Ae){constructor(){super();ee(this,Yi);ee(this,Ra);ee(this,La);ee(this,Ba);ee(this,Va);ee(this,Na);ee(this,za);ee(this,ja);ee(this,Ga);ee(this,Dt,new fa(this,{url:(r,{resume:i}={})=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("resume",i?"1":""),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r),pt("ShopAssistant: error",{widgetId:this.widgetId,error:"websocket onError"})},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&pt("ShopAssistant: user received bot message (streaming started)",{widgetId:this.widgetId,message:r})},onUpdateMessage:r=>{},onMessageDone:r=>{let i={...N(this,Dt)?.messages.find(n=>n.id===r.message?.id)};Object.assign(i,r.message),i.role==="assistant"&&pt("ShopAssistant: user received bot message (streaming ended)",{widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION})},onMessageError:r=>{console.error("ws message error",r),r.message&&N(this,Be)&&alert(r.message),pt("ShopAssistant: error",{widgetId:this.widgetId,error:"websocket ERROR message type: "+r.message})},persistConversationState:(r,i)=>{let n={conversationId:r,messages:i};localStorage.setItem(N(this,Yi,$a),JSON.stringify(n))},restoreConversationState:()=>{try{let r=JSON.parse(localStorage.getItem(N(this,Yi,$a))||"{}");return!(typeof r.conversationId=="string"&&r.conversationId)||!(Array.isArray(r.messages)&&r.messages.every(i=>typeof i=="object"&&i))?void 0:{conversationId:r.conversationId,messages:r.messages}}catch(r){console.error(r)}},onReset:()=>{localStorage.removeItem(N(this,Yi,$a))}}));ee(this,Be,!1);this.widgetId="",this.config}render(){console.assert(this.widgetId,"widget id is required"),console.assert(this.config,"config is required");let r=Object.entries(this.config.bubble.position).filter(([a,o])=>o).map(([a,o])=>`${a}-[${o}]`).reduce((a,o)=>(a[o]=!0,a),{}),i={bottom:"72px"},n=Object.entries(this.config.bubble.position).filter(([a,o])=>o).map(([a,o])=>`sm:${a}-[calc(${[i[a],o].filter(l=>!!l).join("+")})]`).reduce((a,o)=>(a[o]=!0,a),{}),s=n;return pe`
|
|
431
431
|
<mw-bubble class="${yp(r)} fixed z-[99999999]" @click=${ce(this,Va,xd)} ?dialog-shown="${N(this,Be)}" bubble-image-url="${this.config.bubble?.imageUrl||""}"></mw-bubble>
|
|
432
432
|
|
|
433
433
|
${this.config.popup?.enabled?pe`
|
|
@@ -442,6 +442,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
442
442
|
<!-- this structure of 2 divs is required for the native scroll to bottom -->
|
|
443
443
|
<div class="flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto bg-[#FDFDFD] pt-4">
|
|
444
444
|
<!-- this is the 2nd (inner) div that will natively scroll to bottom -->
|
|
445
|
+
${this.config?.showStillLearningBanner?pe`
|
|
446
|
+
<div class="flex justify-center">
|
|
447
|
+
<div class="mb-2 flex w-1/2 items-center justify-center rounded-full bg-black p-3">
|
|
448
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6">
|
|
449
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75C6.61522 21.75 2.25 17.3848 2.25 12ZM10.9562 10.5584C12.1025 9.98533 13.3931 11.0206 13.0823 12.2639L12.3733 15.0999L12.4148 15.0792C12.7852 14.894 13.2357 15.0441 13.421 15.4146C13.6062 15.7851 13.4561 16.2356 13.0856 16.4208L13.0441 16.4416C11.8979 17.0147 10.6072 15.9794 10.9181 14.7361L11.6271 11.9001L11.5856 11.9208C11.2151 12.1061 10.7646 11.9559 10.5793 11.5854C10.3941 11.2149 10.5443 10.7644 10.9148 10.5792L10.9562 10.5584ZM12 9C12.4142 9 12.75 8.66421 12.75 8.25C12.75 7.83579 12.4142 7.5 12 7.5C11.5858 7.5 11.25 7.83579 11.25 8.25C11.25 8.66421 11.5858 9 12 9Z" fill="white" />
|
|
450
|
+
</svg>
|
|
451
|
+
|
|
452
|
+
<span class="ml-2 text-sm text-white">I'm still learning!</span>
|
|
453
|
+
</div>
|
|
454
|
+
</div>
|
|
455
|
+
`:""}
|
|
456
|
+
|
|
445
457
|
<div class="">
|
|
446
458
|
${sn(N(this,Dt)?.messages??[],a=>a.id,a=>pe`
|
|
447
459
|
<mw-chat-message class="mx-4 mb-4 block" .config="${this.config}" side="${a.role}" @click="${ce(this,Ra,bd)}">
|
|
@@ -451,7 +463,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
451
463
|
</mw-chat-message>
|
|
452
464
|
`)}
|
|
453
465
|
</div>
|
|
454
|
-
|
|
455
466
|
<!-- chat background (show/hide display logic is handled inside depending on message count) -->
|
|
456
467
|
<mw-background class="mx-auto max-w-sm flex-grow" messages="${N(this,Dt)?.messages?.length??0}" .config="${this.config}" @mw-example-click="${ce(this,Ba,wd)}"></mw-background>
|
|
457
468
|
</div>
|