@gram-ai/elements 1.22.2 → 1.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@ Error message: ${uo(r)}`,cause:r}),this[hy]=!0,this.value=t}static isInstance(t)
26
26
 
27
27
  `)}m.write("payload.value = newResult;"),m.write("return payload;");const w=m.compile();return(x,v)=>w(f,x,v)};let i;const a=Gn,s=!Ja.jitless,l=s&&by.value,u=t.catchall;let d;e._zod.parse=(f,m)=>{d??(d=o.value);const g=f.value;return a(g)?s&&l&&m?.async===!1&&m.jitless!==!0?(i||(i=n(t.shape)),f=i(f,m),u?T_([],g,f,m,d,e):f):r(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function Wp(e,t,r,o){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const n=e.filter(i=>!Kr(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>At(a,o,Xe())))}),t)}const Ms=T("$ZodUnion",(e,t)=>{Y.init(e,t),de(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),de(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),de(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),de(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Ps(i.source)).join("|")})$`)}});const r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let a=!1;const s=[];for(const c of t.options){const l=c._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}return a?Promise.all(s).then(c=>Wp(c,n,e,i)):Wp(s,n,e,i)}});function Jp(e,t,r,o){const n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>At(a,o,Xe())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}const A_=T("$ZodXor",(e,t)=>{Ms.init(e,t),t.inclusive=!1;const r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let a=!1;const s=[];for(const c of t.options){const l=c._zod.run({value:n.value,issues:[]},i);l instanceof Promise?(s.push(l),a=!0):s.push(l)}return a?Promise.all(s).then(c=>Jp(c,n,e,i)):Jp(s,n,e,i)}}),C_=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ms.init(e,t);const r=e._zod.parse;de(e._zod,"propValues",()=>{const n={};for(const i of t.options){const a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[s,c]of Object.entries(a)){n[s]||(n[s]=new Set);for(const l of c)n[s].add(l)}}return n});const o=xi(()=>{const n=t.options,i=new Map;for(const a of n){const s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const c of s){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(n,i)=>{const a=n.value;if(!Gn(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;const s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),n)}}),N_=T("$ZodIntersection",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>{const n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,l])=>Kp(r,c,l)):Kp(r,i,a)}});function Su(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(nn(e)&&nn(t)){const r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(const i of o){const a=Su(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const n=e[o],i=t[o],a=Su(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Kp(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Kr(e))return e;const o=Su(t.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Vd=T("$ZodTuple",(e,t)=>{Y.init(e,t);const r=t.items;e._zod.parse=(o,n)=>{const i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];const a=[],s=[...r].reverse().findIndex(u=>u._zod.optin!=="optional"),c=s===-1?0:r.length-s;if(!t.rest){const u=i.length>r.length,d=i.length<c-1;if(u||d)return o.issues.push({...u?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},input:i,inst:e,origin:"array"}),o}let l=-1;for(const u of r){if(l++,l>=i.length&&l>=c)continue;const d=u._zod.run({value:i[l],issues:[]},n);d instanceof Promise?a.push(d.then(f=>fa(f,o,l))):fa(d,o,l)}if(t.rest){const u=i.slice(r.length);for(const d of u){l++;const f=t.rest._zod.run({value:d,issues:[]},n);f instanceof Promise?a.push(f.then(m=>fa(m,o,l))):fa(f,o,l)}}return a.length?Promise.all(a).then(()=>o):o}});function fa(e,t,r){e.issues.length&&t.issues.push(...Ft(r,e.issues)),t.value[r]=e.value}const R_=T("$ZodRecord",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!nn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;const i=[],a=t.keyType._zod.values;if(a){r.value={};const s=new Set;for(const l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);const u=t.valueType._zod.run({value:n[l],issues:[]},o);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&r.issues.push(...Ft(l,d.issues)),r.value[l]=d.value})):(u.issues.length&&r.issues.push(...Ft(l,u.issues)),r.value[l]=u.value)}let c;for(const l in n)s.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(const s of Reflect.ownKeys(n)){if(s==="__proto__")continue;const c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(u=>At(u,o,Xe())),input:s,path:[s],inst:e});continue}const l=t.valueType._zod.run({value:n[s],issues:[]},o);l instanceof Promise?i.push(l.then(u=>{u.issues.length&&r.issues.push(...Ft(s,u.issues)),r.value[c.value]=u.value})):(l.issues.length&&r.issues.push(...Ft(s,l.issues)),r.value[c.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),P_=T("$ZodMap",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;const i=[];r.value=new Map;for(const[a,s]of n){const c=t.keyType._zod.run({value:a,issues:[]},o),l=t.valueType._zod.run({value:s,issues:[]},o);c instanceof Promise||l instanceof Promise?i.push(Promise.all([c,l]).then(([u,d])=>{Yp(u,d,r,a,n,e,o)})):Yp(c,l,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Yp(e,t,r,o,n,i,a){e.issues.length&&(Ya.has(typeof o)?r.issues.push(...Ft(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>At(s,a,Xe()))})),t.issues.length&&(Ya.has(typeof o)?r.issues.push(...Ft(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>At(s,a,Xe()))})),r.value.set(e.value,t.value)}const j_=T("$ZodSet",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;const i=[];r.value=new Set;for(const a of n){const s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(c=>Xp(c,r))):Xp(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function Xp(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const D_=T("$ZodEnum",(e,t)=>{Y.init(e,t);const r=wd(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Ya.has(typeof n)).map(n=>typeof n=="string"?fr(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{const a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),z_=T("$ZodLiteral",(e,t)=>{if(Y.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?fr(o):o?fr(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),M_=T("$ZodFile",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),U_=T("$ZodTransform",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Rs(e.constructor.name);const n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new tn;return r.value=n,r}});function Qp(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const L_=T("$ZodOptional",(e,t)=>{Y.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),de(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ps(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Qp(i,r.value)):Qp(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),F_=T("$ZodNullable",(e,t)=>{Y.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ps(r.source)}|null)$`):void 0}),de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),V_=T("$ZodDefault",(e,t)=>{Y.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>eh(i,t)):eh(n,t)}});function eh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Z_=T("$ZodPrefault",(e,t)=>{Y.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),B_=T("$ZodNonOptional",(e,t)=>{Y.init(e,t),de(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>th(i,e)):th(n,e)}});function th(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const q_=T("$ZodSuccess",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Rs("ZodSuccess");const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),G_=T("$ZodCatch",(e,t)=>{Y.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>At(a,o,Xe()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>At(i,o,Xe()))},input:r.value}),r.issues=[]),r)}}),H_=T("$ZodNaN",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),W_=T("$ZodPipe",(e,t)=>{Y.init(e,t),de(e._zod,"values",()=>t.in._zod.values),de(e._zod,"optin",()=>t.in._zod.optin),de(e._zod,"optout",()=>t.out._zod.optout),de(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>ma(a,t.in,o)):ma(i,t.in,o)}const n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>ma(i,t.out,o)):ma(n,t.out,o)}});function ma(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Zd=T("$ZodCodec",(e,t)=>{Y.init(e,t),de(e._zod,"values",()=>t.in._zod.values),de(e._zod,"optin",()=>t.in._zod.optin),de(e._zod,"optout",()=>t.out._zod.optout),de(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){const i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>pa(a,t,o)):pa(i,t,o)}else{const i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>pa(a,t,o)):pa(i,t,o)}}});function pa(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){const n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>ha(e,i,t.out,r)):ha(e,n,t.out,r)}else{const n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>ha(e,i,t.in,r)):ha(e,n,t.in,r)}}function ha(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}const J_=T("$ZodReadonly",(e,t)=>{Y.init(e,t),de(e._zod,"propValues",()=>t.innerType._zod.propValues),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"optin",()=>t.innerType?._zod?.optin),de(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(rh):rh(n)}});function rh(e){return e.value=Object.freeze(e.value),e}const K_=T("$ZodTemplateLiteral",(e,t)=>{Y.init(e,t);const r=[];for(const o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);const n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);const i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||_y.has(typeof o))r.push(fr(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Y_=T("$ZodFunction",(e,t)=>(Y.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){const n=e._def.input?wu(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?wu(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){const n=e._def.input?await xu(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await xu(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{const o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Vd({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{const o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),X_=T("$ZodPromise",(e,t)=>{Y.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Q_=T("$ZodLazy",(e,t)=>{Y.init(e,t),de(e._zod,"innerType",()=>t.getter()),de(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),de(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),de(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),de(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),ew=T("$ZodCustom",(e,t)=>{Ae.init(e,t),Y.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>nh(i,r,o,e));nh(n,r,o,e)}});function nh(e,t,r,o){if(!e){const n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Hn(n))}}const AA=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return n=>{switch(n.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${n.expected}، ولكن تم إدخال ${r(n.input)}`;case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${J(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${i} ${n.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${i} ${n.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:i.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`:i.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`:i.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`:`${o[i.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${R(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function CA(){return{localeError:AA()}}const NA=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${J(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Çox kiçik: gözlənilən ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`:i.format==="ends_with"?`Yanlış mətn: "${i.suffix}" ilə bitməlidir`:i.format==="includes"?`Yanlış mətn: "${i.includes}" daxil olmalıdır`:i.format==="regex"?`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${o[i.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${R(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function RA(){return{localeError:NA()}}function oh(e,t,r,o){const n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}const PA=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"лік";case"object":{if(Array.isArray(n))return"масіў";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return n=>{switch(n.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${n.expected}, атрымана ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Няправільны ўвод: чакалася ${J(n.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);if(a){const s=Number(n.maximum),c=oh(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${a.verb} ${i}${n.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);if(a){const s=Number(n.minimum),c=oh(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${a.verb} ${i}${n.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${i.prefix}"`:i.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${i.suffix}"`:i.format==="includes"?`Няправільны радок: павінен змяшчаць "${i.includes}"`:i.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`:`Няправільны ${o[i.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${R(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function jA(){return{localeError:PA()}}const DA=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"число";case"object":{if(Array.isArray(e))return"масив";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},zA=()=>{const e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(o){return e[o]??null}const r={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return o=>{switch(o.code){case"invalid_type":return`Невалиден вход: очакван ${o.expected}, получен ${DA(o.input)}`;case"invalid_value":return o.values.length===1?`Невалиден вход: очакван ${J(o.values[0])}`:`Невалидна опция: очаквано едно от ${R(o.values,"|")}`;case"too_big":{const n=o.inclusive?"<=":"<",i=t(o.origin);return i?`Твърде голямо: очаква се ${o.origin??"стойност"} да съдържа ${n}${o.maximum.toString()} ${i.unit??"елемента"}`:`Твърде голямо: очаква се ${o.origin??"стойност"} да бъде ${n}${o.maximum.toString()}`}case"too_small":{const n=o.inclusive?">=":">",i=t(o.origin);return i?`Твърде малко: очаква се ${o.origin} да съдържа ${n}${o.minimum.toString()} ${i.unit}`:`Твърде малко: очаква се ${o.origin} да бъде ${n}${o.minimum.toString()}`}case"invalid_format":{const n=o;if(n.format==="starts_with")return`Невалиден низ: трябва да започва с "${n.prefix}"`;if(n.format==="ends_with")return`Невалиден низ: трябва да завършва с "${n.suffix}"`;if(n.format==="includes")return`Невалиден низ: трябва да включва "${n.includes}"`;if(n.format==="regex")return`Невалиден низ: трябва да съвпада с ${n.pattern}`;let i="Невалиден";return n.format==="emoji"&&(i="Невалидно"),n.format==="datetime"&&(i="Невалидно"),n.format==="date"&&(i="Невалидна"),n.format==="time"&&(i="Невалидно"),n.format==="duration"&&(i="Невалидна"),`${i} ${r[n.format]??o.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${o.divisor}`;case"unrecognized_keys":return`Неразпознат${o.keys.length>1?"и":""} ключ${o.keys.length>1?"ове":""}: ${R(o.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${o.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${o.origin}`;default:return"Невалиден вход"}}};function MA(){return{localeError:zA()}}const UA=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus invàlid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${J(n.values[0])}`:`Opció invàlida: s'esperava una de ${R(n.values," o ")}`;case"too_big":{const i=n.inclusive?"com a màxim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?"com a mínim":"més de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingués ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Format invàlid: ha de començar amb "${i.prefix}"`:i.format==="ends_with"?`Format invàlid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format invàlid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${i.pattern}`:`Format invàlid per a ${o[i.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${R(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function LA(){return{localeError:UA()}}const FA=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatný vstup: očekáváno ${n.expected}, obdrženo ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${J(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${i}${n.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${i}${n.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Neplatný řetězec: musí začínat na "${i.prefix}"`:i.format==="ends_with"?`Neplatný řetězec: musí končit na "${i.suffix}"`:i.format==="includes"?`Neplatný řetězec: musí obsahovat "${i.includes}"`:i.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`:`Neplatný formát ${o[i.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${R(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function VA(){return{localeError:FA()}}const ZA=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function r(a){return e[a]??null}function o(a){return t[a]??a}const n=a=>{const s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return s},i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${o(a.expected)}, fik ${o(n(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig værdi: forventede ${J(a.values[0])}`:`Ugyldigt valg: forventede en af følgende ${R(a.values,"|")}`;case"too_big":{const s=a.inclusive?"<=":"<",c=r(a.origin),l=o(a.origin);return c?`For stor: forventede ${l??"value"} ${c.verb} ${s} ${a.maximum.toString()} ${c.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${s} ${a.maximum.toString()}`}case"too_small":{const s=a.inclusive?">=":">",c=r(a.origin),l=o(a.origin);return c?`For lille: forventede ${l} ${c.verb} ${s} ${a.minimum.toString()} ${c.unit}`:`For lille: forventede ${l} havde ${s} ${a.minimum.toString()}`}case"invalid_format":{const s=a;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche mønsteret ${s.pattern}`:`Ugyldig ${i[s.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${R(a.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${a.origin}`;default:return"Ugyldigt input"}}};function BA(){return{localeError:ZA()}}const qA=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{switch(n.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${J(n.values[0])}`:`Ungültige Option: erwartet eine von ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ungültiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ungültiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ungültiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`:`Ungültig: ${o[i.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${R(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function GA(){return{localeError:qA()}}const HA=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},WA=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${HA(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${J(o.values[0])}`:`Invalid option: expected one of ${R(o.values,"|")}`;case"too_big":{const n=o.inclusive?"<=":"<",i=t(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${n}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${n}${o.maximum.toString()}`}case"too_small":{const n=o.inclusive?">=":">",i=t(o.origin);return i?`Too small: expected ${o.origin} to have ${n}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${n}${o.minimum.toString()}`}case"invalid_format":{const n=o;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${r[n.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${R(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function tw(){return{localeError:WA()}}const JA=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},KA=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}const r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${o.expected}, riceviĝis ${JA(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendiĝis ${J(o.values[0])}`:`Nevalida opcio: atendiĝis unu el ${R(o.values,"|")}`;case"too_big":{const n=o.inclusive?"<=":"<",i=t(o.origin);return i?`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${n}${o.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${n}${o.maximum.toString()}`}case"too_small":{const n=o.inclusive?">=":">",i=t(o.origin);return i?`Tro malgranda: atendiĝis ke ${o.origin} havu ${n}${o.minimum.toString()} ${i.unit}`:`Tro malgranda: atendiĝis ke ${o.origin} estu ${n}${o.minimum.toString()}`}case"invalid_format":{const n=o;return n.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${n.prefix}"`:n.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${n.suffix}"`:n.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${n.includes}"`:n.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`:`Nevalida ${r[n.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} ŝlosilo${o.keys.length>1?"j":""}: ${R(o.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function YA(){return{localeError:KA()}}const XA=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function r(a){return e[a]??null}function o(a){return t[a]??a}const n=a=>{const s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return s},i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return a=>{switch(a.code){case"invalid_type":return`Entrada inválida: se esperaba ${o(a.expected)}, recibido ${o(n(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inválida: se esperaba ${J(a.values[0])}`:`Opción inválida: se esperaba una de ${R(a.values,"|")}`;case"too_big":{const s=a.inclusive?"<=":"<",c=r(a.origin),l=o(a.origin);return c?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${s}${a.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${s}${a.maximum.toString()}`}case"too_small":{const s=a.inclusive?">=":">",c=r(a.origin),l=o(a.origin);return c?`Demasiado pequeño: se esperaba que ${l} tuviera ${s}${a.minimum.toString()} ${c.unit}`:`Demasiado pequeño: se esperaba que ${l} fuera ${s}${a.minimum.toString()}`}case"invalid_format":{const s=a;return s.format==="starts_with"?`Cadena inválida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inválida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inválida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${s.pattern}`:`Inválido ${i[s.format]??a.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${R(a.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o(a.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o(a.origin)}`;default:return"Entrada inválida"}}};function QA(){return{localeError:XA()}}const eC=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"آرایه";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return n=>{switch(n.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${n.expected} می‌بود، ${r(n.input)} دریافت شد`;case"invalid_value":return n.values.length===1?`ورودی نامعتبر: می‌بایست ${J(n.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${R(n.values,"|")} می‌بود`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${i}${n.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${i}${n.maximum.toString()} باشد`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`خیلی کوچک: ${n.origin} باید ${i}${n.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${i}${n.minimum.toString()} باشد`}case"invalid_format":{const i=n;return i.format==="starts_with"?`رشته نامعتبر: باید با "${i.prefix}" شروع شود`:i.format==="ends_with"?`رشته نامعتبر: باید با "${i.suffix}" تمام شود`:i.format==="includes"?`رشته نامعتبر: باید شامل "${i.includes}" باشد`:i.format==="regex"?`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`:`${o[i.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${R(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function tC(){return{localeError:eC()}}const rC=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${J(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen syöte: täytyy sisältää "${i.includes}"`:i.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`:`Virheellinen ${o[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${R(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function nC(){return{localeError:rC()}}const oC=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return n=>{switch(n.code){case"invalid_type":return`Entrée invalide : ${n.expected} attendu, ${r(n.input)} reçu`;case"invalid_value":return n.values.length===1?`Entrée invalide : ${J(n.values[0])} attendu`:`Option invalide : une valeur parmi ${R(n.values,"|")} attendue`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${n.origin??"valeur"} doit être ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit être ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Chaîne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Chaîne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Chaîne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${i.pattern}`:`${o[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${R(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function iC(){return{localeError:oC()}}const aC=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return n=>{switch(n.code){case"invalid_type":return`Entrée invalide : attendu ${n.expected}, reçu ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${J(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"≤":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?"≥":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Chaîne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Chaîne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Chaîne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Chaîne invalide : doit correspondre au motif ${i.pattern}`:`${o[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${R(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function sC(){return{localeError:aC()}}const cC=()=>{const e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},r=l=>l?e[l]:void 0,o=l=>{const u=r(l);return u?u.label:l??e.unknown.label},n=l=>`ה${o(l)}`,i=l=>(r(l)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",a=l=>l?t[l]??null:null,s=l=>{const u=typeof l;switch(u){case"number":return Number.isNaN(l)?"NaN":"number";case"object":return Array.isArray(l)?"array":l===null?"null":Object.getPrototypeOf(l)!==Object.prototype&&l.constructor?l.constructor.name:"object";default:return u}},c={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return l=>{switch(l.code){case"invalid_type":{const u=l.expected,d=o(u),f=s(l.input),m=e[f]?.label??f;return`קלט לא תקין: צריך להיות ${d}, התקבל ${m}`}case"invalid_value":{if(l.values.length===1)return`ערך לא תקין: הערך חייב להיות ${J(l.values[0])}`;const u=l.values.map(m=>J(m));if(l.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${u[0]} או ${u[1]}`;const d=u[u.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${u.slice(0,-1).join(", ")} או ${d}`}case"too_big":{const u=a(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"ארוך"} מדי: ${d} צריכה להכיל ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"או פחות":"לכל היותר"}`.trim();if(l.origin==="number"){const g=l.inclusive?`קטן או שווה ל-${l.maximum}`:`קטן מ-${l.maximum}`;return`גדול מדי: ${d} צריך להיות ${g}`}if(l.origin==="array"||l.origin==="set"){const g=l.origin==="set"?"צריכה":"צריך",h=l.inclusive?`${l.maximum} ${u?.unit??""} או פחות`:`פחות מ-${l.maximum} ${u?.unit??""}`;return`גדול מדי: ${d} ${g} להכיל ${h}`.trim()}const f=l.inclusive?"<=":"<",m=i(l.origin??"value");return u?.unit?`${u.longLabel} מדי: ${d} ${m} ${f}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"גדול"} מדי: ${d} ${m} ${f}${l.maximum.toString()}`}case"too_small":{const u=a(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"קצר"} מדי: ${d} צריכה להכיל ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"או יותר":"לפחות"}`.trim();if(l.origin==="number"){const g=l.inclusive?`גדול או שווה ל-${l.minimum}`:`גדול מ-${l.minimum}`;return`קטן מדי: ${d} צריך להיות ${g}`}if(l.origin==="array"||l.origin==="set"){const g=l.origin==="set"?"צריכה":"צריך";if(l.minimum===1&&l.inclusive){const y=(l.origin==="set","לפחות פריט אחד");return`קטן מדי: ${d} ${g} להכיל ${y}`}const h=l.inclusive?`${l.minimum} ${u?.unit??""} או יותר`:`יותר מ-${l.minimum} ${u?.unit??""}`;return`קטן מדי: ${d} ${g} להכיל ${h}`.trim()}const f=l.inclusive?">=":">",m=i(l.origin??"value");return u?.unit?`${u.shortLabel} מדי: ${d} ${m} ${f}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"קטן"} מדי: ${d} ${m} ${f}${l.minimum.toString()}`}case"invalid_format":{const u=l;if(u.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${u.prefix}"`;if(u.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${u.suffix}"`;if(u.format==="includes")return`המחרוזת חייבת לכלול "${u.includes}"`;if(u.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${u.pattern}`;const d=c[u.format],f=d?.label??u.format,g=(d?.gender??"m")==="f"?"תקינה":"תקין";return`${f} לא ${g}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${l.divisor}`;case"unrecognized_keys":return`מפתח${l.keys.length>1?"ות":""} לא מזוה${l.keys.length>1?"ים":"ה"}: ${R(l.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(l.origin??"array")}`;default:return"קלט לא תקין"}}};function lC(){return{localeError:cC()}}const uC=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"szám";case"object":{if(Array.isArray(n))return"tömb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${n.expected}, a kapott érték ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${J(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`:i.format==="ends_with"?`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`:i.format==="includes"?`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`:i.format==="regex"?`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`:`Érvénytelen ${o[i.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${R(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function dC(){return{localeError:uC()}}const fC=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${J(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${o[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${R(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function mC(){return{localeError:fC()}}const pC=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},hC=()=>{const e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(o){return e[o]??null}const r={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return o=>{switch(o.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${pC(o.input)} þar sem á að vera ${o.expected}`;case"invalid_value":return o.values.length===1?`Rangt gildi: gert ráð fyrir ${J(o.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${R(o.values,"|")}`;case"too_big":{const n=o.inclusive?"<=":"<",i=t(o.origin);return i?`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} hafi ${n}${o.maximum.toString()} ${i.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} sé ${n}${o.maximum.toString()}`}case"too_small":{const n=o.inclusive?">=":">",i=t(o.origin);return i?`Of lítið: gert er ráð fyrir að ${o.origin} hafi ${n}${o.minimum.toString()} ${i.unit}`:`Of lítið: gert er ráð fyrir að ${o.origin} sé ${n}${o.minimum.toString()}`}case"invalid_format":{const n=o;return n.format==="starts_with"?`Ógildur strengur: verður að byrja á "${n.prefix}"`:n.format==="ends_with"?`Ógildur strengur: verður að enda á "${n.suffix}"`:n.format==="includes"?`Ógildur strengur: verður að innihalda "${n.includes}"`:n.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${n.pattern}`:`Rangt ${r[n.format]??o.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`Óþekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${R(o.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${o.origin}`;default:return"Rangt gildi"}}};function gC(){return{localeError:hC()}}const vC=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${J(n.values[0])}`:`Opzione non valida: atteso uno tra ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${o[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${R(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function yC(){return{localeError:vC()}}const bC=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"数値";case"object":{if(Array.isArray(n))return"配列";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return n=>{switch(n.code){case"invalid_type":return`無効な入力: ${n.expected}が期待されましたが、${r(n.input)}が入力されました`;case"invalid_value":return n.values.length===1?`無効な入力: ${J(n.values[0])}が期待されました`:`無効な選択: ${R(n.values,"、")}のいずれかである必要があります`;case"too_big":{const i=n.inclusive?"以下である":"より小さい",a=t(n.origin);return a?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${a.unit??"要素"}${i}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${i}必要があります`}case"too_small":{const i=n.inclusive?"以上である":"より大きい",a=t(n.origin);return a?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${a.unit}${i}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${i}必要があります`}case"invalid_format":{const i=n;return i.format==="starts_with"?`無効な文字列: "${i.prefix}"で始まる必要があります`:i.format==="ends_with"?`無効な文字列: "${i.suffix}"で終わる必要があります`:i.format==="includes"?`無効な文字列: "${i.includes}"を含む必要があります`:i.format==="regex"?`無効な文字列: パターン${i.pattern}に一致する必要があります`:`無効な${o[i.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${R(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function _C(){return{localeError:bC()}}const wC=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[t]??t},xC=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(o){return e[o]??null}const r={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return o=>{switch(o.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${o.expected}, მიღებული ${wC(o.input)}`;case"invalid_value":return o.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${J(o.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${R(o.values,"|")}-დან`;case"too_big":{const n=o.inclusive?"<=":"<",i=t(o.origin);return i?`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} ${i.verb} ${n}${o.maximum.toString()} ${i.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} იყოს ${n}${o.maximum.toString()}`}case"too_small":{const n=o.inclusive?">=":">",i=t(o.origin);return i?`ზედმეტად პატარა: მოსალოდნელი ${o.origin} ${i.verb} ${n}${o.minimum.toString()} ${i.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${o.origin} იყოს ${n}${o.minimum.toString()}`}case"invalid_format":{const n=o;return n.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${n.prefix}"-ით`:n.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${n.suffix}"-ით`:n.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${n.includes}"-ს`:n.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${n.pattern}`:`არასწორი ${r[n.format]??o.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${o.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${o.keys.length>1?"ები":"ი"}: ${R(o.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${o.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${o.origin}-ში`;default:return"არასწორი შეყვანა"}}};function SC(){return{localeError:xC()}}const kC=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(n))return"អារេ (Array)";if(n===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return n=>{switch(n.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${n.expected} ប៉ុន្តែទទួលបាន ${r(n.input)}`;case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${J(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${i} ${n.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`តូចពេក៖ ត្រូវការ ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`:i.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`:i.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`:i.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`:`មិនត្រឹមត្រូវ៖ ${o[i.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${R(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function rw(){return{localeError:kC()}}function EC(){return rw()}const IC=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return n=>{switch(n.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${n.expected}, 받은 타입은 ${r(n.input)}입니다`;case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${J(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${R(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const i=n.inclusive?"이하":"미만",a=i==="미만"?"이어야 합니다":"여야 합니다",s=t(n.origin),c=s?.unit??"요소";return s?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${c} ${i}${a}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${i}${a}`}case"too_small":{const i=n.inclusive?"이상":"초과",a=i==="이상"?"이어야 합니다":"여야 합니다",s=t(n.origin),c=s?.unit??"요소";return s?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${c} ${i}${a}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`:i.format==="ends_with"?`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`:i.format==="includes"?`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`:i.format==="regex"?`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`:`잘못된 ${o[i.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${R(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function TC(){return{localeError:IC()}}const $C=e=>Vo(typeof e,e),Vo=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return t===void 0?"nežinomas objektas":t===null?"nulinė reikšmė":Array.isArray(t)?"masyvas":Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:"objektas";case"null":return"nulinė reikšmė"}return e},No=e=>e.charAt(0).toUpperCase()+e.slice(1);function ih(e){const t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}const OC=()=>{const e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(o,n,i,a){const s=e[o]??null;return s===null?s:{unit:s.unit[n],verb:s.verb[a][i?"inclusive":"notInclusive"]}}const r={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return o=>{switch(o.code){case"invalid_type":return`Gautas tipas ${$C(o.input)}, o tikėtasi - ${Vo(o.expected)}`;case"invalid_value":return o.values.length===1?`Privalo būti ${J(o.values[0])}`:`Privalo būti vienas iš ${R(o.values,"|")} pasirinkimų`;case"too_big":{const n=Vo(o.origin),i=t(o.origin,ih(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${No(n??o.origin??"reikšmė")} ${i.verb} ${o.maximum.toString()} ${i.unit??"elementų"}`;const a=o.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${No(n??o.origin??"reikšmė")} turi būti ${a} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{const n=Vo(o.origin),i=t(o.origin,ih(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${No(n??o.origin??"reikšmė")} ${i.verb} ${o.minimum.toString()} ${i.unit??"elementų"}`;const a=o.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${No(n??o.origin??"reikšmė")} turi būti ${a} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{const n=o;return n.format==="starts_with"?`Eilutė privalo prasidėti "${n.prefix}"`:n.format==="ends_with"?`Eilutė privalo pasibaigti "${n.suffix}"`:n.format==="includes"?`Eilutė privalo įtraukti "${n.includes}"`:n.format==="regex"?`Eilutė privalo atitikti ${n.pattern}`:`Neteisingas ${r[n.format]??o.format}`}case"not_multiple_of":return`Skaičius privalo būti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${R(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const n=Vo(o.origin);return`${No(n??o.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function AC(){return{localeError:OC()}}const CC=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"број";case"object":{if(Array.isArray(n))return"низа";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return n=>{switch(n.code){case"invalid_type":return`Грешен внес: се очекува ${n.expected}, примено ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${J(n.values[0])}`:`Грешана опција: се очекува една ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${i}${n.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Премногу мал: се очекува ${n.origin} да има ${i}${n.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Неважечка низа: мора да започнува со "${i.prefix}"`:i.format==="ends_with"?`Неважечка низа: мора да завршува со "${i.suffix}"`:i.format==="includes"?`Неважечка низа: мора да вклучува "${i.includes}"`:i.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${i.pattern}`:`Invalid ${o[i.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${R(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function NC(){return{localeError:CC()}}const RC=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${J(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${o[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${R(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function PC(){return{localeError:RC()}}const jC=()=>{const e={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${J(n.values[0])}`:`Ongeldige optie: verwacht één van ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Te groot: verwacht dat ${n.origin??"waarde"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elementen"}`:`Te groot: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Te klein: verwacht dat ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Te klein: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${o[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${R(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function DC(){return{localeError:jC()}}const zC=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${J(n.values[0])}`:`Ugyldig valg: forventet en av ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til å ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til å ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til å ha ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ugyldig streng: må starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: må ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: må inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: må matche mønsteret ${i.pattern}`:`Ugyldig ${o[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${R(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function MC(){return{localeError:zC()}}const UC=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`Fâsit giren: umulan ${n.expected}, alınan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${J(n.values[0])}`:`Fâsit tercih: mûteberler ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla büyük: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmalıydı.`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla küçük: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${i}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Fâsit metin: "${i.prefix}" ile başlamalı.`:i.format==="ends_with"?`Fâsit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`Fâsit metin: "${i.includes}" ihtivâ etmeli.`:i.format==="regex"?`Fâsit metin: ${i.pattern} nakşına uymalı.`:`Fâsit ${o[i.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${R(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function LC(){return{localeError:UC()}}const FC=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"ارې";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return n=>{switch(n.code){case"invalid_type":return`ناسم ورودي: باید ${n.expected} وای, مګر ${r(n.input)} ترلاسه شو`;case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${J(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${R(n.values,"|")} څخه وای`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`ډیر لوی: ${n.origin??"ارزښت"} باید ${i}${n.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${i}${n.maximum.toString()} وي`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`ډیر کوچنی: ${n.origin} باید ${i}${n.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${i}${n.minimum.toString()} وي`}case"invalid_format":{const i=n;return i.format==="starts_with"?`ناسم متن: باید د "${i.prefix}" سره پیل شي`:i.format==="ends_with"?`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`:i.format==="includes"?`ناسم متن: باید "${i.includes}" ولري`:i.format==="regex"?`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`:`${o[i.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${R(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function VC(){return{localeError:FC()}}const ZC=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return n=>{switch(n.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${J(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${i}${n.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${i}${n.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`:i.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`:i.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`:i.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`:`Nieprawidłow(y/a/e) ${o[i.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${R(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function BC(){return{localeError:ZC()}}const qC=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inválido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${J(n.values[0])}`:`Opção inválida: esperada uma das ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Texto inválido: deve começar com "${i.prefix}"`:i.format==="ends_with"?`Texto inválido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inválido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inválido: deve corresponder ao padrão ${i.pattern}`:`${o[i.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${R(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function GC(){return{localeError:qC()}}function ah(e,t,r,o){const n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}const HC=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"массив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return n=>{switch(n.code){case"invalid_type":return`Неверный ввод: ожидалось ${n.expected}, получено ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Неверный ввод: ожидалось ${J(n.values[0])}`:`Неверный вариант: ожидалось одно из ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);if(a){const s=Number(n.maximum),c=ah(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${i}${n.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);if(a){const s=Number(n.minimum),c=ah(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${i}${n.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Неверная строка: должна начинаться с "${i.prefix}"`:i.format==="ends_with"?`Неверная строка: должна заканчиваться на "${i.suffix}"`:i.format==="includes"?`Неверная строка: должна содержать "${i.includes}"`:i.format==="regex"?`Неверная строка: должна соответствовать шаблону ${i.pattern}`:`Неверный ${o[i.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${R(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function WC(){return{localeError:HC()}}const JC=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"število";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${J(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pričakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Neveljaven niz: mora se začeti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se končati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${o[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${R(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function KC(){return{localeError:JC()}}const YC=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${J(n.values[0])}`:`Ogiltigt val: förväntade en av ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ogiltig sträng: måste börja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig sträng: måste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig sträng: måste innehålla "${i.includes}"`:i.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`:`Ogiltig(t) ${o[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${R(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function XC(){return{localeError:YC()}}const QC=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(n))return"அணி";if(n===null)return"வெறுமை";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${n.expected}, பெறப்பட்டது ${r(n.input)}`;case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${J(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${R(n.values,"|")} இல் ஒன்று`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${i}${n.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${i}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${i}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const i=n;return i.format==="starts_with"?`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`:i.format==="ends_with"?`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`:i.format==="includes"?`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`:i.format==="regex"?`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${o[i.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${R(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function eN(){return{localeError:QC()}}const tN=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(n))return"อาร์เรย์ (Array)";if(n===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return n=>{switch(n.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${n.expected} แต่ได้รับ ${r(n.input)}`;case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${J(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(n.origin);return a?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${i} ${n.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${i} ${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?"อย่างน้อย":"มากกว่า",a=t(n.origin);return a?`น้อยกว่ากำหนด: ${n.origin} ควรมี${i} ${n.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${i} ${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`:i.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`:i.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`:i.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`:`รูปแบบไม่ถูกต้อง: ${o[i.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${R(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function rN(){return{localeError:tN()}}const nN=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},oN=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(o){return e[o]??null}const r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Geçersiz değer: beklenen ${o.expected}, alınan ${nN(o.input)}`;case"invalid_value":return o.values.length===1?`Geçersiz değer: beklenen ${J(o.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${R(o.values,"|")}`;case"too_big":{const n=o.inclusive?"<=":"<",i=t(o.origin);return i?`Çok büyük: beklenen ${o.origin??"değer"} ${n}${o.maximum.toString()} ${i.unit??"öğe"}`:`Çok büyük: beklenen ${o.origin??"değer"} ${n}${o.maximum.toString()}`}case"too_small":{const n=o.inclusive?">=":">",i=t(o.origin);return i?`Çok küçük: beklenen ${o.origin} ${n}${o.minimum.toString()} ${i.unit}`:`Çok küçük: beklenen ${o.origin} ${n}${o.minimum.toString()}`}case"invalid_format":{const n=o;return n.format==="starts_with"?`Geçersiz metin: "${n.prefix}" ile başlamalı`:n.format==="ends_with"?`Geçersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Geçersiz metin: "${n.includes}" içermeli`:n.format==="regex"?`Geçersiz metin: ${n.pattern} desenine uymalı`:`Geçersiz ${r[n.format]??o.format}`}case"not_multiple_of":return`Geçersiz sayı: ${o.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${o.keys.length>1?"lar":""}: ${R(o.keys,", ")}`;case"invalid_key":return`${o.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${o.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function iN(){return{localeError:oN()}}const aN=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"масив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return n=>{switch(n.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${n.expected}, отримано ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${J(n.values[0])}`:`Неправильна опція: очікується одне з ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Занадто велике: очікується, що ${n.origin??"значення"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Занадто мале: очікується, що ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Неправильний рядок: повинен починатися з "${i.prefix}"`:i.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`:i.format==="includes"?`Неправильний рядок: повинен містити "${i.includes}"`:i.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`:`Неправильний ${o[i.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${R(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function nw(){return{localeError:aN()}}function sN(){return nw()}const cN=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"نمبر";case"object":{if(Array.isArray(n))return"آرے";if(n===null)return"نل";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return n=>{switch(n.code){case"invalid_type":return`غلط ان پٹ: ${n.expected} متوقع تھا، ${r(n.input)} موصول ہوا`;case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${J(n.values[0])} متوقع تھا`:`غلط آپشن: ${R(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`بہت بڑا: ${n.origin??"ویلیو"} کے ${i}${n.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${i}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`بہت چھوٹا: ${n.origin} کے ${i}${n.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${i}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const i=n;return i.format==="starts_with"?`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`:i.format==="ends_with"?`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`:i.format==="includes"?`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`:i.format==="regex"?`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`:`غلط ${o[i.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${R(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function lN(){return{localeError:cN()}}const uN=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"số";case"object":{if(Array.isArray(n))return"mảng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return n=>{switch(n.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${n.expected}, nhận được ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${J(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Quá nhỏ: mong đợi ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`:i.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`:i.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`:i.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`:`${o[i.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${R(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function dN(){return{localeError:uN()}}const fN=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(n))return"数组";if(n===null)return"空值(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return n=>{switch(n.code){case"invalid_type":return`无效输入:期望 ${n.expected},实际接收 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`无效输入:期望 ${J(n.values[0])}`:`无效选项:期望以下之一 ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`数值过大:期望 ${n.origin??"值"} ${i}${n.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`数值过小:期望 ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`数值过小:期望 ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`无效字符串:必须以 "${i.prefix}" 开头`:i.format==="ends_with"?`无效字符串:必须以 "${i.suffix}" 结尾`:i.format==="includes"?`无效字符串:必须包含 "${i.includes}"`:i.format==="regex"?`无效字符串:必须满足正则表达式 ${i.pattern}`:`无效${o[i.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${R(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function mN(){return{localeError:fN()}}const pN=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return n=>{switch(n.code){case"invalid_type":return`無效的輸入值:預期為 ${n.expected},但收到 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${J(n.values[0])}`:`無效的選項:預期為以下其中之一 ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`數值過大:預期 ${n.origin??"值"} 應為 ${i}${n.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${i}${n.maximum.toString()}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`數值過小:預期 ${n.origin} 應為 ${i}${n.minimum.toString()} ${a.unit}`:`數值過小:預期 ${n.origin} 應為 ${i}${n.minimum.toString()}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`無效的字串:必須以 "${i.prefix}" 開頭`:i.format==="ends_with"?`無效的字串:必須以 "${i.suffix}" 結尾`:i.format==="includes"?`無效的字串:必須包含 "${i.includes}"`:i.format==="regex"?`無效的字串:必須符合格式 ${i.pattern}`:`無效的 ${o[i.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${R(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function hN(){return{localeError:pN()}}const gN=()=>{const e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(n){return e[n]??null}const r=n=>{const i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(n))return"akopọ";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},o={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return n=>{switch(n.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${n.expected}, àmọ̀ a rí ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${J(n.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${R(n.values,"|")}`;case"too_big":{const i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${i}${n.maximum}`}case"too_small":{const i=n.inclusive?">=":">",a=t(n.origin);return a?`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`Kéré ju: a ní láti jẹ́ ${i}${n.minimum}`}case"invalid_format":{const i=n;return i.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`:i.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`:i.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`:i.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`:`Aṣìṣe: ${o[i.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${R(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function vN(){return{localeError:gN()}}const ow=Object.freeze(Object.defineProperty({__proto__:null,ar:CA,az:RA,be:jA,bg:MA,ca:LA,cs:VA,da:BA,de:GA,en:tw,eo:YA,es:QA,fa:tC,fi:nC,fr:iC,frCA:sC,he:lC,hu:dC,id:mC,is:gC,it:yC,ja:_C,ka:SC,kh:EC,km:rw,ko:TC,lt:AC,mk:NC,ms:PC,nl:DC,no:MC,ota:LC,pl:BC,ps:VC,pt:GC,ru:WC,sl:KC,sv:XC,ta:eN,th:rN,tr:iN,ua:sN,uk:nw,ur:lN,vi:dN,yo:vN,zhCN:mN,zhTW:hN},Symbol.toStringTag,{value:"Module"}));var sh;const iw=Symbol("ZodOutput"),aw=Symbol("ZodInput");class sw{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const o=r[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Bd(){return new sw}(sh=globalThis).__zod_globalRegistry??(sh.__zod_globalRegistry=Bd());const Vt=globalThis.__zod_globalRegistry;function cw(e,t){return new e({type:"string",...C(t)})}function lw(e,t){return new e({type:"string",coerce:!0,...C(t)})}function qd(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...C(t)})}function Qa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...C(t)})}function Gd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...C(t)})}function Hd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(t)})}function Wd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(t)})}function Jd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(t)})}function Us(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...C(t)})}function Kd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...C(t)})}function Yd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(t)})}function Xd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...C(t)})}function Qd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(t)})}function ef(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...C(t)})}function tf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...C(t)})}function rf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(t)})}function nf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(t)})}function of(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(t)})}function uw(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...C(t)})}function af(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(t)})}function sf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(t)})}function cf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...C(t)})}function lf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...C(t)})}function uf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...C(t)})}function df(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...C(t)})}const dw={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function fw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(t)})}function mw(e,t){return new e({type:"string",format:"date",check:"string_format",...C(t)})}function pw(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...C(t)})}function hw(e,t){return new e({type:"string",format:"duration",check:"string_format",...C(t)})}function gw(e,t){return new e({type:"number",checks:[],...C(t)})}function vw(e,t){return new e({type:"number",coerce:!0,checks:[],...C(t)})}function yw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...C(t)})}function bw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...C(t)})}function _w(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...C(t)})}function ww(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...C(t)})}function xw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...C(t)})}function Sw(e,t){return new e({type:"boolean",...C(t)})}function kw(e,t){return new e({type:"boolean",coerce:!0,...C(t)})}function Ew(e,t){return new e({type:"bigint",...C(t)})}function Iw(e,t){return new e({type:"bigint",coerce:!0,...C(t)})}function Tw(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(t)})}function $w(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(t)})}function Ow(e,t){return new e({type:"symbol",...C(t)})}function Aw(e,t){return new e({type:"undefined",...C(t)})}function Cw(e,t){return new e({type:"null",...C(t)})}function Nw(e){return new e({type:"any"})}function Rw(e){return new e({type:"unknown"})}function Pw(e,t){return new e({type:"never",...C(t)})}function jw(e,t){return new e({type:"void",...C(t)})}function Dw(e,t){return new e({type:"date",...C(t)})}function zw(e,t){return new e({type:"date",coerce:!0,...C(t)})}function Mw(e,t){return new e({type:"nan",...C(t)})}function Rr(e,t){return new Dd({check:"less_than",...C(t),value:e,inclusive:!1})}function Ot(e,t){return new Dd({check:"less_than",...C(t),value:e,inclusive:!0})}function Pr(e,t){return new zd({check:"greater_than",...C(t),value:e,inclusive:!1})}function dt(e,t){return new zd({check:"greater_than",...C(t),value:e,inclusive:!0})}function ff(e){return Pr(0,e)}function mf(e){return Rr(0,e)}function pf(e){return Ot(0,e)}function hf(e){return dt(0,e)}function Jn(e,t){return new xb({check:"multiple_of",...C(t),value:e})}function Ci(e,t){return new Eb({check:"max_size",...C(t),maximum:e})}function Kn(e,t){return new Ib({check:"min_size",...C(t),minimum:e})}function Ls(e,t){return new Tb({check:"size_equals",...C(t),size:e})}function Ni(e,t){return new $b({check:"max_length",...C(t),maximum:e})}function on(e,t){return new Ob({check:"min_length",...C(t),minimum:e})}function Ri(e,t){return new Ab({check:"length_equals",...C(t),length:e})}function Fs(e,t){return new Cb({check:"string_format",format:"regex",...C(t),pattern:e})}function Vs(e){return new Nb({check:"string_format",format:"lowercase",...C(e)})}function Zs(e){return new Rb({check:"string_format",format:"uppercase",...C(e)})}function Bs(e,t){return new Pb({check:"string_format",format:"includes",...C(t),includes:e})}function qs(e,t){return new jb({check:"string_format",format:"starts_with",...C(t),prefix:e})}function Gs(e,t){return new Db({check:"string_format",format:"ends_with",...C(t),suffix:e})}function gf(e,t,r){return new zb({check:"property",property:e,schema:t,...C(r)})}function Hs(e,t){return new Mb({check:"mime_type",mime:e,...C(t)})}function xr(e){return new Ub({check:"overwrite",tx:e})}function Ws(e){return xr(t=>t.normalize(e))}function Js(){return xr(e=>e.trim())}function Ks(){return xr(e=>e.toLowerCase())}function Ys(){return xr(e=>e.toUpperCase())}function Xs(){return xr(e=>yy(e))}function Uw(e,t,r){return new e({type:"array",element:t,...C(r)})}function yN(e,t,r){return new e({type:"union",options:t,...C(r)})}function bN(e,t,r){return new e({type:"union",options:t,inclusive:!1,...C(r)})}function _N(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...C(o)})}function wN(e,t,r){return new e({type:"intersection",left:t,right:r})}function xN(e,t,r,o){const n=r instanceof Y,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...C(i)})}function SN(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...C(o)})}function kN(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...C(o)})}function EN(e,t,r){return new e({type:"set",valueType:t,...C(r)})}function IN(e,t,r){const o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...C(r)})}function TN(e,t,r){return new e({type:"enum",entries:t,...C(r)})}function $N(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...C(r)})}function Lw(e,t){return new e({type:"file",...C(t)})}function ON(e,t){return new e({type:"transform",transform:t})}function AN(e,t){return new e({type:"optional",innerType:t})}function CN(e,t){return new e({type:"nullable",innerType:t})}function NN(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():js(r)}})}function RN(e,t,r){return new e({type:"nonoptional",innerType:t,...C(r)})}function PN(e,t){return new e({type:"success",innerType:t})}function jN(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function DN(e,t,r){return new e({type:"pipe",in:t,out:r})}function zN(e,t){return new e({type:"readonly",innerType:t})}function MN(e,t,r){return new e({type:"template_literal",parts:t,...C(r)})}function UN(e,t){return new e({type:"lazy",getter:t})}function LN(e,t){return new e({type:"promise",innerType:t})}function Fw(e,t,r){const o=C(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Vw(e,t,r){return new e({type:"custom",check:"custom",fn:t,...C(r)})}function Zw(e){const t=Bw(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Hn(o,r.value,t._zod.def));else{const n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(Hn(n))}},e(r.value,r)));return t}function Bw(e,t){const r=new Ae({check:"custom",...C(t)});return r._zod.check=e,r}function qw(e){const t=new Ae({check:"describe"});return t._zod.onattach=[r=>{const o=Vt.get(r)??{};Vt.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Gw(e){const t=new Ae({check:"meta"});return t._zod.onattach=[r=>{const o=Vt.get(r)??{};Vt.add(r,{...o,...e})}],t._zod.check=()=>{},t}function Hw(e,t){const r=C(t);let o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(m=>typeof m=="string"?m.toLowerCase():m),n=n.map(m=>typeof m=="string"?m.toLowerCase():m));const i=new Set(o),a=new Set(n),s=e.Codec??Zd,c=e.Boolean??Ld,l=e.String??Ai,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new s({type:"pipe",in:u,out:d,transform:((m,g)=>{let h=m;return r.case!=="sensitive"&&(h=h.toLowerCase()),i.has(h)?!0:a.has(h)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:g.value,inst:f,continue:!1}),{})}),reverseTransform:((m,g)=>m===!0?o[0]||"true":n[0]||"false"),error:r.error});return f}function Pi(e,t,r,o={}){const n=C(o),i={...C(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Yn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Vt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ke(e,t,r={path:[],schemaPath:[]}){var o;const n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const u={...r,schemaPath:[...r.schemaPath,e],path:r.path},d=e._zod.parent;if(d)a.ref=d,ke(d,t,u),t.seen.get(d).isParent=!0;else if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{const f=a.schema,m=t.processors[n.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(e,t,f,u)}}const c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&it(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Xn(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const u=e.external.registry.get(i[0])?.id,d=e.external.uri??(m=>m);if(u)return{ref:d(u)};const f=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=f,{defId:f,ref:`${d("__shared")}#/${a}/${f}`}}if(i[1]===r)return{ref:"#"};const c=`#/${a}/`,l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+l}},n=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:s,defId:c}=o(i);a.def={...a.schema},c&&(a.defId=c);const l=a.schema;for(const u in l)delete l[u];l.$ref=s};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
28
28
 
29
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){n(i);continue}if(e.external){const c=e.external.registry.get(i[0])?.id;if(t!==i[0]&&c){n(i);continue}}if(e.metadataRegistry.get(i[0])?.id){n(i);continue}if(a.cycle){n(i);continue}if(a.count>1&&e.reused==="ref"){n(i);continue}}}function Qn(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=a=>{const s=e.seen.get(a),c=s.def??s.schema,l={...c};if(s.ref===null)return;const u=s.ref;if(s.ref=null,u){o(u);const d=e.seen.get(u).schema;d.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(d)):(Object.assign(c,d),Object.assign(c,l))}s.isParent||e.override({zodSchema:a,jsonSchema:c,path:s.path??[]})};for(const a of[...e.seen.entries()].reverse())o(a[0]);const n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);const i=e.external?.defs??{};for(const a of e.seen.entries()){const s=a[1];s.def&&s.defId&&(i[s.defId]=s.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{const a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yo(t,"input"),output:Yo(t,"output")}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function it(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return it(o.element,r);if(o.type==="set")return it(o.valueType,r);if(o.type==="lazy")return it(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return it(o.innerType,r);if(o.type==="intersection")return it(o.left,r)||it(o.right,r);if(o.type==="record"||o.type==="map")return it(o.keyType,r)||it(o.valueType,r);if(o.type==="pipe")return it(o.in,r)||it(o.out,r);if(o.type==="object"){for(const n in o.shape)if(it(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(const n of o.options)if(it(n,r))return!0;return!1}if(o.type==="tuple"){for(const n of o.items)if(it(n,r))return!0;return!!(o.rest&&it(o.rest,r))}return!1}const Ww=(e,t={})=>r=>{const o=Yn({...r,processors:t});return ke(e,o),Xn(o,e),Qn(o,e)},Yo=(e,t)=>r=>{const{libraryOptions:o,target:n}=r??{},i=Yn({...o??{},target:n,io:t,processors:{}});return ke(e,i),Xn(i,e),Qn(i,e)},FN={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Jw=(e,t,r,o)=>{const n=r;n.type="string";const{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=FN[s]??s,n.format===""&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Kw=(e,t,r,o)=>{const n=r,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u),typeof i=="number"&&(n.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof a=="number"&&(n.maximum=a,typeof l=="number"&&t.target!=="draft-04"&&(l<=a?delete n.maximum:delete n.exclusiveMaximum)),typeof c=="number"&&(n.multipleOf=c)},Yw=(e,t,r,o)=>{r.type="boolean"},Xw=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Qw=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},e0=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},t0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},r0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},n0=(e,t,r,o)=>{r.not={}},o0=(e,t,r,o)=>{},i0=(e,t,r,o)=>{},a0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},s0=(e,t,r,o)=>{const n=e._zod.def,i=wd(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},c0=(e,t,r,o)=>{const n=e._zod.def,i=[];for(const a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},l0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},u0=(e,t,r,o)=>{const n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},d0=(e,t,r,o)=>{const n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),c?c.length===1?(i.contentMediaType=c[0],Object.assign(n,i)):n.anyOf=c.map(l=>({...i,contentMediaType:l})):Object.assign(n,i)},f0=(e,t,r,o)=>{r.type="boolean"},m0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},p0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},h0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},g0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},v0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},y0=(e,t,r,o)=>{const n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=ke(i.element,t,{...o,path:[...o.path,"items"]})},b0=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="object",n.properties={};const a=i.shape;for(const l in a)n.properties[l]=ke(a[l],t,{...o,path:[...o.path,"properties",l]});const s=new Set(Object.keys(a)),c=new Set([...s].filter(l=>{const u=i.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(n.required=Array.from(c)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=ke(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},vf=(e,t,r,o)=>{const n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,c)=>ke(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},_0=(e,t,r,o)=>{const n=e._zod.def,i=ke(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=ke(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c},w0=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((f,m)=>ke(f,t,{...o,path:[...o.path,a,m]})),l=i.rest?ke(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));const{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(n.minItems=u),typeof d=="number"&&(n.maxItems=d)},x0=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="object",(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=ke(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=ke(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]})},S0=(e,t,r,o)=>{const n=e._zod.def,i=ke(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},k0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},E0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},I0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},T0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},$0=(e,t,r,o)=>{const n=e._zod.def,i=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;ke(i,t,o);const a=t.seen.get(e);a.ref=i},O0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},A0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},C0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},N0=(e,t,r,o)=>{const n=e._zod.innerType;ke(n,t,o);const i=t.seen.get(e);i.ref=n},ku={string:Jw,number:Kw,boolean:Yw,bigint:Xw,symbol:Qw,null:e0,undefined:t0,void:r0,never:n0,any:o0,unknown:i0,date:a0,enum:s0,literal:c0,nan:l0,template_literal:u0,file:d0,success:f0,custom:m0,function:p0,transform:h0,map:g0,set:v0,array:y0,object:b0,union:vf,intersection:_0,tuple:w0,record:x0,nullable:S0,nonoptional:k0,default:E0,prefault:I0,catch:T0,pipe:$0,readonly:O0,promise:A0,optional:C0,lazy:N0};function yf(e,t){if("_idmap"in e){const o=e,n=Yn({...t,processors:ku}),i={};for(const c of o._idmap.entries()){const[l,u]=c;ke(u,n)}const a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(const c of o._idmap.entries()){const[l,u]=c;Xn(n,u),a[l]=Qn(n,u)}if(Object.keys(i).length>0){const c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}const r=Yn({...t,processors:ku});return ke(e,r),Xn(r,e),Qn(r,e)}class VN{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Yn({processors:ku,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return ke(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Xn(this.ctx,t);const o=Qn(this.ctx,t),{"~standard":n,...i}=o;return i}}const ZN=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),BN=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:__,$ZodArray:E_,$ZodAsyncError:tn,$ZodBase64:c_,$ZodBase64URL:u_,$ZodBigInt:Fd,$ZodBigIntFormat:g_,$ZodBoolean:Ld,$ZodCIDRv4:a_,$ZodCIDRv6:s_,$ZodCUID:Wb,$ZodCUID2:Jb,$ZodCatch:G_,$ZodCheck:Ae,$ZodCheckBigIntFormat:kb,$ZodCheckEndsWith:Db,$ZodCheckGreaterThan:zd,$ZodCheckIncludes:Pb,$ZodCheckLengthEquals:Ab,$ZodCheckLessThan:Dd,$ZodCheckLowerCase:Nb,$ZodCheckMaxLength:$b,$ZodCheckMaxSize:Eb,$ZodCheckMimeType:Mb,$ZodCheckMinLength:Ob,$ZodCheckMinSize:Ib,$ZodCheckMultipleOf:xb,$ZodCheckNumberFormat:Sb,$ZodCheckOverwrite:Ub,$ZodCheckProperty:zb,$ZodCheckRegex:Cb,$ZodCheckSizeEquals:Tb,$ZodCheckStartsWith:jb,$ZodCheckStringFormat:Oi,$ZodCheckUpperCase:Rb,$ZodCodec:Zd,$ZodCustom:ew,$ZodCustomStringFormat:p_,$ZodDate:k_,$ZodDefault:V_,$ZodDiscriminatedUnion:C_,$ZodE164:d_,$ZodEmail:Bb,$ZodEmoji:Gb,$ZodEncodeError:Rs,$ZodEnum:D_,$ZodError:Sd,$ZodFile:M_,$ZodFunction:Y_,$ZodGUID:Vb,$ZodIPv4:n_,$ZodIPv6:o_,$ZodISODate:e_,$ZodISODateTime:Qb,$ZodISODuration:r_,$ZodISOTime:t_,$ZodIntersection:N_,$ZodJWT:m_,$ZodKSUID:Xb,$ZodLazy:Q_,$ZodLiteral:z_,$ZodMAC:i_,$ZodMap:P_,$ZodNaN:H_,$ZodNanoID:Hb,$ZodNever:x_,$ZodNonOptional:B_,$ZodNull:b_,$ZodNullable:F_,$ZodNumber:Ud,$ZodNumberFormat:h_,$ZodObject:$_,$ZodObjectJIT:O_,$ZodOptional:L_,$ZodPipe:W_,$ZodPrefault:Z_,$ZodPromise:X_,$ZodReadonly:J_,$ZodRealError:kt,$ZodRecord:R_,$ZodRegistry:sw,$ZodSet:j_,$ZodString:Ai,$ZodStringFormat:Ee,$ZodSuccess:q_,$ZodSymbol:v_,$ZodTemplateLiteral:K_,$ZodTransform:U_,$ZodTuple:Vd,$ZodType:Y,$ZodULID:Kb,$ZodURL:qb,$ZodUUID:Zb,$ZodUndefined:y_,$ZodUnion:Ms,$ZodUnknown:w_,$ZodVoid:S_,$ZodXID:Yb,$ZodXor:A_,$brand:gy,$constructor:T,$input:aw,$output:iw,Doc:Lb,JSONSchema:ZN,JSONSchemaGenerator:VN,NEVER:_d,TimePrecision:dw,_any:Nw,_array:Uw,_base64:cf,_base64url:lf,_bigint:Ew,_boolean:Sw,_catch:jN,_check:Bw,_cidrv4:af,_cidrv6:sf,_coercedBigint:Iw,_coercedBoolean:kw,_coercedDate:zw,_coercedNumber:vw,_coercedString:lw,_cuid:Xd,_cuid2:Qd,_custom:Fw,_date:Dw,_decode:Td,_decodeAsync:Od,_default:NN,_discriminatedUnion:_N,_e164:uf,_email:qd,_emoji:Kd,_encode:Id,_encodeAsync:$d,_endsWith:Gs,_enum:IN,_file:Lw,_float32:bw,_float64:_w,_gt:Pr,_gte:dt,_guid:Qa,_includes:Bs,_int:yw,_int32:ww,_int64:Tw,_intersection:wN,_ipv4:nf,_ipv6:of,_isoDate:mw,_isoDateTime:fw,_isoDuration:hw,_isoTime:pw,_jwt:df,_ksuid:rf,_lazy:UN,_length:Ri,_literal:$N,_lowercase:Vs,_lt:Rr,_lte:Ot,_mac:uw,_map:kN,_max:Ot,_maxLength:Ni,_maxSize:Ci,_mime:Hs,_min:dt,_minLength:on,_minSize:Kn,_multipleOf:Jn,_nan:Mw,_nanoid:Yd,_nativeEnum:TN,_negative:mf,_never:Pw,_nonnegative:hf,_nonoptional:RN,_nonpositive:pf,_normalize:Ws,_null:Cw,_nullable:CN,_number:gw,_optional:AN,_overwrite:xr,_parse:Si,_parseAsync:ki,_pipe:DN,_positive:ff,_promise:LN,_property:gf,_readonly:zN,_record:SN,_refine:Vw,_regex:Fs,_safeDecode:Cd,_safeDecodeAsync:Rd,_safeEncode:Ad,_safeEncodeAsync:Nd,_safeParse:Ei,_safeParseAsync:Ii,_set:EN,_size:Ls,_slugify:Xs,_startsWith:qs,_string:cw,_stringFormat:Pi,_stringbool:Hw,_success:PN,_superRefine:Zw,_symbol:Ow,_templateLiteral:MN,_toLowerCase:Ks,_toUpperCase:Ys,_transform:ON,_trim:Js,_tuple:xN,_uint32:xw,_uint64:$w,_ulid:ef,_undefined:Aw,_union:yN,_unknown:Rw,_uppercase:Zs,_url:Us,_uuid:Gd,_uuidv4:Hd,_uuidv6:Wd,_uuidv7:Jd,_void:jw,_xid:tf,_xor:bN,clone:Nt,config:Xe,createStandardJSONSchemaMethod:Yo,createToJSONSchemaMethod:Ww,decode:QO,decodeAsync:tA,describe:qw,encode:XO,encodeAsync:eA,extractDefs:Xn,finalize:Qn,flattenError:kd,formatError:Ed,globalConfig:Ja,globalRegistry:Vt,initializeContext:Yn,isValidBase64:Md,isValidBase64URL:l_,isValidJWT:f_,locales:ow,meta:Gw,parse:wu,parseAsync:xu,prettifyError:zy,process:ke,regexes:jd,registry:Bd,safeDecode:nA,safeDecodeAsync:iA,safeEncode:rA,safeEncodeAsync:oA,safeParse:My,safeParseAsync:Uy,toDotPath:Dy,toJSONSchema:yf,treeifyError:jy,util:Ry,version:Fb},Symbol.toStringTag,{value:"Module"})),qN=Object.freeze(Object.defineProperty({__proto__:null,endsWith:Gs,gt:Pr,gte:dt,includes:Bs,length:Ri,lowercase:Vs,lt:Rr,lte:Ot,maxLength:Ni,maxSize:Ci,mime:Hs,minLength:on,minSize:Kn,multipleOf:Jn,negative:mf,nonnegative:hf,nonpositive:pf,normalize:Ws,overwrite:xr,positive:ff,property:gf,regex:Fs,size:Ls,slugify:Xs,startsWith:qs,toLowerCase:Ks,toUpperCase:Ys,trim:Js,uppercase:Zs},Symbol.toStringTag,{value:"Module"})),bf=T("ZodISODateTime",(e,t)=>{Qb.init(e,t),Ie.init(e,t)});function R0(e){return fw(bf,e)}const _f=T("ZodISODate",(e,t)=>{e_.init(e,t),Ie.init(e,t)});function P0(e){return mw(_f,e)}const wf=T("ZodISOTime",(e,t)=>{t_.init(e,t),Ie.init(e,t)});function j0(e){return pw(wf,e)}const xf=T("ZodISODuration",(e,t)=>{r_.init(e,t),Ie.init(e,t)});function D0(e){return hw(xf,e)}const z0=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:_f,ZodISODateTime:bf,ZodISODuration:xf,ZodISOTime:wf,date:P0,datetime:R0,duration:D0,time:j0},Symbol.toStringTag,{value:"Module"})),M0=(e,t)=>{Sd.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Ed(e,r)},flatten:{value:r=>kd(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ka,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ka,2)}},isEmpty:{get(){return e.issues.length===0}}})},GN=T("ZodError",M0),Et=T("ZodError",M0,{Parent:Error}),U0=Si(Et),L0=ki(Et),F0=Ei(Et),Sf=Ii(Et),V0=Id(Et),Z0=Td(Et),B0=$d(Et),q0=Od(Et),G0=Ad(Et),H0=Cd(Et),W0=Nd(Et),J0=Rd(Et),ie=T("ZodType",(e,t)=>(Y.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yo(e,"input"),output:Yo(e,"output")}}),e.toJSONSchema=Ww(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(wr(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(r,o)=>Nt(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>U0(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>F0(e,r,o),e.parseAsync=async(r,o)=>L0(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Sf(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>V0(e,r,o),e.decode=(r,o)=>Z0(e,r,o),e.encodeAsync=async(r,o)=>B0(e,r,o),e.decodeAsync=async(r,o)=>q0(e,r,o),e.safeEncode=(r,o)=>G0(e,r,o),e.safeDecode=(r,o)=>H0(e,r,o),e.safeEncodeAsync=async(r,o)=>W0(e,r,o),e.safeDecodeAsync=async(r,o)=>J0(e,r,o),e.refine=(r,o)=>e.check(cm(r,o)),e.superRefine=r=>e.check(lm(r)),e.overwrite=r=>e.check(xr(r)),e.optional=()=>re(e),e.nullable=()=>Qo(e),e.nullish=()=>re(Qo(e)),e.nonoptional=r=>Kf(e,r),e.array=()=>D(e),e.or=r=>fe([e,r]),e.and=r=>zf(e,r),e.transform=r=>ei(e,wc(r)),e.default=r=>Hf(e,r),e.prefault=r=>Jf(e,r),e.catch=r=>Qf(e,r),e.pipe=r=>ei(e,r),e.readonly=()=>rm(e),e.describe=r=>{const o=e.clone();return Vt.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Vt.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Vt.get(e);const o=e.clone();return Vt.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Qs=T("_ZodString",(e,t)=>{Ai.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Jw(e,o,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(Fs(...o)),e.includes=(...o)=>e.check(Bs(...o)),e.startsWith=(...o)=>e.check(qs(...o)),e.endsWith=(...o)=>e.check(Gs(...o)),e.min=(...o)=>e.check(on(...o)),e.max=(...o)=>e.check(Ni(...o)),e.length=(...o)=>e.check(Ri(...o)),e.nonempty=(...o)=>e.check(on(1,...o)),e.lowercase=o=>e.check(Vs(o)),e.uppercase=o=>e.check(Zs(o)),e.trim=()=>e.check(Js()),e.normalize=(...o)=>e.check(Ws(...o)),e.toLowerCase=()=>e.check(Ks()),e.toUpperCase=()=>e.check(Ys()),e.slugify=()=>e.check(Xs())}),ji=T("ZodString",(e,t)=>{Ai.init(e,t),Qs.init(e,t),e.email=r=>e.check(qd(ec,r)),e.url=r=>e.check(Us(Di,r)),e.jwt=r=>e.check(df(gc,r)),e.emoji=r=>e.check(Kd(tc,r)),e.guid=r=>e.check(Qa(Xo,r)),e.uuid=r=>e.check(Gd(Qt,r)),e.uuidv4=r=>e.check(Hd(Qt,r)),e.uuidv6=r=>e.check(Wd(Qt,r)),e.uuidv7=r=>e.check(Jd(Qt,r)),e.nanoid=r=>e.check(Yd(rc,r)),e.guid=r=>e.check(Qa(Xo,r)),e.cuid=r=>e.check(Xd(nc,r)),e.cuid2=r=>e.check(Qd(oc,r)),e.ulid=r=>e.check(ef(ic,r)),e.base64=r=>e.check(cf(fc,r)),e.base64url=r=>e.check(lf(pc,r)),e.xid=r=>e.check(tf(ac,r)),e.ksuid=r=>e.check(rf(sc,r)),e.ipv4=r=>e.check(nf(cc,r)),e.ipv6=r=>e.check(of(lc,r)),e.cidrv4=r=>e.check(af(uc,r)),e.cidrv6=r=>e.check(sf(dc,r)),e.e164=r=>e.check(uf(hc,r)),e.datetime=r=>e.check(R0(r)),e.date=r=>e.check(P0(r)),e.time=r=>e.check(j0(r)),e.duration=r=>e.check(D0(r))});function S(e){return cw(ji,e)}const Ie=T("ZodStringFormat",(e,t)=>{Ee.init(e,t),Qs.init(e,t)}),ec=T("ZodEmail",(e,t)=>{Bb.init(e,t),Ie.init(e,t)});function K0(e){return qd(ec,e)}const Xo=T("ZodGUID",(e,t)=>{Vb.init(e,t),Ie.init(e,t)});function Y0(e){return Qa(Xo,e)}const Qt=T("ZodUUID",(e,t)=>{Zb.init(e,t),Ie.init(e,t)});function X0(e){return Gd(Qt,e)}function Q0(e){return Hd(Qt,e)}function ex(e){return Wd(Qt,e)}function tx(e){return Jd(Qt,e)}const Di=T("ZodURL",(e,t)=>{qb.init(e,t),Ie.init(e,t)});function rx(e){return Us(Di,e)}function nx(e){return Us(Di,{protocol:/^https?$/,hostname:ob,...C(e)})}const tc=T("ZodEmoji",(e,t)=>{Gb.init(e,t),Ie.init(e,t)});function ox(e){return Kd(tc,e)}const rc=T("ZodNanoID",(e,t)=>{Hb.init(e,t),Ie.init(e,t)});function ix(e){return Yd(rc,e)}const nc=T("ZodCUID",(e,t)=>{Wb.init(e,t),Ie.init(e,t)});function ax(e){return Xd(nc,e)}const oc=T("ZodCUID2",(e,t)=>{Jb.init(e,t),Ie.init(e,t)});function sx(e){return Qd(oc,e)}const ic=T("ZodULID",(e,t)=>{Kb.init(e,t),Ie.init(e,t)});function cx(e){return ef(ic,e)}const ac=T("ZodXID",(e,t)=>{Yb.init(e,t),Ie.init(e,t)});function lx(e){return tf(ac,e)}const sc=T("ZodKSUID",(e,t)=>{Xb.init(e,t),Ie.init(e,t)});function ux(e){return rf(sc,e)}const cc=T("ZodIPv4",(e,t)=>{n_.init(e,t),Ie.init(e,t)});function dx(e){return nf(cc,e)}const kf=T("ZodMAC",(e,t)=>{i_.init(e,t),Ie.init(e,t)});function fx(e){return uw(kf,e)}const lc=T("ZodIPv6",(e,t)=>{o_.init(e,t),Ie.init(e,t)});function mx(e){return of(lc,e)}const uc=T("ZodCIDRv4",(e,t)=>{a_.init(e,t),Ie.init(e,t)});function px(e){return af(uc,e)}const dc=T("ZodCIDRv6",(e,t)=>{s_.init(e,t),Ie.init(e,t)});function hx(e){return sf(dc,e)}const fc=T("ZodBase64",(e,t)=>{c_.init(e,t),Ie.init(e,t)});function mc(e){return cf(fc,e)}const pc=T("ZodBase64URL",(e,t)=>{u_.init(e,t),Ie.init(e,t)});function gx(e){return lf(pc,e)}const hc=T("ZodE164",(e,t)=>{d_.init(e,t),Ie.init(e,t)});function vx(e){return uf(hc,e)}const gc=T("ZodJWT",(e,t)=>{m_.init(e,t),Ie.init(e,t)});function yx(e){return df(gc,e)}const fo=T("ZodCustomStringFormat",(e,t)=>{p_.init(e,t),Ie.init(e,t)});function bx(e,t,r={}){return Pi(fo,e,t,r)}function _x(e){return Pi(fo,"hostname",nb,e)}function wx(e){return Pi(fo,"hex",_b,e)}function xx(e,t){const r=t?.enc??"hex",o=`${e}_${r}`,n=jd[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Pi(fo,o,n,t)}const zi=T("ZodNumber",(e,t)=>{Ud.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Kw(e,o,n),e.gt=(o,n)=>e.check(Pr(o,n)),e.gte=(o,n)=>e.check(dt(o,n)),e.min=(o,n)=>e.check(dt(o,n)),e.lt=(o,n)=>e.check(Rr(o,n)),e.lte=(o,n)=>e.check(Ot(o,n)),e.max=(o,n)=>e.check(Ot(o,n)),e.int=o=>e.check(es(o)),e.safe=o=>e.check(es(o)),e.positive=o=>e.check(Pr(0,o)),e.nonnegative=o=>e.check(dt(0,o)),e.negative=o=>e.check(Rr(0,o)),e.nonpositive=o=>e.check(Ot(0,o)),e.multipleOf=(o,n)=>e.check(Jn(o,n)),e.step=(o,n)=>e.check(Jn(o,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Z(e){return gw(zi,e)}const hn=T("ZodNumberFormat",(e,t)=>{h_.init(e,t),zi.init(e,t)});function es(e){return yw(hn,e)}function Sx(e){return bw(hn,e)}function kx(e){return _w(hn,e)}function Ex(e){return ww(hn,e)}function Ix(e){return xw(hn,e)}const Mi=T("ZodBoolean",(e,t)=>{Ld.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yw(e,r,o)});function mt(e){return Sw(Mi,e)}const Ui=T("ZodBigInt",(e,t)=>{Fd.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Xw(e,o),e.gte=(o,n)=>e.check(dt(o,n)),e.min=(o,n)=>e.check(dt(o,n)),e.gt=(o,n)=>e.check(Pr(o,n)),e.gte=(o,n)=>e.check(dt(o,n)),e.min=(o,n)=>e.check(dt(o,n)),e.lt=(o,n)=>e.check(Rr(o,n)),e.lte=(o,n)=>e.check(Ot(o,n)),e.max=(o,n)=>e.check(Ot(o,n)),e.positive=o=>e.check(Pr(BigInt(0),o)),e.negative=o=>e.check(Rr(BigInt(0),o)),e.nonpositive=o=>e.check(Ot(BigInt(0),o)),e.nonnegative=o=>e.check(dt(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Jn(o,n));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Tx(e){return Ew(Ui,e)}const vc=T("ZodBigIntFormat",(e,t)=>{g_.init(e,t),Ui.init(e,t)});function $x(e){return Tw(vc,e)}function Ox(e){return $w(vc,e)}const Ef=T("ZodSymbol",(e,t)=>{v_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qw(e,r)});function Ax(e){return Ow(Ef,e)}const If=T("ZodUndefined",(e,t)=>{y_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>t0(e,r)});function Cx(e){return Aw(If,e)}const Tf=T("ZodNull",(e,t)=>{b_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>e0(e,r,o)});function yc(e){return Cw(Tf,e)}const $f=T("ZodAny",(e,t)=>{__.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>o0()});function Me(){return Nw($f)}const Of=T("ZodUnknown",(e,t)=>{w_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>i0()});function Qe(){return Rw(Of)}const Af=T("ZodNever",(e,t)=>{x_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>n0(e,r,o)});function bc(e){return Pw(Af,e)}const Cf=T("ZodVoid",(e,t)=>{S_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>r0(e,r)});function Nx(e){return jw(Cf,e)}const _c=T("ZodDate",(e,t)=>{k_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>a0(e,o),e.min=(o,n)=>e.check(dt(o,n)),e.max=(o,n)=>e.check(Ot(o,n));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Rx(e){return Dw(_c,e)}const Nf=T("ZodArray",(e,t)=>{E_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>y0(e,r,o,n),e.element=t.element,e.min=(r,o)=>e.check(on(r,o)),e.nonempty=r=>e.check(on(1,r)),e.max=(r,o)=>e.check(Ni(r,o)),e.length=(r,o)=>e.check(Ri(r,o)),e.unwrap=()=>e.element});function D(e,t){return Uw(Nf,e,t)}function Px(e){const t=e._zod.def.shape;return gn(Object.keys(t))}const Li=T("ZodObject",(e,t)=>{O_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>b0(e,r,o,n),de(e,"shape",()=>t.shape),e.keyof=()=>gn(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qe()}),e.strict=()=>e.clone({...e._zod.def,catchall:bc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Iy(e,r),e.safeExtend=r=>Ty(e,r),e.merge=r=>$y(e,r),e.pick=r=>ky(e,r),e.omit=r=>Ey(e,r),e.partial=(...r)=>Oy(xc,e,r[0]),e.required=(...r)=>Ay(Sc,e,r[0])});function O(e,t){const r={type:"object",shape:e??{},...C(t)};return new Li(r)}function jx(e,t){return new Li({type:"object",shape:e,catchall:bc(),...C(t)})}function Ir(e,t){return new Li({type:"object",shape:e,catchall:Qe(),...C(t)})}const Fi=T("ZodUnion",(e,t)=>{Ms.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vf(e,r,o,n),e.options=t.options});function fe(e,t){return new Fi({type:"union",options:e,...C(t)})}const Rf=T("ZodXor",(e,t)=>{Fi.init(e,t),A_.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vf(e,r,o,n),e.options=t.options});function Dx(e,t){return new Rf({type:"union",options:e,inclusive:!1,...C(t)})}const Pf=T("ZodDiscriminatedUnion",(e,t)=>{Fi.init(e,t),C_.init(e,t)});function jf(e,t,r){return new Pf({type:"union",options:t,discriminator:e,...C(r)})}const Df=T("ZodIntersection",(e,t)=>{N_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_0(e,r,o,n)});function zf(e,t){return new Df({type:"intersection",left:e,right:t})}const Mf=T("ZodTuple",(e,t)=>{Vd.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>w0(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Uf(e,t,r){const o=t instanceof Y,n=o?r:t,i=o?t:null;return new Mf({type:"tuple",items:e,rest:i,...C(n)})}const Vi=T("ZodRecord",(e,t)=>{R_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>x0(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function nr(e,t,r){return new Vi({type:"record",keyType:e,valueType:t,...C(r)})}function zx(e,t,r){const o=Nt(e);return o._zod.values=void 0,new Vi({type:"record",keyType:o,valueType:t,...C(r)})}function Mx(e,t,r){return new Vi({type:"record",keyType:e,valueType:t,mode:"loose",...C(r)})}const Lf=T("ZodMap",(e,t)=>{P_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>g0(e,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ux(e,t,r){return new Lf({type:"map",keyType:e,valueType:t,...C(r)})}const Ff=T("ZodSet",(e,t)=>{j_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>v0(e,r),e.min=(...r)=>e.check(Kn(...r)),e.nonempty=r=>e.check(Kn(1,r)),e.max=(...r)=>e.check(Ci(...r)),e.size=(...r)=>e.check(Ls(...r))});function Lx(e,t){return new Ff({type:"set",valueType:e,...C(t)})}const eo=T("ZodEnum",(e,t)=>{D_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>s0(e,o,n),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{const i={};for(const a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new eo({...t,checks:[],...C(n),entries:i})},e.exclude=(o,n)=>{const i={...t.entries};for(const a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new eo({...t,checks:[],...C(n),entries:i})}});function gn(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new eo({type:"enum",entries:r,...C(t)})}function Fx(e,t){return new eo({type:"enum",entries:e,...C(t)})}const Vf=T("ZodLiteral",(e,t)=>{z_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>c0(e,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function B(e,t){return new Vf({type:"literal",values:Array.isArray(e)?e:[e],...C(t)})}const Zf=T("ZodFile",(e,t)=>{M_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>d0(e,r,o),e.min=(r,o)=>e.check(Kn(r,o)),e.max=(r,o)=>e.check(Ci(r,o)),e.mime=(r,o)=>e.check(Hs(Array.isArray(r)?r:[r],o))});function Vx(e){return Lw(Zf,e)}const Bf=T("ZodTransform",(e,t)=>{U_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>h0(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Rs(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(Hn(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Hn(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function wc(e){return new Bf({type:"transform",transform:e})}const xc=T("ZodOptional",(e,t)=>{L_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>C0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function re(e){return new xc({type:"optional",innerType:e})}const qf=T("ZodNullable",(e,t)=>{F_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>S0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Qo(e){return new qf({type:"nullable",innerType:e})}function Zx(e){return re(Qo(e))}const Gf=T("ZodDefault",(e,t)=>{V_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>E0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hf(e,t){return new Gf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():js(t)}})}const Wf=T("ZodPrefault",(e,t)=>{Z_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>I0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Jf(e,t){return new Wf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():js(t)}})}const Sc=T("ZodNonOptional",(e,t)=>{B_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>k0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Kf(e,t){return new Sc({type:"nonoptional",innerType:e,...C(t)})}const Yf=T("ZodSuccess",(e,t)=>{q_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>f0(e,r,o),e.unwrap=()=>e._zod.def.innerType});function Bx(e){return new Yf({type:"success",innerType:e})}const Xf=T("ZodCatch",(e,t)=>{G_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>T0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Qf(e,t){return new Xf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const em=T("ZodNaN",(e,t)=>{H_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>l0(e,r)});function qx(e){return Mw(em,e)}const kc=T("ZodPipe",(e,t)=>{W_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$0(e,r,o,n),e.in=t.in,e.out=t.out});function ei(e,t){return new kc({type:"pipe",in:e,out:t})}const Ec=T("ZodCodec",(e,t)=>{kc.init(e,t),Zd.init(e,t)});function Gx(e,t,r){return new Ec({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}const tm=T("ZodReadonly",(e,t)=>{J_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>O0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rm(e){return new tm({type:"readonly",innerType:e})}const nm=T("ZodTemplateLiteral",(e,t)=>{K_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>u0(e,r,o)});function Hx(e,t){return new nm({type:"template_literal",parts:e,...C(t)})}const om=T("ZodLazy",(e,t)=>{Q_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>N0(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Ic(e){return new om({type:"lazy",getter:e})}const im=T("ZodPromise",(e,t)=>{X_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>A0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Wx(e){return new im({type:"promise",innerType:e})}const am=T("ZodFunction",(e,t)=>{Y_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>p0(e,r)});function ts(e){return new am({type:"function",input:Array.isArray(e?.input)?Uf(e?.input):e?.input??D(Qe()),output:e?.output??Qe()})}const Zi=T("ZodCustom",(e,t)=>{ew.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>m0(e,r)});function Jx(e){const t=new Ae({check:"custom"});return t._zod.check=e,t}function sm(e,t){return Fw(Zi,e??(()=>!0),t)}function cm(e,t={}){return Vw(Zi,e,t)}function lm(e){return Zw(e)}const Kx=qw,Yx=Gw;function to(e,t={error:`Input not instance of ${e.name}`}){const r=new Zi({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...C(t)});return r._zod.bag.Class=e,r}const Xx=(...e)=>Hw({Codec:Ec,Boolean:Mi,String:ji},...e);function Qx(e){const t=Ic(()=>fe([S(e),Z(),mt(),yc(),D(t),nr(S(),t)]));return t}function eS(e,t){return ei(wc(e),t)}const HN=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:$f,ZodArray:Nf,ZodBase64:fc,ZodBase64URL:pc,ZodBigInt:Ui,ZodBigIntFormat:vc,ZodBoolean:Mi,ZodCIDRv4:uc,ZodCIDRv6:dc,ZodCUID:nc,ZodCUID2:oc,ZodCatch:Xf,ZodCodec:Ec,ZodCustom:Zi,ZodCustomStringFormat:fo,ZodDate:_c,ZodDefault:Gf,ZodDiscriminatedUnion:Pf,ZodE164:hc,ZodEmail:ec,ZodEmoji:tc,ZodEnum:eo,ZodFile:Zf,ZodFunction:am,ZodGUID:Xo,ZodIPv4:cc,ZodIPv6:lc,ZodIntersection:Df,ZodJWT:gc,ZodKSUID:sc,ZodLazy:om,ZodLiteral:Vf,ZodMAC:kf,ZodMap:Lf,ZodNaN:em,ZodNanoID:rc,ZodNever:Af,ZodNonOptional:Sc,ZodNull:Tf,ZodNullable:qf,ZodNumber:zi,ZodNumberFormat:hn,ZodObject:Li,ZodOptional:xc,ZodPipe:kc,ZodPrefault:Wf,ZodPromise:im,ZodReadonly:tm,ZodRecord:Vi,ZodSet:Ff,ZodString:ji,ZodStringFormat:Ie,ZodSuccess:Yf,ZodSymbol:Ef,ZodTemplateLiteral:nm,ZodTransform:Bf,ZodTuple:Mf,ZodType:ie,ZodULID:ic,ZodURL:Di,ZodUUID:Qt,ZodUndefined:If,ZodUnion:Fi,ZodUnknown:Of,ZodVoid:Cf,ZodXID:ac,ZodXor:Rf,_ZodString:Qs,_default:Hf,_function:ts,any:Me,array:D,base64:mc,base64url:gx,bigint:Tx,boolean:mt,catch:Qf,check:Jx,cidrv4:px,cidrv6:hx,codec:Gx,cuid:ax,cuid2:sx,custom:sm,date:Rx,describe:Kx,discriminatedUnion:jf,e164:vx,email:K0,emoji:ox,enum:gn,file:Vx,float32:Sx,float64:kx,function:ts,guid:Y0,hash:xx,hex:wx,hostname:_x,httpUrl:nx,instanceof:to,int:es,int32:Ex,int64:$x,intersection:zf,ipv4:dx,ipv6:mx,json:Qx,jwt:yx,keyof:Px,ksuid:ux,lazy:Ic,literal:B,looseObject:Ir,looseRecord:Mx,mac:fx,map:Ux,meta:Yx,nan:qx,nanoid:ix,nativeEnum:Fx,never:bc,nonoptional:Kf,null:yc,nullable:Qo,nullish:Zx,number:Z,object:O,optional:re,partialRecord:zx,pipe:ei,prefault:Jf,preprocess:eS,promise:Wx,readonly:rm,record:nr,refine:cm,set:Lx,strictObject:jx,string:S,stringFormat:bx,stringbool:Xx,success:Bx,superRefine:lm,symbol:Ax,templateLiteral:Hx,transform:wc,tuple:Uf,uint32:Ix,uint64:Ox,ulid:cx,undefined:Cx,union:fe,unknown:Qe,url:rx,uuid:X0,uuidv4:Q0,uuidv6:ex,uuidv7:tx,void:Nx,xid:lx,xor:Dx},Symbol.toStringTag,{value:"Module"})),tS={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function WN(e){Xe({customError:e})}function JN(){return Xe().customError}var Eu;Eu||(Eu={});const j={...HN,...qN,iso:z0};function KN(e,t){const r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function YN(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;const o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){const n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function rS(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return j.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){const n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return j.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);const i=YN(n,t),a=Ye(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){const n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return j.null();if(n.length===0)return j.never();if(n.length===1)return j.literal(n[0]);if(n.every(a=>typeof a=="string"))return j.enum(n);const i=n.map(a=>j.literal(a));return i.length<2?i[0]:j.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return j.literal(e.const);const r=e.type;if(Array.isArray(r)){const n=r.map(i=>{const a={...e,type:i};return rS(a,t)});return n.length===0?j.never():n.length===1?n[0]:j.union(n)}if(!r)return j.any();let o;switch(r){case"string":{let n=j.string();if(e.format){const i=e.format;i==="email"?n=n.check(j.email()):i==="uri"||i==="uri-reference"?n=n.check(j.url()):i==="uuid"||i==="guid"?n=n.check(j.uuid()):i==="date-time"?n=n.check(j.iso.datetime()):i==="date"?n=n.check(j.iso.date()):i==="time"?n=n.check(j.iso.time()):i==="duration"?n=n.check(j.iso.duration()):i==="ipv4"?n=n.check(j.ipv4()):i==="ipv6"?n=n.check(j.ipv6()):i==="mac"?n=n.check(j.mac()):i==="cidr"?n=n.check(j.cidrv4()):i==="cidr-v6"?n=n.check(j.cidrv6()):i==="base64"?n=n.check(j.base64()):i==="base64url"?n=n.check(j.base64url()):i==="e164"?n=n.check(j.e164()):i==="jwt"?n=n.check(j.jwt()):i==="emoji"?n=n.check(j.emoji()):i==="nanoid"?n=n.check(j.nanoid()):i==="cuid"?n=n.check(j.cuid()):i==="cuid2"?n=n.check(j.cuid2()):i==="ulid"?n=n.check(j.ulid()):i==="xid"?n=n.check(j.xid()):i==="ksuid"&&(n=n.check(j.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?j.number().int():j.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=j.boolean();break}case"null":{o=j.null();break}case"object":{const n={},i=e.properties||{},a=new Set(e.required||[]);for(const[c,l]of Object.entries(i)){const u=Ye(l,t);n[c]=a.has(c)?u:u.optional()}if(e.propertyNames){const c=Ye(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Ye(e.additionalProperties,t):j.any();if(Object.keys(n).length===0){o=j.record(c,l);break}const u=j.object(n).passthrough(),d=j.looseRecord(c,l);o=j.intersection(u,d);break}if(e.patternProperties){const c=e.patternProperties,l=Object.keys(c),u=[];for(const f of l){const m=Ye(c[f],t),g=j.string().regex(new RegExp(f));u.push(j.looseRecord(g,m))}const d=[];if(Object.keys(n).length>0&&d.push(j.object(n).passthrough()),d.push(...u),d.length===0)o=j.object({}).passthrough();else if(d.length===1)o=d[0];else{let f=j.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)f=j.intersection(f,d[m]);o=f}break}const s=j.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Ye(e.additionalProperties,t)):o=s.passthrough();break}case"array":{const n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){const a=n.map(c=>Ye(c,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Ye(i,t):void 0;s?o=j.tuple(a).rest(s):o=j.tuple(a),typeof e.minItems=="number"&&(o=o.check(j.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(j.maxLength(e.maxItems)))}else if(Array.isArray(i)){const a=i.map(c=>Ye(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Ye(e.additionalItems,t):void 0;s?o=j.tuple(a).rest(s):o=j.tuple(a),typeof e.minItems=="number"&&(o=o.check(j.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(j.maxLength(e.maxItems)))}else if(i!==void 0){const a=Ye(i,t);let s=j.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=j.array(j.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}function Ye(e,t){if(typeof e=="boolean")return e?j.any():j.never();let r=rS(e,t);const o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const n=e.anyOf.map(a=>Ye(a,t)),i=j.union(n);r=o?j.intersection(r,i):i}if(e.oneOf&&Array.isArray(e.oneOf)){const n=e.oneOf.map(a=>Ye(a,t)),i=j.xor(n);r=o?j.intersection(r,i):i}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:j.any();else{let n=o?r:Ye(e.allOf[0],t);const i=o?0:1;for(let a=i;a<e.allOf.length;a++)n=j.intersection(n,Ye(e.allOf[a],t));r=n}return e.nullable===!0&&t.version==="openapi-3.0"&&(r=j.nullable(r)),e.readOnly===!0&&(r=j.readonly(r)),r}function XN(e,t){if(typeof e=="boolean")return e?j.any():j.never();const r=KN(e,t?.defaultTarget),o=e.$defs||e.definitions||{};return Ye(e,{version:r,defs:o,refs:new Map,processing:new Set,rootSchema:e})}function QN(e){return lw(ji,e)}function eR(e){return vw(zi,e)}function tR(e){return kw(Mi,e)}function rR(e){return Iw(Ui,e)}function nR(e){return zw(_c,e)}const oR=Object.freeze(Object.defineProperty({__proto__:null,bigint:rR,boolean:tR,date:nR,number:eR,string:QN},Symbol.toStringTag,{value:"Module"}));Xe(tw());const ch=Object.freeze(Object.defineProperty({__proto__:null,$brand:gy,$input:aw,$output:iw,NEVER:_d,TimePrecision:dw,ZodAny:$f,ZodArray:Nf,ZodBase64:fc,ZodBase64URL:pc,ZodBigInt:Ui,ZodBigIntFormat:vc,ZodBoolean:Mi,ZodCIDRv4:uc,ZodCIDRv6:dc,ZodCUID:nc,ZodCUID2:oc,ZodCatch:Xf,ZodCodec:Ec,ZodCustom:Zi,ZodCustomStringFormat:fo,ZodDate:_c,ZodDefault:Gf,ZodDiscriminatedUnion:Pf,ZodE164:hc,ZodEmail:ec,ZodEmoji:tc,ZodEnum:eo,ZodError:GN,ZodFile:Zf,get ZodFirstPartyTypeKind(){return Eu},ZodFunction:am,ZodGUID:Xo,ZodIPv4:cc,ZodIPv6:lc,ZodISODate:_f,ZodISODateTime:bf,ZodISODuration:xf,ZodISOTime:wf,ZodIntersection:Df,ZodIssueCode:tS,ZodJWT:gc,ZodKSUID:sc,ZodLazy:om,ZodLiteral:Vf,ZodMAC:kf,ZodMap:Lf,ZodNaN:em,ZodNanoID:rc,ZodNever:Af,ZodNonOptional:Sc,ZodNull:Tf,ZodNullable:qf,ZodNumber:zi,ZodNumberFormat:hn,ZodObject:Li,ZodOptional:xc,ZodPipe:kc,ZodPrefault:Wf,ZodPromise:im,ZodReadonly:tm,ZodRealError:Et,ZodRecord:Vi,ZodSet:Ff,ZodString:ji,ZodStringFormat:Ie,ZodSuccess:Yf,ZodSymbol:Ef,ZodTemplateLiteral:nm,ZodTransform:Bf,ZodTuple:Mf,ZodType:ie,ZodULID:ic,ZodURL:Di,ZodUUID:Qt,ZodUndefined:If,ZodUnion:Fi,ZodUnknown:Of,ZodVoid:Cf,ZodXID:ac,ZodXor:Rf,_ZodString:Qs,_default:Hf,_function:ts,any:Me,array:D,base64:mc,base64url:gx,bigint:Tx,boolean:mt,catch:Qf,check:Jx,cidrv4:px,cidrv6:hx,clone:Nt,codec:Gx,coerce:oR,config:Xe,core:BN,cuid:ax,cuid2:sx,custom:sm,date:Rx,decode:Z0,decodeAsync:q0,describe:Kx,discriminatedUnion:jf,e164:vx,email:K0,emoji:ox,encode:V0,encodeAsync:B0,endsWith:Gs,enum:gn,file:Vx,flattenError:kd,float32:Sx,float64:kx,formatError:Ed,fromJSONSchema:XN,function:ts,getErrorMap:JN,globalRegistry:Vt,gt:Pr,gte:dt,guid:Y0,hash:xx,hex:wx,hostname:_x,httpUrl:nx,includes:Bs,instanceof:to,int:es,int32:Ex,int64:$x,intersection:zf,ipv4:dx,ipv6:mx,iso:z0,json:Qx,jwt:yx,keyof:Px,ksuid:ux,lazy:Ic,length:Ri,literal:B,locales:ow,looseObject:Ir,looseRecord:Mx,lowercase:Vs,lt:Rr,lte:Ot,mac:fx,map:Ux,maxLength:Ni,maxSize:Ci,meta:Yx,mime:Hs,minLength:on,minSize:Kn,multipleOf:Jn,nan:qx,nanoid:ix,nativeEnum:Fx,negative:mf,never:bc,nonnegative:hf,nonoptional:Kf,nonpositive:pf,normalize:Ws,null:yc,nullable:Qo,nullish:Zx,number:Z,object:O,optional:re,overwrite:xr,parse:U0,parseAsync:L0,partialRecord:zx,pipe:ei,positive:ff,prefault:Jf,preprocess:eS,prettifyError:zy,promise:Wx,property:gf,readonly:rm,record:nr,refine:cm,regex:Fs,regexes:jd,registry:Bd,safeDecode:H0,safeDecodeAsync:J0,safeEncode:G0,safeEncodeAsync:W0,safeParse:F0,safeParseAsync:Sf,set:Lx,setErrorMap:WN,size:Ls,slugify:Xs,startsWith:qs,strictObject:jx,string:S,stringFormat:bx,stringbool:Xx,success:Bx,superRefine:lm,symbol:Ax,templateLiteral:Hx,toJSONSchema:yf,toLowerCase:Ks,toUpperCase:Ys,transform:wc,treeifyError:jy,trim:Js,tuple:Uf,uint32:Ix,uint64:Ox,ulid:cx,undefined:Cx,union:fe,unknown:Qe,uppercase:Zs,url:rx,util:Ry,uuid:X0,uuidv4:Q0,uuidv6:ex,uuidv7:tx,void:Nx,xid:lx,xor:Dx},Symbol.toStringTag,{value:"Module"}));var ti;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const i={};for(const a of n)i[a]=a;return i},e.getValidEnumValues=n=>{const i=e.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),a={};for(const s of i)a[s]=n[s];return e.objectValues(a)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.push(a);return i},e.find=(n,i)=>{for(const a of n)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function o(n,i=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(ti||(ti={}));var lh;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(lh||(lh={}));ti.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);ti.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"]);class rs extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},o={_errors:[]},n=i=>{for(const a of i.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)o._errors.push(r(a));else{let s=o,c=0;for(;c<a.path.length;){const l=a.path[c];c===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(a))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return n(this),o}static assert(t){if(!(t instanceof rs))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ti.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r=Object.create(null),o=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];r[i]=r[i]||[],r[i].push(t(n))}else o.push(t(n));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}}rs.create=e=>new rs(e);var uh;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(uh||(uh={}));var X;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(X||(X={}));var iR=({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{const n=()=>{const i=r.length,a=new Array(t);for(let s=0;s<t;s++)a[s]=r[Math.random()*i|0];return a.join("")};if(e==null)return n;if(r.includes(o))throw new bd({argument:"separator",message:`The separator "${o}" must not be part of the alphabet "${r}".`});return()=>`${e}${o}${n()}`};iR();function nS(e=globalThis){var t,r,o;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(o=(r=e.process)==null?void 0:r.versions)!=null&&o.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function aR(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((r,o)=>{t[o.toLowerCase()]=r});else{Array.isArray(e)||(e=Object.entries(e));for(const[r,o]of e)o!=null&&(t[r.toLowerCase()]=o)}return t}function oS(e,...t){const r=new Headers(aR(e)),o=r.get("user-agent")||"";return r.set("user-agent",[o,...t].filter(Boolean).join(" ")),Object.fromEntries(r.entries())}var sR=Symbol.for("vercel.ai.validator");function cR(e){return{...e,type:"dynamic"}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var lR=Symbol.for("vercel.ai.schema");function uR(e,{validate:t}={}){return{[lR]:!0,_type:void 0,[sR]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}let um;um=globalThis.crypto;async function dR(e){return(await um).getRandomValues(new Uint8Array(e))}async function fR(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let r="";const o=await dR(e);for(let n=0;n<e;n++){const i=o[n]%t.length;r+=t[i]}return r}async function mR(e){return await fR(e)}async function pR(e){const t=await(await um).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function hR(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await mR(e),r=await pR(t);return{code_verifier:t,code_challenge:r}}var gR="AI_MCPClientError",iS=`vercel.ai.error.${gR}`,vR=Symbol.for(iS),dh,fh,we=class extends(fh=ee,dh=vR,fh){constructor({name:e="MCPClientError",message:t,cause:r,data:o,code:n}){super({name:e,message:t,cause:r}),this[dh]=!0,this.data=o,this.code=n}static isInstance(e){return ee.hasMarker(e,iS)}},mo="2025-06-18",yR=[mo,"2025-03-26","2024-11-05"],bR=Ir({name:S(),version:S()}),Tc=Ir({_meta:re(O({}).loose())}),mr=Tc,aS=O({method:S(),params:re(Tc)}),sS=O({applyDefaults:re(mt())}).loose(),_R=Ir({experimental:re(O({}).loose()),logging:re(O({}).loose()),prompts:re(Ir({listChanged:re(mt())})),resources:re(Ir({subscribe:re(mt()),listChanged:re(mt())})),tools:re(Ir({listChanged:re(mt())})),elicitation:re(sS)});O({elicitation:re(sS)}).loose();var wR=mr.extend({protocolVersion:S(),capabilities:_R,serverInfo:bR,instructions:re(S())}),dm=mr.extend({nextCursor:re(S())}),xR=O({name:S(),description:re(S()),inputSchema:O({type:B("object"),properties:re(O({}).loose())}).loose()}).loose(),SR=dm.extend({tools:D(xR)}),cS=O({type:B("text"),text:S()}).loose(),lS=O({type:B("image"),data:mc(),mimeType:S()}).loose(),kR=O({uri:S(),name:S(),title:re(S()),description:re(S()),mimeType:re(S()),size:re(Z())}).loose(),ER=dm.extend({resources:D(kR)}),uS=O({uri:S(),name:re(S()),title:re(S()),mimeType:re(S())}).loose(),dS=uS.extend({text:S()}),fS=uS.extend({blob:mc()}),mS=O({type:B("resource"),resource:fe([dS,fS])}).loose(),IR=mr.extend({content:D(fe([cS,lS,mS])),isError:mt().default(!1).optional()}).or(mr.extend({toolResult:Qe()})),TR=O({uriTemplate:S(),name:S(),title:re(S()),description:re(S()),mimeType:re(S())}).loose(),$R=mr.extend({resourceTemplates:D(TR)}),OR=mr.extend({contents:D(fe([dS,fS]))}),AR=O({name:S(),description:re(S()),required:re(mt())}).loose(),CR=O({name:S(),title:re(S()),description:re(S()),arguments:re(D(AR))}).loose(),NR=dm.extend({prompts:D(CR)}),RR=O({role:fe([B("user"),B("assistant")]),content:fe([cS,lS,mS])}).loose(),PR=mr.extend({description:re(S()),messages:D(RR)}),jR=Tc.extend({message:S(),requestedSchema:Qe()}),mh=aS.extend({method:B("elicitation/create"),params:jR}),DR=mr.extend({action:fe([B("accept"),B("decline"),B("cancel")]),content:re(nr(S(),Qe()))}),$c="2.0",zR=O({jsonrpc:B($c),id:fe([S(),Z().int()])}).merge(aS).strict(),MR=O({jsonrpc:B($c),id:fe([S(),Z().int()]),result:mr}).strict(),UR=O({jsonrpc:B($c),id:fe([S(),Z().int()]),error:O({code:Z().int(),message:S(),data:re(Qe())})}).strict(),LR=O({jsonrpc:B($c)}).merge(O({method:S(),params:re(Tc)})).strict(),Zo=fe([zR,LR,MR,UR]),pS=typeof __PACKAGE_VERSION__<"u"?__PACKAGE_VERSION__:"0.0.0-test",hS=O({access_token:S(),id_token:S().optional(),token_type:S(),expires_in:Z().optional(),scope:S().optional(),refresh_token:S().optional()}).strip(),ft=S().url().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:tS.custom,message:"URL must be parseable",fatal:!0}),_d}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),FR=O({resource:S().url(),authorization_servers:D(ft).optional(),jwks_uri:S().url().optional(),scopes_supported:D(S()).optional(),bearer_methods_supported:D(S()).optional(),resource_signing_alg_values_supported:D(S()).optional(),resource_name:S().optional(),resource_documentation:S().optional(),resource_policy_uri:S().url().optional(),resource_tos_uri:S().url().optional(),tls_client_certificate_bound_access_tokens:mt().optional(),authorization_details_types_supported:D(S()).optional(),dpop_signing_alg_values_supported:D(S()).optional(),dpop_bound_access_tokens_required:mt().optional()}).passthrough(),gS=O({issuer:S(),authorization_endpoint:ft,token_endpoint:ft,registration_endpoint:ft.optional(),scopes_supported:D(S()).optional(),response_types_supported:D(S()),grant_types_supported:D(S()).optional(),code_challenge_methods_supported:D(S()),token_endpoint_auth_methods_supported:D(S()).optional(),token_endpoint_auth_signing_alg_values_supported:D(S()).optional()}).passthrough(),VR=O({issuer:S(),authorization_endpoint:ft,token_endpoint:ft,userinfo_endpoint:ft.optional(),jwks_uri:ft,registration_endpoint:ft.optional(),scopes_supported:D(S()).optional(),response_types_supported:D(S()),grant_types_supported:D(S()).optional(),subject_types_supported:D(S()),id_token_signing_alg_values_supported:D(S()),claims_supported:D(S()).optional(),token_endpoint_auth_methods_supported:D(S()).optional()}).passthrough(),ZR=VR.merge(gS.pick({code_challenge_methods_supported:!0})),BR=O({client_id:S(),client_secret:S().optional(),client_id_issued_at:Z().optional(),client_secret_expires_at:Z().optional()}).strip(),qR=O({redirect_uris:D(ft),token_endpoint_auth_method:S().optional(),grant_types:D(S()).optional(),response_types:D(S()).optional(),client_name:S().optional(),client_uri:ft.optional(),logo_uri:ft.optional(),scope:S().optional(),contacts:D(S()).optional(),tos_uri:ft.optional(),policy_uri:S().optional(),jwks_uri:ft.optional(),jwks:Me().optional(),software_id:S().optional(),software_version:S().optional(),software_statement:S().optional()}).strip(),GR=O({error:S(),error_description:S().optional(),error_uri:S().optional()}),HR=qR.merge(BR),WR="AI_MCPClientOAuthError",vS=`vercel.ai.error.${WR}`,JR=Symbol.for(vS),ph,hh,Bi=class extends(hh=ee,ph=JR,hh){constructor({name:e="MCPClientOAuthError",message:t,cause:r}){super({name:e,message:t,cause:r}),this[ph]=!0}static isInstance(e){return ee.hasMarker(e,vS)}},ro=class extends Bi{};ro.errorCode="server_error";var ns=class extends Bi{};ns.errorCode="invalid_client";var os=class extends Bi{};os.errorCode="invalid_grant";var is=class extends Bi{};is.errorCode="unauthorized_client";var KR={[ro.errorCode]:ro,[ns.errorCode]:ns,[os.errorCode]:os,[is.errorCode]:is};function YR(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function XR({requestedResource:e,configuredResource:t}){const r=typeof e=="string"?new URL(e):new URL(e.href),o=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==o.origin||r.pathname.length<o.pathname.length)return!1;const n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=o.pathname.endsWith("/")?o.pathname:o.pathname+"/";return n.startsWith(i)}var as=class extends Error{constructor(e="Unauthorized"){super(e),this.name="UnauthorizedError"}};function ss(e){var t;const r=(t=e.headers.get("www-authenticate"))!=null?t:e.headers.get("WWW-Authenticate");if(!r)return;const[o,n]=r.split(" ");if(o.toLowerCase()!=="bearer"||!n)return;const i=/resource_metadata="([^"]*)"/,a=r.match(i);if(a)try{return new URL(a[1])}catch{return}}function QR(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function fm(e,t,r=fetch){try{return await r(e,{headers:t})}catch(o){if(o instanceof TypeError)return t?fm(e,void 0,r):void 0;throw o}}async function gh(e,t,r=fetch){return await fm(e,{"MCP-Protocol-Version":t},r)}function eP(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function tP(e,t,r,o){var n,i;const a=new URL(e),s=(n=o?.protocolVersion)!=null?n:mo;let c;if(o?.metadataUrl)c=new URL(o.metadataUrl);else{const u=QR(t,a.pathname);c=new URL(u,(i=o?.metadataServerUrl)!=null?i:a),c.search=a.search}let l=await gh(c,s,r);if(!o?.metadataUrl&&eP(l,a.pathname)){const u=new URL(`/.well-known/${t}`,a);l=await gh(u,s,r)}return l}async function rP(e,t,r=fetch){const o=await tP(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!o||o.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!o.ok)throw new Error(`HTTP ${o.status} trying to load well-known OAuth protected resource metadata.`);return FR.parse(await o.json())}function nP(e){const t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",o=[];if(!r)return o.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),o.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),o;let n=t.pathname;return n.endsWith("/")&&(n=n.slice(0,-1)),o.push({url:new URL(`/.well-known/oauth-authorization-server${n}`,t.origin),type:"oauth"}),o.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),o.push({url:new URL(`/.well-known/openid-configuration${n}`,t.origin),type:"oidc"}),o.push({url:new URL(`${n}/.well-known/openid-configuration`,t.origin),type:"oidc"}),o}async function oP(e,{fetchFn:t=fetch,protocolVersion:r=mo}={}){var o;const n={"MCP-Protocol-Version":r},i=nP(e);for(const{url:a,type:s}of i){const c=await fm(a,n,t);if(c){if(!c.ok){if(c.status>=400&&c.status<500)continue;throw new Error(`HTTP ${c.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${a}`)}if(s==="oauth")return gS.parse(await c.json());{const l=ZR.parse(await c.json());if(!((o=l.code_challenge_methods_supported)!=null&&o.includes("S256")))throw new Error(`Incompatible OIDC provider at ${a}: does not support S256 code challenge method required by MCP specification`);return l}}}}async function iP(e,{metadata:t,clientInformation:r,redirectUrl:o,scope:n,state:i,resource:a}){const s="code",c="S256";let l;if(t){if(l=new URL(t.authorization_endpoint),!t.response_types_supported.includes(s))throw new Error(`Incompatible auth server: does not support response type ${s}`);if(!t.code_challenge_methods_supported||!t.code_challenge_methods_supported.includes(c))throw new Error(`Incompatible auth server: does not support code challenge method ${c}`)}else l=new URL("/authorize",e);const u=await hR(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",s),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",c),l.searchParams.set("redirect_uri",String(o)),i&&l.searchParams.set("state",i),n&&l.searchParams.set("scope",n),n?.includes("offline_access")&&l.searchParams.append("prompt","consent"),a&&l.searchParams.set("resource",a.href),{authorizationUrl:l,codeVerifier:d}}function yS(e,t){const r=e.client_secret!==void 0;return t.length===0?r?"client_secret_post":"none":r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function bS(e,t,r,o){const{client_id:n,client_secret:i}=t;switch(e){case"client_secret_basic":aP(n,i,r);return;case"client_secret_post":sP(n,i,o);return;case"none":cP(n,o);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function aP(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const o=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${o}`)}function sP(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function cP(e,t){t.set("client_id",e)}async function mm(e){const t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{const o=GR.parse(JSON.parse(r)),{error:n,error_description:i,error_uri:a}=o,s=KR[n]||ro;return new s({message:i||"",cause:a})}catch(o){const n=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${o}. Raw body: ${r}`;return new ro({message:n})}}async function lP(e,{metadata:t,clientInformation:r,authorizationCode:o,codeVerifier:n,redirectUri:i,resource:a,addClientAuthentication:s,fetchFn:c}){var l;const u="authorization_code",d=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e);if(t?.grant_types_supported&&!t.grant_types_supported.includes(u))throw new Error(`Incompatible auth server: does not support grant type ${u}`);const f=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),m=new URLSearchParams({grant_type:u,code:o,code_verifier:n,redirect_uri:String(i)});if(s)s(f,m,e,t);else{const h=(l=t?.token_endpoint_auth_methods_supported)!=null?l:[],y=yS(r,h);bS(y,r,f,m)}a&&m.set("resource",a.href);const g=await(c??fetch)(d,{method:"POST",headers:f,body:m});if(!g.ok)throw await mm(g);return hS.parse(await g.json())}async function uP(e,{metadata:t,clientInformation:r,refreshToken:o,resource:n,addClientAuthentication:i,fetchFn:a}){var s;const c="refresh_token";let l;if(t){if(l=new URL(t.token_endpoint),t.grant_types_supported&&!t.grant_types_supported.includes(c))throw new Error(`Incompatible auth server: does not support grant type ${c}`)}else l=new URL("/token",e);const u=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),d=new URLSearchParams({grant_type:c,refresh_token:o});if(i)i(u,d,e,t);else{const m=(s=t?.token_endpoint_auth_methods_supported)!=null?s:[],g=yS(r,m);bS(g,r,u,d)}n&&d.set("resource",n.href);const f=await(a??fetch)(l,{method:"POST",headers:u,body:d});if(!f.ok)throw await mm(f);return hS.parse({refresh_token:o,...await f.json()})}async function dP(e,{metadata:t,clientMetadata:r,fetchFn:o}){let n;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");n=new URL(t.registration_endpoint)}else n=new URL("/register",e);const i=await(o??fetch)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await mm(i);return HR.parse(await i.json())}async function cs(e,t){var r,o;try{return await xl(e,t)}catch(n){if(n instanceof ns||n instanceof is)return await((r=e.invalidateCredentials)==null?void 0:r.call(e,"all")),await xl(e,t);if(n instanceof os)return await((o=e.invalidateCredentials)==null?void 0:o.call(e,"tokens")),await xl(e,t);throw n}}async function fP(e,t,r){const o=YR(e);if(t.validateResourceURL)return await t.validateResourceURL(o,r?.resource);if(r){if(!XR({requestedResource:o,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${o} (or origin)`);return new URL(r.resource)}}async function xl(e,{serverUrl:t,authorizationCode:r,scope:o,resourceMetadataUrl:n,fetchFn:i}){let a,s;try{a=await rP(t,{resourceMetadataUrl:n},i),a.authorization_servers&&a.authorization_servers.length>0&&(s=a.authorization_servers[0])}catch{}s||(s=t);const c=await fP(t,e,a),l=await oP(s,{fetchFn:i});let u=await Promise.resolve(e.clientInformation());if(!u){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const h=await dP(s,{metadata:l,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(h),u=h}if(r!==void 0){const h=await e.codeVerifier(),y=await lP(s,{metadata:l,clientInformation:u,authorizationCode:r,codeVerifier:h,redirectUri:e.redirectUrl,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}const d=await e.tokens();if(d?.refresh_token)try{const h=await uP(s,{metadata:l,clientInformation:u,refreshToken:d.refresh_token,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(h),"AUTHORIZED"}catch(h){if(!(!(h instanceof Bi)||h instanceof ro))throw h}const f=e.state?await e.state():void 0,{authorizationUrl:m,codeVerifier:g}=await iP(s,{metadata:l,clientInformation:u,state:f,redirectUrl:e.redirectUrl,scope:o||e.clientMetadata.scope,resource:c});return await e.saveCodeVerifier(g),await e.redirectToAuthorization(m),"REDIRECT"}var mP=class{constructor({url:e,headers:t,authProvider:r}){this.connected=!1,this.url=new URL(e),this.headers=t,this.authProvider=r}async commonHeaders(e){const t={...this.headers,...e,"mcp-protocol-version":mo};if(this.authProvider){const r=await this.authProvider.tokens();r?.access_token&&(t.Authorization=`Bearer ${r.access_token}`)}return oS(t,`ai-sdk/${pS}`,nS())}async start(){return new Promise((e,t)=>{if(this.connected)return e();this.abortController=new AbortController;const r=async(o=!1)=>{var n,i,a,s,c;try{const l=await this.commonHeaders({Accept:"text/event-stream"}),u=await fetch(this.url.href,{headers:l,signal:(n=this.abortController)==null?void 0:n.signal});if(u.status===401&&this.authProvider&&!o){this.resourceMetadataUrl=ss(u);try{if(await cs(this.authProvider,{serverUrl:this.url,resourceMetadataUrl:this.resourceMetadataUrl})!=="AUTHORIZED"){const h=new as;return(i=this.onerror)==null||i.call(this,h),t(h)}}catch(g){return(a=this.onerror)==null||a.call(this,g),t(g)}return r(!0)}if(!u.ok||!u.body){let g=`MCP SSE Transport Error: ${u.status} ${u.statusText}`;u.status===405&&(g+=". This server does not support SSE transport. Try using `http` transport instead");const h=new we({message:g});return(s=this.onerror)==null||s.call(this,h),t(h)}const f=u.body.pipeThrough(new TextDecoderStream).pipeThrough(new Wa).getReader(),m=async()=>{var g,h,y;try{for(;;){const{done:b,value:w}=await f.read();if(b){if(this.connected)throw this.connected=!1,new we({message:"MCP SSE Transport Error: Connection closed unexpectedly"});return}const{event:x,data:v}=w;if(x==="endpoint"){if(this.endpoint=new URL(v,this.url),this.endpoint.origin!==this.url.origin)throw new we({message:`MCP SSE Transport Error: Endpoint origin does not match connection origin: ${this.endpoint.origin}`});this.connected=!0,e()}else if(x==="message")try{const k=Zo.parse(JSON.parse(v));(g=this.onmessage)==null||g.call(this,k)}catch(k){const E=new we({message:"MCP SSE Transport Error: Failed to parse message",cause:k});(h=this.onerror)==null||h.call(this,E)}}}catch(b){if(b instanceof Error&&b.name==="AbortError")return;(y=this.onerror)==null||y.call(this,b),t(b)}};this.sseConnection={close:()=>f.cancel()},m()}catch(l){if(l instanceof Error&&l.name==="AbortError")return;(c=this.onerror)==null||c.call(this,l),t(l)}};r()})}async close(){var e,t,r;this.connected=!1,(e=this.sseConnection)==null||e.close(),(t=this.abortController)==null||t.abort(),(r=this.onclose)==null||r.call(this)}async send(e){if(!this.endpoint||!this.connected)throw new we({message:"MCP SSE Transport Error: Not connected"});const t=this.endpoint,r=async(o=!1)=>{var n,i,a,s,c;try{const u={method:"POST",headers:await this.commonHeaders({"Content-Type":"application/json"}),body:JSON.stringify(e),signal:(n=this.abortController)==null?void 0:n.signal},d=await fetch(t,u);if(d.status===401&&this.authProvider&&!o){this.resourceMetadataUrl=ss(d);try{if(await cs(this.authProvider,{serverUrl:this.url,resourceMetadataUrl:this.resourceMetadataUrl})!=="AUTHORIZED"){const m=new as;(i=this.onerror)==null||i.call(this,m);return}}catch(f){(a=this.onerror)==null||a.call(this,f);return}return r(!0)}if(!d.ok){const f=await d.text().catch(()=>null),m=new we({message:`MCP SSE Transport Error: POSTing to endpoint (HTTP ${d.status}): ${f}`});(s=this.onerror)==null||s.call(this,m);return}}catch(l){(c=this.onerror)==null||c.call(this,l);return}};await r()}},pP=class{constructor({url:e,headers:t,authProvider:r}){this.inboundReconnectAttempts=0,this.reconnectionOptions={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},this.url=new URL(e),this.headers=t,this.authProvider=r}async commonHeaders(e){const t={...this.headers,...e,"mcp-protocol-version":mo};if(this.sessionId&&(t["mcp-session-id"]=this.sessionId),this.authProvider){const r=await this.authProvider.tokens();r?.access_token&&(t.Authorization=`Bearer ${r.access_token}`)}return oS(t,`ai-sdk/${pS}`,nS())}async start(){if(this.abortController)throw new we({message:"MCP HTTP Transport Error: Transport already started. Note: client.connect() calls start() automatically."});this.abortController=new AbortController,this.openInboundSse()}async close(){var e,t,r;(e=this.inboundSseConnection)==null||e.close();try{if(this.sessionId&&this.abortController&&!this.abortController.signal.aborted){const o=await this.commonHeaders({});await fetch(this.url,{method:"DELETE",headers:o,signal:this.abortController.signal}).catch(()=>{})}}catch{}(t=this.abortController)==null||t.abort(),(r=this.onclose)==null||r.call(this)}async send(e){const t=async(r=!1)=>{var o,n,i,a,s,c,l;try{const d={method:"POST",headers:await this.commonHeaders({"Content-Type":"application/json",Accept:"application/json, text/event-stream"}),body:JSON.stringify(e),signal:(o=this.abortController)==null?void 0:o.signal},f=await fetch(this.url,d),m=f.headers.get("mcp-session-id");if(m&&(this.sessionId=m),f.status===401&&this.authProvider&&!r){this.resourceMetadataUrl=ss(f);try{if(await cs(this.authProvider,{serverUrl:this.url,resourceMetadataUrl:this.resourceMetadataUrl})!=="AUTHORIZED")throw new as}catch(y){throw(n=this.onerror)==null||n.call(this,y),y}return t(!0)}if(f.status===202){this.inboundSseConnection||this.openInboundSse();return}if(!f.ok){const y=await f.text().catch(()=>null);let b=`MCP HTTP Transport Error: POSTing to endpoint (HTTP ${f.status}): ${y}`;f.status===404&&(b+=". This server does not support HTTP transport. Try using `sse` transport instead");const w=new we({message:b});throw(i=this.onerror)==null||i.call(this,w),w}const g=f.headers.get("content-type")||"";if(g.includes("application/json")){const y=await f.json(),b=Array.isArray(y)?y.map(w=>Zo.parse(w)):[Zo.parse(y)];for(const w of b)(a=this.onmessage)==null||a.call(this,w);return}if(g.includes("text/event-stream")){if(!f.body){const x=new we({message:"MCP HTTP Transport Error: text/event-stream response without body"});throw(s=this.onerror)==null||s.call(this,x),x}const b=f.body.pipeThrough(new TextDecoderStream).pipeThrough(new Wa).getReader();(async()=>{var x,v,k;try{for(;;){const{done:E,value:I}=await b.read();if(E)return;const{event:A,data:M}=I;if(A==="message")try{const U=Zo.parse(JSON.parse(M));(x=this.onmessage)==null||x.call(this,U)}catch(U){const K=new we({message:"MCP HTTP Transport Error: Failed to parse message",cause:U});(v=this.onerror)==null||v.call(this,K)}}}catch(E){if(E instanceof Error&&E.name==="AbortError")return;(k=this.onerror)==null||k.call(this,E)}})();return}const h=new we({message:`MCP HTTP Transport Error: Unexpected content type: ${g}`});throw(c=this.onerror)==null||c.call(this,h),h}catch(u){throw(l=this.onerror)==null||l.call(this,u),u}};await t()}getNextReconnectionDelay(e){const{initialReconnectionDelay:t,reconnectionDelayGrowFactor:r,maxReconnectionDelay:o}=this.reconnectionOptions;return Math.min(t*Math.pow(r,e),o)}scheduleInboundSseReconnection(){var e;const{maxRetries:t}=this.reconnectionOptions;if(t>0&&this.inboundReconnectAttempts>=t){(e=this.onerror)==null||e.call(this,new we({message:`MCP HTTP Transport Error: Maximum reconnection attempts (${t}) exceeded.`}));return}const r=this.getNextReconnectionDelay(this.inboundReconnectAttempts);this.inboundReconnectAttempts+=1,setTimeout(async()=>{var o;(o=this.abortController)!=null&&o.signal.aborted||await this.openInboundSse(!1,this.lastInboundEventId)},r)}async openInboundSse(e=!1,t){var r,o,n,i,a,s;try{const c=await this.commonHeaders({Accept:"text/event-stream"});t&&(c["last-event-id"]=t);const l=await fetch(this.url.href,{method:"GET",headers:c,signal:(r=this.abortController)==null?void 0:r.signal}),u=l.headers.get("mcp-session-id");if(u&&(this.sessionId=u),l.status===401&&this.authProvider&&!e){this.resourceMetadataUrl=ss(l);try{if(await cs(this.authProvider,{serverUrl:this.url,resourceMetadataUrl:this.resourceMetadataUrl})!=="AUTHORIZED"){const h=new as;(o=this.onerror)==null||o.call(this,h);return}}catch(g){(n=this.onerror)==null||n.call(this,g);return}return this.openInboundSse(!0,t)}if(l.status===405)return;if(!l.ok||!l.body){const g=new we({message:`MCP HTTP Transport Error: GET SSE failed: ${l.status} ${l.statusText}`});(i=this.onerror)==null||i.call(this,g);return}const f=l.body.pipeThrough(new TextDecoderStream).pipeThrough(new Wa).getReader(),m=async()=>{var g,h,y,b;try{for(;;){const{done:w,value:x}=await f.read();if(w)return;const{event:v,data:k,id:E}=x;if(E&&(this.lastInboundEventId=E),v==="message")try{const I=Zo.parse(JSON.parse(k));(g=this.onmessage)==null||g.call(this,I)}catch(I){const A=new we({message:"MCP HTTP Transport Error: Failed to parse message",cause:I});(h=this.onerror)==null||h.call(this,A)}}}catch(w){if(w instanceof Error&&w.name==="AbortError")return;(y=this.onerror)==null||y.call(this,w),(b=this.abortController)!=null&&b.signal.aborted||this.scheduleInboundSseReconnection()}};this.inboundSseConnection={close:()=>f.cancel()},this.inboundReconnectAttempts=0,m()}catch(c){if(c instanceof Error&&c.name==="AbortError")return;(a=this.onerror)==null||a.call(this,c),(s=this.abortController)!=null&&s.signal.aborted||this.scheduleInboundSseReconnection()}}};function hP(e){switch(e.type){case"sse":return new mP(e);case"http":return new pP(e);default:throw new we({message:"Unsupported or invalid transport configuration. If you are using a custom transport, make sure it implements the MCPTransport interface."})}}function gP(e){return"start"in e&&typeof e.start=="function"&&"send"in e&&typeof e.send=="function"&&"close"in e&&typeof e.close=="function"}var vP="1.0.0";async function yP(e){const t=new bP(e);return await t.init(),t}var bP=class{constructor({transport:e,name:t="ai-sdk-mcp-client",version:r=vP,onUncaughtError:o,capabilities:n}){this.requestMessageId=0,this.responseHandlers=new Map,this.serverCapabilities={},this.isClosed=!0,this.onUncaughtError=o,this.clientCapabilities=n??{},gP(e)?this.transport=e:this.transport=hP(e),this.transport.onclose=()=>this.onClose(),this.transport.onerror=i=>this.onError(i),this.transport.onmessage=i=>{if("method"in i){"id"in i?this.onRequestMessage(i):this.onError(new we({message:"Unsupported message type"}));return}this.onResponse(i)},this.clientInfo={name:t,version:r}}async init(){try{await this.transport.start(),this.isClosed=!1;const e=await this.request({request:{method:"initialize",params:{protocolVersion:mo,capabilities:this.clientCapabilities,clientInfo:this.clientInfo}},resultSchema:wR});if(e===void 0)throw new we({message:"Server sent invalid initialize result"});if(!yR.includes(e.protocolVersion))throw new we({message:`Server's protocol version is not supported: ${e.protocolVersion}`});return this.serverCapabilities=e.capabilities,await this.notification({method:"notifications/initialized"}),this}catch(e){throw await this.close(),e}}async close(){var e;this.isClosed||(await((e=this.transport)==null?void 0:e.close()),this.onClose())}assertCapability(e){switch(e){case"initialize":break;case"tools/list":case"tools/call":if(!this.serverCapabilities.tools)throw new we({message:"Server does not support tools"});break;case"resources/list":case"resources/read":case"resources/templates/list":if(!this.serverCapabilities.resources)throw new we({message:"Server does not support resources"});break;case"prompts/list":case"prompts/get":if(!this.serverCapabilities.prompts)throw new we({message:"Server does not support prompts"});break;default:throw new we({message:`Unsupported method: ${e}`})}}async request({request:e,resultSchema:t,options:r}){return new Promise((o,n)=>{if(this.isClosed)return n(new we({message:"Attempted to send a request from a closed client"}));this.assertCapability(e.method);const i=r?.signal;i?.throwIfAborted();const a=this.requestMessageId++,s={...e,jsonrpc:"2.0",id:a},c=()=>{this.responseHandlers.delete(a)};this.responseHandlers.set(a,l=>{if(i?.aborted)return n(new we({message:"Request was aborted",cause:i.reason}));if(l instanceof Error)return n(l);try{const u=t.parse(l.result);o(u)}catch(u){const d=new we({message:"Failed to parse server response",cause:u});n(d)}}),this.transport.send(s).catch(l=>{c(),n(l)})})}async listTools({params:e,options:t}={}){try{return this.request({request:{method:"tools/list",params:e},resultSchema:SR,options:t})}catch(r){throw r}}async callTool({name:e,args:t,options:r}){try{return this.request({request:{method:"tools/call",params:{name:e,arguments:t}},resultSchema:IR,options:{signal:r?.abortSignal}})}catch(o){throw o}}async listResourcesInternal({params:e,options:t}={}){try{return this.request({request:{method:"resources/list",params:e},resultSchema:ER,options:t})}catch(r){throw r}}async readResourceInternal({uri:e,options:t}){try{return this.request({request:{method:"resources/read",params:{uri:e}},resultSchema:OR,options:t})}catch(r){throw r}}async listResourceTemplatesInternal({options:e}={}){try{return this.request({request:{method:"resources/templates/list"},resultSchema:$R,options:e})}catch(t){throw t}}async listPromptsInternal({params:e,options:t}={}){try{return this.request({request:{method:"prompts/list",params:e},resultSchema:NR,options:t})}catch(r){throw r}}async getPromptInternal({name:e,args:t,options:r}){try{return this.request({request:{method:"prompts/get",params:{name:e,arguments:t}},resultSchema:PR,options:r})}catch(o){throw o}}async notification(e){const t={...e,jsonrpc:"2.0"};await this.transport.send(t)}async tools({schemas:e="automatic"}={}){var t;const r={};try{const o=await this.listTools();for(const{name:n,description:i,inputSchema:a}of o.tools){if(e!=="automatic"&&!(n in e))continue;const s=this,c=async(u,d)=>{var f;return(f=d?.abortSignal)==null||f.throwIfAborted(),s.callTool({name:n,args:u,options:d})},l=e==="automatic"?cR({description:i,inputSchema:uR({...a,properties:(t=a.properties)!=null?t:{},additionalProperties:!1}),execute:c}):{description:i,inputSchema:e[n].inputSchema,execute:c};r[n]=l}return r}catch(o){throw o}}listResources({params:e,options:t}={}){return this.listResourcesInternal({params:e,options:t})}readResource({uri:e,options:t}){return this.readResourceInternal({uri:e,options:t})}listResourceTemplates({options:e}={}){return this.listResourceTemplatesInternal({options:e})}listPrompts({params:e,options:t}={}){return this.listPromptsInternal({params:e,options:t})}getPrompt({name:e,arguments:t,options:r}){return this.getPromptInternal({name:e,args:t,options:r})}onElicitationRequest(e,t){if(e!==mh)throw new we({message:"Unsupported request schema. Only ElicitationRequestSchema is supported."});this.elicitationRequestHandler=t}async onRequestMessage(e){try{if(e.method!=="elicitation/create"){await this.transport.send({jsonrpc:"2.0",id:e.id,error:{code:-32601,message:`Unsupported request method: ${e.method}`}});return}if(!this.elicitationRequestHandler){await this.transport.send({jsonrpc:"2.0",id:e.id,error:{code:-32601,message:"No elicitation handler registered on client"}});return}const t=mh.safeParse({method:e.method,params:e.params});if(!t.success){await this.transport.send({jsonrpc:"2.0",id:e.id,error:{code:-32602,message:`Invalid elicitation request: ${t.error.message}`,data:t.error.issues}});return}try{const r=await this.elicitationRequestHandler(t.data),o=DR.parse(r);await this.transport.send({jsonrpc:"2.0",id:e.id,result:o})}catch(r){await this.transport.send({jsonrpc:"2.0",id:e.id,error:{code:-32603,message:r instanceof Error?r.message:"Failed to handle elicitation request"}}),this.onError(r)}}catch(t){this.onError(t)}}onClose(){if(this.isClosed)return;this.isClosed=!0;const e=new we({message:"Connection closed"});for(const t of this.responseHandlers.values())t(e);this.responseHandlers.clear()}onError(e){this.onUncaughtError&&this.onUncaughtError(e)}onResponse(e){const t=Number(e.id),r=this.responseHandlers.get(t);if(r===void 0)throw new we({message:`Protocol error: Received a response for an unknown message ID: ${JSON.stringify(e)}`});this.responseHandlers.delete(t),r("result"in e?e:new we({message:e.error.message,code:e.error.code,data:e.error.data,cause:e.error}))}},qi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_P={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},wP=class{#e=_P;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#t&&e!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Yr=new wP;function xP(e){setTimeout(e,0)}var an=typeof window>"u"||"Deno"in globalThis;function ut(){}function SP(e,t){return typeof e=="function"?e(t):e}function Iu(e){return typeof e=="number"&&e>=0&&e!==1/0}function _S(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Or(e,t){return typeof e=="function"?e(t):e}function Tt(e,t){return typeof e=="function"?e(t):e}function vh(e,t){const{type:r="all",exact:o,fetchStatus:n,predicate:i,queryKey:a,stale:s}=e;if(a){if(o){if(t.queryHash!==pm(a,t.options))return!1}else if(!ni(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||n&&n!==t.state.fetchStatus||i&&!i(t))}function yh(e,t){const{exact:r,status:o,predicate:n,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(ri(t.options.mutationKey)!==ri(i))return!1}else if(!ni(t.options.mutationKey,i))return!1}return!(o&&t.state.status!==o||n&&!n(t))}function pm(e,t){return(t?.queryKeyHashFn||ri)(e)}function ri(e){return JSON.stringify(e,(t,r)=>Ou(r)?Object.keys(r).sort().reduce((o,n)=>(o[n]=r[n],o),{}):r)}function ni(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ni(e[r],t[r])):!1}var kP=Object.prototype.hasOwnProperty;function Tu(e,t){if(e===t)return e;const r=bh(e)&&bh(t);if(!r&&!(Ou(e)&&Ou(t)))return t;const n=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,s=r?new Array(a):{};let c=0;for(let l=0;l<a;l++){const u=r?l:i[l],d=e[u],f=t[u];if(d===f){s[u]=d,(r?l<n:kP.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){s[u]=f;continue}const m=Tu(d,f);s[u]=m,m===d&&c++}return n===a&&c===n?e:s}function $u(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function bh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ou(e){if(!_h(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!_h(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _h(e){return Object.prototype.toString.call(e)==="[object Object]"}function EP(e){return new Promise(t=>{Yr.setTimeout(t,e)})}function Au(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Tu(e,t)}catch(o){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${o}`),o}return Tu(e,t)}return t}function IP(e,t,r=0){const o=[...e,t];return r&&o.length>r?o.slice(1):o}function TP(e,t,r=0){const o=[t,...e];return r&&o.length>r?o.slice(0,-1):o}var ls=Symbol();function wS(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===ls&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ls?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $P(e,t){return typeof e=="function"?e(...t):!!e}var OP=class extends qi{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!an&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},hm=new OP;function Cu(){let e,t;const r=new Promise((n,i)=>{e=n,t=i});r.status="pending",r.catch(()=>{});function o(n){Object.assign(r,n),delete r.resolve,delete r.reject}return r.resolve=n=>{o({status:"fulfilled",value:n}),e(n)},r.reject=n=>{o({status:"rejected",reason:n}),t(n)},r}var AP=xP;function CP(){let e=[],t=0,r=s=>{s()},o=s=>{s()},n=AP;const i=s=>{t?e.push(s):n(()=>{r(s)})},a=()=>{const s=e;e=[],s.length&&n(()=>{o(()=>{s.forEach(c=>{r(c)})})})};return{batch:s=>{let c;t++;try{c=s()}finally{t--,t||a()}return c},batchCalls:s=>(...c)=>{i(()=>{s(...c)})},schedule:i,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{o=s},setScheduler:s=>{n=s}}}var We=CP(),NP=class extends qi{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!an&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},us=new NP;function RP(e){return Math.min(1e3*2**e,3e4)}function xS(e){return(e??"online")==="online"?us.isOnline():!0}var Nu=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function SS(e){let t=!1,r=0,o;const n=Cu(),i=()=>n.status!=="pending",a=h=>{if(!i()){const y=new Nu(h);f(y),e.onCancel?.(y)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>hm.isFocused()&&(e.networkMode==="always"||us.isOnline())&&e.canRun(),u=()=>xS(e.networkMode)&&e.canRun(),d=h=>{i()||(o?.(),n.resolve(h))},f=h=>{i()||(o?.(),n.reject(h))},m=()=>new Promise(h=>{o=y=>{(i()||l())&&h(y)},e.onPause?.()}).then(()=>{o=void 0,i()||e.onContinue?.()}),g=()=>{if(i())return;let h;const y=r===0?e.initialPromise:void 0;try{h=y??e.fn()}catch(b){h=Promise.reject(b)}Promise.resolve(h).then(d).catch(b=>{if(i())return;const w=e.retry??(an?0:3),x=e.retryDelay??RP,v=typeof x=="function"?x(r,b):x,k=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,b);if(t||!k){f(b);return}r++,e.onFail?.(r,b),EP(v).then(()=>l()?void 0:m()).then(()=>{t?f(b):g()})})};return{promise:n,status:()=>n.status,cancel:a,continue:()=>(o?.(),n),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?g():m().then(g),n)}}var kS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Iu(this.gcTime)&&(this.#e=Yr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(an?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Yr.clearTimeout(this.#e),this.#e=void 0)}},PP=class extends kS{#e;#t;#r;#o;#n;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=xh(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=xh(this.options);t.data!==void 0&&(this.setState(wh(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=Au(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(ut).catch(ut):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Tt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ls||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Or(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!_S(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#a?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(c=>c.options.queryFn);s&&this.setOptions(s.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},n=()=>{const s=wS(this.options,t),l=(()=>{const u={client:this.#o,queryKey:this.queryKey,meta:this.meta};return o(u),u})();return this.#a=!1,this.options.persister?this.options.persister(s,l,this):s(l)},a=(()=>{const s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:n};return o(s),s})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#i({type:"fetch",meta:a.fetchOptions?.meta}),this.#n=SS({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:s=>{s instanceof Nu&&s.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(s,c)=>{this.#i({type:"failed",failureCount:s,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const s=await this.#n.start();if(s===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(s),this.#r.config.onSuccess?.(s,this),this.#r.config.onSettled?.(s,this.state.error,this),s}catch(s){if(s instanceof Nu){if(s.silent)return this.#n.promise;if(s.revert){if(this.state.data===void 0)throw s;return this.state.data}}throw this.#i({type:"error",error:s}),this.#r.config.onError?.(s,this),this.#r.config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ES(r.data,this.options),fetchMeta:e.meta??null};case"success":const o={...r,...wh(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?o:void 0,o;case"error":const n=e.error;return{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),We.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function ES(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function xh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,o=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var jP=class extends qi{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=Cu(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#o=void 0;#n;#s;#a;#i;#h;#f;#m;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Sh(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ru(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ru(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Tt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),t._defaulted&&!$u(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&kh(this.#t,r,this.options,t)&&this.#d(),this.updateResult(),o&&(this.#t!==r||Tt(this.options.enabled,this.#t)!==Tt(t.enabled,this.#t)||Or(this.options.staleTime,this.#t)!==Or(t.staleTime,this.#t))&&this.#g();const n=this.#v();o&&(this.#t!==r||Tt(this.options.enabled,this.#t)!==Tt(t.enabled,this.#t)||n!==this.#c)&&this.#y(n)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return zP(this,r)&&(this.#o=r,this.#s=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(r,o)=>(this.trackProp(o),t?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#x();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ut)),t}#g(){this.#_();const e=Or(this.options.staleTime,this.#t);if(an||this.#o.isStale||!Iu(e))return;const r=_S(this.#o.dataUpdatedAt,e)+1;this.#l=Yr.setTimeout(()=>{this.#o.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(an||Tt(this.options.enabled,this.#t)===!1||!Iu(this.#c)||this.#c===0)&&(this.#u=Yr.setInterval(()=>{(this.options.refetchIntervalInBackground||hm.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#_(){this.#l&&(Yr.clearTimeout(this.#l),this.#l=void 0)}#w(){this.#u&&(Yr.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#t,o=this.options,n=this.#o,i=this.#n,a=this.#s,c=e!==r?e.state:this.#r,{state:l}=e;let u={...l},d=!1,f;if(t._optimisticResults){const A=this.hasListeners(),M=!A&&Sh(e,t),U=A&&kh(e,r,t,o);(M||U)&&(u={...u,...ES(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:h}=u;f=u.data;let y=!1;if(t.placeholderData!==void 0&&f===void 0&&h==="pending"){let A;n?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(A=n.data,y=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,A!==void 0&&(h="success",f=Au(n?.data,A,t),d=!0)}if(t.select&&f!==void 0&&!y)if(n&&f===i?.data&&t.select===this.#h)f=this.#f;else try{this.#h=t.select,f=t.select(f),f=Au(n?.data,f,t),this.#f=f,this.#i=null}catch(A){this.#i=A}this.#i&&(m=this.#i,f=this.#f,g=Date.now(),h="error");const b=u.fetchStatus==="fetching",w=h==="pending",x=h==="error",v=w&&b,k=f!==void 0,I={status:h,fetchStatus:u.fetchStatus,isPending:w,isSuccess:h==="success",isError:x,isInitialLoading:v,isLoading:v,data:f,dataUpdatedAt:u.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:x&&!k,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:x&&k,isStale:gm(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Tt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=K=>{I.status==="error"?K.reject(I.error):I.data!==void 0&&K.resolve(I.data)},M=()=>{const K=this.#a=I.promise=Cu();A(K)},U=this.#a;switch(U.status){case"pending":e.queryHash===r.queryHash&&A(U);break;case"fulfilled":(I.status==="error"||I.data!==U.value)&&M();break;case"rejected":(I.status!=="error"||I.error!==U.reason)&&M();break}}return I}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#s=this.options,this.#n.data!==void 0&&(this.#m=this.#t),$u(t,e))return;this.#o=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,n=typeof o=="function"?o():o;if(n==="all"||!n&&!this.#p.size)return!0;const i=new Set(n??this.#p);return this.options.throwOnError&&i.add("error"),Object.keys(this.#o).some(a=>{const s=a;return this.#o[s]!==e[s]&&i.has(s)})};this.#S({listeners:r()})}#x(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){We.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function DP(e,t){return Tt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Sh(e,t){return DP(e,t)||e.state.data!==void 0&&Ru(e,t,t.refetchOnMount)}function Ru(e,t,r){if(Tt(t.enabled,e)!==!1&&Or(t.staleTime,e)!=="static"){const o=typeof r=="function"?r(e):r;return o==="always"||o!==!1&&gm(e,t)}return!1}function kh(e,t,r,o){return(e!==t||Tt(o.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&gm(e,r)}function gm(e,t){return Tt(t.enabled,e)!==!1&&e.isStaleByTime(Or(t.staleTime,e))}function zP(e,t){return!$u(e.getCurrentResult(),t)}function Eh(e){return{onFetch:(t,r)=>{const o=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},c=0;const l=async()=>{let u=!1;const d=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=wS(t.options,t.fetchOptions),m=async(g,h,y)=>{if(u)return Promise.reject();if(h==null&&g.pages.length)return Promise.resolve(g);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:h,direction:y?"backward":"forward",meta:t.options.meta};return d(E),E})(),x=await f(w),{maxPages:v}=t.options,k=y?TP:IP;return{pages:k(g.pages,x,v),pageParams:k(g.pageParams,h,v)}};if(n&&i.length){const g=n==="backward",h=g?MP:Ih,y={pages:i,pageParams:a},b=h(o,y);s=await m(y,b,g)}else{const g=e??i.length;do{const h=c===0?a[0]??o.initialPageParam:Ih(o,s);if(c>0&&h==null)break;s=await m(s,h),c++}while(c<g)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function Ih(e,{pages:t,pageParams:r}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,r[o],r):void 0}function MP(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var UP=class extends kS{#e;#t;#r;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||LP(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=SS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(i,a)=>{this.#n({type:"failed",failureCount:i,error:a})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const o=this.state.status==="pending",n=!this.#o.canStart();try{if(o)t();else{this.#n({type:"pending",variables:e,isPaused:n}),await this.#r.config.onMutate?.(e,this,r);const a=await this.options.onMutate?.(e,r);a!==this.state.context&&this.#n({type:"pending",context:a,variables:e,isPaused:n})}const i=await this.#o.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#n({type:"success",data:i}),i}catch(i){try{throw await this.#r.config.onError?.(i,e,this.state.context,this,r),await this.options.onError?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,i,e,this.state.context,r),i}finally{this.#n({type:"error",error:i})}}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),We.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function LP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var FP=class extends qi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const o=new UP({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(o),o}add(e){this.#e.add(e);const t=ga(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ga(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const o=r.indexOf(e);o!==-1&&r.splice(o,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ga(e);if(typeof t=="string"){const o=this.#t.get(t)?.find(n=>n.state.status==="pending");return!o||o===e}else return!0}runNext(e){const t=ga(e);return typeof t=="string"?this.#t.get(t)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){We.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>yh(t,r))}findAll(e={}){return this.getAll().filter(t=>yh(e,t))}notify(e){We.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return We.batch(()=>Promise.all(e.map(t=>t.continue().catch(ut))))}};function ga(e){return e.options.scope?.id}var VP=class extends qi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const o=t.queryKey,n=t.queryHash??pm(o,t);let i=this.get(n);return i||(i=new PP({client:e,queryKey:o,queryHash:n,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){We.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>vh(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>vh(e,r)):t}notify(e){We.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){We.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){We.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ZP=class{#e;#t;#r;#o;#n;#s;#a;#i;constructor(e={}){this.#e=e.queryCache||new VP,this.#t=e.mutationCache||new FP,this.#r=e.defaultOptions||{},this.#o=new Map,this.#n=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=hm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=us.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),o=r.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Or(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const o=r.data;return[t,o]})}setQueryData(e,t,r){const o=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(o.queryHash)?.state.data,a=SP(t,i);if(a!==void 0)return this.#e.build(this,o).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return We.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;We.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return We.batch(()=>(r.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},o=We.batch(()=>this.#e.findAll(e).map(n=>n.cancel(r)));return Promise.all(o).then(ut).catch(ut)}invalidateQueries(e,t={}){return We.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},o=We.batch(()=>this.#e.findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let i=n.fetch(void 0,r);return r.throwOnError||(i=i.catch(ut)),n.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(o).then(ut)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Or(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ut).catch(ut)}fetchInfiniteQuery(e){return e.behavior=Eh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ut).catch(ut)}ensureInfiniteQueryData(e){return e.behavior=Eh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return us.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#o.set(ri(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],r={};return t.forEach(o=>{ni(e,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(ri(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(o=>{ni(e,o.mutationKey)&&Object.assign(r,o.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ls&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},IS=_.createContext(void 0),TS=e=>{const t=_.useContext(IS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},BP=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(IS.Provider,{value:e,children:t})),$S=_.createContext(!1),qP=()=>_.useContext($S);$S.Provider;function GP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var HP=_.createContext(GP()),WP=()=>_.useContext(HP),JP=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},KP=e=>{_.useEffect(()=>{e.clearReset()},[e])},YP=({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(n&&e.data===void 0||$P(r,[e.error,o])),XP=e=>{if(e.suspense){const r=n=>n==="static"?n:Math.max(n??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...n)=>r(o(...n)):r(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},QP=(e,t)=>e.isLoading&&e.isFetching&&!t,ej=(e,t)=>e?.suspense&&t.isPending,Th=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function tj(e,t,r){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const o=qP(),n=WP(),i=TS(),a=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),a._optimisticResults=o?"isRestoring":"optimistic",XP(a),JP(a,n),KP(n);const s=!i.getQueryCache().get(a.queryHash),[c]=_.useState(()=>new t(i,a)),l=c.getOptimisticResult(a),u=!o&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(d=>{const f=u?c.subscribe(We.batchCalls(d)):ut;return c.updateResult(),f},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setOptions(a)},[a,c]),ej(a,l))throw Th(a,c,n);if(YP({result:l,errorResetBoundary:n,throwOnError:a.throwOnError,query:i.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw l.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!an&&QP(l,o)&&(s?Th(a,c,n):i.getQueryCache().get(a.queryHash)?.promise)?.catch(ut).finally(()=>{c.updateResult()}),a.notifyOnChangeProps?l:c.trackResult(l)}function OS(e,t){return tj(e,jP)}function rj({auth:e,mcp:t,environment:r,toolsToInclude:o,gramEnvironment:n}){const i=Object.entries(e.headers??{}).map((s,c)=>`${s}:${c}`);return OS({queryKey:["mcpTools",t,n,...i],queryFn:async()=>{$.assert(!e.isLoading,"No auth found"),$.assert(t,"No MCP URL found");const c=await(await yP({name:"gram-elements-mcp-client",transport:{type:"http",url:t,headers:{...nj(r??{}),...e.headers,...n&&{"Gram-Environment":n}}}})).tools();return o?Object.fromEntries(Object.entries(c).filter(([l])=>typeof o=="function"?o({toolName:l}):o.includes(l))):c},enabled:!e.isLoading&&!!t,staleTime:1/0,gcTime:1/0})}const $h="MCP-";function nj(e){return typeof e!="object"||e===null?{}:Object.entries(e).reduce((t,[r,o])=>{const n=r.replace(/_/g,"-"),i=n.startsWith($h)?n:`${$h}${n}`;return t[i]=o,t},{})}const AS=()=>{const e=N.useContext($.ToolApprovalContext);if(!e)throw new Error("useToolApproval must be used within a ToolApprovalProvider");return e};function oj(e){return(e.api?.url||""||"https://app.getgram.ai").replace(/\/+$/,"")}const Oc={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},ur=console,jn={};Object.keys(Oc).forEach(e=>{jn[e]=ur[e]});const Ro="Datadog Browser SDK:",Q={debug:jn.debug.bind(ur,Ro),log:jn.log.bind(ur,Ro),info:jn.info.bind(ur,Ro),warn:jn.warn.bind(ur,Ro),error:jn.error.bind(ur,Ro)},Ac="https://docs.datadoghq.com",ij=`${Ac}/real_user_monitoring/browser/troubleshooting`,vm="More details:";function CS(e,t){return(...r)=>{try{return e(...r)}catch(o){Q.error(t,o)}}}function Xr(e){return e!==0&&Math.random()*100<=e}function Bo(e,t){return+e.toFixed(t)}function aj(e){return Gi(e)&&e>=0&&e<=100}function Gi(e){return typeof e=="number"}function oi(e){return{...e}}function ds(e,t){return Object.keys(e).some(r=>e[r]===t)}function Vr(e){return Object.keys(e).length===0}function NS(e,t){const r={};for(const o of Object.keys(e))r[o]=t(e[o]);return r}function It(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}const or=It(),Cc="WorkerGlobalScope"in or;function jr(e,t){const r=It();let o;return r.Zone&&typeof r.Zone.__symbol__=="function"&&(o=e[r.Zone.__symbol__(t)]),o||(o=e[t]),o}let Pu,RS=!1;function sj(e){Pu=e}function cj(e){RS=e}function ne(e){return function(){return Ar(e,this,arguments)}}function Ar(e,t,r){try{return e.apply(t,r)}catch(o){pr(o)}}function pr(e){if(ju(e),Pu)try{Pu(e)}catch(t){ju(t)}}function ju(...e){RS&&Q.error("[MONITOR]",...e)}function Je(e,t){return jr(It(),"setTimeout")(ne(e),t)}function yt(e){jr(It(),"clearTimeout")(e)}function po(e,t){return jr(It(),"setInterval")(ne(e),t)}function Nc(e){jr(It(),"clearInterval")(e)}function Oh(e){var t;const r=(t=or.queueMicrotask)===null||t===void 0?void 0:t.bind(or);typeof r=="function"?r(ne(e)):Promise.resolve().then(ne(e))}class he{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach(r=>r(t))}addObserver(t){this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(r=>t!==r),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function PS(...e){return new he(t=>{const r=e.map(o=>o.subscribe(n=>t.notify(n)));return()=>r.forEach(o=>o.unsubscribe())})}class jS extends he{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let r=!1;const o={unsubscribe:()=>{r=!0,this.removeObserver(t)}};return Oh(()=>{for(const n of this.buffer){if(r)return;t(n)}r||this.addObserver(t)}),o}unbuffer(){Oh(()=>{this.maxBufferSize=this.buffer.length=0})}}const Ke=1e3,lt=60*Ke,DS=60*lt,lj=24*DS,zS=365*lj;function Hi(e){return{relative:e,timeStamp:dj(e)}}function uj(e){return{relative:bm(e),timeStamp:e}}function dj(e){const t=ct()-performance.now();return t>Wi()?Math.round(ho(t,e)):fj(e)}function MS(){return Math.round(ct()-ho(Wi(),performance.now()))}function oe(e){return Gi(e)?Bo(e*1e6,0):e}function ct(){return new Date().getTime()}function Be(){return ct()}function _t(){return performance.now()}function Ue(){return{relative:_t(),timeStamp:Be()}}function ym(){return{relative:0,timeStamp:Wi()}}function Ne(e,t){return t-e}function ho(e,t){return e+t}function bm(e){return e-Wi()}function fj(e){return Math.round(ho(Wi(),e))}function mj(e){return e<zS}let Sl;function Wi(){var e,t;return Sl===void 0&&(Sl=(t=(e=performance.timing)===null||e===void 0?void 0:e.navigationStart)!==null&&t!==void 0?t:performance.timeOrigin),Sl}function Ji(e,t,r){const o=r&&r.leading!==void 0?r.leading:!0,n=r&&r.trailing!==void 0?r.trailing:!0;let i=!1,a,s;return{throttled:(...c)=>{if(i){a=c;return}o?e(...c):a=c,i=!0,s=Je(()=>{n&&a&&e(...a),i=!1,a=void 0},t)},cancel:()=>{yt(s),i=!1,a=void 0}}}function _e(){}function et(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,et)}const no=/([\w-]+)\s*=\s*([^;]+)/g;function ii(e,t){for(no.lastIndex=0;;){const r=no.exec(e);if(r){if(r[1]===t)return r[2]}else break}}function pj(e){const t=new Map;for(no.lastIndex=0;;){const r=no.exec(e);if(r){const o=r[1],n=r[2];t.has(o)?t.get(o).push(n):t.set(o,[n])}else break}return t}function hj(e){const t=new Map;for(no.lastIndex=0;;){const r=no.exec(e);if(r)t.set(r[1],r[2]);else break}return t}function _m(e,t,r=""){const o=e.charCodeAt(t-1),i=o>=55296&&o<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${r}`}function gj(){return US()===0}function vj(){return US()===1}let va;function US(){return va??(va=yj())}function yj(e=window){var t;const r=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(r)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(r)&&!/chrome|android/i.test(r)?1:2}function wm(e){return Ki(e,location.href).href}function bj(e){try{return!!Ki(e)}catch{return!1}}function _j(e){const t=Ki(e).pathname;return t[0]==="/"?t:`/${t}`}function Ki(e,t){const{URL:r}=wj();try{return t!==void 0?new r(e,t):new r(e)}catch(o){throw new Error(`Failed to construct URL: ${String(o)}`)}}let kl;function wj(){if(!kl){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=or}kl={URL:t.URL},e?.remove()}return kl}function Rc(e,t,r=0,o){const n=new Date;n.setTime(n.getTime()+r);const i=`expires=${n.toUTCString()}`,a=o&&o.crossSite?"none":"strict",s=o&&o.domain?`;domain=${o.domain}`:"",c=o&&o.secure?";secure":"",l=o&&o.partitioned?";partitioned":"";document.cookie=`${e}=${t};${i};path=/;samesite=${a}${s}${c}${l}`}function Pc(e){return ii(document.cookie,e)}function xj(e){return pj(document.cookie).get(e)||[]}let El;function Tr(e){return El||(El=hj(document.cookie)),El.get(e)}function LS(e,t){Rc(e,"",0,t)}function Sj(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${et()}`,r="test";Rc(t,r,lt,e);const o=Pc(t)===r;return LS(t,e),o}catch(t){return Q.error(t),!1}}let Il;function FS(e=location.hostname,t=document.referrer){if(Il===void 0){const r=kj(e,t);if(r){const o=`dd_site_test_${et()}`,n="test",i=r.split(".");let a=i.pop();for(;i.length&&!Pc(o);)a=`${i.pop()}.${a}`,Rc(o,n,Ke,{domain:a});LS(o,{domain:a}),Il=a}}return Il}function kj(e,t){try{return e||Ki(t).hostname}catch{}}const hr="_dd_s";function VS(e,t){for(let r=e.length-1;r>=0;r-=1){const o=e[r];if(t(o,r,e))return o}}function ZS(e){return Object.values(e)}function jc(e){return Object.entries(e)}const vn=4*DS,BS=15*lt,Ej=zS,qS="0",oo={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},GS=/^([a-zA-Z]+)=([a-z0-9-]+)$/,xm="&";function Ij(e){return!!e&&(e.indexOf(xm)!==-1||GS.test(e))}const Tj="1";function Gr(e,t){const r={isExpired:Tj};return t.trackAnonymousUser&&e?.anonymousId&&(r.anonymousId=e?.anonymousId),r}function Da(e){return Vr(e)}function HS(e){return!Da(e)}function qo(e){return e.isExpired!==void 0||!$j(e)}function $j(e){return(e.created===void 0||ct()-Number(e.created)<vn)&&(e.expire===void 0||ct()<Number(e.expire))}function WS(e){e.expire=String(ct()+BS)}function Du(e){return jc(e).map(([t,r])=>t==="anonymousId"?`aid=${r}`:`${t}=${r}`).join(xm)}function Dc(e){const t={};return Ij(e)&&e.split(xm).forEach(r=>{const o=GS.exec(r);if(o!==null){const[,n,i]=o;n==="aid"?t.anonymousId=i:t[n]=i}}),t}const Oj="_dd",Aj="_dd_r",Cj="_dd_l",Nj="rum",Rj="logs";function Pj(e){if(!Tr(hr)){const r=Tr(Oj),o=Tr(Aj),n=Tr(Cj),i={};r&&(i.id=r),n&&/^[01]$/.test(n)&&(i[Rj]=n),o&&/^[012]$/.test(o)&&(i[Nj]=o),HS(i)&&(WS(i),e.persistSession(i))}}const jj=0;function Ah(e){const t=zj(e);return t&&Sj(t)?{type:oo.COOKIE,cookieOptions:t}:void 0}function Dj(e,t){const r={isLockEnabled:gj(),persistSession:o=>Ch(t,e,o,BS),retrieveSession:()=>JS(t,e),expireSession:o=>Ch(t,e,Gr(o,e),vn)};return Pj(r),r}function Ch(e,t,r,o){let n=Du(r);t.betaEncodeCookieOptions&&(n=Du({...r,...Vr(r)?{}:{c:KS(e)}})),Rc(hr,n,t.trackAnonymousUser?Ej:o,e)}function JS(e,t){if(t.betaEncodeCookieOptions)return Mj(e);const r=Pc(hr);return Dc(r)}function zj(e){const t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){const r=FS();if(!r)return;t.domain=r}return t}function KS(e){const t=e.domain?e.domain.split(".").length-1:0;let r=0;return r|=jj<<5,r|=t<<1,r|=e.crossSite?1:0,r.toString(16)}function Mj(e){const t=xj(hr),r=KS(e);let o;for(const n of t.reverse())if(o=Dc(n),o.c===r)break;return o==null||delete o.c,o??{}}const Uj="_dd_test_";function Nh(){try{const e=et(),t=`${Uj}${e}`;localStorage.setItem(t,e);const r=localStorage.getItem(t);return localStorage.removeItem(t),e===r?{type:oo.LOCAL_STORAGE}:void 0}catch{return}}function Lj(e){return{isLockEnabled:!1,persistSession:YS,retrieveSession:XS,expireSession:t=>Fj(t,e)}}function YS(e){localStorage.setItem(hr,Du(e))}function XS(){const e=localStorage.getItem(hr);return Dc(e)}function Fj(e,t){YS(Gr(e,t))}const Vj=10,Zj=100,Bj=Ke,QS="--",ek=[];let za;function Hr(e,t,r=0){var o;const{isLockEnabled:n,persistSession:i,expireSession:a}=t,s=f=>i({...f,lock:l}),c=()=>{const{lock:f,...m}=t.retrieveSession();return{session:m,lock:f&&!Gj(f)?f:void 0}};if(za||(za=e),e!==za){ek.push(e);return}if(n&&r>=Zj){Rh(t);return}let l,u=c();if(n){if(u.lock){ya(e,t,r);return}if(l=qj(),s(u.session),u=c(),u.lock!==l){ya(e,t,r);return}}let d=e.process(u.session);if(n&&(u=c(),u.lock!==l)){ya(e,t,r);return}if(d&&(qo(d)?a(d):(WS(d),n?s(d):i(d))),n&&!(d&&qo(d))){if(u=c(),u.lock!==l){ya(e,t,r);return}i(u.session),d=u.session}(o=e.after)===null||o===void 0||o.call(e,d||u.session),Rh(t)}function ya(e,t,r){Je(()=>{Hr(e,t,r+1)},Vj)}function Rh(e){za=void 0;const t=ek.shift();t&&Hr(t,e)}function qj(){return et()+QS+Be()}function Gj(e){const[,t]=e.split(QS);return!t||Ne(Number(t),Be())>Bj}const Ph=Ke;function Hj(e){switch(e.sessionPersistence){case oo.COOKIE:return Ah(e);case oo.LOCAL_STORAGE:return Nh();case void 0:{let t=Ah(e);return!t&&e.allowFallbackToLocalStorage&&(t=Nh()),t}default:Q.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Wj(e,t){return e.type===oo.COOKIE?Dj(t,e.cookieOptions):Lj(t)}function Jj(e,t,r,o,n=Wj(e,t)){const i=new he,a=new he,s=new he,c=po(m,Ph);let l;h();const{throttled:u,cancel:d}=Ji(()=>{Hr({process:E=>{if(Da(E))return;const I=g(E);return y(I),I},after:E=>{HS(E)&&!b()&&v(E),l=E}},n)},Ph);function f(){Hr({process:E=>b()?g(E):void 0},n)}function m(){const E=n.retrieveSession();qo(E)?Hr({process:I=>qo(I)?Gr(I,t):void 0,after:g},n):g(E)}function g(E){return qo(E)&&(E=Gr(E,t)),b()&&(w(E)?x():(s.notify({previousState:l,newState:E}),l=E)),E}function h(){Hr({process:E=>{if(Da(E))return E.anonymousId=et(),Gr(E,t)},after:E=>{l=E}},n)}function y(E){if(Da(E))return!1;const I=o(E[r]);E[r]=I,delete E.isExpired,I!==qS&&!E.id&&(E.id=et(),E.created=String(ct()))}function b(){return l?.[r]!==void 0}function w(E){return l.id!==E.id||l[r]!==E[r]}function x(){l=Gr(l,t),a.notify()}function v(E){l=E,i.notify()}function k(E){Hr({process:I=>({...I,...E}),after:g},n)}return{expandOrRenewSession:u,expandSession:f,getSession:()=>l,renewObservable:i,expireObservable:a,sessionStateUpdateObservable:s,restartSession:h,expire:E=>{d(),E===!1&&l&&delete l.anonymousId,n.expireSession(l),g(Gr(l,t))},stop:()=>{Nc(c)},updateSessionState:k}}const zu={GRANTED:"granted",NOT_GRANTED:"not-granted"};function Kj(e){const t=new he;return{tryToInit(r){e||(e=r)},update(r){e=r,t.notify()},isGranted(){return e===zu.GRANTED},observable:t}}function yn(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function ai(e){const t=yn(e);return t==="string"||t==="function"||e instanceof RegExp}function zc(e,t,r=!1){return e.some(o=>{try{if(typeof o=="function")return o(t);if(o instanceof RegExp)return o.test(t);if(typeof o=="string")return r?t.startsWith(o):o===t}catch(n){Q.error(n)}return!1})}const Yj=["chrome-extension://","moz-extension://"];function jh(e){return Yj.some(t=>e.includes(t))}function Xj(e,t=""){if(jh(e))return!1;const o=t.split(`
29
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){n(i);continue}if(e.external){const c=e.external.registry.get(i[0])?.id;if(t!==i[0]&&c){n(i);continue}}if(e.metadataRegistry.get(i[0])?.id){n(i);continue}if(a.cycle){n(i);continue}if(a.count>1&&e.reused==="ref"){n(i);continue}}}function Qn(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=a=>{const s=e.seen.get(a),c=s.def??s.schema,l={...c};if(s.ref===null)return;const u=s.ref;if(s.ref=null,u){o(u);const d=e.seen.get(u).schema;d.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(d)):(Object.assign(c,d),Object.assign(c,l))}s.isParent||e.override({zodSchema:a,jsonSchema:c,path:s.path??[]})};for(const a of[...e.seen.entries()].reverse())o(a[0]);const n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);const i=e.external?.defs??{};for(const a of e.seen.entries()){const s=a[1];s.def&&s.defId&&(i[s.defId]=s.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{const a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yo(t,"input"),output:Yo(t,"output")}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function it(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return it(o.element,r);if(o.type==="set")return it(o.valueType,r);if(o.type==="lazy")return it(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return it(o.innerType,r);if(o.type==="intersection")return it(o.left,r)||it(o.right,r);if(o.type==="record"||o.type==="map")return it(o.keyType,r)||it(o.valueType,r);if(o.type==="pipe")return it(o.in,r)||it(o.out,r);if(o.type==="object"){for(const n in o.shape)if(it(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(const n of o.options)if(it(n,r))return!0;return!1}if(o.type==="tuple"){for(const n of o.items)if(it(n,r))return!0;return!!(o.rest&&it(o.rest,r))}return!1}const Ww=(e,t={})=>r=>{const o=Yn({...r,processors:t});return ke(e,o),Xn(o,e),Qn(o,e)},Yo=(e,t)=>r=>{const{libraryOptions:o,target:n}=r??{},i=Yn({...o??{},target:n,io:t,processors:{}});return ke(e,i),Xn(i,e),Qn(i,e)},FN={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Jw=(e,t,r,o)=>{const n=r;n.type="string";const{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=FN[s]??s,n.format===""&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Kw=(e,t,r,o)=>{const n=r,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u),typeof i=="number"&&(n.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof a=="number"&&(n.maximum=a,typeof l=="number"&&t.target!=="draft-04"&&(l<=a?delete n.maximum:delete n.exclusiveMaximum)),typeof c=="number"&&(n.multipleOf=c)},Yw=(e,t,r,o)=>{r.type="boolean"},Xw=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Qw=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},e0=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},t0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},r0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},n0=(e,t,r,o)=>{r.not={}},o0=(e,t,r,o)=>{},i0=(e,t,r,o)=>{},a0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},s0=(e,t,r,o)=>{const n=e._zod.def,i=wd(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},c0=(e,t,r,o)=>{const n=e._zod.def,i=[];for(const a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},l0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},u0=(e,t,r,o)=>{const n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},d0=(e,t,r,o)=>{const n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),c?c.length===1?(i.contentMediaType=c[0],Object.assign(n,i)):n.anyOf=c.map(l=>({...i,contentMediaType:l})):Object.assign(n,i)},f0=(e,t,r,o)=>{r.type="boolean"},m0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},p0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},h0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},g0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},v0=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},y0=(e,t,r,o)=>{const n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=ke(i.element,t,{...o,path:[...o.path,"items"]})},b0=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="object",n.properties={};const a=i.shape;for(const l in a)n.properties[l]=ke(a[l],t,{...o,path:[...o.path,"properties",l]});const s=new Set(Object.keys(a)),c=new Set([...s].filter(l=>{const u=i.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(n.required=Array.from(c)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=ke(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},vf=(e,t,r,o)=>{const n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,c)=>ke(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},_0=(e,t,r,o)=>{const n=e._zod.def,i=ke(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=ke(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c},w0=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((f,m)=>ke(f,t,{...o,path:[...o.path,a,m]})),l=i.rest?ke(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));const{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(n.minItems=u),typeof d=="number"&&(n.maxItems=d)},x0=(e,t,r,o)=>{const n=r,i=e._zod.def;n.type="object",(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=ke(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=ke(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]})},S0=(e,t,r,o)=>{const n=e._zod.def,i=ke(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},k0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},E0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},I0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},T0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},$0=(e,t,r,o)=>{const n=e._zod.def,i=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;ke(i,t,o);const a=t.seen.get(e);a.ref=i},O0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},A0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},C0=(e,t,r,o)=>{const n=e._zod.def;ke(n.innerType,t,o);const i=t.seen.get(e);i.ref=n.innerType},N0=(e,t,r,o)=>{const n=e._zod.innerType;ke(n,t,o);const i=t.seen.get(e);i.ref=n},ku={string:Jw,number:Kw,boolean:Yw,bigint:Xw,symbol:Qw,null:e0,undefined:t0,void:r0,never:n0,any:o0,unknown:i0,date:a0,enum:s0,literal:c0,nan:l0,template_literal:u0,file:d0,success:f0,custom:m0,function:p0,transform:h0,map:g0,set:v0,array:y0,object:b0,union:vf,intersection:_0,tuple:w0,record:x0,nullable:S0,nonoptional:k0,default:E0,prefault:I0,catch:T0,pipe:$0,readonly:O0,promise:A0,optional:C0,lazy:N0};function yf(e,t){if("_idmap"in e){const o=e,n=Yn({...t,processors:ku}),i={};for(const c of o._idmap.entries()){const[l,u]=c;ke(u,n)}const a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(const c of o._idmap.entries()){const[l,u]=c;Xn(n,u),a[l]=Qn(n,u)}if(Object.keys(i).length>0){const c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}const r=Yn({...t,processors:ku});return ke(e,r),Xn(r,e),Qn(r,e)}class VN{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Yn({processors:ku,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return ke(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Xn(this.ctx,t);const o=Qn(this.ctx,t),{"~standard":n,...i}=o;return i}}const ZN=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),BN=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:__,$ZodArray:E_,$ZodAsyncError:tn,$ZodBase64:c_,$ZodBase64URL:u_,$ZodBigInt:Fd,$ZodBigIntFormat:g_,$ZodBoolean:Ld,$ZodCIDRv4:a_,$ZodCIDRv6:s_,$ZodCUID:Wb,$ZodCUID2:Jb,$ZodCatch:G_,$ZodCheck:Ae,$ZodCheckBigIntFormat:kb,$ZodCheckEndsWith:Db,$ZodCheckGreaterThan:zd,$ZodCheckIncludes:Pb,$ZodCheckLengthEquals:Ab,$ZodCheckLessThan:Dd,$ZodCheckLowerCase:Nb,$ZodCheckMaxLength:$b,$ZodCheckMaxSize:Eb,$ZodCheckMimeType:Mb,$ZodCheckMinLength:Ob,$ZodCheckMinSize:Ib,$ZodCheckMultipleOf:xb,$ZodCheckNumberFormat:Sb,$ZodCheckOverwrite:Ub,$ZodCheckProperty:zb,$ZodCheckRegex:Cb,$ZodCheckSizeEquals:Tb,$ZodCheckStartsWith:jb,$ZodCheckStringFormat:Oi,$ZodCheckUpperCase:Rb,$ZodCodec:Zd,$ZodCustom:ew,$ZodCustomStringFormat:p_,$ZodDate:k_,$ZodDefault:V_,$ZodDiscriminatedUnion:C_,$ZodE164:d_,$ZodEmail:Bb,$ZodEmoji:Gb,$ZodEncodeError:Rs,$ZodEnum:D_,$ZodError:Sd,$ZodFile:M_,$ZodFunction:Y_,$ZodGUID:Vb,$ZodIPv4:n_,$ZodIPv6:o_,$ZodISODate:e_,$ZodISODateTime:Qb,$ZodISODuration:r_,$ZodISOTime:t_,$ZodIntersection:N_,$ZodJWT:m_,$ZodKSUID:Xb,$ZodLazy:Q_,$ZodLiteral:z_,$ZodMAC:i_,$ZodMap:P_,$ZodNaN:H_,$ZodNanoID:Hb,$ZodNever:x_,$ZodNonOptional:B_,$ZodNull:b_,$ZodNullable:F_,$ZodNumber:Ud,$ZodNumberFormat:h_,$ZodObject:$_,$ZodObjectJIT:O_,$ZodOptional:L_,$ZodPipe:W_,$ZodPrefault:Z_,$ZodPromise:X_,$ZodReadonly:J_,$ZodRealError:kt,$ZodRecord:R_,$ZodRegistry:sw,$ZodSet:j_,$ZodString:Ai,$ZodStringFormat:Ee,$ZodSuccess:q_,$ZodSymbol:v_,$ZodTemplateLiteral:K_,$ZodTransform:U_,$ZodTuple:Vd,$ZodType:Y,$ZodULID:Kb,$ZodURL:qb,$ZodUUID:Zb,$ZodUndefined:y_,$ZodUnion:Ms,$ZodUnknown:w_,$ZodVoid:S_,$ZodXID:Yb,$ZodXor:A_,$brand:gy,$constructor:T,$input:aw,$output:iw,Doc:Lb,JSONSchema:ZN,JSONSchemaGenerator:VN,NEVER:_d,TimePrecision:dw,_any:Nw,_array:Uw,_base64:cf,_base64url:lf,_bigint:Ew,_boolean:Sw,_catch:jN,_check:Bw,_cidrv4:af,_cidrv6:sf,_coercedBigint:Iw,_coercedBoolean:kw,_coercedDate:zw,_coercedNumber:vw,_coercedString:lw,_cuid:Xd,_cuid2:Qd,_custom:Fw,_date:Dw,_decode:Td,_decodeAsync:Od,_default:NN,_discriminatedUnion:_N,_e164:uf,_email:qd,_emoji:Kd,_encode:Id,_encodeAsync:$d,_endsWith:Gs,_enum:IN,_file:Lw,_float32:bw,_float64:_w,_gt:Pr,_gte:dt,_guid:Qa,_includes:Bs,_int:yw,_int32:ww,_int64:Tw,_intersection:wN,_ipv4:nf,_ipv6:of,_isoDate:mw,_isoDateTime:fw,_isoDuration:hw,_isoTime:pw,_jwt:df,_ksuid:rf,_lazy:UN,_length:Ri,_literal:$N,_lowercase:Vs,_lt:Rr,_lte:Ot,_mac:uw,_map:kN,_max:Ot,_maxLength:Ni,_maxSize:Ci,_mime:Hs,_min:dt,_minLength:on,_minSize:Kn,_multipleOf:Jn,_nan:Mw,_nanoid:Yd,_nativeEnum:TN,_negative:mf,_never:Pw,_nonnegative:hf,_nonoptional:RN,_nonpositive:pf,_normalize:Ws,_null:Cw,_nullable:CN,_number:gw,_optional:AN,_overwrite:xr,_parse:Si,_parseAsync:ki,_pipe:DN,_positive:ff,_promise:LN,_property:gf,_readonly:zN,_record:SN,_refine:Vw,_regex:Fs,_safeDecode:Cd,_safeDecodeAsync:Rd,_safeEncode:Ad,_safeEncodeAsync:Nd,_safeParse:Ei,_safeParseAsync:Ii,_set:EN,_size:Ls,_slugify:Xs,_startsWith:qs,_string:cw,_stringFormat:Pi,_stringbool:Hw,_success:PN,_superRefine:Zw,_symbol:Ow,_templateLiteral:MN,_toLowerCase:Ks,_toUpperCase:Ys,_transform:ON,_trim:Js,_tuple:xN,_uint32:xw,_uint64:$w,_ulid:ef,_undefined:Aw,_union:yN,_unknown:Rw,_uppercase:Zs,_url:Us,_uuid:Gd,_uuidv4:Hd,_uuidv6:Wd,_uuidv7:Jd,_void:jw,_xid:tf,_xor:bN,clone:Nt,config:Xe,createStandardJSONSchemaMethod:Yo,createToJSONSchemaMethod:Ww,decode:QO,decodeAsync:tA,describe:qw,encode:XO,encodeAsync:eA,extractDefs:Xn,finalize:Qn,flattenError:kd,formatError:Ed,globalConfig:Ja,globalRegistry:Vt,initializeContext:Yn,isValidBase64:Md,isValidBase64URL:l_,isValidJWT:f_,locales:ow,meta:Gw,parse:wu,parseAsync:xu,prettifyError:zy,process:ke,regexes:jd,registry:Bd,safeDecode:nA,safeDecodeAsync:iA,safeEncode:rA,safeEncodeAsync:oA,safeParse:My,safeParseAsync:Uy,toDotPath:Dy,toJSONSchema:yf,treeifyError:jy,util:Ry,version:Fb},Symbol.toStringTag,{value:"Module"})),qN=Object.freeze(Object.defineProperty({__proto__:null,endsWith:Gs,gt:Pr,gte:dt,includes:Bs,length:Ri,lowercase:Vs,lt:Rr,lte:Ot,maxLength:Ni,maxSize:Ci,mime:Hs,minLength:on,minSize:Kn,multipleOf:Jn,negative:mf,nonnegative:hf,nonpositive:pf,normalize:Ws,overwrite:xr,positive:ff,property:gf,regex:Fs,size:Ls,slugify:Xs,startsWith:qs,toLowerCase:Ks,toUpperCase:Ys,trim:Js,uppercase:Zs},Symbol.toStringTag,{value:"Module"})),bf=T("ZodISODateTime",(e,t)=>{Qb.init(e,t),Ie.init(e,t)});function R0(e){return fw(bf,e)}const _f=T("ZodISODate",(e,t)=>{e_.init(e,t),Ie.init(e,t)});function P0(e){return mw(_f,e)}const wf=T("ZodISOTime",(e,t)=>{t_.init(e,t),Ie.init(e,t)});function j0(e){return pw(wf,e)}const xf=T("ZodISODuration",(e,t)=>{r_.init(e,t),Ie.init(e,t)});function D0(e){return hw(xf,e)}const z0=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:_f,ZodISODateTime:bf,ZodISODuration:xf,ZodISOTime:wf,date:P0,datetime:R0,duration:D0,time:j0},Symbol.toStringTag,{value:"Module"})),M0=(e,t)=>{Sd.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Ed(e,r)},flatten:{value:r=>kd(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ka,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ka,2)}},isEmpty:{get(){return e.issues.length===0}}})},GN=T("ZodError",M0),Et=T("ZodError",M0,{Parent:Error}),U0=Si(Et),L0=ki(Et),F0=Ei(Et),Sf=Ii(Et),V0=Id(Et),Z0=Td(Et),B0=$d(Et),q0=Od(Et),G0=Ad(Et),H0=Cd(Et),W0=Nd(Et),J0=Rd(Et),ie=T("ZodType",(e,t)=>(Y.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yo(e,"input"),output:Yo(e,"output")}}),e.toJSONSchema=Ww(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(wr(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(r,o)=>Nt(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>U0(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>F0(e,r,o),e.parseAsync=async(r,o)=>L0(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Sf(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>V0(e,r,o),e.decode=(r,o)=>Z0(e,r,o),e.encodeAsync=async(r,o)=>B0(e,r,o),e.decodeAsync=async(r,o)=>q0(e,r,o),e.safeEncode=(r,o)=>G0(e,r,o),e.safeDecode=(r,o)=>H0(e,r,o),e.safeEncodeAsync=async(r,o)=>W0(e,r,o),e.safeDecodeAsync=async(r,o)=>J0(e,r,o),e.refine=(r,o)=>e.check(cm(r,o)),e.superRefine=r=>e.check(lm(r)),e.overwrite=r=>e.check(xr(r)),e.optional=()=>re(e),e.nullable=()=>Qo(e),e.nullish=()=>re(Qo(e)),e.nonoptional=r=>Kf(e,r),e.array=()=>D(e),e.or=r=>fe([e,r]),e.and=r=>zf(e,r),e.transform=r=>ei(e,wc(r)),e.default=r=>Hf(e,r),e.prefault=r=>Jf(e,r),e.catch=r=>Qf(e,r),e.pipe=r=>ei(e,r),e.readonly=()=>rm(e),e.describe=r=>{const o=e.clone();return Vt.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Vt.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Vt.get(e);const o=e.clone();return Vt.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Qs=T("_ZodString",(e,t)=>{Ai.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Jw(e,o,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(Fs(...o)),e.includes=(...o)=>e.check(Bs(...o)),e.startsWith=(...o)=>e.check(qs(...o)),e.endsWith=(...o)=>e.check(Gs(...o)),e.min=(...o)=>e.check(on(...o)),e.max=(...o)=>e.check(Ni(...o)),e.length=(...o)=>e.check(Ri(...o)),e.nonempty=(...o)=>e.check(on(1,...o)),e.lowercase=o=>e.check(Vs(o)),e.uppercase=o=>e.check(Zs(o)),e.trim=()=>e.check(Js()),e.normalize=(...o)=>e.check(Ws(...o)),e.toLowerCase=()=>e.check(Ks()),e.toUpperCase=()=>e.check(Ys()),e.slugify=()=>e.check(Xs())}),ji=T("ZodString",(e,t)=>{Ai.init(e,t),Qs.init(e,t),e.email=r=>e.check(qd(ec,r)),e.url=r=>e.check(Us(Di,r)),e.jwt=r=>e.check(df(gc,r)),e.emoji=r=>e.check(Kd(tc,r)),e.guid=r=>e.check(Qa(Xo,r)),e.uuid=r=>e.check(Gd(Qt,r)),e.uuidv4=r=>e.check(Hd(Qt,r)),e.uuidv6=r=>e.check(Wd(Qt,r)),e.uuidv7=r=>e.check(Jd(Qt,r)),e.nanoid=r=>e.check(Yd(rc,r)),e.guid=r=>e.check(Qa(Xo,r)),e.cuid=r=>e.check(Xd(nc,r)),e.cuid2=r=>e.check(Qd(oc,r)),e.ulid=r=>e.check(ef(ic,r)),e.base64=r=>e.check(cf(fc,r)),e.base64url=r=>e.check(lf(pc,r)),e.xid=r=>e.check(tf(ac,r)),e.ksuid=r=>e.check(rf(sc,r)),e.ipv4=r=>e.check(nf(cc,r)),e.ipv6=r=>e.check(of(lc,r)),e.cidrv4=r=>e.check(af(uc,r)),e.cidrv6=r=>e.check(sf(dc,r)),e.e164=r=>e.check(uf(hc,r)),e.datetime=r=>e.check(R0(r)),e.date=r=>e.check(P0(r)),e.time=r=>e.check(j0(r)),e.duration=r=>e.check(D0(r))});function S(e){return cw(ji,e)}const Ie=T("ZodStringFormat",(e,t)=>{Ee.init(e,t),Qs.init(e,t)}),ec=T("ZodEmail",(e,t)=>{Bb.init(e,t),Ie.init(e,t)});function K0(e){return qd(ec,e)}const Xo=T("ZodGUID",(e,t)=>{Vb.init(e,t),Ie.init(e,t)});function Y0(e){return Qa(Xo,e)}const Qt=T("ZodUUID",(e,t)=>{Zb.init(e,t),Ie.init(e,t)});function X0(e){return Gd(Qt,e)}function Q0(e){return Hd(Qt,e)}function ex(e){return Wd(Qt,e)}function tx(e){return Jd(Qt,e)}const Di=T("ZodURL",(e,t)=>{qb.init(e,t),Ie.init(e,t)});function rx(e){return Us(Di,e)}function nx(e){return Us(Di,{protocol:/^https?$/,hostname:ob,...C(e)})}const tc=T("ZodEmoji",(e,t)=>{Gb.init(e,t),Ie.init(e,t)});function ox(e){return Kd(tc,e)}const rc=T("ZodNanoID",(e,t)=>{Hb.init(e,t),Ie.init(e,t)});function ix(e){return Yd(rc,e)}const nc=T("ZodCUID",(e,t)=>{Wb.init(e,t),Ie.init(e,t)});function ax(e){return Xd(nc,e)}const oc=T("ZodCUID2",(e,t)=>{Jb.init(e,t),Ie.init(e,t)});function sx(e){return Qd(oc,e)}const ic=T("ZodULID",(e,t)=>{Kb.init(e,t),Ie.init(e,t)});function cx(e){return ef(ic,e)}const ac=T("ZodXID",(e,t)=>{Yb.init(e,t),Ie.init(e,t)});function lx(e){return tf(ac,e)}const sc=T("ZodKSUID",(e,t)=>{Xb.init(e,t),Ie.init(e,t)});function ux(e){return rf(sc,e)}const cc=T("ZodIPv4",(e,t)=>{n_.init(e,t),Ie.init(e,t)});function dx(e){return nf(cc,e)}const kf=T("ZodMAC",(e,t)=>{i_.init(e,t),Ie.init(e,t)});function fx(e){return uw(kf,e)}const lc=T("ZodIPv6",(e,t)=>{o_.init(e,t),Ie.init(e,t)});function mx(e){return of(lc,e)}const uc=T("ZodCIDRv4",(e,t)=>{a_.init(e,t),Ie.init(e,t)});function px(e){return af(uc,e)}const dc=T("ZodCIDRv6",(e,t)=>{s_.init(e,t),Ie.init(e,t)});function hx(e){return sf(dc,e)}const fc=T("ZodBase64",(e,t)=>{c_.init(e,t),Ie.init(e,t)});function mc(e){return cf(fc,e)}const pc=T("ZodBase64URL",(e,t)=>{u_.init(e,t),Ie.init(e,t)});function gx(e){return lf(pc,e)}const hc=T("ZodE164",(e,t)=>{d_.init(e,t),Ie.init(e,t)});function vx(e){return uf(hc,e)}const gc=T("ZodJWT",(e,t)=>{m_.init(e,t),Ie.init(e,t)});function yx(e){return df(gc,e)}const fo=T("ZodCustomStringFormat",(e,t)=>{p_.init(e,t),Ie.init(e,t)});function bx(e,t,r={}){return Pi(fo,e,t,r)}function _x(e){return Pi(fo,"hostname",nb,e)}function wx(e){return Pi(fo,"hex",_b,e)}function xx(e,t){const r=t?.enc??"hex",o=`${e}_${r}`,n=jd[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Pi(fo,o,n,t)}const zi=T("ZodNumber",(e,t)=>{Ud.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Kw(e,o,n),e.gt=(o,n)=>e.check(Pr(o,n)),e.gte=(o,n)=>e.check(dt(o,n)),e.min=(o,n)=>e.check(dt(o,n)),e.lt=(o,n)=>e.check(Rr(o,n)),e.lte=(o,n)=>e.check(Ot(o,n)),e.max=(o,n)=>e.check(Ot(o,n)),e.int=o=>e.check(es(o)),e.safe=o=>e.check(es(o)),e.positive=o=>e.check(Pr(0,o)),e.nonnegative=o=>e.check(dt(0,o)),e.negative=o=>e.check(Rr(0,o)),e.nonpositive=o=>e.check(Ot(0,o)),e.multipleOf=(o,n)=>e.check(Jn(o,n)),e.step=(o,n)=>e.check(Jn(o,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Z(e){return gw(zi,e)}const hn=T("ZodNumberFormat",(e,t)=>{h_.init(e,t),zi.init(e,t)});function es(e){return yw(hn,e)}function Sx(e){return bw(hn,e)}function kx(e){return _w(hn,e)}function Ex(e){return ww(hn,e)}function Ix(e){return xw(hn,e)}const Mi=T("ZodBoolean",(e,t)=>{Ld.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yw(e,r,o)});function mt(e){return Sw(Mi,e)}const Ui=T("ZodBigInt",(e,t)=>{Fd.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Xw(e,o),e.gte=(o,n)=>e.check(dt(o,n)),e.min=(o,n)=>e.check(dt(o,n)),e.gt=(o,n)=>e.check(Pr(o,n)),e.gte=(o,n)=>e.check(dt(o,n)),e.min=(o,n)=>e.check(dt(o,n)),e.lt=(o,n)=>e.check(Rr(o,n)),e.lte=(o,n)=>e.check(Ot(o,n)),e.max=(o,n)=>e.check(Ot(o,n)),e.positive=o=>e.check(Pr(BigInt(0),o)),e.negative=o=>e.check(Rr(BigInt(0),o)),e.nonpositive=o=>e.check(Ot(BigInt(0),o)),e.nonnegative=o=>e.check(dt(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Jn(o,n));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Tx(e){return Ew(Ui,e)}const vc=T("ZodBigIntFormat",(e,t)=>{g_.init(e,t),Ui.init(e,t)});function $x(e){return Tw(vc,e)}function Ox(e){return $w(vc,e)}const Ef=T("ZodSymbol",(e,t)=>{v_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qw(e,r)});function Ax(e){return Ow(Ef,e)}const If=T("ZodUndefined",(e,t)=>{y_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>t0(e,r)});function Cx(e){return Aw(If,e)}const Tf=T("ZodNull",(e,t)=>{b_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>e0(e,r,o)});function yc(e){return Cw(Tf,e)}const $f=T("ZodAny",(e,t)=>{__.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>o0()});function Me(){return Nw($f)}const Of=T("ZodUnknown",(e,t)=>{w_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>i0()});function Qe(){return Rw(Of)}const Af=T("ZodNever",(e,t)=>{x_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>n0(e,r,o)});function bc(e){return Pw(Af,e)}const Cf=T("ZodVoid",(e,t)=>{S_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>r0(e,r)});function Nx(e){return jw(Cf,e)}const _c=T("ZodDate",(e,t)=>{k_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>a0(e,o),e.min=(o,n)=>e.check(dt(o,n)),e.max=(o,n)=>e.check(Ot(o,n));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Rx(e){return Dw(_c,e)}const Nf=T("ZodArray",(e,t)=>{E_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>y0(e,r,o,n),e.element=t.element,e.min=(r,o)=>e.check(on(r,o)),e.nonempty=r=>e.check(on(1,r)),e.max=(r,o)=>e.check(Ni(r,o)),e.length=(r,o)=>e.check(Ri(r,o)),e.unwrap=()=>e.element});function D(e,t){return Uw(Nf,e,t)}function Px(e){const t=e._zod.def.shape;return gn(Object.keys(t))}const Li=T("ZodObject",(e,t)=>{O_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>b0(e,r,o,n),de(e,"shape",()=>t.shape),e.keyof=()=>gn(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qe()}),e.strict=()=>e.clone({...e._zod.def,catchall:bc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Iy(e,r),e.safeExtend=r=>Ty(e,r),e.merge=r=>$y(e,r),e.pick=r=>ky(e,r),e.omit=r=>Ey(e,r),e.partial=(...r)=>Oy(xc,e,r[0]),e.required=(...r)=>Ay(Sc,e,r[0])});function O(e,t){const r={type:"object",shape:e??{},...C(t)};return new Li(r)}function jx(e,t){return new Li({type:"object",shape:e,catchall:bc(),...C(t)})}function Ir(e,t){return new Li({type:"object",shape:e,catchall:Qe(),...C(t)})}const Fi=T("ZodUnion",(e,t)=>{Ms.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vf(e,r,o,n),e.options=t.options});function fe(e,t){return new Fi({type:"union",options:e,...C(t)})}const Rf=T("ZodXor",(e,t)=>{Fi.init(e,t),A_.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vf(e,r,o,n),e.options=t.options});function Dx(e,t){return new Rf({type:"union",options:e,inclusive:!1,...C(t)})}const Pf=T("ZodDiscriminatedUnion",(e,t)=>{Fi.init(e,t),C_.init(e,t)});function jf(e,t,r){return new Pf({type:"union",options:t,discriminator:e,...C(r)})}const Df=T("ZodIntersection",(e,t)=>{N_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_0(e,r,o,n)});function zf(e,t){return new Df({type:"intersection",left:e,right:t})}const Mf=T("ZodTuple",(e,t)=>{Vd.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>w0(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Uf(e,t,r){const o=t instanceof Y,n=o?r:t,i=o?t:null;return new Mf({type:"tuple",items:e,rest:i,...C(n)})}const Vi=T("ZodRecord",(e,t)=>{R_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>x0(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function nr(e,t,r){return new Vi({type:"record",keyType:e,valueType:t,...C(r)})}function zx(e,t,r){const o=Nt(e);return o._zod.values=void 0,new Vi({type:"record",keyType:o,valueType:t,...C(r)})}function Mx(e,t,r){return new Vi({type:"record",keyType:e,valueType:t,mode:"loose",...C(r)})}const Lf=T("ZodMap",(e,t)=>{P_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>g0(e,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ux(e,t,r){return new Lf({type:"map",keyType:e,valueType:t,...C(r)})}const Ff=T("ZodSet",(e,t)=>{j_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>v0(e,r),e.min=(...r)=>e.check(Kn(...r)),e.nonempty=r=>e.check(Kn(1,r)),e.max=(...r)=>e.check(Ci(...r)),e.size=(...r)=>e.check(Ls(...r))});function Lx(e,t){return new Ff({type:"set",valueType:e,...C(t)})}const eo=T("ZodEnum",(e,t)=>{D_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(o,n,i)=>s0(e,o,n),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{const i={};for(const a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new eo({...t,checks:[],...C(n),entries:i})},e.exclude=(o,n)=>{const i={...t.entries};for(const a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new eo({...t,checks:[],...C(n),entries:i})}});function gn(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new eo({type:"enum",entries:r,...C(t)})}function Fx(e,t){return new eo({type:"enum",entries:e,...C(t)})}const Vf=T("ZodLiteral",(e,t)=>{z_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>c0(e,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function B(e,t){return new Vf({type:"literal",values:Array.isArray(e)?e:[e],...C(t)})}const Zf=T("ZodFile",(e,t)=>{M_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>d0(e,r,o),e.min=(r,o)=>e.check(Kn(r,o)),e.max=(r,o)=>e.check(Ci(r,o)),e.mime=(r,o)=>e.check(Hs(Array.isArray(r)?r:[r],o))});function Vx(e){return Lw(Zf,e)}const Bf=T("ZodTransform",(e,t)=>{U_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>h0(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Rs(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(Hn(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Hn(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function wc(e){return new Bf({type:"transform",transform:e})}const xc=T("ZodOptional",(e,t)=>{L_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>C0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function re(e){return new xc({type:"optional",innerType:e})}const qf=T("ZodNullable",(e,t)=>{F_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>S0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Qo(e){return new qf({type:"nullable",innerType:e})}function Zx(e){return re(Qo(e))}const Gf=T("ZodDefault",(e,t)=>{V_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>E0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hf(e,t){return new Gf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():js(t)}})}const Wf=T("ZodPrefault",(e,t)=>{Z_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>I0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Jf(e,t){return new Wf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():js(t)}})}const Sc=T("ZodNonOptional",(e,t)=>{B_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>k0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Kf(e,t){return new Sc({type:"nonoptional",innerType:e,...C(t)})}const Yf=T("ZodSuccess",(e,t)=>{q_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>f0(e,r,o),e.unwrap=()=>e._zod.def.innerType});function Bx(e){return new Yf({type:"success",innerType:e})}const Xf=T("ZodCatch",(e,t)=>{G_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>T0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Qf(e,t){return new Xf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const em=T("ZodNaN",(e,t)=>{H_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>l0(e,r)});function qx(e){return Mw(em,e)}const kc=T("ZodPipe",(e,t)=>{W_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$0(e,r,o,n),e.in=t.in,e.out=t.out});function ei(e,t){return new kc({type:"pipe",in:e,out:t})}const Ec=T("ZodCodec",(e,t)=>{kc.init(e,t),Zd.init(e,t)});function Gx(e,t,r){return new Ec({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}const tm=T("ZodReadonly",(e,t)=>{J_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>O0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rm(e){return new tm({type:"readonly",innerType:e})}const nm=T("ZodTemplateLiteral",(e,t)=>{K_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>u0(e,r,o)});function Hx(e,t){return new nm({type:"template_literal",parts:e,...C(t)})}const om=T("ZodLazy",(e,t)=>{Q_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>N0(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Ic(e){return new om({type:"lazy",getter:e})}const im=T("ZodPromise",(e,t)=>{X_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>A0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Wx(e){return new im({type:"promise",innerType:e})}const am=T("ZodFunction",(e,t)=>{Y_.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>p0(e,r)});function ts(e){return new am({type:"function",input:Array.isArray(e?.input)?Uf(e?.input):e?.input??D(Qe()),output:e?.output??Qe()})}const Zi=T("ZodCustom",(e,t)=>{ew.init(e,t),ie.init(e,t),e._zod.processJSONSchema=(r,o,n)=>m0(e,r)});function Jx(e){const t=new Ae({check:"custom"});return t._zod.check=e,t}function sm(e,t){return Fw(Zi,e??(()=>!0),t)}function cm(e,t={}){return Vw(Zi,e,t)}function lm(e){return Zw(e)}const Kx=qw,Yx=Gw;function to(e,t={error:`Input not instance of ${e.name}`}){const r=new Zi({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...C(t)});return r._zod.bag.Class=e,r}const Xx=(...e)=>Hw({Codec:Ec,Boolean:Mi,String:ji},...e);function Qx(e){const t=Ic(()=>fe([S(e),Z(),mt(),yc(),D(t),nr(S(),t)]));return t}function eS(e,t){return ei(wc(e),t)}const HN=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:$f,ZodArray:Nf,ZodBase64:fc,ZodBase64URL:pc,ZodBigInt:Ui,ZodBigIntFormat:vc,ZodBoolean:Mi,ZodCIDRv4:uc,ZodCIDRv6:dc,ZodCUID:nc,ZodCUID2:oc,ZodCatch:Xf,ZodCodec:Ec,ZodCustom:Zi,ZodCustomStringFormat:fo,ZodDate:_c,ZodDefault:Gf,ZodDiscriminatedUnion:Pf,ZodE164:hc,ZodEmail:ec,ZodEmoji:tc,ZodEnum:eo,ZodFile:Zf,ZodFunction:am,ZodGUID:Xo,ZodIPv4:cc,ZodIPv6:lc,ZodIntersection:Df,ZodJWT:gc,ZodKSUID:sc,ZodLazy:om,ZodLiteral:Vf,ZodMAC:kf,ZodMap:Lf,ZodNaN:em,ZodNanoID:rc,ZodNever:Af,ZodNonOptional:Sc,ZodNull:Tf,ZodNullable:qf,ZodNumber:zi,ZodNumberFormat:hn,ZodObject:Li,ZodOptional:xc,ZodPipe:kc,ZodPrefault:Wf,ZodPromise:im,ZodReadonly:tm,ZodRecord:Vi,ZodSet:Ff,ZodString:ji,ZodStringFormat:Ie,ZodSuccess:Yf,ZodSymbol:Ef,ZodTemplateLiteral:nm,ZodTransform:Bf,ZodTuple:Mf,ZodType:ie,ZodULID:ic,ZodURL:Di,ZodUUID:Qt,ZodUndefined:If,ZodUnion:Fi,ZodUnknown:Of,ZodVoid:Cf,ZodXID:ac,ZodXor:Rf,_ZodString:Qs,_default:Hf,_function:ts,any:Me,array:D,base64:mc,base64url:gx,bigint:Tx,boolean:mt,catch:Qf,check:Jx,cidrv4:px,cidrv6:hx,codec:Gx,cuid:ax,cuid2:sx,custom:sm,date:Rx,describe:Kx,discriminatedUnion:jf,e164:vx,email:K0,emoji:ox,enum:gn,file:Vx,float32:Sx,float64:kx,function:ts,guid:Y0,hash:xx,hex:wx,hostname:_x,httpUrl:nx,instanceof:to,int:es,int32:Ex,int64:$x,intersection:zf,ipv4:dx,ipv6:mx,json:Qx,jwt:yx,keyof:Px,ksuid:ux,lazy:Ic,literal:B,looseObject:Ir,looseRecord:Mx,mac:fx,map:Ux,meta:Yx,nan:qx,nanoid:ix,nativeEnum:Fx,never:bc,nonoptional:Kf,null:yc,nullable:Qo,nullish:Zx,number:Z,object:O,optional:re,partialRecord:zx,pipe:ei,prefault:Jf,preprocess:eS,promise:Wx,readonly:rm,record:nr,refine:cm,set:Lx,strictObject:jx,string:S,stringFormat:bx,stringbool:Xx,success:Bx,superRefine:lm,symbol:Ax,templateLiteral:Hx,transform:wc,tuple:Uf,uint32:Ix,uint64:Ox,ulid:cx,undefined:Cx,union:fe,unknown:Qe,url:rx,uuid:X0,uuidv4:Q0,uuidv6:ex,uuidv7:tx,void:Nx,xid:lx,xor:Dx},Symbol.toStringTag,{value:"Module"})),tS={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function WN(e){Xe({customError:e})}function JN(){return Xe().customError}var Eu;Eu||(Eu={});const j={...HN,...qN,iso:z0};function KN(e,t){const r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function YN(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;const o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){const n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function rS(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return j.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){const n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return j.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);const i=YN(n,t),a=Ye(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){const n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return j.null();if(n.length===0)return j.never();if(n.length===1)return j.literal(n[0]);if(n.every(a=>typeof a=="string"))return j.enum(n);const i=n.map(a=>j.literal(a));return i.length<2?i[0]:j.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return j.literal(e.const);const r=e.type;if(Array.isArray(r)){const n=r.map(i=>{const a={...e,type:i};return rS(a,t)});return n.length===0?j.never():n.length===1?n[0]:j.union(n)}if(!r)return j.any();let o;switch(r){case"string":{let n=j.string();if(e.format){const i=e.format;i==="email"?n=n.check(j.email()):i==="uri"||i==="uri-reference"?n=n.check(j.url()):i==="uuid"||i==="guid"?n=n.check(j.uuid()):i==="date-time"?n=n.check(j.iso.datetime()):i==="date"?n=n.check(j.iso.date()):i==="time"?n=n.check(j.iso.time()):i==="duration"?n=n.check(j.iso.duration()):i==="ipv4"?n=n.check(j.ipv4()):i==="ipv6"?n=n.check(j.ipv6()):i==="mac"?n=n.check(j.mac()):i==="cidr"?n=n.check(j.cidrv4()):i==="cidr-v6"?n=n.check(j.cidrv6()):i==="base64"?n=n.check(j.base64()):i==="base64url"?n=n.check(j.base64url()):i==="e164"?n=n.check(j.e164()):i==="jwt"?n=n.check(j.jwt()):i==="emoji"?n=n.check(j.emoji()):i==="nanoid"?n=n.check(j.nanoid()):i==="cuid"?n=n.check(j.cuid()):i==="cuid2"?n=n.check(j.cuid2()):i==="ulid"?n=n.check(j.ulid()):i==="xid"?n=n.check(j.xid()):i==="ksuid"&&(n=n.check(j.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?j.number().int():j.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=j.boolean();break}case"null":{o=j.null();break}case"object":{const n={},i=e.properties||{},a=new Set(e.required||[]);for(const[c,l]of Object.entries(i)){const u=Ye(l,t);n[c]=a.has(c)?u:u.optional()}if(e.propertyNames){const c=Ye(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Ye(e.additionalProperties,t):j.any();if(Object.keys(n).length===0){o=j.record(c,l);break}const u=j.object(n).passthrough(),d=j.looseRecord(c,l);o=j.intersection(u,d);break}if(e.patternProperties){const c=e.patternProperties,l=Object.keys(c),u=[];for(const f of l){const m=Ye(c[f],t),g=j.string().regex(new RegExp(f));u.push(j.looseRecord(g,m))}const d=[];if(Object.keys(n).length>0&&d.push(j.object(n).passthrough()),d.push(...u),d.length===0)o=j.object({}).passthrough();else if(d.length===1)o=d[0];else{let f=j.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)f=j.intersection(f,d[m]);o=f}break}const s=j.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Ye(e.additionalProperties,t)):o=s.passthrough();break}case"array":{const n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){const a=n.map(c=>Ye(c,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Ye(i,t):void 0;s?o=j.tuple(a).rest(s):o=j.tuple(a),typeof e.minItems=="number"&&(o=o.check(j.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(j.maxLength(e.maxItems)))}else if(Array.isArray(i)){const a=i.map(c=>Ye(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Ye(e.additionalItems,t):void 0;s?o=j.tuple(a).rest(s):o=j.tuple(a),typeof e.minItems=="number"&&(o=o.check(j.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(j.maxLength(e.maxItems)))}else if(i!==void 0){const a=Ye(i,t);let s=j.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=j.array(j.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}function Ye(e,t){if(typeof e=="boolean")return e?j.any():j.never();let r=rS(e,t);const o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const n=e.anyOf.map(a=>Ye(a,t)),i=j.union(n);r=o?j.intersection(r,i):i}if(e.oneOf&&Array.isArray(e.oneOf)){const n=e.oneOf.map(a=>Ye(a,t)),i=j.xor(n);r=o?j.intersection(r,i):i}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:j.any();else{let n=o?r:Ye(e.allOf[0],t);const i=o?0:1;for(let a=i;a<e.allOf.length;a++)n=j.intersection(n,Ye(e.allOf[a],t));r=n}return e.nullable===!0&&t.version==="openapi-3.0"&&(r=j.nullable(r)),e.readOnly===!0&&(r=j.readonly(r)),r}function XN(e,t){if(typeof e=="boolean")return e?j.any():j.never();const r=KN(e,t?.defaultTarget),o=e.$defs||e.definitions||{};return Ye(e,{version:r,defs:o,refs:new Map,processing:new Set,rootSchema:e})}function QN(e){return lw(ji,e)}function eR(e){return vw(zi,e)}function tR(e){return kw(Mi,e)}function rR(e){return Iw(Ui,e)}function nR(e){return zw(_c,e)}const oR=Object.freeze(Object.defineProperty({__proto__:null,bigint:rR,boolean:tR,date:nR,number:eR,string:QN},Symbol.toStringTag,{value:"Module"}));Xe(tw());const ch=Object.freeze(Object.defineProperty({__proto__:null,$brand:gy,$input:aw,$output:iw,NEVER:_d,TimePrecision:dw,ZodAny:$f,ZodArray:Nf,ZodBase64:fc,ZodBase64URL:pc,ZodBigInt:Ui,ZodBigIntFormat:vc,ZodBoolean:Mi,ZodCIDRv4:uc,ZodCIDRv6:dc,ZodCUID:nc,ZodCUID2:oc,ZodCatch:Xf,ZodCodec:Ec,ZodCustom:Zi,ZodCustomStringFormat:fo,ZodDate:_c,ZodDefault:Gf,ZodDiscriminatedUnion:Pf,ZodE164:hc,ZodEmail:ec,ZodEmoji:tc,ZodEnum:eo,ZodError:GN,ZodFile:Zf,get ZodFirstPartyTypeKind(){return Eu},ZodFunction:am,ZodGUID:Xo,ZodIPv4:cc,ZodIPv6:lc,ZodISODate:_f,ZodISODateTime:bf,ZodISODuration:xf,ZodISOTime:wf,ZodIntersection:Df,ZodIssueCode:tS,ZodJWT:gc,ZodKSUID:sc,ZodLazy:om,ZodLiteral:Vf,ZodMAC:kf,ZodMap:Lf,ZodNaN:em,ZodNanoID:rc,ZodNever:Af,ZodNonOptional:Sc,ZodNull:Tf,ZodNullable:qf,ZodNumber:zi,ZodNumberFormat:hn,ZodObject:Li,ZodOptional:xc,ZodPipe:kc,ZodPrefault:Wf,ZodPromise:im,ZodReadonly:tm,ZodRealError:Et,ZodRecord:Vi,ZodSet:Ff,ZodString:ji,ZodStringFormat:Ie,ZodSuccess:Yf,ZodSymbol:Ef,ZodTemplateLiteral:nm,ZodTransform:Bf,ZodTuple:Mf,ZodType:ie,ZodULID:ic,ZodURL:Di,ZodUUID:Qt,ZodUndefined:If,ZodUnion:Fi,ZodUnknown:Of,ZodVoid:Cf,ZodXID:ac,ZodXor:Rf,_ZodString:Qs,_default:Hf,_function:ts,any:Me,array:D,base64:mc,base64url:gx,bigint:Tx,boolean:mt,catch:Qf,check:Jx,cidrv4:px,cidrv6:hx,clone:Nt,codec:Gx,coerce:oR,config:Xe,core:BN,cuid:ax,cuid2:sx,custom:sm,date:Rx,decode:Z0,decodeAsync:q0,describe:Kx,discriminatedUnion:jf,e164:vx,email:K0,emoji:ox,encode:V0,encodeAsync:B0,endsWith:Gs,enum:gn,file:Vx,flattenError:kd,float32:Sx,float64:kx,formatError:Ed,fromJSONSchema:XN,function:ts,getErrorMap:JN,globalRegistry:Vt,gt:Pr,gte:dt,guid:Y0,hash:xx,hex:wx,hostname:_x,httpUrl:nx,includes:Bs,instanceof:to,int:es,int32:Ex,int64:$x,intersection:zf,ipv4:dx,ipv6:mx,iso:z0,json:Qx,jwt:yx,keyof:Px,ksuid:ux,lazy:Ic,length:Ri,literal:B,locales:ow,looseObject:Ir,looseRecord:Mx,lowercase:Vs,lt:Rr,lte:Ot,mac:fx,map:Ux,maxLength:Ni,maxSize:Ci,meta:Yx,mime:Hs,minLength:on,minSize:Kn,multipleOf:Jn,nan:qx,nanoid:ix,nativeEnum:Fx,negative:mf,never:bc,nonnegative:hf,nonoptional:Kf,nonpositive:pf,normalize:Ws,null:yc,nullable:Qo,nullish:Zx,number:Z,object:O,optional:re,overwrite:xr,parse:U0,parseAsync:L0,partialRecord:zx,pipe:ei,positive:ff,prefault:Jf,preprocess:eS,prettifyError:zy,promise:Wx,property:gf,readonly:rm,record:nr,refine:cm,regex:Fs,regexes:jd,registry:Bd,safeDecode:H0,safeDecodeAsync:J0,safeEncode:G0,safeEncodeAsync:W0,safeParse:F0,safeParseAsync:Sf,set:Lx,setErrorMap:WN,size:Ls,slugify:Xs,startsWith:qs,strictObject:jx,string:S,stringFormat:bx,stringbool:Xx,success:Bx,superRefine:lm,symbol:Ax,templateLiteral:Hx,toJSONSchema:yf,toLowerCase:Ks,toUpperCase:Ys,transform:wc,treeifyError:jy,trim:Js,tuple:Uf,uint32:Ix,uint64:Ox,ulid:cx,undefined:Cx,union:fe,unknown:Qe,uppercase:Zs,url:rx,util:Ry,uuid:X0,uuidv4:Q0,uuidv6:ex,uuidv7:tx,void:Nx,xid:lx,xor:Dx},Symbol.toStringTag,{value:"Module"}));var ti;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const i={};for(const a of n)i[a]=a;return i},e.getValidEnumValues=n=>{const i=e.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),a={};for(const s of i)a[s]=n[s];return e.objectValues(a)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.push(a);return i},e.find=(n,i)=>{for(const a of n)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function o(n,i=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(ti||(ti={}));var lh;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(lh||(lh={}));ti.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);ti.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"]);class rs extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},o={_errors:[]},n=i=>{for(const a of i.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)o._errors.push(r(a));else{let s=o,c=0;for(;c<a.path.length;){const l=a.path[c];c===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(a))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return n(this),o}static assert(t){if(!(t instanceof rs))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ti.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r=Object.create(null),o=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];r[i]=r[i]||[],r[i].push(t(n))}else o.push(t(n));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}}rs.create=e=>new rs(e);var uh;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(uh||(uh={}));var X;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(X||(X={}));var iR=({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{const n=()=>{const i=r.length,a=new Array(t);for(let s=0;s<t;s++)a[s]=r[Math.random()*i|0];return a.join("")};if(e==null)return n;if(r.includes(o))throw new bd({argument:"separator",message:`The separator "${o}" must not be part of the alphabet "${r}".`});return()=>`${e}${o}${n()}`};iR();function nS(e=globalThis){var t,r,o;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(o=(r=e.process)==null?void 0:r.versions)!=null&&o.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function aR(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((r,o)=>{t[o.toLowerCase()]=r});else{Array.isArray(e)||(e=Object.entries(e));for(const[r,o]of e)o!=null&&(t[r.toLowerCase()]=o)}return t}function oS(e,...t){const r=new Headers(aR(e)),o=r.get("user-agent")||"";return r.set("user-agent",[o,...t].filter(Boolean).join(" ")),Object.fromEntries(r.entries())}var sR=Symbol.for("vercel.ai.validator");function cR(e){return{...e,type:"dynamic"}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var lR=Symbol.for("vercel.ai.schema");function uR(e,{validate:t}={}){return{[lR]:!0,_type:void 0,[sR]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}let um;um=globalThis.crypto;async function dR(e){return(await um).getRandomValues(new Uint8Array(e))}async function fR(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let r="";const o=await dR(e);for(let n=0;n<e;n++){const i=o[n]%t.length;r+=t[i]}return r}async function mR(e){return await fR(e)}async function pR(e){const t=await(await um).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function hR(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await mR(e),r=await pR(t);return{code_verifier:t,code_challenge:r}}var gR="AI_MCPClientError",iS=`vercel.ai.error.${gR}`,vR=Symbol.for(iS),dh,fh,we=class extends(fh=ee,dh=vR,fh){constructor({name:e="MCPClientError",message:t,cause:r,data:o,code:n}){super({name:e,message:t,cause:r}),this[dh]=!0,this.data=o,this.code=n}static isInstance(e){return ee.hasMarker(e,iS)}},mo="2025-06-18",yR=[mo,"2025-03-26","2024-11-05"],bR=Ir({name:S(),version:S()}),Tc=Ir({_meta:re(O({}).loose())}),mr=Tc,aS=O({method:S(),params:re(Tc)}),sS=O({applyDefaults:re(mt())}).loose(),_R=Ir({experimental:re(O({}).loose()),logging:re(O({}).loose()),prompts:re(Ir({listChanged:re(mt())})),resources:re(Ir({subscribe:re(mt()),listChanged:re(mt())})),tools:re(Ir({listChanged:re(mt())})),elicitation:re(sS)});O({elicitation:re(sS)}).loose();var wR=mr.extend({protocolVersion:S(),capabilities:_R,serverInfo:bR,instructions:re(S())}),dm=mr.extend({nextCursor:re(S())}),xR=O({name:S(),description:re(S()),inputSchema:O({type:B("object"),properties:re(O({}).loose())}).loose()}).loose(),SR=dm.extend({tools:D(xR)}),cS=O({type:B("text"),text:S()}).loose(),lS=O({type:B("image"),data:mc(),mimeType:S()}).loose(),kR=O({uri:S(),name:S(),title:re(S()),description:re(S()),mimeType:re(S()),size:re(Z())}).loose(),ER=dm.extend({resources:D(kR)}),uS=O({uri:S(),name:re(S()),title:re(S()),mimeType:re(S())}).loose(),dS=uS.extend({text:S()}),fS=uS.extend({blob:mc()}),mS=O({type:B("resource"),resource:fe([dS,fS])}).loose(),IR=mr.extend({content:D(fe([cS,lS,mS])),isError:mt().default(!1).optional()}).or(mr.extend({toolResult:Qe()})),TR=O({uriTemplate:S(),name:S(),title:re(S()),description:re(S()),mimeType:re(S())}).loose(),$R=mr.extend({resourceTemplates:D(TR)}),OR=mr.extend({contents:D(fe([dS,fS]))}),AR=O({name:S(),description:re(S()),required:re(mt())}).loose(),CR=O({name:S(),title:re(S()),description:re(S()),arguments:re(D(AR))}).loose(),NR=dm.extend({prompts:D(CR)}),RR=O({role:fe([B("user"),B("assistant")]),content:fe([cS,lS,mS])}).loose(),PR=mr.extend({description:re(S()),messages:D(RR)}),jR=Tc.extend({message:S(),requestedSchema:Qe()}),mh=aS.extend({method:B("elicitation/create"),params:jR}),DR=mr.extend({action:fe([B("accept"),B("decline"),B("cancel")]),content:re(nr(S(),Qe()))}),$c="2.0",zR=O({jsonrpc:B($c),id:fe([S(),Z().int()])}).merge(aS).strict(),MR=O({jsonrpc:B($c),id:fe([S(),Z().int()]),result:mr}).strict(),UR=O({jsonrpc:B($c),id:fe([S(),Z().int()]),error:O({code:Z().int(),message:S(),data:re(Qe())})}).strict(),LR=O({jsonrpc:B($c)}).merge(O({method:S(),params:re(Tc)})).strict(),Zo=fe([zR,LR,MR,UR]),pS=typeof __PACKAGE_VERSION__<"u"?__PACKAGE_VERSION__:"0.0.0-test",hS=O({access_token:S(),id_token:S().optional(),token_type:S(),expires_in:Z().optional(),scope:S().optional(),refresh_token:S().optional()}).strip(),ft=S().url().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:tS.custom,message:"URL must be parseable",fatal:!0}),_d}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),FR=O({resource:S().url(),authorization_servers:D(ft).optional(),jwks_uri:S().url().optional(),scopes_supported:D(S()).optional(),bearer_methods_supported:D(S()).optional(),resource_signing_alg_values_supported:D(S()).optional(),resource_name:S().optional(),resource_documentation:S().optional(),resource_policy_uri:S().url().optional(),resource_tos_uri:S().url().optional(),tls_client_certificate_bound_access_tokens:mt().optional(),authorization_details_types_supported:D(S()).optional(),dpop_signing_alg_values_supported:D(S()).optional(),dpop_bound_access_tokens_required:mt().optional()}).passthrough(),gS=O({issuer:S(),authorization_endpoint:ft,token_endpoint:ft,registration_endpoint:ft.optional(),scopes_supported:D(S()).optional(),response_types_supported:D(S()),grant_types_supported:D(S()).optional(),code_challenge_methods_supported:D(S()),token_endpoint_auth_methods_supported:D(S()).optional(),token_endpoint_auth_signing_alg_values_supported:D(S()).optional()}).passthrough(),VR=O({issuer:S(),authorization_endpoint:ft,token_endpoint:ft,userinfo_endpoint:ft.optional(),jwks_uri:ft,registration_endpoint:ft.optional(),scopes_supported:D(S()).optional(),response_types_supported:D(S()),grant_types_supported:D(S()).optional(),subject_types_supported:D(S()),id_token_signing_alg_values_supported:D(S()),claims_supported:D(S()).optional(),token_endpoint_auth_methods_supported:D(S()).optional()}).passthrough(),ZR=VR.merge(gS.pick({code_challenge_methods_supported:!0})),BR=O({client_id:S(),client_secret:S().optional(),client_id_issued_at:Z().optional(),client_secret_expires_at:Z().optional()}).strip(),qR=O({redirect_uris:D(ft),token_endpoint_auth_method:S().optional(),grant_types:D(S()).optional(),response_types:D(S()).optional(),client_name:S().optional(),client_uri:ft.optional(),logo_uri:ft.optional(),scope:S().optional(),contacts:D(S()).optional(),tos_uri:ft.optional(),policy_uri:S().optional(),jwks_uri:ft.optional(),jwks:Me().optional(),software_id:S().optional(),software_version:S().optional(),software_statement:S().optional()}).strip(),GR=O({error:S(),error_description:S().optional(),error_uri:S().optional()}),HR=qR.merge(BR),WR="AI_MCPClientOAuthError",vS=`vercel.ai.error.${WR}`,JR=Symbol.for(vS),ph,hh,Bi=class extends(hh=ee,ph=JR,hh){constructor({name:e="MCPClientOAuthError",message:t,cause:r}){super({name:e,message:t,cause:r}),this[ph]=!0}static isInstance(e){return ee.hasMarker(e,vS)}},ro=class extends Bi{};ro.errorCode="server_error";var ns=class extends Bi{};ns.errorCode="invalid_client";var os=class extends Bi{};os.errorCode="invalid_grant";var is=class extends Bi{};is.errorCode="unauthorized_client";var KR={[ro.errorCode]:ro,[ns.errorCode]:ns,[os.errorCode]:os,[is.errorCode]:is};function YR(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function XR({requestedResource:e,configuredResource:t}){const r=typeof e=="string"?new URL(e):new URL(e.href),o=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==o.origin||r.pathname.length<o.pathname.length)return!1;const n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=o.pathname.endsWith("/")?o.pathname:o.pathname+"/";return n.startsWith(i)}var as=class extends Error{constructor(e="Unauthorized"){super(e),this.name="UnauthorizedError"}};function ss(e){var t;const r=(t=e.headers.get("www-authenticate"))!=null?t:e.headers.get("WWW-Authenticate");if(!r)return;const[o,n]=r.split(" ");if(o.toLowerCase()!=="bearer"||!n)return;const i=/resource_metadata="([^"]*)"/,a=r.match(i);if(a)try{return new URL(a[1])}catch{return}}function QR(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function fm(e,t,r=fetch){try{return await r(e,{headers:t})}catch(o){if(o instanceof TypeError)return t?fm(e,void 0,r):void 0;throw o}}async function gh(e,t,r=fetch){return await fm(e,{"MCP-Protocol-Version":t},r)}function eP(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function tP(e,t,r,o){var n,i;const a=new URL(e),s=(n=o?.protocolVersion)!=null?n:mo;let c;if(o?.metadataUrl)c=new URL(o.metadataUrl);else{const u=QR(t,a.pathname);c=new URL(u,(i=o?.metadataServerUrl)!=null?i:a),c.search=a.search}let l=await gh(c,s,r);if(!o?.metadataUrl&&eP(l,a.pathname)){const u=new URL(`/.well-known/${t}`,a);l=await gh(u,s,r)}return l}async function rP(e,t,r=fetch){const o=await tP(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!o||o.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!o.ok)throw new Error(`HTTP ${o.status} trying to load well-known OAuth protected resource metadata.`);return FR.parse(await o.json())}function nP(e){const t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",o=[];if(!r)return o.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),o.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),o;let n=t.pathname;return n.endsWith("/")&&(n=n.slice(0,-1)),o.push({url:new URL(`/.well-known/oauth-authorization-server${n}`,t.origin),type:"oauth"}),o.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),o.push({url:new URL(`/.well-known/openid-configuration${n}`,t.origin),type:"oidc"}),o.push({url:new URL(`${n}/.well-known/openid-configuration`,t.origin),type:"oidc"}),o}async function oP(e,{fetchFn:t=fetch,protocolVersion:r=mo}={}){var o;const n={"MCP-Protocol-Version":r},i=nP(e);for(const{url:a,type:s}of i){const c=await fm(a,n,t);if(c){if(!c.ok){if(c.status>=400&&c.status<500)continue;throw new Error(`HTTP ${c.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${a}`)}if(s==="oauth")return gS.parse(await c.json());{const l=ZR.parse(await c.json());if(!((o=l.code_challenge_methods_supported)!=null&&o.includes("S256")))throw new Error(`Incompatible OIDC provider at ${a}: does not support S256 code challenge method required by MCP specification`);return l}}}}async function iP(e,{metadata:t,clientInformation:r,redirectUrl:o,scope:n,state:i,resource:a}){const s="code",c="S256";let l;if(t){if(l=new URL(t.authorization_endpoint),!t.response_types_supported.includes(s))throw new Error(`Incompatible auth server: does not support response type ${s}`);if(!t.code_challenge_methods_supported||!t.code_challenge_methods_supported.includes(c))throw new Error(`Incompatible auth server: does not support code challenge method ${c}`)}else l=new URL("/authorize",e);const u=await hR(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",s),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",c),l.searchParams.set("redirect_uri",String(o)),i&&l.searchParams.set("state",i),n&&l.searchParams.set("scope",n),n?.includes("offline_access")&&l.searchParams.append("prompt","consent"),a&&l.searchParams.set("resource",a.href),{authorizationUrl:l,codeVerifier:d}}function yS(e,t){const r=e.client_secret!==void 0;return t.length===0?r?"client_secret_post":"none":r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function bS(e,t,r,o){const{client_id:n,client_secret:i}=t;switch(e){case"client_secret_basic":aP(n,i,r);return;case"client_secret_post":sP(n,i,o);return;case"none":cP(n,o);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function aP(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const o=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${o}`)}function sP(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function cP(e,t){t.set("client_id",e)}async function mm(e){const t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{const o=GR.parse(JSON.parse(r)),{error:n,error_description:i,error_uri:a}=o,s=KR[n]||ro;return new s({message:i||"",cause:a})}catch(o){const n=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${o}. Raw body: ${r}`;return new ro({message:n})}}async function lP(e,{metadata:t,clientInformation:r,authorizationCode:o,codeVerifier:n,redirectUri:i,resource:a,addClientAuthentication:s,fetchFn:c}){var l;const u="authorization_code",d=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e);if(t?.grant_types_supported&&!t.grant_types_supported.includes(u))throw new Error(`Incompatible auth server: does not support grant type ${u}`);const f=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),m=new URLSearchParams({grant_type:u,code:o,code_verifier:n,redirect_uri:String(i)});if(s)s(f,m,e,t);else{const h=(l=t?.token_endpoint_auth_methods_supported)!=null?l:[],y=yS(r,h);bS(y,r,f,m)}a&&m.set("resource",a.href);const g=await(c??fetch)(d,{method:"POST",headers:f,body:m});if(!g.ok)throw await mm(g);return hS.parse(await g.json())}async function uP(e,{metadata:t,clientInformation:r,refreshToken:o,resource:n,addClientAuthentication:i,fetchFn:a}){var s;const c="refresh_token";let l;if(t){if(l=new URL(t.token_endpoint),t.grant_types_supported&&!t.grant_types_supported.includes(c))throw new Error(`Incompatible auth server: does not support grant type ${c}`)}else l=new URL("/token",e);const u=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),d=new URLSearchParams({grant_type:c,refresh_token:o});if(i)i(u,d,e,t);else{const m=(s=t?.token_endpoint_auth_methods_supported)!=null?s:[],g=yS(r,m);bS(g,r,u,d)}n&&d.set("resource",n.href);const f=await(a??fetch)(l,{method:"POST",headers:u,body:d});if(!f.ok)throw await mm(f);return hS.parse({refresh_token:o,...await f.json()})}async function dP(e,{metadata:t,clientMetadata:r,fetchFn:o}){let n;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");n=new URL(t.registration_endpoint)}else n=new URL("/register",e);const i=await(o??fetch)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await mm(i);return HR.parse(await i.json())}async function cs(e,t){var r,o;try{return await xl(e,t)}catch(n){if(n instanceof ns||n instanceof is)return await((r=e.invalidateCredentials)==null?void 0:r.call(e,"all")),await xl(e,t);if(n instanceof os)return await((o=e.invalidateCredentials)==null?void 0:o.call(e,"tokens")),await xl(e,t);throw n}}async function fP(e,t,r){const o=YR(e);if(t.validateResourceURL)return await t.validateResourceURL(o,r?.resource);if(r){if(!XR({requestedResource:o,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${o} (or origin)`);return new URL(r.resource)}}async function xl(e,{serverUrl:t,authorizationCode:r,scope:o,resourceMetadataUrl:n,fetchFn:i}){let a,s;try{a=await rP(t,{resourceMetadataUrl:n},i),a.authorization_servers&&a.authorization_servers.length>0&&(s=a.authorization_servers[0])}catch{}s||(s=t);const c=await fP(t,e,a),l=await oP(s,{fetchFn:i});let u=await Promise.resolve(e.clientInformation());if(!u){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const h=await dP(s,{metadata:l,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(h),u=h}if(r!==void 0){const h=await e.codeVerifier(),y=await lP(s,{metadata:l,clientInformation:u,authorizationCode:r,codeVerifier:h,redirectUri:e.redirectUrl,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}const d=await e.tokens();if(d?.refresh_token)try{const h=await uP(s,{metadata:l,clientInformation:u,refreshToken:d.refresh_token,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(h),"AUTHORIZED"}catch(h){if(!(!(h instanceof Bi)||h instanceof ro))throw h}const f=e.state?await e.state():void 0,{authorizationUrl:m,codeVerifier:g}=await iP(s,{metadata:l,clientInformation:u,state:f,redirectUrl:e.redirectUrl,scope:o||e.clientMetadata.scope,resource:c});return await e.saveCodeVerifier(g),await e.redirectToAuthorization(m),"REDIRECT"}var mP=class{constructor({url:e,headers:t,authProvider:r}){this.connected=!1,this.url=new URL(e),this.headers=t,this.authProvider=r}async commonHeaders(e){const t={...this.headers,...e,"mcp-protocol-version":mo};if(this.authProvider){const r=await this.authProvider.tokens();r?.access_token&&(t.Authorization=`Bearer ${r.access_token}`)}return oS(t,`ai-sdk/${pS}`,nS())}async start(){return new Promise((e,t)=>{if(this.connected)return e();this.abortController=new AbortController;const r=async(o=!1)=>{var n,i,a,s,c;try{const l=await this.commonHeaders({Accept:"text/event-stream"}),u=await fetch(this.url.href,{headers:l,signal:(n=this.abortController)==null?void 0:n.signal});if(u.status===401&&this.authProvider&&!o){this.resourceMetadataUrl=ss(u);try{if(await cs(this.authProvider,{serverUrl:this.url,resourceMetadataUrl:this.resourceMetadataUrl})!=="AUTHORIZED"){const h=new as;return(i=this.onerror)==null||i.call(this,h),t(h)}}catch(g){return(a=this.onerror)==null||a.call(this,g),t(g)}return r(!0)}if(!u.ok||!u.body){let g=`MCP SSE Transport Error: ${u.status} ${u.statusText}`;u.status===405&&(g+=". This server does not support SSE transport. Try using `http` transport instead");const h=new we({message:g});return(s=this.onerror)==null||s.call(this,h),t(h)}const f=u.body.pipeThrough(new TextDecoderStream).pipeThrough(new Wa).getReader(),m=async()=>{var g,h,y;try{for(;;){const{done:b,value:w}=await f.read();if(b){if(this.connected)throw this.connected=!1,new we({message:"MCP SSE Transport Error: Connection closed unexpectedly"});return}const{event:x,data:v}=w;if(x==="endpoint"){if(this.endpoint=new URL(v,this.url),this.endpoint.origin!==this.url.origin)throw new we({message:`MCP SSE Transport Error: Endpoint origin does not match connection origin: ${this.endpoint.origin}`});this.connected=!0,e()}else if(x==="message")try{const k=Zo.parse(JSON.parse(v));(g=this.onmessage)==null||g.call(this,k)}catch(k){const E=new we({message:"MCP SSE Transport Error: Failed to parse message",cause:k});(h=this.onerror)==null||h.call(this,E)}}}catch(b){if(b instanceof Error&&b.name==="AbortError")return;(y=this.onerror)==null||y.call(this,b),t(b)}};this.sseConnection={close:()=>f.cancel()},m()}catch(l){if(l instanceof Error&&l.name==="AbortError")return;(c=this.onerror)==null||c.call(this,l),t(l)}};r()})}async close(){var e,t,r;this.connected=!1,(e=this.sseConnection)==null||e.close(),(t=this.abortController)==null||t.abort(),(r=this.onclose)==null||r.call(this)}async send(e){if(!this.endpoint||!this.connected)throw new we({message:"MCP SSE Transport Error: Not connected"});const t=this.endpoint,r=async(o=!1)=>{var n,i,a,s,c;try{const u={method:"POST",headers:await this.commonHeaders({"Content-Type":"application/json"}),body:JSON.stringify(e),signal:(n=this.abortController)==null?void 0:n.signal},d=await fetch(t,u);if(d.status===401&&this.authProvider&&!o){this.resourceMetadataUrl=ss(d);try{if(await cs(this.authProvider,{serverUrl:this.url,resourceMetadataUrl:this.resourceMetadataUrl})!=="AUTHORIZED"){const m=new as;(i=this.onerror)==null||i.call(this,m);return}}catch(f){(a=this.onerror)==null||a.call(this,f);return}return r(!0)}if(!d.ok){const f=await d.text().catch(()=>null),m=new we({message:`MCP SSE Transport Error: POSTing to endpoint (HTTP ${d.status}): ${f}`});(s=this.onerror)==null||s.call(this,m);return}}catch(l){(c=this.onerror)==null||c.call(this,l);return}};await r()}},pP=class{constructor({url:e,headers:t,authProvider:r}){this.inboundReconnectAttempts=0,this.reconnectionOptions={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},this.url=new URL(e),this.headers=t,this.authProvider=r}async commonHeaders(e){const t={...this.headers,...e,"mcp-protocol-version":mo};if(this.sessionId&&(t["mcp-session-id"]=this.sessionId),this.authProvider){const r=await this.authProvider.tokens();r?.access_token&&(t.Authorization=`Bearer ${r.access_token}`)}return oS(t,`ai-sdk/${pS}`,nS())}async start(){if(this.abortController)throw new we({message:"MCP HTTP Transport Error: Transport already started. Note: client.connect() calls start() automatically."});this.abortController=new AbortController,this.openInboundSse()}async close(){var e,t,r;(e=this.inboundSseConnection)==null||e.close();try{if(this.sessionId&&this.abortController&&!this.abortController.signal.aborted){const o=await this.commonHeaders({});await fetch(this.url,{method:"DELETE",headers:o,signal:this.abortController.signal}).catch(()=>{})}}catch{}(t=this.abortController)==null||t.abort(),(r=this.onclose)==null||r.call(this)}async send(e){const t=async(r=!1)=>{var o,n,i,a,s,c,l;try{const d={method:"POST",headers:await this.commonHeaders({"Content-Type":"application/json",Accept:"application/json, text/event-stream"}),body:JSON.stringify(e),signal:(o=this.abortController)==null?void 0:o.signal},f=await fetch(this.url,d),m=f.headers.get("mcp-session-id");if(m&&(this.sessionId=m),f.status===401&&this.authProvider&&!r){this.resourceMetadataUrl=ss(f);try{if(await cs(this.authProvider,{serverUrl:this.url,resourceMetadataUrl:this.resourceMetadataUrl})!=="AUTHORIZED")throw new as}catch(y){throw(n=this.onerror)==null||n.call(this,y),y}return t(!0)}if(f.status===202){this.inboundSseConnection||this.openInboundSse();return}if(!f.ok){const y=await f.text().catch(()=>null);let b=`MCP HTTP Transport Error: POSTing to endpoint (HTTP ${f.status}): ${y}`;f.status===404&&(b+=". This server does not support HTTP transport. Try using `sse` transport instead");const w=new we({message:b});throw(i=this.onerror)==null||i.call(this,w),w}const g=f.headers.get("content-type")||"";if(g.includes("application/json")){const y=await f.json(),b=Array.isArray(y)?y.map(w=>Zo.parse(w)):[Zo.parse(y)];for(const w of b)(a=this.onmessage)==null||a.call(this,w);return}if(g.includes("text/event-stream")){if(!f.body){const x=new we({message:"MCP HTTP Transport Error: text/event-stream response without body"});throw(s=this.onerror)==null||s.call(this,x),x}const b=f.body.pipeThrough(new TextDecoderStream).pipeThrough(new Wa).getReader();(async()=>{var x,v,k;try{for(;;){const{done:E,value:I}=await b.read();if(E)return;const{event:A,data:M}=I;if(A==="message")try{const U=Zo.parse(JSON.parse(M));(x=this.onmessage)==null||x.call(this,U)}catch(U){const K=new we({message:"MCP HTTP Transport Error: Failed to parse message",cause:U});(v=this.onerror)==null||v.call(this,K)}}}catch(E){if(E instanceof Error&&E.name==="AbortError")return;(k=this.onerror)==null||k.call(this,E)}})();return}const h=new we({message:`MCP HTTP Transport Error: Unexpected content type: ${g}`});throw(c=this.onerror)==null||c.call(this,h),h}catch(u){throw(l=this.onerror)==null||l.call(this,u),u}};await t()}getNextReconnectionDelay(e){const{initialReconnectionDelay:t,reconnectionDelayGrowFactor:r,maxReconnectionDelay:o}=this.reconnectionOptions;return Math.min(t*Math.pow(r,e),o)}scheduleInboundSseReconnection(){var e;const{maxRetries:t}=this.reconnectionOptions;if(t>0&&this.inboundReconnectAttempts>=t){(e=this.onerror)==null||e.call(this,new we({message:`MCP HTTP Transport Error: Maximum reconnection attempts (${t}) exceeded.`}));return}const r=this.getNextReconnectionDelay(this.inboundReconnectAttempts);this.inboundReconnectAttempts+=1,setTimeout(async()=>{var o;(o=this.abortController)!=null&&o.signal.aborted||await this.openInboundSse(!1,this.lastInboundEventId)},r)}async openInboundSse(e=!1,t){var r,o,n,i,a,s;try{const c=await this.commonHeaders({Accept:"text/event-stream"});t&&(c["last-event-id"]=t);const l=await fetch(this.url.href,{method:"GET",headers:c,signal:(r=this.abortController)==null?void 0:r.signal}),u=l.headers.get("mcp-session-id");if(u&&(this.sessionId=u),l.status===401&&this.authProvider&&!e){this.resourceMetadataUrl=ss(l);try{if(await cs(this.authProvider,{serverUrl:this.url,resourceMetadataUrl:this.resourceMetadataUrl})!=="AUTHORIZED"){const h=new as;(o=this.onerror)==null||o.call(this,h);return}}catch(g){(n=this.onerror)==null||n.call(this,g);return}return this.openInboundSse(!0,t)}if(l.status===405)return;if(!l.ok||!l.body){const g=new we({message:`MCP HTTP Transport Error: GET SSE failed: ${l.status} ${l.statusText}`});(i=this.onerror)==null||i.call(this,g);return}const f=l.body.pipeThrough(new TextDecoderStream).pipeThrough(new Wa).getReader(),m=async()=>{var g,h,y,b;try{for(;;){const{done:w,value:x}=await f.read();if(w)return;const{event:v,data:k,id:E}=x;if(E&&(this.lastInboundEventId=E),v==="message")try{const I=Zo.parse(JSON.parse(k));(g=this.onmessage)==null||g.call(this,I)}catch(I){const A=new we({message:"MCP HTTP Transport Error: Failed to parse message",cause:I});(h=this.onerror)==null||h.call(this,A)}}}catch(w){if(w instanceof Error&&w.name==="AbortError")return;(y=this.onerror)==null||y.call(this,w),(b=this.abortController)!=null&&b.signal.aborted||this.scheduleInboundSseReconnection()}};this.inboundSseConnection={close:()=>f.cancel()},this.inboundReconnectAttempts=0,m()}catch(c){if(c instanceof Error&&c.name==="AbortError")return;(a=this.onerror)==null||a.call(this,c),(s=this.abortController)!=null&&s.signal.aborted||this.scheduleInboundSseReconnection()}}};function hP(e){switch(e.type){case"sse":return new mP(e);case"http":return new pP(e);default:throw new we({message:"Unsupported or invalid transport configuration. If you are using a custom transport, make sure it implements the MCPTransport interface."})}}function gP(e){return"start"in e&&typeof e.start=="function"&&"send"in e&&typeof e.send=="function"&&"close"in e&&typeof e.close=="function"}var vP="1.0.0";async function yP(e){const t=new bP(e);return await t.init(),t}var bP=class{constructor({transport:e,name:t="ai-sdk-mcp-client",version:r=vP,onUncaughtError:o,capabilities:n}){this.requestMessageId=0,this.responseHandlers=new Map,this.serverCapabilities={},this.isClosed=!0,this.onUncaughtError=o,this.clientCapabilities=n??{},gP(e)?this.transport=e:this.transport=hP(e),this.transport.onclose=()=>this.onClose(),this.transport.onerror=i=>this.onError(i),this.transport.onmessage=i=>{if("method"in i){"id"in i?this.onRequestMessage(i):this.onError(new we({message:"Unsupported message type"}));return}this.onResponse(i)},this.clientInfo={name:t,version:r}}async init(){try{await this.transport.start(),this.isClosed=!1;const e=await this.request({request:{method:"initialize",params:{protocolVersion:mo,capabilities:this.clientCapabilities,clientInfo:this.clientInfo}},resultSchema:wR});if(e===void 0)throw new we({message:"Server sent invalid initialize result"});if(!yR.includes(e.protocolVersion))throw new we({message:`Server's protocol version is not supported: ${e.protocolVersion}`});return this.serverCapabilities=e.capabilities,await this.notification({method:"notifications/initialized"}),this}catch(e){throw await this.close(),e}}async close(){var e;this.isClosed||(await((e=this.transport)==null?void 0:e.close()),this.onClose())}assertCapability(e){switch(e){case"initialize":break;case"tools/list":case"tools/call":if(!this.serverCapabilities.tools)throw new we({message:"Server does not support tools"});break;case"resources/list":case"resources/read":case"resources/templates/list":if(!this.serverCapabilities.resources)throw new we({message:"Server does not support resources"});break;case"prompts/list":case"prompts/get":if(!this.serverCapabilities.prompts)throw new we({message:"Server does not support prompts"});break;default:throw new we({message:`Unsupported method: ${e}`})}}async request({request:e,resultSchema:t,options:r}){return new Promise((o,n)=>{if(this.isClosed)return n(new we({message:"Attempted to send a request from a closed client"}));this.assertCapability(e.method);const i=r?.signal;i?.throwIfAborted();const a=this.requestMessageId++,s={...e,jsonrpc:"2.0",id:a},c=()=>{this.responseHandlers.delete(a)};this.responseHandlers.set(a,l=>{if(i?.aborted)return n(new we({message:"Request was aborted",cause:i.reason}));if(l instanceof Error)return n(l);try{const u=t.parse(l.result);o(u)}catch(u){const d=new we({message:"Failed to parse server response",cause:u});n(d)}}),this.transport.send(s).catch(l=>{c(),n(l)})})}async listTools({params:e,options:t}={}){try{return this.request({request:{method:"tools/list",params:e},resultSchema:SR,options:t})}catch(r){throw r}}async callTool({name:e,args:t,options:r}){try{return this.request({request:{method:"tools/call",params:{name:e,arguments:t}},resultSchema:IR,options:{signal:r?.abortSignal}})}catch(o){throw o}}async listResourcesInternal({params:e,options:t}={}){try{return this.request({request:{method:"resources/list",params:e},resultSchema:ER,options:t})}catch(r){throw r}}async readResourceInternal({uri:e,options:t}){try{return this.request({request:{method:"resources/read",params:{uri:e}},resultSchema:OR,options:t})}catch(r){throw r}}async listResourceTemplatesInternal({options:e}={}){try{return this.request({request:{method:"resources/templates/list"},resultSchema:$R,options:e})}catch(t){throw t}}async listPromptsInternal({params:e,options:t}={}){try{return this.request({request:{method:"prompts/list",params:e},resultSchema:NR,options:t})}catch(r){throw r}}async getPromptInternal({name:e,args:t,options:r}){try{return this.request({request:{method:"prompts/get",params:{name:e,arguments:t}},resultSchema:PR,options:r})}catch(o){throw o}}async notification(e){const t={...e,jsonrpc:"2.0"};await this.transport.send(t)}async tools({schemas:e="automatic"}={}){var t;const r={};try{const o=await this.listTools();for(const{name:n,description:i,inputSchema:a}of o.tools){if(e!=="automatic"&&!(n in e))continue;const s=this,c=async(u,d)=>{var f;return(f=d?.abortSignal)==null||f.throwIfAborted(),s.callTool({name:n,args:u,options:d})},l=e==="automatic"?cR({description:i,inputSchema:uR({...a,properties:(t=a.properties)!=null?t:{},additionalProperties:!1}),execute:c}):{description:i,inputSchema:e[n].inputSchema,execute:c};r[n]=l}return r}catch(o){throw o}}listResources({params:e,options:t}={}){return this.listResourcesInternal({params:e,options:t})}readResource({uri:e,options:t}){return this.readResourceInternal({uri:e,options:t})}listResourceTemplates({options:e}={}){return this.listResourceTemplatesInternal({options:e})}listPrompts({params:e,options:t}={}){return this.listPromptsInternal({params:e,options:t})}getPrompt({name:e,arguments:t,options:r}){return this.getPromptInternal({name:e,args:t,options:r})}onElicitationRequest(e,t){if(e!==mh)throw new we({message:"Unsupported request schema. Only ElicitationRequestSchema is supported."});this.elicitationRequestHandler=t}async onRequestMessage(e){try{if(e.method!=="elicitation/create"){await this.transport.send({jsonrpc:"2.0",id:e.id,error:{code:-32601,message:`Unsupported request method: ${e.method}`}});return}if(!this.elicitationRequestHandler){await this.transport.send({jsonrpc:"2.0",id:e.id,error:{code:-32601,message:"No elicitation handler registered on client"}});return}const t=mh.safeParse({method:e.method,params:e.params});if(!t.success){await this.transport.send({jsonrpc:"2.0",id:e.id,error:{code:-32602,message:`Invalid elicitation request: ${t.error.message}`,data:t.error.issues}});return}try{const r=await this.elicitationRequestHandler(t.data),o=DR.parse(r);await this.transport.send({jsonrpc:"2.0",id:e.id,result:o})}catch(r){await this.transport.send({jsonrpc:"2.0",id:e.id,error:{code:-32603,message:r instanceof Error?r.message:"Failed to handle elicitation request"}}),this.onError(r)}}catch(t){this.onError(t)}}onClose(){if(this.isClosed)return;this.isClosed=!0;const e=new we({message:"Connection closed"});for(const t of this.responseHandlers.values())t(e);this.responseHandlers.clear()}onError(e){this.onUncaughtError&&this.onUncaughtError(e)}onResponse(e){const t=Number(e.id),r=this.responseHandlers.get(t);if(r===void 0)throw new we({message:`Protocol error: Received a response for an unknown message ID: ${JSON.stringify(e)}`});this.responseHandlers.delete(t),r("result"in e?e:new we({message:e.error.message,code:e.error.code,data:e.error.data,cause:e.error}))}},qi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_P={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},wP=class{#e=_P;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#t&&e!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Yr=new wP;function xP(e){setTimeout(e,0)}var an=typeof window>"u"||"Deno"in globalThis;function ut(){}function SP(e,t){return typeof e=="function"?e(t):e}function Iu(e){return typeof e=="number"&&e>=0&&e!==1/0}function _S(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Or(e,t){return typeof e=="function"?e(t):e}function Tt(e,t){return typeof e=="function"?e(t):e}function vh(e,t){const{type:r="all",exact:o,fetchStatus:n,predicate:i,queryKey:a,stale:s}=e;if(a){if(o){if(t.queryHash!==pm(a,t.options))return!1}else if(!ni(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||n&&n!==t.state.fetchStatus||i&&!i(t))}function yh(e,t){const{exact:r,status:o,predicate:n,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(ri(t.options.mutationKey)!==ri(i))return!1}else if(!ni(t.options.mutationKey,i))return!1}return!(o&&t.state.status!==o||n&&!n(t))}function pm(e,t){return(t?.queryKeyHashFn||ri)(e)}function ri(e){return JSON.stringify(e,(t,r)=>Ou(r)?Object.keys(r).sort().reduce((o,n)=>(o[n]=r[n],o),{}):r)}function ni(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ni(e[r],t[r])):!1}var kP=Object.prototype.hasOwnProperty;function Tu(e,t){if(e===t)return e;const r=bh(e)&&bh(t);if(!r&&!(Ou(e)&&Ou(t)))return t;const n=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,s=r?new Array(a):{};let c=0;for(let l=0;l<a;l++){const u=r?l:i[l],d=e[u],f=t[u];if(d===f){s[u]=d,(r?l<n:kP.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){s[u]=f;continue}const m=Tu(d,f);s[u]=m,m===d&&c++}return n===a&&c===n?e:s}function $u(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function bh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ou(e){if(!_h(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!_h(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _h(e){return Object.prototype.toString.call(e)==="[object Object]"}function EP(e){return new Promise(t=>{Yr.setTimeout(t,e)})}function Au(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Tu(e,t)}catch(o){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${o}`),o}return Tu(e,t)}return t}function IP(e,t,r=0){const o=[...e,t];return r&&o.length>r?o.slice(1):o}function TP(e,t,r=0){const o=[t,...e];return r&&o.length>r?o.slice(0,-1):o}var ls=Symbol();function wS(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===ls&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ls?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $P(e,t){return typeof e=="function"?e(...t):!!e}var OP=class extends qi{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!an&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},hm=new OP;function Cu(){let e,t;const r=new Promise((n,i)=>{e=n,t=i});r.status="pending",r.catch(()=>{});function o(n){Object.assign(r,n),delete r.resolve,delete r.reject}return r.resolve=n=>{o({status:"fulfilled",value:n}),e(n)},r.reject=n=>{o({status:"rejected",reason:n}),t(n)},r}var AP=xP;function CP(){let e=[],t=0,r=s=>{s()},o=s=>{s()},n=AP;const i=s=>{t?e.push(s):n(()=>{r(s)})},a=()=>{const s=e;e=[],s.length&&n(()=>{o(()=>{s.forEach(c=>{r(c)})})})};return{batch:s=>{let c;t++;try{c=s()}finally{t--,t||a()}return c},batchCalls:s=>(...c)=>{i(()=>{s(...c)})},schedule:i,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{o=s},setScheduler:s=>{n=s}}}var We=CP(),NP=class extends qi{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!an&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},us=new NP;function RP(e){return Math.min(1e3*2**e,3e4)}function xS(e){return(e??"online")==="online"?us.isOnline():!0}var Nu=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function SS(e){let t=!1,r=0,o;const n=Cu(),i=()=>n.status!=="pending",a=h=>{if(!i()){const y=new Nu(h);f(y),e.onCancel?.(y)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>hm.isFocused()&&(e.networkMode==="always"||us.isOnline())&&e.canRun(),u=()=>xS(e.networkMode)&&e.canRun(),d=h=>{i()||(o?.(),n.resolve(h))},f=h=>{i()||(o?.(),n.reject(h))},m=()=>new Promise(h=>{o=y=>{(i()||l())&&h(y)},e.onPause?.()}).then(()=>{o=void 0,i()||e.onContinue?.()}),g=()=>{if(i())return;let h;const y=r===0?e.initialPromise:void 0;try{h=y??e.fn()}catch(b){h=Promise.reject(b)}Promise.resolve(h).then(d).catch(b=>{if(i())return;const w=e.retry??(an?0:3),x=e.retryDelay??RP,v=typeof x=="function"?x(r,b):x,k=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,b);if(t||!k){f(b);return}r++,e.onFail?.(r,b),EP(v).then(()=>l()?void 0:m()).then(()=>{t?f(b):g()})})};return{promise:n,status:()=>n.status,cancel:a,continue:()=>(o?.(),n),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?g():m().then(g),n)}}var kS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Iu(this.gcTime)&&(this.#e=Yr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(an?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Yr.clearTimeout(this.#e),this.#e=void 0)}},PP=class extends kS{#e;#t;#r;#o;#n;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=xh(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=xh(this.options);t.data!==void 0&&(this.setState(wh(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=Au(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(ut).catch(ut):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Tt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ls||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Or(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!_S(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#a?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(c=>c.options.queryFn);s&&this.setOptions(s.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},n=()=>{const s=wS(this.options,t),l=(()=>{const u={client:this.#o,queryKey:this.queryKey,meta:this.meta};return o(u),u})();return this.#a=!1,this.options.persister?this.options.persister(s,l,this):s(l)},a=(()=>{const s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:n};return o(s),s})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#i({type:"fetch",meta:a.fetchOptions?.meta}),this.#n=SS({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:s=>{s instanceof Nu&&s.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(s,c)=>{this.#i({type:"failed",failureCount:s,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const s=await this.#n.start();if(s===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(s),this.#r.config.onSuccess?.(s,this),this.#r.config.onSettled?.(s,this.state.error,this),s}catch(s){if(s instanceof Nu){if(s.silent)return this.#n.promise;if(s.revert){if(this.state.data===void 0)throw s;return this.state.data}}throw this.#i({type:"error",error:s}),this.#r.config.onError?.(s,this),this.#r.config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ES(r.data,this.options),fetchMeta:e.meta??null};case"success":const o={...r,...wh(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?o:void 0,o;case"error":const n=e.error;return{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),We.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function ES(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function xh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,o=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var jP=class extends qi{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=Cu(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#o=void 0;#n;#s;#a;#i;#h;#f;#m;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Sh(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ru(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ru(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Tt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),t._defaulted&&!$u(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&kh(this.#t,r,this.options,t)&&this.#d(),this.updateResult(),o&&(this.#t!==r||Tt(this.options.enabled,this.#t)!==Tt(t.enabled,this.#t)||Or(this.options.staleTime,this.#t)!==Or(t.staleTime,this.#t))&&this.#g();const n=this.#v();o&&(this.#t!==r||Tt(this.options.enabled,this.#t)!==Tt(t.enabled,this.#t)||n!==this.#c)&&this.#y(n)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return zP(this,r)&&(this.#o=r,this.#s=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(r,o)=>(this.trackProp(o),t?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#x();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ut)),t}#g(){this.#_();const e=Or(this.options.staleTime,this.#t);if(an||this.#o.isStale||!Iu(e))return;const r=_S(this.#o.dataUpdatedAt,e)+1;this.#l=Yr.setTimeout(()=>{this.#o.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(an||Tt(this.options.enabled,this.#t)===!1||!Iu(this.#c)||this.#c===0)&&(this.#u=Yr.setInterval(()=>{(this.options.refetchIntervalInBackground||hm.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#_(){this.#l&&(Yr.clearTimeout(this.#l),this.#l=void 0)}#w(){this.#u&&(Yr.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#t,o=this.options,n=this.#o,i=this.#n,a=this.#s,c=e!==r?e.state:this.#r,{state:l}=e;let u={...l},d=!1,f;if(t._optimisticResults){const A=this.hasListeners(),M=!A&&Sh(e,t),U=A&&kh(e,r,t,o);(M||U)&&(u={...u,...ES(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:h}=u;f=u.data;let y=!1;if(t.placeholderData!==void 0&&f===void 0&&h==="pending"){let A;n?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(A=n.data,y=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,A!==void 0&&(h="success",f=Au(n?.data,A,t),d=!0)}if(t.select&&f!==void 0&&!y)if(n&&f===i?.data&&t.select===this.#h)f=this.#f;else try{this.#h=t.select,f=t.select(f),f=Au(n?.data,f,t),this.#f=f,this.#i=null}catch(A){this.#i=A}this.#i&&(m=this.#i,f=this.#f,g=Date.now(),h="error");const b=u.fetchStatus==="fetching",w=h==="pending",x=h==="error",v=w&&b,k=f!==void 0,I={status:h,fetchStatus:u.fetchStatus,isPending:w,isSuccess:h==="success",isError:x,isInitialLoading:v,isLoading:v,data:f,dataUpdatedAt:u.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:x&&!k,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:x&&k,isStale:gm(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Tt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=K=>{I.status==="error"?K.reject(I.error):I.data!==void 0&&K.resolve(I.data)},M=()=>{const K=this.#a=I.promise=Cu();A(K)},U=this.#a;switch(U.status){case"pending":e.queryHash===r.queryHash&&A(U);break;case"fulfilled":(I.status==="error"||I.data!==U.value)&&M();break;case"rejected":(I.status!=="error"||I.error!==U.reason)&&M();break}}return I}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#s=this.options,this.#n.data!==void 0&&(this.#m=this.#t),$u(t,e))return;this.#o=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,n=typeof o=="function"?o():o;if(n==="all"||!n&&!this.#p.size)return!0;const i=new Set(n??this.#p);return this.options.throwOnError&&i.add("error"),Object.keys(this.#o).some(a=>{const s=a;return this.#o[s]!==e[s]&&i.has(s)})};this.#S({listeners:r()})}#x(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){We.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function DP(e,t){return Tt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Sh(e,t){return DP(e,t)||e.state.data!==void 0&&Ru(e,t,t.refetchOnMount)}function Ru(e,t,r){if(Tt(t.enabled,e)!==!1&&Or(t.staleTime,e)!=="static"){const o=typeof r=="function"?r(e):r;return o==="always"||o!==!1&&gm(e,t)}return!1}function kh(e,t,r,o){return(e!==t||Tt(o.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&gm(e,r)}function gm(e,t){return Tt(t.enabled,e)!==!1&&e.isStaleByTime(Or(t.staleTime,e))}function zP(e,t){return!$u(e.getCurrentResult(),t)}function Eh(e){return{onFetch:(t,r)=>{const o=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},c=0;const l=async()=>{let u=!1;const d=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=wS(t.options,t.fetchOptions),m=async(g,h,y)=>{if(u)return Promise.reject();if(h==null&&g.pages.length)return Promise.resolve(g);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:h,direction:y?"backward":"forward",meta:t.options.meta};return d(E),E})(),x=await f(w),{maxPages:v}=t.options,k=y?TP:IP;return{pages:k(g.pages,x,v),pageParams:k(g.pageParams,h,v)}};if(n&&i.length){const g=n==="backward",h=g?MP:Ih,y={pages:i,pageParams:a},b=h(o,y);s=await m(y,b,g)}else{const g=e??i.length;do{const h=c===0?a[0]??o.initialPageParam:Ih(o,s);if(c>0&&h==null)break;s=await m(s,h),c++}while(c<g)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function Ih(e,{pages:t,pageParams:r}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,r[o],r):void 0}function MP(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var UP=class extends kS{#e;#t;#r;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||LP(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=SS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(i,a)=>{this.#n({type:"failed",failureCount:i,error:a})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const o=this.state.status==="pending",n=!this.#o.canStart();try{if(o)t();else{this.#n({type:"pending",variables:e,isPaused:n}),await this.#r.config.onMutate?.(e,this,r);const a=await this.options.onMutate?.(e,r);a!==this.state.context&&this.#n({type:"pending",context:a,variables:e,isPaused:n})}const i=await this.#o.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#n({type:"success",data:i}),i}catch(i){try{throw await this.#r.config.onError?.(i,e,this.state.context,this,r),await this.options.onError?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,i,e,this.state.context,r),i}finally{this.#n({type:"error",error:i})}}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),We.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function LP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var FP=class extends qi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const o=new UP({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(o),o}add(e){this.#e.add(e);const t=ga(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ga(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const o=r.indexOf(e);o!==-1&&r.splice(o,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ga(e);if(typeof t=="string"){const o=this.#t.get(t)?.find(n=>n.state.status==="pending");return!o||o===e}else return!0}runNext(e){const t=ga(e);return typeof t=="string"?this.#t.get(t)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){We.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>yh(t,r))}findAll(e={}){return this.getAll().filter(t=>yh(e,t))}notify(e){We.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return We.batch(()=>Promise.all(e.map(t=>t.continue().catch(ut))))}};function ga(e){return e.options.scope?.id}var VP=class extends qi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const o=t.queryKey,n=t.queryHash??pm(o,t);let i=this.get(n);return i||(i=new PP({client:e,queryKey:o,queryHash:n,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){We.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>vh(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>vh(e,r)):t}notify(e){We.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){We.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){We.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ZP=class{#e;#t;#r;#o;#n;#s;#a;#i;constructor(e={}){this.#e=e.queryCache||new VP,this.#t=e.mutationCache||new FP,this.#r=e.defaultOptions||{},this.#o=new Map,this.#n=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=hm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=us.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),o=r.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Or(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const o=r.data;return[t,o]})}setQueryData(e,t,r){const o=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(o.queryHash)?.state.data,a=SP(t,i);if(a!==void 0)return this.#e.build(this,o).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return We.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;We.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return We.batch(()=>(r.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},o=We.batch(()=>this.#e.findAll(e).map(n=>n.cancel(r)));return Promise.all(o).then(ut).catch(ut)}invalidateQueries(e,t={}){return We.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},o=We.batch(()=>this.#e.findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let i=n.fetch(void 0,r);return r.throwOnError||(i=i.catch(ut)),n.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(o).then(ut)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Or(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ut).catch(ut)}fetchInfiniteQuery(e){return e.behavior=Eh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ut).catch(ut)}ensureInfiniteQueryData(e){return e.behavior=Eh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return us.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#o.set(ri(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],r={};return t.forEach(o=>{ni(e,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(ri(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(o=>{ni(e,o.mutationKey)&&Object.assign(r,o.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ls&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},IS=_.createContext(void 0),TS=e=>{const t=_.useContext(IS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},BP=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(IS.Provider,{value:e,children:t})),$S=_.createContext(!1),qP=()=>_.useContext($S);$S.Provider;function GP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var HP=_.createContext(GP()),WP=()=>_.useContext(HP),JP=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},KP=e=>{_.useEffect(()=>{e.clearReset()},[e])},YP=({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(n&&e.data===void 0||$P(r,[e.error,o])),XP=e=>{if(e.suspense){const r=n=>n==="static"?n:Math.max(n??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...n)=>r(o(...n)):r(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},QP=(e,t)=>e.isLoading&&e.isFetching&&!t,ej=(e,t)=>e?.suspense&&t.isPending,Th=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function tj(e,t,r){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const o=qP(),n=WP(),i=TS(),a=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),a._optimisticResults=o?"isRestoring":"optimistic",XP(a),JP(a,n),KP(n);const s=!i.getQueryCache().get(a.queryHash),[c]=_.useState(()=>new t(i,a)),l=c.getOptimisticResult(a),u=!o&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(d=>{const f=u?c.subscribe(We.batchCalls(d)):ut;return c.updateResult(),f},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setOptions(a)},[a,c]),ej(a,l))throw Th(a,c,n);if(YP({result:l,errorResetBoundary:n,throwOnError:a.throwOnError,query:i.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw l.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!an&&QP(l,o)&&(s?Th(a,c,n):i.getQueryCache().get(a.queryHash)?.promise)?.catch(ut).finally(()=>{c.updateResult()}),a.notifyOnChangeProps?l:c.trackResult(l)}function OS(e,t){return tj(e,jP)}function rj({auth:e,mcp:t,environment:r,toolsToInclude:o,gramEnvironment:n,chatId:i}){const a=Object.entries(e.headers??{}).map((c,l)=>`${c}:${l}`);return OS({queryKey:["mcpTools",t,n,...a],queryFn:async()=>{$.assert(!e.isLoading,"No auth found"),$.assert(t,"No MCP URL found");const l=await(await yP({name:"gram-elements-mcp-client",transport:{type:"http",url:t,headers:{...nj(r??{}),...e.headers,...n&&{"Gram-Environment":n},...i&&{"Gram-Chat-ID":i}}}})).tools();return o?Object.fromEntries(Object.entries(l).filter(([u])=>typeof o=="function"?o({toolName:u}):o.includes(u))):l},enabled:!e.isLoading&&!!t,staleTime:1/0,gcTime:1/0})}const $h="MCP-";function nj(e){return typeof e!="object"||e===null?{}:Object.entries(e).reduce((t,[r,o])=>{const n=r.replace(/_/g,"-"),i=n.startsWith($h)?n:`${$h}${n}`;return t[i]=o,t},{})}const AS=()=>{const e=N.useContext($.ToolApprovalContext);if(!e)throw new Error("useToolApproval must be used within a ToolApprovalProvider");return e};function oj(e){return(e.api?.url||""||"https://app.getgram.ai").replace(/\/+$/,"")}const Oc={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},ur=console,jn={};Object.keys(Oc).forEach(e=>{jn[e]=ur[e]});const Ro="Datadog Browser SDK:",Q={debug:jn.debug.bind(ur,Ro),log:jn.log.bind(ur,Ro),info:jn.info.bind(ur,Ro),warn:jn.warn.bind(ur,Ro),error:jn.error.bind(ur,Ro)},Ac="https://docs.datadoghq.com",ij=`${Ac}/real_user_monitoring/browser/troubleshooting`,vm="More details:";function CS(e,t){return(...r)=>{try{return e(...r)}catch(o){Q.error(t,o)}}}function Xr(e){return e!==0&&Math.random()*100<=e}function Bo(e,t){return+e.toFixed(t)}function aj(e){return Gi(e)&&e>=0&&e<=100}function Gi(e){return typeof e=="number"}function oi(e){return{...e}}function ds(e,t){return Object.keys(e).some(r=>e[r]===t)}function Vr(e){return Object.keys(e).length===0}function NS(e,t){const r={};for(const o of Object.keys(e))r[o]=t(e[o]);return r}function It(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}const or=It(),Cc="WorkerGlobalScope"in or;function jr(e,t){const r=It();let o;return r.Zone&&typeof r.Zone.__symbol__=="function"&&(o=e[r.Zone.__symbol__(t)]),o||(o=e[t]),o}let Pu,RS=!1;function sj(e){Pu=e}function cj(e){RS=e}function ne(e){return function(){return Ar(e,this,arguments)}}function Ar(e,t,r){try{return e.apply(t,r)}catch(o){pr(o)}}function pr(e){if(ju(e),Pu)try{Pu(e)}catch(t){ju(t)}}function ju(...e){RS&&Q.error("[MONITOR]",...e)}function Je(e,t){return jr(It(),"setTimeout")(ne(e),t)}function yt(e){jr(It(),"clearTimeout")(e)}function po(e,t){return jr(It(),"setInterval")(ne(e),t)}function Nc(e){jr(It(),"clearInterval")(e)}function Oh(e){var t;const r=(t=or.queueMicrotask)===null||t===void 0?void 0:t.bind(or);typeof r=="function"?r(ne(e)):Promise.resolve().then(ne(e))}class he{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach(r=>r(t))}addObserver(t){this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(r=>t!==r),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function PS(...e){return new he(t=>{const r=e.map(o=>o.subscribe(n=>t.notify(n)));return()=>r.forEach(o=>o.unsubscribe())})}class jS extends he{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let r=!1;const o={unsubscribe:()=>{r=!0,this.removeObserver(t)}};return Oh(()=>{for(const n of this.buffer){if(r)return;t(n)}r||this.addObserver(t)}),o}unbuffer(){Oh(()=>{this.maxBufferSize=this.buffer.length=0})}}const Ke=1e3,lt=60*Ke,DS=60*lt,lj=24*DS,zS=365*lj;function Hi(e){return{relative:e,timeStamp:dj(e)}}function uj(e){return{relative:bm(e),timeStamp:e}}function dj(e){const t=ct()-performance.now();return t>Wi()?Math.round(ho(t,e)):fj(e)}function MS(){return Math.round(ct()-ho(Wi(),performance.now()))}function oe(e){return Gi(e)?Bo(e*1e6,0):e}function ct(){return new Date().getTime()}function Be(){return ct()}function _t(){return performance.now()}function Ue(){return{relative:_t(),timeStamp:Be()}}function ym(){return{relative:0,timeStamp:Wi()}}function Ne(e,t){return t-e}function ho(e,t){return e+t}function bm(e){return e-Wi()}function fj(e){return Math.round(ho(Wi(),e))}function mj(e){return e<zS}let Sl;function Wi(){var e,t;return Sl===void 0&&(Sl=(t=(e=performance.timing)===null||e===void 0?void 0:e.navigationStart)!==null&&t!==void 0?t:performance.timeOrigin),Sl}function Ji(e,t,r){const o=r&&r.leading!==void 0?r.leading:!0,n=r&&r.trailing!==void 0?r.trailing:!0;let i=!1,a,s;return{throttled:(...c)=>{if(i){a=c;return}o?e(...c):a=c,i=!0,s=Je(()=>{n&&a&&e(...a),i=!1,a=void 0},t)},cancel:()=>{yt(s),i=!1,a=void 0}}}function _e(){}function et(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,et)}const no=/([\w-]+)\s*=\s*([^;]+)/g;function ii(e,t){for(no.lastIndex=0;;){const r=no.exec(e);if(r){if(r[1]===t)return r[2]}else break}}function pj(e){const t=new Map;for(no.lastIndex=0;;){const r=no.exec(e);if(r){const o=r[1],n=r[2];t.has(o)?t.get(o).push(n):t.set(o,[n])}else break}return t}function hj(e){const t=new Map;for(no.lastIndex=0;;){const r=no.exec(e);if(r)t.set(r[1],r[2]);else break}return t}function _m(e,t,r=""){const o=e.charCodeAt(t-1),i=o>=55296&&o<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${r}`}function gj(){return US()===0}function vj(){return US()===1}let va;function US(){return va??(va=yj())}function yj(e=window){var t;const r=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(r)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(r)&&!/chrome|android/i.test(r)?1:2}function wm(e){return Ki(e,location.href).href}function bj(e){try{return!!Ki(e)}catch{return!1}}function _j(e){const t=Ki(e).pathname;return t[0]==="/"?t:`/${t}`}function Ki(e,t){const{URL:r}=wj();try{return t!==void 0?new r(e,t):new r(e)}catch(o){throw new Error(`Failed to construct URL: ${String(o)}`)}}let kl;function wj(){if(!kl){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=or}kl={URL:t.URL},e?.remove()}return kl}function Rc(e,t,r=0,o){const n=new Date;n.setTime(n.getTime()+r);const i=`expires=${n.toUTCString()}`,a=o&&o.crossSite?"none":"strict",s=o&&o.domain?`;domain=${o.domain}`:"",c=o&&o.secure?";secure":"",l=o&&o.partitioned?";partitioned":"";document.cookie=`${e}=${t};${i};path=/;samesite=${a}${s}${c}${l}`}function Pc(e){return ii(document.cookie,e)}function xj(e){return pj(document.cookie).get(e)||[]}let El;function Tr(e){return El||(El=hj(document.cookie)),El.get(e)}function LS(e,t){Rc(e,"",0,t)}function Sj(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${et()}`,r="test";Rc(t,r,lt,e);const o=Pc(t)===r;return LS(t,e),o}catch(t){return Q.error(t),!1}}let Il;function FS(e=location.hostname,t=document.referrer){if(Il===void 0){const r=kj(e,t);if(r){const o=`dd_site_test_${et()}`,n="test",i=r.split(".");let a=i.pop();for(;i.length&&!Pc(o);)a=`${i.pop()}.${a}`,Rc(o,n,Ke,{domain:a});LS(o,{domain:a}),Il=a}}return Il}function kj(e,t){try{return e||Ki(t).hostname}catch{}}const hr="_dd_s";function VS(e,t){for(let r=e.length-1;r>=0;r-=1){const o=e[r];if(t(o,r,e))return o}}function ZS(e){return Object.values(e)}function jc(e){return Object.entries(e)}const vn=4*DS,BS=15*lt,Ej=zS,qS="0",oo={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},GS=/^([a-zA-Z]+)=([a-z0-9-]+)$/,xm="&";function Ij(e){return!!e&&(e.indexOf(xm)!==-1||GS.test(e))}const Tj="1";function Gr(e,t){const r={isExpired:Tj};return t.trackAnonymousUser&&e?.anonymousId&&(r.anonymousId=e?.anonymousId),r}function Da(e){return Vr(e)}function HS(e){return!Da(e)}function qo(e){return e.isExpired!==void 0||!$j(e)}function $j(e){return(e.created===void 0||ct()-Number(e.created)<vn)&&(e.expire===void 0||ct()<Number(e.expire))}function WS(e){e.expire=String(ct()+BS)}function Du(e){return jc(e).map(([t,r])=>t==="anonymousId"?`aid=${r}`:`${t}=${r}`).join(xm)}function Dc(e){const t={};return Ij(e)&&e.split(xm).forEach(r=>{const o=GS.exec(r);if(o!==null){const[,n,i]=o;n==="aid"?t.anonymousId=i:t[n]=i}}),t}const Oj="_dd",Aj="_dd_r",Cj="_dd_l",Nj="rum",Rj="logs";function Pj(e){if(!Tr(hr)){const r=Tr(Oj),o=Tr(Aj),n=Tr(Cj),i={};r&&(i.id=r),n&&/^[01]$/.test(n)&&(i[Rj]=n),o&&/^[012]$/.test(o)&&(i[Nj]=o),HS(i)&&(WS(i),e.persistSession(i))}}const jj=0;function Ah(e){const t=zj(e);return t&&Sj(t)?{type:oo.COOKIE,cookieOptions:t}:void 0}function Dj(e,t){const r={isLockEnabled:gj(),persistSession:o=>Ch(t,e,o,BS),retrieveSession:()=>JS(t,e),expireSession:o=>Ch(t,e,Gr(o,e),vn)};return Pj(r),r}function Ch(e,t,r,o){let n=Du(r);t.betaEncodeCookieOptions&&(n=Du({...r,...Vr(r)?{}:{c:KS(e)}})),Rc(hr,n,t.trackAnonymousUser?Ej:o,e)}function JS(e,t){if(t.betaEncodeCookieOptions)return Mj(e);const r=Pc(hr);return Dc(r)}function zj(e){const t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){const r=FS();if(!r)return;t.domain=r}return t}function KS(e){const t=e.domain?e.domain.split(".").length-1:0;let r=0;return r|=jj<<5,r|=t<<1,r|=e.crossSite?1:0,r.toString(16)}function Mj(e){const t=xj(hr),r=KS(e);let o;for(const n of t.reverse())if(o=Dc(n),o.c===r)break;return o==null||delete o.c,o??{}}const Uj="_dd_test_";function Nh(){try{const e=et(),t=`${Uj}${e}`;localStorage.setItem(t,e);const r=localStorage.getItem(t);return localStorage.removeItem(t),e===r?{type:oo.LOCAL_STORAGE}:void 0}catch{return}}function Lj(e){return{isLockEnabled:!1,persistSession:YS,retrieveSession:XS,expireSession:t=>Fj(t,e)}}function YS(e){localStorage.setItem(hr,Du(e))}function XS(){const e=localStorage.getItem(hr);return Dc(e)}function Fj(e,t){YS(Gr(e,t))}const Vj=10,Zj=100,Bj=Ke,QS="--",ek=[];let za;function Hr(e,t,r=0){var o;const{isLockEnabled:n,persistSession:i,expireSession:a}=t,s=f=>i({...f,lock:l}),c=()=>{const{lock:f,...m}=t.retrieveSession();return{session:m,lock:f&&!Gj(f)?f:void 0}};if(za||(za=e),e!==za){ek.push(e);return}if(n&&r>=Zj){Rh(t);return}let l,u=c();if(n){if(u.lock){ya(e,t,r);return}if(l=qj(),s(u.session),u=c(),u.lock!==l){ya(e,t,r);return}}let d=e.process(u.session);if(n&&(u=c(),u.lock!==l)){ya(e,t,r);return}if(d&&(qo(d)?a(d):(WS(d),n?s(d):i(d))),n&&!(d&&qo(d))){if(u=c(),u.lock!==l){ya(e,t,r);return}i(u.session),d=u.session}(o=e.after)===null||o===void 0||o.call(e,d||u.session),Rh(t)}function ya(e,t,r){Je(()=>{Hr(e,t,r+1)},Vj)}function Rh(e){za=void 0;const t=ek.shift();t&&Hr(t,e)}function qj(){return et()+QS+Be()}function Gj(e){const[,t]=e.split(QS);return!t||Ne(Number(t),Be())>Bj}const Ph=Ke;function Hj(e){switch(e.sessionPersistence){case oo.COOKIE:return Ah(e);case oo.LOCAL_STORAGE:return Nh();case void 0:{let t=Ah(e);return!t&&e.allowFallbackToLocalStorage&&(t=Nh()),t}default:Q.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Wj(e,t){return e.type===oo.COOKIE?Dj(t,e.cookieOptions):Lj(t)}function Jj(e,t,r,o,n=Wj(e,t)){const i=new he,a=new he,s=new he,c=po(m,Ph);let l;h();const{throttled:u,cancel:d}=Ji(()=>{Hr({process:E=>{if(Da(E))return;const I=g(E);return y(I),I},after:E=>{HS(E)&&!b()&&v(E),l=E}},n)},Ph);function f(){Hr({process:E=>b()?g(E):void 0},n)}function m(){const E=n.retrieveSession();qo(E)?Hr({process:I=>qo(I)?Gr(I,t):void 0,after:g},n):g(E)}function g(E){return qo(E)&&(E=Gr(E,t)),b()&&(w(E)?x():(s.notify({previousState:l,newState:E}),l=E)),E}function h(){Hr({process:E=>{if(Da(E))return E.anonymousId=et(),Gr(E,t)},after:E=>{l=E}},n)}function y(E){if(Da(E))return!1;const I=o(E[r]);E[r]=I,delete E.isExpired,I!==qS&&!E.id&&(E.id=et(),E.created=String(ct()))}function b(){return l?.[r]!==void 0}function w(E){return l.id!==E.id||l[r]!==E[r]}function x(){l=Gr(l,t),a.notify()}function v(E){l=E,i.notify()}function k(E){Hr({process:I=>({...I,...E}),after:g},n)}return{expandOrRenewSession:u,expandSession:f,getSession:()=>l,renewObservable:i,expireObservable:a,sessionStateUpdateObservable:s,restartSession:h,expire:E=>{d(),E===!1&&l&&delete l.anonymousId,n.expireSession(l),g(Gr(l,t))},stop:()=>{Nc(c)},updateSessionState:k}}const zu={GRANTED:"granted",NOT_GRANTED:"not-granted"};function Kj(e){const t=new he;return{tryToInit(r){e||(e=r)},update(r){e=r,t.notify()},isGranted(){return e===zu.GRANTED},observable:t}}function yn(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function ai(e){const t=yn(e);return t==="string"||t==="function"||e instanceof RegExp}function zc(e,t,r=!1){return e.some(o=>{try{if(typeof o=="function")return o(t);if(o instanceof RegExp)return o.test(t);if(typeof o=="string")return r?t.startsWith(o):o===t}catch(n){Q.error(n)}return!1})}const Yj=["chrome-extension://","moz-extension://"];function jh(e){return Yj.some(t=>e.includes(t))}function Xj(e,t=""){if(jh(e))return!1;const o=t.split(`
30
30
  `).filter(n=>{const i=n.trim();return i.length&&/^at\s+|@/.test(i)})[1]||"";return jh(o)}const Qj="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",e2="SDK initialized on a non-allowed domain.";function t2(e,t,r=typeof location<"u"?location.origin:""){const o=e.allowedTrackingOrigins;if(!o)return Xj(r,t)?(Q.error(Qj),!1):!0;const n=zc(o,r);return n||Q.error(e2),n}const tk="datad0g.com",r2="dd0g-gov.com",Qr="datadoghq.com",n2="datadoghq.eu",o2="ddog-gov.com",i2="pci.browser-intake-datadoghq.com",a2=["ddsource","dd-api-key","dd-request-id"];function Wr(e,t,r){const o=s2(e,t);return{build(n,i){const a=c2(e,t,n,i,r);return o(a)},trackType:t}}function s2(e,t){const r=`/api/v2/${t}`,o=e.proxy;if(typeof o=="string"){const i=wm(o);return a=>`${i}?ddforward=${encodeURIComponent(`${r}?${a}`)}`}if(typeof o=="function")return i=>o({path:r,parameters:i});const n=rk(t,e);return i=>`https://${n}${r}?${i}`}function rk(e,t){const{site:r=Qr,internalAnalyticsSubdomain:o}=t;if(e==="logs"&&t.usePciIntake&&r===Qr)return i2;if(o&&r===Qr)return`${o}.${Qr}`;if(r===r2)return`http-intake.logs.${r}`;const n=r.split("."),i=n.pop();return`browser-intake-${n.join("-")}.${i}`}function c2({clientToken:e,internalAnalyticsSubdomain:t,source:r="browser"},o,n,{retry:i,encoding:a},s=[]){const c=[`ddsource=${r}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.24.1")}`,"dd-evp-origin=browser",`dd-request-id=${et()}`].concat(s);return a&&c.push(`dd-evp-encoding=${a}`),o==="rum"&&(c.push(`batch_time=${Be()}`,`_dd.api=${n}`),i&&c.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`)),t&&c.reverse(),c.join("&")}function l2(e){const t=e.site||Qr,r=u2(e.source),o=d2({...e,site:t,source:r});return{replica:f2({...e,site:t,source:r}),site:t,source:r,...o}}function u2(e){return e==="flutter"||e==="unity"?e:"browser"}function d2(e){return{logsEndpointBuilder:Wr(e,"logs"),rumEndpointBuilder:Wr(e,"rum"),profilingEndpointBuilder:Wr(e,"profile"),sessionReplayEndpointBuilder:Wr(e,"replay"),exposuresEndpointBuilder:Wr(e,"exposures")}}function f2(e){if(!e.replica)return;const t={...e,site:Qr,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Wr(t,"logs"),rumEndpointBuilder:Wr(t,"rum",[`application.id=${e.replica.applicationId}`])}}function m2(e){return a2.every(t=>e.includes(t))}const Dn={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},Mu={ALL:"all",SAMPLED:"sampled"};function Tl(e,t){return e!=null&&typeof e!="string"?(Q.error(`${t} must be defined as a string`),!1):!0}function p2(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(Q.error(`Site should be a valid Datadog site. ${vm} ${Ac}/getting_started/site/.`),!1):!0}function zn(e,t){return e!==void 0&&!aj(e)?(Q.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function h2(e,t){var r,o,n,i,a,s,c,l,u,d;if(!e||!e.clientToken){Q.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){Q.error("Allowed Tracking Origins must be an array");return}if(!(!p2(e.site)||!zn(e.sessionSampleRate,"Session")||!zn(e.telemetrySampleRate,"Telemetry")||!zn(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!zn(e.telemetryUsageSampleRate,"Telemetry Usage")||!Tl(e.version,"Version")||!Tl(e.env,"Env")||!Tl(e.service,"Service")||!t2(e,t??""))){if(e.trackingConsent!==void 0&&!ds(zu,e.trackingConsent)){Q.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&CS(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Cc?void 0:Hj(e),sessionSampleRate:(r=e.sessionSampleRate)!==null&&r!==void 0?r:100,telemetrySampleRate:(o=e.telemetrySampleRate)!==null&&o!==void 0?o:20,telemetryConfigurationSampleRate:(n=e.telemetryConfigurationSampleRate)!==null&&n!==void 0?n:5,telemetryUsageSampleRate:(i=e.telemetryUsageSampleRate)!==null&&i!==void 0?i:5,service:(a=e.service)!==null&&a!==void 0?a:void 0,env:(s=e.env)!==null&&s!==void 0?s:void 0,version:(c=e.version)!==null&&c!==void 0?c:void 0,datacenter:(l=e.datacenter)!==null&&l!==void 0?l:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(u=e.trackingConsent)!==null&&u!==void 0?u:zu.GRANTED,trackAnonymousUser:(d=e.trackAnonymousUser)!==null&&d!==void 0?d:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,betaEncodeCookieOptions:!!e.betaEncodeCookieOptions,variant:e.variant,sdkVersion:e.sdkVersion,...l2(e)}}}function g2(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),beta_encode_cookie_options:e.betaEncodeCookieOptions,source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}var Dr;(function(e){e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name",e.FEATURE_OPERATION_VITAL="feature_operation_vital",e.SHORT_SESSION_INVESTIGATION="short_session_investigation",e.AVOID_FETCH_KEEPALIVE="avoid_fetch_keepalive"})(Dr||(Dr={}));const Sm=new Set;function v2(e){Array.isArray(e)&&y2(e.filter(t=>ds(Dr,t)))}function y2(e){e.forEach(t=>{Sm.add(t)})}function Yi(e){return Sm.has(e)}function b2(){return Sm}const io="?";function Xi(e){var t,r;const o=[];let n=$l(e,"stack");const i=String(e);if(n&&n.startsWith(i)&&(n=n.slice(i.length)),n&&n.split(`
31
31
  `).forEach(a=>{const s=x2(a)||k2(a)||I2(a)||O2(a);s&&(!s.func&&s.line&&(s.func=io),o.push(s))}),o.length>0&&R2()&&e instanceof Error){const a=[];let s=e;for(;(s=Object.getPrototypeOf(s))&&ok(s);){const c=((t=s.constructor)===null||t===void 0?void 0:t.name)||io;a.push(c)}for(let c=a.length-1;c>=0&&((r=o[0])===null||r===void 0?void 0:r.func)===a[c];c--)o.shift()}return{message:$l(e,"message"),name:$l(e,"name"),stack:o}}const nk="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",ao="(?::(\\d+))",_2=new RegExp(`^\\s*at (.*?) ?\\(${nk}${ao}?${ao}?\\)?\\s*$`,"i"),w2=new RegExp(`\\((\\S*)${ao}${ao}\\)`);function x2(e){const t=_2.exec(e);if(!t)return;const r=t[2]&&t[2].indexOf("native")===0,o=t[2]&&t[2].indexOf("eval")===0,n=w2.exec(t[2]);return o&&n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3]),{args:r?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||io,line:t[3]?+t[3]:void 0,url:r?void 0:t[2]}}const S2=new RegExp(`^\\s*at ?${nk}${ao}?${ao}??\\s*$`,"i");function k2(e){const t=S2.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:io,line:t[2]?+t[2]:void 0,url:t[1]}}const E2=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function I2(e){const t=E2.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||io,line:+t[3],url:t[2]}}const T2=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,$2=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function O2(e){const t=T2.exec(e);if(!t)return;const r=t[3]&&t[3].indexOf(" > eval")>-1,o=$2.exec(t[3]);return r&&o&&(t[3]=o[1],t[4]=o[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||io,line:t[4]?+t[4]:void 0,url:t[3]}}function $l(e,t){if(typeof e!="object"||!e||!(t in e))return;const r=e[t];return typeof r=="string"?r:void 0}function A2(e,t,r,o){if(t===void 0)return;const{name:n,message:i}=N2(e);return{name:n,message:i,stack:[{url:t,column:o,line:r}]}}const C2=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function N2(e){let t,r;return{}.toString.call(e)==="[object String]"&&([,t,r]=C2.exec(e)),{name:t,message:r}}function ok(e){return String(e.constructor).startsWith("class ")}let ba;function R2(){if(ba!==void 0)return ba;class e extends Error{constructor(){super(),this.name="Error"}}const[t,r]=[e,Error].map(o=>new o);return ba=ok(Object.getPrototypeOf(t))&&r.stack!==t.stack,ba}function fs(e){const r=new Error(e);r.name="HandlingStack";let o;return Ar(()=>{const n=Xi(r);n.stack=n.stack.slice(2),o=Qi(n)}),o}function Qi(e){let t=ik(e);return e.stack.forEach(r=>{const o=r.func==="?"?"<anonymous>":r.func,n=r.args&&r.args.length>0?`(${r.args.join(", ")})`:"",i=r.line?`:${r.line}`:"",a=r.line&&r.column?`:${r.column}`:"";t+=`
32
32
  at ${o}${n} @ ${r.url}${i}${a}`}),t}function ik(e){return`${e.name||"Error"}: ${e.message}`}function Bt(e,t,r,{computeHandlingStack:o}={}){let n=e[t];if(typeof n!="function")if(t in e&&t.startsWith("on"))n=_e;else return{stop:_e};let i=!1;const a=function(){if(i)return n.apply(this,arguments);const s=Array.from(arguments);let c;Ar(r,null,[{target:this,parameters:s,onPostCall:u=>{c=u},handlingStack:o?fs("instrumented method"):void 0}]);const l=n.apply(this,s);return c&&Ar(c,null,[l]),l};return e[t]=a,{stop:()=>{i=!0,e[t]===a&&(e[t]=n)}}}function P2(e,t,r){const o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o.set||!o.configurable)return{stop:_e};const n=_e;let i=(s,c)=>{Je(()=>{i!==n&&r(s,c)},0)};const a=function(s){o.set.call(this,s),i(this,s)};return Object.defineProperty(e,t,{set:a}),{stop:()=>{var s;((s=Object.getOwnPropertyDescriptor(e,t))===null||s===void 0?void 0:s.set)===a&&Object.defineProperty(e,t,o),i=n}}}const bn=1024,ak=1024*bn,j2=/[^\u0000-\u007F]/;function sk(e){return j2.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function ck(e){if(e.length===1)return e[0];const t=e.reduce((n,i)=>n+i.length,0),r=new Uint8Array(t);let o=0;for(const n of e)r.set(n,o),o+=n.length;return r}function go(e,t,r){if(typeof e!="object"||e===null)return JSON.stringify(e);const o=Mn(Object.prototype),n=Mn(Array.prototype),i=Mn(Object.getPrototypeOf(e)),a=Mn(e);try{return JSON.stringify(e,t,r)}catch{return"<error: unable to serialize object>"}finally{o(),n(),i(),a()}}function Mn(e){const t=e,r=t.toJSON;return r?(delete t.toJSON,()=>{t.toJSON=r}):_e}const D2=220*bn,z2="$",M2=3;function $e(e,t=D2){const r=Mn(Object.prototype),o=Mn(Array.prototype),n=[],i=new WeakMap,a=Ol(e,z2,void 0,n,i),s=JSON.stringify(a);let c=s?s.length:0;if(c>t){Al(t,"discarded",e);return}for(;n.length>0&&c<t;){const l=n.shift();let u=0;if(Array.isArray(l.source))for(let d=0;d<l.source.length;d++){const f=Ol(l.source[d],l.path,d,n,i);if(f!==void 0?c+=JSON.stringify(f).length:c+=4,c+=u,u=1,c>t){Al(t,"truncated",e);break}l.target[d]=f}else for(const d in l.source)if(Object.prototype.hasOwnProperty.call(l.source,d)){const f=Ol(l.source[d],l.path,d,n,i);if(f!==void 0&&(c+=JSON.stringify(f).length+u+d.length+M2,u=1),c>t){Al(t,"truncated",e);break}l.target[d]=f}}return r(),o(),a}function Ol(e,t,r,o,n){const i=F2(e);if(!i||typeof i!="object")return U2(i);const a=Uu(i);if(a!=="[Object]"&&a!=="[Array]"&&a!=="[Error]")return a;const s=e;if(n.has(s))return`[Reference seen at ${n.get(s)}]`;const c=r!==void 0?`${t}.${r}`:t,l=Array.isArray(i)?[]:{};return n.set(s,c),o.push({source:i,target:l,path:c}),l}function U2(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function Uu(e){try{if(e instanceof Event)return L2(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;const r=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(r&&r[1])return`[${r[1]}]`}catch{}return"[Unserializable]"}function L2(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Uu(e.currentTarget):null,target:e.target?Uu(e.target):null}}function F2(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function Al(e,t,r){Q.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,r)}const lk="No stack, consider using an instance of Error";function km({stackTrace:e,originalError:t,handlingStack:r,componentStack:o,startClocks:n,nonErrorPrefix:i,useFallbackStack:a=!0,source:s,handling:c}){const l=_n(t);return!e&&l&&(e=Xi(t)),{startClocks:n,source:s,handling:c,handlingStack:r,componentStack:o,originalError:t,type:e?e.name:void 0,message:V2(e,l,i,t),stack:e?Qi(e):a?lk:void 0,causes:l?q2(t,s):void 0,fingerprint:Z2(t),context:B2(t)}}function V2(e,t,r,o){return e?.message&&e?.name?e.message:t?"Empty message":`${r} ${go($e(o))}`}function Z2(e){return _n(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function B2(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function _n(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function q2(e,t){let r=e;const o=[];for(;_n(r?.cause)&&o.length<10;){const n=Xi(r.cause);o.push({message:r.cause.message,source:t,type:n?.name,stack:n&&Qi(n)}),r=r.cause}return o.length?o:void 0}const vo={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function G2(){return new he(e=>{const t=(n,i)=>{const a=km({stackTrace:i,originalError:n,startClocks:Ue(),nonErrorPrefix:"Uncaught",source:vo.SOURCE,handling:"unhandled"});e.notify(a)},{stop:r}=H2(t),{stop:o}=W2(t);return()=>{r(),o()}})}function H2(e){return Bt(It(),"onerror",({parameters:[t,r,o,n,i]})=>{let a;_n(i)||(a=A2(t,r,o,n)),e(i??t,a)})}function W2(e){return Bt(It(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function J2(e){const t={version:"6.24.1",onReady(r){r()},...e};return Object.defineProperty(t,"_setDebug",{get(){return cj},enumerable:!1}),t}function K2(e,t,r){const o=e[t];o&&!o.q&&o.version&&Q.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=r,o&&o.q&&o.q.forEach(n=>CS(n,"onReady callback threw an error:")())}function uk(e,t){t.silentMultipleInit||Q.error(`${e} is already initialized.`)}function Oe(e,t,r,o,n){return gr(e,t,[r],o,n)}function gr(e,t,r,o,{once:n,capture:i,passive:a}={}){const s=ne(f=>{!f.isTrusted&&!f.__ddIsTrusted&&!e.allowUntrustedEvents||(n&&d(),o(f))}),c=a?{capture:i,passive:a}:i,l=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,u=jr(l,"addEventListener");r.forEach(f=>u.call(t,f,s,c));function d(){const f=jr(l,"removeEventListener");r.forEach(m=>f.call(t,m,s,c))}return{stop:d}}const si={intervention:"intervention",cspViolation:"csp_violation"};function Y2(e,t){const r=[];t.includes(si.cspViolation)&&r.push(Q2(e));const o=t.filter(n=>n!==si.cspViolation);return o.length&&r.push(X2(o)),PS(...r)}function X2(e){return new he(t=>{if(!window.ReportingObserver)return;const r=ne((n,i)=>n.forEach(a=>t.notify(eD(a)))),o=new window.ReportingObserver(r,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}})}function Q2(e){return new he(t=>{const{stop:r}=Oe(e,document,"securitypolicyviolation",o=>{t.notify(tD(o))});return r})}function eD(e){const{type:t,body:r}=e;return dk({type:r.id,message:`${t}: ${r.message}`,originalError:e,stack:fk(r.id,r.message,r.sourceFile,r.lineNumber,r.columnNumber)})}function tD(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return dk({type:e.effectiveDirective,message:`${si.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:fk(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${_m(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function dk(e){return{startClocks:Ue(),source:vo.REPORT,handling:"unhandled",...e}}function fk(e,t,r,o,n){return r?Qi({name:e,message:t,stack:[{func:"?",url:r,line:o??void 0,column:n??void 0}]}):void 0}const rD=200;function Em(e){const{env:t,service:r,version:o,datacenter:n,sdkVersion:i,variant:a}=e,s=[Tn("sdk_version",i??"6.24.1")];return t&&s.push(Tn("env",t)),r&&s.push(Tn("service",r)),o&&s.push(Tn("version",o)),n&&s.push(Tn("datacenter",n)),a&&s.push(Tn("variant",a)),s}function Tn(e,t){const r=t?`${e}:${t}`:e;return(r.length>rD||oD(r))&&Q.warn(`Tag ${r} doesn't meet tag requirements and will be sanitized. ${vm} ${Ac}/getting_started/tagging/#defining-tags`),nD(r)}function nD(e){return e.replace(/,/g,"_")}function oD(e){return iD()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function iD(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function Im(e,t){const r=or.__ddBrowserSdkExtensionCallback;r&&r({type:e,payload:t})}function ms(e,t,r=aD()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const n=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,n)}if(r.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const n=Array.isArray(e)?e:[];for(let i=0;i<t.length;++i)n[i]=ms(n[i],t[i],r);return n}const o=yn(e)==="object"?e:{};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=ms(o[n],t[n],r));return o}function Tm(e){return ms(void 0,e)}function vr(...e){let t;for(const r of e)r!=null&&(t=ms(t,r));return t}function aD(){if(typeof WeakSet<"u"){const t=new WeakSet;return{hasAlreadyBeenSeen(r){const o=t.has(r);return o||t.add(r),o}}}const e=[];return{hasAlreadyBeenSeen(t){const r=e.indexOf(t)>=0;return r||e.push(t),r}}}function mk(){var e;const t=or.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function sD(e){return e>=500}function cD(e){try{return e.clone()}catch{return}}const lD=80*bn,uD=32,pk=20*ak,dD=lt,hk=Ke;function gk(e,t,r,o,n,i){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?yk(e,t,r,i,{onSuccess:()=>bk(0,t,r,o,n,i),onFailure:()=>{t.queuedPayloads.enqueue(e)||i.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),vk(t,r,o,n,i)}}):t.queuedPayloads.enqueue(e)||i.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function vk(e,t,r,o,n){e.transportStatus===2&&Je(()=>{const i=e.queuedPayloads.first();yk(i,e,t,n,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=hk,bk(1,e,t,r,o,n)},onFailure:()=>{e.currentBackoffTime=Math.min(dD,e.currentBackoffTime*2),vk(e,t,r,o,n)}})},e.currentBackoffTime)}function yk(e,t,r,o,{onSuccess:n,onFailure:i}){t.bandwidthMonitor.add(e),r(e,a=>{t.bandwidthMonitor.remove(e),fD(a)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:a.status},o.notify({type:"failure",bandwidth:t.bandwidthMonitor.stats(),payload:e}),i()):(t.transportStatus=0,o.notify({type:"success",bandwidth:t.bandwidthMonitor.stats(),payload:e}),n())})}function bk(e,t,r,o,n,i){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(n({message:`Reached max ${o} events size queued for upload: ${pk/ak}MiB`,source:vo.AGENT,startClocks:Ue()}),t.queueFullReported=!0);const a=t.queuedPayloads;for(t.queuedPayloads=_k();a.size()>0;)gk(a.dequeue(),t,r,o,n,i)}function fD(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||sD(e.status))}function mD(){return{transportStatus:0,currentBackoffTime:hk,bandwidthMonitor:pD(),queuedPayloads:_k(),queueFullReported:!1}}function _k(){const e=[];return{bytesCount:0,enqueue(t){return this.isFull()?!1:(e.push(t),this.bytesCount+=t.bytesCount,!0)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=pk}}}function pD(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=lD&&this.ongoingRequestCount<uD},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}const Lu=16*bn;function $m(e,t,r=Lu){const o=new he,n=mD();return{observable:o,send:i=>{for(const a of e)gk(i,n,(s,c)=>{Yi(Dr.AVOID_FETCH_KEEPALIVE)?ps(a,s,c):vD(a,r,s,c)},a.trackType,t,o)},sendOnExit:i=>{for(const a of e)hD(a,r,i)}}}function hD(e,t,r){if(!!navigator.sendBeacon&&r.bytesCount<t)try{const n=e.build("beacon",r);if(navigator.sendBeacon(n,r.data))return}catch(n){gD(n)}ps(e,r)}let Dh=!1;function gD(e){Dh||(Dh=!0,pr(e))}function vD(e,t,r,o){if(yD()&&r.bytesCount<t){const i=e.build("fetch-keepalive",r);fetch(i,{method:"POST",body:r.data,keepalive:!0,mode:"cors"}).then(ne(a=>o?.({status:a.status,type:a.type}))).catch(ne(()=>ps(e,r,o)))}else ps(e,r,o)}function ps(e,t,r){const o=e.build("fetch",t);fetch(o,{method:"POST",body:t.data,mode:"cors"}).then(ne(n=>r?.({status:n.status,type:n.type}))).catch(ne(()=>r?.({status:0})))}function yD(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function yo(){const e=bD();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,r,o){const n=o?{id:o}:void 0;e.send(JSON.stringify({eventType:t,event:r,view:n}))}}}function wk(e){const t=yo();return!!t&&t.getCapabilities().includes(e)}function sn(e){var t;e===void 0&&(e=(t=It().location)===null||t===void 0?void 0:t.hostname);const r=yo();return!!r&&r.getAllowedWebViewHosts().some(o=>e===o||e.endsWith(`.${o}`))}function bD(){return It().DatadogEventBridge}const Ln={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function _D(e){return new he(t=>{const{stop:r}=gr(e,window,["visibilitychange","freeze"],n=>{n.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:Ln.HIDDEN}):n.type==="freeze"&&t.notify({reason:Ln.FROZEN})},{capture:!0}),o=Oe(e,window,"beforeunload",()=>{t.notify({reason:Ln.UNLOADING})}).stop;return()=>{r(),o()}})}function xk(e){return ZS(Ln).includes(e)}const zh=256*bn;function Sk({encoder:e,request:t,flushController:r}){let o={};const n=r.flushObservable.subscribe(u=>l(u));function i(u,d,f){r.notifyBeforeAddMessage(d),f!==void 0?(o[f]=u,r.notifyAfterAddMessage()):e.write(e.isEmpty?u:`
@@ -34,7 +34,7 @@ ${u}`,m=>{r.notifyAfterAddMessage(m-d)})}function a(u){return u!==void 0&&o[u]!=
34
34
  `);o={};const f=xk(u.reason),m=f?t.sendOnExit:t.send;if(f&&e.isAsync){const g=e.finishSync();g.outputBytesCount&&m(Mh(g));const h=[g.pendingData,d].filter(Boolean).join(`
35
35
  `);h&&m({data:h,bytesCount:sk(h)})}else d&&e.write(e.isEmpty?d:`
36
36
  ${d}`),e.finish(g=>{m(Mh(g))})}return{flushController:r,add:c,upsert:c,stop:n.unsubscribe}}function Mh(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}const wD=30*Ke,xD=Cc?1:50;function kk({pageMayExitObservable:e,sessionExpireObservable:t}){const r=e.subscribe(d=>s(d.reason)),o=t.subscribe(()=>s("session_expire")),n=new he(()=>()=>{r.unsubscribe(),o.unsubscribe()});let i=0,a=0;function s(d){if(a===0)return;const f=a,m=i;a=0,i=0,u(),n.notify({reason:d,messagesCount:f,bytesCount:m})}let c;function l(){c===void 0&&(c=Je(()=>{s("duration_limit")},wD))}function u(){yt(c),c=void 0}return{flushObservable:n,get messagesCount(){return a},notifyBeforeAddMessage(d){i+d>=Lu&&s("bytes_limit"),a+=1,i+=d,l()},notifyAfterAddMessage(d=0){i+=d,a>=xD?s("messages_limit"):i>=Lu&&s("bytes_limit")},notifyAfterRemoveMessage(d){i-=d,a-=1,a===0&&u()}}}const zr="DISCARDED",wt="SKIPPED";function SD(){const e={};return{register(t,r){return e[t]||(e[t]=[]),e[t].push(r),{unregister:()=>{e[t]=e[t].filter(o=>o!==r)}}},triggerHook(t,r){const o=e[t]||[],n=[];for(const i of o){const a=i(r);if(a===zr)return zr;a!==wt&&n.push(a)}return vr(...n)}}}const Cr={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},kD=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],ED=1,ID=[o2],TD=15;let Cl;function bo(){return Cl||(Cl=new jS(100)),Cl}function $D(e,t,r,o,n,i){const a=new he,{stop:s}=AD(t,o,n,i,a),{enabled:c,metricsEnabled:l}=OD(e,t,r,a);return{stop:s,enabled:c,metricsEnabled:l}}function OD(e,t,r,o,n=ED,i=TD){const a={},s=!ID.includes(t.site)&&Xr(t.telemetrySampleRate),c={[Cr.LOG]:s,[Cr.CONFIGURATION]:s&&Xr(t.telemetryConfigurationSampleRate),[Cr.USAGE]:s&&Xr(t.telemetryUsageSampleRate),metric:s&&Xr(n)},l=CD(),u=bo();return u.subscribe(({rawEvent:f,metricName:m})=>{if(m&&!c.metric||!c[f.type])return;const g=m||f.status||f.type;let h=a[g];if(h||(h=a[g]=new Set),h.size>=i)return;const y=go(f);if(h.has(y))return;const b=r.triggerHook(1,{startTime:Ue().relative});if(b===zr)return;const w=d(b,e,f,l);o.notify(w),Im("telemetry",w),h.add(y)}),u.unbuffer(),sj(Om),{enabled:s,metricsEnabled:c.metric};function d(f,m,g,h){const b={type:"telemetry",date:Ue().timeStamp,service:m,version:"6.24.1",source:"browser",_dd:{format_version:2},telemetry:vr(g,{runtime_env:h,connectivity:mk(),sdk_setup:"npm"}),ddtags:Em(t).join(","),experimental_features:Array.from(b2())};return vr(b,f)}}function AD(e,t,r,o,n){const i=[];if(sn()){const a=yo(),s=n.subscribe(c=>a.send("internal_telemetry",c));i.push(s.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&ND(e)&&a.push(e.replica.rumEndpointBuilder);const s=Sk({encoder:o(4),request:$m(a,t),flushController:kk({pageMayExitObservable:r,sessionExpireObservable:new he})});i.push(s.stop);const c=n.subscribe(s.add);i.push(c.unsubscribe)}return{stop:()=>i.forEach(a=>a())}}function CD(){var e;return{is_local_file:((e=or.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:Cc}}function ND(e){return e.site===tk}function _o(e,t){ju(Oc.debug,e,t),bo().notify({rawEvent:{type:Cr.LOG,message:e,status:"debug",...t}})}function Om(e,t){bo().notify({rawEvent:{type:Cr.LOG,status:"error",...PD(e),...t}})}function RD(e){bo().notify({rawEvent:{type:Cr.CONFIGURATION,configuration:e}})}function ea(e,t){bo().notify({rawEvent:{type:Cr.LOG,message:e,status:"debug",...t},metricName:e})}function Ve(e){bo().notify({rawEvent:{type:Cr.USAGE,usage:e}})}function PD(e){if(_n(e)){const t=Xi(e);return{error:{kind:t.name,stack:Qi(jD(t))},message:t.message}}return{error:{stack:lk},message:`Uncaught ${go(e)}`}}function jD(e){return e.stack=e.stack.filter(t=>!t.url||kD.some(r=>t.url.startsWith(r))),e}function Ek(e,t){const r=e.indexOf(t);r>=0&&e.splice(r,1)}function rn(e){return Array.isArray(e)&&e.length>0}const _a=1/0,DD=lt;let Po=null;const Ma=new Set;function zD(){Ma.forEach(e=>e())}function wo({expireDelay:e,maxEntries:t}){let r=[];Po||(Po=po(()=>zD(),DD));const o=()=>{const u=_t()-e;for(;r.length>0&&r[r.length-1].endTime<u;)r.pop()};Ma.add(o);function n(u,d){const f={value:u,startTime:d,endTime:_a,remove:()=>{Ek(r,f)},close:m=>{f.endTime=m}};return t&&r.length>=t&&r.pop(),r.unshift(f),f}function i(u=_a,d={returnInactive:!1}){for(const f of r)if(f.startTime<=u){if(d.returnInactive||u<=f.endTime)return f.value;break}}function a(u){const d=r[0];d&&d.endTime===_a&&d.close(u)}function s(u=_a,d=0){const f=ho(u,d);return r.filter(m=>m.startTime<=f&&u<=m.endTime).map(m=>m.value)}function c(){r=[]}function l(){Ma.delete(o),Ma.size===0&&Po&&(Nc(Po),Po=null)}return{add:n,find:i,closeActive:a,findAll:s,reset:c,stop:l}}const MD="datadog-synthetics-public-id",UD="datadog-synthetics-result-id",LD="datadog-synthetics-injects-rum";function Ik(){return Cc?!1:!!(or._DATADOG_SYNTHETICS_INJECTS_RUM||Tr(LD))}function Tk(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||Tr(MD);return typeof e=="string"?e:void 0}function $k(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||Tr(UD);return typeof e=="string"?e:void 0}function Ok(){return!!(Tk()&&$k())}const FD=lt,VD=vn;function ZD(e,t,r,o){const n=new he,i=new he,a=Jj(e.sessionStoreStrategyType,e,t,r),s=wo({expireDelay:VD});if(a.renewObservable.subscribe(()=>{s.add(c(),_t()),n.notify()}),a.expireObservable.subscribe(()=>{i.notify(),s.closeActive(_t())}),a.expandOrRenewSession(),s.add(c(),ym().relative),Yi(Dr.SHORT_SESSION_INVESTIGATION)){const l=a.getSession();l&&WD(e,l)}o.observable.subscribe(()=>{o.isGranted()?a.expandOrRenewSession():a.expire(!1)}),BD(e,()=>{o.isGranted()&&a.expandOrRenewSession()}),qD(e,()=>a.expandSession()),GD(e,()=>a.restartSession());function c(){const l=a.getSession();return l?{id:l.id,trackingType:l[t],isReplayForced:!!l.forcedReplay,anonymousId:l.anonymousId}:(HD(e).catch(()=>{}),{id:"invalid",trackingType:qS,isReplayForced:!1,anonymousId:void 0})}return{findSession:(l,u)=>s.find(l,u),renewObservable:n,expireObservable:i,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function BD(e,t){const{stop:r}=gr(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function qD(e,t){const r=()=>{document.visibilityState==="visible"&&t()},{stop:o}=Oe(e,document,"visibilitychange",r);po(r,FD)}function GD(e,t){const{stop:r}=Oe(e,window,"resume",t,{capture:!0})}async function HD(e){const t=e.sessionStoreStrategyType;if(!t)return;let r,o;t.type===oo.COOKIE?(r=JS(t.cookieOptions,e),o={cookie:await Ak(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):r=XS(),_o("Unexpected session state",{sessionStoreStrategyType:t.type,session:r,isSyntheticsTest:Ok(),createdTimestamp:r?.created,expireTimestamp:r?.expire,...o})}function WD(e,t){if(!window.cookieStore||!t.created)return;const r=Number(t.created),o=ct(),{stop:n}=Oe(e,cookieStore,"change",i);function i(a){const s=VS(a.changed,l=>l.name===hr);if(!s)return;const c=ct()-r;if(c>14*lt)n();else{const l=Dc(s.value);if(l.id&&l.id!==t.id){n();const u=ct()-o;Ak().then(d=>{_o("Session cookie changed",{time:u,session_age:c,old:t,new:l,cookie:d})}).catch(pr)}}}}async function Ak(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(hr):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(hr)),{count:e.length,domain:FS()||"undefined",...e}}function JD(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(r,o){const n=sk(r);t+=n,e+=r,o&&o(n)},finish(r){r(this.finishSync())},finishSync(){const r={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,r},estimateEncodedBytesCount(r){return r.length}}}class KD{constructor(){this.callbacks={}}notify(t,r){const o=this.callbacks[t];o&&o.forEach(n=>n(r))}subscribe(t,r){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(r),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(o=>r!==o)}}}}const YD=3e3;function Nl(e,t,r=YD){let o=0,n=!1;return{isLimitReached(){if(o===0&&Je(()=>{o=0},lt),o+=1,o<=r||n)return n=!1,!1;if(o===r+1){n=!0;try{t({message:`Reached max number of ${e}s by minute: ${r}`,source:vo.AGENT,startClocks:Ue()})}finally{n=!1}}return!0}}}function Am(e,t,r){return document.readyState===t||document.readyState==="complete"?(r(),{stop:_e}):Oe(e,window,t==="complete"?"load":"DOMContentLoaded",r,{once:!0})}function XD(e,t){return new Promise(r=>{Am(e,t,r)})}let Rl;const Cm=new WeakMap;function QD(e){return Rl||(Rl=ez(e)),Rl}function ez(e){return new he(t=>{const{stop:r}=Bt(XMLHttpRequest.prototype,"open",tz),{stop:o}=Bt(XMLHttpRequest.prototype,"send",i=>{rz(i,e,t)},{computeHandlingStack:!0}),{stop:n}=Bt(XMLHttpRequest.prototype,"abort",nz);return()=>{r(),o(),n()}})}function tz({target:e,parameters:[t,r]}){Cm.set(e,{state:"open",method:String(t).toUpperCase(),url:wm(String(r))})}function rz({target:e,parameters:[t],handlingStack:r},o,n){const i=Cm.get(e);if(!i)return;const a=i;a.state="start",a.startClocks=Ue(),a.isAborted=!1,a.xhr=e,a.handlingStack=r,a.requestBody=t;let s=!1;const{stop:c}=Bt(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&l()}),l=()=>{if(u(),c(),s)return;s=!0;const d=i;d.state="complete",d.duration=Ne(a.startClocks.timeStamp,Be()),d.status=e.status,typeof e.response=="string"&&(d.responseBody=e.response),n.notify(oi(d))},{stop:u}=Oe(o,e,"loadend",l);n.notify(a)}function nz({target:e}){const t=Cm.get(e);t&&(t.isAborted=!0)}async function oz(e,t){const r=e.getReader(),o=[];for(;;){const n=await r.read();if(n.done)break;t.collectStreamBody&&o.push(n.value)}return r.cancel().catch(_e),t.collectStreamBody?ck(o):void 0}let Pl;const Ck=[];function Nk({responseBodyAction:e}={}){return e&&Ck.push(e),Pl||(Pl=iz()),Pl}function iz(){return new he(e=>{if(!or.fetch)return;const{stop:t}=Bt(or,"fetch",r=>az(r,e),{computeHandlingStack:!0});return t})}function az({parameters:e,onPostCall:t,handlingStack:r},o){const[n,i]=e;let a=i&&i.method;a===void 0&&n instanceof Request&&(a=n.method);const s=a!==void 0?String(a).toUpperCase():"GET",c=n instanceof Request?n.url:wm(String(n)),l=Ue(),u={state:"start",init:i,input:n,method:s,startClocks:l,url:c,handlingStack:r};o.notify(u),e[0]=u.input,e[1]=u.init,t(d=>{sz(o,d,u).catch(pr)})}async function sz(e,t,r){var o,n;const i=r;i.state="resolve";let a;try{a=await t}catch(c){i.status=0,i.isAborted=((n=(o=i.init)===null||o===void 0?void 0:o.signal)===null||n===void 0?void 0:n.aborted)||c instanceof DOMException&&c.code===DOMException.ABORT_ERR,i.error=c,e.notify(i);return}i.response=a,i.status=a.status,i.responseType=a.type,i.isAborted=!1;const s=Ck.reduce((c,l)=>Math.max(c,l(i)),0);if(s!==0){const c=cD(a);if(c&&c.body)try{const l=await oz(c.body,{collectStreamBody:s===2});i.responseBody=l&&new TextDecoder().decode(l)}catch{}}e.notify(i)}function Rk(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const r=window.requestIdleCallback(ne(e),t);return()=>window.cancelIdleCallback(r)}return lz(e)}const cz=50;function lz(e){const t=ct(),r=Je(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,cz-(ct()-t))})},0);return()=>yt(r)}const uz=Ke,dz=30;function fz(){const e=[];function t(o){let n;if(o.didTimeout){const i=performance.now();n=()=>dz-(performance.now()-i)}else n=o.timeRemaining.bind(o);for(;n()>0&&e.length;)e.shift()();e.length&&r()}function r(){Rk(t,{timeout:uz})}return{push(o){e.push(o)===1&&r()},stop(){e.length=0}}}let jl={};function mz(e){const t=e.map(r=>(jl[r]||(jl[r]=pz(r)),jl[r]));return PS(...t)}function pz(e){return new he(t=>{const r=ur[e];return ur[e]=(...o)=>{r.apply(console,o);const n=fs("console error");Ar(()=>{t.notify(hz(o,e,n))})},()=>{ur[e]=r}})}function hz(e,t,r){const o=e.map(n=>gz(n)).join(" ");if(t===Oc.error){const n=e.find(_n),i=km({originalError:n,handlingStack:r,startClocks:Ue(),source:vo.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=o,{api:t,message:o,handlingStack:r,error:i}}return{api:t,message:o,error:void 0,handlingStack:r}}function gz(e){return typeof e=="string"?$e(e):_n(e)?ik(Xi(e)):go($e(e),void 0,2)}const vz=500;function yz(){const e=[];return{add:n=>{e.push(n)>vz&&e.splice(0,1)},remove:n=>{Ek(e,n)},drain:n=>{e.forEach(i=>i(n)),e.length=0}}}function bz(e){const t=yn(e)==="object";return t||Q.error("Unsupported context:",e),t}function Dl(e,t,r){const o={...e};for(const[n,{required:i,type:a}]of Object.entries(t))a==="string"&&!Uh(o[n])&&(o[n]=String(o[n])),i&&Uh(o[n])&&Q.warn(`The property ${n} of ${r} is required; context will not be sent to the intake.`);return o}function Uh(e){return e==null||e===""}function Mc(e="",{propertiesConfig:t={}}={}){let r={};const o=new he,n={getContext:()=>Tm(r),setContext:i=>{bz(i)?r=$e(Dl(i,t,e)):n.clearContext(),o.notify()},setContextProperty:(i,a)=>{r=$e(Dl({...r,[i]:a},t,e)),o.notify()},removeContextProperty:i=>{delete r[i],Dl(r,t,e),o.notify()},clearContext:()=>{r={},o.notify()},changeObservable:o};return n}function rt(e,t,r,o){return ne((...n)=>(o&&Ve({feature:o}),e()[t][r](...n)))}const _z="_dd_c",wz=[];function Nm(e,t,r,o){const n=xz(r,o);wz.push(Oe(e,window,"storage",({key:l})=>{n===l&&a()})),t.changeObservable.subscribe(s);const i=vr(c(),t.getContext());Vr(i)||t.setContext(i);function a(){t.setContext(c())}function s(){localStorage.setItem(n,JSON.stringify(t.getContext()))}function c(){const l=localStorage.getItem(n);return l?JSON.parse(l):{}}}function xz(e,t){return`${_z}_${e}_${t}`}function Sz(e,t,r){const o=Pk();return t.storeContextsAcrossPages&&Nm(t,o,r,4),e.register(0,()=>{const n=o.getContext();return Vr(n)||!n.id?wt:{account:n}}),o}function Pk(){return Mc("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function kz(e,t,r,o){const n=jk();return t.storeContextsAcrossPages&&Nm(t,n,r,2),e.register(0,()=>({context:n.getContext()})),n}function jk(){return Mc("global context")}function Ez(e,t,r,o){const n=Dk();return t.storeContextsAcrossPages&&Nm(t,n,o,1),e.register(0,({eventType:i,startTime:a})=>{const s=n.getContext(),c=r.findTrackedSession(a);return c&&c.anonymousId&&!s.anonymous_id&&t.trackAnonymousUser&&(s.anonymous_id=c.anonymousId),Vr(s)?wt:{type:i,usr:s}}),e.register(1,({startTime:i})=>{var a;return{anonymous_id:(a=r.findTrackedSession(i))===null||a===void 0?void 0:a.anonymousId}}),n}function Dk(){return Mc("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Ze={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},nt={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},at={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Uc={FETCH:at.FETCH,XHR:at.XHR},Iz=500;function Tz(e=G2){const t=new jS(Iz),r=e().subscribe(o=>{t.notify({type:0,error:o})});return{observable:t,stop:()=>{r.unsubscribe()}}}function $z(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const te={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},zk={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},dr={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},Lc={CLICK:"click",CUSTOM:"custom"},jo={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},ci={DURATION:"duration",OPERATION_STEP:"operation_step"};function Oz(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function Az(e,t,r){function o(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function n(a){o(a)&&e.notify(12,Lh(a))}function i(a,s,c,l){if(!Yi(Dr.FEATURE_OPERATION_VITAL))return;const{operationKey:u,context:d,description:f}=c||{},m={name:a,type:ci.OPERATION_STEP,operationKey:u,failureReason:l,stepType:s,startClocks:Ue(),context:$e(d),description:f};e.notify(12,Lh(m))}return{addOperationStepVital:i,addDurationVital:n,startDurationVital:(a,s={})=>Mk(r,a,s),stopDurationVital:(a,s={})=>{Uk(n,r,a,s)}}}function Mk({vitalsByName:e,vitalsByReference:t},r,o={}){const n={name:r,startClocks:Ue(),...o},i={__dd_vital_reference:!0};return e.set(r,n),t.set(i,n),i}function Uk(e,{vitalsByName:t,vitalsByReference:r},o,n={}){const i=typeof o=="string"?t.get(o):r.get(o);i&&(e(Cz(i,i.startClocks,n,Ue())),typeof o=="string"?t.delete(o):r.delete(o))}function Cz(e,t,r,o){var n;return{name:e.name,type:ci.DURATION,startClocks:t,duration:Ne(t.timeStamp,o.timeStamp),context:vr(e.context,r.context),description:(n=r.description)!==null&&n!==void 0?n:e.description}}function Lh(e){const{startClocks:t,type:r,name:o,description:n,context:i}=e,a={id:et(),type:r,name:o,description:n,...r===ci.DURATION?{duration:oe(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:te.VITAL,context:i},startTime:t.relative,duration:r===ci.DURATION?e.duration:void 0,domainContext:{}}}function Lk(e,t,r){if(e)for(const o of e){const n=o[t];n&&n(r)}}const Fh=new Map;function Fk(e,t){if(t===100)return!0;if(t===0)return!1;const r=Fh.get(t);if(r&&e===r.sessionId)return r.decision;let o;return window.BigInt?o=Nz(BigInt(`0x${e.split("-")[4]}`),t):o=Xr(t),Fh.set(t,{sessionId:e,decision:o}),o}function Nz(e,t){const r=BigInt("1111111111111111111"),o=BigInt("0x10000000000000000"),n=e*r%o;return Number(n)<=t/100*Number(o)}function Rz(){return Zk(64)}function Vk(){return Zk(63)}function Zk(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(r=10){let o=t[1],n=t[0],i="";do{const a=o%r*4294967296+n;o=Math.floor(o/r),n=Math.floor(a/r),i=(a%r).toString(r)+i}while(o||n);return i}}}function $n(e){return e.toString(16).padStart(16,"0")}function Pz(e){const t=e;return yn(t)==="object"&&ai(t.match)&&Array.isArray(t.propagatorTypes)}function jz(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Dz(e,t,r,o){return{clearTracingIfNeeded:jz,traceFetch:n=>Vh(e,n,t,r,o,i=>{var a;if(n.input instanceof Request&&!(!((a=n.init)===null||a===void 0)&&a.headers))n.input=new Request(n.input),Object.keys(i).forEach(s=>{n.input.headers.append(s,i[s])});else{n.init=oi(n.init);const s=[];n.init.headers instanceof Headers?n.init.headers.forEach((c,l)=>{s.push([l,c])}):Array.isArray(n.init.headers)?n.init.headers.forEach(c=>{s.push(c)}):n.init.headers&&Object.keys(n.init.headers).forEach(c=>{s.push([c,n.init.headers[c]])}),n.init.headers=s.concat(jc(i))}}),traceXhr:(n,i)=>Vh(e,n,t,r,o,a=>{Object.keys(a).forEach(s=>{i.setRequestHeader(s,a[s])})})}}function Vh(e,t,r,o,n,i){const a=r.findTrackedSession();if(!a)return;const s=e.allowedTracingUrls.find(u=>zc([u.match],t.url,!0));if(!s)return;const c=Fk(a.id,e.traceSampleRate);(c||e.traceContextInjection===Mu.ALL)&&(t.traceSampled=c,t.traceId=Rz(),t.spanId=Vk(),i(zz(t.traceId,t.spanId,t.traceSampled,a.id,s.propagatorTypes,o,n,e)))}function zz(e,t,r,o,n,i,a,s){const c={};if(n.forEach(l=>{switch(l){case"datadog":{Object.assign(c,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":r?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(c,{traceparent:`00-0000000000000000${$n(e)}-${$n(t)}-0${r?"1":"0"}`,tracestate:`dd=s:${r?"1":"0"};o:rum`});break}case"b3":{Object.assign(c,{b3:`${$n(e)}-${$n(t)}-${r?"1":"0"}`});break}case"b3multi":{Object.assign(c,{"X-B3-TraceId":$n(e),"X-B3-SpanId":$n(t),"X-B3-Sampled":r?"1":"0"});break}}}),s.propagateTraceBaggage){const l={"session.id":o},u=i.getContext().id;typeof u=="string"&&(l["user.id"]=u);const d=a.getContext().id;typeof d=="string"&&(l["account.id"]=d);const f=Object.entries(l).map(([m,g])=>`${m}=${encodeURIComponent(g)}`).join(",");f&&(c.baggage=f)}return c}const Bk=["tracecontext","datadog"];function Mz(e,t){var r,o,n,i,a,s,c;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&Q.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){Q.error("Application ID is not configured, no RUM data will be collected.");return}if(!zn(e.sessionReplaySampleRate,"Session Replay")||!zn(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){Q.error("Excluded Activity Urls should be an array");return}const l=Uz(e);if(!l)return;const u=h2(e,t),d=Fz(e);if(!u)return;const f=(r=e.sessionReplaySampleRate)!==null&&r!==void 0?r:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:f,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:f===0,traceSampleRate:(o=e.traceSampleRate)!==null&&o!==void 0?o:100,rulePsr:Gi(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:l,excludedActivityUrls:(n=e.excludedActivityUrls)!==null&&n!==void 0?n:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((i=e.trackUserInteractions)!==null&&i!==void 0)||i),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((a=e.trackResources)!==null&&a!==void 0)||a),trackLongTasks:!!(!((s=e.trackLongTasks)!==null&&s!==void 0)||s),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:ds(Dn,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Dn.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:ds(Mu,e.traceContextInjection)?e.traceContextInjection:Mu.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(c=e.profilingSampleRate)!==null&&c!==void 0?c:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:d,...u}}function Uz(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){Q.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){Q.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(r=>{ai(r)?t.push({match:r,propagatorTypes:Bk}):Pz(r)?t.push(r):Q.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",r)}),t}function Lz(e){const t=new Set;return rn(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(r=>{ai(r)?Bk.forEach(o=>t.add(o)):yn(r)==="object"&&Array.isArray(r.propagatorTypes)&&r.propagatorTypes.forEach(o=>t.add(o))}),Array.from(t)}function Fz(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return Q.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(r=>{ai(r)?t.push({match:r,trackPayload:!1,trackResponseErrors:!1}):r&&typeof r=="object"&&"match"in r&&ai(r.match)&&t.push({match:r.match,trackPayload:!!r.trackPayload,trackResponseErrors:!!r.trackResponseErrors})}),t}function Vz(e){return rn(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function Zz(e){return rn(e)&&e.some(t=>typeof t=="object"&&"trackResponseErrors"in t?!!t.trackResponseErrors:!1)}function Bz(e){var t;const r=g2(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:rn(e.allowedTracingUrls),use_allowed_graph_ql_urls:rn(e.allowedGraphQlUrls),use_track_graph_ql_payload:Vz(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:Zz(e.allowedGraphQlUrls),selected_tracing_propagators:Lz(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:rn(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,track_early_requests:e.trackEarlyRequests,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(o=>{var n;return{name:o.name,...(n=o.getConfigurationTelemetry)===null||n===void 0?void 0:n.call(o)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,...r}}function qz(e){const t=[];let r=0,o;const n={quote:void 0,escapeSequence:void 0};let i="";for(const a of e){if(o=Zh[r].find(s=>Yz[s](a,n)),!o)return[];if(n.escapeSequence!==void 0&&o!==12){if(!eM(n.escapeSequence))return[];i+=rM(n.escapeSequence),n.escapeSequence=void 0}Xz.includes(o)?i+=a:Qz.includes(o)&&i!==""?(t.push(i),i=""):o===12?n.escapeSequence=n.escapeSequence?`${n.escapeSequence}${a}`:a:o===8?n.quote=a:o===9&&(n.quote=void 0),r=o}return Zh[r].includes(1)?(i!==""&&t.push(i),t):[]}const Gz=/[a-zA-Z_$]/,Hz=/[a-zA-Z0-9_$]/,Wz=/[0-9]/,Jz=/[a-fA-F0-9]/,Kz=`'"`,Yz={0:()=>!1,1:()=>!1,2:e=>Gz.test(e),3:e=>Hz.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>Wz.test(e),8:e=>Kz.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e==="\\",12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5?Jz.test(e):!1},Zh={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},Xz=[2,3,7,10],Qz=[4,5,6];function eM(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const tM={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
37
- `,r:"\r",t:" "};function rM(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):tM[e]}const nM="v1",oM=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function iM(e,t){let r;const o=sM(),n=await dM(e);return n.ok?(o.increment("fetch","success"),r=aM(e,n.value,t,o)):(o.increment("fetch","failure"),Q.error(n.error)),ea("remote configuration metrics",{metrics:o.get()}),r}function aM(e,t,r,o){const n={...e};return oM.forEach(f=>{f in t&&(n[f]=i(t[f]))}),Object.keys(r).forEach(f=>{t[f]!==void 0&&a(r[f],t[f])}),n;function i(f){if(Array.isArray(f))return f.map(i);if(cM(f)){if(lM(f)){const m=f.rcSerializedType;switch(m){case"string":return f.value;case"regex":return qk(f.value);case"dynamic":return s(f);default:Q.error(`Unsupported remote configuration: "rcSerializedType": "${m}"`);return}}return NS(f,i)}return f}function a(f,m){m.forEach(({key:g,value:h})=>{f.setContextProperty(g,i(h))})}function s(f){const m=f.strategy;let g;switch(m){case"cookie":g=c(f);break;case"dom":g=l(f);break;case"js":g=d(f);break;default:Q.error(`Unsupported remote configuration: "strategy": "${m}"`);return}const h=f.extractor;return h!==void 0&&typeof g=="string"?uM(h,g):g}function c({name:f}){const m=Pc(f);return o.increment("cookie",m!==void 0?"success":"missing"),m}function l({selector:f,attribute:m}){let g;try{g=document.querySelector(f)}catch{Q.error(`Invalid selector in the remote configuration: '${f}'`),o.increment("dom","failure");return}if(!g){o.increment("dom","missing");return}if(u(g,m)){Q.error(`Forbidden element selected by the remote configuration: '${f}'`),o.increment("dom","failure");return}const h=m!==void 0?g.getAttribute(m):g.textContent;if(h===null){o.increment("dom","missing");return}return o.increment("dom","success"),h}function u(f,m){return f.getAttribute("type")==="password"&&m==="value"}function d({path:f}){let m=window;const g=qz(f);if(g.length===0){Q.error(`Invalid JSON path in the remote configuration: '${f}'`),o.increment("js","failure");return}for(const h of g){if(!(h in m)){o.increment("js","missing");return}try{m=m[h]}catch(y){Q.error(`Error accessing: '${f}'`,y),o.increment("js","failure");return}}return o.increment("js","success"),m}}function sM(){const e={fetch:{}};return{get:()=>e,increment:(t,r)=>{e[t]||(e[t]={}),e[t][r]||(e[t][r]=0),e[t][r]=e[t][r]+1}}}function cM(e){return typeof e=="object"&&e!==null}function lM(e){return"rcSerializedType"in e}function qk(e){try{return new RegExp(e)}catch{Q.error(`Invalid regex in the remote configuration: '${e}'`)}}function uM(e,t){const r=qk(e.value);if(r===void 0)return;const o=r.exec(t);if(o===null)return;const[n,i]=o;return i||n}async function dM(e){let t;try{t=await fetch(fM(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const r=await t.json();return r.rum?{ok:!0,value:r.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function fM(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${rk("rum",e)}/${nM}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function mM({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},r,o,n){const i=yz(),a=jk();zl(a,Ze.globalContext,i);const s=Dk();zl(s,Ze.userContext,i);const c=Pk();zl(c,Ze.accountContext,i);let l,u,d,f;const m=r.observable.subscribe(h),g={};function h(){if(!d||!f||!r.isGranted())return;m.unsubscribe();let v;if(f.trackViewsManually){if(!l)return;i.remove(l.callback),v=l.options}const k=n(f,u,v);i.drain(k)}function y(v,k){const E=sn();if(E&&(v=pM(v)),d=v,RD(Bz(v)),f){uk("DD_RUM",v);return}const I=Mz(v,k);if(I){if(!E&&!I.sessionStoreStrategyType){Q.warn("No storage available for session. We will not send any data.");return}I.compressIntakeRequests&&!E&&t&&(u=t(I,"Datadog RUM",_e),!u)||(f=I,Nk().subscribe(_e),r.tryToInit(I.trackingConsent),h())}}const b=v=>{i.add(k=>k.addDurationVital(v))};return{init(v,k,E){if(!v){Q.error("Missing configuration");return}v2(v.enableExperimentalFeatures),d=v,!(e&&Ik())&&(Lk(v.plugins,"onInit",{initConfiguration:v,publicApi:k}),v.remoteConfigurationId?iM(v,{user:s,context:a}).then(I=>{I&&y(I,E)}).catch(pr):y(v,E))},get initConfiguration(){return d},getInternalContext:_e,stopSession:_e,addTiming(v,k=Be()){i.add(E=>E.addTiming(v,k))},startView(v,k=Ue()){const E=I=>{I.startView(v,k)};i.add(E),l||(l={options:v,callback:E},h())},setViewName(v){i.add(k=>k.setViewName(v))},setViewContext(v){i.add(k=>k.setViewContext(v))},setViewContextProperty(v,k){i.add(E=>E.setViewContextProperty(v,k))},getViewContext:()=>g,globalContext:a,userContext:s,accountContext:c,addAction(v){i.add(k=>k.addAction(v))},addError(v){i.add(k=>k.addError(v))},addFeatureFlagEvaluation(v,k){i.add(E=>E.addFeatureFlagEvaluation(v,k))},startDurationVital(v,k){return Mk(o,v,k)},stopDurationVital(v,k){Uk(b,o,v,k)},addDurationVital:b,addOperationStepVital:(v,k,E,I)=>{i.add(A=>A.addOperationStepVital($e(v),k,$e(E),$e(I)))}}}function pM(e){var t,r;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(r=yo())===null||r===void 0?void 0:r.getPrivacyLevel()}}function zl(e,t,r){e.changeObservable.subscribe(()=>{const o=e.getContext();r.add(n=>n[t].setContext(o))})}function hM(e,t,r,o={}){const n=Kj(),i=Oz(),a=Tz().observable;let s=mM(o,n,i,(d,f,m)=>{const g=f&&o.createDeflateEncoder?y=>o.createDeflateEncoder(d,f,y):JD,h=e(d,t,r,m,g,n,i,a,o.sdkName);return t.onRumStart(h.lifeCycle,d,h.session,h.viewHistory,f,h.telemetry),r.onRumStart(h.lifeCycle,h.hooks,d,h.session,h.viewHistory,g),s=gM(s,h),Lk(d.plugins,"onRumStart",{strategy:s,addEvent:h.addEvent}),h});const c=()=>s,l=ne(d=>{const f=typeof d=="object"?d:{name:d};s.startView(f),Ve({feature:"start-view"})}),u=J2({init:d=>{const f=new Error().stack;Ar(()=>s.init(d,u,f))},setTrackingConsent:ne(d=>{n.update(d),Ve({feature:"set-tracking-consent",tracking_consent:d})}),setViewName:ne(d=>{s.setViewName(d),Ve({feature:"set-view-name"})}),setViewContext:ne(d=>{s.setViewContext(d),Ve({feature:"set-view-context"})}),setViewContextProperty:ne((d,f)=>{s.setViewContextProperty(d,f),Ve({feature:"set-view-context-property"})}),getViewContext:ne(()=>(Ve({feature:"set-view-context-property"}),s.getViewContext())),getInternalContext:ne(d=>s.getInternalContext(d)),getInitConfiguration:ne(()=>Tm(s.initConfiguration)),addAction:(d,f)=>{const m=fs("action");Ar(()=>{s.addAction({name:$e(d),context:$e(f),startClocks:Ue(),type:Lc.CUSTOM,handlingStack:m}),Ve({feature:"add-action"})})},addError:(d,f)=>{const m=fs("error");Ar(()=>{s.addError({error:d,handlingStack:m,context:$e(f),startClocks:Ue()}),Ve({feature:"add-error"})})},addTiming:ne((d,f)=>{s.addTiming($e(d),f)}),setGlobalContext:rt(c,Ze.globalContext,nt.setContext,"set-global-context"),getGlobalContext:rt(c,Ze.globalContext,nt.getContext,"get-global-context"),setGlobalContextProperty:rt(c,Ze.globalContext,nt.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:rt(c,Ze.globalContext,nt.removeContextProperty,"remove-global-context-property"),clearGlobalContext:rt(c,Ze.globalContext,nt.clearContext,"clear-global-context"),setUser:rt(c,Ze.userContext,nt.setContext,"set-user"),getUser:rt(c,Ze.userContext,nt.getContext,"get-user"),setUserProperty:rt(c,Ze.userContext,nt.setContextProperty,"set-user-property"),removeUserProperty:rt(c,Ze.userContext,nt.removeContextProperty,"remove-user-property"),clearUser:rt(c,Ze.userContext,nt.clearContext,"clear-user"),setAccount:rt(c,Ze.accountContext,nt.setContext,"set-account"),getAccount:rt(c,Ze.accountContext,nt.getContext,"get-account"),setAccountProperty:rt(c,Ze.accountContext,nt.setContextProperty,"set-account-property"),removeAccountProperty:rt(c,Ze.accountContext,nt.removeContextProperty,"remove-account-property"),clearAccount:rt(c,Ze.accountContext,nt.clearContext,"clear-account"),startView:l,stopSession:ne(()=>{s.stopSession(),Ve({feature:"stop-session"})}),addFeatureFlagEvaluation:ne((d,f)=>{s.addFeatureFlagEvaluation($e(d),$e(f)),Ve({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:ne(()=>t.getSessionReplayLink()),startSessionReplayRecording:ne(d=>{t.start(d),Ve({feature:"start-session-replay-recording",force:d&&d.force})}),stopSessionReplayRecording:ne(()=>t.stop()),addDurationVital:ne((d,f)=>{Ve({feature:"add-duration-vital"}),s.addDurationVital({name:$e(d),type:ci.DURATION,startClocks:uj(f.startTime),duration:f.duration,context:$e(f&&f.context),description:$e(f&&f.description)})}),startDurationVital:ne((d,f)=>(Ve({feature:"start-duration-vital"}),s.startDurationVital($e(d),{context:$e(f&&f.context),description:$e(f&&f.description)}))),stopDurationVital:ne((d,f)=>{Ve({feature:"stop-duration-vital"}),s.stopDurationVital(typeof d=="string"?$e(d):d,{context:$e(f&&f.context),description:$e(f&&f.description)})}),startFeatureOperation:ne((d,f)=>{Ve({feature:"add-operation-step-vital",action_type:"start"}),s.addOperationStepVital(d,"start",f)}),succeedFeatureOperation:ne((d,f)=>{Ve({feature:"add-operation-step-vital",action_type:"succeed"}),s.addOperationStepVital(d,"end",f)}),failFeatureOperation:ne((d,f,m)=>{Ve({feature:"add-operation-step-vital",action_type:"fail"}),s.addOperationStepVital(d,"end",m,f)})});return u}function gM(e,t){return{init:r=>{uk("DD_RUM",r)},initConfiguration:e.initConfiguration,...t}}function vM(){const e=Gk();return new he(t=>{if(!e)return;const r=new e(ne(o=>t.notify(o)));return r.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>r.disconnect()})}function Gk(){let e;const t=window;if(t.Zone&&(e=jr(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const r=new t.MutationObserver(_e),o=jr(r,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function yM(){const e=new he,{stop:t}=Bt(window,"open",()=>e.notify());return{observable:e,stop:t}}function bM(e,t,r,o,n){return{get:i=>{const a=r.findView(i),s=n.findUrl(i),c=t.findTrackedSession(i);if(c&&a&&s){const l=o.findActionId(i);return{application_id:e,session_id:c.id,user_action:l?{id:l}:void 0,view:{id:a.id,name:a.name,referrer:s.referrer,url:s.url}}}}}}const _M=KD,wM=vn;function xM(e){const t=wo({expireDelay:wM});e.subscribe(1,o=>{t.add(r(o),o.startClocks.relative)}),e.subscribe(6,({endClocks:o})=>{t.closeActive(o.relative)}),e.subscribe(3,o=>{const n=t.find(o.startClocks.relative);n&&(o.name&&(n.name=o.name),o.context&&(n.context=o.context),n.sessionIsActive=o.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function r(o){return{service:o.service,version:o.version,context:o.context,id:o.id,name:o.name,startClocks:o.startClocks}}return{findView:o=>t.find(o),stop:()=>{t.stop()}}}const Hk="initial_document",SM=[[at.DOCUMENT,e=>Hk===e],[at.XHR,e=>e==="xmlhttprequest"],[at.FETCH,e=>e==="fetch"],[at.BEACON,e=>e==="beacon"],[at.CSS,(e,t)=>/\.css$/i.test(t)],[at.JS,(e,t)=>/\.js$/i.test(t)],[at.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[at.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[at.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function kM(e){const t=e.name;if(!bj(t))return at.OTHER;const r=_j(t);for(const[o,n]of SM)if(n(e.initiatorType,r))return o;return at.OTHER}function Bh(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Wk(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function EM(e){const{duration:t,startTime:r,responseEnd:o}=e;return t===0&&r<o?Ne(r,o):t}function IM(e){if(!Kk(e))return;const{startTime:t,fetchStart:r,workerStart:o,redirectStart:n,redirectEnd:i,domainLookupStart:a,domainLookupEnd:s,connectStart:c,secureConnectionStart:l,connectEnd:u,requestStart:d,responseStart:f,responseEnd:m}=e,g={download:qr(t,f,m),first_byte:qr(t,d,f)};return 0<o&&o<r&&(g.worker=qr(t,o,r)),r<u&&(g.connect=qr(t,c,u),c<=l&&l<=u&&(g.ssl=qr(t,l,u))),r<s&&(g.dns=qr(t,a,s)),t<i&&(g.redirect=qr(t,n,i)),g}function Jk(e){return e.duration>=0}function Kk(e){const t=Bh(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),r=TM(e)?Bh(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&r}function TM(e){return e.redirectEnd>e.startTime}function qr(e,t,r){if(e<=t&&t<=r)return{duration:oe(Ne(t,r)),start:oe(Ne(e,t))}}function $M(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function OM(e){return e.deliveryType===""?"other":e.deliveryType}function AM(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:r,transferSize:o}=e;return{size:r,encoded_body_size:t,decoded_body_size:r,transfer_size:o}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function Rm(e){return e&&(!m2(e)||Yi(Dr.TRACK_INTAKE_REQUESTS))}const CM=/data:(.+)?(;base64)?,/g,NM=24e3;function Yk(e,t=NM){if(e.length<=t||!e.startsWith("data:"))return e;const r=e.substring(0,100).match(CM);return r?`${r[0]}[...]`:e}const RM=32*bn;function PM(e,t){const r=DM(e.requestBody,t.trackPayload);if(r){if(t.trackResponseErrors&&e.responseBody){const o=jM(e.responseBody);o&&(r.errors_count=o.length,r.errors=o)}return r}}function jM(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const r=t;return rn(r.errors)?r.errors.map(n=>{var i;return{message:n.message,path:n.path,locations:n.locations,code:(i=n.extensions)===null||i===void 0?void 0:i.code}}):void 0}function Xk(e,t){return t.allowedGraphQlUrls.find(r=>zc([r.match],e))}function DM(e,t=!1){if(!e||typeof e!="string")return;let r;try{r=JSON.parse(e)}catch{return}if(!r||!r.query)return;const o=r.query.trim(),n=zM(o),i=r.operationName;if(!n)return;let a;return r.variables&&(a=JSON.stringify(r.variables)),{operationType:n,operationName:i,variables:a,payload:t?_m(o,RM,"..."):void 0}}function zM(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let qh=1;function MM(e,t,r,o,n){const i=Dz(t,r,o,n);UM(e,t,i),LM(e,t,i)}function UM(e,t,r){const o=QD(t).subscribe(n=>{const i=n;if(Rm(i.url))switch(i.state){case"start":r.traceXhr(i,i.xhr),i.requestIndex=Qk(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":r.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:Uc.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack,requestBody:i.requestBody,responseBody:i.responseBody});break}});return{stop:()=>o.unsubscribe()}}function LM(e,t,r){const o=Nk({responseBodyAction:n=>{var i;return!((i=Xk(n.url,t))===null||i===void 0)&&i.trackResponseErrors?2:1}}).subscribe(n=>{var i;const a=n;if(Rm(a.url))switch(a.state){case"start":r.traceFetch(a),a.requestIndex=Qk(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":r.clearTracingIfNeeded(a),e.notify(8,{duration:Ne(a.startClocks.timeStamp,Be()),method:a.method,requestIndex:a.requestIndex,responseType:a.responseType,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:Uc.FETCH,url:a.url,response:a.response,init:a.init,input:a.input,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:(i=a.init)===null||i===void 0?void 0:i.body,responseBody:a.responseBody});break}});return{stop:()=>o.unsubscribe()}}function Qk(){const e=qh;return qh+=1,e}function eE(e){return Gi(e)&&e<0?void 0:e}function tE({lifeCycle:e,isChildEvent:t,onChange:r=_e}){const o={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},n=e.subscribe(13,i=>{var a;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case te.ERROR:o.errorCount+=1,r();break;case te.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),r();break;case te.LONG_TASK:o.longTaskCount+=1,r();break;case te.RESOURCE:!((a=i._dd)===null||a===void 0)&&a.discarded||(o.resourceCount+=1,r());break}});return{stop:()=>{n.unsubscribe()},eventCounts:o}}function FM(e,t){const r=ct();let o=!1;const{stop:n}=gr(e,window,["click","mousedown","keydown","touchstart","pointerdown"],s=>{if(!s.cancelable)return;const c={entryType:"first-input",processingStart:_t(),processingEnd:_t(),startTime:s.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};s.type==="pointerdown"?i(e,c):a(c)},{passive:!0,capture:!0});return{stop:n};function i(s,c){gr(s,window,["pointerup","pointercancel"],l=>{l.type==="pointerup"&&a(c)},{once:!0})}function a(s){if(!o){o=!0,n();const c=s.processingStart-s.startTime;c>=0&&c<ct()-r&&t(s)}}}exports.RumPerformanceEntryType=void 0;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(exports.RumPerformanceEntryType||(exports.RumPerformanceEntryType={}));function ir(e,t){return new he(r=>{if(!window.PerformanceObserver)return;const o=c=>{const l=BM(c);l.length>0&&r.notify(l)};let n,i=!0;const a=new PerformanceObserver(ne(c=>{i?n=Je(()=>o(c.getEntries())):o(c.getEntries())}));try{a.observe(t)}catch{if([exports.RumPerformanceEntryType.RESOURCE,exports.RumPerformanceEntryType.NAVIGATION,exports.RumPerformanceEntryType.LONG_TASK,exports.RumPerformanceEntryType.PAINT].includes(t.type)){t.buffered&&(n=Je(()=>o(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}i=!1,VM(e);let s;return!Zr(exports.RumPerformanceEntryType.FIRST_INPUT)&&t.type===exports.RumPerformanceEntryType.FIRST_INPUT&&({stop:s}=FM(e,c=>{o([c])})),()=>{a.disconnect(),s&&s(),yt(n)}})}let Do;function VM(e){return!Do&&ZM()&&"addEventListener"in performance&&(Do=Oe(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Do?.stop()}}function ZM(){return window.performance!==void 0&&"getEntries"in performance}function Zr(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function BM(e){return e.filter(t=>!qM(t))}function qM(e){return e.entryType===exports.RumPerformanceEntryType.RESOURCE&&(!Rm(e.name)||!Jk(e))}function Fu(e){return e.nodeType===Node.TEXT_NODE}function GM(e){return e.nodeType===Node.COMMENT_NODE}function yr(e){return e.nodeType===Node.ELEMENT_NODE}function Pm(e){return yr(e)&&!!e.shadowRoot}function rE(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&yr(t.host)}function HM(e){return e.childNodes.length>0||Pm(e)}function WM(e,t){let r=e.firstChild;for(;r;)t(r),r=r.nextSibling;Pm(e)&&t(e.shadowRoot)}function nE(e){return rE(e)?e.host:e.parentNode}const oE=100,JM=100,Gh="data-dd-excluded-activity-mutations";function jm(e,t,r,o,n,i){const a=YM(e,t,r,o);return KM(a,n,i)}function KM(e,t,r){let o,n=!1;const i=Je(ne(()=>l({hadActivity:!1})),oE),a=r!==void 0?Je(ne(()=>l({hadActivity:!0,end:Be()})),r):void 0,s=e.subscribe(({isBusy:u})=>{yt(i),yt(o);const d=Be();u||(o=Je(ne(()=>l({hadActivity:!0,end:d})),JM))}),c=()=>{n=!0,yt(i),yt(o),yt(a),s.unsubscribe()};function l(u){n||(c(),t(u))}return{stop:c}}function YM(e,t,r,o){return new he(n=>{const i=[];let a,s=0;return i.push(t.subscribe(l=>{l.every(XM)||c()}),r.subscribe(c),ir(o,{type:exports.RumPerformanceEntryType.RESOURCE}).subscribe(l=>{l.some(u=>!Ml(o,u.name))&&c()}),e.subscribe(7,l=>{Ml(o,l.url)||(a===void 0&&(a=l.requestIndex),s+=1,c())}),e.subscribe(8,l=>{Ml(o,l.url)||a===void 0||l.requestIndex<a||(s-=1,c())})),()=>{i.forEach(l=>l.unsubscribe())};function c(){n.notify({isBusy:s>0})}})}function Ml(e,t){return zc(e.excludedActivityUrls,t)}function XM(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&yr(t)&&t.matches(`[${Gh}], [${Gh}] *`))}const Fc="data-dd-action-name",iE="Masked Element",aE=[Fc,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],QM=[cE,t4],e4=[cE,r4,n4];function ta(e,t){if(!e.isConnected)return;let r,o=e;for(;o&&o.nodeName!=="HTML";){const n=Hh(o,QM,i4,t,r);if(n)return n;r=Hh(o,e4,a4,t,r)||Vc(o4(o),r),o=o.parentElement}return r}function sE(e){return/[0-9]/.test(e)}function t4(e){if(e.id&&!sE(e.id))return`#${CSS.escape(e.id)}`}function r4(e){if(e.tagName==="BODY")return;const t=e.classList;for(let r=0;r<t.length;r+=1){const o=t[r];if(!sE(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function n4(e){return CSS.escape(e.tagName)}function cE(e,t){if(t){const o=r(t);if(o)return o}for(const o of aE){const n=r(o);if(n)return n}function r(o){if(e.hasAttribute(o))return`${CSS.escape(e.tagName)}[${o}="${CSS.escape(e.getAttribute(o))}"]`}}function o4(e){let t=e.parentElement.firstElementChild,r=1;for(;t&&t!==e;)t.tagName===e.tagName&&(r+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${r})`}function Hh(e,t,r,o,n){for(const i of t){const a=i(e,o);if(a&&r(e,a,n))return Vc(a,n)}}function i4(e,t,r){return e.ownerDocument.querySelectorAll(Vc(t,r)).length===1}function a4(e,t,r){let o;if(r===void 0)o=a=>a.matches(t);else{const a=Vc(`${t}:scope`,r);o=s=>s.querySelector(a)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Vc(e,t){return t?`${e}>${t}`:e}const ae={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Dn.ALLOW,MASK:Dn.MASK,MASK_USER_INPUT:Dn.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Dn.MASK_UNLESS_ALLOWLISTED},Dm="data-dd-privacy",s4="hidden",c4="dd-privacy-",Ua="***",l4="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",u4={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},d4="x";function Jr(e){return`[${Dm}="${e}"], .${c4}${e}`}function ra(e,t,r){if(r&&r.has(e))return r.get(e);const o=nE(e),n=o?ra(o,t,r):t,i=uE(e),a=lE(i,n);return r&&r.set(e,a),a}function lE(e,t){switch(t){case ae.HIDDEN:case ae.IGNORE:return t}switch(e){case ae.ALLOW:case ae.MASK:case ae.MASK_USER_INPUT:case ae.MASK_UNLESS_ALLOWLISTED:case ae.HIDDEN:case ae.IGNORE:return e;default:return t}}function uE(e){if(yr(e)){if(e.tagName==="BASE")return ae.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return ae.MASK;const r=t.getAttribute("autocomplete");if(r&&(r.startsWith("cc-")||r.endsWith("-password")))return ae.MASK}if(e.matches(Jr(ae.HIDDEN)))return ae.HIDDEN;if(e.matches(Jr(ae.MASK)))return ae.MASK;if(e.matches(Jr(ae.MASK_UNLESS_ALLOWLISTED)))return ae.MASK_UNLESS_ALLOWLISTED;if(e.matches(Jr(ae.MASK_USER_INPUT)))return ae.MASK_USER_INPUT;if(e.matches(Jr(ae.ALLOW)))return ae.ALLOW;if(m4(e))return ae.IGNORE}}function zm(e,t){switch(t){case ae.MASK:case ae.HIDDEN:case ae.IGNORE:return!0;case ae.MASK_UNLESS_ALLOWLISTED:return Fu(e)?wa(e.parentNode)?!0:!mE(e.textContent||""):wa(e);case ae.MASK_USER_INPUT:return Fu(e)?wa(e.parentNode):wa(e);default:return!1}}function dE(e,t,r,o,n){if(o!==ae.MASK&&o!==ae.MASK_UNLESS_ALLOWLISTED||t===Dm||aE.includes(t)||t===n.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||r&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function wa(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!u4[t.tagName]}const fE=e=>e.replace(/\S/g,d4);function f4(e,t){var r;const o=(r=e.parentElement)===null||r===void 0?void 0:r.tagName;let n=e.textContent||"";if(o==="HEAD"&&!n.trim())return;const a=t;if(o==="SCRIPT")n=Ua;else if(a===ae.HIDDEN)n=Ua;else if(zm(e,a))if(o==="DATALIST"||o==="SELECT"||o==="OPTGROUP"){if(!n.trim())return}else o==="OPTION"?n=Ua:a===ae.MASK_UNLESS_ALLOWLISTED?n=pE(n):n=fE(n);return n}function m4(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const r=t("rel");return/preload|prefetch/i.test(r)&&t("as")==="script"||r==="shortcut icon"||r==="icon"}if(e.nodeName==="META"){const r=t("name"),o=t("rel"),n=t("property");return/^msapplication-tile(image|color)$/.test(r)||r==="application-name"||o==="icon"||o==="apple-touch-icon"||o==="shortcut icon"||r==="keywords"||r==="description"||/^(og|twitter|fb):/.test(n)||/^(og|twitter):/.test(r)||r==="pinterest"||r==="robots"||r==="googlebot"||r==="bingbot"||e.hasAttribute("http-equiv")||r==="author"||r==="generator"||r==="framework"||r==="publisher"||r==="progid"||/^article:/.test(n)||/^product:/.test(n)||r==="google-site-verification"||r==="yandex-verification"||r==="csrf-token"||r==="p:domain_verify"||r==="verify-v1"||r==="verification"||r==="shopify-checkout-api-token"}function t(r){return(e.getAttribute(r)||"").toLowerCase()}return!1}function mE(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function pE(e,t){return mE(e)?e:t||fE(e)}const hE=Ke,p4=100;function h4(e,t){const r=[];let o=0,n;i(e);function i(c){c.stopObservable.subscribe(a),r.push(c),yt(n),n=Je(s,hE)}function a(){o===1&&r.every(c=>c.isStopped())&&(o=2,t(r))}function s(){yt(n),o===0&&(o=1,a())}return{tryAppend:c=>o!==0?!1:r.length>0&&!g4(r[r.length-1].event,c.event)?(s(),!1):(i(c),!0),stop:()=>{s()}}}function g4(e,t){return e.target===t.target&&v4(e,t)<=p4&&e.timeStamp-t.timeStamp<=hE}function v4(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function y4(e,t,r=ae.ALLOW){const o=new Map,{actionNameAttribute:n}=t,i=Wh(e,Fc)||n&&Wh(e,n);return i?{name:i,nameSource:"custom_attribute"}:r===ae.MASK?{name:iE,nameSource:"mask_placeholder"}:Jh(e,b4,t,o)||Jh(e,_4,t,o)||{name:"",nameSource:"blank"}}function Wh(e,t){const r=e.closest(`[${t}]`);if(!r)return;const o=r.getAttribute(t);return vE(gE(o.trim()))}const b4=[(e,t,r)=>{if("labels"in e&&e.labels&&e.labels.length>0)return La(e.labels[0],t,r)},e=>{if(e.nodeName==="INPUT"){const t=e,r=t.getAttribute("type");if(r==="button"||r==="submit"||r==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,r)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return La(e,t,r)},(e,t,r)=>zo(e,"aria-label",t,r),(e,t,r)=>{const o=e.getAttribute("aria-labelledby");if(o)return{name:o.split(/\s+/).map(n=>x4(e,n)).filter(n=>!!n).map(n=>yE(n,t,r)).join(" "),nameSource:"text_content"}},(e,t,r)=>zo(e,"alt",t,r),(e,t,r)=>zo(e,"name",t,r),(e,t,r)=>zo(e,"title",t,r),(e,t,r)=>zo(e,"placeholder",t,r),(e,t,r)=>{if("options"in e&&e.options.length>0)return La(e.options[0],t,r)}],_4=[(e,t,r)=>La(e,t,r)],w4=10;function Jh(e,t,r,o){let n=e,i=0;for(;i<=w4&&n&&n.nodeName!=="BODY"&&n.nodeName!=="HTML"&&n.nodeName!=="HEAD";){for(const a of t){const s=a(n,r,o);if(s){const{name:c,nameSource:l}=s,u=c&&c.trim();if(u)return{name:vE(gE(u)),nameSource:l}}}if(n.nodeName==="FORM")break;n=n.parentElement,i+=1}}function gE(e){return e.replace(/\s+/g," ")}function vE(e){return e.length>100?`${_m(e,100)} [...]`:e}function x4(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function zo(e,t,r,o){const{enablePrivacyForActionName:n,defaultPrivacyLevel:i}=r;let a=e.getAttribute(t);if(a&&n){const s=ra(e,i,o);dE(e.tagName,t,a,s,r)&&(a=pE(a,iE))}else a||(a="");return{name:a,nameSource:"standard_attribute"}}function La(e,t,r){return{name:yE(e,t,r)||"",nameSource:"text_content"}}function yE(e,t,r){if(e.isContentEditable)return;const{enablePrivacyForActionName:o,actionNameAttribute:n,defaultPrivacyLevel:i}=t;if(Yi(Dr.USE_TREE_WALKER_FOR_ACTION_NAME))return S4(e,n,o,i,r);if("innerText"in e){let a=e.innerText;const s=c=>{const l=e.querySelectorAll(c);for(let u=0;u<l.length;u+=1){const d=l[u];if("innerText"in d){const f=d.innerText;f&&f.trim().length>0&&(a=a.replace(f,""))}}};return s(`[${Fc}]`),n&&s(`[${n}]`),o&&s(`${Jr(ae.HIDDEN)}, ${Jr(ae.MASK)}`),a}return e.textContent}function S4(e,t,r,o,n){const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,s);let a="";for(;i.nextNode();){const c=i.currentNode;if(yr(c)){(c.nodeName==="BR"||c.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(c).display))&&(a+=" ");continue}a+=c.textContent||""}return a.replace(/\s+/g," ").trim();function s(c){const l=ra(c,o,n);if(r&&l&&zm(c,l))return NodeFilter.FILTER_REJECT;if(yr(c)){if(c.hasAttribute(Fc)||t&&c.hasAttribute(t))return NodeFilter.FILTER_REJECT;const u=getComputedStyle(c);if(u.visibility!=="visible"||u.display==="none"||u.contentVisibility&&u.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function k4(e,{onPointerDown:t,onPointerUp:r}){let o,n={selection:!1,input:!1,scroll:!1},i;const a=[Oe(e,window,"pointerdown",s=>{Yh(s)&&(o=Kh(),n={selection:!1,input:!1,scroll:!1},i=t(s))},{capture:!0}),Oe(e,window,"selectionchange",()=>{(!o||!Kh())&&(n.selection=!0)},{capture:!0}),Oe(e,window,"scroll",()=>{n.scroll=!0},{capture:!0,passive:!0}),Oe(e,window,"pointerup",s=>{if(Yh(s)&&i){const c=n;r(i,s,()=>c),i=void 0}},{capture:!0}),Oe(e,window,"input",()=>{n.input=!0},{capture:!0})];return{stop:()=>{a.forEach(s=>s.stop())}}}function Kh(){const e=window.getSelection();return!e||e.isCollapsed}function Yh(e){return e.target instanceof Element&&e.isPrimary!==!1}const Xh=3;function E4(e,t){if(I4(e))return t.addFrustration(jo.RAGE_CLICK),e.some(Qh)&&t.addFrustration(jo.DEAD_CLICK),t.hasError&&t.addFrustration(jo.ERROR_CLICK),{isRage:!0};const r=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration(jo.ERROR_CLICK),Qh(o)&&!r&&o.addFrustration(jo.DEAD_CLICK)}),{isRage:!1}}function I4(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(Xh-1);t+=1)if(e[t+Xh-1].event.timeStamp-e[t].event.timeStamp<=Ke)return!0;return!1}const T4='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Qh(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(T4)}const bE=10*Ke,Go=new Map;function $4(e){const t=Go.get(e);return Go.delete(e),t}function _E(e,t){Go.set(e,t),Go.forEach((r,o)=>{Ne(o,_t())>bE&&Go.delete(o)})}const O4=5*lt;function A4(e,t,r,o){const n=wo({expireDelay:O4}),i=new he;let a;e.subscribe(10,()=>{n.reset()}),e.subscribe(5,u),e.subscribe(11,d=>{d.reason===Ln.UNLOADING&&u()});const{stop:s}=k4(o,{onPointerDown:d=>C4(o,e,t,d,r),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:f},m,g)=>{N4(o,e,t,r,n,i,l,d,m,g,f)}});return{stop:()=>{u(),i.notify(),s()},actionContexts:{findActionId:d=>n.findAll(d)}};function l(d){if(!a||!a.tryAppend(d)){const f=d.clone();a=h4(d,m=>{P4(m,f)})}}function u(){a&&a.stop()}}function C4(e,t,r,o,n){let i;if(e.enablePrivacyForActionName?i=ra(o.target,e.defaultPrivacyLevel):i=ae.ALLOW,i===ae.HIDDEN)return;const a=R4(o,i,e);let s=!1;return jm(t,r,n,e,c=>{s=c.hadActivity},oE),{clickActionBase:a,hadActivityOnPointerDown:()=>s}}function N4(e,t,r,o,n,i,a,s,c,l,u){var d;const f=wE(t,n,l,s,c);a(f);const m=(d=s?.target)===null||d===void 0?void 0:d.selector;m&&_E(c.timeStamp,m);const{stop:g}=jm(t,r,o,e,b=>{b.hadActivity&&b.end<f.startClocks.timeStamp?f.discard():b.hadActivity?f.stop(b.end):u()?f.stop(f.startClocks.timeStamp):f.stop()},bE),h=t.subscribe(5,({endClocks:b})=>{f.stop(b.timeStamp)}),y=i.subscribe(()=>{f.stop()});f.stopObservable.subscribe(()=>{h.unsubscribe(),g(),y.unsubscribe()})}function R4(e,t,r){const o=e.target.getBoundingClientRect(),n=ta(e.target,r.actionNameAttribute);n&&_E(e.timeStamp,n);const{name:i,nameSource:a}=y4(e.target,r,t);return{type:Lc.CLICK,target:{width:Math.round(o.width),height:Math.round(o.height),selector:n},position:{x:Math.round(e.clientX-o.left),y:Math.round(e.clientY-o.top)},name:i,nameSource:a}}function wE(e,t,r,o,n){const i=et(),a=Ue(),s=t.add(i,a.relative),c=tE({lifeCycle:e,isChildEvent:g=>g.action!==void 0&&(Array.isArray(g.action.id)?g.action.id.includes(i):g.action.id===i)});let l=0,u;const d=[],f=new he;function m(g){l===0&&(u=g,l=1,u?s.close(bm(u)):s.remove(),c.stop(),f.notify())}return{event:n,stop:m,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return u!==void 0},getUserActivity:r,addFrustration:g=>{d.push(g)},startClocks:a,isStopped:()=>l===1||l===2,clone:()=>wE(e,t,r,o,n),validate:g=>{if(m(),l!==1)return;const{resourceCount:h,errorCount:y,longTaskCount:b}=c.eventCounts,w={duration:u&&Ne(a.timeStamp,u),startClocks:a,id:i,frustrationTypes:d,counts:{resourceCount:h,errorCount:y,longTaskCount:b},events:g??[n],event:n,...o};e.notify(0,w),l=2},discard:()=>{m(),l=2}}}function P4(e,t){const{isRage:r}=E4(e,t);r?(e.forEach(o=>o.discard()),t.stop(Be()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function j4(e,t,r,o,n){const{unsubscribe:i}=e.subscribe(0,c=>{e.notify(12,eg(c))});t.register(0,({startTime:c,eventType:l})=>{if(l!==te.ERROR&&l!==te.RESOURCE&&l!==te.LONG_TASK)return wt;const u=a.findActionId(c);return u?{type:l,action:{id:u}}:wt}),t.register(1,({startTime:c})=>({action:{id:a.findActionId(c)}}));let a={findActionId:_e},s=_e;return n.trackUserInteractions&&({actionContexts:a,stop:s}=A4(e,r,o,n)),{addAction:c=>{e.notify(12,eg(c))},actionContexts:a,stop:()=>{i(),s()}}}function eg(e){const t=Ul(e)?{action:{id:e.id,loading_time:eE(oe(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},r=vr({action:{id:et(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:te.ACTION},t),o=Ul(e)?e.duration:void 0,n=Ul(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:r,duration:o,startTime:e.startClocks.relative,domainContext:n}}function Ul(e){return e.type!==Lc.CUSTOM}function D4(e){const t=mz([Oc.error]).subscribe(r=>e.notify(r.error));return{stop:()=>{t.unsubscribe()}}}function z4(e,t){const r=Y2(e,[si.cspViolation,si.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{r.unsubscribe()}}}function M4(e,t,r){const o=new he;return r.subscribe(n=>{n.type===0&&o.notify(n.error)}),D4(o),z4(t,o),o.subscribe(n=>e.notify(14,{error:n})),U4(e)}function U4(e){return e.subscribe(14,({error:t})=>{e.notify(12,L4(t))}),{addError:({error:t,handlingStack:r,componentStack:o,startClocks:n,context:i})=>{const a=km({originalError:t,handlingStack:r,componentStack:o,startClocks:n,nonErrorPrefix:"Provided",source:vo.CUSTOM,handling:"handled"});a.context=vr(a.context,i),e.notify(14,{error:a})}}}function L4(e){const t={date:e.startClocks.timeStamp,error:{id:et(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:te.ERROR,context:e.context},r={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:r}}const tg=new WeakSet;function F4(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const r=t.filter(o=>!tg.has(o)).filter(o=>Jk(o)&&Kk(o)).filter(o=>V4(o,e.startClocks.relative,xE({startTime:e.startClocks.relative,duration:e.duration})));if(r.length===1)return tg.add(r[0]),r[0].toJSON()}function xE(e){return ho(e.startTime,e.duration)}function V4(e,t,r){return e.startTime>=t-1&&xE(e)<=ho(r,1)}const Z4=2*lt;function B4(e){const t=q4(e)||G4(e);if(!(!t||t.traceTime<=ct()-Z4))return t.traceId}function q4(e){const t=e.querySelector("meta[name=dd-trace-id]"),r=e.querySelector("meta[name=dd-trace-time]");return SE(t&&t.content,r&&r.content)}function G4(e){const t=H4(e);if(t)return SE(ii(t,"trace-id"),ii(t,"trace-time"))}function SE(e,t){const r=t&&Number(t);if(!(!e||!r))return{traceId:e,traceTime:r}}function H4(e){for(let t=0;t<e.childNodes.length;t+=1){const r=rg(e.childNodes[t]);if(r)return r}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const r=e.body.childNodes[t],o=rg(r);if(o)return o;if(!Fu(r))break}}function rg(e){if(e&&GM(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function kE(){if(Zr(exports.RumPerformanceEntryType.NAVIGATION)){const r=performance.getEntriesByType(exports.RumPerformanceEntryType.NAVIGATION)[0];if(r)return r}const e=W4(),t={entryType:exports.RumPerformanceEntryType.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function W4(){const e={},t=performance.timing;for(const r in t)if(Gi(t[r])){const o=r,n=t[o];e[o]=n===0?0:bm(n)}return e}function J4(e,t,r=kE){Am(e,"interactive",()=>{const o=r(),n=Object.assign(o.toJSON(),{entryType:exports.RumPerformanceEntryType.RESOURCE,initiatorType:Hk,duration:o.responseEnd,traceId:B4(document),toJSON:()=>({...n,toJSON:void 0})});t(n)})}const K4=1e3;function Y4(e){const t=new Set,r=e.subscribe(8,o=>{t.add(o),t.size>K4&&(_o("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let n=1/0,i;for(const a of t){const s=o.startTime-a.startClocks.relative;0<=s&&s<n&&a.url===o.name&&(n=Math.abs(s),i=a)}return i&&t.delete(i),i},stop(){r.unsubscribe()}}}function X4(e,t,r,o=fz(),n=J4){let i;const a=t.trackEarlyRequests;a?i=Y4(e):e.subscribe(8,l=>{c(()=>Q4(l,t,r))});const s=ir(t,{type:exports.RumPerformanceEntryType.RESOURCE,buffered:!0}).subscribe(l=>{for(const u of l)(a||!Wk(u))&&c(()=>ng(u,t,r,i))});n(t,l=>{c(()=>ng(l,t,r,i))});function c(l){o.push(()=>{const u=l();u&&e.notify(12,u)})}return{stop:()=>{o.stop(),s.unsubscribe()}}}function Q4(e,t,r){const o=F4(e);return EE(o,e,r,t)}function ng(e,t,r,o){const n=Wk(e)&&o?o.getMatchingRequest(e):void 0;return EE(e,n,r,t)}function EE(e,t,r,o){if(!e&&!t)return;const n=t?nU(t,o):oU(e,o);if(!o.trackResources&&!n)return;const i=e?Hi(e.startTime):t.startClocks,a=e?EM(e):iU(r,i,t.duration),s=t&&eU(t,o),c=vr({date:i.timeStamp,resource:{id:et(),duration:oe(a),type:t?t.type===Uc.XHR?at.XHR:at.FETCH:kM(e),method:t?t.method:void 0,status_code:t?t.status:aU(e.responseStatus),url:t?Yk(t.url):e.name,protocol:e&&$M(e),delivery_type:e&&OM(e),graphql:s},type:te.RESOURCE,_dd:{discarded:!o.trackResources}},n,e&&rU(e));return{startTime:i.relative,duration:a,rawRumEvent:c,domainContext:tU(e,t)}}function eU(e,t){const r=Xk(e.url,t);if(r)return PM(e,r)}function tU(e,t){if(t){const r={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Uc.XHR?{xhr:t.xhr,...r}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...r}}return{performanceEntry:e}}function rU(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...AM(e),...IM(e)}}}function nU(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function oU(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Vk().toString(),rule_psr:t.rulePsr}}}function iU(e,t,r){return e.wasInPageStateDuringPeriod("frozen",t.relative,r)?void 0:r}function aU(e){return e===0?void 0:e}function sU(e,t,r){const{stop:o,eventCounts:n}=tE({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:r});return{stop:o,eventCounts:n}}const cU=10*lt;function lU(e,t,r){return{stop:ir(e,{type:exports.RumPerformanceEntryType.PAINT,buffered:!0}).subscribe(n=>{const i=n.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<cU);i&&r(i.startTime)}).unsubscribe}}function uU(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Ne(e,_t()))})})}function dU(e,t,r){const o=ir(e,{type:exports.RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(n=>{const i=n.find(a=>a.startTime<t.timeStamp);if(i){const a=Ne(i.startTime,i.processingStart);let s;i.target&&yr(i.target)&&(s=ta(i.target,e.actionNameAttribute)),r({delay:a>=0?a:0,time:i.startTime,targetSelector:s})}});return{stop:()=>{o.unsubscribe()}}}function fU(e,t,r=kE){return hU(e,()=>{const o=r();pU(o)||t(mU(o))})}function mU(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=_t()?e.responseStart:void 0}}function pU(e){return e.loadEventEnd<=0}function hU(e,t){let r;const{stop:o}=Am(e,"complete",()=>{r=Je(()=>t())});return{stop:()=>{o(),yt(r)}}}const gU=10*lt;function vU(e,t,r,o){let n=1/0;const{stop:i}=gr(e,r,["pointerdown","keydown"],c=>{n=c.timeStamp},{capture:!0,once:!0});let a=0;const s=ir(e,{type:exports.RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(c=>{const l=VS(c,u=>u.entryType===exports.RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT&&u.startTime<n&&u.startTime<t.timeStamp&&u.startTime<gU&&u.size>a);if(l){let u;l.element&&(u=ta(l.element,e.actionNameAttribute)),o({value:l.startTime,targetSelector:u,resourceUrl:yU(l)}),a=l.size}});return{stop:()=>{i(),s.unsubscribe()}}}function yU(e){return e.url===""?void 0:e.url}function IE(e,t,r=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:_e};if(Zr(exports.RumPerformanceEntryType.VISIBILITY_STATE)){const i=performance.getEntriesByType(exports.RumPerformanceEntryType.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:_e}}let o=1/0;const{stop:n}=gr(e,r,["pagehide","visibilitychange"],i=>{(i.type==="pagehide"||document.visibilityState==="hidden")&&(o=i.timeStamp,n())},{capture:!0});return{get timeStamp(){return o},stop:n}}function bU(e,t,r,o){const n={},{stop:i}=fU(e,d=>{r(d.loadEvent),n.navigationTimings=d,o()}),a=IE(e,t),{stop:s}=lU(e,a,d=>{n.firstContentfulPaint=d,o()}),{stop:c}=vU(e,a,window,d=>{n.largestContentfulPaint=d,o()}),{stop:l}=dU(e,a,d=>{n.firstInput=d,o()});function u(){i(),s(),c(),l(),a.stop()}return{stop:u,initialViewMetrics:n}}const Vu=(e,t)=>e*t,_U=(e,t)=>{const r=Math.max(e.left,t.left),o=Math.max(e.top,t.top),n=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return r>=n||o>=i?0:Vu(n-r,i-o)},og=e=>{const t=Vu(e.previousRect.width,e.previousRect.height),r=Vu(e.currentRect.width,e.currentRect.height),o=_U(e.previousRect,e.currentRect);return t+r-o};function wU(e,t,r){if(!IU())return{stop:_e};let o=0,n;r({value:0});const i=EU(),a=ir(e,{type:exports.RumPerformanceEntryType.LAYOUT_SHIFT,buffered:!0}).subscribe(s=>{var c;for(const l of s){if(l.hadRecentInput||l.startTime<t)continue;const{cumulatedValue:u,isMaxValue:d}=i.update(l);if(d){const f=xU(l.sources);n={target:f?.node?new WeakRef(f.node):void 0,time:Ne(t,l.startTime),previousRect:f?.previousRect,currentRect:f?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(u>o){o=u;const f=(c=n?.target)===null||c===void 0?void 0:c.deref();r({value:Bo(o,4),targetSelector:f&&ta(f,e.actionNameAttribute),time:n?.time,previousRect:n?.previousRect?ig(n.previousRect):void 0,currentRect:n?.currentRect?ig(n.currentRect):void 0,devicePixelRatio:n?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function xU(e){let t;for(const r of e)if(r.node&&yr(r.node)){const o=og(r);(!t||og(t)<o)&&(t=r)}return t}function ig({x:e,y:t,width:r,height:o}){return{x:e,y:t,width:r,height:o}}const SU=5*Ke,kU=Ke;function EU(){let e=0,t,r,o=0;return{update:n=>{const i=t===void 0||n.startTime-r>=kU||n.startTime-t>=SU;let a;return i?(t=r=n.startTime,o=e=n.value,a=!0):(e+=n.value,r=n.startTime,a=n.value>o,a&&(o=n.value)),{cumulatedValue:e,isMaxValue:a}}}}function IU(){return Zr(exports.RumPerformanceEntryType.LAYOUT_SHIFT)&&"WeakRef"in window}let Fa,TE=0,Ll=1/0,Fl=0;function TU(){"interactionCount"in performance||Fa||(Fa=new window.PerformanceObserver(ne(e=>{e.getEntries().forEach(t=>{const r=t;r.interactionId&&(Ll=Math.min(Ll,r.interactionId),Fl=Math.max(Fl,r.interactionId),TE=(Fl-Ll)/7+1)})})),Fa.observe({type:"event",buffered:!0,durationThreshold:0}))}const ag=()=>Fa?TE:window.performance.interactionCount||0,sg=10,$U=1*lt;function OU(e,t,r){if(!NU())return{getInteractionToNextPaint:()=>{},setViewEnd:_e,stop:_e};const{getViewInteractionCount:o,stopViewInteractionCount:n}=CU(r);let i=1/0;const a=AU(o);let s=-1,c,l;function u(m){for(const h of m)h.interactionId&&h.startTime>=t&&h.startTime<=i&&a.process(h);const g=a.estimateP98Interaction();g&&g.duration!==s&&(s=g.duration,l=Ne(t,g.startTime),c=$4(g.startTime),!c&&g.target&&yr(g.target)&&(c=ta(g.target,e.actionNameAttribute)))}const d=ir(e,{type:exports.RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(u),f=ir(e,{type:exports.RumPerformanceEntryType.EVENT,durationThreshold:40,buffered:!0}).subscribe(u);return{getInteractionToNextPaint:()=>{if(s>=0)return{value:Math.min(s,$U),targetSelector:c,time:l};if(o())return{value:0}},setViewEnd:m=>{i=m,n()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function AU(e){const t=[];function r(){t.sort((o,n)=>n.duration-o.duration).splice(sg)}return{process(o){const n=t.findIndex(a=>o.interactionId===a.interactionId),i=t[t.length-1];n!==-1?o.duration>t[n].duration&&(t[n]=o,r()):(t.length<sg||o.duration>i.duration)&&(t.push(o),r())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function CU(e){TU();const t=e===dr.INITIAL_LOAD?0:ag();let r={stopped:!1};function o(){return ag()-t}return{getViewInteractionCount:()=>r.stopped?r.interactionCount:o(),stopViewInteractionCount:()=>{r={stopped:!0,interactionCount:o()}}}}function NU(){return Zr(exports.RumPerformanceEntryType.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function RU(e,t,r,o,n,i,a){let s=n===dr.INITIAL_LOAD,c=!0;const l=[],u=IE(o,i);function d(){if(!c&&!s&&l.length>0){const m=Math.max(...l);m<u.timeStamp-i.relative&&a(m)}}const{stop:f}=jm(e,t,r,o,m=>{c&&(c=!1,m.hadActivity&&l.push(Ne(i.timeStamp,m.end)),d())});return{stop:()=>{f(),u.stop()},setLoadEvent:m=>{s&&(s=!1,l.push(m),d())}}}function PU(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function $E(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let Vl;function OE(e){return Vl||(Vl=jU(e)),Vl}function jU(e){return new he(t=>{const{throttled:r}=Ji(()=>{t.notify(Zc())},200);return Oe(e,window,"resize",r,{capture:!0,passive:!0}).stop})}function Zc(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const DU=Ke;function zU(e,t,r,o=UU(e)){let n=0,i=0,a=0;const s=o.subscribe(({scrollDepth:c,scrollTop:l,scrollHeight:u})=>{let d=!1;if(c>n&&(n=c,d=!0),u>i){i=u;const f=_t();a=Ne(t.relative,f),d=!0}d&&r({maxDepth:Math.min(n,i),maxDepthScrollTop:l,maxScrollHeight:i,maxScrollHeightTime:a})});return{stop:()=>s.unsubscribe()}}function MU(){const e=$E(),{height:t}=Zc(),r=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:r,scrollDepth:o,scrollTop:e}}function UU(e,t=DU){return new he(r=>{function o(){r.notify(MU())}if(window.ResizeObserver){const n=Ji(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,a=new ResizeObserver(ne(n.throttled));i&&a.observe(i);const s=Oe(e,window,"scroll",n.throttled,{passive:!0});return()=>{n.cancel(),a.disconnect(),s.stop()}}})}function LU(e,t,r,o,n,i,a){const s={},{stop:c,setLoadEvent:l}=RU(e,t,r,o,i,a,h=>{s.loadingTime=h,n()}),{stop:u}=zU(o,a,h=>{s.scroll=h}),{stop:d}=wU(o,a.relative,h=>{s.cumulativeLayoutShift=h,n()}),{stop:f,getInteractionToNextPaint:m,setViewEnd:g}=OU(o,a.relative,i);return{stop:()=>{c(),d(),u()},stopINPTracking:f,setLoadEvent:l,setViewEnd:g,getCommonViewMetrics:()=>(s.interactionToNextPaint=m(),s)}}function FU(e,t){const{stop:r}=Oe(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return r}function VU(e,t,r){uU(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},r()})}const ZU=3e3,BU=5*lt,qU=5*lt;function GU(e,t,r,o,n,i,a,s){const c=new Set;let l=f(dr.INITIAL_LOAD,ym(),s),u;m();let d;a&&(d=g(i),n.trackBfcacheViews&&(u=FU(n,h=>{l.end();const y=Hi(h.timeStamp);l=f(dr.BF_CACHE,y,void 0)})));function f(h,y,b){const w=HU(t,r,o,n,e,h,y,b);return c.add(w),w.stopObservable.subscribe(()=>{c.delete(w)}),w}function m(){t.subscribe(10,()=>{l=f(dr.ROUTE_CHANGE,void 0,{name:l.name,service:l.service,version:l.version,context:l.contextManager.getContext()})}),t.subscribe(9,()=>{l.end({sessionIsActive:!1})})}function g(h){return h.subscribe(({oldLocation:y,newLocation:b})=>{JU(y,b)&&(l.end(),l=f(dr.ROUTE_CHANGE))})}return{addTiming:(h,y=Be())=>{l.addTiming(h,y)},startView:(h,y)=>{l.end({endClocks:y}),l=f(dr.ROUTE_CHANGE,y,h)},setViewContext:h=>{l.contextManager.setContext(h)},setViewContextProperty:(h,y)=>{l.contextManager.setContextProperty(h,y)},setViewName:h=>{l.setViewName(h)},getViewContext:()=>l.contextManager.getContext(),stop:()=>{d&&d.unsubscribe(),u&&u(),l.end(),c.forEach(h=>h.stop())}}}function HU(e,t,r,o,n,i,a=Ue(),s){const c=et(),l=new he,u={};let d=0,f;const m=oi(n),g=Mc();let h=!0,y=s?.name;const b=s?.service||o.service,w=s?.version||o.version,x=s?.context;x&&g.setContext(x);const v={id:c,name:y,startClocks:a,service:b,version:w,context:x};e.notify(1,v),e.notify(2,v);const{throttled:k,cancel:E}=Ji(V,ZU,{leading:!1}),{setLoadEvent:I,setViewEnd:A,stop:M,stopINPTracking:U,getCommonViewMetrics:K}=LU(e,t,r,o,se,i,a),{stop:ge,initialViewMetrics:q}=i===dr.INITIAL_LOAD?bU(o,a,I,se):{stop:_e,initialViewMetrics:{}};i===dr.BF_CACHE&&VU(a,q,se);const{stop:F,eventCounts:ce}=sU(e,c,se),le=po(V,BU),pe=e.subscribe(11,ye=>{ye.reason===Ln.UNLOADING&&V()});V(),g.changeObservable.subscribe(se);function G(){e.notify(3,{id:c,name:y,context:g.getContext(),startClocks:a,sessionIsActive:h})}function se(){G(),k()}function V(){E(),G(),d+=1;const ye=f===void 0?Be():f.timeStamp;e.notify(4,{customTimings:u,documentVersion:d,id:c,name:y,service:b,version:w,context:g.getContext(),loadingType:i,location:m,startClocks:a,commonViewMetrics:K(),initialViewMetrics:q,duration:Ne(a.timeStamp,ye),isActive:f===void 0,sessionIsActive:h,eventCounts:ce})}return{get name(){return y},service:b,version:w,contextManager:g,stopObservable:l,end(ye={}){var ue,ve;f||(f=(ue=ye.endClocks)!==null&&ue!==void 0?ue:Ue(),h=(ve=ye.sessionIsActive)!==null&&ve!==void 0?ve:!0,e.notify(5,{endClocks:f}),e.notify(6,{endClocks:f}),Nc(le),A(f.relative),M(),pe.unsubscribe(),V(),Je(()=>{this.stop()},qU))},stop(){ge(),F(),U(),l.notify()},addTiming(ye,ue){if(f)return;const ve=mj(ue)?ue:Ne(a.timeStamp,ue);u[WU(ye)]=ve,se()},setViewName(ye){y=ye,V()}}}function WU(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&Q.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function JU(e,t){return e.pathname!==t.pathname||!KU(t.hash)&&cg(t.hash)!==cg(e.hash)}function KU(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function cg(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function YU(e,t,r,o,n,i,a,s,c,l){return e.subscribe(4,u=>e.notify(12,XU(u,r,s))),t.register(0,({startTime:u,eventType:d})=>{const f=c.findView(u);return f?{type:d,service:f.service,version:f.version,context:f.context,view:{id:f.id,name:f.name}}:zr}),t.register(1,({startTime:u})=>{var d;return{view:{id:(d=c.findView(u))===null||d===void 0?void 0:d.id}}}),GU(o,e,n,i,r,a,!r.trackViewsManually,l)}function XU(e,t,r){var o,n,i,a,s,c,l,u,d,f,m,g,h,y,b,w,x,v;const k=r.getReplayStats(e.id),E=(n=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||n===void 0?void 0:n.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:k,cls:E?{device_pixel_ratio:E}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:te.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:oe((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(s=e.commonViewMetrics.cumulativeLayoutShift)===null||s===void 0?void 0:s.targetSelector,first_byte:oe((c=e.initialViewMetrics.navigationTimings)===null||c===void 0?void 0:c.firstByte),dom_complete:oe((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.domComplete),dom_content_loaded:oe((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domContentLoaded),dom_interactive:oe((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:oe(e.initialViewMetrics.firstContentfulPaint),first_input_delay:oe((f=e.initialViewMetrics.firstInput)===null||f===void 0?void 0:f.delay),first_input_time:oe((m=e.initialViewMetrics.firstInput)===null||m===void 0?void 0:m.time),first_input_target_selector:(g=e.initialViewMetrics.firstInput)===null||g===void 0?void 0:g.targetSelector,interaction_to_next_paint:oe((h=e.commonViewMetrics.interactionToNextPaint)===null||h===void 0?void 0:h.value),interaction_to_next_paint_time:oe((y=e.commonViewMetrics.interactionToNextPaint)===null||y===void 0?void 0:y.time),interaction_to_next_paint_target_selector:(b=e.commonViewMetrics.interactionToNextPaint)===null||b===void 0?void 0:b.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:oe((w=e.initialViewMetrics.largestContentfulPaint)===null||w===void 0?void 0:w.value),largest_contentful_paint_target_selector:(x=e.initialViewMetrics.largestContentfulPaint)===null||x===void 0?void 0:x.targetSelector,load_event:oe((v=e.initialViewMetrics.navigationTimings)===null||v===void 0?void 0:v.loadEvent),loading_time:eE(oe(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:QU(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:oe(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:oe(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:$z()}};return Vr(e.customTimings)||(I.view.custom_timings=NS(e.customTimings,oe)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function QU({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:r,firstInput:o,largestContentfulPaint:n}){return{cls:e&&{score:e.value,timestamp:oe(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:r&&{timestamp:oe(r)},fid:o&&{duration:oe(o.delay),timestamp:oe(o.time),target_selector:o.targetSelector},inp:t&&{duration:oe(t.value),timestamp:oe(t.time),target_selector:t.targetSelector},lcp:n&&{timestamp:oe(n.value),target_selector:n.targetSelector,resource_url:n.resourceUrl}}}const e6="rum";function t6(e,t,r){const o=ZD(e,e6,n=>n6(e,n),r);return o.expireObservable.subscribe(()=>{t.notify(9)}),o.renewObservable.subscribe(()=>{t.notify(10)}),o.sessionStateUpdateObservable.subscribe(({previousState:n,newState:i})=>{if(!n.forcedReplay&&i.forcedReplay){const a=o.findSession();a&&(a.isReplayForced=!0)}}),{findTrackedSession:n=>{const i=o.findSession(n);if(!(!i||i.trackingType==="0"))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:o.expire,expireObservable:o.expireObservable,setForcedReplay:()=>o.updateSessionState({forcedReplay:"1"})}}function r6(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:wk("records")?1:0};return{findTrackedSession:()=>e,expire:_e,expireObservable:new he,setForcedReplay:_e}}function n6(e,t){return o6(t)?t:Xr(e.sessionSampleRate)?Xr(e.sessionReplaySampleRate)?"1":"2":"0"}function o6(e){return e==="0"||e==="1"||e==="2"}function i6(e,t,r,o,n,i){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const s=Sk({encoder:i(2),request:$m(a,r),flushController:kk({pageMayExitObservable:o,sessionExpireObservable:n})});return t.subscribe(13,c=>{c.type===te.VIEW?s.upsert(c,c.view.id):s.add(c)}),s}function a6(e){const t=yo();e.subscribe(13,r=>{t.send("rum",r)})}const s6=vn;function c6(e,t,r,o){const n=wo({expireDelay:s6});let i;e.subscribe(1,({startClocks:c})=>{const l=o.href;n.add(s({url:l,referrer:i||document.referrer}),c.relative),i=l}),e.subscribe(6,({endClocks:c})=>{n.closeActive(c.relative)});const a=r.subscribe(({newLocation:c})=>{const l=n.find();if(l){const u=_t();n.closeActive(u),n.add(s({url:c.href,referrer:l.referrer}),u)}});function s({url:c,referrer:l}){return{url:c,referrer:l}}return t.register(0,({startTime:c,eventType:l})=>{const u=n.find(c);return u?{type:l,view:{url:u.url,referrer:u.referrer}}:zr}),{findUrl:c=>n.find(c),stop:()=>{a.unsubscribe(),n.stop()}}}function l6(e,t){let r=oi(t);return new he(o=>{const{stop:n}=u6(e,a),{stop:i}=d6(e,a);function a(){if(r.href===t.href)return;const s=oi(t);o.notify({newLocation:s,oldLocation:r}),r=s}return()=>{n(),i()}})}function u6(e,t){const{stop:r}=Bt(lg("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=Bt(lg("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:n}=Oe(e,window,"popstate",t);return{stop:()=>{r(),o(),n()}}}function d6(e,t){return Oe(e,window,"hashchange",t)}function lg(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const f6=vn;function m6(e,t,r){const o=wo({expireDelay:f6});return e.subscribe(1,({startClocks:n})=>{o.add({},n.relative)}),e.subscribe(6,({endClocks:n})=>{o.closeActive(n.relative)}),t.register(0,({startTime:n,eventType:i})=>{if(!r.trackFeatureFlagsForEvents.concat([te.VIEW,te.ERROR]).includes(i))return wt;const s=o.find(n);return!s||Vr(s)?wt:{type:i,feature_flags:s}}),{addFeatureFlagEvaluation:(n,i)=>{const a=o.find();a&&(a[n]=i)}}}const p6=10*Ke;let Fn,xa;function h6(e,t,r){e.metricsEnabled&&(AE(),xa=!1,t.subscribe(13,()=>{xa=!0}),r.subscribe(({bytesCount:o,messagesCount:n})=>{xa&&(xa=!1,Fn.batchCount+=1,dg(Fn.batchBytesCount,o),dg(Fn.batchMessagesCount,n))}),po(g6,p6))}function g6(){Fn.batchCount!==0&&(ea("Customer data measures",Fn),AE())}function ug(){return{min:1/0,max:0,sum:0}}function dg(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function AE(){Fn={batchCount:0,batchBytesCount:ug(),batchMessagesCount:ug()}}const v6=4e3,y6=500,b6=vn;function _6(e,t,r=y6){const o=wo({expireDelay:b6,maxEntries:v6});let n;Zr(exports.RumPerformanceEntryType.VISIBILITY_STATE)&&performance.getEntriesByType(exports.RumPerformanceEntryType.VISIBILITY_STATE).forEach(l=>{const u=l.name==="hidden"?"hidden":"active";a(u,l.startTime)}),a(CE(),_t());const{stop:i}=gr(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],c=>{a(x6(c),c.timeStamp)},{capture:!0});function a(c,l=_t()){c!==n&&(n=c,o.closeActive(l),o.add({state:n,startTime:l},l))}function s(c,l,u){return o.findAll(l,u).some(d=>d.state===c)}return e.register(0,({startTime:c,duration:l=0,eventType:u})=>{if(u===te.VIEW){const d=o.findAll(c,l);return{type:u,_dd:{page_states:w6(d,c,r)}}}return u===te.ACTION||u===te.ERROR?{type:u,view:{in_foreground:s("active",c,0)}}:wt}),{wasInPageStateDuringPeriod:s,addPageState:a,stop:()=>{i(),o.stop()}}}function w6(e,t,r){if(e.length!==0)return e.slice(-r).reverse().map(({state:o,startTime:n})=>({state:o,start:oe(Ne(t,n))}))}function x6(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":CE()}function CE(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function S6(e,t){let r;const o=requestAnimationFrame(ne(()=>{r=Zc()})),n=OE(t).subscribe(i=>{r=i}).unsubscribe;return e.register(0,({eventType:i})=>({type:i,display:r?{viewport:r}:void 0})),{stop:()=>{n(),o&&cancelAnimationFrame(o)}}}function k6(e,t){const r=window.cookieStore?E6(e):T6;return new he(o=>r(t,n=>o.notify(n)))}function E6(e){return(t,r)=>Oe(e,window.cookieStore,"change",n=>{const i=n.changed.find(a=>a.name===t)||n.deleted.find(a=>a.name===t);i&&r(i.value)}).stop}const I6=Ke;function T6(e,t){const r=ii(document.cookie,e),o=po(()=>{const n=ii(document.cookie,e);n!==r&&t(n)},I6);return()=>{Nc(o)}}const fg="datadog-ci-visibility-test-execution-id";function $6(e,t,r=k6(e,fg)){var o;let n=Tr(fg)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=r.subscribe(a=>{n=a});return t.register(0,({eventType:a})=>typeof n!="string"?wt:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:n}}),{stop:()=>{i.unsubscribe()}}}function O6(e,t){const r=ir(t,{type:exports.RumPerformanceEntryType.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const n of o){const i=Hi(n.startTime),a={date:i.timeStamp,long_task:{id:et(),entry_type:zk.LONG_ANIMATION_FRAME,duration:oe(n.duration),blocking_duration:oe(n.blockingDuration),first_ui_event_timestamp:oe(n.firstUIEventTimestamp),render_start:oe(n.renderStart),style_and_layout_start:oe(n.styleAndLayoutStart),start_time:oe(n.startTime),scripts:n.scripts.map(s=>({duration:oe(s.duration),pause_duration:oe(s.pauseDuration),forced_style_and_layout_duration:oe(s.forcedStyleAndLayoutDuration),start_time:oe(s.startTime),execution_start:oe(s.executionStart),source_url:s.sourceURL,source_function_name:s.sourceFunctionName,source_char_position:s.sourceCharPosition,invoker:s.invoker,invoker_type:s.invokerType,window_attribution:s.windowAttribution}))},type:te.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:i.relative,duration:n.duration,domainContext:{performanceEntry:n}})}});return{stop:()=>r.unsubscribe()}}function A6(e,t){const r=ir(t,{type:exports.RumPerformanceEntryType.LONG_TASK,buffered:!0}).subscribe(o=>{for(const n of o){if(n.entryType!==exports.RumPerformanceEntryType.LONG_TASK||!t.trackLongTasks)break;const i=Hi(n.startTime),a={date:i.timeStamp,long_task:{id:et(),entry_type:zk.LONG_TASK,duration:oe(n.duration)},type:te.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:i.relative,duration:n.duration,domainContext:{performanceEntry:n}})}});return{stop(){r.unsubscribe()}}}function C6(e){e.register(0,({eventType:t})=>{if(!Ok())return wt;const r=Tk(),o=$k();return{type:t,session:{type:"synthetics"},synthetics:{test_id:r,result_id:o,injected:Ik()}}})}function N6(e,t,r){const o=Tm(e),n=r(o);return jc(t).forEach(([i,a])=>Zu(e,o,i.split(/\.|(?=\[\])/),a)),n}function Zu(e,t,r,o){const[n,...i]=r;if(n==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,s)=>Zu(a,t[s],i,o));return}if(!(!mg(e)||!mg(t))){if(i.length>0)return Zu(e[n],t[n],i,o);R6(e,n,t[n],o)}}function R6(e,t,r,o){const n=yn(r);n===o?e[t]=$e(r):o==="object"&&(n==="undefined"||n==="null")&&(e[t]={})}function mg(e){return yn(e)==="object"}const On={"view.name":"string","view.url":"string","view.referrer":"string"},An={context:"object"},Cn={service:"string",version:"string"};let NE;function P6(e,t,r,o,n){NE={[te.VIEW]:{"view.performance.lcp.resource_url":"string",...An,...On,...Cn},[te.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...An,...On,...Cn},[te.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...An,...On,...Cn},[te.ACTION]:{"action.target.name":"string",...An,...On,...Cn},[te.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...An,...On,...Cn},[te.VITAL]:{...An,...On,...Cn}};const i={[te.ERROR]:Nl(te.ERROR,o,n),[te.ACTION]:Nl(te.ACTION,o,n),[te.VITAL]:Nl(te.VITAL,o,n)};t.subscribe(12,({startTime:a,duration:s,rawRumEvent:c,domainContext:l})=>{const u=r.triggerHook(0,{eventType:c.type,startTime:a,duration:s});if(u===zr)return;const d=vr(u,c,{ddtags:Em(e).join(",")});j6(d,e.beforeSend,l,i)&&(Vr(d.context)&&delete d.context,t.notify(13,d))})}function j6(e,t,r,o){var n;if(t){const a=N6(e,NE[e.type],s=>t(s,r));if(a===!1&&e.type!==te.VIEW)return!1;a===!1&&Q.warn("Can't dismiss view events using beforeSend!")}return!((n=o[e.type])===null||n===void 0?void 0:n.isLimitReached())}function D6(e,t,r,o){e.register(0,({eventType:n,startTime:i})=>{const a=t.findTrackedSession(i),s=o.findView(i);if(!a||!s)return zr;let c,l,u;return n===te.VIEW?(c=r.getReplayStats(s.id)?!0:void 0,l=a.sessionReplay===1,u=s.sessionIsActive?void 0:!1):c=r.isRecording()?!0:void 0,{type:n,session:{id:a.id,type:"user",has_replay:c,sampled_for_replay:l,is_active:u}}}),e.register(1,({startTime:n})=>{const i=t.findTrackedSession(n);return i?{session:{id:i.id}}:wt})}function z6(e){e.register(0,({eventType:t})=>({type:t,connectivity:mk()}))}function M6(e,t,r){e.register(0,({eventType:o})=>{const n=t.source;return{type:o,_dd:{format_version:2,drift:MS(),configuration:{session_sample_rate:Bo(t.sessionSampleRate,3),session_replay_sample_rate:Bo(t.sessionReplaySampleRate,3),profiling_sample_rate:Bo(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:sn()?"6.24.1":void 0,sdk_name:r},application:{id:t.applicationId},date:Be(),source:n}}),e.register(1,()=>({application:{id:t.applicationId}}))}function U6(e,t){e.register(1,()=>t.isGranted()?wt:zr)}const L6=SD,F6=[te.ACTION,te.ERROR,te.LONG_TASK,te.RESOURCE,te.VITAL];function V6(e){return{addEvent:(t,r,o,n)=>{F6.includes(r.type)&&e.notify(12,{startTime:t,rawRumEvent:r,domainContext:o,duration:n})}}}function Z6(e,t){if(!t.metricsEnabled)return{stop:_e};const{unsubscribe:r}=e.subscribe(4,({initialViewMetrics:o})=>{!o.largestContentfulPaint||!o.navigationTimings||(ea("Initial view metrics",{metrics:B6(o.largestContentfulPaint,o.navigationTimings)}),r())});return{stop:r}}function B6(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function q6(e,t,r,o,n,i,a,s,c){const l=[],u=new _M,d=L6();u.subscribe(13,Fe=>Im("rum",Fe));const f=Fe=>{u.notify(14,{error:Fe}),_o("Error reported to customer",{"error.message":Fe.message})},m=_D(e),g=m.subscribe(Fe=>{u.notify(11,Fe)});l.push(()=>g.unsubscribe());const h=$D("browser-rum-sdk",e,d,f,m,n);l.push(h.stop);const y=sn()?r6():t6(e,u,i);if(sn())a6(u);else{const Fe=i6(e,u,f,m,y.expireObservable,n);l.push(()=>Fe.stop()),h6(h,u,Fe.flushController.flushObservable)}const b=vM(),w=l6(e,location),{observable:x,stop:v}=yM();l.push(v),M6(d,e,c);const k=_6(d,e),E=xM(u);l.push(()=>E.stop());const I=c6(u,d,w,location);l.push(()=>I.stop());const A=m6(u,d,e);D6(d,y,t,E),z6(d),U6(d,i);const M=kz(d,e,"rum"),U=Ez(d,e,y,"rum"),K=Sz(d,e,"rum"),{actionContexts:ge,addAction:q,addEvent:F,stop:ce}=G6(u,d,e,k,b,x,f);l.push(ce);const{addTiming:le,startView:pe,setViewName:G,setViewContext:se,setViewContextProperty:V,getViewContext:ye,stop:ue}=YU(u,d,e,location,b,x,w,t,E,o);l.push(ue);const{stop:ve}=Z6(u,h);l.push(ve);const{stop:P}=X4(u,e,k);if(l.push(P),e.trackLongTasks)if(Zr(exports.RumPerformanceEntryType.LONG_ANIMATION_FRAME)){const{stop:Fe}=O6(u,e);l.push(Fe)}else A6(u,e);const{addError:H}=M4(u,e,s);s.unbuffer(),MM(u,e,y,U,K);const me=Az(u,k,a),Te=bM(e.applicationId,y,E,ge,I);return l.push(()=>r.stop()),{addAction:q,addEvent:F,addError:H,addTiming:le,addFeatureFlagEvaluation:A.addFeatureFlagEvaluation,startView:pe,setViewContext:se,setViewContextProperty:V,getViewContext:ye,setViewName:G,lifeCycle:u,viewHistory:E,session:y,stopSession:()=>y.expire(),getInternalContext:Te.get,startDurationVital:me.startDurationVital,stopDurationVital:me.stopDurationVital,addDurationVital:me.addDurationVital,addOperationStepVital:me.addOperationStepVital,globalContext:M,userContext:U,accountContext:K,telemetry:h,stop:()=>{l.forEach(Fe=>Fe())},hooks:d}}function G6(e,t,r,o,n,i,a){const s=j4(e,t,n,i,r),c=V6(e),l=S6(t,r),u=$6(r,t);return C6(t),P6(r,e,t,a),{pageStateHistory:o,addAction:s.addAction,addEvent:c.addEvent,actionContexts:s.actionContexts,stop:()=>{s.stop(),u.stop(),l.stop(),o.stop()}}}function H6(e,{session:t,viewContext:r,errorType:o}){const n=t?t.id:"no-session-id",i=[];o!==void 0&&i.push(`error-type=${o}`),r&&(i.push(`seed=${r.id}`),i.push(`from=${r.startClocks.timeStamp}`));const a=W6(e),s=`/rum/replay/sessions/${n}`;return`${a}${s}?${i.join("&")}`}function W6(e){const t=e.site,r=e.subdomain||J6(e);return`https://${r?`${r}.`:""}${t}`}function J6(e){switch(e.site){case Qr:case n2:return"app";case tk:return"dd";default:return}}const K6=1e3;let $t;function Y6(e){return Bc(e).segments_count}function X6(e){Bc(e).segments_count+=1}function Q6(e){Bc(e).records_count+=1}function eL(e,t){Bc(e).segments_total_raw_size+=t}function tL(e){return $t?.get(e)}function Bc(e){$t||($t=new Map);let t;return $t.has(e)?t=$t.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},$t.set(e,t),$t.size>K6&&rL()),t}function rL(){if(!$t)return;const e=$t.keys().next().value;e&&$t.delete(e)}function RE(e,t,r){let o=0,n=[],i,a=!0,s=0;const c=[],{stop:l}=Oe(e,t,"message",({data:f})=>{if(f.type!=="wrote"||f.streamId!==r)return;const m=c[0];m&&(m.id===f.id?(c.shift(),o+=f.additionalBytesCount,n.push(f.result),i=f.trailer,m.writeCallback?m.writeCallback(f.result.byteLength):m.finishCallback&&m.finishCallback()):m.id<f.id&&l())});function u(){const f=n.length===0?new Uint8Array(0):ck(n.concat(i)),m={rawBytesCount:o,output:f,outputBytesCount:f.byteLength,encoding:"deflate"};return o=0,n=[],m}function d(){a||(t.postMessage({action:"reset",streamId:r}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(f,m){t.postMessage({action:"write",id:s,data:f,streamId:r}),c.push({id:s,writeCallback:m,data:f}),a=!1,s+=1},finish(f){d(),c.length?(c.forEach(m=>{delete m.writeCallback}),c[c.length-1].finishCallback=()=>f(u())):f(u())},finishSync(){d();const f=c.map(m=>m.data).join("");return c.length=0,{...u(),pendingData:f}},estimateEncodedBytesCount(f){return f.length/8},stop(){l()}}}function Mm({configuredUrl:e,error:t,source:r,scriptType:o}){if(Q.error(`${r} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&nL(t.message)){let n;e?n=`Please make sure the ${o} URL ${e} is correct and CSP is correctly configured.`:n="Please make sure CSP is correctly configured.",Q.error(`${n} See documentation at ${Ac}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&Om(t)}function nL(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const oL=30*Ke;function PE(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([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]),n=new Uint8Array([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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.1"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let Re={status:0};function jE(e,t,r,o=PE){switch(Re.status===0&&iL(e,t,o),Re.status){case 1:return Re.initializationFailureCallbacks.push(r),Re.worker;case 3:return Re.worker}}function pg(){return Re.status}function iL(e,t,r=PE){try{const o=r(e),{stop:n}=Oe(e,o,"error",s=>{Zl(e,t,s)}),{stop:i}=Oe(e,o,"message",({data:s})=>{s.type==="errored"?Zl(e,t,s.error,s.streamId):s.type==="initialized"&&sL(s.version)});o.postMessage({action:"init"}),Je(()=>aL(t),oL),Re={status:1,worker:o,stop:()=>{n(),i()},initializationFailureCallbacks:[]}}catch(o){Zl(e,t,o)}}function aL(e){Re.status===1&&(Q.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Re.initializationFailureCallbacks.forEach(t=>t()),Re={status:2})}function sL(e){Re.status===1&&(Re={status:3,worker:Re.worker,stop:Re.stop,version:e})}function Zl(e,t,r,o){Re.status===1||Re.status===0?(Mm({configuredUrl:e.workerUrl,error:r,source:t,scriptType:"worker"}),Re.status===1&&Re.initializationFailureCallbacks.forEach(n=>n()),Re={status:2}):Om(r,{worker_version:Re.status===3&&Re.version,stream_id:o})}function DE(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function cL(e,t,r,o){const n=t.findTrackedSession(),i=lL(n,o),a=r.findView();return H6(e,{viewContext:a,errorType:i,session:n})}function lL(e,t){if(!DE())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function uL(e,t){if(!e.metricsEnabled)return{stop:_e};let r,o,n;const{unsubscribe:i}=t.subscribe(a=>{switch(a.type){case"start":r={forced:a.forced,timestamp:Be()},o=void 0,n=void 0;break;case"document-ready":r&&(o=Ne(r.timestamp,Be()));break;case"recorder-settled":r&&(n=Ne(r.timestamp,Be()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":i(),r&&ea("Recorder init metrics",{metrics:dL(r.forced,n,Ne(r.timestamp,Be()),a.type,o)});break}});return{stop:i}}function dL(e,t,r,o,n){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:r,result:o,waitForDocReadyDuration:n}}function fL(e,t,r,o,n,i,a){let s=0,c;t.subscribe(9,()=>{(s===2||s===3)&&(f(),s=1)}),t.subscribe(10,()=>{s===1&&d()});const l=new he;uL(a,l);const u=async m=>{l.notify({type:"start",forced:m});const[g]=await Promise.all([hg(l,{type:"recorder-settled"},n()),hg(l,{type:"document-ready"},XD(e,"interactive"))]);if(s!==2){l.notify({type:"aborted"});return}if(!g){s=0,l.notify({type:"recorder-load-failed"});return}const h=i();if(!h){s=0,l.notify({type:"deflate-encoder-load-failed"});return}({stop:c}=g(t,e,r,o,h,a)),s=3,l.notify({type:"succeeded"})};function d(m){const g=r.findTrackedSession();if(mL(g,m)){s=1;return}if(pL(s))return;s=2;const h=hL(g,m)||!1;u(h).catch(pr),h&&r.setForcedReplay()}function f(){s===3&&c?.(),s=0}return{start:d,stop:f,getSessionReplayLink(){return cL(e,r,o,s!==0)},isRecording:()=>s===3}}function mL(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function pL(e){return e===2||e===3}function hL(e,t){return t&&t.force&&e.sessionReplay===0}async function hg(e,t,r){try{return await r}finally{e.notify(t)}}function gL(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:_e},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function vL(e,t){if(sn()&&!wk("records")||!DE())return{start:_e,stop:_e,getReplayStats:()=>{},onRumStart:_e,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:r,shouldStartImmediately:o}=gL();return{start:i=>r.start(i),stop:()=>r.stop(),getSessionReplayLink:()=>r.getSessionReplayLink(),onRumStart:n,isRecording:()=>pg()===3&&r.isRecording(),getReplayStats:i=>pg()===3?tL(i):void 0};function n(i,a,s,c,l,u){let d;function f(){return d||(l??(l=jE(a,"Datadog Session Replay",()=>{r.stop()},t)),l&&(d=RE(a,l,1))),d}r=fL(a,i,s,c,e,f,u),o(a)&&r.start()}}async function yL(e=bL){try{return await e()}catch(t){Mm({error:t,source:"Recorder",scriptType:"module"})}}async function bL(){return(await Promise.resolve().then(()=>require("./startRecording-DnKfQvrb.cjs"))).startRecording}function _L(){return It().Profiler!==void 0}const wL=e=>{let t={status:"starting"};return e.register(0,({eventType:r})=>r!==te.VIEW&&r!==te.LONG_TASK?wt:{type:r,_dd:{profiling:t}}),{get:()=>t,set:r=>{t=r}}};async function xL(e=SL){try{return await e()}catch(t){Mm({error:t,source:"Profiler",scriptType:"module"})}}async function SL(){return(await Promise.resolve().then(()=>require("./profiler-DxZ_V4Bm.cjs"))).createRumProfiler}function kL(){let e;function t(r,o,n,i,a,s){const c=i.findTrackedSession();if(!c||!Fk(c.id,n.profilingSampleRate))return;const l=wL(o);if(!_L()){l.set({status:"error",error_reason:"not-supported-by-browser"});return}xL().then(u=>{if(!u){_o("[DD_RUM] Failed to lazy load the RUM Profiler"),l.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=u(n,r,i,l,s),e.start(a.findView())}).catch(pr)}return{onRumStart:t,stop:()=>{e?.stop().catch(pr)}}}const EL=vL(yL),IL=kL(),Ho=hM(q6,EL,IL,{startDeflateWorker:jE,createDeflateEncoder:RE,sdkName:"rum"});K2(It(),"DD_RUM",Ho);const Sa={applicationId:"0b0a19b9-099b-4812-b342-930518330975",clientToken:"puba92c09799d321f572535176e9fe08256",site:"datadoghq.com",service:"gram-elements"};let Bu=!1,qu=!0;function TL(e={}){if(e.enabled===!1){qu=!1;return}if(!Bu)try{Ho.init({applicationId:Sa.applicationId,clientToken:Sa.clientToken,site:Sa.site,service:Sa.service,env:process.env.NODE_ENV||"production",sessionSampleRate:100,sessionReplaySampleRate:100,trackUserInteractions:!0,trackResources:!0,trackLongTasks:!0,defaultPrivacyLevel:"mask"}),e.projectSlug&&Ho.setGlobalContextProperty("projectSlug",e.projectSlug),e.variant&&Ho.setGlobalContextProperty("variant",e.variant),Bu=!0}catch(t){console.warn("[Elements] Failed to initialize Datadog RUM:",t),qu=!1}}function hs(e,t){if(!qu||!Bu)return;const r=e instanceof Error?e:new Error(String(e));try{Ho.addError(r,{...t,timestamp:new Date().toISOString()})}catch(o){console.warn("[Elements] Failed to track error:",o)}}const Um=["anthropic/claude-sonnet-4.5","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4","anthropic/claude-opus-4.5","openai/gpt-4o","openai/gpt-4o-mini","openai/gpt-5.1-codex","openai/gpt-5","openai/gpt-5.1","openai/gpt-4.1","anthropic/claude-3.7-sonnet","anthropic/claude-opus-4","google/gemini-2.5-pro-preview","google/gemini-3-pro-preview","moonshotai/kimi-k2","mistralai/mistral-medium-3","mistralai/mistral-medium-3.1","mistralai/codestral-2501"],$L=e=>Object.fromEntries(Object.entries(e).map(([t,r])=>[t,{...r.description?{description:r.description}:void 0,parameters:r.parameters instanceof ch.ZodType?ch.toJSONSchema(r.parameters):r.parameters}])),OL=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>!t.disabled&&t.type!=="backend"));let gs=null;function AL(e,t){const r=zE(t);gs={helpers:e,requiresApproval:r}}function CL(){gs=null}function zE(e){if(!e)return()=>!1;if(typeof e=="function")return r=>e({toolName:r});const t=new Set(e);return r=>t.has(r)}const NL=(e,t)=>z.makeAssistantTool({...e,execute:async(r,o)=>{if(gs?.requiresApproval(t)){const{helpers:n}=gs,i=o.toolCallId??"";if(!n.isToolApproved(t)&&!await n.requestApproval(t,i,r))return{content:[{type:"text",text:`Tool "${t}" execution was denied by the user. Please acknowledge this and continue without using this tool's result.`}],isError:!0}}return e.execute?.(r,o)},toolName:t});function RL(e,t,r){if(!t||Array.isArray(t)&&t.length===0)return e;const o=zE(t);return Object.fromEntries(Object.entries(e).map(([n,i])=>{if(!o(n))return[n,i];const a=i.execute;return a?[n,{...i,execute:async(s,c)=>{const l=c??{},u=l.toolCallId??"";return r.isToolApproved(n)||await r.requestApproval(n,u,s)?a(s,l):{content:[{type:"text",text:`Tool "${n}" execution was denied by the user. Please acknowledge this and continue without using this tool's result.`}],isError:!0}}}]:[n,i]}))}const PL=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],jL=$.createLucideIcon("arrow-down",PL);const DL=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],zL=$.createLucideIcon("arrow-up",DL);const ML=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],UL=$.createLucideIcon("brain",ML);const LL=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Nr=$.createLucideIcon("check",LL);const FL=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vs=$.createLucideIcon("chevron-down",FL);const VL=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ZL=$.createLucideIcon("chevron-left",VL);const BL=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ME=$.createLucideIcon("chevron-right",BL);const qL=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Lm=$.createLucideIcon("copy",qL);const GL=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],HL=$.createLucideIcon("file-text",GL);const WL=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],JL=$.createLucideIcon("link",WL);const KL=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],ys=$.createLucideIcon("loader",KL);const YL=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],XL=$.createLucideIcon("maximize",YL);const QL=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],e5=$.createLucideIcon("message-circle",QL);const t5=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],r5=$.createLucideIcon("minimize",t5);const n5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],o5=$.createLucideIcon("panel-right-close",n5);const i5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],a5=$.createLucideIcon("panel-right-open",i5);const s5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],c5=$.createLucideIcon("pencil",s5);const l5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],UE=$.createLucideIcon("plus",l5);const u5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],d5=$.createLucideIcon("settings-2",u5);const f5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],m5=$.createLucideIcon("square",f5);const p5=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],LE=$.createLucideIcon("wrench",p5);const h5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xo=$.createLucideIcon("x",h5);var g5=Object.defineProperty,v5=Object.defineProperties,y5=Object.getOwnPropertyDescriptors,gg=Object.getOwnPropertySymbols,b5=Object.prototype.hasOwnProperty,_5=Object.prototype.propertyIsEnumerable,vg=(e,t,r)=>t in e?g5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xe=(e,t)=>{for(var r in t||(t={}))b5.call(t,r)&&vg(e,r,t[r]);if(gg)for(var r of gg(t))_5.call(t,r)&&vg(e,r,t[r]);return e},bs=(e,t)=>v5(e,y5(t)),FE="vercel.ai.error",w5=Symbol.for(FE),VE,x5=class ZE extends Error{constructor({name:t,message:r,cause:o}){super(r),this[VE]=!0,this.name=t,this.cause=o}static isInstance(t){return ZE.hasMarker(t,FE)}static hasMarker(t,r){const o=Symbol.for(r);return t!=null&&typeof t=="object"&&o in t&&typeof t[o]=="boolean"&&t[o]===!0}};VE=w5;var ze=x5,BE="AI_APICallError",qE=`vercel.ai.error.${BE}`,S5=Symbol.for(qE),GE,Zt=class extends ze{constructor({message:e,url:t,requestBodyValues:r,statusCode:o,responseHeaders:n,responseBody:i,cause:a,isRetryable:s=o!=null&&(o===408||o===409||o===429||o>=500),data:c}){super({name:BE,message:e,cause:a}),this[GE]=!0,this.url=t,this.requestBodyValues=r,this.statusCode=o,this.responseHeaders=n,this.responseBody=i,this.isRetryable=s,this.data=c}static isInstance(e){return ze.hasMarker(e,qE)}};GE=S5;var HE="AI_EmptyResponseBodyError",WE=`vercel.ai.error.${HE}`,k5=Symbol.for(WE),JE,E5=class extends ze{constructor({message:e="Empty response body"}={}){super({name:HE,message:e}),this[JE]=!0}static isInstance(e){return ze.hasMarker(e,WE)}};JE=k5;function KE(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var YE="AI_InvalidArgumentError",XE=`vercel.ai.error.${YE}`,I5=Symbol.for(XE),QE,eI=class extends ze{constructor({message:t,cause:r,argument:o}){super({name:YE,message:t,cause:r}),this[QE]=!0,this.argument=o}static isInstance(t){return ze.hasMarker(t,XE)}};QE=I5;var tI="AI_InvalidPromptError",rI=`vercel.ai.error.${tI}`,T5=Symbol.for(rI),nI,$5=class extends ze{constructor({prompt:e,message:t,cause:r}){super({name:tI,message:`Invalid prompt: ${t}`,cause:r}),this[nI]=!0,this.prompt=e}static isInstance(e){return ze.hasMarker(e,rI)}};nI=T5;var oI="AI_InvalidResponseDataError",iI=`vercel.ai.error.${oI}`,O5=Symbol.for(iI),aI,Mo=class extends ze{constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:oI,message:t}),this[aI]=!0,this.data=e}static isInstance(e){return ze.hasMarker(e,iI)}};aI=O5;var sI="AI_JSONParseError",cI=`vercel.ai.error.${sI}`,A5=Symbol.for(cI),lI,_s=class extends ze{constructor({text:e,cause:t}){super({name:sI,message:`JSON parsing failed: Text: ${e}.
37
+ `,r:"\r",t:" "};function rM(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):tM[e]}const nM="v1",oM=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function iM(e,t){let r;const o=sM(),n=await dM(e);return n.ok?(o.increment("fetch","success"),r=aM(e,n.value,t,o)):(o.increment("fetch","failure"),Q.error(n.error)),ea("remote configuration metrics",{metrics:o.get()}),r}function aM(e,t,r,o){const n={...e};return oM.forEach(f=>{f in t&&(n[f]=i(t[f]))}),Object.keys(r).forEach(f=>{t[f]!==void 0&&a(r[f],t[f])}),n;function i(f){if(Array.isArray(f))return f.map(i);if(cM(f)){if(lM(f)){const m=f.rcSerializedType;switch(m){case"string":return f.value;case"regex":return qk(f.value);case"dynamic":return s(f);default:Q.error(`Unsupported remote configuration: "rcSerializedType": "${m}"`);return}}return NS(f,i)}return f}function a(f,m){m.forEach(({key:g,value:h})=>{f.setContextProperty(g,i(h))})}function s(f){const m=f.strategy;let g;switch(m){case"cookie":g=c(f);break;case"dom":g=l(f);break;case"js":g=d(f);break;default:Q.error(`Unsupported remote configuration: "strategy": "${m}"`);return}const h=f.extractor;return h!==void 0&&typeof g=="string"?uM(h,g):g}function c({name:f}){const m=Pc(f);return o.increment("cookie",m!==void 0?"success":"missing"),m}function l({selector:f,attribute:m}){let g;try{g=document.querySelector(f)}catch{Q.error(`Invalid selector in the remote configuration: '${f}'`),o.increment("dom","failure");return}if(!g){o.increment("dom","missing");return}if(u(g,m)){Q.error(`Forbidden element selected by the remote configuration: '${f}'`),o.increment("dom","failure");return}const h=m!==void 0?g.getAttribute(m):g.textContent;if(h===null){o.increment("dom","missing");return}return o.increment("dom","success"),h}function u(f,m){return f.getAttribute("type")==="password"&&m==="value"}function d({path:f}){let m=window;const g=qz(f);if(g.length===0){Q.error(`Invalid JSON path in the remote configuration: '${f}'`),o.increment("js","failure");return}for(const h of g){if(!(h in m)){o.increment("js","missing");return}try{m=m[h]}catch(y){Q.error(`Error accessing: '${f}'`,y),o.increment("js","failure");return}}return o.increment("js","success"),m}}function sM(){const e={fetch:{}};return{get:()=>e,increment:(t,r)=>{e[t]||(e[t]={}),e[t][r]||(e[t][r]=0),e[t][r]=e[t][r]+1}}}function cM(e){return typeof e=="object"&&e!==null}function lM(e){return"rcSerializedType"in e}function qk(e){try{return new RegExp(e)}catch{Q.error(`Invalid regex in the remote configuration: '${e}'`)}}function uM(e,t){const r=qk(e.value);if(r===void 0)return;const o=r.exec(t);if(o===null)return;const[n,i]=o;return i||n}async function dM(e){let t;try{t=await fetch(fM(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const r=await t.json();return r.rum?{ok:!0,value:r.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function fM(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${rk("rum",e)}/${nM}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function mM({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},r,o,n){const i=yz(),a=jk();zl(a,Ze.globalContext,i);const s=Dk();zl(s,Ze.userContext,i);const c=Pk();zl(c,Ze.accountContext,i);let l,u,d,f;const m=r.observable.subscribe(h),g={};function h(){if(!d||!f||!r.isGranted())return;m.unsubscribe();let v;if(f.trackViewsManually){if(!l)return;i.remove(l.callback),v=l.options}const k=n(f,u,v);i.drain(k)}function y(v,k){const E=sn();if(E&&(v=pM(v)),d=v,RD(Bz(v)),f){uk("DD_RUM",v);return}const I=Mz(v,k);if(I){if(!E&&!I.sessionStoreStrategyType){Q.warn("No storage available for session. We will not send any data.");return}I.compressIntakeRequests&&!E&&t&&(u=t(I,"Datadog RUM",_e),!u)||(f=I,Nk().subscribe(_e),r.tryToInit(I.trackingConsent),h())}}const b=v=>{i.add(k=>k.addDurationVital(v))};return{init(v,k,E){if(!v){Q.error("Missing configuration");return}v2(v.enableExperimentalFeatures),d=v,!(e&&Ik())&&(Lk(v.plugins,"onInit",{initConfiguration:v,publicApi:k}),v.remoteConfigurationId?iM(v,{user:s,context:a}).then(I=>{I&&y(I,E)}).catch(pr):y(v,E))},get initConfiguration(){return d},getInternalContext:_e,stopSession:_e,addTiming(v,k=Be()){i.add(E=>E.addTiming(v,k))},startView(v,k=Ue()){const E=I=>{I.startView(v,k)};i.add(E),l||(l={options:v,callback:E},h())},setViewName(v){i.add(k=>k.setViewName(v))},setViewContext(v){i.add(k=>k.setViewContext(v))},setViewContextProperty(v,k){i.add(E=>E.setViewContextProperty(v,k))},getViewContext:()=>g,globalContext:a,userContext:s,accountContext:c,addAction(v){i.add(k=>k.addAction(v))},addError(v){i.add(k=>k.addError(v))},addFeatureFlagEvaluation(v,k){i.add(E=>E.addFeatureFlagEvaluation(v,k))},startDurationVital(v,k){return Mk(o,v,k)},stopDurationVital(v,k){Uk(b,o,v,k)},addDurationVital:b,addOperationStepVital:(v,k,E,I)=>{i.add(A=>A.addOperationStepVital($e(v),k,$e(E),$e(I)))}}}function pM(e){var t,r;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(r=yo())===null||r===void 0?void 0:r.getPrivacyLevel()}}function zl(e,t,r){e.changeObservable.subscribe(()=>{const o=e.getContext();r.add(n=>n[t].setContext(o))})}function hM(e,t,r,o={}){const n=Kj(),i=Oz(),a=Tz().observable;let s=mM(o,n,i,(d,f,m)=>{const g=f&&o.createDeflateEncoder?y=>o.createDeflateEncoder(d,f,y):JD,h=e(d,t,r,m,g,n,i,a,o.sdkName);return t.onRumStart(h.lifeCycle,d,h.session,h.viewHistory,f,h.telemetry),r.onRumStart(h.lifeCycle,h.hooks,d,h.session,h.viewHistory,g),s=gM(s,h),Lk(d.plugins,"onRumStart",{strategy:s,addEvent:h.addEvent}),h});const c=()=>s,l=ne(d=>{const f=typeof d=="object"?d:{name:d};s.startView(f),Ve({feature:"start-view"})}),u=J2({init:d=>{const f=new Error().stack;Ar(()=>s.init(d,u,f))},setTrackingConsent:ne(d=>{n.update(d),Ve({feature:"set-tracking-consent",tracking_consent:d})}),setViewName:ne(d=>{s.setViewName(d),Ve({feature:"set-view-name"})}),setViewContext:ne(d=>{s.setViewContext(d),Ve({feature:"set-view-context"})}),setViewContextProperty:ne((d,f)=>{s.setViewContextProperty(d,f),Ve({feature:"set-view-context-property"})}),getViewContext:ne(()=>(Ve({feature:"set-view-context-property"}),s.getViewContext())),getInternalContext:ne(d=>s.getInternalContext(d)),getInitConfiguration:ne(()=>Tm(s.initConfiguration)),addAction:(d,f)=>{const m=fs("action");Ar(()=>{s.addAction({name:$e(d),context:$e(f),startClocks:Ue(),type:Lc.CUSTOM,handlingStack:m}),Ve({feature:"add-action"})})},addError:(d,f)=>{const m=fs("error");Ar(()=>{s.addError({error:d,handlingStack:m,context:$e(f),startClocks:Ue()}),Ve({feature:"add-error"})})},addTiming:ne((d,f)=>{s.addTiming($e(d),f)}),setGlobalContext:rt(c,Ze.globalContext,nt.setContext,"set-global-context"),getGlobalContext:rt(c,Ze.globalContext,nt.getContext,"get-global-context"),setGlobalContextProperty:rt(c,Ze.globalContext,nt.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:rt(c,Ze.globalContext,nt.removeContextProperty,"remove-global-context-property"),clearGlobalContext:rt(c,Ze.globalContext,nt.clearContext,"clear-global-context"),setUser:rt(c,Ze.userContext,nt.setContext,"set-user"),getUser:rt(c,Ze.userContext,nt.getContext,"get-user"),setUserProperty:rt(c,Ze.userContext,nt.setContextProperty,"set-user-property"),removeUserProperty:rt(c,Ze.userContext,nt.removeContextProperty,"remove-user-property"),clearUser:rt(c,Ze.userContext,nt.clearContext,"clear-user"),setAccount:rt(c,Ze.accountContext,nt.setContext,"set-account"),getAccount:rt(c,Ze.accountContext,nt.getContext,"get-account"),setAccountProperty:rt(c,Ze.accountContext,nt.setContextProperty,"set-account-property"),removeAccountProperty:rt(c,Ze.accountContext,nt.removeContextProperty,"remove-account-property"),clearAccount:rt(c,Ze.accountContext,nt.clearContext,"clear-account"),startView:l,stopSession:ne(()=>{s.stopSession(),Ve({feature:"stop-session"})}),addFeatureFlagEvaluation:ne((d,f)=>{s.addFeatureFlagEvaluation($e(d),$e(f)),Ve({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:ne(()=>t.getSessionReplayLink()),startSessionReplayRecording:ne(d=>{t.start(d),Ve({feature:"start-session-replay-recording",force:d&&d.force})}),stopSessionReplayRecording:ne(()=>t.stop()),addDurationVital:ne((d,f)=>{Ve({feature:"add-duration-vital"}),s.addDurationVital({name:$e(d),type:ci.DURATION,startClocks:uj(f.startTime),duration:f.duration,context:$e(f&&f.context),description:$e(f&&f.description)})}),startDurationVital:ne((d,f)=>(Ve({feature:"start-duration-vital"}),s.startDurationVital($e(d),{context:$e(f&&f.context),description:$e(f&&f.description)}))),stopDurationVital:ne((d,f)=>{Ve({feature:"stop-duration-vital"}),s.stopDurationVital(typeof d=="string"?$e(d):d,{context:$e(f&&f.context),description:$e(f&&f.description)})}),startFeatureOperation:ne((d,f)=>{Ve({feature:"add-operation-step-vital",action_type:"start"}),s.addOperationStepVital(d,"start",f)}),succeedFeatureOperation:ne((d,f)=>{Ve({feature:"add-operation-step-vital",action_type:"succeed"}),s.addOperationStepVital(d,"end",f)}),failFeatureOperation:ne((d,f,m)=>{Ve({feature:"add-operation-step-vital",action_type:"fail"}),s.addOperationStepVital(d,"end",m,f)})});return u}function gM(e,t){return{init:r=>{uk("DD_RUM",r)},initConfiguration:e.initConfiguration,...t}}function vM(){const e=Gk();return new he(t=>{if(!e)return;const r=new e(ne(o=>t.notify(o)));return r.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>r.disconnect()})}function Gk(){let e;const t=window;if(t.Zone&&(e=jr(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const r=new t.MutationObserver(_e),o=jr(r,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function yM(){const e=new he,{stop:t}=Bt(window,"open",()=>e.notify());return{observable:e,stop:t}}function bM(e,t,r,o,n){return{get:i=>{const a=r.findView(i),s=n.findUrl(i),c=t.findTrackedSession(i);if(c&&a&&s){const l=o.findActionId(i);return{application_id:e,session_id:c.id,user_action:l?{id:l}:void 0,view:{id:a.id,name:a.name,referrer:s.referrer,url:s.url}}}}}}const _M=KD,wM=vn;function xM(e){const t=wo({expireDelay:wM});e.subscribe(1,o=>{t.add(r(o),o.startClocks.relative)}),e.subscribe(6,({endClocks:o})=>{t.closeActive(o.relative)}),e.subscribe(3,o=>{const n=t.find(o.startClocks.relative);n&&(o.name&&(n.name=o.name),o.context&&(n.context=o.context),n.sessionIsActive=o.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function r(o){return{service:o.service,version:o.version,context:o.context,id:o.id,name:o.name,startClocks:o.startClocks}}return{findView:o=>t.find(o),stop:()=>{t.stop()}}}const Hk="initial_document",SM=[[at.DOCUMENT,e=>Hk===e],[at.XHR,e=>e==="xmlhttprequest"],[at.FETCH,e=>e==="fetch"],[at.BEACON,e=>e==="beacon"],[at.CSS,(e,t)=>/\.css$/i.test(t)],[at.JS,(e,t)=>/\.js$/i.test(t)],[at.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[at.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[at.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function kM(e){const t=e.name;if(!bj(t))return at.OTHER;const r=_j(t);for(const[o,n]of SM)if(n(e.initiatorType,r))return o;return at.OTHER}function Bh(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Wk(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function EM(e){const{duration:t,startTime:r,responseEnd:o}=e;return t===0&&r<o?Ne(r,o):t}function IM(e){if(!Kk(e))return;const{startTime:t,fetchStart:r,workerStart:o,redirectStart:n,redirectEnd:i,domainLookupStart:a,domainLookupEnd:s,connectStart:c,secureConnectionStart:l,connectEnd:u,requestStart:d,responseStart:f,responseEnd:m}=e,g={download:qr(t,f,m),first_byte:qr(t,d,f)};return 0<o&&o<r&&(g.worker=qr(t,o,r)),r<u&&(g.connect=qr(t,c,u),c<=l&&l<=u&&(g.ssl=qr(t,l,u))),r<s&&(g.dns=qr(t,a,s)),t<i&&(g.redirect=qr(t,n,i)),g}function Jk(e){return e.duration>=0}function Kk(e){const t=Bh(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),r=TM(e)?Bh(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&r}function TM(e){return e.redirectEnd>e.startTime}function qr(e,t,r){if(e<=t&&t<=r)return{duration:oe(Ne(t,r)),start:oe(Ne(e,t))}}function $M(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function OM(e){return e.deliveryType===""?"other":e.deliveryType}function AM(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:r,transferSize:o}=e;return{size:r,encoded_body_size:t,decoded_body_size:r,transfer_size:o}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function Rm(e){return e&&(!m2(e)||Yi(Dr.TRACK_INTAKE_REQUESTS))}const CM=/data:(.+)?(;base64)?,/g,NM=24e3;function Yk(e,t=NM){if(e.length<=t||!e.startsWith("data:"))return e;const r=e.substring(0,100).match(CM);return r?`${r[0]}[...]`:e}const RM=32*bn;function PM(e,t){const r=DM(e.requestBody,t.trackPayload);if(r){if(t.trackResponseErrors&&e.responseBody){const o=jM(e.responseBody);o&&(r.errors_count=o.length,r.errors=o)}return r}}function jM(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const r=t;return rn(r.errors)?r.errors.map(n=>{var i;return{message:n.message,path:n.path,locations:n.locations,code:(i=n.extensions)===null||i===void 0?void 0:i.code}}):void 0}function Xk(e,t){return t.allowedGraphQlUrls.find(r=>zc([r.match],e))}function DM(e,t=!1){if(!e||typeof e!="string")return;let r;try{r=JSON.parse(e)}catch{return}if(!r||!r.query)return;const o=r.query.trim(),n=zM(o),i=r.operationName;if(!n)return;let a;return r.variables&&(a=JSON.stringify(r.variables)),{operationType:n,operationName:i,variables:a,payload:t?_m(o,RM,"..."):void 0}}function zM(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let qh=1;function MM(e,t,r,o,n){const i=Dz(t,r,o,n);UM(e,t,i),LM(e,t,i)}function UM(e,t,r){const o=QD(t).subscribe(n=>{const i=n;if(Rm(i.url))switch(i.state){case"start":r.traceXhr(i,i.xhr),i.requestIndex=Qk(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":r.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:Uc.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack,requestBody:i.requestBody,responseBody:i.responseBody});break}});return{stop:()=>o.unsubscribe()}}function LM(e,t,r){const o=Nk({responseBodyAction:n=>{var i;return!((i=Xk(n.url,t))===null||i===void 0)&&i.trackResponseErrors?2:1}}).subscribe(n=>{var i;const a=n;if(Rm(a.url))switch(a.state){case"start":r.traceFetch(a),a.requestIndex=Qk(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":r.clearTracingIfNeeded(a),e.notify(8,{duration:Ne(a.startClocks.timeStamp,Be()),method:a.method,requestIndex:a.requestIndex,responseType:a.responseType,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:Uc.FETCH,url:a.url,response:a.response,init:a.init,input:a.input,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:(i=a.init)===null||i===void 0?void 0:i.body,responseBody:a.responseBody});break}});return{stop:()=>o.unsubscribe()}}function Qk(){const e=qh;return qh+=1,e}function eE(e){return Gi(e)&&e<0?void 0:e}function tE({lifeCycle:e,isChildEvent:t,onChange:r=_e}){const o={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},n=e.subscribe(13,i=>{var a;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case te.ERROR:o.errorCount+=1,r();break;case te.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),r();break;case te.LONG_TASK:o.longTaskCount+=1,r();break;case te.RESOURCE:!((a=i._dd)===null||a===void 0)&&a.discarded||(o.resourceCount+=1,r());break}});return{stop:()=>{n.unsubscribe()},eventCounts:o}}function FM(e,t){const r=ct();let o=!1;const{stop:n}=gr(e,window,["click","mousedown","keydown","touchstart","pointerdown"],s=>{if(!s.cancelable)return;const c={entryType:"first-input",processingStart:_t(),processingEnd:_t(),startTime:s.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};s.type==="pointerdown"?i(e,c):a(c)},{passive:!0,capture:!0});return{stop:n};function i(s,c){gr(s,window,["pointerup","pointercancel"],l=>{l.type==="pointerup"&&a(c)},{once:!0})}function a(s){if(!o){o=!0,n();const c=s.processingStart-s.startTime;c>=0&&c<ct()-r&&t(s)}}}exports.RumPerformanceEntryType=void 0;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(exports.RumPerformanceEntryType||(exports.RumPerformanceEntryType={}));function ir(e,t){return new he(r=>{if(!window.PerformanceObserver)return;const o=c=>{const l=BM(c);l.length>0&&r.notify(l)};let n,i=!0;const a=new PerformanceObserver(ne(c=>{i?n=Je(()=>o(c.getEntries())):o(c.getEntries())}));try{a.observe(t)}catch{if([exports.RumPerformanceEntryType.RESOURCE,exports.RumPerformanceEntryType.NAVIGATION,exports.RumPerformanceEntryType.LONG_TASK,exports.RumPerformanceEntryType.PAINT].includes(t.type)){t.buffered&&(n=Je(()=>o(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}i=!1,VM(e);let s;return!Zr(exports.RumPerformanceEntryType.FIRST_INPUT)&&t.type===exports.RumPerformanceEntryType.FIRST_INPUT&&({stop:s}=FM(e,c=>{o([c])})),()=>{a.disconnect(),s&&s(),yt(n)}})}let Do;function VM(e){return!Do&&ZM()&&"addEventListener"in performance&&(Do=Oe(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Do?.stop()}}function ZM(){return window.performance!==void 0&&"getEntries"in performance}function Zr(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function BM(e){return e.filter(t=>!qM(t))}function qM(e){return e.entryType===exports.RumPerformanceEntryType.RESOURCE&&(!Rm(e.name)||!Jk(e))}function Fu(e){return e.nodeType===Node.TEXT_NODE}function GM(e){return e.nodeType===Node.COMMENT_NODE}function yr(e){return e.nodeType===Node.ELEMENT_NODE}function Pm(e){return yr(e)&&!!e.shadowRoot}function rE(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&yr(t.host)}function HM(e){return e.childNodes.length>0||Pm(e)}function WM(e,t){let r=e.firstChild;for(;r;)t(r),r=r.nextSibling;Pm(e)&&t(e.shadowRoot)}function nE(e){return rE(e)?e.host:e.parentNode}const oE=100,JM=100,Gh="data-dd-excluded-activity-mutations";function jm(e,t,r,o,n,i){const a=YM(e,t,r,o);return KM(a,n,i)}function KM(e,t,r){let o,n=!1;const i=Je(ne(()=>l({hadActivity:!1})),oE),a=r!==void 0?Je(ne(()=>l({hadActivity:!0,end:Be()})),r):void 0,s=e.subscribe(({isBusy:u})=>{yt(i),yt(o);const d=Be();u||(o=Je(ne(()=>l({hadActivity:!0,end:d})),JM))}),c=()=>{n=!0,yt(i),yt(o),yt(a),s.unsubscribe()};function l(u){n||(c(),t(u))}return{stop:c}}function YM(e,t,r,o){return new he(n=>{const i=[];let a,s=0;return i.push(t.subscribe(l=>{l.every(XM)||c()}),r.subscribe(c),ir(o,{type:exports.RumPerformanceEntryType.RESOURCE}).subscribe(l=>{l.some(u=>!Ml(o,u.name))&&c()}),e.subscribe(7,l=>{Ml(o,l.url)||(a===void 0&&(a=l.requestIndex),s+=1,c())}),e.subscribe(8,l=>{Ml(o,l.url)||a===void 0||l.requestIndex<a||(s-=1,c())})),()=>{i.forEach(l=>l.unsubscribe())};function c(){n.notify({isBusy:s>0})}})}function Ml(e,t){return zc(e.excludedActivityUrls,t)}function XM(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&yr(t)&&t.matches(`[${Gh}], [${Gh}] *`))}const Fc="data-dd-action-name",iE="Masked Element",aE=[Fc,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],QM=[cE,t4],e4=[cE,r4,n4];function ta(e,t){if(!e.isConnected)return;let r,o=e;for(;o&&o.nodeName!=="HTML";){const n=Hh(o,QM,i4,t,r);if(n)return n;r=Hh(o,e4,a4,t,r)||Vc(o4(o),r),o=o.parentElement}return r}function sE(e){return/[0-9]/.test(e)}function t4(e){if(e.id&&!sE(e.id))return`#${CSS.escape(e.id)}`}function r4(e){if(e.tagName==="BODY")return;const t=e.classList;for(let r=0;r<t.length;r+=1){const o=t[r];if(!sE(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function n4(e){return CSS.escape(e.tagName)}function cE(e,t){if(t){const o=r(t);if(o)return o}for(const o of aE){const n=r(o);if(n)return n}function r(o){if(e.hasAttribute(o))return`${CSS.escape(e.tagName)}[${o}="${CSS.escape(e.getAttribute(o))}"]`}}function o4(e){let t=e.parentElement.firstElementChild,r=1;for(;t&&t!==e;)t.tagName===e.tagName&&(r+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${r})`}function Hh(e,t,r,o,n){for(const i of t){const a=i(e,o);if(a&&r(e,a,n))return Vc(a,n)}}function i4(e,t,r){return e.ownerDocument.querySelectorAll(Vc(t,r)).length===1}function a4(e,t,r){let o;if(r===void 0)o=a=>a.matches(t);else{const a=Vc(`${t}:scope`,r);o=s=>s.querySelector(a)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Vc(e,t){return t?`${e}>${t}`:e}const ae={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Dn.ALLOW,MASK:Dn.MASK,MASK_USER_INPUT:Dn.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Dn.MASK_UNLESS_ALLOWLISTED},Dm="data-dd-privacy",s4="hidden",c4="dd-privacy-",Ua="***",l4="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",u4={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},d4="x";function Jr(e){return`[${Dm}="${e}"], .${c4}${e}`}function ra(e,t,r){if(r&&r.has(e))return r.get(e);const o=nE(e),n=o?ra(o,t,r):t,i=uE(e),a=lE(i,n);return r&&r.set(e,a),a}function lE(e,t){switch(t){case ae.HIDDEN:case ae.IGNORE:return t}switch(e){case ae.ALLOW:case ae.MASK:case ae.MASK_USER_INPUT:case ae.MASK_UNLESS_ALLOWLISTED:case ae.HIDDEN:case ae.IGNORE:return e;default:return t}}function uE(e){if(yr(e)){if(e.tagName==="BASE")return ae.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return ae.MASK;const r=t.getAttribute("autocomplete");if(r&&(r.startsWith("cc-")||r.endsWith("-password")))return ae.MASK}if(e.matches(Jr(ae.HIDDEN)))return ae.HIDDEN;if(e.matches(Jr(ae.MASK)))return ae.MASK;if(e.matches(Jr(ae.MASK_UNLESS_ALLOWLISTED)))return ae.MASK_UNLESS_ALLOWLISTED;if(e.matches(Jr(ae.MASK_USER_INPUT)))return ae.MASK_USER_INPUT;if(e.matches(Jr(ae.ALLOW)))return ae.ALLOW;if(m4(e))return ae.IGNORE}}function zm(e,t){switch(t){case ae.MASK:case ae.HIDDEN:case ae.IGNORE:return!0;case ae.MASK_UNLESS_ALLOWLISTED:return Fu(e)?wa(e.parentNode)?!0:!mE(e.textContent||""):wa(e);case ae.MASK_USER_INPUT:return Fu(e)?wa(e.parentNode):wa(e);default:return!1}}function dE(e,t,r,o,n){if(o!==ae.MASK&&o!==ae.MASK_UNLESS_ALLOWLISTED||t===Dm||aE.includes(t)||t===n.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||r&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function wa(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!u4[t.tagName]}const fE=e=>e.replace(/\S/g,d4);function f4(e,t){var r;const o=(r=e.parentElement)===null||r===void 0?void 0:r.tagName;let n=e.textContent||"";if(o==="HEAD"&&!n.trim())return;const a=t;if(o==="SCRIPT")n=Ua;else if(a===ae.HIDDEN)n=Ua;else if(zm(e,a))if(o==="DATALIST"||o==="SELECT"||o==="OPTGROUP"){if(!n.trim())return}else o==="OPTION"?n=Ua:a===ae.MASK_UNLESS_ALLOWLISTED?n=pE(n):n=fE(n);return n}function m4(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const r=t("rel");return/preload|prefetch/i.test(r)&&t("as")==="script"||r==="shortcut icon"||r==="icon"}if(e.nodeName==="META"){const r=t("name"),o=t("rel"),n=t("property");return/^msapplication-tile(image|color)$/.test(r)||r==="application-name"||o==="icon"||o==="apple-touch-icon"||o==="shortcut icon"||r==="keywords"||r==="description"||/^(og|twitter|fb):/.test(n)||/^(og|twitter):/.test(r)||r==="pinterest"||r==="robots"||r==="googlebot"||r==="bingbot"||e.hasAttribute("http-equiv")||r==="author"||r==="generator"||r==="framework"||r==="publisher"||r==="progid"||/^article:/.test(n)||/^product:/.test(n)||r==="google-site-verification"||r==="yandex-verification"||r==="csrf-token"||r==="p:domain_verify"||r==="verify-v1"||r==="verification"||r==="shopify-checkout-api-token"}function t(r){return(e.getAttribute(r)||"").toLowerCase()}return!1}function mE(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function pE(e,t){return mE(e)?e:t||fE(e)}const hE=Ke,p4=100;function h4(e,t){const r=[];let o=0,n;i(e);function i(c){c.stopObservable.subscribe(a),r.push(c),yt(n),n=Je(s,hE)}function a(){o===1&&r.every(c=>c.isStopped())&&(o=2,t(r))}function s(){yt(n),o===0&&(o=1,a())}return{tryAppend:c=>o!==0?!1:r.length>0&&!g4(r[r.length-1].event,c.event)?(s(),!1):(i(c),!0),stop:()=>{s()}}}function g4(e,t){return e.target===t.target&&v4(e,t)<=p4&&e.timeStamp-t.timeStamp<=hE}function v4(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function y4(e,t,r=ae.ALLOW){const o=new Map,{actionNameAttribute:n}=t,i=Wh(e,Fc)||n&&Wh(e,n);return i?{name:i,nameSource:"custom_attribute"}:r===ae.MASK?{name:iE,nameSource:"mask_placeholder"}:Jh(e,b4,t,o)||Jh(e,_4,t,o)||{name:"",nameSource:"blank"}}function Wh(e,t){const r=e.closest(`[${t}]`);if(!r)return;const o=r.getAttribute(t);return vE(gE(o.trim()))}const b4=[(e,t,r)=>{if("labels"in e&&e.labels&&e.labels.length>0)return La(e.labels[0],t,r)},e=>{if(e.nodeName==="INPUT"){const t=e,r=t.getAttribute("type");if(r==="button"||r==="submit"||r==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,r)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return La(e,t,r)},(e,t,r)=>zo(e,"aria-label",t,r),(e,t,r)=>{const o=e.getAttribute("aria-labelledby");if(o)return{name:o.split(/\s+/).map(n=>x4(e,n)).filter(n=>!!n).map(n=>yE(n,t,r)).join(" "),nameSource:"text_content"}},(e,t,r)=>zo(e,"alt",t,r),(e,t,r)=>zo(e,"name",t,r),(e,t,r)=>zo(e,"title",t,r),(e,t,r)=>zo(e,"placeholder",t,r),(e,t,r)=>{if("options"in e&&e.options.length>0)return La(e.options[0],t,r)}],_4=[(e,t,r)=>La(e,t,r)],w4=10;function Jh(e,t,r,o){let n=e,i=0;for(;i<=w4&&n&&n.nodeName!=="BODY"&&n.nodeName!=="HTML"&&n.nodeName!=="HEAD";){for(const a of t){const s=a(n,r,o);if(s){const{name:c,nameSource:l}=s,u=c&&c.trim();if(u)return{name:vE(gE(u)),nameSource:l}}}if(n.nodeName==="FORM")break;n=n.parentElement,i+=1}}function gE(e){return e.replace(/\s+/g," ")}function vE(e){return e.length>100?`${_m(e,100)} [...]`:e}function x4(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function zo(e,t,r,o){const{enablePrivacyForActionName:n,defaultPrivacyLevel:i}=r;let a=e.getAttribute(t);if(a&&n){const s=ra(e,i,o);dE(e.tagName,t,a,s,r)&&(a=pE(a,iE))}else a||(a="");return{name:a,nameSource:"standard_attribute"}}function La(e,t,r){return{name:yE(e,t,r)||"",nameSource:"text_content"}}function yE(e,t,r){if(e.isContentEditable)return;const{enablePrivacyForActionName:o,actionNameAttribute:n,defaultPrivacyLevel:i}=t;if(Yi(Dr.USE_TREE_WALKER_FOR_ACTION_NAME))return S4(e,n,o,i,r);if("innerText"in e){let a=e.innerText;const s=c=>{const l=e.querySelectorAll(c);for(let u=0;u<l.length;u+=1){const d=l[u];if("innerText"in d){const f=d.innerText;f&&f.trim().length>0&&(a=a.replace(f,""))}}};return s(`[${Fc}]`),n&&s(`[${n}]`),o&&s(`${Jr(ae.HIDDEN)}, ${Jr(ae.MASK)}`),a}return e.textContent}function S4(e,t,r,o,n){const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,s);let a="";for(;i.nextNode();){const c=i.currentNode;if(yr(c)){(c.nodeName==="BR"||c.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(c).display))&&(a+=" ");continue}a+=c.textContent||""}return a.replace(/\s+/g," ").trim();function s(c){const l=ra(c,o,n);if(r&&l&&zm(c,l))return NodeFilter.FILTER_REJECT;if(yr(c)){if(c.hasAttribute(Fc)||t&&c.hasAttribute(t))return NodeFilter.FILTER_REJECT;const u=getComputedStyle(c);if(u.visibility!=="visible"||u.display==="none"||u.contentVisibility&&u.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function k4(e,{onPointerDown:t,onPointerUp:r}){let o,n={selection:!1,input:!1,scroll:!1},i;const a=[Oe(e,window,"pointerdown",s=>{Yh(s)&&(o=Kh(),n={selection:!1,input:!1,scroll:!1},i=t(s))},{capture:!0}),Oe(e,window,"selectionchange",()=>{(!o||!Kh())&&(n.selection=!0)},{capture:!0}),Oe(e,window,"scroll",()=>{n.scroll=!0},{capture:!0,passive:!0}),Oe(e,window,"pointerup",s=>{if(Yh(s)&&i){const c=n;r(i,s,()=>c),i=void 0}},{capture:!0}),Oe(e,window,"input",()=>{n.input=!0},{capture:!0})];return{stop:()=>{a.forEach(s=>s.stop())}}}function Kh(){const e=window.getSelection();return!e||e.isCollapsed}function Yh(e){return e.target instanceof Element&&e.isPrimary!==!1}const Xh=3;function E4(e,t){if(I4(e))return t.addFrustration(jo.RAGE_CLICK),e.some(Qh)&&t.addFrustration(jo.DEAD_CLICK),t.hasError&&t.addFrustration(jo.ERROR_CLICK),{isRage:!0};const r=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration(jo.ERROR_CLICK),Qh(o)&&!r&&o.addFrustration(jo.DEAD_CLICK)}),{isRage:!1}}function I4(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(Xh-1);t+=1)if(e[t+Xh-1].event.timeStamp-e[t].event.timeStamp<=Ke)return!0;return!1}const T4='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Qh(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(T4)}const bE=10*Ke,Go=new Map;function $4(e){const t=Go.get(e);return Go.delete(e),t}function _E(e,t){Go.set(e,t),Go.forEach((r,o)=>{Ne(o,_t())>bE&&Go.delete(o)})}const O4=5*lt;function A4(e,t,r,o){const n=wo({expireDelay:O4}),i=new he;let a;e.subscribe(10,()=>{n.reset()}),e.subscribe(5,u),e.subscribe(11,d=>{d.reason===Ln.UNLOADING&&u()});const{stop:s}=k4(o,{onPointerDown:d=>C4(o,e,t,d,r),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:f},m,g)=>{N4(o,e,t,r,n,i,l,d,m,g,f)}});return{stop:()=>{u(),i.notify(),s()},actionContexts:{findActionId:d=>n.findAll(d)}};function l(d){if(!a||!a.tryAppend(d)){const f=d.clone();a=h4(d,m=>{P4(m,f)})}}function u(){a&&a.stop()}}function C4(e,t,r,o,n){let i;if(e.enablePrivacyForActionName?i=ra(o.target,e.defaultPrivacyLevel):i=ae.ALLOW,i===ae.HIDDEN)return;const a=R4(o,i,e);let s=!1;return jm(t,r,n,e,c=>{s=c.hadActivity},oE),{clickActionBase:a,hadActivityOnPointerDown:()=>s}}function N4(e,t,r,o,n,i,a,s,c,l,u){var d;const f=wE(t,n,l,s,c);a(f);const m=(d=s?.target)===null||d===void 0?void 0:d.selector;m&&_E(c.timeStamp,m);const{stop:g}=jm(t,r,o,e,b=>{b.hadActivity&&b.end<f.startClocks.timeStamp?f.discard():b.hadActivity?f.stop(b.end):u()?f.stop(f.startClocks.timeStamp):f.stop()},bE),h=t.subscribe(5,({endClocks:b})=>{f.stop(b.timeStamp)}),y=i.subscribe(()=>{f.stop()});f.stopObservable.subscribe(()=>{h.unsubscribe(),g(),y.unsubscribe()})}function R4(e,t,r){const o=e.target.getBoundingClientRect(),n=ta(e.target,r.actionNameAttribute);n&&_E(e.timeStamp,n);const{name:i,nameSource:a}=y4(e.target,r,t);return{type:Lc.CLICK,target:{width:Math.round(o.width),height:Math.round(o.height),selector:n},position:{x:Math.round(e.clientX-o.left),y:Math.round(e.clientY-o.top)},name:i,nameSource:a}}function wE(e,t,r,o,n){const i=et(),a=Ue(),s=t.add(i,a.relative),c=tE({lifeCycle:e,isChildEvent:g=>g.action!==void 0&&(Array.isArray(g.action.id)?g.action.id.includes(i):g.action.id===i)});let l=0,u;const d=[],f=new he;function m(g){l===0&&(u=g,l=1,u?s.close(bm(u)):s.remove(),c.stop(),f.notify())}return{event:n,stop:m,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return u!==void 0},getUserActivity:r,addFrustration:g=>{d.push(g)},startClocks:a,isStopped:()=>l===1||l===2,clone:()=>wE(e,t,r,o,n),validate:g=>{if(m(),l!==1)return;const{resourceCount:h,errorCount:y,longTaskCount:b}=c.eventCounts,w={duration:u&&Ne(a.timeStamp,u),startClocks:a,id:i,frustrationTypes:d,counts:{resourceCount:h,errorCount:y,longTaskCount:b},events:g??[n],event:n,...o};e.notify(0,w),l=2},discard:()=>{m(),l=2}}}function P4(e,t){const{isRage:r}=E4(e,t);r?(e.forEach(o=>o.discard()),t.stop(Be()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function j4(e,t,r,o,n){const{unsubscribe:i}=e.subscribe(0,c=>{e.notify(12,eg(c))});t.register(0,({startTime:c,eventType:l})=>{if(l!==te.ERROR&&l!==te.RESOURCE&&l!==te.LONG_TASK)return wt;const u=a.findActionId(c);return u?{type:l,action:{id:u}}:wt}),t.register(1,({startTime:c})=>({action:{id:a.findActionId(c)}}));let a={findActionId:_e},s=_e;return n.trackUserInteractions&&({actionContexts:a,stop:s}=A4(e,r,o,n)),{addAction:c=>{e.notify(12,eg(c))},actionContexts:a,stop:()=>{i(),s()}}}function eg(e){const t=Ul(e)?{action:{id:e.id,loading_time:eE(oe(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},r=vr({action:{id:et(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:te.ACTION},t),o=Ul(e)?e.duration:void 0,n=Ul(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:r,duration:o,startTime:e.startClocks.relative,domainContext:n}}function Ul(e){return e.type!==Lc.CUSTOM}function D4(e){const t=mz([Oc.error]).subscribe(r=>e.notify(r.error));return{stop:()=>{t.unsubscribe()}}}function z4(e,t){const r=Y2(e,[si.cspViolation,si.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{r.unsubscribe()}}}function M4(e,t,r){const o=new he;return r.subscribe(n=>{n.type===0&&o.notify(n.error)}),D4(o),z4(t,o),o.subscribe(n=>e.notify(14,{error:n})),U4(e)}function U4(e){return e.subscribe(14,({error:t})=>{e.notify(12,L4(t))}),{addError:({error:t,handlingStack:r,componentStack:o,startClocks:n,context:i})=>{const a=km({originalError:t,handlingStack:r,componentStack:o,startClocks:n,nonErrorPrefix:"Provided",source:vo.CUSTOM,handling:"handled"});a.context=vr(a.context,i),e.notify(14,{error:a})}}}function L4(e){const t={date:e.startClocks.timeStamp,error:{id:et(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:te.ERROR,context:e.context},r={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:r}}const tg=new WeakSet;function F4(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const r=t.filter(o=>!tg.has(o)).filter(o=>Jk(o)&&Kk(o)).filter(o=>V4(o,e.startClocks.relative,xE({startTime:e.startClocks.relative,duration:e.duration})));if(r.length===1)return tg.add(r[0]),r[0].toJSON()}function xE(e){return ho(e.startTime,e.duration)}function V4(e,t,r){return e.startTime>=t-1&&xE(e)<=ho(r,1)}const Z4=2*lt;function B4(e){const t=q4(e)||G4(e);if(!(!t||t.traceTime<=ct()-Z4))return t.traceId}function q4(e){const t=e.querySelector("meta[name=dd-trace-id]"),r=e.querySelector("meta[name=dd-trace-time]");return SE(t&&t.content,r&&r.content)}function G4(e){const t=H4(e);if(t)return SE(ii(t,"trace-id"),ii(t,"trace-time"))}function SE(e,t){const r=t&&Number(t);if(!(!e||!r))return{traceId:e,traceTime:r}}function H4(e){for(let t=0;t<e.childNodes.length;t+=1){const r=rg(e.childNodes[t]);if(r)return r}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const r=e.body.childNodes[t],o=rg(r);if(o)return o;if(!Fu(r))break}}function rg(e){if(e&&GM(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function kE(){if(Zr(exports.RumPerformanceEntryType.NAVIGATION)){const r=performance.getEntriesByType(exports.RumPerformanceEntryType.NAVIGATION)[0];if(r)return r}const e=W4(),t={entryType:exports.RumPerformanceEntryType.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function W4(){const e={},t=performance.timing;for(const r in t)if(Gi(t[r])){const o=r,n=t[o];e[o]=n===0?0:bm(n)}return e}function J4(e,t,r=kE){Am(e,"interactive",()=>{const o=r(),n=Object.assign(o.toJSON(),{entryType:exports.RumPerformanceEntryType.RESOURCE,initiatorType:Hk,duration:o.responseEnd,traceId:B4(document),toJSON:()=>({...n,toJSON:void 0})});t(n)})}const K4=1e3;function Y4(e){const t=new Set,r=e.subscribe(8,o=>{t.add(o),t.size>K4&&(_o("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let n=1/0,i;for(const a of t){const s=o.startTime-a.startClocks.relative;0<=s&&s<n&&a.url===o.name&&(n=Math.abs(s),i=a)}return i&&t.delete(i),i},stop(){r.unsubscribe()}}}function X4(e,t,r,o=fz(),n=J4){let i;const a=t.trackEarlyRequests;a?i=Y4(e):e.subscribe(8,l=>{c(()=>Q4(l,t,r))});const s=ir(t,{type:exports.RumPerformanceEntryType.RESOURCE,buffered:!0}).subscribe(l=>{for(const u of l)(a||!Wk(u))&&c(()=>ng(u,t,r,i))});n(t,l=>{c(()=>ng(l,t,r,i))});function c(l){o.push(()=>{const u=l();u&&e.notify(12,u)})}return{stop:()=>{o.stop(),s.unsubscribe()}}}function Q4(e,t,r){const o=F4(e);return EE(o,e,r,t)}function ng(e,t,r,o){const n=Wk(e)&&o?o.getMatchingRequest(e):void 0;return EE(e,n,r,t)}function EE(e,t,r,o){if(!e&&!t)return;const n=t?nU(t,o):oU(e,o);if(!o.trackResources&&!n)return;const i=e?Hi(e.startTime):t.startClocks,a=e?EM(e):iU(r,i,t.duration),s=t&&eU(t,o),c=vr({date:i.timeStamp,resource:{id:et(),duration:oe(a),type:t?t.type===Uc.XHR?at.XHR:at.FETCH:kM(e),method:t?t.method:void 0,status_code:t?t.status:aU(e.responseStatus),url:t?Yk(t.url):e.name,protocol:e&&$M(e),delivery_type:e&&OM(e),graphql:s},type:te.RESOURCE,_dd:{discarded:!o.trackResources}},n,e&&rU(e));return{startTime:i.relative,duration:a,rawRumEvent:c,domainContext:tU(e,t)}}function eU(e,t){const r=Xk(e.url,t);if(r)return PM(e,r)}function tU(e,t){if(t){const r={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Uc.XHR?{xhr:t.xhr,...r}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...r}}return{performanceEntry:e}}function rU(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...AM(e),...IM(e)}}}function nU(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function oU(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Vk().toString(),rule_psr:t.rulePsr}}}function iU(e,t,r){return e.wasInPageStateDuringPeriod("frozen",t.relative,r)?void 0:r}function aU(e){return e===0?void 0:e}function sU(e,t,r){const{stop:o,eventCounts:n}=tE({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:r});return{stop:o,eventCounts:n}}const cU=10*lt;function lU(e,t,r){return{stop:ir(e,{type:exports.RumPerformanceEntryType.PAINT,buffered:!0}).subscribe(n=>{const i=n.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<cU);i&&r(i.startTime)}).unsubscribe}}function uU(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Ne(e,_t()))})})}function dU(e,t,r){const o=ir(e,{type:exports.RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(n=>{const i=n.find(a=>a.startTime<t.timeStamp);if(i){const a=Ne(i.startTime,i.processingStart);let s;i.target&&yr(i.target)&&(s=ta(i.target,e.actionNameAttribute)),r({delay:a>=0?a:0,time:i.startTime,targetSelector:s})}});return{stop:()=>{o.unsubscribe()}}}function fU(e,t,r=kE){return hU(e,()=>{const o=r();pU(o)||t(mU(o))})}function mU(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=_t()?e.responseStart:void 0}}function pU(e){return e.loadEventEnd<=0}function hU(e,t){let r;const{stop:o}=Am(e,"complete",()=>{r=Je(()=>t())});return{stop:()=>{o(),yt(r)}}}const gU=10*lt;function vU(e,t,r,o){let n=1/0;const{stop:i}=gr(e,r,["pointerdown","keydown"],c=>{n=c.timeStamp},{capture:!0,once:!0});let a=0;const s=ir(e,{type:exports.RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(c=>{const l=VS(c,u=>u.entryType===exports.RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT&&u.startTime<n&&u.startTime<t.timeStamp&&u.startTime<gU&&u.size>a);if(l){let u;l.element&&(u=ta(l.element,e.actionNameAttribute)),o({value:l.startTime,targetSelector:u,resourceUrl:yU(l)}),a=l.size}});return{stop:()=>{i(),s.unsubscribe()}}}function yU(e){return e.url===""?void 0:e.url}function IE(e,t,r=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:_e};if(Zr(exports.RumPerformanceEntryType.VISIBILITY_STATE)){const i=performance.getEntriesByType(exports.RumPerformanceEntryType.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:_e}}let o=1/0;const{stop:n}=gr(e,r,["pagehide","visibilitychange"],i=>{(i.type==="pagehide"||document.visibilityState==="hidden")&&(o=i.timeStamp,n())},{capture:!0});return{get timeStamp(){return o},stop:n}}function bU(e,t,r,o){const n={},{stop:i}=fU(e,d=>{r(d.loadEvent),n.navigationTimings=d,o()}),a=IE(e,t),{stop:s}=lU(e,a,d=>{n.firstContentfulPaint=d,o()}),{stop:c}=vU(e,a,window,d=>{n.largestContentfulPaint=d,o()}),{stop:l}=dU(e,a,d=>{n.firstInput=d,o()});function u(){i(),s(),c(),l(),a.stop()}return{stop:u,initialViewMetrics:n}}const Vu=(e,t)=>e*t,_U=(e,t)=>{const r=Math.max(e.left,t.left),o=Math.max(e.top,t.top),n=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return r>=n||o>=i?0:Vu(n-r,i-o)},og=e=>{const t=Vu(e.previousRect.width,e.previousRect.height),r=Vu(e.currentRect.width,e.currentRect.height),o=_U(e.previousRect,e.currentRect);return t+r-o};function wU(e,t,r){if(!IU())return{stop:_e};let o=0,n;r({value:0});const i=EU(),a=ir(e,{type:exports.RumPerformanceEntryType.LAYOUT_SHIFT,buffered:!0}).subscribe(s=>{var c;for(const l of s){if(l.hadRecentInput||l.startTime<t)continue;const{cumulatedValue:u,isMaxValue:d}=i.update(l);if(d){const f=xU(l.sources);n={target:f?.node?new WeakRef(f.node):void 0,time:Ne(t,l.startTime),previousRect:f?.previousRect,currentRect:f?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(u>o){o=u;const f=(c=n?.target)===null||c===void 0?void 0:c.deref();r({value:Bo(o,4),targetSelector:f&&ta(f,e.actionNameAttribute),time:n?.time,previousRect:n?.previousRect?ig(n.previousRect):void 0,currentRect:n?.currentRect?ig(n.currentRect):void 0,devicePixelRatio:n?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function xU(e){let t;for(const r of e)if(r.node&&yr(r.node)){const o=og(r);(!t||og(t)<o)&&(t=r)}return t}function ig({x:e,y:t,width:r,height:o}){return{x:e,y:t,width:r,height:o}}const SU=5*Ke,kU=Ke;function EU(){let e=0,t,r,o=0;return{update:n=>{const i=t===void 0||n.startTime-r>=kU||n.startTime-t>=SU;let a;return i?(t=r=n.startTime,o=e=n.value,a=!0):(e+=n.value,r=n.startTime,a=n.value>o,a&&(o=n.value)),{cumulatedValue:e,isMaxValue:a}}}}function IU(){return Zr(exports.RumPerformanceEntryType.LAYOUT_SHIFT)&&"WeakRef"in window}let Fa,TE=0,Ll=1/0,Fl=0;function TU(){"interactionCount"in performance||Fa||(Fa=new window.PerformanceObserver(ne(e=>{e.getEntries().forEach(t=>{const r=t;r.interactionId&&(Ll=Math.min(Ll,r.interactionId),Fl=Math.max(Fl,r.interactionId),TE=(Fl-Ll)/7+1)})})),Fa.observe({type:"event",buffered:!0,durationThreshold:0}))}const ag=()=>Fa?TE:window.performance.interactionCount||0,sg=10,$U=1*lt;function OU(e,t,r){if(!NU())return{getInteractionToNextPaint:()=>{},setViewEnd:_e,stop:_e};const{getViewInteractionCount:o,stopViewInteractionCount:n}=CU(r);let i=1/0;const a=AU(o);let s=-1,c,l;function u(m){for(const h of m)h.interactionId&&h.startTime>=t&&h.startTime<=i&&a.process(h);const g=a.estimateP98Interaction();g&&g.duration!==s&&(s=g.duration,l=Ne(t,g.startTime),c=$4(g.startTime),!c&&g.target&&yr(g.target)&&(c=ta(g.target,e.actionNameAttribute)))}const d=ir(e,{type:exports.RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(u),f=ir(e,{type:exports.RumPerformanceEntryType.EVENT,durationThreshold:40,buffered:!0}).subscribe(u);return{getInteractionToNextPaint:()=>{if(s>=0)return{value:Math.min(s,$U),targetSelector:c,time:l};if(o())return{value:0}},setViewEnd:m=>{i=m,n()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function AU(e){const t=[];function r(){t.sort((o,n)=>n.duration-o.duration).splice(sg)}return{process(o){const n=t.findIndex(a=>o.interactionId===a.interactionId),i=t[t.length-1];n!==-1?o.duration>t[n].duration&&(t[n]=o,r()):(t.length<sg||o.duration>i.duration)&&(t.push(o),r())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function CU(e){TU();const t=e===dr.INITIAL_LOAD?0:ag();let r={stopped:!1};function o(){return ag()-t}return{getViewInteractionCount:()=>r.stopped?r.interactionCount:o(),stopViewInteractionCount:()=>{r={stopped:!0,interactionCount:o()}}}}function NU(){return Zr(exports.RumPerformanceEntryType.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function RU(e,t,r,o,n,i,a){let s=n===dr.INITIAL_LOAD,c=!0;const l=[],u=IE(o,i);function d(){if(!c&&!s&&l.length>0){const m=Math.max(...l);m<u.timeStamp-i.relative&&a(m)}}const{stop:f}=jm(e,t,r,o,m=>{c&&(c=!1,m.hadActivity&&l.push(Ne(i.timeStamp,m.end)),d())});return{stop:()=>{f(),u.stop()},setLoadEvent:m=>{s&&(s=!1,l.push(m),d())}}}function PU(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function $E(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let Vl;function OE(e){return Vl||(Vl=jU(e)),Vl}function jU(e){return new he(t=>{const{throttled:r}=Ji(()=>{t.notify(Zc())},200);return Oe(e,window,"resize",r,{capture:!0,passive:!0}).stop})}function Zc(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const DU=Ke;function zU(e,t,r,o=UU(e)){let n=0,i=0,a=0;const s=o.subscribe(({scrollDepth:c,scrollTop:l,scrollHeight:u})=>{let d=!1;if(c>n&&(n=c,d=!0),u>i){i=u;const f=_t();a=Ne(t.relative,f),d=!0}d&&r({maxDepth:Math.min(n,i),maxDepthScrollTop:l,maxScrollHeight:i,maxScrollHeightTime:a})});return{stop:()=>s.unsubscribe()}}function MU(){const e=$E(),{height:t}=Zc(),r=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:r,scrollDepth:o,scrollTop:e}}function UU(e,t=DU){return new he(r=>{function o(){r.notify(MU())}if(window.ResizeObserver){const n=Ji(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,a=new ResizeObserver(ne(n.throttled));i&&a.observe(i);const s=Oe(e,window,"scroll",n.throttled,{passive:!0});return()=>{n.cancel(),a.disconnect(),s.stop()}}})}function LU(e,t,r,o,n,i,a){const s={},{stop:c,setLoadEvent:l}=RU(e,t,r,o,i,a,h=>{s.loadingTime=h,n()}),{stop:u}=zU(o,a,h=>{s.scroll=h}),{stop:d}=wU(o,a.relative,h=>{s.cumulativeLayoutShift=h,n()}),{stop:f,getInteractionToNextPaint:m,setViewEnd:g}=OU(o,a.relative,i);return{stop:()=>{c(),d(),u()},stopINPTracking:f,setLoadEvent:l,setViewEnd:g,getCommonViewMetrics:()=>(s.interactionToNextPaint=m(),s)}}function FU(e,t){const{stop:r}=Oe(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return r}function VU(e,t,r){uU(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},r()})}const ZU=3e3,BU=5*lt,qU=5*lt;function GU(e,t,r,o,n,i,a,s){const c=new Set;let l=f(dr.INITIAL_LOAD,ym(),s),u;m();let d;a&&(d=g(i),n.trackBfcacheViews&&(u=FU(n,h=>{l.end();const y=Hi(h.timeStamp);l=f(dr.BF_CACHE,y,void 0)})));function f(h,y,b){const w=HU(t,r,o,n,e,h,y,b);return c.add(w),w.stopObservable.subscribe(()=>{c.delete(w)}),w}function m(){t.subscribe(10,()=>{l=f(dr.ROUTE_CHANGE,void 0,{name:l.name,service:l.service,version:l.version,context:l.contextManager.getContext()})}),t.subscribe(9,()=>{l.end({sessionIsActive:!1})})}function g(h){return h.subscribe(({oldLocation:y,newLocation:b})=>{JU(y,b)&&(l.end(),l=f(dr.ROUTE_CHANGE))})}return{addTiming:(h,y=Be())=>{l.addTiming(h,y)},startView:(h,y)=>{l.end({endClocks:y}),l=f(dr.ROUTE_CHANGE,y,h)},setViewContext:h=>{l.contextManager.setContext(h)},setViewContextProperty:(h,y)=>{l.contextManager.setContextProperty(h,y)},setViewName:h=>{l.setViewName(h)},getViewContext:()=>l.contextManager.getContext(),stop:()=>{d&&d.unsubscribe(),u&&u(),l.end(),c.forEach(h=>h.stop())}}}function HU(e,t,r,o,n,i,a=Ue(),s){const c=et(),l=new he,u={};let d=0,f;const m=oi(n),g=Mc();let h=!0,y=s?.name;const b=s?.service||o.service,w=s?.version||o.version,x=s?.context;x&&g.setContext(x);const v={id:c,name:y,startClocks:a,service:b,version:w,context:x};e.notify(1,v),e.notify(2,v);const{throttled:k,cancel:E}=Ji(V,ZU,{leading:!1}),{setLoadEvent:I,setViewEnd:A,stop:M,stopINPTracking:U,getCommonViewMetrics:K}=LU(e,t,r,o,se,i,a),{stop:ge,initialViewMetrics:q}=i===dr.INITIAL_LOAD?bU(o,a,I,se):{stop:_e,initialViewMetrics:{}};i===dr.BF_CACHE&&VU(a,q,se);const{stop:F,eventCounts:ce}=sU(e,c,se),le=po(V,BU),pe=e.subscribe(11,ye=>{ye.reason===Ln.UNLOADING&&V()});V(),g.changeObservable.subscribe(se);function G(){e.notify(3,{id:c,name:y,context:g.getContext(),startClocks:a,sessionIsActive:h})}function se(){G(),k()}function V(){E(),G(),d+=1;const ye=f===void 0?Be():f.timeStamp;e.notify(4,{customTimings:u,documentVersion:d,id:c,name:y,service:b,version:w,context:g.getContext(),loadingType:i,location:m,startClocks:a,commonViewMetrics:K(),initialViewMetrics:q,duration:Ne(a.timeStamp,ye),isActive:f===void 0,sessionIsActive:h,eventCounts:ce})}return{get name(){return y},service:b,version:w,contextManager:g,stopObservable:l,end(ye={}){var ue,ve;f||(f=(ue=ye.endClocks)!==null&&ue!==void 0?ue:Ue(),h=(ve=ye.sessionIsActive)!==null&&ve!==void 0?ve:!0,e.notify(5,{endClocks:f}),e.notify(6,{endClocks:f}),Nc(le),A(f.relative),M(),pe.unsubscribe(),V(),Je(()=>{this.stop()},qU))},stop(){ge(),F(),U(),l.notify()},addTiming(ye,ue){if(f)return;const ve=mj(ue)?ue:Ne(a.timeStamp,ue);u[WU(ye)]=ve,se()},setViewName(ye){y=ye,V()}}}function WU(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&Q.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function JU(e,t){return e.pathname!==t.pathname||!KU(t.hash)&&cg(t.hash)!==cg(e.hash)}function KU(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function cg(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function YU(e,t,r,o,n,i,a,s,c,l){return e.subscribe(4,u=>e.notify(12,XU(u,r,s))),t.register(0,({startTime:u,eventType:d})=>{const f=c.findView(u);return f?{type:d,service:f.service,version:f.version,context:f.context,view:{id:f.id,name:f.name}}:zr}),t.register(1,({startTime:u})=>{var d;return{view:{id:(d=c.findView(u))===null||d===void 0?void 0:d.id}}}),GU(o,e,n,i,r,a,!r.trackViewsManually,l)}function XU(e,t,r){var o,n,i,a,s,c,l,u,d,f,m,g,h,y,b,w,x,v;const k=r.getReplayStats(e.id),E=(n=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||n===void 0?void 0:n.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:k,cls:E?{device_pixel_ratio:E}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:te.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:oe((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(s=e.commonViewMetrics.cumulativeLayoutShift)===null||s===void 0?void 0:s.targetSelector,first_byte:oe((c=e.initialViewMetrics.navigationTimings)===null||c===void 0?void 0:c.firstByte),dom_complete:oe((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.domComplete),dom_content_loaded:oe((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domContentLoaded),dom_interactive:oe((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:oe(e.initialViewMetrics.firstContentfulPaint),first_input_delay:oe((f=e.initialViewMetrics.firstInput)===null||f===void 0?void 0:f.delay),first_input_time:oe((m=e.initialViewMetrics.firstInput)===null||m===void 0?void 0:m.time),first_input_target_selector:(g=e.initialViewMetrics.firstInput)===null||g===void 0?void 0:g.targetSelector,interaction_to_next_paint:oe((h=e.commonViewMetrics.interactionToNextPaint)===null||h===void 0?void 0:h.value),interaction_to_next_paint_time:oe((y=e.commonViewMetrics.interactionToNextPaint)===null||y===void 0?void 0:y.time),interaction_to_next_paint_target_selector:(b=e.commonViewMetrics.interactionToNextPaint)===null||b===void 0?void 0:b.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:oe((w=e.initialViewMetrics.largestContentfulPaint)===null||w===void 0?void 0:w.value),largest_contentful_paint_target_selector:(x=e.initialViewMetrics.largestContentfulPaint)===null||x===void 0?void 0:x.targetSelector,load_event:oe((v=e.initialViewMetrics.navigationTimings)===null||v===void 0?void 0:v.loadEvent),loading_time:eE(oe(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:QU(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:oe(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:oe(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:$z()}};return Vr(e.customTimings)||(I.view.custom_timings=NS(e.customTimings,oe)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function QU({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:r,firstInput:o,largestContentfulPaint:n}){return{cls:e&&{score:e.value,timestamp:oe(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:r&&{timestamp:oe(r)},fid:o&&{duration:oe(o.delay),timestamp:oe(o.time),target_selector:o.targetSelector},inp:t&&{duration:oe(t.value),timestamp:oe(t.time),target_selector:t.targetSelector},lcp:n&&{timestamp:oe(n.value),target_selector:n.targetSelector,resource_url:n.resourceUrl}}}const e6="rum";function t6(e,t,r){const o=ZD(e,e6,n=>n6(e,n),r);return o.expireObservable.subscribe(()=>{t.notify(9)}),o.renewObservable.subscribe(()=>{t.notify(10)}),o.sessionStateUpdateObservable.subscribe(({previousState:n,newState:i})=>{if(!n.forcedReplay&&i.forcedReplay){const a=o.findSession();a&&(a.isReplayForced=!0)}}),{findTrackedSession:n=>{const i=o.findSession(n);if(!(!i||i.trackingType==="0"))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:o.expire,expireObservable:o.expireObservable,setForcedReplay:()=>o.updateSessionState({forcedReplay:"1"})}}function r6(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:wk("records")?1:0};return{findTrackedSession:()=>e,expire:_e,expireObservable:new he,setForcedReplay:_e}}function n6(e,t){return o6(t)?t:Xr(e.sessionSampleRate)?Xr(e.sessionReplaySampleRate)?"1":"2":"0"}function o6(e){return e==="0"||e==="1"||e==="2"}function i6(e,t,r,o,n,i){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const s=Sk({encoder:i(2),request:$m(a,r),flushController:kk({pageMayExitObservable:o,sessionExpireObservable:n})});return t.subscribe(13,c=>{c.type===te.VIEW?s.upsert(c,c.view.id):s.add(c)}),s}function a6(e){const t=yo();e.subscribe(13,r=>{t.send("rum",r)})}const s6=vn;function c6(e,t,r,o){const n=wo({expireDelay:s6});let i;e.subscribe(1,({startClocks:c})=>{const l=o.href;n.add(s({url:l,referrer:i||document.referrer}),c.relative),i=l}),e.subscribe(6,({endClocks:c})=>{n.closeActive(c.relative)});const a=r.subscribe(({newLocation:c})=>{const l=n.find();if(l){const u=_t();n.closeActive(u),n.add(s({url:c.href,referrer:l.referrer}),u)}});function s({url:c,referrer:l}){return{url:c,referrer:l}}return t.register(0,({startTime:c,eventType:l})=>{const u=n.find(c);return u?{type:l,view:{url:u.url,referrer:u.referrer}}:zr}),{findUrl:c=>n.find(c),stop:()=>{a.unsubscribe(),n.stop()}}}function l6(e,t){let r=oi(t);return new he(o=>{const{stop:n}=u6(e,a),{stop:i}=d6(e,a);function a(){if(r.href===t.href)return;const s=oi(t);o.notify({newLocation:s,oldLocation:r}),r=s}return()=>{n(),i()}})}function u6(e,t){const{stop:r}=Bt(lg("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=Bt(lg("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:n}=Oe(e,window,"popstate",t);return{stop:()=>{r(),o(),n()}}}function d6(e,t){return Oe(e,window,"hashchange",t)}function lg(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const f6=vn;function m6(e,t,r){const o=wo({expireDelay:f6});return e.subscribe(1,({startClocks:n})=>{o.add({},n.relative)}),e.subscribe(6,({endClocks:n})=>{o.closeActive(n.relative)}),t.register(0,({startTime:n,eventType:i})=>{if(!r.trackFeatureFlagsForEvents.concat([te.VIEW,te.ERROR]).includes(i))return wt;const s=o.find(n);return!s||Vr(s)?wt:{type:i,feature_flags:s}}),{addFeatureFlagEvaluation:(n,i)=>{const a=o.find();a&&(a[n]=i)}}}const p6=10*Ke;let Fn,xa;function h6(e,t,r){e.metricsEnabled&&(AE(),xa=!1,t.subscribe(13,()=>{xa=!0}),r.subscribe(({bytesCount:o,messagesCount:n})=>{xa&&(xa=!1,Fn.batchCount+=1,dg(Fn.batchBytesCount,o),dg(Fn.batchMessagesCount,n))}),po(g6,p6))}function g6(){Fn.batchCount!==0&&(ea("Customer data measures",Fn),AE())}function ug(){return{min:1/0,max:0,sum:0}}function dg(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function AE(){Fn={batchCount:0,batchBytesCount:ug(),batchMessagesCount:ug()}}const v6=4e3,y6=500,b6=vn;function _6(e,t,r=y6){const o=wo({expireDelay:b6,maxEntries:v6});let n;Zr(exports.RumPerformanceEntryType.VISIBILITY_STATE)&&performance.getEntriesByType(exports.RumPerformanceEntryType.VISIBILITY_STATE).forEach(l=>{const u=l.name==="hidden"?"hidden":"active";a(u,l.startTime)}),a(CE(),_t());const{stop:i}=gr(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],c=>{a(x6(c),c.timeStamp)},{capture:!0});function a(c,l=_t()){c!==n&&(n=c,o.closeActive(l),o.add({state:n,startTime:l},l))}function s(c,l,u){return o.findAll(l,u).some(d=>d.state===c)}return e.register(0,({startTime:c,duration:l=0,eventType:u})=>{if(u===te.VIEW){const d=o.findAll(c,l);return{type:u,_dd:{page_states:w6(d,c,r)}}}return u===te.ACTION||u===te.ERROR?{type:u,view:{in_foreground:s("active",c,0)}}:wt}),{wasInPageStateDuringPeriod:s,addPageState:a,stop:()=>{i(),o.stop()}}}function w6(e,t,r){if(e.length!==0)return e.slice(-r).reverse().map(({state:o,startTime:n})=>({state:o,start:oe(Ne(t,n))}))}function x6(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":CE()}function CE(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function S6(e,t){let r;const o=requestAnimationFrame(ne(()=>{r=Zc()})),n=OE(t).subscribe(i=>{r=i}).unsubscribe;return e.register(0,({eventType:i})=>({type:i,display:r?{viewport:r}:void 0})),{stop:()=>{n(),o&&cancelAnimationFrame(o)}}}function k6(e,t){const r=window.cookieStore?E6(e):T6;return new he(o=>r(t,n=>o.notify(n)))}function E6(e){return(t,r)=>Oe(e,window.cookieStore,"change",n=>{const i=n.changed.find(a=>a.name===t)||n.deleted.find(a=>a.name===t);i&&r(i.value)}).stop}const I6=Ke;function T6(e,t){const r=ii(document.cookie,e),o=po(()=>{const n=ii(document.cookie,e);n!==r&&t(n)},I6);return()=>{Nc(o)}}const fg="datadog-ci-visibility-test-execution-id";function $6(e,t,r=k6(e,fg)){var o;let n=Tr(fg)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=r.subscribe(a=>{n=a});return t.register(0,({eventType:a})=>typeof n!="string"?wt:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:n}}),{stop:()=>{i.unsubscribe()}}}function O6(e,t){const r=ir(t,{type:exports.RumPerformanceEntryType.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const n of o){const i=Hi(n.startTime),a={date:i.timeStamp,long_task:{id:et(),entry_type:zk.LONG_ANIMATION_FRAME,duration:oe(n.duration),blocking_duration:oe(n.blockingDuration),first_ui_event_timestamp:oe(n.firstUIEventTimestamp),render_start:oe(n.renderStart),style_and_layout_start:oe(n.styleAndLayoutStart),start_time:oe(n.startTime),scripts:n.scripts.map(s=>({duration:oe(s.duration),pause_duration:oe(s.pauseDuration),forced_style_and_layout_duration:oe(s.forcedStyleAndLayoutDuration),start_time:oe(s.startTime),execution_start:oe(s.executionStart),source_url:s.sourceURL,source_function_name:s.sourceFunctionName,source_char_position:s.sourceCharPosition,invoker:s.invoker,invoker_type:s.invokerType,window_attribution:s.windowAttribution}))},type:te.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:i.relative,duration:n.duration,domainContext:{performanceEntry:n}})}});return{stop:()=>r.unsubscribe()}}function A6(e,t){const r=ir(t,{type:exports.RumPerformanceEntryType.LONG_TASK,buffered:!0}).subscribe(o=>{for(const n of o){if(n.entryType!==exports.RumPerformanceEntryType.LONG_TASK||!t.trackLongTasks)break;const i=Hi(n.startTime),a={date:i.timeStamp,long_task:{id:et(),entry_type:zk.LONG_TASK,duration:oe(n.duration)},type:te.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:i.relative,duration:n.duration,domainContext:{performanceEntry:n}})}});return{stop(){r.unsubscribe()}}}function C6(e){e.register(0,({eventType:t})=>{if(!Ok())return wt;const r=Tk(),o=$k();return{type:t,session:{type:"synthetics"},synthetics:{test_id:r,result_id:o,injected:Ik()}}})}function N6(e,t,r){const o=Tm(e),n=r(o);return jc(t).forEach(([i,a])=>Zu(e,o,i.split(/\.|(?=\[\])/),a)),n}function Zu(e,t,r,o){const[n,...i]=r;if(n==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,s)=>Zu(a,t[s],i,o));return}if(!(!mg(e)||!mg(t))){if(i.length>0)return Zu(e[n],t[n],i,o);R6(e,n,t[n],o)}}function R6(e,t,r,o){const n=yn(r);n===o?e[t]=$e(r):o==="object"&&(n==="undefined"||n==="null")&&(e[t]={})}function mg(e){return yn(e)==="object"}const On={"view.name":"string","view.url":"string","view.referrer":"string"},An={context:"object"},Cn={service:"string",version:"string"};let NE;function P6(e,t,r,o,n){NE={[te.VIEW]:{"view.performance.lcp.resource_url":"string",...An,...On,...Cn},[te.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...An,...On,...Cn},[te.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...An,...On,...Cn},[te.ACTION]:{"action.target.name":"string",...An,...On,...Cn},[te.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...An,...On,...Cn},[te.VITAL]:{...An,...On,...Cn}};const i={[te.ERROR]:Nl(te.ERROR,o,n),[te.ACTION]:Nl(te.ACTION,o,n),[te.VITAL]:Nl(te.VITAL,o,n)};t.subscribe(12,({startTime:a,duration:s,rawRumEvent:c,domainContext:l})=>{const u=r.triggerHook(0,{eventType:c.type,startTime:a,duration:s});if(u===zr)return;const d=vr(u,c,{ddtags:Em(e).join(",")});j6(d,e.beforeSend,l,i)&&(Vr(d.context)&&delete d.context,t.notify(13,d))})}function j6(e,t,r,o){var n;if(t){const a=N6(e,NE[e.type],s=>t(s,r));if(a===!1&&e.type!==te.VIEW)return!1;a===!1&&Q.warn("Can't dismiss view events using beforeSend!")}return!((n=o[e.type])===null||n===void 0?void 0:n.isLimitReached())}function D6(e,t,r,o){e.register(0,({eventType:n,startTime:i})=>{const a=t.findTrackedSession(i),s=o.findView(i);if(!a||!s)return zr;let c,l,u;return n===te.VIEW?(c=r.getReplayStats(s.id)?!0:void 0,l=a.sessionReplay===1,u=s.sessionIsActive?void 0:!1):c=r.isRecording()?!0:void 0,{type:n,session:{id:a.id,type:"user",has_replay:c,sampled_for_replay:l,is_active:u}}}),e.register(1,({startTime:n})=>{const i=t.findTrackedSession(n);return i?{session:{id:i.id}}:wt})}function z6(e){e.register(0,({eventType:t})=>({type:t,connectivity:mk()}))}function M6(e,t,r){e.register(0,({eventType:o})=>{const n=t.source;return{type:o,_dd:{format_version:2,drift:MS(),configuration:{session_sample_rate:Bo(t.sessionSampleRate,3),session_replay_sample_rate:Bo(t.sessionReplaySampleRate,3),profiling_sample_rate:Bo(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:sn()?"6.24.1":void 0,sdk_name:r},application:{id:t.applicationId},date:Be(),source:n}}),e.register(1,()=>({application:{id:t.applicationId}}))}function U6(e,t){e.register(1,()=>t.isGranted()?wt:zr)}const L6=SD,F6=[te.ACTION,te.ERROR,te.LONG_TASK,te.RESOURCE,te.VITAL];function V6(e){return{addEvent:(t,r,o,n)=>{F6.includes(r.type)&&e.notify(12,{startTime:t,rawRumEvent:r,domainContext:o,duration:n})}}}function Z6(e,t){if(!t.metricsEnabled)return{stop:_e};const{unsubscribe:r}=e.subscribe(4,({initialViewMetrics:o})=>{!o.largestContentfulPaint||!o.navigationTimings||(ea("Initial view metrics",{metrics:B6(o.largestContentfulPaint,o.navigationTimings)}),r())});return{stop:r}}function B6(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function q6(e,t,r,o,n,i,a,s,c){const l=[],u=new _M,d=L6();u.subscribe(13,Fe=>Im("rum",Fe));const f=Fe=>{u.notify(14,{error:Fe}),_o("Error reported to customer",{"error.message":Fe.message})},m=_D(e),g=m.subscribe(Fe=>{u.notify(11,Fe)});l.push(()=>g.unsubscribe());const h=$D("browser-rum-sdk",e,d,f,m,n);l.push(h.stop);const y=sn()?r6():t6(e,u,i);if(sn())a6(u);else{const Fe=i6(e,u,f,m,y.expireObservable,n);l.push(()=>Fe.stop()),h6(h,u,Fe.flushController.flushObservable)}const b=vM(),w=l6(e,location),{observable:x,stop:v}=yM();l.push(v),M6(d,e,c);const k=_6(d,e),E=xM(u);l.push(()=>E.stop());const I=c6(u,d,w,location);l.push(()=>I.stop());const A=m6(u,d,e);D6(d,y,t,E),z6(d),U6(d,i);const M=kz(d,e,"rum"),U=Ez(d,e,y,"rum"),K=Sz(d,e,"rum"),{actionContexts:ge,addAction:q,addEvent:F,stop:ce}=G6(u,d,e,k,b,x,f);l.push(ce);const{addTiming:le,startView:pe,setViewName:G,setViewContext:se,setViewContextProperty:V,getViewContext:ye,stop:ue}=YU(u,d,e,location,b,x,w,t,E,o);l.push(ue);const{stop:ve}=Z6(u,h);l.push(ve);const{stop:P}=X4(u,e,k);if(l.push(P),e.trackLongTasks)if(Zr(exports.RumPerformanceEntryType.LONG_ANIMATION_FRAME)){const{stop:Fe}=O6(u,e);l.push(Fe)}else A6(u,e);const{addError:H}=M4(u,e,s);s.unbuffer(),MM(u,e,y,U,K);const me=Az(u,k,a),Te=bM(e.applicationId,y,E,ge,I);return l.push(()=>r.stop()),{addAction:q,addEvent:F,addError:H,addTiming:le,addFeatureFlagEvaluation:A.addFeatureFlagEvaluation,startView:pe,setViewContext:se,setViewContextProperty:V,getViewContext:ye,setViewName:G,lifeCycle:u,viewHistory:E,session:y,stopSession:()=>y.expire(),getInternalContext:Te.get,startDurationVital:me.startDurationVital,stopDurationVital:me.stopDurationVital,addDurationVital:me.addDurationVital,addOperationStepVital:me.addOperationStepVital,globalContext:M,userContext:U,accountContext:K,telemetry:h,stop:()=>{l.forEach(Fe=>Fe())},hooks:d}}function G6(e,t,r,o,n,i,a){const s=j4(e,t,n,i,r),c=V6(e),l=S6(t,r),u=$6(r,t);return C6(t),P6(r,e,t,a),{pageStateHistory:o,addAction:s.addAction,addEvent:c.addEvent,actionContexts:s.actionContexts,stop:()=>{s.stop(),u.stop(),l.stop(),o.stop()}}}function H6(e,{session:t,viewContext:r,errorType:o}){const n=t?t.id:"no-session-id",i=[];o!==void 0&&i.push(`error-type=${o}`),r&&(i.push(`seed=${r.id}`),i.push(`from=${r.startClocks.timeStamp}`));const a=W6(e),s=`/rum/replay/sessions/${n}`;return`${a}${s}?${i.join("&")}`}function W6(e){const t=e.site,r=e.subdomain||J6(e);return`https://${r?`${r}.`:""}${t}`}function J6(e){switch(e.site){case Qr:case n2:return"app";case tk:return"dd";default:return}}const K6=1e3;let $t;function Y6(e){return Bc(e).segments_count}function X6(e){Bc(e).segments_count+=1}function Q6(e){Bc(e).records_count+=1}function eL(e,t){Bc(e).segments_total_raw_size+=t}function tL(e){return $t?.get(e)}function Bc(e){$t||($t=new Map);let t;return $t.has(e)?t=$t.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},$t.set(e,t),$t.size>K6&&rL()),t}function rL(){if(!$t)return;const e=$t.keys().next().value;e&&$t.delete(e)}function RE(e,t,r){let o=0,n=[],i,a=!0,s=0;const c=[],{stop:l}=Oe(e,t,"message",({data:f})=>{if(f.type!=="wrote"||f.streamId!==r)return;const m=c[0];m&&(m.id===f.id?(c.shift(),o+=f.additionalBytesCount,n.push(f.result),i=f.trailer,m.writeCallback?m.writeCallback(f.result.byteLength):m.finishCallback&&m.finishCallback()):m.id<f.id&&l())});function u(){const f=n.length===0?new Uint8Array(0):ck(n.concat(i)),m={rawBytesCount:o,output:f,outputBytesCount:f.byteLength,encoding:"deflate"};return o=0,n=[],m}function d(){a||(t.postMessage({action:"reset",streamId:r}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(f,m){t.postMessage({action:"write",id:s,data:f,streamId:r}),c.push({id:s,writeCallback:m,data:f}),a=!1,s+=1},finish(f){d(),c.length?(c.forEach(m=>{delete m.writeCallback}),c[c.length-1].finishCallback=()=>f(u())):f(u())},finishSync(){d();const f=c.map(m=>m.data).join("");return c.length=0,{...u(),pendingData:f}},estimateEncodedBytesCount(f){return f.length/8},stop(){l()}}}function Mm({configuredUrl:e,error:t,source:r,scriptType:o}){if(Q.error(`${r} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&nL(t.message)){let n;e?n=`Please make sure the ${o} URL ${e} is correct and CSP is correctly configured.`:n="Please make sure CSP is correctly configured.",Q.error(`${n} See documentation at ${Ac}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&Om(t)}function nL(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const oL=30*Ke;function PE(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([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]),n=new Uint8Array([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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.1"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let Re={status:0};function jE(e,t,r,o=PE){switch(Re.status===0&&iL(e,t,o),Re.status){case 1:return Re.initializationFailureCallbacks.push(r),Re.worker;case 3:return Re.worker}}function pg(){return Re.status}function iL(e,t,r=PE){try{const o=r(e),{stop:n}=Oe(e,o,"error",s=>{Zl(e,t,s)}),{stop:i}=Oe(e,o,"message",({data:s})=>{s.type==="errored"?Zl(e,t,s.error,s.streamId):s.type==="initialized"&&sL(s.version)});o.postMessage({action:"init"}),Je(()=>aL(t),oL),Re={status:1,worker:o,stop:()=>{n(),i()},initializationFailureCallbacks:[]}}catch(o){Zl(e,t,o)}}function aL(e){Re.status===1&&(Q.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Re.initializationFailureCallbacks.forEach(t=>t()),Re={status:2})}function sL(e){Re.status===1&&(Re={status:3,worker:Re.worker,stop:Re.stop,version:e})}function Zl(e,t,r,o){Re.status===1||Re.status===0?(Mm({configuredUrl:e.workerUrl,error:r,source:t,scriptType:"worker"}),Re.status===1&&Re.initializationFailureCallbacks.forEach(n=>n()),Re={status:2}):Om(r,{worker_version:Re.status===3&&Re.version,stream_id:o})}function DE(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function cL(e,t,r,o){const n=t.findTrackedSession(),i=lL(n,o),a=r.findView();return H6(e,{viewContext:a,errorType:i,session:n})}function lL(e,t){if(!DE())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function uL(e,t){if(!e.metricsEnabled)return{stop:_e};let r,o,n;const{unsubscribe:i}=t.subscribe(a=>{switch(a.type){case"start":r={forced:a.forced,timestamp:Be()},o=void 0,n=void 0;break;case"document-ready":r&&(o=Ne(r.timestamp,Be()));break;case"recorder-settled":r&&(n=Ne(r.timestamp,Be()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":i(),r&&ea("Recorder init metrics",{metrics:dL(r.forced,n,Ne(r.timestamp,Be()),a.type,o)});break}});return{stop:i}}function dL(e,t,r,o,n){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:r,result:o,waitForDocReadyDuration:n}}function fL(e,t,r,o,n,i,a){let s=0,c;t.subscribe(9,()=>{(s===2||s===3)&&(f(),s=1)}),t.subscribe(10,()=>{s===1&&d()});const l=new he;uL(a,l);const u=async m=>{l.notify({type:"start",forced:m});const[g]=await Promise.all([hg(l,{type:"recorder-settled"},n()),hg(l,{type:"document-ready"},XD(e,"interactive"))]);if(s!==2){l.notify({type:"aborted"});return}if(!g){s=0,l.notify({type:"recorder-load-failed"});return}const h=i();if(!h){s=0,l.notify({type:"deflate-encoder-load-failed"});return}({stop:c}=g(t,e,r,o,h,a)),s=3,l.notify({type:"succeeded"})};function d(m){const g=r.findTrackedSession();if(mL(g,m)){s=1;return}if(pL(s))return;s=2;const h=hL(g,m)||!1;u(h).catch(pr),h&&r.setForcedReplay()}function f(){s===3&&c?.(),s=0}return{start:d,stop:f,getSessionReplayLink(){return cL(e,r,o,s!==0)},isRecording:()=>s===3}}function mL(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function pL(e){return e===2||e===3}function hL(e,t){return t&&t.force&&e.sessionReplay===0}async function hg(e,t,r){try{return await r}finally{e.notify(t)}}function gL(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:_e},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function vL(e,t){if(sn()&&!wk("records")||!DE())return{start:_e,stop:_e,getReplayStats:()=>{},onRumStart:_e,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:r,shouldStartImmediately:o}=gL();return{start:i=>r.start(i),stop:()=>r.stop(),getSessionReplayLink:()=>r.getSessionReplayLink(),onRumStart:n,isRecording:()=>pg()===3&&r.isRecording(),getReplayStats:i=>pg()===3?tL(i):void 0};function n(i,a,s,c,l,u){let d;function f(){return d||(l??(l=jE(a,"Datadog Session Replay",()=>{r.stop()},t)),l&&(d=RE(a,l,1))),d}r=fL(a,i,s,c,e,f,u),o(a)&&r.start()}}async function yL(e=bL){try{return await e()}catch(t){Mm({error:t,source:"Recorder",scriptType:"module"})}}async function bL(){return(await Promise.resolve().then(()=>require("./startRecording-BE9dMdci.cjs"))).startRecording}function _L(){return It().Profiler!==void 0}const wL=e=>{let t={status:"starting"};return e.register(0,({eventType:r})=>r!==te.VIEW&&r!==te.LONG_TASK?wt:{type:r,_dd:{profiling:t}}),{get:()=>t,set:r=>{t=r}}};async function xL(e=SL){try{return await e()}catch(t){Mm({error:t,source:"Profiler",scriptType:"module"})}}async function SL(){return(await Promise.resolve().then(()=>require("./profiler-BUSOvmmE.cjs"))).createRumProfiler}function kL(){let e;function t(r,o,n,i,a,s){const c=i.findTrackedSession();if(!c||!Fk(c.id,n.profilingSampleRate))return;const l=wL(o);if(!_L()){l.set({status:"error",error_reason:"not-supported-by-browser"});return}xL().then(u=>{if(!u){_o("[DD_RUM] Failed to lazy load the RUM Profiler"),l.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=u(n,r,i,l,s),e.start(a.findView())}).catch(pr)}return{onRumStart:t,stop:()=>{e?.stop().catch(pr)}}}const EL=vL(yL),IL=kL(),Ho=hM(q6,EL,IL,{startDeflateWorker:jE,createDeflateEncoder:RE,sdkName:"rum"});K2(It(),"DD_RUM",Ho);const Sa={applicationId:"0b0a19b9-099b-4812-b342-930518330975",clientToken:"puba92c09799d321f572535176e9fe08256",site:"datadoghq.com",service:"gram-elements"};let Bu=!1,qu=!0;function TL(e={}){if(e.enabled===!1){qu=!1;return}if(!Bu)try{Ho.init({applicationId:Sa.applicationId,clientToken:Sa.clientToken,site:Sa.site,service:Sa.service,env:process.env.NODE_ENV||"production",sessionSampleRate:100,sessionReplaySampleRate:100,trackUserInteractions:!0,trackResources:!0,trackLongTasks:!0,defaultPrivacyLevel:"mask"}),e.projectSlug&&Ho.setGlobalContextProperty("projectSlug",e.projectSlug),e.variant&&Ho.setGlobalContextProperty("variant",e.variant),Bu=!0}catch(t){console.warn("[Elements] Failed to initialize Datadog RUM:",t),qu=!1}}function hs(e,t){if(!qu||!Bu)return;const r=e instanceof Error?e:new Error(String(e));try{Ho.addError(r,{...t,timestamp:new Date().toISOString()})}catch(o){console.warn("[Elements] Failed to track error:",o)}}const Um=["anthropic/claude-sonnet-4.5","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4","anthropic/claude-opus-4.5","openai/gpt-4o","openai/gpt-4o-mini","openai/gpt-5.1-codex","openai/gpt-5","openai/gpt-5.1","openai/gpt-4.1","anthropic/claude-3.7-sonnet","anthropic/claude-opus-4","google/gemini-2.5-pro-preview","google/gemini-3-pro-preview","moonshotai/kimi-k2","mistralai/mistral-medium-3","mistralai/mistral-medium-3.1","mistralai/codestral-2501"],$L=e=>Object.fromEntries(Object.entries(e).map(([t,r])=>[t,{...r.description?{description:r.description}:void 0,parameters:r.parameters instanceof ch.ZodType?ch.toJSONSchema(r.parameters):r.parameters}])),OL=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>!t.disabled&&t.type!=="backend"));let gs=null;function AL(e,t){const r=zE(t);gs={helpers:e,requiresApproval:r}}function CL(){gs=null}function zE(e){if(!e)return()=>!1;if(typeof e=="function")return r=>e({toolName:r});const t=new Set(e);return r=>t.has(r)}const NL=(e,t)=>z.makeAssistantTool({...e,execute:async(r,o)=>{if(gs?.requiresApproval(t)){const{helpers:n}=gs,i=o.toolCallId??"";if(!n.isToolApproved(t)&&!await n.requestApproval(t,i,r))return{content:[{type:"text",text:`Tool "${t}" execution was denied by the user. Please acknowledge this and continue without using this tool's result.`}],isError:!0}}return e.execute?.(r,o)},toolName:t});function RL(e,t,r){if(!t||Array.isArray(t)&&t.length===0)return e;const o=zE(t);return Object.fromEntries(Object.entries(e).map(([n,i])=>{if(!o(n))return[n,i];const a=i.execute;return a?[n,{...i,execute:async(s,c)=>{const l=c??{},u=l.toolCallId??"";return r.isToolApproved(n)||await r.requestApproval(n,u,s)?a(s,l):{content:[{type:"text",text:`Tool "${n}" execution was denied by the user. Please acknowledge this and continue without using this tool's result.`}],isError:!0}}}]:[n,i]}))}const PL=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],jL=$.createLucideIcon("arrow-down",PL);const DL=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],zL=$.createLucideIcon("arrow-up",DL);const ML=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],UL=$.createLucideIcon("brain",ML);const LL=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Nr=$.createLucideIcon("check",LL);const FL=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vs=$.createLucideIcon("chevron-down",FL);const VL=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ZL=$.createLucideIcon("chevron-left",VL);const BL=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ME=$.createLucideIcon("chevron-right",BL);const qL=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Lm=$.createLucideIcon("copy",qL);const GL=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],HL=$.createLucideIcon("file-text",GL);const WL=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],JL=$.createLucideIcon("link",WL);const KL=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],ys=$.createLucideIcon("loader",KL);const YL=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],XL=$.createLucideIcon("maximize",YL);const QL=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],e5=$.createLucideIcon("message-circle",QL);const t5=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],r5=$.createLucideIcon("minimize",t5);const n5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],o5=$.createLucideIcon("panel-right-close",n5);const i5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],a5=$.createLucideIcon("panel-right-open",i5);const s5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],c5=$.createLucideIcon("pencil",s5);const l5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],UE=$.createLucideIcon("plus",l5);const u5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],d5=$.createLucideIcon("settings-2",u5);const f5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],m5=$.createLucideIcon("square",f5);const p5=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],LE=$.createLucideIcon("wrench",p5);const h5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xo=$.createLucideIcon("x",h5);var g5=Object.defineProperty,v5=Object.defineProperties,y5=Object.getOwnPropertyDescriptors,gg=Object.getOwnPropertySymbols,b5=Object.prototype.hasOwnProperty,_5=Object.prototype.propertyIsEnumerable,vg=(e,t,r)=>t in e?g5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xe=(e,t)=>{for(var r in t||(t={}))b5.call(t,r)&&vg(e,r,t[r]);if(gg)for(var r of gg(t))_5.call(t,r)&&vg(e,r,t[r]);return e},bs=(e,t)=>v5(e,y5(t)),FE="vercel.ai.error",w5=Symbol.for(FE),VE,x5=class ZE extends Error{constructor({name:t,message:r,cause:o}){super(r),this[VE]=!0,this.name=t,this.cause=o}static isInstance(t){return ZE.hasMarker(t,FE)}static hasMarker(t,r){const o=Symbol.for(r);return t!=null&&typeof t=="object"&&o in t&&typeof t[o]=="boolean"&&t[o]===!0}};VE=w5;var ze=x5,BE="AI_APICallError",qE=`vercel.ai.error.${BE}`,S5=Symbol.for(qE),GE,Zt=class extends ze{constructor({message:e,url:t,requestBodyValues:r,statusCode:o,responseHeaders:n,responseBody:i,cause:a,isRetryable:s=o!=null&&(o===408||o===409||o===429||o>=500),data:c}){super({name:BE,message:e,cause:a}),this[GE]=!0,this.url=t,this.requestBodyValues=r,this.statusCode=o,this.responseHeaders=n,this.responseBody=i,this.isRetryable=s,this.data=c}static isInstance(e){return ze.hasMarker(e,qE)}};GE=S5;var HE="AI_EmptyResponseBodyError",WE=`vercel.ai.error.${HE}`,k5=Symbol.for(WE),JE,E5=class extends ze{constructor({message:e="Empty response body"}={}){super({name:HE,message:e}),this[JE]=!0}static isInstance(e){return ze.hasMarker(e,WE)}};JE=k5;function KE(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var YE="AI_InvalidArgumentError",XE=`vercel.ai.error.${YE}`,I5=Symbol.for(XE),QE,eI=class extends ze{constructor({message:t,cause:r,argument:o}){super({name:YE,message:t,cause:r}),this[QE]=!0,this.argument=o}static isInstance(t){return ze.hasMarker(t,XE)}};QE=I5;var tI="AI_InvalidPromptError",rI=`vercel.ai.error.${tI}`,T5=Symbol.for(rI),nI,$5=class extends ze{constructor({prompt:e,message:t,cause:r}){super({name:tI,message:`Invalid prompt: ${t}`,cause:r}),this[nI]=!0,this.prompt=e}static isInstance(e){return ze.hasMarker(e,rI)}};nI=T5;var oI="AI_InvalidResponseDataError",iI=`vercel.ai.error.${oI}`,O5=Symbol.for(iI),aI,Mo=class extends ze{constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:oI,message:t}),this[aI]=!0,this.data=e}static isInstance(e){return ze.hasMarker(e,iI)}};aI=O5;var sI="AI_JSONParseError",cI=`vercel.ai.error.${sI}`,A5=Symbol.for(cI),lI,_s=class extends ze{constructor({text:e,cause:t}){super({name:sI,message:`JSON parsing failed: Text: ${e}.
38
38
  Error message: ${KE(t)}`,cause:t}),this[lI]=!0,this.text=e}static isInstance(e){return ze.hasMarker(e,cI)}};lI=A5;var uI="AI_LoadAPIKeyError",dI=`vercel.ai.error.${uI}`,C5=Symbol.for(dI),fI,ka=class extends ze{constructor({message:e}){super({name:uI,message:e}),this[fI]=!0}static isInstance(e){return ze.hasMarker(e,dI)}};fI=C5;var mI="AI_NoContentGeneratedError",pI=`vercel.ai.error.${mI}`,N5=Symbol.for(pI),hI,gI=class extends ze{constructor({message:e="No content generated."}={}){super({name:mI,message:e}),this[hI]=!0}static isInstance(e){return ze.hasMarker(e,pI)}};hI=N5;var vI="AI_TypeValidationError",yI=`vercel.ai.error.${vI}`,R5=Symbol.for(yI),bI,P5=class Gu extends ze{constructor({value:t,cause:r}){super({name:vI,message:`Type validation failed: Value: ${JSON.stringify(t)}.
39
39
  Error message: ${KE(r)}`,cause:r}),this[bI]=!0,this.value=t}static isInstance(t){return ze.hasMarker(t,yI)}static wrap({value:t,cause:r}){return Gu.isInstance(r)&&r.value===t?r:new Gu({value:t,cause:r})}};bI=R5;var li=P5,_I="AI_UnsupportedFunctionalityError",wI=`vercel.ai.error.${_I}`,j5=Symbol.for(wI),xI,Er=class extends ze{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:_I,message:t}),this[xI]=!0,this.functionality=e}static isInstance(e){return ze.hasMarker(e,wI)}};xI=j5;var yg=class extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function Bl(e){}function D5(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Bl,onError:r=Bl,onRetry:o=Bl,onComment:n}=e;let i="",a=!0,s,c="",l="";function u(h){const y=a?h.replace(/^\xEF\xBB\xBF/,""):h,[b,w]=z5(`${i}${y}`);for(const x of b)d(x);i=w,a=!1}function d(h){if(h===""){m();return}if(h.startsWith(":")){n&&n(h.slice(h.startsWith(": ")?2:1));return}const y=h.indexOf(":");if(y!==-1){const b=h.slice(0,y),w=h[y+1]===" "?2:1,x=h.slice(y+w);f(b,x,h);return}f(h,"",h)}function f(h,y,b){switch(h){case"event":l=y;break;case"data":c=`${c}${y}
40
40
  `;break;case"id":s=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?o(parseInt(y,10)):r(new yg(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:b}));break;default:r(new yg(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:y,line:b}));break}}function m(){c.length>0&&t({id:s,event:l||void 0,data:c.endsWith(`
@@ -93,7 +93,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
93
93
 
94
94
  Utilities:
95
95
  ${t.map(r=>`- ${r.language}: ${r.prompt}`).join(`
96
- `)}`}function VB(e){return e.map(t=>{const r=t.parts;if(!Array.isArray(r))return t;const o=r.map(n=>{const{callProviderMetadata:i,...a}=n;return a});return{...t,parts:o}})}const ZB=({children:e,config:t})=>{const r=oj(t),o=MB({auth:t.api,projectSlug:t.projectSlug}),n=AS(),[i,a]=N.useState(t.model?.defaultModel??Um[0]),[s,c]=N.useState(t.modal?.defaultExpanded??!1),[l,u]=N.useState(t.modal?.defaultOpen),d=t.plugins??$.recommended,f=FB(t.systemPrompt,d);N.useEffect(()=>{TL({enabled:t.errorTracking?.enabled,projectSlug:t.projectSlug,variant:t.variant})},[]);const{data:m}=rj({auth:o,mcp:t.mcp,environment:t.environment??{},toolsToInclude:t.tools?.toolsToInclude,gramEnvironment:t.gramEnvironment}),g=N.useRef({requestApproval:n.requestApproval,isToolApproved:n.isToolApproved,whitelistTool:n.whitelistTool});g.current={requestApproval:n.requestApproval,isToolApproved:n.isToolApproved,whitelistTool:n.whitelistTool};const h=N.useCallback(()=>({requestApproval:(...I)=>g.current.requestApproval(...I),isToolApproved:(...I)=>g.current.isToolApproved(...I),whitelistTool:(...I)=>g.current.whitelistTool(...I)}),[]);N.useEffect(()=>(t.tools?.toolsRequiringApproval&&AL(h(),t.tools.toolsRequiringApproval),()=>{CL()}),[t.tools?.toolsRequiringApproval,h]);const y=N.useRef(null),b=N.useRef(null),w=N.useRef(new Map),x=N.useMemo(()=>({sendMessages:async({messages:I,abortSignal:A})=>{const M=!!t.languageModel;if(o.isLoading)throw new Error("Session is loading");const U=y.current,K=U?.threadListItem?.getState?.(),ge=U?.threads?.getState?.(),q=K?.remoteId,F=K?.id??ge?.mainThreadId??ge?.threadIds?.[0];let ce=q;if(ja(ce)||!ce&&F){const ve=ce??F;if(ve){const P=w.current.get(ve);if(P)ce=P;else{const H=crypto.randomUUID();w.current.set(ve,H),ce=H}}}ce||(b.current||(b.current=crypto.randomUUID()),ce=b.current);const le=y.current?.thread.getModelContext(),pe=$L(OL(le?.tools??{})),G={...o.headers,"Gram-Chat-ID":ce,...t.gramEnvironment&&{"Gram-Environment":t.gramEnvironment}},se=M?null:AI({baseURL:r,apiKey:"unused, but must be set",headers:G});t.languageModel&&console.log("Using custom language model",t.languageModel);const V={...m,...pd.frontendTools(pe)},ye=RL(V,t.tools?.toolsRequiringApproval,h()),ue=t.languageModel?t.languageModel:se.chat(i);try{const ve=VB(I),P=OB(ve);return IB({system:f,model:ue,messages:P,tools:ye,stopWhen:qT(10),experimental_transform:PB({delayInMs:15}),abortSignal:A,onError:({error:me})=>{console.error("Stream error in onError callback:",me),hs(me,{source:"streaming"})}}).toUIMessageStream()}catch(ve){throw console.error("Error creating stream:",ve),hs(ve,{source:"stream-creation"}),ve}},reconnectToStream:async()=>{throw new Error("Stream reconnection not supported")}}),[t.languageModel,t.tools?.toolsRequiringApproval,i,f,m,h,r,o.headers,o.isLoading]),v=t.history?.enabled??!1,k=N.useMemo(()=>({config:t,setModel:a,model:i,isExpanded:s,setIsExpanded:c,isOpen:l??!1,setIsOpen:u,plugins:d,mcpTools:m}),[t,i,s,l,d,m]),E=t.tools?.frontendTools??{};return v&&!o.isLoading?p.jsx(BB,{transport:x,apiUrl:r,headers:o.headers,contextValue:k,runtimeRef:y,frontendTools:E,localIdToUuidMap:w.current,children:e}):p.jsx(qB,{transport:x,contextValue:k,runtimeRef:y,frontendTools:E,children:e})},BB=({children:e,transport:t,apiUrl:r,headers:o,contextValue:n,runtimeRef:i,frontendTools:a,localIdToUuidMap:s})=>{const c=yO({apiUrl:r,headers:o,localIdToUuidMap:s}),l=n?.config.history?.initialThreadId,u=N.useCallback(()=>pd.useChatRuntime({transport:t}),[t]),d=z.unstable_useRemoteThreadListRuntime({adapter:c,runtimeHook:u});N.useEffect(()=>{i.current=d},[d,i]);const f=N.useRef(!1);N.useEffect(()=>{if(l&&!f.current){f.current=!0;const g=setTimeout(()=>{d.threads.switchToThread(l).catch(h=>{console.error("Failed to switch to initial thread:",h)})},100);return()=>clearTimeout(g)}},[l,d]);const m=c.unstable_Provider??(({children:g})=>p.jsx(p.Fragment,{children:g}));return p.jsx(z.AssistantRuntimeProvider,{runtime:d,children:p.jsx(m,{children:p.jsxs($.ElementsContext.Provider,{value:n,children:[p.jsx("div",{className:`${vd} h-full`,children:e}),p.jsx(Zv,{tools:a})]})})})},qB=({children:e,transport:t,contextValue:r,runtimeRef:o,frontendTools:n})=>{const i=pd.useChatRuntime({transport:t});return N.useEffect(()=>{o.current=i},[i,o]),p.jsx(z.AssistantRuntimeProvider,{runtime:i,children:p.jsxs($.ElementsContext.Provider,{value:r,children:[p.jsx("div",{className:`${vd} h-full`,children:e}),p.jsx(Zv,{tools:n})]})})},GB=new ZP,HB=e=>p.jsx(BP,{client:GB,children:p.jsx(UB,{children:p.jsx(ZB,{...e})})});function YT(){return{threadId:z.useAssistantState(({threadListItem:t})=>t.remoteId??null)}}function uv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function np(...e){return t=>{let r=!1;const o=e.map(n=>{const i=uv(n,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let n=0;n<o.length;n++){const i=o[n];typeof i=="function"?i():uv(e[n],null)}}}}function ht(...e){return _.useCallback(np(...e),e)}var WB=Symbol.for("react.lazy"),Ts=_[" use ".trim().toString()];function JB(e){return typeof e=="object"&&e!==null&&"then"in e}function XT(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===WB&&"_payload"in e&&JB(e._payload)}function QT(e){const t=YB(e),r=_.forwardRef((o,n)=>{let{children:i,...a}=o;XT(i)&&typeof Ts=="function"&&(i=Ts(i._payload));const s=_.Children.toArray(i),c=s.find(eq);if(c){const l=c.props.children,u=s.map(d=>d===c?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:d);return p.jsx(t,{...a,ref:n,children:_.isValidElement(l)?_.cloneElement(l,void 0,u):null})}return p.jsx(t,{...a,ref:n,children:i})});return r.displayName=`${e}.Slot`,r}var KB=QT("Slot");function YB(e){const t=_.forwardRef((r,o)=>{let{children:n,...i}=r;if(XT(n)&&typeof Ts=="function"&&(n=Ts(n._payload)),_.isValidElement(n)){const a=rq(n),s=tq(i,n.props);return n.type!==_.Fragment&&(s.ref=o?np(o,a):a),_.cloneElement(n,s)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e$=Symbol("radix.slottable");function XB(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=e$,t}var QB=XB("Slottable");function eq(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e$}function tq(e,t){const r={...t};for(const o in t){const n=e[o],i=t[o];/^on[A-Z]/.test(o)?n&&i?r[o]=(...s)=>{const c=i(...s);return n(...s),c}:n&&(r[o]=n):o==="style"?r[o]={...n,...i}:o==="className"&&(r[o]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}function rq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const dv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fv=$.clsx,t$=(e,t)=>r=>{var o;if(t?.variants==null)return fv(e,r?.class,r?.className);const{variants:n,defaultVariants:i}=t,a=Object.keys(n).map(l=>{const u=r?.[l],d=i?.[l];if(u===null)return null;const f=dv(u)||dv(d);return n[l][f]}),s=r&&Object.entries(r).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((l,u)=>{let{class:d,className:f,...m}=u;return Object.entries(m).every(g=>{let[h,y]=g;return Array.isArray(y)?y.includes({...i,...s}[h]):{...i,...s}[h]===y})?[...l,d,f]:l},[]);return fv(e,a,c,r?.class,r?.className)},nq=t$("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),pt=_.forwardRef(({className:e,variant:t,size:r,asChild:o=!1,...n},i)=>{const a=o?KB:"button";return p.jsx(a,{"data-slot":"button",className:$.cn(nq({variant:t,size:r,className:e})),ref:i,...n})});pt.displayName="Button";const oq=({error:e,onRetry:t})=>p.jsx("div",{className:$.cn("aui-root aui-error-boundary bg-background flex h-full w-full flex-col items-center justify-center p-6"),children:p.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[p.jsx("div",{className:"text-destructive",children:p.jsx($.CircleAlert,{className:"size-12 stroke-[1.5px]"})}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("h3",{className:"text-foreground text-xl font-semibold",children:"Something went wrong"}),p.jsx("p",{className:"text-muted-foreground text-base",children:"An error occurred while loading the chat."}),e&&p.jsx("p",{className:"text-muted-foreground/60 max-w-md truncate text-sm",children:e.message})]}),p.jsx(pt,{onClick:t,variant:"default",className:"mt-2",children:"Try again"})]})}),iq=({children:e})=>p.jsx(p.Fragment,{children:e});class op extends N.Component{constructor(t){super(t),this.handleRetry=()=>{this.setState(r=>({hasError:!1,error:null,resetKey:r.resetKey+1})),this.props.onReset?.()},this.state={hasError:!1,error:null,resetKey:0}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){hs(t,{source:"error-boundary",componentStack:r.componentStack??void 0}),this.props.onError?.(t,r)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:p.jsx(oq,{error:this.state.error,onRetry:this.handleRetry}):p.jsx(iq,{children:this.props.children},this.state.resetKey)}}function De(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),r===!1||!n.defaultPrevented)return t?.(n)}}function aq(e,t){const r=_.createContext(t),o=i=>{const{children:a,...s}=i,c=_.useMemo(()=>s,Object.values(s));return p.jsx(r.Provider,{value:c,children:a})};o.displayName=e+"Provider";function n(i){const a=_.useContext(r);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,n]}function ia(e,t=[]){let r=[];function o(i,a){const s=_.createContext(a),c=r.length;r=[...r,a];const l=d=>{const{scope:f,children:m,...g}=d,h=f?.[e]?.[c]||s,y=_.useMemo(()=>g,Object.values(g));return p.jsx(h.Provider,{value:y,children:m})};l.displayName=i+"Provider";function u(d,f){const m=f?.[e]?.[c]||s,g=_.useContext(m);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const n=()=>{const i=r.map(a=>_.createContext(a));return function(s){const c=s?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return n.scopeName=e,[o,sq(n,...t)]}function sq(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(i){const a=o.reduce((s,{useScope:c,scopeName:l})=>{const d=c(i)[`__scope${l}`];return{...s,...d}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function ip(e){const t=cq(e),r=_.forwardRef((o,n)=>{const{children:i,...a}=o,s=_.Children.toArray(i),c=s.find(uq);if(c){const l=c.props.children,u=s.map(d=>d===c?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:d);return p.jsx(t,{...a,ref:n,children:_.isValidElement(l)?_.cloneElement(l,void 0,u):null})}return p.jsx(t,{...a,ref:n,children:i})});return r.displayName=`${e}.Slot`,r}function cq(e){const t=_.forwardRef((r,o)=>{const{children:n,...i}=r;if(_.isValidElement(n)){const a=fq(n),s=dq(i,n.props);return n.type!==_.Fragment&&(s.ref=o?np(o,a):a),_.cloneElement(n,s)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var r$=Symbol("radix.slottable");function lq(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=r$,t}function uq(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===r$}function dq(e,t){const r={...t};for(const o in t){const n=e[o],i=t[o];/^on[A-Z]/.test(o)?n&&i?r[o]=(...s)=>{const c=i(...s);return n(...s),c}:n&&(r[o]=n):o==="style"?r[o]={...n,...i}:o==="className"&&(r[o]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}function fq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=mq.reduce((e,t)=>{const r=ip(`Primitive.${t}`),o=_.forwardRef((n,i)=>{const{asChild:a,...s}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function pq(e,t){e&&Vv.flushSync(()=>e.dispatchEvent(t))}function dn(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...r)=>t.current?.(...r),[])}function hq(e,t=globalThis?.document){const r=dn(e);_.useEffect(()=>{const o=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var gq="DismissableLayer",sd="dismissableLayer.update",vq="dismissableLayer.pointerDownOutside",yq="dismissableLayer.focusOutside",mv,n$=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kc=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:n,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...c}=e,l=_.useContext(n$),[u,d]=_.useState(null),f=u?.ownerDocument??globalThis?.document,[,m]=_.useState({}),g=ht(t,I=>d(I)),h=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=h.indexOf(y),w=u?h.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,v=w>=b,k=wq(I=>{const A=I.target,M=[...l.branches].some(U=>U.contains(A));!v||M||(n?.(I),a?.(I),I.defaultPrevented||s?.())},f),E=xq(I=>{const A=I.target;[...l.branches].some(U=>U.contains(A))||(i?.(I),a?.(I),I.defaultPrevented||s?.())},f);return hq(I=>{w===l.layers.size-1&&(o?.(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(mv=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),pv(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=mv)}},[u,f,r,l]),_.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),pv())},[u,l]),_.useEffect(()=>{const I=()=>m({});return document.addEventListener(sd,I),()=>document.removeEventListener(sd,I)},[]),p.jsx(Le.div,{...c,ref:g,style:{pointerEvents:x?v?"auto":"none":void 0,...e.style},onFocusCapture:De(e.onFocusCapture,E.onFocusCapture),onBlurCapture:De(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:De(e.onPointerDownCapture,k.onPointerDownCapture)})});Kc.displayName=gq;var bq="DismissableLayerBranch",_q=_.forwardRef((e,t)=>{const r=_.useContext(n$),o=_.useRef(null),n=ht(t,o);return _.useEffect(()=>{const i=o.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),p.jsx(Le.div,{...e,ref:n})});_q.displayName=bq;function wq(e,t=globalThis?.document){const r=dn(e),o=_.useRef(!1),n=_.useRef(()=>{});return _.useEffect(()=>{const i=s=>{if(s.target&&!o.current){let c=function(){o$(vq,r,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=c,t.addEventListener("click",n.current,{once:!0})):c()}else t.removeEventListener("click",n.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function xq(e,t=globalThis?.document){const r=dn(e),o=_.useRef(!1);return _.useEffect(()=>{const n=i=>{i.target&&!o.current&&o$(yq,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function pv(){const e=new CustomEvent(sd);document.dispatchEvent(e)}function o$(e,t,r,{discrete:o}){const n=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?pq(n,i):n.dispatchEvent(i)}var Ct=globalThis?.document?_.useLayoutEffect:()=>{},Sq=_[" useId ".trim().toString()]||(()=>{}),kq=0;function Zn(e){const[t,r]=_.useState(Sq());return Ct(()=>{r(o=>o??String(kq++))},[e]),t?`radix-${t}`:""}const Eq=["top","right","bottom","left"],Ur=Math.min,vt=Math.max,$s=Math.round,$a=Math.floor,tr=e=>({x:e,y:e}),Iq={left:"right",right:"left",bottom:"top",top:"bottom"},Tq={start:"end",end:"start"};function cd(e,t,r){return vt(e,Ur(t,r))}function br(e,t){return typeof e=="function"?e(t):e}function _r(e){return e.split("-")[0]}function ko(e){return e.split("-")[1]}function ap(e){return e==="x"?"y":"x"}function sp(e){return e==="y"?"height":"width"}const $q=new Set(["top","bottom"]);function er(e){return $q.has(_r(e))?"y":"x"}function cp(e){return ap(er(e))}function Oq(e,t,r){r===void 0&&(r=!1);const o=ko(e),n=cp(e),i=sp(n);let a=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Os(a)),[a,Os(a)]}function Aq(e){const t=Os(e);return[ld(e),t,ld(t)]}function ld(e){return e.replace(/start|end/g,t=>Tq[t])}const hv=["left","right"],gv=["right","left"],Cq=["top","bottom"],Nq=["bottom","top"];function Rq(e,t,r){switch(e){case"top":case"bottom":return r?t?gv:hv:t?hv:gv;case"left":case"right":return t?Cq:Nq;default:return[]}}function Pq(e,t,r,o){const n=ko(e);let i=Rq(_r(e),r==="start",o);return n&&(i=i.map(a=>a+"-"+n),t&&(i=i.concat(i.map(ld)))),i}function Os(e){return e.replace(/left|right|bottom|top/g,t=>Iq[t])}function jq(e){return{top:0,right:0,bottom:0,left:0,...e}}function i$(e){return typeof e!="number"?jq(e):{top:e,right:e,bottom:e,left:e}}function As(e){const{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function vv(e,t,r){let{reference:o,floating:n}=e;const i=er(t),a=cp(t),s=sp(a),c=_r(t),l=i==="y",u=o.x+o.width/2-n.width/2,d=o.y+o.height/2-n.height/2,f=o[s]/2-n[s]/2;let m;switch(c){case"top":m={x:u,y:o.y-n.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-n.width,y:d};break;default:m={x:o.x,y:o.y}}switch(ko(t)){case"start":m[a]-=f*(r&&l?-1:1);break;case"end":m[a]+=f*(r&&l?-1:1);break}return m}const Dq=async(e,t,r)=>{const{placement:o="bottom",strategy:n="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=vv(l,o,c),f=o,m={},g=0;for(let h=0;h<s.length;h++){const{name:y,fn:b}=s[h],{x:w,y:x,data:v,reset:k}=await b({x:u,y:d,initialPlacement:o,placement:f,strategy:n,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=w??u,d=x??d,m={...m,[y]:{...m[y],...v}},k&&g<=50&&(g++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(l=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:n}):k.rects),{x:u,y:d}=vv(l,f,c)),h=-1)}return{x:u,y:d,placement:f,strategy:n,middlewareData:m}};async function bi(e,t){var r;t===void 0&&(t={});const{x:o,y:n,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=br(t,e),g=i$(m),y=s[f?d==="floating"?"reference":"floating":d],b=As(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(y)))==null||r?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:o,y:n,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),v=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},k=As(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:x,strategy:c}):w);return{top:(b.top-k.top+g.top)/v.y,bottom:(k.bottom-b.bottom+g.bottom)/v.y,left:(b.left-k.left+g.left)/v.x,right:(k.right-b.right+g.right)/v.x}}const zq=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:n,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=br(e,t)||{};if(l==null)return{};const d=i$(u),f={x:r,y:o},m=cp(n),g=sp(m),h=await a.getDimensions(l),y=m==="y",b=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=i.reference[g]+i.reference[m]-f[m]-i.floating[g],k=f[m]-i.reference[m],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let I=E?E[x]:0;(!I||!await(a.isElement==null?void 0:a.isElement(E)))&&(I=s.floating[x]||i.floating[g]);const A=v/2-k/2,M=I/2-h[g]/2-1,U=Ur(d[b],M),K=Ur(d[w],M),ge=U,q=I-h[g]-K,F=I/2-h[g]/2+A,ce=cd(ge,F,q),le=!c.arrow&&ko(n)!=null&&F!==ce&&i.reference[g]/2-(F<ge?U:K)-h[g]/2<0,pe=le?F<ge?F-ge:F-q:0;return{[m]:f[m]+pe,data:{[m]:ce,centerOffset:F-ce-pe,...le&&{alignmentOffset:pe}},reset:le}}}),Mq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:n,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...y}=br(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const b=_r(n),w=er(s),x=_r(s)===s,v=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=f||(x||!h?[Os(s)]:Aq(s)),E=g!=="none";!f&&E&&k.push(...Pq(s,h,g,v));const I=[s,...k],A=await bi(t,y),M=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push(A[b]),d){const F=Oq(n,a,v);M.push(A[F[0]],A[F[1]])}if(U=[...U,{placement:n,overflows:M}],!M.every(F=>F<=0)){var K,ge;const F=(((K=i.flip)==null?void 0:K.index)||0)+1,ce=I[F];if(ce&&(!(d==="alignment"?w!==er(ce):!1)||U.every(G=>er(G.placement)===w?G.overflows[0]>0:!0)))return{data:{index:F,overflows:U},reset:{placement:ce}};let le=(ge=U.filter(pe=>pe.overflows[0]<=0).sort((pe,G)=>pe.overflows[1]-G.overflows[1])[0])==null?void 0:ge.placement;if(!le)switch(m){case"bestFit":{var q;const pe=(q=U.filter(G=>{if(E){const se=er(G.placement);return se===w||se==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(se=>se>0).reduce((se,V)=>se+V,0)]).sort((G,se)=>G[1]-se[1])[0])==null?void 0:q[0];pe&&(le=pe);break}case"initialPlacement":le=s;break}if(n!==le)return{reset:{placement:le}}}return{}}}};function yv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bv(e){return Eq.some(t=>e[t]>=0)}const Uq=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:o="referenceHidden",...n}=br(e,t);switch(o){case"referenceHidden":{const i=await bi(t,{...n,elementContext:"reference"}),a=yv(i,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bv(a)}}}case"escaped":{const i=await bi(t,{...n,altBoundary:!0}),a=yv(i,r.floating);return{data:{escapedOffsets:a,escaped:bv(a)}}}default:return{}}}}},a$=new Set(["left","top"]);async function Lq(e,t){const{placement:r,platform:o,elements:n}=e,i=await(o.isRTL==null?void 0:o.isRTL(n.floating)),a=_r(r),s=ko(r),c=er(r)==="y",l=a$.has(a)?-1:1,u=i&&c?-1:1,d=br(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof g=="number"&&(m=s==="end"?g*-1:g),c?{x:m*u,y:f*l}:{x:f*l,y:m*u}}const Fq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:n,y:i,placement:a,middlewareData:s}=t,c=await Lq(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:n+c.x,y:i+c.y,data:{...c,placement:a}}}}},Vq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:n}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...c}=br(e,t),l={x:r,y:o},u=await bi(t,c),d=er(_r(n)),f=ap(d);let m=l[f],g=l[d];if(i){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=m+u[y],x=m-u[b];m=cd(w,m,x)}if(a){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=g+u[y],x=g-u[b];g=cd(w,g,x)}const h=s.fn({...t,[f]:m,[d]:g});return{...h,data:{x:h.x-r,y:h.y-o,enabled:{[f]:i,[d]:a}}}}}},Zq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:n,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=br(e,t),u={x:r,y:o},d=er(n),f=ap(d);let m=u[f],g=u[d];const h=br(s,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const x=f==="y"?"height":"width",v=i.reference[f]-i.floating[x]+y.mainAxis,k=i.reference[f]+i.reference[x]-y.mainAxis;m<v?m=v:m>k&&(m=k)}if(l){var b,w;const x=f==="y"?"width":"height",v=a$.has(_r(n)),k=i.reference[d]-i.floating[x]+(v&&((b=a.offset)==null?void 0:b[d])||0)+(v?0:y.crossAxis),E=i.reference[d]+i.reference[x]+(v?0:((w=a.offset)==null?void 0:w[d])||0)-(v?y.crossAxis:0);g<k?g=k:g>E&&(g=E)}return{[f]:m,[d]:g}}}},Bq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:n,rects:i,platform:a,elements:s}=t,{apply:c=()=>{},...l}=br(e,t),u=await bi(t,l),d=_r(n),f=ko(n),m=er(n)==="y",{width:g,height:h}=i.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,y=f==="end"?"top":"bottom");const w=h-u.top-u.bottom,x=g-u.left-u.right,v=Ur(h-u[y],w),k=Ur(g-u[b],x),E=!t.middlewareData.shift;let I=v,A=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(A=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(I=w),E&&!f){const U=vt(u.left,0),K=vt(u.right,0),ge=vt(u.top,0),q=vt(u.bottom,0);m?A=g-2*(U!==0||K!==0?U+K:vt(u.left,u.right)):I=h-2*(ge!==0||q!==0?ge+q:vt(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:I});const M=await a.getDimensions(s.floating);return g!==M.width||h!==M.height?{reset:{rects:!0}}:{}}}};function Yc(){return typeof window<"u"}function Eo(e){return s$(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cr(e){var t;return(t=(s$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s$(e){return Yc()?e instanceof Node||e instanceof bt(e).Node:!1}function qt(e){return Yc()?e instanceof Element||e instanceof bt(e).Element:!1}function ar(e){return Yc()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function _v(e){return!Yc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const qq=new Set(["inline","contents"]);function aa(e){const{overflow:t,overflowX:r,overflowY:o,display:n}=Gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!qq.has(n)}const Gq=new Set(["table","td","th"]);function Hq(e){return Gq.has(Eo(e))}const Wq=[":popover-open",":modal"];function Xc(e){return Wq.some(t=>{try{return e.matches(t)}catch{return!1}})}const Jq=["transform","translate","scale","rotate","perspective"],Kq=["transform","translate","scale","rotate","perspective","filter"],Yq=["paint","layout","strict","content"];function lp(e){const t=up(),r=qt(e)?Gt(e):e;return Jq.some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Kq.some(o=>(r.willChange||"").includes(o))||Yq.some(o=>(r.contain||"").includes(o))}function Xq(e){let t=Lr(e);for(;ar(t)&&!so(t);){if(lp(t))return t;if(Xc(t))return null;t=Lr(t)}return null}function up(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Qq=new Set(["html","body","#document"]);function so(e){return Qq.has(Eo(e))}function Gt(e){return bt(e).getComputedStyle(e)}function Qc(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lr(e){if(Eo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_v(e)&&e.host||cr(e);return _v(t)?t.host:t}function c$(e){const t=Lr(e);return so(t)?e.ownerDocument?e.ownerDocument.body:e.body:ar(t)&&aa(t)?t:c$(t)}function _i(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const n=c$(e),i=n===((o=e.ownerDocument)==null?void 0:o.body),a=bt(n);if(i){const s=ud(a);return t.concat(a,a.visualViewport||[],aa(n)?n:[],s&&r?_i(s):[])}return t.concat(n,_i(n,[],r))}function ud(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function l$(e){const t=Gt(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=ar(e),i=n?e.offsetWidth:r,a=n?e.offsetHeight:o,s=$s(r)!==i||$s(o)!==a;return s&&(r=i,o=a),{width:r,height:o,$:s}}function dp(e){return qt(e)?e:e.contextElement}function Bn(e){const t=dp(e);if(!ar(t))return tr(1);const r=t.getBoundingClientRect(),{width:o,height:n,$:i}=l$(t);let a=(i?$s(r.width):r.width)/o,s=(i?$s(r.height):r.height)/n;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const e9=tr(0);function u$(e){const t=bt(e);return!up()||!t.visualViewport?e9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function t9(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==bt(e)?!1:t}function fn(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=dp(e);let a=tr(1);t&&(o?qt(o)&&(a=Bn(o)):a=Bn(e));const s=t9(i,r,o)?u$(i):tr(0);let c=(n.left+s.x)/a.x,l=(n.top+s.y)/a.y,u=n.width/a.x,d=n.height/a.y;if(i){const f=bt(i),m=o&&qt(o)?bt(o):o;let g=f,h=ud(g);for(;h&&o&&m!==g;){const y=Bn(h),b=h.getBoundingClientRect(),w=Gt(h),x=b.left+(h.clientLeft+parseFloat(w.paddingLeft))*y.x,v=b.top+(h.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,d*=y.y,c+=x,l+=v,g=bt(h),h=ud(g)}}return As({width:u,height:d,x:c,y:l})}function fp(e,t){const r=Qc(e).scrollLeft;return t?t.left+r:fn(cr(e)).left+r}function d$(e,t,r){r===void 0&&(r=!1);const o=e.getBoundingClientRect(),n=o.left+t.scrollLeft-(r?0:fp(e,o)),i=o.top+t.scrollTop;return{x:n,y:i}}function r9(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e;const i=n==="fixed",a=cr(o),s=t?Xc(t.floating):!1;if(o===a||s&&i)return r;let c={scrollLeft:0,scrollTop:0},l=tr(1);const u=tr(0),d=ar(o);if((d||!d&&!i)&&((Eo(o)!=="body"||aa(a))&&(c=Qc(o)),ar(o))){const m=fn(o);l=Bn(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}const f=a&&!d&&!i?d$(a,c,!0):tr(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:r.y*l.y-c.scrollTop*l.y+u.y+f.y}}function n9(e){return Array.from(e.getClientRects())}function o9(e){const t=cr(e),r=Qc(e),o=e.ownerDocument.body,n=vt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=vt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-r.scrollLeft+fp(e);const s=-r.scrollTop;return Gt(o).direction==="rtl"&&(a+=vt(t.clientWidth,o.clientWidth)-n),{width:n,height:i,x:a,y:s}}function i9(e,t){const r=bt(e),o=cr(e),n=r.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,c=0;if(n){i=n.width,a=n.height;const l=up();(!l||l&&t==="fixed")&&(s=n.offsetLeft,c=n.offsetTop)}return{width:i,height:a,x:s,y:c}}const a9=new Set(["absolute","fixed"]);function s9(e,t){const r=fn(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,i=ar(e)?Bn(e):tr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=n*i.x,l=o*i.y;return{width:a,height:s,x:c,y:l}}function wv(e,t,r){let o;if(t==="viewport")o=i9(e,r);else if(t==="document")o=o9(cr(e));else if(qt(t))o=s9(t,r);else{const n=u$(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return As(o)}function f$(e,t){const r=Lr(e);return r===t||!qt(r)||so(r)?!1:Gt(r).position==="fixed"||f$(r,t)}function c9(e,t){const r=t.get(e);if(r)return r;let o=_i(e,[],!1).filter(s=>qt(s)&&Eo(s)!=="body"),n=null;const i=Gt(e).position==="fixed";let a=i?Lr(e):e;for(;qt(a)&&!so(a);){const s=Gt(a),c=lp(a);!c&&s.position==="fixed"&&(n=null),(i?!c&&!n:!c&&s.position==="static"&&!!n&&a9.has(n.position)||aa(a)&&!c&&f$(e,a))?o=o.filter(u=>u!==a):n=s,a=Lr(a)}return t.set(e,o),o}function l9(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e;const a=[...r==="clippingAncestors"?Xc(t)?[]:c9(t,this._c):[].concat(r),o],s=a[0],c=a.reduce((l,u)=>{const d=wv(t,u,n);return l.top=vt(d.top,l.top),l.right=Ur(d.right,l.right),l.bottom=Ur(d.bottom,l.bottom),l.left=vt(d.left,l.left),l},wv(t,s,n));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function u9(e){const{width:t,height:r}=l$(e);return{width:t,height:r}}function d9(e,t,r){const o=ar(t),n=cr(t),i=r==="fixed",a=fn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=tr(0);function l(){c.x=fp(n)}if(o||!o&&!i)if((Eo(t)!=="body"||aa(n))&&(s=Qc(t)),o){const m=fn(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else n&&l();i&&!o&&n&&l();const u=n&&!o&&!i?d$(n,s):tr(0),d=a.left+s.scrollLeft-c.x-u.x,f=a.top+s.scrollTop-c.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function iu(e){return Gt(e).position==="static"}function xv(e,t){if(!ar(e)||Gt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return cr(e)===r&&(r=r.ownerDocument.body),r}function m$(e,t){const r=bt(e);if(Xc(e))return r;if(!ar(e)){let n=Lr(e);for(;n&&!so(n);){if(qt(n)&&!iu(n))return n;n=Lr(n)}return r}let o=xv(e,t);for(;o&&Hq(o)&&iu(o);)o=xv(o,t);return o&&so(o)&&iu(o)&&!lp(o)?r:o||Xq(e)||r}const f9=async function(e){const t=this.getOffsetParent||m$,r=this.getDimensions,o=await r(e.floating);return{reference:d9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function m9(e){return Gt(e).direction==="rtl"}const p9={convertOffsetParentRelativeRectToViewportRelativeRect:r9,getDocumentElement:cr,getClippingRect:l9,getOffsetParent:m$,getElementRects:f9,getClientRects:n9,getDimensions:u9,getScale:Bn,isElement:qt,isRTL:m9};function p$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function h9(e,t){let r=null,o;const n=cr(e);function i(){var s;clearTimeout(o),(s=r)==null||s.disconnect(),r=null}function a(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=l;if(s||t(),!f||!m)return;const g=$a(d),h=$a(n.clientWidth-(u+f)),y=$a(n.clientHeight-(d+m)),b=$a(u),x={rootMargin:-g+"px "+-h+"px "+-y+"px "+-b+"px",threshold:vt(0,Ur(1,c))||1};let v=!0;function k(E){const I=E[0].intersectionRatio;if(I!==c){if(!v)return a();I?a(!1,I):o=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!p$(l,e.getBoundingClientRect())&&a(),v=!1}try{r=new IntersectionObserver(k,{...x,root:n.ownerDocument})}catch{r=new IntersectionObserver(k,x)}r.observe(e)}return a(!0),i}function g9(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=dp(e),u=n||i?[...l?_i(l):[],..._i(t)]:[];u.forEach(b=>{n&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r)});const d=l&&s?h9(l,r):null;let f=-1,m=null;a&&(m=new ResizeObserver(b=>{let[w]=b;w&&w.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),r()}),l&&!c&&m.observe(l),m.observe(t));let g,h=c?fn(e):null;c&&y();function y(){const b=fn(e);h&&!p$(h,b)&&r(),h=b,g=requestAnimationFrame(y)}return r(),()=>{var b;u.forEach(w=>{n&&w.removeEventListener("scroll",r),i&&w.removeEventListener("resize",r)}),d?.(),(b=m)==null||b.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const v9=Fq,y9=Vq,b9=Mq,_9=Bq,w9=Uq,Sv=zq,x9=Zq,S9=(e,t,r)=>{const o=new Map,n={platform:p9,...r},i={...n.platform,_c:o};return Dq(e,t,{...n,platform:i})};var k9=typeof document<"u",E9=function(){},Ba=k9?N.useLayoutEffect:E9;function Cs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!Cs(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){const i=n[o];if(!(i==="_owner"&&e.$$typeof)&&!Cs(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function h$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kv(e,t){const r=h$(e);return Math.round(t*r)/r}function au(e){const t=_.useRef(e);return Ba(()=>{t.current=e}),t}function I9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=_.useState(o);Cs(f,o)||m(o);const[g,h]=_.useState(null),[y,b]=_.useState(null),w=_.useCallback(G=>{G!==E.current&&(E.current=G,h(G))},[]),x=_.useCallback(G=>{G!==I.current&&(I.current=G,b(G))},[]),v=i||g,k=a||y,E=_.useRef(null),I=_.useRef(null),A=_.useRef(u),M=c!=null,U=au(c),K=au(n),ge=au(l),q=_.useCallback(()=>{if(!E.current||!I.current)return;const G={placement:t,strategy:r,middleware:f};K.current&&(G.platform=K.current),S9(E.current,I.current,G).then(se=>{const V={...se,isPositioned:ge.current!==!1};F.current&&!Cs(A.current,V)&&(A.current=V,Vv.flushSync(()=>{d(V)}))})},[f,t,r,K,ge]);Ba(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(G=>({...G,isPositioned:!1})))},[l]);const F=_.useRef(!1);Ba(()=>(F.current=!0,()=>{F.current=!1}),[]),Ba(()=>{if(v&&(E.current=v),k&&(I.current=k),v&&k){if(U.current)return U.current(v,k,q);q()}},[v,k,q,U,M]);const ce=_.useMemo(()=>({reference:E,floating:I,setReference:w,setFloating:x}),[w,x]),le=_.useMemo(()=>({reference:v,floating:k}),[v,k]),pe=_.useMemo(()=>{const G={position:r,left:0,top:0};if(!le.floating)return G;const se=kv(le.floating,u.x),V=kv(le.floating,u.y);return s?{...G,transform:"translate("+se+"px, "+V+"px)",...h$(le.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:se,top:V}},[r,s,le.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:q,refs:ce,elements:le,floatingStyles:pe}),[u,q,ce,le,pe])}const T9=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:n}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?Sv({element:o.current,padding:n}).fn(r):{}:o?Sv({element:o,padding:n}).fn(r):{}}}},$9=(e,t)=>({...v9(e),options:[e,t]}),O9=(e,t)=>({...y9(e),options:[e,t]}),A9=(e,t)=>({...x9(e),options:[e,t]}),C9=(e,t)=>({...b9(e),options:[e,t]}),N9=(e,t)=>({..._9(e),options:[e,t]}),R9=(e,t)=>({...w9(e),options:[e,t]}),P9=(e,t)=>({...T9(e),options:[e,t]});var j9="Arrow",g$=_.forwardRef((e,t)=>{const{children:r,width:o=10,height:n=5,...i}=e;return p.jsx(Le.svg,{...i,ref:t,width:o,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});g$.displayName=j9;var D9=g$;function z9(e){const[t,r]=_.useState(void 0);return Ct(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const i=n[0];let a,s;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var mp="Popper",[v$,el]=ia(mp),[M9,y$]=v$(mp),b$=e=>{const{__scopePopper:t,children:r}=e,[o,n]=_.useState(null);return p.jsx(M9,{scope:t,anchor:o,onAnchorChange:n,children:r})};b$.displayName=mp;var _$="PopperAnchor",w$=_.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...n}=e,i=y$(_$,r),a=_.useRef(null),s=ht(t,a),c=_.useRef(null);return _.useEffect(()=>{const l=c.current;c.current=o?.current||a.current,l!==c.current&&i.onAnchorChange(c.current)}),o?null:p.jsx(Le.div,{...n,ref:s})});w$.displayName=_$;var pp="PopperContent",[U9,L9]=v$(pp),x$=_.forwardRef((e,t)=>{const{__scopePopper:r,side:o="bottom",sideOffset:n=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:g,...h}=e,y=y$(pp,r),[b,w]=_.useState(null),x=ht(t,Te=>w(Te)),[v,k]=_.useState(null),E=z9(v),I=E?.width??0,A=E?.height??0,M=o+(i!=="center"?"-"+i:""),U=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},K=Array.isArray(l)?l:[l],ge=K.length>0,q={padding:U,boundary:K.filter(V9),altBoundary:ge},{refs:F,floatingStyles:ce,placement:le,isPositioned:pe,middlewareData:G}=I9({strategy:"fixed",placement:M,whileElementsMounted:(...Te)=>g9(...Te,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[$9({mainAxis:n+A,alignmentAxis:a}),c&&O9({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?A9():void 0,...q}),c&&C9({...q}),N9({...q,apply:({elements:Te,rects:Fe,availableWidth:fl,availableHeight:Io})=>{const{width:Rt,height:la}=Fe.reference,qe=Te.floating.style;qe.setProperty("--radix-popper-available-width",`${fl}px`),qe.setProperty("--radix-popper-available-height",`${Io}px`),qe.setProperty("--radix-popper-anchor-width",`${Rt}px`),qe.setProperty("--radix-popper-anchor-height",`${la}px`)}}),v&&P9({element:v,padding:s}),Z9({arrowWidth:I,arrowHeight:A}),f&&R9({strategy:"referenceHidden",...q})]}),[se,V]=E$(le),ye=dn(g);Ct(()=>{pe&&ye?.()},[pe,ye]);const ue=G.arrow?.x,ve=G.arrow?.y,P=G.arrow?.centerOffset!==0,[H,me]=_.useState();return Ct(()=>{b&&me(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:pe?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[G.transformOrigin?.x,G.transformOrigin?.y].join(" "),...G.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(U9,{scope:r,placedSide:se,onArrowChange:k,arrowX:ue,arrowY:ve,shouldHideArrow:P,children:p.jsx(Le.div,{"data-side":se,"data-align":V,...h,ref:x,style:{...h.style,animation:pe?void 0:"none"}})})})});x$.displayName=pp;var S$="PopperArrow",F9={top:"bottom",right:"left",bottom:"top",left:"right"},k$=_.forwardRef(function(t,r){const{__scopePopper:o,...n}=t,i=L9(S$,o),a=F9[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(D9,{...n,ref:r,style:{...n.style,display:"block"}})})});k$.displayName=S$;function V9(e){return e!==null}var Z9=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:o,middlewareData:n}=t,a=n.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[l,u]=E$(r),d={start:"0%",center:"50%",end:"100%"}[u],f=(n.arrow?.x??0)+s/2,m=(n.arrow?.y??0)+c/2;let g="",h="";return l==="bottom"?(g=a?d:`${f}px`,h=`${-c}px`):l==="top"?(g=a?d:`${f}px`,h=`${o.floating.height+c}px`):l==="right"?(g=`${-c}px`,h=a?d:`${m}px`):l==="left"&&(g=`${o.floating.width+c}px`,h=a?d:`${m}px`),{data:{x:g,y:h}}}});function E$(e){const[t,r="center"]=e.split("-");return[t,r]}var I$=b$,hp=w$,T$=x$,$$=k$,B9="Portal",gp=_.forwardRef((e,t)=>{const{container:r,...o}=e,[n,i]=_.useState(!1);Ct(()=>i(!0),[]);const a=r||n&&globalThis?.document?.body;return a?hd.createPortal(p.jsx(Le.div,{...o,ref:t}),a):null});gp.displayName=B9;function q9(e,t){return _.useReducer((r,o)=>t[r][o]??r,e)}var Br=e=>{const{present:t,children:r}=e,o=G9(t),n=typeof r=="function"?r({present:o.isPresent}):_.Children.only(r),i=ht(o.ref,H9(n));return typeof r=="function"||o.isPresent?_.cloneElement(n,{ref:i}):null};Br.displayName="Presence";function G9(e){const[t,r]=_.useState(),o=_.useRef(null),n=_.useRef(e),i=_.useRef("none"),a=e?"mounted":"unmounted",[s,c]=q9(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const l=Oa(o.current);i.current=s==="mounted"?l:"none"},[s]),Ct(()=>{const l=o.current,u=n.current;if(u!==e){const f=i.current,m=Oa(l);e?c("MOUNT"):m==="none"||l?.display==="none"?c("UNMOUNT"):c(u&&f!==m?"ANIMATION_OUT":"UNMOUNT"),n.current=e}},[e,c]),Ct(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=m=>{const h=Oa(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&h&&(c("ANIMATION_END"),!n.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=m=>{m.target===t&&(i.current=Oa(o.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(l=>{o.current=l?getComputedStyle(l):null,r(l)},[])}}function Oa(e){return e?.animationName||"none"}function H9(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var W9=_[" useInsertionEffect ".trim().toString()]||Ct;function tl({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[n,i,a]=J9({defaultProp:t,onChange:r}),s=e!==void 0,c=s?e:n;{const u=_.useRef(e!==void 0);_.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,o])}const l=_.useCallback(u=>{if(s){const d=K9(u)?u(e):u;d!==e&&a.current?.(d)}else i(u)},[s,e,i,a]);return[c,l]}function J9({defaultProp:e,onChange:t}){const[r,o]=_.useState(e),n=_.useRef(r),i=_.useRef(t);return W9(()=>{i.current=t},[t]),_.useEffect(()=>{n.current!==r&&(i.current?.(r),n.current=r)},[r,n]),[r,o,i]}function K9(e){return typeof e=="function"}var Y9=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),X9="VisuallyHidden",O$=_.forwardRef((e,t)=>p.jsx(Le.span,{...e,ref:t,style:{...Y9,...e.style}}));O$.displayName=X9;var Q9=O$,[rl]=ia("Tooltip",[el]),nl=el(),A$="TooltipProvider",e8=700,dd="tooltip.open",[t8,vp]=rl(A$),C$=e=>{const{__scopeTooltip:t,delayDuration:r=e8,skipDelayDuration:o=300,disableHoverableContent:n=!1,children:i}=e,a=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),p.jsx(t8,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(l=>{s.current=l},[]),disableHoverableContent:n,children:i})};C$.displayName=A$;var wi="Tooltip",[r8,sa]=rl(wi),N$=e=>{const{__scopeTooltip:t,children:r,open:o,defaultOpen:n,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,c=vp(wi,e.__scopeTooltip),l=nl(t),[u,d]=_.useState(null),f=Zn(),m=_.useRef(0),g=a??c.disableHoverableContent,h=s??c.delayDuration,y=_.useRef(!1),[b,w]=tl({prop:o,defaultProp:n??!1,onChange:I=>{I?(c.onOpen(),document.dispatchEvent(new CustomEvent(dd))):c.onClose(),i?.(I)},caller:wi}),x=_.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),v=_.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,w(!0)},[w]),k=_.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w(!1)},[w]),E=_.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,w(!0),m.current=0},h)},[h,w]);return _.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),p.jsx(I$,{...l,children:p.jsx(r8,{scope:t,contentId:f,open:b,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?E():v()},[c.isOpenDelayedRef,E,v]),onTriggerLeave:_.useCallback(()=>{g?k():(window.clearTimeout(m.current),m.current=0)},[k,g]),onOpen:v,onClose:k,disableHoverableContent:g,children:r})})};N$.displayName=wi;var fd="TooltipTrigger",R$=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,n=sa(fd,r),i=vp(fd,r),a=nl(r),s=_.useRef(null),c=ht(t,s,n.onTriggerChange),l=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),p.jsx(hp,{asChild:!0,...a,children:p.jsx(Le.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...o,ref:c,onPointerMove:De(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:De(e.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:De(e.onPointerDown,()=>{n.open&&n.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:De(e.onFocus,()=>{l.current||n.onOpen()}),onBlur:De(e.onBlur,n.onClose),onClick:De(e.onClick,n.onClose)})})});R$.displayName=fd;var yp="TooltipPortal",[n8,o8]=rl(yp,{forceMount:void 0}),P$=e=>{const{__scopeTooltip:t,forceMount:r,children:o,container:n}=e,i=sa(yp,t);return p.jsx(n8,{scope:t,forceMount:r,children:p.jsx(Br,{present:r||i.open,children:p.jsx(gp,{asChild:!0,container:n,children:o})})})};P$.displayName=yp;var co="TooltipContent",j$=_.forwardRef((e,t)=>{const r=o8(co,e.__scopeTooltip),{forceMount:o=r.forceMount,side:n="top",...i}=e,a=sa(co,e.__scopeTooltip);return p.jsx(Br,{present:o||a.open,children:a.disableHoverableContent?p.jsx(D$,{side:n,...i,ref:t}):p.jsx(i8,{side:n,...i,ref:t})})}),i8=_.forwardRef((e,t)=>{const r=sa(co,e.__scopeTooltip),o=vp(co,e.__scopeTooltip),n=_.useRef(null),i=ht(t,n),[a,s]=_.useState(null),{trigger:c,onClose:l}=r,u=n.current,{onPointerInTransitChange:d}=o,f=_.useCallback(()=>{s(null),d(!1)},[d]),m=_.useCallback((g,h)=>{const y=g.currentTarget,b={x:g.clientX,y:g.clientY},w=l8(b,y.getBoundingClientRect()),x=u8(b,w),v=d8(h.getBoundingClientRect()),k=m8([...x,...v]);s(k),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){const g=y=>m(y,u),h=y=>m(y,c);return c.addEventListener("pointerleave",g),u.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",h)}}},[c,u,m,f]),_.useEffect(()=>{if(a){const g=h=>{const y=h.target,b={x:h.clientX,y:h.clientY},w=c?.contains(y)||u?.contains(y),x=!f8(b,a);w?f():x&&(f(),l())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,u,a,l,f]),p.jsx(D$,{...e,ref:i})}),[a8,s8]=rl(wi,{isInside:!1}),c8=lq("TooltipContent"),D$=_.forwardRef((e,t)=>{const{__scopeTooltip:r,children:o,"aria-label":n,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,c=sa(co,r),l=nl(r),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(dd,u),()=>document.removeEventListener(dd,u)),[u]),_.useEffect(()=>{if(c.trigger){const d=f=>{f.target?.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),p.jsx(Kc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:p.jsxs(T$,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(c8,{children:o}),p.jsx(a8,{scope:r,isInside:!0,children:p.jsx(Q9,{id:c.contentId,role:"tooltip",children:n||o})})]})})});j$.displayName=co;var z$="TooltipArrow",M$=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,n=nl(r);return s8(z$,r).isInside?null:p.jsx($$,{...n,...o,ref:t})});M$.displayName=z$;function l8(e,t){const r=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),n=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,o,n,i)){case i:return"left";case n:return"right";case r:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function u8(e,t,r=5){const o=[];switch(t){case"top":o.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":o.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":o.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":o.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return o}function d8(e){const{top:t,right:r,bottom:o,left:n}=e;return[{x:n,y:t},{x:r,y:t},{x:r,y:o},{x:n,y:o}]}function f8(e,t){const{x:r,y:o}=e;let n=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],c=t[a],l=s.x,u=s.y,d=c.x,f=c.y;u>o!=f>o&&r<(d-l)*(o-u)/(f-u)+l&&(n=!n)}return n}function m8(e){const t=e.slice();return t.sort((r,o)=>r.x<o.x?-1:r.x>o.x?1:r.y<o.y?-1:r.y>o.y?1:0),p8(t)}function p8(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const n=e[o];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(n.y-a.y)>=(i.y-a.y)*(n.x-a.x))t.pop();else break}t.push(n)}t.pop();const r=[];for(let o=e.length-1;o>=0;o--){const n=e[o];for(;r.length>=2;){const i=r[r.length-1],a=r[r.length-2];if((i.x-a.x)*(n.y-a.y)>=(i.y-a.y)*(n.x-a.x))r.pop();else break}r.push(n)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var h8=C$,g8=N$,v8=R$,y8=P$,b8=j$,_8=M$;const U$=N.createContext(null);function L$(){return N.useContext(U$)?.current??null}function F$({delayDuration:e=0,...t}){return p.jsx(h8,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ol({...e}){return p.jsx(F$,{children:p.jsx(g8,{"data-slot":"tooltip",...e})})}function il({...e}){return p.jsx(v8,{"data-slot":"tooltip-trigger",...e})}function al({className:e,sideOffset:t=0,children:r,container:o,...n}){const i=L$();return p.jsx(y8,{container:o??i,children:p.jsxs(b8,{"data-slot":"tooltip-content",sideOffset:t,className:$.cn("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-20 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,p.jsx(_8,{className:"bg-foreground fill-foreground z-20 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]"})]})})}var su="focusScope.autoFocusOnMount",cu="focusScope.autoFocusOnUnmount",Ev={bubbles:!1,cancelable:!0},w8="FocusScope",bp=_.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:n,onUnmountAutoFocus:i,...a}=e,[s,c]=_.useState(null),l=dn(n),u=dn(i),d=_.useRef(null),f=ht(t,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(o){let h=function(x){if(m.paused||!s)return;const v=x.target;s.contains(v)?d.current=v:kr(d.current,{select:!0})},y=function(x){if(m.paused||!s)return;const v=x.relatedTarget;v!==null&&(s.contains(v)||kr(d.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const k of x)k.removedNodes.length>0&&kr(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const w=new MutationObserver(b);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),w.disconnect()}}},[o,s,m.paused]),_.useEffect(()=>{if(s){Tv.add(m);const h=document.activeElement;if(!s.contains(h)){const b=new CustomEvent(su,Ev);s.addEventListener(su,l),s.dispatchEvent(b),b.defaultPrevented||(x8(T8(V$(s)),{select:!0}),document.activeElement===h&&kr(s))}return()=>{s.removeEventListener(su,l),setTimeout(()=>{const b=new CustomEvent(cu,Ev);s.addEventListener(cu,u),s.dispatchEvent(b),b.defaultPrevented||kr(h??document.body,{select:!0}),s.removeEventListener(cu,u),Tv.remove(m)},0)}}},[s,l,u,m]);const g=_.useCallback(h=>{if(!r&&!o||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,b=document.activeElement;if(y&&b){const w=h.currentTarget,[x,v]=S8(w);x&&v?!h.shiftKey&&b===v?(h.preventDefault(),r&&kr(x,{select:!0})):h.shiftKey&&b===x&&(h.preventDefault(),r&&kr(v,{select:!0})):b===w&&h.preventDefault()}},[r,o,m.paused]);return p.jsx(Le.div,{tabIndex:-1,...a,ref:f,onKeyDown:g})});bp.displayName=w8;function x8(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(kr(o,{select:t}),document.activeElement!==r)return}function S8(e){const t=V$(e),r=Iv(t,e),o=Iv(t.reverse(),e);return[r,o]}function V$(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Iv(e,t){for(const r of e)if(!k8(r,{upTo:t}))return r}function k8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function E8(e){return e instanceof HTMLInputElement&&"select"in e}function kr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&E8(e)&&t&&e.select()}}var Tv=I8();function I8(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=$v(e,t),e.unshift(t)},remove(t){e=$v(e,t),e[0]?.resume()}}}function $v(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function T8(e){return e.filter(t=>t.tagName!=="A")}var lu=0;function Z$(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ov()),document.body.insertAdjacentElement("beforeend",e[1]??Ov()),lu++,()=>{lu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lu--}},[])}function Ov(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Xt=function(){return Xt=Object.assign||function(t){for(var r,o=1,n=arguments.length;o<n;o++){r=arguments[o];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Xt.apply(this,arguments)};function B$(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function $8(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o<n;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var qa="right-scroll-bar-position",Ga="width-before-scroll-bar",O8="with-scroll-bars-hidden",A8="--removed-body-scroll-bar-size";function uu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function C8(e,t){var r=N.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var n=r.value;n!==o&&(r.value=o,r.callback(o,n))}}}})[0];return r.callback=t,r.facade}var N8=typeof window<"u"?_.useLayoutEffect:_.useEffect,Av=new WeakMap;function R8(e,t){var r=C8(null,function(o){return e.forEach(function(n){return uu(n,o)})});return N8(function(){var o=Av.get(r);if(o){var n=new Set(o),i=new Set(e),a=r.current;n.forEach(function(s){i.has(s)||uu(s,null)}),i.forEach(function(s){n.has(s)||uu(s,a)})}Av.set(r,e)},[e]),r}function P8(e){return e}function j8(e,t){t===void 0&&(t=P8);var r=[],o=!1,n={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var a=t(i,o);return r.push(a),function(){r=r.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(o=!0;r.length;){var a=r;r=[],a.forEach(i)}r={push:function(s){return i(s)},filter:function(){return r}}},assignMedium:function(i){o=!0;var a=[];if(r.length){var s=r;r=[],s.forEach(i),a=r}var c=function(){var u=a;a=[],u.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){a.push(u),l()},filter:function(u){return a=a.filter(u),r}}}};return n}function D8(e){e===void 0&&(e={});var t=j8(null);return t.options=Xt({async:!0,ssr:!1},e),t}var q$=function(e){var t=e.sideCar,r=B$(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return _.createElement(o,Xt({},r))};q$.isSideCarExport=!0;function z8(e,t){return e.useMedium(t),q$}var G$=D8(),du=function(){},sl=_.forwardRef(function(e,t){var r=_.useRef(null),o=_.useState({onScrollCapture:du,onWheelCapture:du,onTouchMoveCapture:du}),n=o[0],i=o[1],a=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,m=e.noRelative,g=e.noIsolation,h=e.inert,y=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,x=e.gapMode,v=B$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,E=R8([r,t]),I=Xt(Xt({},v),n);return _.createElement(_.Fragment,null,u&&_.createElement(k,{sideCar:G$,removeScrollBar:l,shards:d,noRelative:m,noIsolation:g,inert:h,setCallbacks:i,allowPinchZoom:!!y,lockRef:r,gapMode:x}),a?_.cloneElement(_.Children.only(s),Xt(Xt({},I),{ref:E})):_.createElement(w,Xt({},I,{className:c,ref:E}),s))});sl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sl.classNames={fullWidth:Ga,zeroRight:qa};var M8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=M8();return t&&e.setAttribute("nonce",t),e}function L8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function F8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V8=function(){var e=0,t=null;return{add:function(r){e==0&&(t=U8())&&(L8(t,r),F8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Z8=function(){var e=V8();return function(t,r){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},H$=function(){var e=Z8(),t=function(r){var o=r.styles,n=r.dynamic;return e(o,n),null};return t},B8={left:0,top:0,right:0,gap:0},fu=function(e){return parseInt(e||"",10)||0},q8=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],n=t[e==="padding"?"paddingRight":"marginRight"];return[fu(r),fu(o),fu(n)]},G8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return B8;var t=q8(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},H8=H$(),qn="data-scroll-locked",W8=function(e,t,r,o){var n=e.left,i=e.top,a=e.right,s=e.gap;return r===void 0&&(r="margin"),`
96
+ `)}`}function VB(e){return e.map(t=>{const r=t.parts;if(!Array.isArray(r))return t;const o=r.map(n=>{const{callProviderMetadata:i,...a}=n;return a});return{...t,parts:o}})}const ZB=({children:e,config:t})=>{const r=oj(t),o=MB({auth:t.api,projectSlug:t.projectSlug}),n=AS(),[i,a]=N.useState(t.model?.defaultModel??Um[0]),[s,c]=N.useState(t.modal?.defaultExpanded??!1),[l,u]=N.useState(t.modal?.defaultOpen),d=t.plugins??$.recommended,f=FB(t.systemPrompt,d);N.useEffect(()=>{TL({enabled:t.errorTracking?.enabled,projectSlug:t.projectSlug,variant:t.variant})},[]);const m=N.useRef(null),{data:g}=rj({auth:o,mcp:t.mcp,environment:t.environment??{},toolsToInclude:t.tools?.toolsToInclude,gramEnvironment:t.gramEnvironment,chatId:m.current??void 0}),h=N.useRef({requestApproval:n.requestApproval,isToolApproved:n.isToolApproved,whitelistTool:n.whitelistTool});h.current={requestApproval:n.requestApproval,isToolApproved:n.isToolApproved,whitelistTool:n.whitelistTool};const y=N.useCallback(()=>({requestApproval:(...I)=>h.current.requestApproval(...I),isToolApproved:(...I)=>h.current.isToolApproved(...I),whitelistTool:(...I)=>h.current.whitelistTool(...I)}),[]);N.useEffect(()=>(t.tools?.toolsRequiringApproval&&AL(y(),t.tools.toolsRequiringApproval),()=>{CL()}),[t.tools?.toolsRequiringApproval,y]);const b=N.useRef(null),w=N.useRef(new Map),x=N.useMemo(()=>({sendMessages:async({messages:I,abortSignal:A})=>{const M=!!t.languageModel;if(o.isLoading)throw new Error("Session is loading");const U=b.current,K=U?.threadListItem?.getState?.(),ge=U?.threads?.getState?.(),q=K?.remoteId,F=K?.id??ge?.mainThreadId??ge?.threadIds?.[0];let ce=q;if(ja(ce)||!ce&&F){const ve=ce??F;if(ve){const P=w.current.get(ve);if(P)ce=P;else{const H=crypto.randomUUID();w.current.set(ve,H),ce=H}}}ce||(m.current||(m.current=crypto.randomUUID()),ce=m.current);const le=b.current?.thread.getModelContext(),pe=$L(OL(le?.tools??{})),G={...o.headers,"Gram-Chat-ID":ce,...t.gramEnvironment&&{"Gram-Environment":t.gramEnvironment}},se=M?null:AI({baseURL:r,apiKey:"unused, but must be set",headers:G});t.languageModel&&console.log("Using custom language model",t.languageModel);const V={...g,...pd.frontendTools(pe)},ye=RL(V,t.tools?.toolsRequiringApproval,y()),ue=t.languageModel?t.languageModel:se.chat(i);try{const ve=VB(I),P=OB(ve);return IB({system:f,model:ue,messages:P,tools:ye,stopWhen:qT(10),experimental_transform:PB({delayInMs:15}),abortSignal:A,onError:({error:me})=>{console.error("Stream error in onError callback:",me),hs(me,{source:"streaming"})}}).toUIMessageStream()}catch(ve){throw console.error("Error creating stream:",ve),hs(ve,{source:"stream-creation"}),ve}},reconnectToStream:async()=>{throw new Error("Stream reconnection not supported")}}),[t.languageModel,t.tools?.toolsRequiringApproval,i,f,g,y,r,o.headers,o.isLoading]),v=t.history?.enabled??!1,k=N.useMemo(()=>({config:t,setModel:a,model:i,isExpanded:s,setIsExpanded:c,isOpen:l??!1,setIsOpen:u,plugins:d,mcpTools:g}),[t,i,s,l,d,g]),E=t.tools?.frontendTools??{};return v&&!o.isLoading?p.jsx(BB,{transport:x,apiUrl:r,headers:o.headers,contextValue:k,runtimeRef:b,frontendTools:E,localIdToUuidMap:w.current,children:e}):p.jsx(qB,{transport:x,contextValue:k,runtimeRef:b,frontendTools:E,children:e})},BB=({children:e,transport:t,apiUrl:r,headers:o,contextValue:n,runtimeRef:i,frontendTools:a,localIdToUuidMap:s})=>{const c=yO({apiUrl:r,headers:o,localIdToUuidMap:s}),l=n?.config.history?.initialThreadId,u=N.useCallback(()=>pd.useChatRuntime({transport:t}),[t]),d=z.unstable_useRemoteThreadListRuntime({adapter:c,runtimeHook:u});N.useEffect(()=>{i.current=d},[d,i]);const f=N.useRef(!1);N.useEffect(()=>{if(l&&!f.current){f.current=!0;const g=setTimeout(()=>{d.threads.switchToThread(l).catch(h=>{console.error("Failed to switch to initial thread:",h)})},100);return()=>clearTimeout(g)}},[l,d]);const m=c.unstable_Provider??(({children:g})=>p.jsx(p.Fragment,{children:g}));return p.jsx(z.AssistantRuntimeProvider,{runtime:d,children:p.jsx(m,{children:p.jsxs($.ElementsContext.Provider,{value:n,children:[p.jsx("div",{className:`${vd} h-full`,children:e}),p.jsx(Zv,{tools:a})]})})})},qB=({children:e,transport:t,contextValue:r,runtimeRef:o,frontendTools:n})=>{const i=pd.useChatRuntime({transport:t});return N.useEffect(()=>{o.current=i},[i,o]),p.jsx(z.AssistantRuntimeProvider,{runtime:i,children:p.jsxs($.ElementsContext.Provider,{value:r,children:[p.jsx("div",{className:`${vd} h-full`,children:e}),p.jsx(Zv,{tools:n})]})})},GB=new ZP,HB=e=>p.jsx(BP,{client:GB,children:p.jsx(UB,{children:p.jsx(ZB,{...e})})});function YT(){return{threadId:z.useAssistantState(({threadListItem:t})=>t.remoteId??null)}}function uv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function np(...e){return t=>{let r=!1;const o=e.map(n=>{const i=uv(n,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let n=0;n<o.length;n++){const i=o[n];typeof i=="function"?i():uv(e[n],null)}}}}function ht(...e){return _.useCallback(np(...e),e)}var WB=Symbol.for("react.lazy"),Ts=_[" use ".trim().toString()];function JB(e){return typeof e=="object"&&e!==null&&"then"in e}function XT(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===WB&&"_payload"in e&&JB(e._payload)}function QT(e){const t=YB(e),r=_.forwardRef((o,n)=>{let{children:i,...a}=o;XT(i)&&typeof Ts=="function"&&(i=Ts(i._payload));const s=_.Children.toArray(i),c=s.find(eq);if(c){const l=c.props.children,u=s.map(d=>d===c?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:d);return p.jsx(t,{...a,ref:n,children:_.isValidElement(l)?_.cloneElement(l,void 0,u):null})}return p.jsx(t,{...a,ref:n,children:i})});return r.displayName=`${e}.Slot`,r}var KB=QT("Slot");function YB(e){const t=_.forwardRef((r,o)=>{let{children:n,...i}=r;if(XT(n)&&typeof Ts=="function"&&(n=Ts(n._payload)),_.isValidElement(n)){const a=rq(n),s=tq(i,n.props);return n.type!==_.Fragment&&(s.ref=o?np(o,a):a),_.cloneElement(n,s)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e$=Symbol("radix.slottable");function XB(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=e$,t}var QB=XB("Slottable");function eq(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e$}function tq(e,t){const r={...t};for(const o in t){const n=e[o],i=t[o];/^on[A-Z]/.test(o)?n&&i?r[o]=(...s)=>{const c=i(...s);return n(...s),c}:n&&(r[o]=n):o==="style"?r[o]={...n,...i}:o==="className"&&(r[o]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}function rq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const dv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fv=$.clsx,t$=(e,t)=>r=>{var o;if(t?.variants==null)return fv(e,r?.class,r?.className);const{variants:n,defaultVariants:i}=t,a=Object.keys(n).map(l=>{const u=r?.[l],d=i?.[l];if(u===null)return null;const f=dv(u)||dv(d);return n[l][f]}),s=r&&Object.entries(r).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((l,u)=>{let{class:d,className:f,...m}=u;return Object.entries(m).every(g=>{let[h,y]=g;return Array.isArray(y)?y.includes({...i,...s}[h]):{...i,...s}[h]===y})?[...l,d,f]:l},[]);return fv(e,a,c,r?.class,r?.className)},nq=t$("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),pt=_.forwardRef(({className:e,variant:t,size:r,asChild:o=!1,...n},i)=>{const a=o?KB:"button";return p.jsx(a,{"data-slot":"button",className:$.cn(nq({variant:t,size:r,className:e})),ref:i,...n})});pt.displayName="Button";const oq=({error:e,onRetry:t})=>p.jsx("div",{className:$.cn("aui-root aui-error-boundary bg-background flex h-full w-full flex-col items-center justify-center p-6"),children:p.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[p.jsx("div",{className:"text-destructive",children:p.jsx($.CircleAlert,{className:"size-12 stroke-[1.5px]"})}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("h3",{className:"text-foreground text-xl font-semibold",children:"Something went wrong"}),p.jsx("p",{className:"text-muted-foreground text-base",children:"An error occurred while loading the chat."}),e&&p.jsx("p",{className:"text-muted-foreground/60 max-w-md truncate text-sm",children:e.message})]}),p.jsx(pt,{onClick:t,variant:"default",className:"mt-2",children:"Try again"})]})}),iq=({children:e})=>p.jsx(p.Fragment,{children:e});class op extends N.Component{constructor(t){super(t),this.handleRetry=()=>{this.setState(r=>({hasError:!1,error:null,resetKey:r.resetKey+1})),this.props.onReset?.()},this.state={hasError:!1,error:null,resetKey:0}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){hs(t,{source:"error-boundary",componentStack:r.componentStack??void 0}),this.props.onError?.(t,r)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:p.jsx(oq,{error:this.state.error,onRetry:this.handleRetry}):p.jsx(iq,{children:this.props.children},this.state.resetKey)}}function De(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),r===!1||!n.defaultPrevented)return t?.(n)}}function aq(e,t){const r=_.createContext(t),o=i=>{const{children:a,...s}=i,c=_.useMemo(()=>s,Object.values(s));return p.jsx(r.Provider,{value:c,children:a})};o.displayName=e+"Provider";function n(i){const a=_.useContext(r);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,n]}function ia(e,t=[]){let r=[];function o(i,a){const s=_.createContext(a),c=r.length;r=[...r,a];const l=d=>{const{scope:f,children:m,...g}=d,h=f?.[e]?.[c]||s,y=_.useMemo(()=>g,Object.values(g));return p.jsx(h.Provider,{value:y,children:m})};l.displayName=i+"Provider";function u(d,f){const m=f?.[e]?.[c]||s,g=_.useContext(m);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const n=()=>{const i=r.map(a=>_.createContext(a));return function(s){const c=s?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return n.scopeName=e,[o,sq(n,...t)]}function sq(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(i){const a=o.reduce((s,{useScope:c,scopeName:l})=>{const d=c(i)[`__scope${l}`];return{...s,...d}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function ip(e){const t=cq(e),r=_.forwardRef((o,n)=>{const{children:i,...a}=o,s=_.Children.toArray(i),c=s.find(uq);if(c){const l=c.props.children,u=s.map(d=>d===c?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:d);return p.jsx(t,{...a,ref:n,children:_.isValidElement(l)?_.cloneElement(l,void 0,u):null})}return p.jsx(t,{...a,ref:n,children:i})});return r.displayName=`${e}.Slot`,r}function cq(e){const t=_.forwardRef((r,o)=>{const{children:n,...i}=r;if(_.isValidElement(n)){const a=fq(n),s=dq(i,n.props);return n.type!==_.Fragment&&(s.ref=o?np(o,a):a),_.cloneElement(n,s)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var r$=Symbol("radix.slottable");function lq(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=r$,t}function uq(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===r$}function dq(e,t){const r={...t};for(const o in t){const n=e[o],i=t[o];/^on[A-Z]/.test(o)?n&&i?r[o]=(...s)=>{const c=i(...s);return n(...s),c}:n&&(r[o]=n):o==="style"?r[o]={...n,...i}:o==="className"&&(r[o]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}function fq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=mq.reduce((e,t)=>{const r=ip(`Primitive.${t}`),o=_.forwardRef((n,i)=>{const{asChild:a,...s}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function pq(e,t){e&&Vv.flushSync(()=>e.dispatchEvent(t))}function dn(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...r)=>t.current?.(...r),[])}function hq(e,t=globalThis?.document){const r=dn(e);_.useEffect(()=>{const o=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var gq="DismissableLayer",sd="dismissableLayer.update",vq="dismissableLayer.pointerDownOutside",yq="dismissableLayer.focusOutside",mv,n$=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kc=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:n,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...c}=e,l=_.useContext(n$),[u,d]=_.useState(null),f=u?.ownerDocument??globalThis?.document,[,m]=_.useState({}),g=ht(t,I=>d(I)),h=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=h.indexOf(y),w=u?h.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,v=w>=b,k=wq(I=>{const A=I.target,M=[...l.branches].some(U=>U.contains(A));!v||M||(n?.(I),a?.(I),I.defaultPrevented||s?.())},f),E=xq(I=>{const A=I.target;[...l.branches].some(U=>U.contains(A))||(i?.(I),a?.(I),I.defaultPrevented||s?.())},f);return hq(I=>{w===l.layers.size-1&&(o?.(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(mv=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),pv(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=mv)}},[u,f,r,l]),_.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),pv())},[u,l]),_.useEffect(()=>{const I=()=>m({});return document.addEventListener(sd,I),()=>document.removeEventListener(sd,I)},[]),p.jsx(Le.div,{...c,ref:g,style:{pointerEvents:x?v?"auto":"none":void 0,...e.style},onFocusCapture:De(e.onFocusCapture,E.onFocusCapture),onBlurCapture:De(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:De(e.onPointerDownCapture,k.onPointerDownCapture)})});Kc.displayName=gq;var bq="DismissableLayerBranch",_q=_.forwardRef((e,t)=>{const r=_.useContext(n$),o=_.useRef(null),n=ht(t,o);return _.useEffect(()=>{const i=o.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),p.jsx(Le.div,{...e,ref:n})});_q.displayName=bq;function wq(e,t=globalThis?.document){const r=dn(e),o=_.useRef(!1),n=_.useRef(()=>{});return _.useEffect(()=>{const i=s=>{if(s.target&&!o.current){let c=function(){o$(vq,r,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=c,t.addEventListener("click",n.current,{once:!0})):c()}else t.removeEventListener("click",n.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function xq(e,t=globalThis?.document){const r=dn(e),o=_.useRef(!1);return _.useEffect(()=>{const n=i=>{i.target&&!o.current&&o$(yq,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function pv(){const e=new CustomEvent(sd);document.dispatchEvent(e)}function o$(e,t,r,{discrete:o}){const n=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?pq(n,i):n.dispatchEvent(i)}var Ct=globalThis?.document?_.useLayoutEffect:()=>{},Sq=_[" useId ".trim().toString()]||(()=>{}),kq=0;function Zn(e){const[t,r]=_.useState(Sq());return Ct(()=>{r(o=>o??String(kq++))},[e]),t?`radix-${t}`:""}const Eq=["top","right","bottom","left"],Ur=Math.min,vt=Math.max,$s=Math.round,$a=Math.floor,tr=e=>({x:e,y:e}),Iq={left:"right",right:"left",bottom:"top",top:"bottom"},Tq={start:"end",end:"start"};function cd(e,t,r){return vt(e,Ur(t,r))}function br(e,t){return typeof e=="function"?e(t):e}function _r(e){return e.split("-")[0]}function ko(e){return e.split("-")[1]}function ap(e){return e==="x"?"y":"x"}function sp(e){return e==="y"?"height":"width"}const $q=new Set(["top","bottom"]);function er(e){return $q.has(_r(e))?"y":"x"}function cp(e){return ap(er(e))}function Oq(e,t,r){r===void 0&&(r=!1);const o=ko(e),n=cp(e),i=sp(n);let a=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Os(a)),[a,Os(a)]}function Aq(e){const t=Os(e);return[ld(e),t,ld(t)]}function ld(e){return e.replace(/start|end/g,t=>Tq[t])}const hv=["left","right"],gv=["right","left"],Cq=["top","bottom"],Nq=["bottom","top"];function Rq(e,t,r){switch(e){case"top":case"bottom":return r?t?gv:hv:t?hv:gv;case"left":case"right":return t?Cq:Nq;default:return[]}}function Pq(e,t,r,o){const n=ko(e);let i=Rq(_r(e),r==="start",o);return n&&(i=i.map(a=>a+"-"+n),t&&(i=i.concat(i.map(ld)))),i}function Os(e){return e.replace(/left|right|bottom|top/g,t=>Iq[t])}function jq(e){return{top:0,right:0,bottom:0,left:0,...e}}function i$(e){return typeof e!="number"?jq(e):{top:e,right:e,bottom:e,left:e}}function As(e){const{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function vv(e,t,r){let{reference:o,floating:n}=e;const i=er(t),a=cp(t),s=sp(a),c=_r(t),l=i==="y",u=o.x+o.width/2-n.width/2,d=o.y+o.height/2-n.height/2,f=o[s]/2-n[s]/2;let m;switch(c){case"top":m={x:u,y:o.y-n.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-n.width,y:d};break;default:m={x:o.x,y:o.y}}switch(ko(t)){case"start":m[a]-=f*(r&&l?-1:1);break;case"end":m[a]+=f*(r&&l?-1:1);break}return m}const Dq=async(e,t,r)=>{const{placement:o="bottom",strategy:n="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=vv(l,o,c),f=o,m={},g=0;for(let h=0;h<s.length;h++){const{name:y,fn:b}=s[h],{x:w,y:x,data:v,reset:k}=await b({x:u,y:d,initialPlacement:o,placement:f,strategy:n,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=w??u,d=x??d,m={...m,[y]:{...m[y],...v}},k&&g<=50&&(g++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(l=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:n}):k.rects),{x:u,y:d}=vv(l,f,c)),h=-1)}return{x:u,y:d,placement:f,strategy:n,middlewareData:m}};async function bi(e,t){var r;t===void 0&&(t={});const{x:o,y:n,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=br(t,e),g=i$(m),y=s[f?d==="floating"?"reference":"floating":d],b=As(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(y)))==null||r?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:o,y:n,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),v=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},k=As(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:x,strategy:c}):w);return{top:(b.top-k.top+g.top)/v.y,bottom:(k.bottom-b.bottom+g.bottom)/v.y,left:(b.left-k.left+g.left)/v.x,right:(k.right-b.right+g.right)/v.x}}const zq=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:n,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=br(e,t)||{};if(l==null)return{};const d=i$(u),f={x:r,y:o},m=cp(n),g=sp(m),h=await a.getDimensions(l),y=m==="y",b=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=i.reference[g]+i.reference[m]-f[m]-i.floating[g],k=f[m]-i.reference[m],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let I=E?E[x]:0;(!I||!await(a.isElement==null?void 0:a.isElement(E)))&&(I=s.floating[x]||i.floating[g]);const A=v/2-k/2,M=I/2-h[g]/2-1,U=Ur(d[b],M),K=Ur(d[w],M),ge=U,q=I-h[g]-K,F=I/2-h[g]/2+A,ce=cd(ge,F,q),le=!c.arrow&&ko(n)!=null&&F!==ce&&i.reference[g]/2-(F<ge?U:K)-h[g]/2<0,pe=le?F<ge?F-ge:F-q:0;return{[m]:f[m]+pe,data:{[m]:ce,centerOffset:F-ce-pe,...le&&{alignmentOffset:pe}},reset:le}}}),Mq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:n,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...y}=br(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const b=_r(n),w=er(s),x=_r(s)===s,v=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=f||(x||!h?[Os(s)]:Aq(s)),E=g!=="none";!f&&E&&k.push(...Pq(s,h,g,v));const I=[s,...k],A=await bi(t,y),M=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push(A[b]),d){const F=Oq(n,a,v);M.push(A[F[0]],A[F[1]])}if(U=[...U,{placement:n,overflows:M}],!M.every(F=>F<=0)){var K,ge;const F=(((K=i.flip)==null?void 0:K.index)||0)+1,ce=I[F];if(ce&&(!(d==="alignment"?w!==er(ce):!1)||U.every(G=>er(G.placement)===w?G.overflows[0]>0:!0)))return{data:{index:F,overflows:U},reset:{placement:ce}};let le=(ge=U.filter(pe=>pe.overflows[0]<=0).sort((pe,G)=>pe.overflows[1]-G.overflows[1])[0])==null?void 0:ge.placement;if(!le)switch(m){case"bestFit":{var q;const pe=(q=U.filter(G=>{if(E){const se=er(G.placement);return se===w||se==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(se=>se>0).reduce((se,V)=>se+V,0)]).sort((G,se)=>G[1]-se[1])[0])==null?void 0:q[0];pe&&(le=pe);break}case"initialPlacement":le=s;break}if(n!==le)return{reset:{placement:le}}}return{}}}};function yv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bv(e){return Eq.some(t=>e[t]>=0)}const Uq=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:o="referenceHidden",...n}=br(e,t);switch(o){case"referenceHidden":{const i=await bi(t,{...n,elementContext:"reference"}),a=yv(i,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bv(a)}}}case"escaped":{const i=await bi(t,{...n,altBoundary:!0}),a=yv(i,r.floating);return{data:{escapedOffsets:a,escaped:bv(a)}}}default:return{}}}}},a$=new Set(["left","top"]);async function Lq(e,t){const{placement:r,platform:o,elements:n}=e,i=await(o.isRTL==null?void 0:o.isRTL(n.floating)),a=_r(r),s=ko(r),c=er(r)==="y",l=a$.has(a)?-1:1,u=i&&c?-1:1,d=br(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof g=="number"&&(m=s==="end"?g*-1:g),c?{x:m*u,y:f*l}:{x:f*l,y:m*u}}const Fq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:n,y:i,placement:a,middlewareData:s}=t,c=await Lq(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:n+c.x,y:i+c.y,data:{...c,placement:a}}}}},Vq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:n}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...c}=br(e,t),l={x:r,y:o},u=await bi(t,c),d=er(_r(n)),f=ap(d);let m=l[f],g=l[d];if(i){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=m+u[y],x=m-u[b];m=cd(w,m,x)}if(a){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=g+u[y],x=g-u[b];g=cd(w,g,x)}const h=s.fn({...t,[f]:m,[d]:g});return{...h,data:{x:h.x-r,y:h.y-o,enabled:{[f]:i,[d]:a}}}}}},Zq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:n,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=br(e,t),u={x:r,y:o},d=er(n),f=ap(d);let m=u[f],g=u[d];const h=br(s,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const x=f==="y"?"height":"width",v=i.reference[f]-i.floating[x]+y.mainAxis,k=i.reference[f]+i.reference[x]-y.mainAxis;m<v?m=v:m>k&&(m=k)}if(l){var b,w;const x=f==="y"?"width":"height",v=a$.has(_r(n)),k=i.reference[d]-i.floating[x]+(v&&((b=a.offset)==null?void 0:b[d])||0)+(v?0:y.crossAxis),E=i.reference[d]+i.reference[x]+(v?0:((w=a.offset)==null?void 0:w[d])||0)-(v?y.crossAxis:0);g<k?g=k:g>E&&(g=E)}return{[f]:m,[d]:g}}}},Bq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:n,rects:i,platform:a,elements:s}=t,{apply:c=()=>{},...l}=br(e,t),u=await bi(t,l),d=_r(n),f=ko(n),m=er(n)==="y",{width:g,height:h}=i.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,y=f==="end"?"top":"bottom");const w=h-u.top-u.bottom,x=g-u.left-u.right,v=Ur(h-u[y],w),k=Ur(g-u[b],x),E=!t.middlewareData.shift;let I=v,A=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(A=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(I=w),E&&!f){const U=vt(u.left,0),K=vt(u.right,0),ge=vt(u.top,0),q=vt(u.bottom,0);m?A=g-2*(U!==0||K!==0?U+K:vt(u.left,u.right)):I=h-2*(ge!==0||q!==0?ge+q:vt(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:I});const M=await a.getDimensions(s.floating);return g!==M.width||h!==M.height?{reset:{rects:!0}}:{}}}};function Yc(){return typeof window<"u"}function Eo(e){return s$(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cr(e){var t;return(t=(s$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s$(e){return Yc()?e instanceof Node||e instanceof bt(e).Node:!1}function qt(e){return Yc()?e instanceof Element||e instanceof bt(e).Element:!1}function ar(e){return Yc()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function _v(e){return!Yc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const qq=new Set(["inline","contents"]);function aa(e){const{overflow:t,overflowX:r,overflowY:o,display:n}=Gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!qq.has(n)}const Gq=new Set(["table","td","th"]);function Hq(e){return Gq.has(Eo(e))}const Wq=[":popover-open",":modal"];function Xc(e){return Wq.some(t=>{try{return e.matches(t)}catch{return!1}})}const Jq=["transform","translate","scale","rotate","perspective"],Kq=["transform","translate","scale","rotate","perspective","filter"],Yq=["paint","layout","strict","content"];function lp(e){const t=up(),r=qt(e)?Gt(e):e;return Jq.some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Kq.some(o=>(r.willChange||"").includes(o))||Yq.some(o=>(r.contain||"").includes(o))}function Xq(e){let t=Lr(e);for(;ar(t)&&!so(t);){if(lp(t))return t;if(Xc(t))return null;t=Lr(t)}return null}function up(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Qq=new Set(["html","body","#document"]);function so(e){return Qq.has(Eo(e))}function Gt(e){return bt(e).getComputedStyle(e)}function Qc(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lr(e){if(Eo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_v(e)&&e.host||cr(e);return _v(t)?t.host:t}function c$(e){const t=Lr(e);return so(t)?e.ownerDocument?e.ownerDocument.body:e.body:ar(t)&&aa(t)?t:c$(t)}function _i(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const n=c$(e),i=n===((o=e.ownerDocument)==null?void 0:o.body),a=bt(n);if(i){const s=ud(a);return t.concat(a,a.visualViewport||[],aa(n)?n:[],s&&r?_i(s):[])}return t.concat(n,_i(n,[],r))}function ud(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function l$(e){const t=Gt(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=ar(e),i=n?e.offsetWidth:r,a=n?e.offsetHeight:o,s=$s(r)!==i||$s(o)!==a;return s&&(r=i,o=a),{width:r,height:o,$:s}}function dp(e){return qt(e)?e:e.contextElement}function Bn(e){const t=dp(e);if(!ar(t))return tr(1);const r=t.getBoundingClientRect(),{width:o,height:n,$:i}=l$(t);let a=(i?$s(r.width):r.width)/o,s=(i?$s(r.height):r.height)/n;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const e9=tr(0);function u$(e){const t=bt(e);return!up()||!t.visualViewport?e9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function t9(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==bt(e)?!1:t}function fn(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=dp(e);let a=tr(1);t&&(o?qt(o)&&(a=Bn(o)):a=Bn(e));const s=t9(i,r,o)?u$(i):tr(0);let c=(n.left+s.x)/a.x,l=(n.top+s.y)/a.y,u=n.width/a.x,d=n.height/a.y;if(i){const f=bt(i),m=o&&qt(o)?bt(o):o;let g=f,h=ud(g);for(;h&&o&&m!==g;){const y=Bn(h),b=h.getBoundingClientRect(),w=Gt(h),x=b.left+(h.clientLeft+parseFloat(w.paddingLeft))*y.x,v=b.top+(h.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,d*=y.y,c+=x,l+=v,g=bt(h),h=ud(g)}}return As({width:u,height:d,x:c,y:l})}function fp(e,t){const r=Qc(e).scrollLeft;return t?t.left+r:fn(cr(e)).left+r}function d$(e,t,r){r===void 0&&(r=!1);const o=e.getBoundingClientRect(),n=o.left+t.scrollLeft-(r?0:fp(e,o)),i=o.top+t.scrollTop;return{x:n,y:i}}function r9(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e;const i=n==="fixed",a=cr(o),s=t?Xc(t.floating):!1;if(o===a||s&&i)return r;let c={scrollLeft:0,scrollTop:0},l=tr(1);const u=tr(0),d=ar(o);if((d||!d&&!i)&&((Eo(o)!=="body"||aa(a))&&(c=Qc(o)),ar(o))){const m=fn(o);l=Bn(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}const f=a&&!d&&!i?d$(a,c,!0):tr(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:r.y*l.y-c.scrollTop*l.y+u.y+f.y}}function n9(e){return Array.from(e.getClientRects())}function o9(e){const t=cr(e),r=Qc(e),o=e.ownerDocument.body,n=vt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=vt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-r.scrollLeft+fp(e);const s=-r.scrollTop;return Gt(o).direction==="rtl"&&(a+=vt(t.clientWidth,o.clientWidth)-n),{width:n,height:i,x:a,y:s}}function i9(e,t){const r=bt(e),o=cr(e),n=r.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,c=0;if(n){i=n.width,a=n.height;const l=up();(!l||l&&t==="fixed")&&(s=n.offsetLeft,c=n.offsetTop)}return{width:i,height:a,x:s,y:c}}const a9=new Set(["absolute","fixed"]);function s9(e,t){const r=fn(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,i=ar(e)?Bn(e):tr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=n*i.x,l=o*i.y;return{width:a,height:s,x:c,y:l}}function wv(e,t,r){let o;if(t==="viewport")o=i9(e,r);else if(t==="document")o=o9(cr(e));else if(qt(t))o=s9(t,r);else{const n=u$(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return As(o)}function f$(e,t){const r=Lr(e);return r===t||!qt(r)||so(r)?!1:Gt(r).position==="fixed"||f$(r,t)}function c9(e,t){const r=t.get(e);if(r)return r;let o=_i(e,[],!1).filter(s=>qt(s)&&Eo(s)!=="body"),n=null;const i=Gt(e).position==="fixed";let a=i?Lr(e):e;for(;qt(a)&&!so(a);){const s=Gt(a),c=lp(a);!c&&s.position==="fixed"&&(n=null),(i?!c&&!n:!c&&s.position==="static"&&!!n&&a9.has(n.position)||aa(a)&&!c&&f$(e,a))?o=o.filter(u=>u!==a):n=s,a=Lr(a)}return t.set(e,o),o}function l9(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e;const a=[...r==="clippingAncestors"?Xc(t)?[]:c9(t,this._c):[].concat(r),o],s=a[0],c=a.reduce((l,u)=>{const d=wv(t,u,n);return l.top=vt(d.top,l.top),l.right=Ur(d.right,l.right),l.bottom=Ur(d.bottom,l.bottom),l.left=vt(d.left,l.left),l},wv(t,s,n));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function u9(e){const{width:t,height:r}=l$(e);return{width:t,height:r}}function d9(e,t,r){const o=ar(t),n=cr(t),i=r==="fixed",a=fn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=tr(0);function l(){c.x=fp(n)}if(o||!o&&!i)if((Eo(t)!=="body"||aa(n))&&(s=Qc(t)),o){const m=fn(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else n&&l();i&&!o&&n&&l();const u=n&&!o&&!i?d$(n,s):tr(0),d=a.left+s.scrollLeft-c.x-u.x,f=a.top+s.scrollTop-c.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function iu(e){return Gt(e).position==="static"}function xv(e,t){if(!ar(e)||Gt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return cr(e)===r&&(r=r.ownerDocument.body),r}function m$(e,t){const r=bt(e);if(Xc(e))return r;if(!ar(e)){let n=Lr(e);for(;n&&!so(n);){if(qt(n)&&!iu(n))return n;n=Lr(n)}return r}let o=xv(e,t);for(;o&&Hq(o)&&iu(o);)o=xv(o,t);return o&&so(o)&&iu(o)&&!lp(o)?r:o||Xq(e)||r}const f9=async function(e){const t=this.getOffsetParent||m$,r=this.getDimensions,o=await r(e.floating);return{reference:d9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function m9(e){return Gt(e).direction==="rtl"}const p9={convertOffsetParentRelativeRectToViewportRelativeRect:r9,getDocumentElement:cr,getClippingRect:l9,getOffsetParent:m$,getElementRects:f9,getClientRects:n9,getDimensions:u9,getScale:Bn,isElement:qt,isRTL:m9};function p$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function h9(e,t){let r=null,o;const n=cr(e);function i(){var s;clearTimeout(o),(s=r)==null||s.disconnect(),r=null}function a(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=l;if(s||t(),!f||!m)return;const g=$a(d),h=$a(n.clientWidth-(u+f)),y=$a(n.clientHeight-(d+m)),b=$a(u),x={rootMargin:-g+"px "+-h+"px "+-y+"px "+-b+"px",threshold:vt(0,Ur(1,c))||1};let v=!0;function k(E){const I=E[0].intersectionRatio;if(I!==c){if(!v)return a();I?a(!1,I):o=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!p$(l,e.getBoundingClientRect())&&a(),v=!1}try{r=new IntersectionObserver(k,{...x,root:n.ownerDocument})}catch{r=new IntersectionObserver(k,x)}r.observe(e)}return a(!0),i}function g9(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=dp(e),u=n||i?[...l?_i(l):[],..._i(t)]:[];u.forEach(b=>{n&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r)});const d=l&&s?h9(l,r):null;let f=-1,m=null;a&&(m=new ResizeObserver(b=>{let[w]=b;w&&w.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),r()}),l&&!c&&m.observe(l),m.observe(t));let g,h=c?fn(e):null;c&&y();function y(){const b=fn(e);h&&!p$(h,b)&&r(),h=b,g=requestAnimationFrame(y)}return r(),()=>{var b;u.forEach(w=>{n&&w.removeEventListener("scroll",r),i&&w.removeEventListener("resize",r)}),d?.(),(b=m)==null||b.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const v9=Fq,y9=Vq,b9=Mq,_9=Bq,w9=Uq,Sv=zq,x9=Zq,S9=(e,t,r)=>{const o=new Map,n={platform:p9,...r},i={...n.platform,_c:o};return Dq(e,t,{...n,platform:i})};var k9=typeof document<"u",E9=function(){},Ba=k9?N.useLayoutEffect:E9;function Cs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!Cs(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){const i=n[o];if(!(i==="_owner"&&e.$$typeof)&&!Cs(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function h$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kv(e,t){const r=h$(e);return Math.round(t*r)/r}function au(e){const t=_.useRef(e);return Ba(()=>{t.current=e}),t}function I9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=_.useState(o);Cs(f,o)||m(o);const[g,h]=_.useState(null),[y,b]=_.useState(null),w=_.useCallback(G=>{G!==E.current&&(E.current=G,h(G))},[]),x=_.useCallback(G=>{G!==I.current&&(I.current=G,b(G))},[]),v=i||g,k=a||y,E=_.useRef(null),I=_.useRef(null),A=_.useRef(u),M=c!=null,U=au(c),K=au(n),ge=au(l),q=_.useCallback(()=>{if(!E.current||!I.current)return;const G={placement:t,strategy:r,middleware:f};K.current&&(G.platform=K.current),S9(E.current,I.current,G).then(se=>{const V={...se,isPositioned:ge.current!==!1};F.current&&!Cs(A.current,V)&&(A.current=V,Vv.flushSync(()=>{d(V)}))})},[f,t,r,K,ge]);Ba(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(G=>({...G,isPositioned:!1})))},[l]);const F=_.useRef(!1);Ba(()=>(F.current=!0,()=>{F.current=!1}),[]),Ba(()=>{if(v&&(E.current=v),k&&(I.current=k),v&&k){if(U.current)return U.current(v,k,q);q()}},[v,k,q,U,M]);const ce=_.useMemo(()=>({reference:E,floating:I,setReference:w,setFloating:x}),[w,x]),le=_.useMemo(()=>({reference:v,floating:k}),[v,k]),pe=_.useMemo(()=>{const G={position:r,left:0,top:0};if(!le.floating)return G;const se=kv(le.floating,u.x),V=kv(le.floating,u.y);return s?{...G,transform:"translate("+se+"px, "+V+"px)",...h$(le.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:se,top:V}},[r,s,le.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:q,refs:ce,elements:le,floatingStyles:pe}),[u,q,ce,le,pe])}const T9=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:n}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?Sv({element:o.current,padding:n}).fn(r):{}:o?Sv({element:o,padding:n}).fn(r):{}}}},$9=(e,t)=>({...v9(e),options:[e,t]}),O9=(e,t)=>({...y9(e),options:[e,t]}),A9=(e,t)=>({...x9(e),options:[e,t]}),C9=(e,t)=>({...b9(e),options:[e,t]}),N9=(e,t)=>({..._9(e),options:[e,t]}),R9=(e,t)=>({...w9(e),options:[e,t]}),P9=(e,t)=>({...T9(e),options:[e,t]});var j9="Arrow",g$=_.forwardRef((e,t)=>{const{children:r,width:o=10,height:n=5,...i}=e;return p.jsx(Le.svg,{...i,ref:t,width:o,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});g$.displayName=j9;var D9=g$;function z9(e){const[t,r]=_.useState(void 0);return Ct(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const i=n[0];let a,s;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var mp="Popper",[v$,el]=ia(mp),[M9,y$]=v$(mp),b$=e=>{const{__scopePopper:t,children:r}=e,[o,n]=_.useState(null);return p.jsx(M9,{scope:t,anchor:o,onAnchorChange:n,children:r})};b$.displayName=mp;var _$="PopperAnchor",w$=_.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...n}=e,i=y$(_$,r),a=_.useRef(null),s=ht(t,a),c=_.useRef(null);return _.useEffect(()=>{const l=c.current;c.current=o?.current||a.current,l!==c.current&&i.onAnchorChange(c.current)}),o?null:p.jsx(Le.div,{...n,ref:s})});w$.displayName=_$;var pp="PopperContent",[U9,L9]=v$(pp),x$=_.forwardRef((e,t)=>{const{__scopePopper:r,side:o="bottom",sideOffset:n=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:g,...h}=e,y=y$(pp,r),[b,w]=_.useState(null),x=ht(t,Te=>w(Te)),[v,k]=_.useState(null),E=z9(v),I=E?.width??0,A=E?.height??0,M=o+(i!=="center"?"-"+i:""),U=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},K=Array.isArray(l)?l:[l],ge=K.length>0,q={padding:U,boundary:K.filter(V9),altBoundary:ge},{refs:F,floatingStyles:ce,placement:le,isPositioned:pe,middlewareData:G}=I9({strategy:"fixed",placement:M,whileElementsMounted:(...Te)=>g9(...Te,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[$9({mainAxis:n+A,alignmentAxis:a}),c&&O9({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?A9():void 0,...q}),c&&C9({...q}),N9({...q,apply:({elements:Te,rects:Fe,availableWidth:fl,availableHeight:Io})=>{const{width:Rt,height:la}=Fe.reference,qe=Te.floating.style;qe.setProperty("--radix-popper-available-width",`${fl}px`),qe.setProperty("--radix-popper-available-height",`${Io}px`),qe.setProperty("--radix-popper-anchor-width",`${Rt}px`),qe.setProperty("--radix-popper-anchor-height",`${la}px`)}}),v&&P9({element:v,padding:s}),Z9({arrowWidth:I,arrowHeight:A}),f&&R9({strategy:"referenceHidden",...q})]}),[se,V]=E$(le),ye=dn(g);Ct(()=>{pe&&ye?.()},[pe,ye]);const ue=G.arrow?.x,ve=G.arrow?.y,P=G.arrow?.centerOffset!==0,[H,me]=_.useState();return Ct(()=>{b&&me(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:pe?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[G.transformOrigin?.x,G.transformOrigin?.y].join(" "),...G.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(U9,{scope:r,placedSide:se,onArrowChange:k,arrowX:ue,arrowY:ve,shouldHideArrow:P,children:p.jsx(Le.div,{"data-side":se,"data-align":V,...h,ref:x,style:{...h.style,animation:pe?void 0:"none"}})})})});x$.displayName=pp;var S$="PopperArrow",F9={top:"bottom",right:"left",bottom:"top",left:"right"},k$=_.forwardRef(function(t,r){const{__scopePopper:o,...n}=t,i=L9(S$,o),a=F9[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(D9,{...n,ref:r,style:{...n.style,display:"block"}})})});k$.displayName=S$;function V9(e){return e!==null}var Z9=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:o,middlewareData:n}=t,a=n.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[l,u]=E$(r),d={start:"0%",center:"50%",end:"100%"}[u],f=(n.arrow?.x??0)+s/2,m=(n.arrow?.y??0)+c/2;let g="",h="";return l==="bottom"?(g=a?d:`${f}px`,h=`${-c}px`):l==="top"?(g=a?d:`${f}px`,h=`${o.floating.height+c}px`):l==="right"?(g=`${-c}px`,h=a?d:`${m}px`):l==="left"&&(g=`${o.floating.width+c}px`,h=a?d:`${m}px`),{data:{x:g,y:h}}}});function E$(e){const[t,r="center"]=e.split("-");return[t,r]}var I$=b$,hp=w$,T$=x$,$$=k$,B9="Portal",gp=_.forwardRef((e,t)=>{const{container:r,...o}=e,[n,i]=_.useState(!1);Ct(()=>i(!0),[]);const a=r||n&&globalThis?.document?.body;return a?hd.createPortal(p.jsx(Le.div,{...o,ref:t}),a):null});gp.displayName=B9;function q9(e,t){return _.useReducer((r,o)=>t[r][o]??r,e)}var Br=e=>{const{present:t,children:r}=e,o=G9(t),n=typeof r=="function"?r({present:o.isPresent}):_.Children.only(r),i=ht(o.ref,H9(n));return typeof r=="function"||o.isPresent?_.cloneElement(n,{ref:i}):null};Br.displayName="Presence";function G9(e){const[t,r]=_.useState(),o=_.useRef(null),n=_.useRef(e),i=_.useRef("none"),a=e?"mounted":"unmounted",[s,c]=q9(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const l=Oa(o.current);i.current=s==="mounted"?l:"none"},[s]),Ct(()=>{const l=o.current,u=n.current;if(u!==e){const f=i.current,m=Oa(l);e?c("MOUNT"):m==="none"||l?.display==="none"?c("UNMOUNT"):c(u&&f!==m?"ANIMATION_OUT":"UNMOUNT"),n.current=e}},[e,c]),Ct(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=m=>{const h=Oa(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&h&&(c("ANIMATION_END"),!n.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=m=>{m.target===t&&(i.current=Oa(o.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(l=>{o.current=l?getComputedStyle(l):null,r(l)},[])}}function Oa(e){return e?.animationName||"none"}function H9(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var W9=_[" useInsertionEffect ".trim().toString()]||Ct;function tl({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[n,i,a]=J9({defaultProp:t,onChange:r}),s=e!==void 0,c=s?e:n;{const u=_.useRef(e!==void 0);_.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,o])}const l=_.useCallback(u=>{if(s){const d=K9(u)?u(e):u;d!==e&&a.current?.(d)}else i(u)},[s,e,i,a]);return[c,l]}function J9({defaultProp:e,onChange:t}){const[r,o]=_.useState(e),n=_.useRef(r),i=_.useRef(t);return W9(()=>{i.current=t},[t]),_.useEffect(()=>{n.current!==r&&(i.current?.(r),n.current=r)},[r,n]),[r,o,i]}function K9(e){return typeof e=="function"}var Y9=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),X9="VisuallyHidden",O$=_.forwardRef((e,t)=>p.jsx(Le.span,{...e,ref:t,style:{...Y9,...e.style}}));O$.displayName=X9;var Q9=O$,[rl]=ia("Tooltip",[el]),nl=el(),A$="TooltipProvider",e8=700,dd="tooltip.open",[t8,vp]=rl(A$),C$=e=>{const{__scopeTooltip:t,delayDuration:r=e8,skipDelayDuration:o=300,disableHoverableContent:n=!1,children:i}=e,a=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),p.jsx(t8,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(l=>{s.current=l},[]),disableHoverableContent:n,children:i})};C$.displayName=A$;var wi="Tooltip",[r8,sa]=rl(wi),N$=e=>{const{__scopeTooltip:t,children:r,open:o,defaultOpen:n,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,c=vp(wi,e.__scopeTooltip),l=nl(t),[u,d]=_.useState(null),f=Zn(),m=_.useRef(0),g=a??c.disableHoverableContent,h=s??c.delayDuration,y=_.useRef(!1),[b,w]=tl({prop:o,defaultProp:n??!1,onChange:I=>{I?(c.onOpen(),document.dispatchEvent(new CustomEvent(dd))):c.onClose(),i?.(I)},caller:wi}),x=_.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),v=_.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,w(!0)},[w]),k=_.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w(!1)},[w]),E=_.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,w(!0),m.current=0},h)},[h,w]);return _.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),p.jsx(I$,{...l,children:p.jsx(r8,{scope:t,contentId:f,open:b,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?E():v()},[c.isOpenDelayedRef,E,v]),onTriggerLeave:_.useCallback(()=>{g?k():(window.clearTimeout(m.current),m.current=0)},[k,g]),onOpen:v,onClose:k,disableHoverableContent:g,children:r})})};N$.displayName=wi;var fd="TooltipTrigger",R$=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,n=sa(fd,r),i=vp(fd,r),a=nl(r),s=_.useRef(null),c=ht(t,s,n.onTriggerChange),l=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),p.jsx(hp,{asChild:!0,...a,children:p.jsx(Le.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...o,ref:c,onPointerMove:De(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:De(e.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:De(e.onPointerDown,()=>{n.open&&n.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:De(e.onFocus,()=>{l.current||n.onOpen()}),onBlur:De(e.onBlur,n.onClose),onClick:De(e.onClick,n.onClose)})})});R$.displayName=fd;var yp="TooltipPortal",[n8,o8]=rl(yp,{forceMount:void 0}),P$=e=>{const{__scopeTooltip:t,forceMount:r,children:o,container:n}=e,i=sa(yp,t);return p.jsx(n8,{scope:t,forceMount:r,children:p.jsx(Br,{present:r||i.open,children:p.jsx(gp,{asChild:!0,container:n,children:o})})})};P$.displayName=yp;var co="TooltipContent",j$=_.forwardRef((e,t)=>{const r=o8(co,e.__scopeTooltip),{forceMount:o=r.forceMount,side:n="top",...i}=e,a=sa(co,e.__scopeTooltip);return p.jsx(Br,{present:o||a.open,children:a.disableHoverableContent?p.jsx(D$,{side:n,...i,ref:t}):p.jsx(i8,{side:n,...i,ref:t})})}),i8=_.forwardRef((e,t)=>{const r=sa(co,e.__scopeTooltip),o=vp(co,e.__scopeTooltip),n=_.useRef(null),i=ht(t,n),[a,s]=_.useState(null),{trigger:c,onClose:l}=r,u=n.current,{onPointerInTransitChange:d}=o,f=_.useCallback(()=>{s(null),d(!1)},[d]),m=_.useCallback((g,h)=>{const y=g.currentTarget,b={x:g.clientX,y:g.clientY},w=l8(b,y.getBoundingClientRect()),x=u8(b,w),v=d8(h.getBoundingClientRect()),k=m8([...x,...v]);s(k),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){const g=y=>m(y,u),h=y=>m(y,c);return c.addEventListener("pointerleave",g),u.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",h)}}},[c,u,m,f]),_.useEffect(()=>{if(a){const g=h=>{const y=h.target,b={x:h.clientX,y:h.clientY},w=c?.contains(y)||u?.contains(y),x=!f8(b,a);w?f():x&&(f(),l())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,u,a,l,f]),p.jsx(D$,{...e,ref:i})}),[a8,s8]=rl(wi,{isInside:!1}),c8=lq("TooltipContent"),D$=_.forwardRef((e,t)=>{const{__scopeTooltip:r,children:o,"aria-label":n,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,c=sa(co,r),l=nl(r),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(dd,u),()=>document.removeEventListener(dd,u)),[u]),_.useEffect(()=>{if(c.trigger){const d=f=>{f.target?.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),p.jsx(Kc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:p.jsxs(T$,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(c8,{children:o}),p.jsx(a8,{scope:r,isInside:!0,children:p.jsx(Q9,{id:c.contentId,role:"tooltip",children:n||o})})]})})});j$.displayName=co;var z$="TooltipArrow",M$=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,n=nl(r);return s8(z$,r).isInside?null:p.jsx($$,{...n,...o,ref:t})});M$.displayName=z$;function l8(e,t){const r=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),n=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,o,n,i)){case i:return"left";case n:return"right";case r:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function u8(e,t,r=5){const o=[];switch(t){case"top":o.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":o.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":o.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":o.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return o}function d8(e){const{top:t,right:r,bottom:o,left:n}=e;return[{x:n,y:t},{x:r,y:t},{x:r,y:o},{x:n,y:o}]}function f8(e,t){const{x:r,y:o}=e;let n=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],c=t[a],l=s.x,u=s.y,d=c.x,f=c.y;u>o!=f>o&&r<(d-l)*(o-u)/(f-u)+l&&(n=!n)}return n}function m8(e){const t=e.slice();return t.sort((r,o)=>r.x<o.x?-1:r.x>o.x?1:r.y<o.y?-1:r.y>o.y?1:0),p8(t)}function p8(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const n=e[o];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(n.y-a.y)>=(i.y-a.y)*(n.x-a.x))t.pop();else break}t.push(n)}t.pop();const r=[];for(let o=e.length-1;o>=0;o--){const n=e[o];for(;r.length>=2;){const i=r[r.length-1],a=r[r.length-2];if((i.x-a.x)*(n.y-a.y)>=(i.y-a.y)*(n.x-a.x))r.pop();else break}r.push(n)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var h8=C$,g8=N$,v8=R$,y8=P$,b8=j$,_8=M$;const U$=N.createContext(null);function L$(){return N.useContext(U$)?.current??null}function F$({delayDuration:e=0,...t}){return p.jsx(h8,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ol({...e}){return p.jsx(F$,{children:p.jsx(g8,{"data-slot":"tooltip",...e})})}function il({...e}){return p.jsx(v8,{"data-slot":"tooltip-trigger",...e})}function al({className:e,sideOffset:t=0,children:r,container:o,...n}){const i=L$();return p.jsx(y8,{container:o??i,children:p.jsxs(b8,{"data-slot":"tooltip-content",sideOffset:t,className:$.cn("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-20 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,p.jsx(_8,{className:"bg-foreground fill-foreground z-20 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]"})]})})}var su="focusScope.autoFocusOnMount",cu="focusScope.autoFocusOnUnmount",Ev={bubbles:!1,cancelable:!0},w8="FocusScope",bp=_.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:n,onUnmountAutoFocus:i,...a}=e,[s,c]=_.useState(null),l=dn(n),u=dn(i),d=_.useRef(null),f=ht(t,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(o){let h=function(x){if(m.paused||!s)return;const v=x.target;s.contains(v)?d.current=v:kr(d.current,{select:!0})},y=function(x){if(m.paused||!s)return;const v=x.relatedTarget;v!==null&&(s.contains(v)||kr(d.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const k of x)k.removedNodes.length>0&&kr(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const w=new MutationObserver(b);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),w.disconnect()}}},[o,s,m.paused]),_.useEffect(()=>{if(s){Tv.add(m);const h=document.activeElement;if(!s.contains(h)){const b=new CustomEvent(su,Ev);s.addEventListener(su,l),s.dispatchEvent(b),b.defaultPrevented||(x8(T8(V$(s)),{select:!0}),document.activeElement===h&&kr(s))}return()=>{s.removeEventListener(su,l),setTimeout(()=>{const b=new CustomEvent(cu,Ev);s.addEventListener(cu,u),s.dispatchEvent(b),b.defaultPrevented||kr(h??document.body,{select:!0}),s.removeEventListener(cu,u),Tv.remove(m)},0)}}},[s,l,u,m]);const g=_.useCallback(h=>{if(!r&&!o||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,b=document.activeElement;if(y&&b){const w=h.currentTarget,[x,v]=S8(w);x&&v?!h.shiftKey&&b===v?(h.preventDefault(),r&&kr(x,{select:!0})):h.shiftKey&&b===x&&(h.preventDefault(),r&&kr(v,{select:!0})):b===w&&h.preventDefault()}},[r,o,m.paused]);return p.jsx(Le.div,{tabIndex:-1,...a,ref:f,onKeyDown:g})});bp.displayName=w8;function x8(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(kr(o,{select:t}),document.activeElement!==r)return}function S8(e){const t=V$(e),r=Iv(t,e),o=Iv(t.reverse(),e);return[r,o]}function V$(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Iv(e,t){for(const r of e)if(!k8(r,{upTo:t}))return r}function k8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function E8(e){return e instanceof HTMLInputElement&&"select"in e}function kr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&E8(e)&&t&&e.select()}}var Tv=I8();function I8(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=$v(e,t),e.unshift(t)},remove(t){e=$v(e,t),e[0]?.resume()}}}function $v(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function T8(e){return e.filter(t=>t.tagName!=="A")}var lu=0;function Z$(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ov()),document.body.insertAdjacentElement("beforeend",e[1]??Ov()),lu++,()=>{lu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lu--}},[])}function Ov(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Xt=function(){return Xt=Object.assign||function(t){for(var r,o=1,n=arguments.length;o<n;o++){r=arguments[o];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Xt.apply(this,arguments)};function B$(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function $8(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o<n;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var qa="right-scroll-bar-position",Ga="width-before-scroll-bar",O8="with-scroll-bars-hidden",A8="--removed-body-scroll-bar-size";function uu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function C8(e,t){var r=N.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var n=r.value;n!==o&&(r.value=o,r.callback(o,n))}}}})[0];return r.callback=t,r.facade}var N8=typeof window<"u"?_.useLayoutEffect:_.useEffect,Av=new WeakMap;function R8(e,t){var r=C8(null,function(o){return e.forEach(function(n){return uu(n,o)})});return N8(function(){var o=Av.get(r);if(o){var n=new Set(o),i=new Set(e),a=r.current;n.forEach(function(s){i.has(s)||uu(s,null)}),i.forEach(function(s){n.has(s)||uu(s,a)})}Av.set(r,e)},[e]),r}function P8(e){return e}function j8(e,t){t===void 0&&(t=P8);var r=[],o=!1,n={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var a=t(i,o);return r.push(a),function(){r=r.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(o=!0;r.length;){var a=r;r=[],a.forEach(i)}r={push:function(s){return i(s)},filter:function(){return r}}},assignMedium:function(i){o=!0;var a=[];if(r.length){var s=r;r=[],s.forEach(i),a=r}var c=function(){var u=a;a=[],u.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){a.push(u),l()},filter:function(u){return a=a.filter(u),r}}}};return n}function D8(e){e===void 0&&(e={});var t=j8(null);return t.options=Xt({async:!0,ssr:!1},e),t}var q$=function(e){var t=e.sideCar,r=B$(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return _.createElement(o,Xt({},r))};q$.isSideCarExport=!0;function z8(e,t){return e.useMedium(t),q$}var G$=D8(),du=function(){},sl=_.forwardRef(function(e,t){var r=_.useRef(null),o=_.useState({onScrollCapture:du,onWheelCapture:du,onTouchMoveCapture:du}),n=o[0],i=o[1],a=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,m=e.noRelative,g=e.noIsolation,h=e.inert,y=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,x=e.gapMode,v=B$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,E=R8([r,t]),I=Xt(Xt({},v),n);return _.createElement(_.Fragment,null,u&&_.createElement(k,{sideCar:G$,removeScrollBar:l,shards:d,noRelative:m,noIsolation:g,inert:h,setCallbacks:i,allowPinchZoom:!!y,lockRef:r,gapMode:x}),a?_.cloneElement(_.Children.only(s),Xt(Xt({},I),{ref:E})):_.createElement(w,Xt({},I,{className:c,ref:E}),s))});sl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sl.classNames={fullWidth:Ga,zeroRight:qa};var M8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=M8();return t&&e.setAttribute("nonce",t),e}function L8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function F8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V8=function(){var e=0,t=null;return{add:function(r){e==0&&(t=U8())&&(L8(t,r),F8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Z8=function(){var e=V8();return function(t,r){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},H$=function(){var e=Z8(),t=function(r){var o=r.styles,n=r.dynamic;return e(o,n),null};return t},B8={left:0,top:0,right:0,gap:0},fu=function(e){return parseInt(e||"",10)||0},q8=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],n=t[e==="padding"?"paddingRight":"marginRight"];return[fu(r),fu(o),fu(n)]},G8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return B8;var t=q8(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},H8=H$(),qn="data-scroll-locked",W8=function(e,t,r,o){var n=e.left,i=e.top,a=e.right,s=e.gap;return r===void 0&&(r="margin"),`
97
97
  .`.concat(O8,` {
98
98
  overflow: hidden `).concat(o,`;
99
99
  padding-right: `).concat(s,"px ").concat(o,`;
@@ -142,4 +142,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
142
142
  linear-gradient(45deg, transparent 75%, #ccc 75%),
143
143
  linear-gradient(135deg, transparent 75%, #ccc 75%)`,backgroundSize:"25px 25px",backgroundPosition:"0 0, 12.5px 0, 12.5px -12.5px, 0px 12.5px"},children:p.jsx("img",{src:t,className:"max-h-[300px] max-w-full object-contain"})})}function ZH({content:e}){return p.jsx("div",{className:"w-full",children:e.content.map((t,r)=>{switch(t.type){case"text":{const o=MH(t._meta?.["getgram.ai/mime-type"]??"text/plain"),n=UH(t.text,o);return p.jsx(q1,{text:n,language:o},r)}case"image":return p.jsx(VH,{data:t.data},r);default:return p.jsx("pre",{className:"px-4 py-3 text-sm whitespace-pre-wrap",children:JSON.stringify(t,null,2)},r)}})})}function Lv({title:e,content:t,defaultExpanded:r=!1,highlightSyntax:o=!0,language:n="json"}){const[i,a]=N.useState(r),s=LH(t),c=s?JSON.stringify(t,null,2):typeof t=="string"?t:JSON.stringify(t,null,2);return p.jsxs("div",{"data-slot":"tool-ui-section",className:"border-border border-t",children:[p.jsxs("button",{onClick:()=>a(!i),className:"hover:bg-accent/50 flex w-full cursor-pointer items-center justify-between px-5 py-2.5 text-left transition-colors",children:[p.jsx("span",{className:"text-muted-foreground text-sm",children:e}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(FH,{content:c}),p.jsx(ME,{className:$.cn("text-muted-foreground size-4 transition-transform duration-200",i&&"rotate-90")})]})]}),i&&p.jsx("div",{className:"border-border border-t",children:s?p.jsx(ZH,{content:t}):o?p.jsx(q1,{text:c,language:n}):p.jsx("pre",{className:"text-foreground overflow-x-auto px-4 py-3 text-sm whitespace-pre-wrap",children:c})})]})}function BH({name:e,icon:t,provider:r,status:o="complete",request:n,result:i,defaultExpanded:a=!1,className:s,onApproveOnce:c,onApproveForSession:l,onDeny:u}){const d=o==="approval"&&c!==void 0&&u!==void 0,[f,m]=N.useState(a),g=n!==void 0||i!==void 0,[h,y]=N.useState("one-time"),[b,w]=N.useState(!1);N.useEffect(()=>{!d&&f&&!a&&m(!1)},[d]);const x=()=>{h==="for-session"&&l?l():c&&c()};return p.jsxs("div",{"data-slot":"tool-ui",className:$.cn("border-border bg-card overflow-hidden rounded-lg border",s),children:[r&&p.jsxs("div",{"data-slot":"tool-ui-provider",className:$.cn("border-border flex items-center gap-2 border-b px-4 py-2.5"),children:[t?p.jsx("span",{className:"flex size-5 items-center justify-center",children:t}):p.jsx("span",{className:"bg-muted flex size-5 items-center justify-center rounded text-xs font-medium",children:r.charAt(0).toUpperCase()}),p.jsx("span",{className:"text-sm font-medium",children:r})]}),p.jsxs("button",{onClick:()=>g&&m(!f),disabled:!g,className:$.cn("flex w-full items-center gap-2 px-4 py-3 text-left",g&&"hover:bg-accent/50 cursor-pointer transition-colors"),children:[p.jsx(B1,{status:o}),p.jsx("span",{className:$.cn("flex-1 text-sm",!r&&d&&"shimmer"),children:e}),g&&p.jsx(vs,{className:$.cn("text-muted-foreground size-4 transition-transform duration-200",f&&"rotate-180")})]}),f&&g&&p.jsxs("div",{"data-slot":"tool-ui-content",children:[n!==void 0&&p.jsx(Lv,{title:"Arguments",content:n,highlightSyntax:!0,language:"json"}),i!==void 0&&p.jsx(Lv,{title:"Output",content:i,highlightSyntax:!0,language:"json"})]}),d&&p.jsxs("div",{"data-slot":"tool-ui-approval-actions",className:"border-border flex items-center justify-end gap-2 border-t px-4 py-3",children:[p.jsx("div",{children:p.jsx("span",{className:"text-muted-foreground text-sm",children:"This tool requires approval"})}),p.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[p.jsxs(pt,{variant:"outline",size:"sm",onClick:u,className:"text-destructive hover:bg-destructive/10",children:[p.jsx(xo,{className:"mr-1 size-3"}),"Deny"]}),p.jsxs("div",{className:"flex items-center",children:[p.jsxs(pt,{variant:"default",size:"sm",onClick:x,className:"flex cursor-pointer justify-between gap-1 rounded-r-none bg-emerald-600 hover:bg-emerald-700",children:[p.jsx(Nr,{className:"mr-1 size-3"}),p.jsx("span",{className:"min-w-[110px]",children:h==="one-time"?"Approve this time":"Approve always"})]}),p.jsxs(F1,{open:b,onOpenChange:w,children:[p.jsx(V1,{asChild:!0,children:p.jsx(pt,{variant:"default",size:"sm",className:"cursor-pointer rounded-l-none border-l border-emerald-700 bg-emerald-600 px-2 hover:bg-emerald-700",children:p.jsx(vs,{className:"size-3"})})}),p.jsxs(Z1,{align:"end",className:"w-64 p-1",sideOffset:4,children:[p.jsxs("button",{onClick:()=>{y("one-time"),w(!1)},className:"hover:bg-accent relative flex w-full items-start gap-2 rounded-sm px-2 py-2 text-left",children:[p.jsx(Nr,{className:$.cn("relative top-1 mt-0.5 size-3 shrink-0",h!=="one-time"&&"invisible")}),p.jsxs("div",{className:"flex flex-col gap-0.5",children:[p.jsx("span",{className:"text-sm",children:"Approve only once"}),p.jsx("span",{className:"text-muted-foreground text-xs",children:"You'll be asked again next time"})]})]}),l&&p.jsxs("button",{onClick:()=>{y("for-session"),w(!1)},className:"hover:bg-accent relative flex w-full items-start gap-2 rounded-sm px-2 py-2 text-left",children:[p.jsx(Nr,{className:$.cn("relative top-1 mt-0.5 size-3 shrink-0",h!=="for-session"&&"invisible")}),p.jsxs("div",{className:"flex flex-col gap-0.5",children:[p.jsx("span",{className:"text-sm",children:"Approve always"}),p.jsx("span",{className:"text-muted-foreground text-xs",children:"Trust this tool for the session"})]})]})]})]})]})]})]})]})}function qH({title:e,icon:t,status:r="complete",defaultExpanded:o=!1,children:n,className:i}){const[a,s]=N.useState(o);return p.jsxs("div",{"data-slot":"tool-ui-group",className:$.cn("border-border bg-card overflow-hidden rounded-lg border",i),children:[p.jsxs("button",{onClick:()=>s(!a),className:"hover:bg-accent/50 flex w-full items-center gap-2 px-4 py-3 text-left transition-colors",children:[t||p.jsx(B1,{status:r==="running"?"running":"complete"}),p.jsx("span",{className:$.cn("flex-1 text-sm font-medium",r==="running"&&"shimmer"),children:e}),p.jsx(vs,{className:$.cn("text-muted-foreground size-4 transition-transform duration-200",a&&"rotate-180")})]}),a&&p.jsx("div",{"data-slot":"tool-ui-group-content",className:"border-border border-t",children:n})]})}const GH=({toolName:e,toolCallId:t,status:r,result:o,args:n})=>{const{pendingApprovals:i,whitelistTool:a,confirmPendingApproval:s,rejectPendingApproval:c}=AS(),l=i.get(t),d=z.useAssistantState(({message:w})=>w).parts.filter(w=>w.type==="tool-call"),f=d.findIndex(w=>w.toolName===e),m=()=>{s(t)},g=()=>{a(e),s(t)},h=()=>{c(t)},y=()=>l?"approval":r.type==="incomplete"?"error":r.type==="complete"?o&&typeof o=="object"&&"isError"in o&&o.isError?"error":"complete":"running",b=()=>{if(o!==void 0)return typeof o=="object"&&o!==null&&"content"in o&&Array.isArray(o.content)||typeof o=="string",o};return p.jsx("div",{className:$.cn("aui-tool-fallback-root flex w-full flex-col",f!==-1&&f!==d.length-1&&"border-b"),children:p.jsx(BH,{name:e,status:y(),request:n,result:b(),onApproveOnce:l?m:void 0,onApproveForSession:l?g:void 0,onDeny:l?h:void 0,className:"rounded-none border-0"})})},rr=[.23,1,.32,1],Fv=/@(\w+)/g;function HH(e){return e?Object.entries(e).map(([t,r])=>({id:t,name:t,description:typeof r=="object"&&r!==null&&"description"in r?String(r.description??""):void 0})):[]}function WH(e,t){if(!t||!e)return[];const r=Object.keys(t),o=[];let n;for(Fv.lastIndex=0;(n=Fv.exec(e))!==null;)o.push(n[1].toLowerCase());const i=r.filter(a=>o.includes(a.toLowerCase()));return[...new Set(i)]}function JH(e,t){const r=e.slice(0,t),o=r.lastIndexOf("@");if(o===-1)return{isInMention:!1,query:"",atPosition:-1};const n=r.slice(o+1);return n.includes(" ")||n.includes(`
144
144
  `)?{isInMention:!1,query:"",atPosition:-1}:{isInMention:!0,query:n.toLowerCase(),atPosition:o}}function KH(e,t){if(!t)return e;const r=t.toLowerCase();return e.filter(o=>{const n=o.name.toLowerCase().includes(r),i=o.description?.toLowerCase().includes(r);return n||i})}function YH(e,t,r,o){const n=e.slice(0,r),i=e.slice(o),a=`${n}@${t} ${i}`,s=r+t.length+2;return{text:a,cursorPosition:s}}function XH(e,t){const r=new RegExp(`@${t}\\s?`,"gi");return e.replace(r,"")}const QH=({tools:e,value:t,cursorPosition:r,onValueChange:o,textareaRef:n,className:i})=>{const[a,s]=N.useState(0),[c,l]=N.useState(!1),[u,d]=N.useState([]),[f,m]=N.useState(null),g=N.useRef(null),h=$.useDensity(),y=$.useRadius();N.useEffect(()=>{const w=JH(t,r);if(w.isInMention&&e.length>0){const x=KH(e,w.query);d(x),l(x.length>0),m({atPosition:w.atPosition,query:w.query}),s(0)}else l(!1),m(null)},[t,r,e]);const b=N.useCallback(w=>{if(!f)return;const x=YH(t,w.name,f.atPosition,r);o(x.text,x.cursorPosition),l(!1)},[f,t,r,o,n]);return N.useEffect(()=>{if(!c)return;const w=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),v.stopPropagation(),s(k=>(k+1)%u.length);break;case"ArrowUp":v.preventDefault(),v.stopPropagation(),s(k=>(k-1+u.length)%u.length);break;case"Enter":case"Tab":v.preventDefault(),v.stopPropagation(),u[a]&&b(u[a]);break;case"Escape":v.preventDefault(),v.stopPropagation(),l(!1);break}},x=n.current;if(x)return x.addEventListener("keydown",w,{capture:!0}),()=>x.removeEventListener("keydown",w,{capture:!0})},[c,u,a,b,n]),N.useEffect(()=>{if(!c)return;const w=g.current;if(!w)return;const x=w.querySelector(`[data-index="${a}"]`);x&&x.scrollIntoView({block:"nearest"})},[a,c]),N.useEffect(()=>{if(!c)return;const w=x=>{g.current&&!g.current.contains(x.target)&&n.current&&!n.current.contains(x.target)&&l(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c,n]),N.useEffect(()=>{const w=n.current;if(!w)return;const x=w.closest(".aui-composer-root");return x?(c?requestAnimationFrame(()=>{const k=g.current;if(k&&c){x.style.borderTopColor="var(--ring)",x.style.borderTopLeftRadius="0",x.style.borderTopRightRadius="0";const E=x.getBoundingClientRect(),I=k.offsetParent;if(I){const A=I.getBoundingClientRect();k.style.left=`${E.left-A.left}px`,k.style.right="auto",k.style.width=`${E.width}px`}}}):(x.style.borderTopColor="",x.style.borderTopLeftRadius="",x.style.borderTopRightRadius=""),()=>{x.style.borderTopColor="",x.style.borderTopLeftRadius="",x.style.borderTopRightRadius=""}):void 0},[c,n]),!c||u.length===0?null:p.jsx(Ut.div,{ref:g,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.15,ease:rr},className:$.cn("aui-tool-mention-autocomplete border-ring bg-background absolute bottom-full z-50 max-h-[220px] overflow-clip overflow-y-auto overscroll-contain rounded-br-none! rounded-bl-none! border border-b-0 shadow-xs",y("xl"),i),children:p.jsx("div",{className:"flex flex-col gap-1",children:u.map((w,x)=>p.jsxs("button",{type:"button","data-index":x,className:$.cn("aui-tool-mention-item flex w-full items-center gap-2 text-left transition-colors",h("p-sm"),"hover:bg-accent hover:text-accent-foreground",x===a&&"bg-accent text-accent-foreground"),onClick:v=>{v.preventDefault(),v.stopPropagation(),b(w)},onMouseEnter:()=>s(x),children:[p.jsx(LE,{className:"mt-0.5 size-4 flex-shrink-0 opacity-50"}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"text-sm font-medium",children:w.name}),w.description&&p.jsx("div",{className:"text-muted-foreground line-clamp-2 text-xs",children:w.description})]})]},w.id))})})},eW=({mentionedToolIds:e,tools:t,onRemove:r,className:o})=>{const n=$.useDensity(),i=t.filter(a=>e.includes(a.id));return i.length===0?null:p.jsxs("div",{className:$.cn("aui-mentioned-tools-badges flex flex-wrap items-center gap-1",n("px-sm"),n("py-xs"),o),children:[p.jsx("span",{className:"text-muted-foreground flex-shrink-0 text-xs",children:"Tools:"}),p.jsx(Lt.AnimatePresence,{mode:"popLayout",children:i.map(a=>p.jsx(Ut.div,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15,ease:rr},children:p.jsx(tW,{tool:a,onRemove:r?()=>r(a.id):void 0})},a.id))})]})},tW=({tool:e,onRemove:t})=>{const r=$.useDensity(),o=$.useRadius();return p.jsxs("div",{className:$.cn("aui-tool-badge bg-primary/10 text-primary inline-flex items-center gap-1",o("md"),r("px-sm"),r("py-xs")),children:[p.jsx(LE,{className:"size-3 flex-shrink-0"}),p.jsx("span",{className:"text-xs font-medium",children:e.name}),t&&p.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),t()},className:"hover:opacity-70 focus:outline-none","aria-label":`Remove ${e.name}`,children:p.jsx(xo,{className:"size-3 flex-shrink-0"})})]})};function rW({tools:e,enabled:t=!0}){const[r,o]=N.useState(0),n=N.useRef(null),i=z.useAssistantApi(),a=z.useAssistantState(({composer:m})=>m.text),s=N.useMemo(()=>HH(e),[e]),c=N.useMemo(()=>t?WH(a,e):[],[a,e,t]),l=N.useCallback(()=>{const m=n.current;m&&o(m.selectionStart)},[]),u=N.useCallback((m,g)=>{i.composer().setText(m),o(g),setTimeout(()=>{const h=n.current;h&&(h.focus(),h.setSelectionRange(g,g))},0)},[i]),d=N.useCallback(m=>{const g=s.find(h=>h.id===m);if(g){const h=XH(a,g.name);i.composer().setText(h)}},[a,s,i]),f=t&&s.length>0;return{mentionableTools:s,mentionedToolIds:c,value:a,cursorPosition:r,textareaRef:n,updateCursorPosition:l,handleAutocompleteChange:u,removeMention:d,isActive:f}}const dl=()=>{const{config:e}=$.useElements(),t=e.theme??{};return N.useMemo(()=>{const{colorScheme:r="light"}=t;return{className:r==="dark"||r==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":void 0}},[t])};function nW(e){return e.replace(/[-_]/g," ").split(/(?=[A-Z])/).join(" ").split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const oW=({children:e})=>{const t=z.useAssistantState(({message:s})=>s).parts,r=t.filter(s=>s.type==="tool-call"),o=r.some(s=>s.status?.type==="running"),{config:n}=$.useElements(),i=n.tools?.expandToolGroupsByDefault??!1,a=N.useMemo(()=>{const s=t.filter(c=>c.type==="tool-call");return s.length===0?"No tools called":s.length===1?`Calling ${nW(s[0].toolName)}...`:o?`Calling ${s.length} tools...`:`Executed ${s.length} tools`},[t,o]);return n.tools?.components?.[r[0]?.toolName]?e:r.length===1?p.jsx("div",{className:$.cn("my-4 w-full max-w-xl"),children:p.jsx("div",{className:"border-border bg-card overflow-hidden rounded-lg border",children:e})}):p.jsx("div",{className:"my-4 w-full max-w-xl",children:p.jsx(qH,{title:a,status:o?"running":"complete",defaultExpanded:i,children:e})})},iW=()=>p.jsxs("div",{className:"m-2 rounded-md border border-amber-500 bg-amber-100 px-4 py-3 text-sm text-amber-800 dark:border-amber-600 dark:bg-amber-900/30 dark:text-amber-200",children:[p.jsx("strong",{children:"Warning:"})," You are using a static session token in the client. It will expire shortly. Please"," ",p.jsx("a",{href:"https://github.com/speakeasy-api/gram/tree/main/elements#setting-up-your-backend",target:"_blank",rel:"noopener noreferrer",className:"text-amber-700 underline hover:text-amber-800 dark:text-amber-300 dark:hover:text-amber-200",children:"set up a session endpoint to avoid this warning."})]}),Op=({className:e})=>{const t=dl(),r=$.useDensity(),{config:o}=$.useElements(),n=o.components??{},i=o.api&&"sessionToken"in o.api;return p.jsx(Lt.LazyMotion,{features:Lt.domAnimation,children:p.jsx(Lt.MotionConfig,{reducedMotion:"user",children:p.jsx(z.ThreadPrimitive.Root,{className:$.cn("aui-root aui-thread-root bg-background @container flex h-full flex-col",t.className,e),children:p.jsxs(z.ThreadPrimitive.Viewport,{className:$.cn("aui-thread-viewport relative mx-auto flex w-full flex-1 flex-col overflow-x-auto overflow-y-scroll pb-0!",r("p-lg")),children:[p.jsx(z.ThreadPrimitive.If,{empty:!0,children:n.ThreadWelcome?p.jsx(n.ThreadWelcome,{}):p.jsx(sW,{})}),i&&p.jsx(iW,{}),p.jsx(z.ThreadPrimitive.Messages,{components:{UserMessage:n.UserMessage??vW,EditComposer:n.EditComposer??bW,AssistantMessage:n.AssistantMessage??pW}}),p.jsx(z.ThreadPrimitive.If,{empty:!1,children:p.jsx("div",{className:"aui-thread-viewport-spacer min-h-8 grow"})}),p.jsx(uW,{})]})})})})},aW=()=>p.jsx(z.ThreadPrimitive.ScrollToBottom,{asChild:!0,children:p.jsx(Ht,{tooltip:"Scroll to bottom",variant:"outline",className:"aui-thread-scroll-to-bottom dark:bg-background dark:hover:bg-accent absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible",children:p.jsx(jL,{})})}),sW=()=>{const{config:e}=$.useElements(),t=$.useDensity(),{title:r,subtitle:o}=e.welcome??{},n=e.variant==="standalone";return p.jsxs("div",{className:$.cn("aui-thread-welcome-root my-auto flex w-full grow flex-col",n?"items-center justify-center":"",t("gap-lg")),children:[p.jsx("div",{className:$.cn("aui-thread-welcome-center flex w-full grow flex-col items-center justify-start"),children:p.jsxs("div",{className:$.cn("aui-thread-welcome-message flex flex-col",n?"items-center text-center":"size-full justify-start",t("gap-sm"),!n&&t("py-md")),children:[p.jsx(Ut.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.25,ease:rr},className:$.cn("aui-thread-welcome-message-motion-1 text-foreground font-semibold",t("text-title")),children:r}),p.jsx(Ut.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.25,delay:.05,ease:rr},className:$.cn("aui-thread-welcome-message-motion-2 text-muted-foreground/65",t("text-subtitle")),children:o})]})}),p.jsx(cW,{})]})},cW=()=>{const{config:e}=$.useElements(),t=$.useRadius(),r=$.useDensity(),o=e.welcome?.suggestions??[],n=e.variant==="standalone";return o.length===0?null:p.jsx("div",{className:$.cn("aui-thread-welcome-suggestions w-full",r("gap-md"),r("py-lg"),n?"flex flex-wrap items-center justify-center":o.length===1?"flex":"grid max-w-fit @md:grid-cols-2"),children:o.map((i,a)=>p.jsx(Ut.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.25,delay:.03*a,ease:rr},className:$.cn("aui-thread-welcome-suggestion-display",!n&&"nth-[n+3]:hidden @md:nth-[n+3]:block"),children:p.jsx(z.ThreadPrimitive.Suggestion,{prompt:i.prompt,send:!0,asChild:!0,children:p.jsxs(pt,{variant:"ghost",className:$.cn("aui-thread-welcome-suggestion dark:hover:bg-accent/60 h-auto w-full border text-left whitespace-break-spaces",r("text-base"),n?`flex-row items-center ${r("gap-sm")} ${r("px-md")} ${r("py-sm")} ${t("full")}`:`w-full flex-1 flex-col flex-wrap items-start justify-start ${r("gap-sm")} ${r("px-lg")} ${r("py-md")} ${t("xl")}`),"aria-label":i.prompt,children:[p.jsx("span",{className:"aui-thread-welcome-suggestion-text-1 text-foreground text-sm font-medium",children:i.title}),p.jsx("span",{className:"aui-thread-welcome-suggestion-text-2 text-muted-foreground text-sm",children:i.label})]})})},`suggested-action-${i.title}-${a}`))})},lW=({tools:e})=>{const t=N.useRef(null),{mentionableTools:r,mentionedToolIds:o,value:n,cursorPosition:i,textareaRef:a,updateCursorPosition:s,handleAutocompleteChange:c,removeMention:l,isActive:u}=rW({tools:e});return N.useEffect(()=>{if(!u)return;const d=()=>{const g=document.querySelector(".aui-composer-input");if(g&&a.current!==g){a.current=g;const h=()=>s();return g.addEventListener("click",h),g.addEventListener("keyup",h),g.addEventListener("input",h),()=>{g.removeEventListener("click",h),g.removeEventListener("keyup",h),g.removeEventListener("input",h)}}},f=d(),m=new MutationObserver(()=>{d()});return m.observe(document.body,{childList:!0,subtree:!0}),()=>{f?.(),m.disconnect()}},[u,a,s]),u?p.jsxs("div",{ref:t,className:"aui-composer-tool-mentions relative",children:[p.jsx(eW,{mentionedToolIds:o,tools:r,onRemove:l}),p.jsx(Lt.AnimatePresence,{children:p.jsx(QH,{tools:r,value:n,cursorPosition:i,onValueChange:c,textareaRef:a})})]}):null},uW=()=>{const{config:e,mcpTools:t}=$.useElements(),r=$.useRadius(),o=$.useDensity(),n=e.composer??{placeholder:"Send a message...",attachments:!0},i=e.components??{},a=n.toolMentions===void 0||n.toolMentions===!0||typeof n.toolMentions=="object"&&n.toolMentions.enabled!==!1,s=N.useRef(null);return i.Composer?p.jsx(i.Composer,{}):p.jsxs("div",{className:$.cn("aui-composer-wrapper bg-background sticky bottom-0 flex w-full flex-col overflow-visible",o("gap-md"),o("py-md"),r("xl")),children:[p.jsx(aW,{}),p.jsxs(z.ComposerPrimitive.Root,{ref:s,className:$.cn("aui-composer-root group/input-group border-input bg-background has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-ring/5 dark:bg-background relative flex w-full flex-col border px-1 pt-2 shadow-xs transition-[color,box-shadow] outline-none has-[textarea:focus-visible]:ring-1",r("xl")),children:[n.attachments&&p.jsx(aH,{}),a&&p.jsx(lW,{tools:t}),p.jsx(z.ComposerPrimitive.Input,{placeholder:n.placeholder,className:$.cn("aui-composer-input placeholder:text-muted-foreground mb-1 max-h-32 w-full resize-none bg-transparent px-3.5 pt-1.5 pb-3 outline-none focus-visible:ring-0",o("h-input"),o("text-base")),rows:1,autoFocus:!0,"aria-label":"Message input"}),p.jsx(fW,{})]})]})},dW=()=>{const{model:e,setModel:t}=$.useElements(),[r,o]=N.useState(!1),[n,i]=N.useState(!1),a=N.useRef(null),s=N.useRef(0),c=N.useRef(!1);N.useEffect(()=>{r&&!c.current&&requestAnimationFrame(()=>{const u=a.current;u&&u.scrollHeight>0&&(u.scrollTop=s.current)}),c.current=r},[r]),N.useEffect(()=>{r&&i(!1)},[r]);const l=u=>{s.current=u.currentTarget.scrollTop};return p.jsx(F$,{children:p.jsxs(ol,{open:n&&!r,onOpenChange:i,children:[p.jsxs(F1,{open:r,onOpenChange:o,children:[p.jsx(il,{asChild:!0,children:p.jsx(V1,{asChild:!0,children:p.jsx(pt,{variant:"ghost",size:"icon","data-state":r?"open":"closed",className:"aui-composer-model-picker data-[state=open]:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30 flex w-fit items-center gap-2 rounded-full px-2.5 py-1 text-xs font-semibold","aria-label":"Model Settings",children:p.jsx(d5,{className:"aui-attachment-add-icon size-5 stroke-[1.5px]"})})})}),p.jsx(Z1,{side:"top",align:"start",className:"w-min p-0 shadow-none",children:p.jsx("div",{ref:a,className:"max-h-48 overflow-y-auto",onScroll:l,children:Um.map(u=>p.jsxs(pt,{onClick:()=>{t(u)},variant:"ghost",className:"w-full justify-start gap-2 rounded-none px-2",children:[u===e?p.jsx("div",{children:p.jsx(Nr,{className:"size-4 text-emerald-500"})}):p.jsx("div",{className:"size-4",children:" "}),u]},u))})})]}),p.jsx(al,{side:"bottom",align:"start",children:"Model Settings"})]})})},fW=()=>{const{config:e}=$.useElements(),t=$.useRadius(),r=e.composer??{attachments:!0};return p.jsxs("div",{className:"aui-composer-action-wrapper relative mx-1 mt-2 mb-2 flex items-center justify-between",children:[p.jsxs("div",{className:"aui-composer-action-wrapper-inner flex items-center",children:[r.attachments?p.jsx(sH,{}):p.jsx("div",{className:"aui-composer-add-attachment-placeholder"}),e.model?.showModelPicker&&!e.languageModel&&p.jsx(dW,{})]}),p.jsx(z.ThreadPrimitive.If,{running:!1,children:p.jsx(z.ComposerPrimitive.Send,{asChild:!0,children:p.jsx(Ht,{tooltip:"Send message",side:"bottom",type:"submit",variant:"default",size:"icon",className:$.cn("aui-composer-send size-[34px] p-1",t("full")),"aria-label":"Send message",children:p.jsx(zL,{className:"aui-composer-send-icon size-5"})})})}),p.jsx(z.ThreadPrimitive.If,{running:!0,children:p.jsx(z.ComposerPrimitive.Cancel,{asChild:!0,children:p.jsx(pt,{type:"button",variant:"default",size:"icon",className:$.cn("aui-composer-cancel border-muted-foreground/60 hover:bg-primary/75 dark:border-muted-foreground/90 size-[34px] border",t("full")),"aria-label":"Stop generating",children:p.jsx(m5,{className:"aui-composer-cancel-icon size-3.5 fill-white dark:fill-black"})})})})]})},mW=()=>p.jsx(z.MessagePrimitive.Error,{children:p.jsx(z.ErrorPrimitive.Root,{className:"aui-message-error-root border-destructive bg-destructive/10 text-destructive dark:bg-destructive/5 mt-2 rounded-md border p-3 text-sm dark:text-red-200",children:p.jsx(z.ErrorPrimitive.Message,{className:"aui-message-error-message line-clamp-2"})})}),pW=()=>{const{config:e}=$.useElements(),t=e.tools??{},r=e.components??{};return p.jsx(z.MessagePrimitive.Root,{asChild:!0,children:p.jsxs("div",{className:"aui-assistant-message-root animate-in fade-in slide-in-from-bottom-1 relative mx-auto w-full py-4 duration-150 ease-out last:mb-24","data-role":"assistant",children:[p.jsxs("div",{className:"aui-assistant-message-content text-foreground mx-2 leading-7 wrap-break-word",children:[p.jsx(z.MessagePrimitive.Parts,{components:{Text:r.Text??x1,Image:r.Image??hW,tools:{by_name:t.components,Fallback:r.ToolFallback??GH},Reasoning:r.Reasoning??A1,ReasoningGroup:r.ReasoningGroup??C1,ToolGroup:r.ToolGroup??oW}}),p.jsx(mW,{})]}),p.jsx("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:p.jsx(gW,{})})]})})},hW=e=>p.jsx("img",{src:e.image}),gW=()=>p.jsx(z.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",autohideFloat:"single-branch",className:"aui-assistant-action-bar-root text-muted-foreground data-floating:bg-background col-start-3 row-start-2 -ml-1 flex gap-1 data-floating:absolute data-floating:rounded-md data-floating:border data-floating:p-1 data-floating:shadow-sm",children:p.jsx(z.ActionBarPrimitive.Copy,{asChild:!0,children:p.jsxs(Ht,{tooltip:"Copy",children:[p.jsx(z.MessagePrimitive.If,{copied:!0,children:p.jsx(Nr,{})}),p.jsx(z.MessagePrimitive.If,{copied:!1,children:p.jsx(Lm,{})})]})})}),vW=()=>{const e=$.useRadius();return p.jsx(z.MessagePrimitive.Root,{asChild:!0,children:p.jsxs("div",{className:"aui-user-message-root animate-in fade-in slide-in-from-bottom-1 mx-auto grid w-full auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] gap-y-2 px-2 py-4 duration-150 ease-out first:mt-3 last:mb-5 [&:where(>*)]:col-start-2","data-role":"user",children:[p.jsx(iH,{}),p.jsxs("div",{className:"aui-user-message-content-wrapper relative col-start-2 min-w-0",children:[p.jsx("div",{className:$.cn("aui-user-message-content bg-muted text-foreground px-5 py-2.5 wrap-break-word",e("xl")),children:p.jsx(z.MessagePrimitive.Parts,{})}),p.jsx("div",{className:"aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2",children:p.jsx(yW,{})})]}),p.jsx(_W,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]})})},yW=()=>p.jsx(z.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",className:"aui-user-action-bar-root flex flex-col items-end",children:p.jsx(z.ActionBarPrimitive.Edit,{asChild:!0,children:p.jsx(Ht,{tooltip:"Edit",className:"aui-user-action-edit p-4",children:p.jsx(c5,{})})})}),bW=()=>p.jsx("div",{className:"aui-edit-composer-wrapper mx-auto flex w-full flex-col gap-4 px-2 first:mt-4",children:p.jsxs(z.ComposerPrimitive.Root,{className:"aui-edit-composer-root bg-muted ml-auto flex w-full max-w-7/8 flex-col rounded-xl",children:[p.jsx(z.ComposerPrimitive.Input,{className:"aui-edit-composer-input text-foreground flex min-h-[60px] w-full resize-none bg-transparent p-4 outline-none",autoFocus:!0}),p.jsxs("div",{className:"aui-edit-composer-footer mx-3 mb-3 flex items-center justify-center gap-2 self-end",children:[p.jsx(z.ComposerPrimitive.Cancel,{asChild:!0,children:p.jsx(pt,{variant:"ghost",size:"sm","aria-label":"Cancel edit",children:"Cancel"})}),p.jsx(z.ComposerPrimitive.Send,{asChild:!0,children:p.jsx(pt,{size:"sm","aria-label":"Update message",children:"Update"})})]})]})}),_W=({className:e,...t})=>p.jsxs(z.BranchPickerPrimitive.Root,{hideWhenSingleBranch:!0,className:$.cn("aui-branch-picker-root text-muted-foreground mr-2 -ml-2 inline-flex items-center text-xs",e),...t,children:[p.jsx(z.BranchPickerPrimitive.Previous,{asChild:!0,children:p.jsx(Ht,{tooltip:"Previous",children:p.jsx(ZL,{})})}),p.jsxs("span",{className:"aui-branch-picker-state font-medium",children:[p.jsx(z.BranchPickerPrimitive.Number,{})," / ",p.jsx(z.BranchPickerPrimitive.Count,{})]}),p.jsx(z.BranchPickerPrimitive.Next,{asChild:!0,children:p.jsx(Ht,{tooltip:"Next",children:p.jsx(ME,{})})})]});function wW({className:e,...t}){return p.jsx("div",{"data-slot":"skeleton",className:$.cn("bg-accent animate-pulse rounded-md",e),...t})}const Ap=({className:e})=>{const t=$.useDensity();return p.jsxs(z.ThreadListPrimitive.Root,{className:$.cn("aui-root aui-thread-list-root bg-background flex flex-col items-stretch",t("gap-sm"),e),children:[p.jsx("div",{className:$.cn("aui-thread-list-new-section border-b pb-2",t("py-sm"),t("px-sm")),children:p.jsx(xW,{})}),p.jsx("div",{className:$.cn("aui-thread-list-items-section flex flex-col gap-1",t("py-xs"),t("px-sm")),children:p.jsx(SW,{})})]})},xW=()=>{const e=$.useDensity();return p.jsx(z.ThreadListPrimitive.New,{asChild:!0,children:p.jsxs(pt,{className:$.cn("aui-thread-list-new hover:bg-muted-foreground/10 data-[active=true]:bg-muted-foreground/20! flex w-full cursor-pointer items-center justify-start gap-1 rounded-lg px-2.5 py-2 text-start",e("p-sm"),e("py-xs")),variant:"ghost",children:[p.jsx(UE,{}),"New Thread"]})})},SW=()=>z.useAssistantState(({threads:t})=>t.isLoading)?p.jsx(kW,{}):p.jsx(z.ThreadListPrimitive.Items,{components:{ThreadListItem:EW}}),kW=()=>p.jsx(p.Fragment,{children:Array.from({length:5},(e,t)=>p.jsx("div",{role:"status","aria-label":"Loading threads","aria-live":"polite",className:"aui-thread-list-skeleton-wrapper flex items-center gap-2 rounded-md px-3 py-2",children:p.jsx(wW,{className:"aui-thread-list-skeleton h-[22px] grow"})},t))}),EW=()=>{const e=$.useRadius(),t=$.useDensity();return p.jsx(z.ThreadListItemPrimitive.Root,{className:$.cn("aui-thread-list-item group hover:bg-muted focus-visible:bg-muted focus-visible:ring-ring data-[active=true]:bg-muted-foreground/20 flex items-center gap-2 rounded-lg transition-all focus-visible:ring-2 focus-visible:outline-none",e("md")),children:p.jsx(z.ThreadListItemPrimitive.Trigger,{className:$.cn("aui-thread-list-item-trigger flex grow cursor-pointer items-center text-start",t("px-lg"),t("py-sm")),children:p.jsx(IW,{})})})},IW=()=>p.jsx("span",{className:"aui-thread-list-item-title text-sm",children:p.jsx(z.ThreadListItemPrimitive.Title,{fallback:"New Chat"})}),G1=()=>{const{config:e,isExpanded:t,setIsExpanded:r}=$.useElements(),o=e.variant==="sidecar"?e.sidecar:e.modal,n=o?.expandable??!1,i=o?.defaultExpanded??!1;return{expandable:n,isExpanded:t,setIsExpanded:r,defaultExpanded:i}},TW={layout:{duration:.25,ease:rr}},$W=({className:e})=>{const{config:t}=$.useElements(),r=dl(),o=$.useRadius(),n=$.useDensity(),[i,a]=N.useState(t.modal?.defaultOpen??!1),{expandable:s,isExpanded:c,setIsExpanded:l}=G1(),u=t.modal?.title,d=t.modal?.icon,f=t.history?.enabled&&t.history?.showThreadList!==!1,m=t.modal?.position??"bottom-right",g=OW(m),h=N.useMemo(()=>t.modal?.dimensions?.default??{width:"500px",height:"600px",maxHeight:"95vh"},[t.modal?.dimensions?.default]),y=N.useMemo(()=>t.modal?.dimensions?.expanded??{width:"70vw",height:"90vh"},[t.modal?.dimensions?.expanded]),w=z.useAssistantState(({thread:E})=>E).messages.some(E=>E.status?.type==="running"),x=c?y.width:h.width,v=c?y.height:h.height,k=h.maxHeight;return p.jsx(Lt.LazyMotion,{features:Lt.domMax,children:p.jsx(Lt.MotionConfig,{reducedMotion:"user",transition:TW,children:p.jsx("div",{className:$.cn("aui-root aui-modal-anchor fixed z-10",g,r.className,o("lg"),i&&"shadow-xl",e),children:p.jsx(Lt.AnimatePresence,{mode:"wait",children:i?p.jsxs(Ut.div,{layout:!0,layoutId:"chat-container",className:$.cn("aui-modal-content bg-popover text-popover-foreground flex flex-col overflow-hidden border [&>.aui-thread-root]:bg-inherit",o("lg")),initial:!1,style:{originX:m.includes("left")?0:1,originY:m.includes("top")?0:1,width:x,height:v,maxHeight:k},children:[p.jsxs(Ut.div,{className:$.cn("aui-modal-header flex shrink-0 items-center justify-between border-b",n("h-header"),n("px-lg")),initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.1,ease:rr},children:[p.jsx("div",{className:$.cn("flex min-w-0 items-center"),children:p.jsxs("span",{className:$.cn("text-md flex items-center gap-2 truncate font-medium",w&&"shimmer"),children:[p.jsx("span",{className:"truncate",children:u}),w&&p.jsx(ys,{className:"text-muted-foreground size-4.5 animate-spin",strokeWidth:1.25})]})}),p.jsxs("div",{className:"flex flex-row items-center justify-end gap-1",children:[s?p.jsx("button",{type:"button",onClick:()=>l(E=>!E),className:$.cn("text-muted-foreground hover:text-foreground hover:bg-accent flex h-8 cursor-pointer items-center rounded-md px-2 text-xs transition-colors"),"aria-pressed":c,"aria-label":c?"Collapse assistant":"Expand assistant",children:c?p.jsx(r5,{strokeWidth:2,className:"size-3.5 rotate-90"}):p.jsx(XL,{strokeWidth:2,className:"size-3.5 rotate-90"})}):null,p.jsx("button",{onClick:()=>{a(!1),l(!1)},className:"text-muted-foreground hover:text-foreground hover:bg-accent -mr-1 flex size-8 cursor-pointer items-center justify-center rounded-md transition-colors","aria-label":`Close ${u}`,children:p.jsx(xo,{className:"size-4.5"})})]})]}),p.jsxs(Ut.div,{className:"aui-modal-body flex flex-1 overflow-hidden",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.05,ease:rr},children:[f&&p.jsx("div",{className:"aui-modal-thread-list w-56 shrink-0 overflow-y-auto border-r",children:p.jsx(Ap,{})}),p.jsx("div",{className:"aui-modal-thread w-full flex-1 overflow-hidden",children:p.jsx(op,{children:p.jsx(Op,{})})})]})]},"chat"):p.jsx(Ut.button,{layout:!0,layoutId:"chat-container",onClick:()=>a(!0),className:$.cn("aui-modal-button bg-primary text-primary-foreground flex size-12 cursor-pointer items-center justify-center border shadow-lg transition-shadow hover:shadow-xl",o("full")),initial:!1,"aria-label":`Open ${u}`,style:{originX:1,originY:1},children:p.jsx(Ut.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2,ease:rr},className:"flex size-full items-center justify-center",children:d?d("closed"):p.jsx(e5,{className:"size-6"})})},"button")})})})})};function OW(e){switch(e){case"bottom-left":return"left-4 bottom-4";case"top-right":return"right-4 top-4";case"top-left":return"left-4 top-4";case"bottom-right":return"right-4 bottom-4";default:$.assertNever(e)}}const AW=({className:e})=>{const{config:t}=$.useElements(),r=dl(),o=t.sidecar??{},{title:n,dimensions:i}=o,{expandable:a,isExpanded:s,setIsExpanded:c}=G1(),u=z.useAssistantState(({thread:f})=>f).messages.some(f=>f.status?.type==="running"),d=t.history?.enabled&&t.history?.showThreadList!==!1;return p.jsx(Lt.LazyMotion,{features:Lt.domMax,children:p.jsxs(Ut.div,{initial:!1,animate:{width:s?i?.expanded?.width??"800px":i?.default?.width??"400px"},transition:{duration:.3,ease:rr},className:$.cn("aui-root aui-sidecar bg-popover text-popover-foreground fixed top-0 right-0 bottom-0 flex flex-col border-l",r.className,e),children:[p.jsxs("div",{className:"aui-sidecar-header flex h-14 shrink-0 items-center justify-between border-b px-4",children:[p.jsxs("span",{className:$.cn("text-md flex items-center gap-2 font-medium",u&&"shimmer"),children:[n,u&&p.jsx(ys,{className:"text-muted-foreground size-4.5 animate-spin",strokeWidth:1.25})]}),a&&p.jsx("div",{className:"aui-sidecar-header-actions flex items-center gap-1",children:p.jsx(Ht,{tooltip:s?"Collapse":"Pop out",variant:"ghost",className:"aui-sidecar-popout size-8",onClick:()=>c(f=>!f),children:s?p.jsx(o5,{className:"size-4.5"}):p.jsx(a5,{className:"size-4.5"})})})]}),p.jsxs("div",{className:"aui-sidecar-body flex min-h-0 flex-1 overflow-hidden",children:[d&&p.jsx("div",{className:"aui-sidecar-thread-list w-56 shrink-0 overflow-y-auto border-r",children:p.jsx(Ap,{})}),p.jsx("div",{className:"aui-sidecar-content flex-1 overflow-hidden",children:p.jsx(op,{children:p.jsx(Op,{})})})]})]})})};function CW({containerRef:e,children:t}){return p.jsx(U$.Provider,{value:e,children:t})}const gu=`@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-track-height:200px;--shimmer-angle:15deg}*,:before,:after,::backdrop{--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root,:host{--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-800:oklch(39.8% .195 277.366);--color-violet-600:oklch(54.1% .281 293.009);--color-purple-600:oklch(55.8% .288 302.321);--color-pink-500:oklch(65.6% .241 354.308);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--tracking-tight:-.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--color-background:var(--background)}@property --shimmer-track-height{syntax:"<length>";inherits:true;initial-value:200px}@property --shimmer-angle{syntax:"<angle>";inherits:true;initial-value:15deg}@layer theme;@layer base{.gram-elements .\\@container{container-type:inline-size}.gram-elements .pointer-events-none{pointer-events:none}.gram-elements .collapse{visibility:collapse}.gram-elements .invisible{visibility:hidden}.gram-elements .visible{visibility:visible}.gram-elements .sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.gram-elements .absolute{position:absolute}.gram-elements .fixed{position:fixed}.gram-elements .relative{position:relative}.gram-elements .static{position:static}.gram-elements .sticky{position:sticky}.gram-elements .inset-0{inset:calc(var(--spacing)*0)}.gram-elements .inset-x-0{inset-inline:calc(var(--spacing)*0)}.gram-elements .-top-10{top:calc(var(--spacing)*-10)}.gram-elements .-top-12{top:calc(var(--spacing)*-12)}.gram-elements .top-0{top:calc(var(--spacing)*0)}.gram-elements .top-1{top:calc(var(--spacing)*1)}.gram-elements .top-1\\.5{top:calc(var(--spacing)*1.5)}.gram-elements .top-1\\/2{top:50%}.gram-elements .top-4{top:calc(var(--spacing)*4)}.gram-elements .top-8{top:calc(var(--spacing)*8)}.gram-elements .top-\\[50\\%\\]{top:50%}.gram-elements .-right-10{right:calc(var(--spacing)*-10)}.gram-elements .right-0{right:calc(var(--spacing)*0)}.gram-elements .right-1\\.5{right:calc(var(--spacing)*1.5)}.gram-elements .right-2{right:calc(var(--spacing)*2)}.gram-elements .right-4{right:calc(var(--spacing)*4)}.gram-elements .-bottom-10{bottom:calc(var(--spacing)*-10)}.gram-elements .bottom-0{bottom:calc(var(--spacing)*0)}.gram-elements .bottom-2{bottom:calc(var(--spacing)*2)}.gram-elements .bottom-4{bottom:calc(var(--spacing)*4)}.gram-elements .bottom-full{bottom:100%}.gram-elements .-left-10{left:calc(var(--spacing)*-10)}.gram-elements .left-0{left:calc(var(--spacing)*0)}.gram-elements .left-2{left:calc(var(--spacing)*2)}.gram-elements .left-4{left:calc(var(--spacing)*4)}.gram-elements .left-\\[50\\%\\]{left:50%}.gram-elements .z-0{z-index:0}.gram-elements .z-10{z-index:10}.gram-elements .z-20{z-index:20}.gram-elements .z-50{z-index:50}.gram-elements .col-span-full{grid-column:1/-1}.gram-elements .col-start-1{grid-column-start:1}.gram-elements .col-start-2{grid-column-start:2}.gram-elements .col-start-3{grid-column-start:3}.gram-elements .row-start-1{grid-row-start:1}.gram-elements .row-start-2{grid-row-start:2}.gram-elements .row-start-3{grid-row-start:3}.gram-elements .container{width:100%}@media(min-width:40rem){.gram-elements .container{max-width:40rem}}@media(min-width:48rem){.gram-elements .container{max-width:48rem}}@media(min-width:64rem){.gram-elements .container{max-width:64rem}}@media(min-width:80rem){.gram-elements .container{max-width:80rem}}@media(min-width:96rem){.gram-elements .container{max-width:96rem}}.gram-elements .m-0{margin:calc(var(--spacing)*0)}.gram-elements .m-2{margin:calc(var(--spacing)*2)}.gram-elements .m-auto{margin:auto}.gram-elements .mx-1{margin-inline:calc(var(--spacing)*1)}.gram-elements .mx-2{margin-inline:calc(var(--spacing)*2)}.gram-elements .mx-3{margin-inline:calc(var(--spacing)*3)}.gram-elements .mx-4{margin-inline:calc(var(--spacing)*4)}.gram-elements .mx-auto{margin-inline:auto}.gram-elements .my-4{margin-block:calc(var(--spacing)*4)}.gram-elements .my-5{margin-block:calc(var(--spacing)*5)}.gram-elements .my-auto{margin-block:auto}.gram-elements .mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.gram-elements .mt-2{margin-top:calc(var(--spacing)*2)}.gram-elements .mt-4{margin-top:calc(var(--spacing)*4)}.gram-elements .mt-5{margin-top:calc(var(--spacing)*5)}.gram-elements .mt-6{margin-top:calc(var(--spacing)*6)}.gram-elements .mt-8{margin-top:calc(var(--spacing)*8)}.gram-elements .mt-16{margin-top:calc(var(--spacing)*16)}.gram-elements .-mr-1{margin-right:calc(var(--spacing)*-1)}.gram-elements .mr-1{margin-right:calc(var(--spacing)*1)}.gram-elements .mr-2{margin-right:calc(var(--spacing)*2)}.gram-elements .mr-\\[400px\\]{margin-right:400px}.gram-elements .mr-\\[600px\\]{margin-right:600px}.gram-elements .-mb-2{margin-bottom:calc(var(--spacing)*-2)}.gram-elements .mb-1{margin-bottom:calc(var(--spacing)*1)}.gram-elements .mb-2{margin-bottom:calc(var(--spacing)*2)}.gram-elements .mb-3{margin-bottom:calc(var(--spacing)*3)}.gram-elements .mb-4{margin-bottom:calc(var(--spacing)*4)}.gram-elements .mb-5{margin-bottom:calc(var(--spacing)*5)}.gram-elements .mb-8{margin-bottom:calc(var(--spacing)*8)}.gram-elements .-ml-1{margin-left:calc(var(--spacing)*-1)}.gram-elements .-ml-2{margin-left:calc(var(--spacing)*-2)}.gram-elements .ml-2{margin-left:calc(var(--spacing)*2)}.gram-elements .ml-6{margin-left:calc(var(--spacing)*6)}.gram-elements .ml-auto{margin-left:auto}.gram-elements .line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.gram-elements .block{display:block}.gram-elements .flex{display:flex}.gram-elements .grid{display:grid}.gram-elements .hidden{display:none}.gram-elements .inline-block{display:inline-block}.gram-elements .inline-flex{display:inline-flex}.gram-elements .table{display:table}.gram-elements .aspect-square{aspect-ratio:1}.gram-elements .size-2\\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.gram-elements .size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.gram-elements .size-3\\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.gram-elements .size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.gram-elements .size-4\\.5{width:calc(var(--spacing)*4.5);height:calc(var(--spacing)*4.5)}.gram-elements .size-5{width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}.gram-elements .size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.gram-elements .size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.gram-elements .size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.gram-elements .size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.gram-elements .size-12{width:calc(var(--spacing)*12);height:calc(var(--spacing)*12)}.gram-elements .size-14{width:calc(var(--spacing)*14);height:calc(var(--spacing)*14)}.gram-elements .size-\\[34px\\]{width:34px;height:34px}.gram-elements .size-full{width:100%;height:100%}.gram-elements .h-0\\.5{height:calc(var(--spacing)*.5)}.gram-elements .h-3{height:calc(var(--spacing)*3)}.gram-elements .h-4{height:calc(var(--spacing)*4)}.gram-elements .h-8{height:calc(var(--spacing)*8)}.gram-elements .h-9{height:calc(var(--spacing)*9)}.gram-elements .h-10{height:calc(var(--spacing)*10)}.gram-elements .h-10\\/12{height:83.3333%}.gram-elements .h-12{height:calc(var(--spacing)*12)}.gram-elements .h-14{height:calc(var(--spacing)*14)}.gram-elements .h-16{height:calc(var(--spacing)*16)}.gram-elements .h-32{height:calc(var(--spacing)*32)}.gram-elements .h-40{height:calc(var(--spacing)*40)}.gram-elements .h-48{height:calc(var(--spacing)*48)}.gram-elements .h-96{height:calc(var(--spacing)*96)}.gram-elements .h-\\[22px\\]{height:22px}.gram-elements .h-auto{height:auto}.gram-elements .h-full{height:100%}.gram-elements .h-screen{height:100vh}.gram-elements .max-h-32{max-height:calc(var(--spacing)*32)}.gram-elements .max-h-48{max-height:calc(var(--spacing)*48)}.gram-elements .max-h-\\[80dvh\\]{max-height:80dvh}.gram-elements .max-h-\\[80vh\\]{max-height:80vh}.gram-elements .max-h-\\[220px\\]{max-height:220px}.gram-elements .max-h-\\[300px\\]{max-height:300px}.gram-elements .max-h-\\[800px\\]{max-height:800px}.gram-elements .min-h-0{min-height:calc(var(--spacing)*0)}.gram-elements .min-h-8{min-height:calc(var(--spacing)*8)}.gram-elements .min-h-10{min-height:calc(var(--spacing)*10)}.gram-elements .min-h-12{min-height:calc(var(--spacing)*12)}.gram-elements .min-h-16{min-height:calc(var(--spacing)*16)}.gram-elements .min-h-\\[60px\\]{min-height:60px}.gram-elements .min-h-\\[400px\\]{min-height:400px}.gram-elements .w-1\\/2{width:50%}.gram-elements .w-1\\/3{width:33.3333%}.gram-elements .w-3{width:calc(var(--spacing)*3)}.gram-elements .w-4{width:calc(var(--spacing)*4)}.gram-elements .w-12{width:calc(var(--spacing)*12)}.gram-elements .w-16{width:calc(var(--spacing)*16)}.gram-elements .w-32{width:calc(var(--spacing)*32)}.gram-elements .w-40{width:calc(var(--spacing)*40)}.gram-elements .w-56{width:calc(var(--spacing)*56)}.gram-elements .w-64{width:calc(var(--spacing)*64)}.gram-elements .w-72{width:calc(var(--spacing)*72)}.gram-elements .w-80{width:calc(var(--spacing)*80)}.gram-elements .w-\\[400px\\]{width:400px}.gram-elements .w-auto{width:auto}.gram-elements .w-fit{width:fit-content}.gram-elements .w-full{width:100%}.gram-elements .w-min{width:min-content}.gram-elements .max-w-3xl{max-width:var(--container-3xl)}.gram-elements .max-w-7\\/8{max-width:87.5%}.gram-elements .max-w-\\[75\\%\\]{max-width:75%}.gram-elements .max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 2rem)}.gram-elements .max-w-fit{max-width:fit-content}.gram-elements .max-w-full{max-width:100%}.gram-elements .max-w-md{max-width:var(--container-md)}.gram-elements .max-w-xl{max-width:var(--container-xl)}.gram-elements .min-w-0{min-width:calc(var(--spacing)*0)}.gram-elements .min-w-\\[110px\\]{min-width:110px}.gram-elements .min-w-\\[400px\\]{min-width:400px}.gram-elements .flex-1{flex:1}.gram-elements .flex-3{flex:3}.gram-elements .flex-none{flex:none}.gram-elements .flex-shrink-0,.gram-elements .shrink-0{flex-shrink:0}.gram-elements .grow{flex-grow:1}.gram-elements .border-separate{border-collapse:separate}.gram-elements .border-spacing-0{--tw-border-spacing-x:calc(var(--spacing)*0);--tw-border-spacing-y:calc(var(--spacing)*0);border-spacing:var(--tw-border-spacing-x)var(--tw-border-spacing-y)}.gram-elements .origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.gram-elements .origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.gram-elements .-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.gram-elements .translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.gram-elements .-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.gram-elements .translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.gram-elements .translate-y-\\[calc\\(-50\\%-2px\\)\\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.gram-elements .rotate-0{rotate:none}.gram-elements .rotate-45{rotate:45deg}.gram-elements .rotate-90{rotate:90deg}.gram-elements .rotate-180{rotate:180deg}.gram-elements .transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.gram-elements .transform-\\[rotateY\\(180deg\\)\\]{transform:rotateY(180deg)}.gram-elements .transform-gpu{transform:translateZ(0)var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.gram-elements .shimmer{--_gradient-width:calc(var(--_spread) + var(--shimmer-track-height)*tan(var(--shimmer-angle)));--_active-distance:calc(var(--shimmer-track-width,200px) + var(--_gradient-width));--_duration:var(--shimmer-duration,calc(var(--_active-distance)/var(--_speed)/1px*1000));--_repeat-delay:var(--shimmer-repeat-delay,calc(20000/var(--_speed)));--_repeat-delay-px:calc(var(--_repeat-delay)*var(--_active-distance)/var(--_duration));--_xy-offset-px:calc((var(--shimmer-x,0) + var(--shimmer-y,0)*tan(var(--shimmer-angle)))*1px);--_bg-width:calc(100% + var(--shimmer-track-width,100%) + var(--_gradient-width) + var(--_repeat-delay-px));--_position:calc(var(--shimmer-track-width,(100% - var(--_gradient-width) - var(--_repeat-delay-px))/2) + var(--_gradient-width)/2 + var(--_repeat-delay-px) - var(--_xy-offset-px))}.gram-elements .shimmer:not(.shimmer-bg){--_speed:var(--shimmer-speed,200);--_spread:var(--shimmer-spread, calc(4ch + 80px) );--_bg:currentColor;--_fg:var(--shimmer-color,oklch(from currentColor l c h/ calc(alpha/5) ));-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text}.gram-elements .shimmer.shimmer-bg{--_speed:var(--shimmer-speed,1000);--_spread:var(--shimmer-spread,480px);--_bg:transparent;--_fg:var(--shimmer-color,oklch(from currentColor 0 c h/.06))}.gram-elements .shimmer:is(.dark *):not(.shimmer-bg){--_fg:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4) )c h/ calc(alpha + .4) ))}.gram-elements .shimmer:is(.dark *).shimmer-bg{--_fg:var(--shimmer-color,oklch(from currentColor 0 c h/.3))}@-moz-document url-prefix(){.gram-elements .shimmer{--_duration:var(--shimmer-duration,calc(375000/var(--_speed)))}}.gram-elements .shimmer{--_mix-96:var(--_fg)}@supports (color:color-mix(in lab,red,red)){.gram-elements .shimmer{--_mix-96:color-mix(in oklch,var(--_fg),var(--_bg)96%)}}.gram-elements .shimmer{--_mix-83:var(--_fg)}@supports (color:color-mix(in lab,red,red)){.gram-elements .shimmer{--_mix-83:color-mix(in oklch,var(--_fg),var(--_bg)83%)}}.gram-elements .shimmer{--_mix-67:var(--_fg)}@supports (color:color-mix(in lab,red,red)){.gram-elements .shimmer{--_mix-67:color-mix(in oklch,var(--_fg),var(--_bg)67%)}}.gram-elements .shimmer{--_mix-50:var(--_fg)}@supports (color:color-mix(in lab,red,red)){.gram-elements .shimmer{--_mix-50:color-mix(in oklch,var(--_fg),var(--_bg)50%)}}.gram-elements .shimmer{--_mix-33:var(--_fg)}@supports (color:color-mix(in lab,red,red)){.gram-elements .shimmer{--_mix-33:color-mix(in oklch,var(--_fg),var(--_bg)33%)}}.gram-elements .shimmer{--_mix-17:var(--_fg)}@supports (color:color-mix(in lab,red,red)){.gram-elements .shimmer{--_mix-17:color-mix(in oklch,var(--_fg),var(--_bg)17%)}}.gram-elements .shimmer{--_mix-4:var(--_fg)}@supports (color:color-mix(in lab,red,red)){.gram-elements .shimmer{--_mix-4:color-mix(in oklch,var(--_fg),var(--_bg)4%)}}.gram-elements .shimmer{background:linear-gradient(calc(90deg + var(--shimmer-angle)),var(--_bg)calc(var(--_position) - var(--_spread)*.5),var(--_mix-96)calc(var(--_position) - var(--_spread)*.44),var(--_mix-83)calc(var(--_position) - var(--_spread)*.37),var(--_mix-67)calc(var(--_position) - var(--_spread)*.31),var(--_mix-50)calc(var(--_position) - var(--_spread)*.25),var(--_mix-33)calc(var(--_position) - var(--_spread)*.19),var(--_mix-17)calc(var(--_position) - var(--_spread)*.12),var(--_mix-4)calc(var(--_position) - var(--_spread)*.06),var(--_fg)var(--_position),var(--_mix-4)calc(var(--_position) + var(--_spread)*.06),var(--_mix-17)calc(var(--_position) + var(--_spread)*.12),var(--_mix-33)calc(var(--_position) + var(--_spread)*.19),var(--_mix-50)calc(var(--_position) + var(--_spread)*.25),var(--_mix-67)calc(var(--_position) + var(--_spread)*.31),var(--_mix-83)calc(var(--_position) + var(--_spread)*.37),var(--_mix-96)calc(var(--_position) + var(--_spread)*.44),var(--_bg)calc(var(--_position) + var(--_spread)*.5))0 0/var(--_bg-width)100% no-repeat;animation:1s linear infinite backwards tw-shimmer;animation-duration:calc((var(--_duration) + var(--_repeat-delay))*1ms)}.gram-elements .animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.gram-elements .animate-pulse{animation:var(--animate-pulse)}.gram-elements .animate-spin{animation:var(--animate-spin)}.gram-elements .cursor-pointer{cursor:pointer}.gram-elements .resize-none{resize:none}.gram-elements .scroll-m-20{scroll-margin:calc(var(--spacing)*20)}.gram-elements .list-decimal{list-style-type:decimal}.gram-elements .list-disc{list-style-type:disc}.gram-elements .auto-rows-auto{grid-auto-rows:auto}.gram-elements .grid-cols-\\[minmax\\(72px\\,1fr\\)_auto\\]{grid-template-columns:minmax(72px,1fr) auto}.gram-elements .flex-col{flex-direction:column}.gram-elements .flex-col-reverse{flex-direction:column-reverse}.gram-elements .flex-row{flex-direction:row}.gram-elements .flex-wrap{flex-wrap:wrap}.gram-elements .items-center{align-items:center}.gram-elements .items-end{align-items:flex-end}.gram-elements .items-start{align-items:flex-start}.gram-elements .items-stretch{align-items:stretch}.gram-elements .justify-between{justify-content:space-between}.gram-elements .justify-center{justify-content:center}.gram-elements .justify-end{justify-content:flex-end}.gram-elements .justify-start{justify-content:flex-start}.gram-elements .gap-0\\.5{gap:calc(var(--spacing)*.5)}.gram-elements .gap-1{gap:calc(var(--spacing)*1)}.gram-elements .gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gram-elements .gap-2{gap:calc(var(--spacing)*2)}.gram-elements .gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gram-elements .gap-3{gap:calc(var(--spacing)*3)}.gram-elements .gap-4{gap:calc(var(--spacing)*4)}.gram-elements .gap-6{gap:calc(var(--spacing)*6)}:where(.gram-elements .space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.gram-elements .space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.gram-elements .gap-y-2{row-gap:calc(var(--spacing)*2)}.gram-elements .self-center{align-self:center}.gram-elements .self-end{align-self:flex-end}.gram-elements .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.gram-elements .overflow-auto{overflow:auto}.gram-elements .overflow-clip{overflow:clip}.gram-elements .overflow-hidden{overflow:hidden}.gram-elements .overflow-visible{overflow:visible}.gram-elements .overflow-x-auto{overflow-x:auto}.gram-elements .overflow-y-auto{overflow-y:auto}.gram-elements .overflow-y-scroll{overflow-y:scroll}.gram-elements .overscroll-contain{overscroll-behavior:contain}.gram-elements .rounded{border-radius:.25rem}.gram-elements .rounded-2xl{border-radius:var(--radius-2xl)}.gram-elements .rounded-3xl{border-radius:var(--radius-3xl)}.gram-elements .rounded-\\[2px\\]{border-radius:2px}.gram-elements .rounded-\\[14px\\]{border-radius:14px}.gram-elements .rounded-full{border-radius:3.40282e38px}.gram-elements .rounded-lg{border-radius:var(--radius)}.gram-elements .rounded-md{border-radius:calc(var(--radius) - 2px)}.gram-elements .rounded-none{border-radius:0}.gram-elements .rounded-sm{border-radius:calc(var(--radius) - 4px)}.gram-elements .rounded-xl{border-radius:calc(var(--radius) + 4px)}.gram-elements .rounded-xs{border-radius:var(--radius-xs)}.gram-elements .rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.gram-elements .rounded-t-none\\!{border-top-left-radius:0!important;border-top-right-radius:0!important}.gram-elements .rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.gram-elements .rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.gram-elements .rounded-b-lg{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.gram-elements .rounded-br-none\\!{border-bottom-right-radius:0!important}.gram-elements .rounded-bl-none\\!{border-bottom-left-radius:0!important}.gram-elements .border{border-style:var(--tw-border-style);border-width:1px}.gram-elements .border-0{border-style:var(--tw-border-style);border-width:0}.gram-elements .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.gram-elements .border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.gram-elements .border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.gram-elements .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.gram-elements .border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.gram-elements .border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.gram-elements .border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.gram-elements .border-dashed{--tw-border-style:dashed;border-style:dashed}.gram-elements .border-amber-500{border-color:var(--color-amber-500)}.gram-elements .border-border{border-color:var(--border)}.gram-elements .border-destructive{border-color:var(--destructive)}.gram-elements .border-emerald-700{border-color:var(--color-emerald-700)}.gram-elements .border-foreground\\/20{border-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .border-foreground\\/20{border-color:color-mix(in oklab,var(--foreground)20%,transparent)}}.gram-elements .border-input{border-color:var(--input)}.gram-elements .border-muted-foreground\\/50{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .border-muted-foreground\\/50{border-color:color-mix(in oklab,var(--muted-foreground)50%,transparent)}}.gram-elements .border-muted-foreground\\/60{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .border-muted-foreground\\/60{border-color:color-mix(in oklab,var(--muted-foreground)60%,transparent)}}.gram-elements .border-ring{border-color:var(--ring)}.gram-elements .bg-accent{background-color:var(--accent)}.gram-elements .bg-amber-100{background-color:var(--color-amber-100)}.gram-elements .bg-background,.gram-elements .bg-background\\/80{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-background\\/80{background-color:color-mix(in oklab,var(--background)80%,transparent)}}.gram-elements .bg-black{background-color:var(--color-black)}.gram-elements .bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.gram-elements .bg-blue-500{background-color:var(--color-blue-500)}.gram-elements .bg-card{background-color:var(--card)}.gram-elements .bg-destructive,.gram-elements .bg-destructive\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-destructive\\/10{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.gram-elements .bg-emerald-600{background-color:var(--color-emerald-600)}.gram-elements .bg-foreground{background-color:var(--foreground)}.gram-elements .bg-green-500{background-color:var(--color-green-500)}.gram-elements .bg-muted{background-color:var(--muted)}.gram-elements .bg-muted-foreground\\/15{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-muted-foreground\\/15{background-color:color-mix(in oklab,var(--muted-foreground)15%,transparent)}}.gram-elements .bg-muted\\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-muted\\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.gram-elements .bg-popover{background-color:var(--popover)}.gram-elements .bg-primary,.gram-elements .bg-primary\\/10{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-primary\\/10{background-color:color-mix(in oklab,var(--primary)10%,transparent)}}.gram-elements .bg-red-300{background-color:var(--color-red-300)}.gram-elements .bg-red-500{background-color:var(--color-red-500)}.gram-elements .bg-secondary{background-color:var(--secondary)}.gram-elements .bg-slate-800\\/90{background-color:#1d293de6}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-slate-800\\/90{background-color:color-mix(in oklab,var(--color-slate-800)90%,transparent)}}.gram-elements .bg-transparent{background-color:#0000}.gram-elements .bg-white{background-color:var(--color-white)}.gram-elements .bg-white\\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-white\\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.gram-elements .bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.gram-elements .bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.gram-elements .bg-yellow-500{background-color:var(--color-yellow-500)}.gram-elements .bg-linear-to-r{--tw-gradient-position:to right}@supports (background-image:linear-gradient(in lab,red,red)){.gram-elements .bg-linear-to-r{--tw-gradient-position:to right in oklab}}.gram-elements .bg-linear-to-r{background-image:linear-gradient(var(--tw-gradient-stops))}.gram-elements .bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.gram-elements .bg-\\[linear-gradient\\(to_top\\,var\\(--color-background\\)\\,transparent\\)\\]{background-image:linear-gradient(to top,var(--color-background),transparent)}.gram-elements .from-indigo-600{--tw-gradient-from:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.gram-elements .from-slate-800{--tw-gradient-from:var(--color-slate-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.gram-elements .from-violet-600{--tw-gradient-from:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.gram-elements .from-yellow-400{--tw-gradient-from:var(--color-yellow-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.gram-elements .via-purple-600{--tw-gradient-via:var(--color-purple-600);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.gram-elements .via-slate-700{--tw-gradient-via:var(--color-slate-700);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.gram-elements .to-indigo-800{--tw-gradient-to:var(--color-indigo-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.gram-elements .to-orange-500{--tw-gradient-to:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.gram-elements .to-pink-500{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.gram-elements .to-slate-900{--tw-gradient-to:var(--color-slate-900);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.gram-elements .fill-foreground{fill:var(--foreground)}.gram-elements .fill-white{fill:var(--color-white)}.gram-elements .stroke-\\[1\\.5px\\]{stroke-width:1.5px}.gram-elements .object-contain{object-fit:contain}.gram-elements .object-cover{object-fit:cover}.gram-elements .p-0{padding:calc(var(--spacing)*0)}.gram-elements .p-1{padding:calc(var(--spacing)*1)}.gram-elements .p-1\\.5{padding:calc(var(--spacing)*1.5)}.gram-elements .p-2{padding:calc(var(--spacing)*2)}.gram-elements .p-2\\.5{padding:calc(var(--spacing)*2.5)}.gram-elements .p-3{padding:calc(var(--spacing)*3)}.gram-elements .p-4{padding:calc(var(--spacing)*4)}.gram-elements .p-5{padding:calc(var(--spacing)*5)}.gram-elements .p-6{padding:calc(var(--spacing)*6)}.gram-elements .p-10{padding:calc(var(--spacing)*10)}.gram-elements .px-1{padding-inline:calc(var(--spacing)*1)}.gram-elements .px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.gram-elements .px-2{padding-inline:calc(var(--spacing)*2)}.gram-elements .px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.gram-elements .px-3{padding-inline:calc(var(--spacing)*3)}.gram-elements .px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.gram-elements .px-4{padding-inline:calc(var(--spacing)*4)}.gram-elements .px-5{padding-inline:calc(var(--spacing)*5)}.gram-elements .px-6{padding-inline:calc(var(--spacing)*6)}.gram-elements .px-10{padding-inline:calc(var(--spacing)*10)}.gram-elements .py-1{padding-block:calc(var(--spacing)*1)}.gram-elements .py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.gram-elements .py-2{padding-block:calc(var(--spacing)*2)}.gram-elements .py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.gram-elements .py-3{padding-block:calc(var(--spacing)*3)}.gram-elements .py-4{padding-block:calc(var(--spacing)*4)}.gram-elements .py-6{padding-block:calc(var(--spacing)*6)}.gram-elements .py-10{padding-block:calc(var(--spacing)*10)}.gram-elements .pt-0\\.5{padding-top:calc(var(--spacing)*.5)}.gram-elements .pt-1\\.5{padding-top:calc(var(--spacing)*1.5)}.gram-elements .pt-2{padding-top:calc(var(--spacing)*2)}.gram-elements .pt-4{padding-top:calc(var(--spacing)*4)}.gram-elements .pr-2{padding-right:calc(var(--spacing)*2)}.gram-elements .pb-0\\!{padding-bottom:calc(var(--spacing)*0)!important}.gram-elements .pb-1{padding-bottom:calc(var(--spacing)*1)}.gram-elements .pb-2{padding-bottom:calc(var(--spacing)*2)}.gram-elements .pb-3{padding-bottom:calc(var(--spacing)*3)}.gram-elements .pl-6{padding-left:calc(var(--spacing)*6)}.gram-elements .text-center{text-align:center}.gram-elements .text-left{text-align:left}.gram-elements .text-right{text-align:right}.gram-elements .text-start{text-align:start}.gram-elements .font-mono{font-family:var(--font-mono)}.gram-elements .text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.gram-elements .text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.gram-elements .text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.gram-elements .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.gram-elements .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.gram-elements .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.gram-elements .text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.gram-elements .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.gram-elements .leading-7{--tw-leading:calc(var(--spacing)*7);line-height:calc(var(--spacing)*7)}.gram-elements .leading-none{--tw-leading:1;line-height:1}.gram-elements .leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.gram-elements .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.gram-elements .font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.gram-elements .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.gram-elements .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.gram-elements .tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.gram-elements .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.gram-elements .text-balance{text-wrap:balance}.gram-elements .wrap-break-word{overflow-wrap:break-word}.gram-elements .whitespace-break-spaces{white-space:break-spaces}.gram-elements .whitespace-nowrap{white-space:nowrap}.gram-elements .whitespace-pre-wrap{white-space:pre-wrap}.gram-elements .text-accent-foreground{color:var(--accent-foreground)}.gram-elements .text-amber-500{color:var(--color-amber-500)}.gram-elements .text-amber-700{color:var(--color-amber-700)}.gram-elements .text-amber-800{color:var(--color-amber-800)}.gram-elements .text-background{color:var(--background)}.gram-elements .text-destructive{color:var(--destructive)}.gram-elements .text-emerald-500{color:var(--color-emerald-500)}.gram-elements .text-foreground{color:var(--foreground)}.gram-elements .text-green-600{color:var(--color-green-600)}.gram-elements .text-muted-foreground,.gram-elements .text-muted-foreground\\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .text-muted-foreground\\/60{color:color-mix(in oklab,var(--muted-foreground)60%,transparent)}}.gram-elements .text-muted-foreground\\/65{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .text-muted-foreground\\/65{color:color-mix(in oklab,var(--muted-foreground)65%,transparent)}}.gram-elements .text-popover-foreground{color:var(--popover-foreground)}.gram-elements .text-primary{color:var(--primary)}.gram-elements .text-primary-foreground{color:var(--primary-foreground)}.gram-elements .text-red-500{color:var(--color-red-500)}.gram-elements .text-red-900{color:var(--color-red-900)}.gram-elements .text-rose-500{color:var(--color-rose-500)}.gram-elements .text-secondary-foreground{color:var(--secondary-foreground)}.gram-elements .text-slate-100{color:var(--color-slate-100)}.gram-elements .text-white{color:var(--color-white)}.gram-elements .capitalize{text-transform:capitalize}.gram-elements .lowercase{text-transform:lowercase}.gram-elements .italic{font-style:italic}.gram-elements .ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.gram-elements .underline{text-decoration-line:underline}.gram-elements .underline-offset-4{text-underline-offset:4px}.gram-elements .opacity-10{opacity:.1}.gram-elements .opacity-50{opacity:.5}.gram-elements .opacity-60{opacity:.6}.gram-elements .opacity-70{opacity:.7}.gram-elements .opacity-100{opacity:1}.gram-elements .shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .ring-offset-background{--tw-ring-offset-color:var(--background)}.gram-elements .outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.gram-elements .outline-hidden{outline-offset:2px;outline:2px solid #0000}}.gram-elements .outline{outline-style:var(--tw-outline-style);outline-width:1px}.gram-elements .filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.gram-elements .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.gram-elements .transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.gram-elements .transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.gram-elements .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.gram-elements .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.gram-elements .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.gram-elements .transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.gram-elements .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.gram-elements .duration-\\(--animation-duration\\){--tw-duration:var(--animation-duration);transition-duration:var(--animation-duration)}.gram-elements .duration-150{--tw-duration:.15s;transition-duration:.15s}.gram-elements .duration-200{--tw-duration:.2s;transition-duration:.2s}.gram-elements .duration-700{--tw-duration:.7s;transition-duration:.7s}.gram-elements .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.gram-elements .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.gram-elements .fade-in-0{--tw-enter-opacity:0}.gram-elements .outline-none{--tw-outline-style:none;outline-style:none}.gram-elements .zoom-in-95{--tw-enter-scale:.95}.gram-elements .\\[transform-style\\:preserve-3d\\]{transform-style:preserve-3d}.gram-elements .backface-hidden{backface-visibility:hidden}.gram-elements .fade-in{--tw-enter-opacity:0}.gram-elements .perspective-\\[1000px\\]{perspective:1000px}.gram-elements .running{animation-play-state:running}.gram-elements .slide-in-from-bottom-1{--tw-enter-translate-y:calc(1*var(--spacing))}.gram-elements .group-data-\\[state\\=closed\\]\\/collapsible-content\\:animate-out:is(:where(.group\\/collapsible-content)[data-state=closed] *){animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.gram-elements .group-data-\\[state\\=closed\\]\\/collapsible-content\\:duration-\\(--animation-duration\\):is(:where(.group\\/collapsible-content)[data-state=closed] *){--tw-duration:var(--animation-duration);transition-duration:var(--animation-duration)}.gram-elements .group-data-\\[state\\=closed\\]\\/collapsible-content\\:fade-out-0:is(:where(.group\\/collapsible-content)[data-state=closed] *){--tw-exit-opacity:0}.gram-elements .group-data-\\[state\\=closed\\]\\/collapsible-content\\:slide-out-to-top-4:is(:where(.group\\/collapsible-content)[data-state=closed] *){--tw-exit-translate-y:calc(4*var(--spacing)*-1)}.gram-elements .group-data-\\[state\\=closed\\]\\/trigger\\:-rotate-90:is(:where(.group\\/trigger)[data-state=closed] *){rotate:-90deg}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:animate-in:is(:where(.group\\/collapsible-content)[data-state=open] *){animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:animate-out:is(:where(.group\\/collapsible-content)[data-state=open] *){animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:delay-\\[calc\\(var\\(--animation-duration\\)\\*0\\.75\\)\\]:is(:where(.group\\/collapsible-content)[data-state=open] *){transition-delay:calc(var(--animation-duration)*.75)}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:duration-\\(--animation-duration\\):is(:where(.group\\/collapsible-content)[data-state=open] *){--tw-duration:var(--animation-duration);transition-duration:var(--animation-duration)}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:delay-\\[calc\\(var\\(--animation-duration\\)\\*0\\.75\\)\\]:is(:where(.group\\/collapsible-content)[data-state=open] *){animation-delay:calc(var(--animation-duration)*.75);--tw-animation-delay:calc(var(--animation-duration)*.75)}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:fade-in-0:is(:where(.group\\/collapsible-content)[data-state=open] *){--tw-enter-opacity:0}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:fade-out-0:is(:where(.group\\/collapsible-content)[data-state=open] *){--tw-exit-opacity:0}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:fill-mode-forwards:is(:where(.group\\/collapsible-content)[data-state=open] *){--tw-animation-fill-mode:forwards;animation-fill-mode:forwards}.gram-elements .group-data-\\[state\\=open\\]\\/collapsible-content\\:slide-in-from-top-4:is(:where(.group\\/collapsible-content)[data-state=open] *){--tw-enter-translate-y:calc(4*var(--spacing)*-1)}.gram-elements .group-data-\\[state\\=open\\]\\/trigger\\:rotate-0:is(:where(.group\\/trigger)[data-state=open] *){rotate:none}.gram-elements .placeholder\\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.gram-elements .after\\:hidden:after{content:var(--tw-content);display:none}.gram-elements .first\\:mt-0:first-child{margin-top:calc(var(--spacing)*0)}.gram-elements .first\\:mt-3:first-child{margin-top:calc(var(--spacing)*3)}.gram-elements .first\\:mt-4:first-child{margin-top:calc(var(--spacing)*4)}.gram-elements .first\\:rounded-tl-lg:first-child{border-top-left-radius:var(--radius)}.gram-elements .first\\:border-t:first-child{border-top-style:var(--tw-border-style);border-top-width:1px}.gram-elements .last\\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}.gram-elements .last\\:mb-5:last-child{margin-bottom:calc(var(--spacing)*5)}.gram-elements .last\\:mb-24:last-child{margin-bottom:calc(var(--spacing)*24)}.gram-elements .last\\:rounded-tr-lg:last-child{border-top-right-radius:var(--radius)}.gram-elements .last\\:border-r:last-child{border-right-style:var(--tw-border-style);border-right-width:1px}.gram-elements .empty\\:hidden:empty{display:none}@media(hover:hover){.gram-elements .hover\\:\\!bg-white:hover{background-color:var(--color-white)!important}.gram-elements .hover\\:bg-accent:hover,.gram-elements .hover\\:bg-accent\\/50:hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.gram-elements .hover\\:bg-accent\\/50:hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.gram-elements .hover\\:bg-destructive\\/10:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .hover\\:bg-destructive\\/10:hover{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.gram-elements .hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.gram-elements .hover\\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.gram-elements .hover\\:bg-muted:hover{background-color:var(--muted)}.gram-elements .hover\\:bg-muted-foreground\\/10:hover{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .hover\\:bg-muted-foreground\\/10:hover{background-color:color-mix(in oklab,var(--muted-foreground)10%,transparent)}}.gram-elements .hover\\:bg-muted-foreground\\/15:hover{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .hover\\:bg-muted-foreground\\/15:hover{background-color:color-mix(in oklab,var(--muted-foreground)15%,transparent)}}.gram-elements .hover\\:bg-primary\\/75:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.gram-elements .hover\\:bg-primary\\/75:hover{background-color:color-mix(in oklab,var(--primary)75%,transparent)}}.gram-elements .hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.gram-elements .hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.gram-elements .hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.gram-elements .hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.gram-elements .hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}.gram-elements .hover\\:text-amber-800:hover{color:var(--color-amber-800)}.gram-elements .hover\\:text-foreground:hover{color:var(--foreground)}.gram-elements .hover\\:underline:hover{text-decoration-line:underline}.gram-elements .hover\\:opacity-70:hover{opacity:.7}.gram-elements .hover\\:opacity-75:hover{opacity:.75}.gram-elements .hover\\:opacity-100:hover{opacity:1}.gram-elements .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.gram-elements .focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .focus\\:ring-ring:focus{--tw-ring-color:var(--ring)}.gram-elements .focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.gram-elements .focus\\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.gram-elements .focus\\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.gram-elements .focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.gram-elements .focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.gram-elements .focus-visible\\:bg-muted:focus-visible{background-color:var(--muted)}.gram-elements .focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.gram-elements .focus-visible\\:ring-ring:focus-visible,.gram-elements .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.gram-elements .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.gram-elements .focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.gram-elements .disabled\\:pointer-events-none:disabled{pointer-events:none}.gram-elements .disabled\\:invisible:disabled{visibility:hidden}.gram-elements .disabled\\:opacity-50:disabled{opacity:.5}.gram-elements .has-\\[textarea\\:focus-visible\\]\\:border-ring:has(:is(textarea:focus-visible)){border-color:var(--ring)}.gram-elements .has-\\[textarea\\:focus-visible\\]\\:ring-1:has(:is(textarea:focus-visible)){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .has-\\[textarea\\:focus-visible\\]\\:ring-ring\\/5:has(:is(textarea:focus-visible)){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.gram-elements .has-\\[textarea\\:focus-visible\\]\\:ring-ring\\/5:has(:is(textarea:focus-visible)){--tw-ring-color:color-mix(in oklab,var(--ring)5%,transparent)}}.gram-elements .has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.gram-elements .has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.gram-elements .has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.gram-elements .aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.gram-elements .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.gram-elements .data-floating\\:absolute[data-floating]{position:absolute}.gram-elements .data-floating\\:rounded-md[data-floating]{border-radius:calc(var(--radius) - 2px)}.gram-elements .data-floating\\:border[data-floating]{border-style:var(--tw-border-style);border-width:1px}.gram-elements .data-floating\\:bg-background[data-floating]{background-color:var(--background)}.gram-elements .data-floating\\:p-1[data-floating]{padding:calc(var(--spacing)*1)}.gram-elements .data-floating\\:shadow-sm[data-floating]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.gram-elements .data-\\[active\\=true\\]\\:bg-muted-foreground\\/20[data-active=true]{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .data-\\[active\\=true\\]\\:bg-muted-foreground\\/20[data-active=true]{background-color:color-mix(in oklab,var(--muted-foreground)20%,transparent)}}.gram-elements .data-\\[active\\=true\\]\\:bg-muted-foreground\\/20\\![data-active=true]{background-color:var(--muted-foreground)!important}@supports (color:color-mix(in lab,red,red)){.gram-elements .data-\\[active\\=true\\]\\:bg-muted-foreground\\/20\\![data-active=true]{background-color:color-mix(in oklab,var(--muted-foreground)20%,transparent)!important}}.gram-elements .data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.gram-elements .data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.gram-elements .data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.gram-elements .data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.gram-elements .data-\\[state\\=closed\\]\\:pointer-events-none[data-state=closed]{pointer-events:none}.gram-elements .data-\\[state\\=closed\\]\\:scale-100[data-state=closed]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.gram-elements .data-\\[state\\=closed\\]\\:rotate-0[data-state=closed]{rotate:none}.gram-elements .data-\\[state\\=closed\\]\\:animate-collapsible-up[data-state=closed]{animation:collapsible-up var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.gram-elements .data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.gram-elements .data-\\[state\\=closed\\]\\:duration-\\(--animation-duration\\)[data-state=closed]{--tw-duration:var(--animation-duration);transition-duration:var(--animation-duration)}.gram-elements .data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.gram-elements .data-\\[state\\=closed\\]\\:fill-mode-forwards[data-state=closed]{--tw-animation-fill-mode:forwards;animation-fill-mode:forwards}.gram-elements .data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.gram-elements .data-\\[state\\=open\\]\\:scale-0[data-state=open]{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x)var(--tw-scale-y)}.gram-elements .data-\\[state\\=open\\]\\:rotate-90[data-state=open]{rotate:90deg}.gram-elements .data-\\[state\\=open\\]\\:animate-collapsible-down[data-state=open]{animation:collapsible-down var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.gram-elements .data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.gram-elements .data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:var(--accent)}.gram-elements .data-\\[state\\=open\\]\\:bg-muted-foreground\\/15[data-state=open]{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .data-\\[state\\=open\\]\\:bg-muted-foreground\\/15[data-state=open]{background-color:color-mix(in oklab,var(--muted-foreground)15%,transparent)}}.gram-elements .data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.gram-elements .data-\\[state\\=open\\]\\:duration-\\(--animation-duration\\)[data-state=open]{--tw-duration:var(--animation-duration);transition-duration:var(--animation-duration)}.gram-elements .data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.gram-elements .data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.gram-elements .nth-\\[n\\+3\\]\\:hidden:nth-child(n+3){display:none}@media(prefers-reduced-motion:reduce){.gram-elements .motion-reduce\\:animate-none{animation:none}}@media(min-width:40rem){.gram-elements .sm\\:w-3\\/4{width:75%}.gram-elements .sm\\:max-w-3xl{max-width:var(--container-3xl)}.gram-elements .sm\\:max-w-lg{max-width:var(--container-lg)}.gram-elements .sm\\:flex-row{flex-direction:row}.gram-elements .sm\\:justify-end{justify-content:flex-end}.gram-elements .sm\\:text-left{text-align:left}}@container (min-width:28rem){.gram-elements .\\@md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.gram-elements .\\@md\\:nth-\\[n\\+3\\]\\:block:nth-child(n+3){display:block}}.gram-elements .dark\\:border-amber-600:is(.dark *){border-color:var(--color-amber-600)}.gram-elements .dark\\:border-input:is(.dark *){border-color:var(--input)}.gram-elements .dark\\:border-muted-foreground\\/15:is(.dark *){border-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:border-muted-foreground\\/15:is(.dark *){border-color:color-mix(in oklab,var(--muted-foreground)15%,transparent)}}.gram-elements .dark\\:border-muted-foreground\\/90:is(.dark *){border-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:border-muted-foreground\\/90:is(.dark *){border-color:color-mix(in oklab,var(--muted-foreground)90%,transparent)}}.gram-elements .dark\\:bg-amber-900\\/30:is(.dark *){background-color:#7b33064d}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:bg-amber-900\\/30:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-900)30%,transparent)}}.gram-elements .dark\\:bg-background:is(.dark *){background-color:var(--background)}.gram-elements .dark\\:bg-destructive\\/5:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:bg-destructive\\/5:is(.dark *){background-color:color-mix(in oklab,var(--destructive)5%,transparent)}}.gram-elements .dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.gram-elements .dark\\:bg-input\\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.gram-elements .dark\\:bg-muted-foreground\\/20:is(.dark *){background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:bg-muted-foreground\\/20:is(.dark *){background-color:color-mix(in oklab,var(--muted-foreground)20%,transparent)}}.gram-elements .dark\\:fill-black:is(.dark *){fill:var(--color-black)}.gram-elements .dark\\:stroke-\\[2\\.5px\\]:is(.dark *){stroke-width:2.5px}.gram-elements .dark\\:text-amber-200:is(.dark *){color:var(--color-amber-200)}.gram-elements .dark\\:text-amber-300:is(.dark *){color:var(--color-amber-300)}.gram-elements .dark\\:text-green-500:is(.dark *){color:var(--color-green-500)}.gram-elements .dark\\:text-red-200:is(.dark *){color:var(--color-red-200)}@media(hover:hover){.gram-elements .dark\\:hover\\:bg-accent:is(.dark *):hover,.gram-elements .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.gram-elements .dark\\:hover\\:bg-accent\\/60:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:hover\\:bg-accent\\/60:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)60%,transparent)}}.gram-elements .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}.gram-elements .dark\\:hover\\:bg-muted-foreground\\/30:is(.dark *):hover{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:hover\\:bg-muted-foreground\\/30:is(.dark *):hover{background-color:color-mix(in oklab,var(--muted-foreground)30%,transparent)}}.gram-elements .dark\\:hover\\:text-amber-200:is(.dark *):hover{color:var(--color-amber-200)}}.gram-elements .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.gram-elements .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.gram-elements .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.gram-elements .\\[\\&_p\\]\\:-mb-2 p{margin-bottom:calc(var(--spacing)*-2)}.gram-elements .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.gram-elements .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.gram-elements .\\[\\&_svg\\]\\:text-background svg{color:var(--background)}.gram-elements .\\[\\&_svg\\]\\:text-black svg{color:var(--color-black)}@media(hover:hover){.gram-elements .hover\\:\\[\\&_svg\\]\\:text-destructive:hover svg{color:var(--destructive)}}.gram-elements .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.gram-elements .\\[\\[align\\=center\\]\\]\\:text-center[align=center]{text-align:center}.gram-elements .\\[\\[align\\=right\\]\\]\\:text-right[align=right]{text-align:right}.gram-elements .\\[\\&\\:last-child\\>td\\:first-child\\]\\:rounded-bl-lg:last-child>td:first-child{border-bottom-left-radius:var(--radius)}.gram-elements .\\[\\&\\:last-child\\>td\\:last-child\\]\\:rounded-br-lg:last-child>td:last-child{border-bottom-right-radius:var(--radius)}.gram-elements .only\\:\\[\\&\\>\\#attachment-tile\\]\\:size-24:only-child>#attachment-tile{width:calc(var(--spacing)*24);height:calc(var(--spacing)*24)}.gram-elements .\\[\\&\\>\\.aui-thread-root\\]\\:bg-inherit>.aui-thread-root{background-color:inherit}.gram-elements .\\[\\&\\>a\\]\\:text-xs>a{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.gram-elements .\\[\\&\\>a\\]\\:no-underline>a{text-decoration-line:none}.gram-elements .\\[\\&\\>button\\]\\:rounded-full>button{border-radius:3.40282e38px}.gram-elements .\\[\\&\\>button\\]\\:bg-foreground\\/60>button{background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.gram-elements .\\[\\&\\>button\\]\\:bg-foreground\\/60>button{background-color:color-mix(in oklab,var(--foreground)60%,transparent)}}.gram-elements .\\[\\&\\>button\\]\\:p-1>button{padding:calc(var(--spacing)*1)}.gram-elements .\\[\\&\\>button\\]\\:opacity-100>button{opacity:1}.gram-elements .\\[\\&\\>button\\]\\:\\!ring-0>button{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}@media(hover:hover){.gram-elements .\\[\\&\\>button\\]\\:hover\\:\\[\\&_svg\\]\\:text-destructive>button:hover svg{color:var(--destructive)}}.gram-elements .\\[\\&\\>li\\]\\:mt-2>li{margin-top:calc(var(--spacing)*2)}.gram-elements .\\[\\&\\>span\\]\\:text-xs>span{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.gram-elements *,.gram-elements :before,.gram-elements :after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.gram-elements *,.gram-elements :before,.gram-elements :after{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}.gram-elements h1,.gram-elements h2,.gram-elements h3,.gram-elements h4,.gram-elements h5,.gram-elements h6,.gram-elements p,.gram-elements blockquote,.gram-elements pre,.gram-elements ul,.gram-elements ol,.gram-elements figure{margin:0;padding:0}.gram-elements ul,.gram-elements ol{list-style:none}.gram-elements img,.gram-elements svg,.gram-elements video,.gram-elements canvas,.gram-elements audio,.gram-elements iframe,.gram-elements embed,.gram-elements object{display:block}.gram-elements img,.gram-elements video{max-width:100%;height:auto}.gram-elements button,.gram-elements input,.gram-elements optgroup,.gram-elements select,.gram-elements textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}.gram-elements button,.gram-elements select{text-transform:none}.gram-elements button,.gram-elements input:where([type=button]),.gram-elements input:where([type=reset]),.gram-elements input:where([type=submit]){appearance:button;background-color:#0000;background-image:none}.gram-elements a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}.gram-elements table{text-indent:0;border-color:inherit;border-collapse:collapse}}@layer components,utilities;.gram-elements{font-feature-settings:normal;font-variation-settings:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;tab-size:4;--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.1% .005 285.823);--card:oklch(100% 0 0);--card-foreground:oklch(14.1% .005 285.823);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.1% .005 285.823);--primary:oklch(21% .006 285.885);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(96.7% .001 286.375);--secondary-foreground:oklch(21% .006 285.885);--muted:oklch(96.7% .001 286.375);--muted-foreground:oklch(55.2% .016 285.938);--accent:oklch(96.7% .001 286.375);--accent-foreground:oklch(21% .006 285.885);--destructive:oklch(57.7% .245 27.325);--border:oklch(92% .004 286.32);--input:oklch(92% .004 286.32);--ring:oklch(70.5% .015 286.067);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.1% .005 285.823);--sidebar-primary:oklch(21% .006 285.885);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(96.7% .001 286.375);--sidebar-accent-foreground:oklch(21% .006 285.885);--sidebar-border:oklch(92% .004 286.32);--sidebar-ring:oklch(70.5% .015 286.067);font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}.gram-elements.dark,.dark .gram-elements{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92% .004 286.32);--primary-foreground:oklch(21% .006 285.885);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(27.4% .006 286.033);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(21% .006 285.885);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(27.4% .006 286.033);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.2% .016 285.938)}.gram-elements[data-radius=sharp],[data-radius=sharp] .gram-elements{--radius:.25rem}.gram-elements[data-radius=soft],[data-radius=soft] .gram-elements{--radius:.625rem}.gram-elements[data-radius=round],[data-radius=round] .gram-elements{--radius:1rem}.gram-elements[data-radius=pill],[data-radius=pill] .gram-elements{--radius:9999px}@keyframes aui-pulse{50%{opacity:.5}}.gram-elements :where(.aui-md[data-status=running]):empty:after,.gram-elements :where(.aui-md[data-status=running])>:where(:not(ol):not(ul):not(pre)):last-child:after,.gram-elements :where(.aui-md[data-status=running])>pre:last-child code:after,.gram-elements :where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child:not(:has(*>li))):after,.gram-elements :where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child:not(:has(*>li))):after,.gram-elements :where(.aui-md[data-status=running])>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child)>:where(:is(ol,ul):last-child)>:where(li:last-child):after{--aui-content:"●";content:var(--aui-content);margin-left:.25rem;margin-right:.25rem;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;animation:2s cubic-bezier(.4,0,.6,1) infinite aui-pulse}@property --tw-border-spacing-x{syntax:"<length>";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"<length>";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes collapsible-down{0%{height:0}to{height:var(--radix-collapsible-content-height,var(--bits-collapsible-content-height,var(--reka-collapsible-content-height,var(--kb-collapsible-content-height,auto))))}}@keyframes collapsible-up{0%{height:var(--radix-collapsible-content-height,var(--bits-collapsible-content-height,var(--reka-collapsible-content-height,var(--kb-collapsible-content-height,auto))))}to{height:0}}@keyframes tw-shimmer{0%{background-position:100% 0}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}`,H1=({children:e,hostClassName:t,hostStyle:r})=>{const o=N.useRef(null),n=N.useRef(null),[i,a]=N.useState(null),{config:s}=$.useElements(),c=dl(),l=N.useMemo(()=>$.cn(vd,c.className),[c.className]);return N.useEffect(()=>{const u=o.current;if(!u)return;const d=u.shadowRoot??u.attachShadow({mode:"open"});a(d)},[]),N.useEffect(()=>{if(!i)return;const u=i.querySelector("style[data-gram-elements]");if(u){u.textContent=gu;return}const d=document.createElement("style");d.setAttribute("data-gram-elements","true"),d.textContent=gu,i.prepend(d)},[i,gu]),p.jsx("div",{ref:o,className:t,style:r,children:i?hd.createPortal(p.jsx("div",{ref:n,className:l,"data-radius":s.theme?.radius,style:{height:"100%",width:"100%"},children:p.jsx(CW,{containerRef:n,children:e})}),i):null})};function vu({children:e}){return p.jsx(H1,{hostStyle:{height:"inherit",width:"inherit"},children:e})}const NW=({className:e})=>{const{config:t}=$.useElements();switch(t.variant){case"standalone":return p.jsx(op,{children:p.jsx(vu,{children:p.jsx(Op,{})})});case"sidecar":return p.jsx(vu,{children:p.jsx(AW,{})});default:return p.jsx(vu,{children:p.jsx($W,{className:e})})}},RW=({className:e})=>p.jsx(H1,{hostStyle:{height:"inherit",width:"inherit"},children:p.jsx(Ap,{className:e})});function PW({onShare:e,buildShareUrl:t,variant:r="ghost",size:o="sm",className:n,children:i}){const{threadId:a}=YT(),s=N.useCallback(async()=>{if(!a){e?.({error:new Error("No chat to share yet. Send a message first.")});return}try{const c=t?t(a):(()=>{const l=new URL(window.location.href);return l.searchParams.set("threadId",a),l.toString()})();await navigator.clipboard.writeText(c),e?.({url:c})}catch(c){e?.({error:c instanceof Error?c:new Error("Failed to copy link")})}},[a,t,e]);return p.jsxs(ol,{children:[p.jsx(il,{asChild:!0,children:p.jsx(pt,{variant:r,size:o,onClick:s,disabled:!a,className:$.cn("aui-share-button",n),"aria-label":"Share chat",children:i??p.jsxs(p.Fragment,{children:[p.jsx(JL,{className:"mr-2 size-4"}),"Share chat"]})})}),p.jsx(al,{children:a?"Copy chat link to clipboard":"Send a message first to share"})]})}exports.ActionType=Lc;exports.CENSORED_IMG_MARK=l4;exports.CENSORED_STRING_MARK=Ua;exports.Chat=NW;exports.ChatHistory=RW;exports.ElementsProvider=HB;exports.MODELS=Um;exports.NodePrivacyLevel=ae;exports.ONE_SECOND=Ke;exports.PRIVACY_ATTR_NAME=Dm;exports.PRIVACY_ATTR_VALUE_HIDDEN=s4;exports.RumEventType=te;exports.ShareButton=PW;exports.addEventListener=Oe;exports.addEventListeners=gr;exports.addRecord=Q6;exports.addSegment=X6;exports.addTelemetryDebug=_o;exports.addTelemetryMetrics=ea;exports.addWroteData=eL;exports.buildTags=Em;exports.buildUrl=Ki;exports.canUseEventBridge=sn;exports.clearTimeout=yt;exports.clocksNow=Ue;exports.clocksOrigin=ym;exports.createHttpRequest=$m;exports.currentDrift=MS;exports.defineFrontendTool=NL;exports.display=Q;exports.elapsed=Ne;exports.forEachChildNodes=WM;exports.getEventBridge=yo;exports.getGlobalObject=It;exports.getMutationObserverConstructor=Gk;exports.getNodePrivacyLevel=ra;exports.getNodeSelfPrivacyLevel=uE;exports.getParentNode=nE;exports.getScrollX=PU;exports.getScrollY=$E;exports.getSegmentsCount=Y6;exports.getTextContent=f4;exports.getViewportDimension=Zc;exports.hasChildNodes=HM;exports.initViewportObservable=OE;exports.instrumentMethod=Bt;exports.instrumentSetter=P2;exports.isNodeShadowHost=Pm;exports.isNodeShadowRoot=rE;exports.isPageExitReason=xk;exports.isSafari=vj;exports.jsonStringify=go;exports.monitor=ne;exports.monitorError=pr;exports.noop=_e;exports.objectEntries=jc;exports.reducePrivacyLevel=lE;exports.relativeToClocks=Hi;exports.requestIdleCallback=Rk;exports.sanitizeIfLongDataUrl=Yk;exports.sendToExtension=Im;exports.setTimeout=Je;exports.shouldMaskAttribute=dE;exports.shouldMaskNode=zm;exports.supportPerformanceTimingEvent=Zr;exports.throttle=Ji;exports.timeStampNow=Be;exports.trackError=hs;exports.useThreadId=YT;
145
- //# sourceMappingURL=index-Ysm5O3J6.cjs.map
145
+ //# sourceMappingURL=index-JbEIsMvT.cjs.map