@rekayasa/erica-bubble 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/erica-bubble.css +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +261 -250
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -41,7 +41,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
|
|
|
41
41
|
|
|
42
42
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=hn,s=!tn.jitless,c=s&&gn.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?xi([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function wi(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!An(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Nn(e,r,nn())))}),t)}var Ti=j(`$ZodUnion`,(e,t)=>{P.init(e,t),M(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),M(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),M(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),M(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>cn(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>wi(t,i,e,a)):wi(s,i,e,a)}}),Ei=j(`$ZodIntersection`,(e,t)=>{P.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Oi(e,t,n)):Oi(e,i,a)}});function Di(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_n(e)&&_n(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Di(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Di(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Oi(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),An(e))return e;let o=Di(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var ki=j(`$ZodEnum`,(e,t)=>{P.init(e,t);let n=rn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>yn.has(typeof e)).map(e=>typeof e==`string`?bn(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Ai=j(`$ZodTransform`,(e,t)=>{P.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new en(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new $t;return n.value=i,n}});function ji(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Mi=j(`$ZodOptional`,(e,t)=>{P.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,M(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),M(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${cn(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>ji(t,e.value)):ji(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ni=j(`$ZodExactOptional`,(e,t)=>{Mi.init(e,t),M(e._zod,`values`,()=>t.innerType._zod.values),M(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Pi=j(`$ZodNullable`,(e,t)=>{P.init(e,t),M(e._zod,`optin`,()=>t.innerType._zod.optin),M(e._zod,`optout`,()=>t.innerType._zod.optout),M(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${cn(e.source)}|null)$`):void 0}),M(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Fi=j(`$ZodDefault`,(e,t)=>{P.init(e,t),e._zod.optin=`optional`,M(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ii(e,t)):Ii(r,t)}});function Ii(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Li=j(`$ZodPrefault`,(e,t)=>{P.init(e,t),e._zod.optin=`optional`,M(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ri=j(`$ZodNonOptional`,(e,t)=>{P.init(e,t),M(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>zi(t,e)):zi(i,e)}});function zi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Bi=j(`$ZodCatch`,(e,t)=>{P.init(e,t),M(e._zod,`optin`,()=>t.innerType._zod.optin),M(e._zod,`optout`,()=>t.innerType._zod.optout),M(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Nn(e,n,nn()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Nn(e,n,nn()))},input:e.value}),e.issues=[]),e)}}),Vi=j(`$ZodPipe`,(e,t)=>{P.init(e,t),M(e._zod,`values`,()=>t.in._zod.values),M(e._zod,`optin`,()=>t.in._zod.optin),M(e._zod,`optout`,()=>t.out._zod.optout),M(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Hi(e,t.in,n)):Hi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Hi(e,t.out,n)):Hi(r,t.out,n)}});function Hi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Ui=j(`$ZodReadonly`,(e,t)=>{P.init(e,t),M(e._zod,`propValues`,()=>t.innerType._zod.propValues),M(e._zod,`values`,()=>t.innerType._zod.values),M(e._zod,`optin`,()=>t.innerType?._zod?.optin),M(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Wi):Wi(r)}});function Wi(e){return e.value=Object.freeze(e.value),e}var Gi=j(`$ZodCustom`,(e,t)=>{Or.init(e,t),P.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ki(t,n,r,e));Ki(i,n,r,e)}});function Ki(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Fn(e))}}var qi,Ji=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Yi(){return new Ji}(qi=globalThis).__zod_globalRegistry??(qi.__zod_globalRegistry=Yi());var Xi=globalThis.__zod_globalRegistry;function Zi(e,t){return new e({type:`string`,...N(t)})}function Qi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...N(t)})}function $i(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...N(t)})}function ea(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...N(t)})}function ta(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...N(t)})}function na(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...N(t)})}function ra(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...N(t)})}function ia(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...N(t)})}function aa(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...N(t)})}function oa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...N(t)})}function sa(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...N(t)})}function ca(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...N(t)})}function la(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...N(t)})}function ua(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...N(t)})}function da(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...N(t)})}function fa(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...N(t)})}function pa(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...N(t)})}function ma(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...N(t)})}function ha(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...N(t)})}function ga(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...N(t)})}function _a(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...N(t)})}function va(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...N(t)})}function ya(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...N(t)})}function ba(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...N(t)})}function xa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...N(t)})}function Sa(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...N(t)})}function Ca(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...N(t)})}function wa(e){return new e({type:`unknown`})}function Ta(e,t){return new e({type:`never`,...N(t)})}function Ea(e,t){return new kr({check:`max_length`,...N(t),maximum:e})}function Da(e,t){return new Ar({check:`min_length`,...N(t),minimum:e})}function Oa(e,t){return new jr({check:`length_equals`,...N(t),length:e})}function ka(e,t){return new Nr({check:`string_format`,format:`regex`,...N(t),pattern:e})}function Aa(e){return new Pr({check:`string_format`,format:`lowercase`,...N(e)})}function ja(e){return new Fr({check:`string_format`,format:`uppercase`,...N(e)})}function Ma(e,t){return new Ir({check:`string_format`,format:`includes`,...N(t),includes:e})}function Na(e,t){return new Lr({check:`string_format`,format:`starts_with`,...N(t),prefix:e})}function Pa(e,t){return new Rr({check:`string_format`,format:`ends_with`,...N(t),suffix:e})}function Fa(e){return new zr({check:`overwrite`,tx:e})}function Ia(e){return Fa(t=>t.normalize(e))}function La(){return Fa(e=>e.trim())}function Ra(){return Fa(e=>e.toLowerCase())}function za(){return Fa(e=>e.toUpperCase())}function Ba(){return Fa(e=>pn(e))}function Va(e,t,n){return new e({type:`array`,element:t,...N(n)})}function Ha(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...N(n)})}function Ua(e){let t=Wa(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Fn(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Fn(r))}},e(n.value,n)));return t}function Wa(e,t){let n=new Or({check:`custom`,...N(t)});return n._zod.check=e,n}function Ga(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??Xi,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 I(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,I(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&L(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ka(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
43
43
|
|
|
44
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function qa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Ya(t,`input`,e.processors),output:Ya(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function L(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return L(r.element,n);if(r.type===`set`)return L(r.valueType,n);if(r.type===`lazy`)return L(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return L(r.innerType,n);if(r.type===`intersection`)return L(r.left,n)||L(r.right,n);if(r.type===`record`||r.type===`map`)return L(r.keyType,n)||L(r.valueType,n);if(r.type===`pipe`)return L(r.in,n)||L(r.out,n);if(r.type===`object`){for(let e in r.shape)if(L(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(L(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(L(e,n))return!0;return!!(r.rest&&L(r.rest,n))}return!1}var Ja=(e,t={})=>n=>{let r=Ga({...n,processors:t});return I(e,r),Ka(r,e),qa(r,e)},Ya=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ga({...i??{},target:a,io:t,processors:n});return I(e,o),Ka(o,e),qa(o,e)},Xa={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Za=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Xa[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Qa=(e,t,n,r)=>{n.not={}},$a=(e,t,n,r)=>{let i=e._zod.def,a=rn(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},eo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},to=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},no=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=I(a.element,t,{...r,path:[...r.path,`items`]})},ro=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=I(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=I(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},io=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>I(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ao=(e,t,n,r)=>{let i=e._zod.def,a=I(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=I(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},oo=(e,t,n,r)=>{let i=e._zod.def,a=I(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},so=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},co=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},lo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},uo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},fo=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;I(a,t,r);let o=t.seen.get(e);o.ref=a},po=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},mo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ho=j(`ZodISODateTime`,(e,t)=>{ei.init(e,t),z.init(e,t)});function go(e){return ba(ho,e)}var _o=j(`ZodISODate`,(e,t)=>{ti.init(e,t),z.init(e,t)});function vo(e){return xa(_o,e)}var yo=j(`ZodISOTime`,(e,t)=>{ni.init(e,t),z.init(e,t)});function bo(e){return Sa(yo,e)}var xo=j(`ZodISODuration`,(e,t)=>{ri.init(e,t),z.init(e,t)});function So(e){return Ca(xo,e)}var Co=(e,t)=>{Ln.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Bn(e,t)},flatten:{value:t=>zn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,an,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,an,2)}},isEmpty:{get(){return e.issues.length===0}}})};j(`ZodError`,Co);var wo=j(`ZodError`,Co,{Parent:Error}),To=Vn(wo),Eo=Hn(wo),Do=Un(wo),Oo=Gn(wo),ko=qn(wo),Ao=Jn(wo),jo=Yn(wo),Mo=Xn(wo),No=Zn(wo),Po=Qn(wo),Fo=$n(wo),Io=er(wo),R=j(`ZodType`,(e,t)=>(P.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ya(e,`input`),output:Ya(e,`output`)}}),e.toJSONSchema=Ja(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(dn(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>xn(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>To(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Do(e,t,n),e.parseAsync=async(t,n)=>Eo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Oo(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ko(e,t,n),e.decode=(t,n)=>Ao(e,t,n),e.encodeAsync=async(t,n)=>jo(e,t,n),e.decodeAsync=async(t,n)=>Mo(e,t,n),e.safeEncode=(t,n)=>No(e,t,n),e.safeDecode=(t,n)=>Po(e,t,n),e.safeEncodeAsync=async(t,n)=>Fo(e,t,n),e.safeDecodeAsync=async(t,n)=>Io(e,t,n),e.refine=(t,n)=>e.check(Bs(t,n)),e.superRefine=t=>e.check(Vs(t)),e.overwrite=t=>e.check(Fa(t)),e.optional=()=>Ss(e),e.exactOptional=()=>ws(e),e.nullable=()=>Es(e),e.nullish=()=>Ss(Es(e)),e.nonoptional=t=>Ms(e,t),e.array=()=>us(e),e.or=t=>ms([e,t]),e.and=t=>gs(e,t),e.transform=t=>Is(e,bs(t)),e.default=t=>Os(e,t),e.prefault=t=>As(e,t),e.catch=t=>Ps(e,t),e.pipe=t=>Is(e,t),e.readonly=()=>Rs(e),e.describe=t=>{let n=e.clone();return Xi.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Xi.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Xi.get(e);let n=e.clone();return Xi.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Lo=j(`_ZodString`,(e,t)=>{Hr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(ka(...t)),e.includes=(...t)=>e.check(Ma(...t)),e.startsWith=(...t)=>e.check(Na(...t)),e.endsWith=(...t)=>e.check(Pa(...t)),e.min=(...t)=>e.check(Da(...t)),e.max=(...t)=>e.check(Ea(...t)),e.length=(...t)=>e.check(Oa(...t)),e.nonempty=(...t)=>e.check(Da(1,...t)),e.lowercase=t=>e.check(Aa(t)),e.uppercase=t=>e.check(ja(t)),e.trim=()=>e.check(La()),e.normalize=(...t)=>e.check(Ia(...t)),e.toLowerCase=()=>e.check(Ra()),e.toUpperCase=()=>e.check(za()),e.slugify=()=>e.check(Ba())}),Ro=j(`ZodString`,(e,t)=>{Hr.init(e,t),Lo.init(e,t),e.email=t=>e.check(Qi(Bo,t)),e.url=t=>e.check(ia(Uo,t)),e.jwt=t=>e.check(ya(is,t)),e.emoji=t=>e.check(aa(Wo,t)),e.guid=t=>e.check($i(Vo,t)),e.uuid=t=>e.check(ea(Ho,t)),e.uuidv4=t=>e.check(ta(Ho,t)),e.uuidv6=t=>e.check(na(Ho,t)),e.uuidv7=t=>e.check(ra(Ho,t)),e.nanoid=t=>e.check(oa(Go,t)),e.guid=t=>e.check($i(Vo,t)),e.cuid=t=>e.check(sa(Ko,t)),e.cuid2=t=>e.check(ca(qo,t)),e.ulid=t=>e.check(la(Jo,t)),e.base64=t=>e.check(ga(ts,t)),e.base64url=t=>e.check(_a(ns,t)),e.xid=t=>e.check(ua(Yo,t)),e.ksuid=t=>e.check(da(Xo,t)),e.ipv4=t=>e.check(fa(Zo,t)),e.ipv6=t=>e.check(pa(Qo,t)),e.cidrv4=t=>e.check(ma($o,t)),e.cidrv6=t=>e.check(ha(es,t)),e.e164=t=>e.check(va(rs,t)),e.datetime=t=>e.check(go(t)),e.date=t=>e.check(vo(t)),e.time=t=>e.check(bo(t)),e.duration=t=>e.check(So(t))});function zo(e){return Zi(Ro,e)}var z=j(`ZodStringFormat`,(e,t)=>{F.init(e,t),Lo.init(e,t)}),Bo=j(`ZodEmail`,(e,t)=>{Gr.init(e,t),z.init(e,t)}),Vo=j(`ZodGUID`,(e,t)=>{Ur.init(e,t),z.init(e,t)}),Ho=j(`ZodUUID`,(e,t)=>{Wr.init(e,t),z.init(e,t)}),Uo=j(`ZodURL`,(e,t)=>{Kr.init(e,t),z.init(e,t)}),Wo=j(`ZodEmoji`,(e,t)=>{qr.init(e,t),z.init(e,t)}),Go=j(`ZodNanoID`,(e,t)=>{Jr.init(e,t),z.init(e,t)}),Ko=j(`ZodCUID`,(e,t)=>{Yr.init(e,t),z.init(e,t)}),qo=j(`ZodCUID2`,(e,t)=>{Xr.init(e,t),z.init(e,t)}),Jo=j(`ZodULID`,(e,t)=>{Zr.init(e,t),z.init(e,t)}),Yo=j(`ZodXID`,(e,t)=>{Qr.init(e,t),z.init(e,t)}),Xo=j(`ZodKSUID`,(e,t)=>{$r.init(e,t),z.init(e,t)}),Zo=j(`ZodIPv4`,(e,t)=>{ii.init(e,t),z.init(e,t)}),Qo=j(`ZodIPv6`,(e,t)=>{ai.init(e,t),z.init(e,t)}),$o=j(`ZodCIDRv4`,(e,t)=>{oi.init(e,t),z.init(e,t)}),es=j(`ZodCIDRv6`,(e,t)=>{si.init(e,t),z.init(e,t)}),ts=j(`ZodBase64`,(e,t)=>{li.init(e,t),z.init(e,t)}),ns=j(`ZodBase64URL`,(e,t)=>{di.init(e,t),z.init(e,t)}),rs=j(`ZodE164`,(e,t)=>{fi.init(e,t),z.init(e,t)}),is=j(`ZodJWT`,(e,t)=>{mi.init(e,t),z.init(e,t)}),as=j(`ZodUnknown`,(e,t)=>{hi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function os(){return wa(as)}var ss=j(`ZodNever`,(e,t)=>{gi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r)});function cs(e){return Ta(ss,e)}var ls=j(`ZodArray`,(e,t)=>{vi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Da(t,n)),e.nonempty=t=>e.check(Da(1,t)),e.max=(t,n)=>e.check(Ea(t,n)),e.length=(t,n)=>e.check(Oa(t,n)),e.unwrap=()=>e.element});function us(e,t){return Va(ls,e,t)}var ds=j(`ZodObject`,(e,t)=>{Ci.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),M(e,`shape`,()=>t.shape),e.keyof=()=>vs(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:os()}),e.loose=()=>e.clone({...e._zod.def,catchall:os()}),e.strict=()=>e.clone({...e._zod.def,catchall:cs()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Tn(e,t),e.safeExtend=t=>En(e,t),e.merge=t=>Dn(e,t),e.pick=t=>Cn(e,t),e.omit=t=>wn(e,t),e.partial=(...t)=>On(xs,e,t[0]),e.required=(...t)=>kn(js,e,t[0])});function fs(e,t){return new ds({type:`object`,shape:e??{},...N(t)})}var ps=j(`ZodUnion`,(e,t)=>{Ti.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.options=t.options});function ms(e,t){return new ps({type:`union`,options:e,...N(t)})}var hs=j(`ZodIntersection`,(e,t)=>{Ei.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)});function gs(e,t){return new hs({type:`intersection`,left:e,right:t})}var _s=j(`ZodEnum`,(e,t)=>{ki.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new _s({...t,checks:[],...N(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new _s({...t,checks:[],...N(r),entries:i})}});function vs(e,t){return new _s({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...N(t)})}var ys=j(`ZodTransform`,(e,t)=>{Ai.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new en(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Fn(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Fn(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function bs(e){return new ys({type:`transform`,transform:e})}var xs=j(`ZodOptional`,(e,t)=>{Mi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ss(e){return new xs({type:`optional`,innerType:e})}var Cs=j(`ZodExactOptional`,(e,t)=>{Ni.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ws(e){return new Cs({type:`optional`,innerType:e})}var Ts=j(`ZodNullable`,(e,t)=>{Pi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Es(e){return new Ts({type:`nullable`,innerType:e})}var Ds=j(`ZodDefault`,(e,t)=>{Fi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Os(e,t){return new Ds({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():vn(t)}})}var ks=j(`ZodPrefault`,(e,t)=>{Li.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function As(e,t){return new ks({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():vn(t)}})}var js=j(`ZodNonOptional`,(e,t)=>{Ri.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ms(e,t){return new js({type:`nonoptional`,innerType:e,...N(t)})}var Ns=j(`ZodCatch`,(e,t)=>{Bi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ps(e,t){return new Ns({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Fs=j(`ZodPipe`,(e,t)=>{Vi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.in=t.in,e.out=t.out});function Is(e,t){return new Fs({type:`pipe`,in:e,out:t})}var Ls=j(`ZodReadonly`,(e,t)=>{Ui.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rs(e){return new Ls({type:`readonly`,innerType:e})}var zs=j(`ZodCustom`,(e,t)=>{Gi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r)});function Bs(e,t={}){return Ha(zs,e,t)}function Vs(e){return Ua(e)}fs({chartConfig:zo().describe(`Erica chart config syntax.`)});var Hs=fs({compiled_chart:fs({path:zo().describe(`Path to the chart JSON file.`)}).describe(`Compiled chart`)});fs({title:zo().describe(`Title of the report.`),reportContent:zo().describe(`Markdown content of the report.`)});var Us=fs({compiled_report:fs({title:zo().describe(`Title of the report.`),path:zo().describe(`Path to the compiled report.`)})}),Ws={get:async(e,t)=>{let{data:n}=await Gt({path:{threadId:e,filename:t},throwOnError:!0});return n}},Gs=[`bar`,`line`,`pie`,`bignumber`,`table`,`scatter`,`funnel`],Ks=/(\w+)=(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|(true|false|-?(?:\d+\.?\d*|\.\d+)))/g;function qs(e){let t={},n=new RegExp(Ks.source,Ks.flags),r;for(;(r=n.exec(e))!==null;){let e=r[2]??r[3]??r[4]??``;r[2]===void 0?r[3]!==void 0&&(e=e.replace(/\\'/g,`'`).replace(/\\\\/g,`\\`)):e=e.replace(/\\"/g,`"`).replace(/\\\\/g,`\\`),t[r[1]]=e}return t}var Js=/\{%\s*(\w+)\s+((?:(?!\/%\})[\s\S])*)\/%\}/g;function Ys(e){let t=[],n=0,r=new RegExp(Js.source,Js.flags),i;for(;(i=r.exec(e))!==null;){let[r,a,o]=i,s=i.index;s>n&&t.push({kind:`text`,content:e.slice(n,s)});let c=a.toLowerCase();if(Gs.includes(c)){let e={type:c,attrs:qs(o),raw:r};t.push({kind:`chart`,node:e})}else t.push({kind:`text`,content:r});n=s+r.length}return n<e.length&&t.push({kind:`text`,content:e.slice(n)}),t}function Xs(e,t){let n=[];switch(e){case`bar`:case`line`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.x||n.push({field:`x`,message:`x is required`}),t.y||n.push({field:`y`,message:`y is required`});break;case`pie`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.name||n.push({field:`name`,message:`name is required`}),t.value||n.push({field:`value`,message:`value is required`});break;case`bignumber`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.value||n.push({field:`value`,message:`value is required`});break;case`table`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`});break;case`scatter`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.x||n.push({field:`x`,message:`x is required`}),t.y||n.push({field:`y`,message:`y is required`});break;case`funnel`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.name||n.push({field:`name`,message:`name is required`}),t.value||n.push({field:`value`,message:`value is required`});break}return n.length>0?{valid:!1,errors:n}:{valid:!0}}function Zs(e){if(e===void 0)return;let t=e.toLowerCase();if(t===`true`||t===`1`||t===`yes`)return!0;if(t===`false`||t===`0`||t===`no`)return!1}function Qs(e){if(e===void 0)return;let t=Number(e);return isNaN(t)?void 0:t}function $s(e){if(e===void 0)return;let t=Number(e);return isNaN(t)?e:t}function ec(e){if(e!==void 0)return e.includes(`,`)?e.split(`,`).map(e=>e.trim()):e}function tc(e){if(e!==void 0)return e.split(`,`).map(e=>e.trim())}function nc(e){if(e!==void 0)try{return JSON.parse(e)}catch{return}}function rc(e){if(e!==void 0)try{return JSON.parse(e)}catch{return}}function ic(e){let t={};for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function ac({option:e,style:t={height:`400px`,width:`100%`},settings:n={notMerge:!0},theme:r}){let i=(0,u.useRef)(null),a=(0,u.useRef)(null);return(0,u.useEffect)(()=>{i.current&&(a.current=p.init(i.current,r));let e=()=>{a.current?.resize()};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e),a.current?.dispose()}},[r]),(0,u.useEffect)(()=>{if(a.current&&e){let t={...e,grid:{left:30,right:30,top:100,bottom:50,containLabel:!0},toolbox:{show:!0,...e.toolbox,feature:{saveAsImage:{show:!0,title:`Download`,pixelRatio:2},restore:{show:!0},...e.toolbox?.feature||{}}}};a.current.setOption(t,n)}},[e,n]),(0,f.jsx)(`div`,{ref:i,style:t})}function oc({sql:e,data:t,x:n,y:r,title:i,height:a=`400px`,color:o,xAxisName:s,yAxisName:c,horizontal:l=!1,stack:d=!1,seriesNames:p}){let[m,h]=(0,u.useState)(!1),g=(0,u.useMemo)(()=>Array.isArray(r)?r:[r],[r]),_=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),v=(0,u.useMemo)(()=>{if(!_?.rows?.length)return null;let e=_.rows.map(e=>String(e[n]??``)),t=g.map(e=>({name:p?.[e]??e,type:`bar`,data:_.rows.map(t=>t[e]??null),stack:d?`total`:void 0,label:m?{show:!0,position:l?`right`:`top`}:void 0}));return ic({title:i?{text:i}:void 0,tooltip:{trigger:`axis`,axisPointer:{type:`shadow`}},toolbox:{feature:{myToggleLabels:{show:!0,title:m?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>h(e=>!e)}}},legend:g.length>1?{show:!0}:void 0,color:o?Array.isArray(o)?o:[o]:void 0,grid:{containLabel:!0},...l?{xAxis:{type:`value`,name:s},yAxis:{type:`category`,data:e,name:c}}:{xAxis:{type:`category`,data:e,name:s},yAxis:{type:`value`,name:c}},series:t})},[_,n,g,i,o,s,c,l,p,m,d]),y={height:typeof a==`number`?`${a}px`:a,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:{...y,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-yellow-200 bg-yellow-50 p-4`,children:(0,f.jsx)(`p`,{className:`text-sm text-yellow-700`,children:`SQL queries are not supported yet. Please provide data directly.`})}):v?(0,f.jsx)(ac,{option:v,style:y}):(0,f.jsx)(`div`,{style:{...y,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-gray-200 bg-gray-50`,children:(0,f.jsx)(`p`,{className:`text-sm text-gray-500`,children:`No data`})})}function sc({sql:e,data:t,x:n,y:r,title:i,height:a=`400px`,color:o,xAxisName:s,yAxisName:c,smooth:l=!1,area:d=!1,seriesNames:p,secondary_y:m,secondary_title:h,prefix:g,suffix:_}){let[v,y]=(0,u.useState)(!1),b=(0,u.useMemo)(()=>Array.isArray(r)?r:[r],[r]),x=(0,u.useMemo)(()=>m?Array.isArray(m)?m:[m]:[],[m]),S=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),C=(0,u.useMemo)(()=>{if(!S?.rows?.length)return null;let e=S.rows.map(e=>String(e[n]??``)),t=b.map(e=>({name:p?.[e]??e,type:`line`,data:S.rows.map(t=>t[e]??null),smooth:l,areaStyle:d?{}:void 0,yAxisIndex:0,label:v?{show:!0,position:`top`}:void 0})),r=x.map(e=>({name:p?.[e]??e,type:`line`,data:S.rows.map(t=>t[e]??null),smooth:l,yAxisIndex:1,label:v?{show:!0,position:`top`}:void 0})),a=[...t,...r],u=x.length>0;return ic({title:i?{text:i}:void 0,tooltip:{trigger:`axis`,valueFormatter:e=>`${g||``}${String(e??``)}${_||``}`},toolbox:{feature:{myToggleLabels:{show:!0,title:v?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>y(e=>!e)}}},legend:b.length>1||u?{show:!0}:void 0,color:o?Array.isArray(o)?o:[o]:void 0,grid:{containLabel:!0},xAxis:{type:`category`,data:e,name:s},yAxis:u?[{type:`value`,name:c},{type:`value`,name:h}]:{type:`value`,name:c},series:a})},[S,n,b,x,i,o,s,c,h,l,d,p,v,g,_]),w={height:typeof a==`number`?`${a}px`:a,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:{...w,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-yellow-200 bg-yellow-50 p-4`,children:(0,f.jsx)(`p`,{className:`text-sm text-yellow-700`,children:`SQL queries are not supported yet. Please provide data directly.`})}):C?(0,f.jsx)(ac,{option:C,style:w}):(0,f.jsx)(`div`,{style:{...w,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-gray-200 bg-gray-50`,children:(0,f.jsx)(`p`,{className:`text-sm text-gray-500`,children:`No data`})})}var cc={red:`#dc2626`,green:`#16a34a`,blue:`#2563eb`,yellow:`#ca8a04`,orange:`#ea580c`,purple:`#9333ea`,pink:`#db2777`,gray:`#6b7280`,black:`#111827`,white:`#ffffff`},lc=e=>{if(!e)return null;let t=e.indexOf(`|`);if(t===-1)return{text:e};let n=e.slice(0,t).trim().toLowerCase(),r=e.slice(t+1).trim();return r?{text:r,color:cc[n]??n}:{text:e}};function uc({sql:e,data:t,value:n,title:r=`Big Number`,subtitle:i,description:a,height:o=`170px`,prefix:s=``,suffix:c=``,decimals:l=0}){let d=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),p=(0,u.useMemo)(()=>d?.rows?.length?d.rows[0]?.[n]??null:null,[d,n]),m=(0,u.useMemo)(()=>{if(p==null||p===``)return`--`;let e=Number(p);return Number.isNaN(e)?String(p):`${s}${e.toLocaleString(void 0,{minimumFractionDigits:l,maximumFractionDigits:l})}${c}`},[p,s,c,l]),h=(0,u.useMemo)(()=>lc(r),[r]),g=(0,u.useMemo)(()=>lc(i),[i]),_=(0,u.useMemo)(()=>lc(a),[a]),v=(0,u.useMemo)(()=>lc(m),[m]),y={width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:y,className:`flex items-center justify-center rounded-lg border border-yellow-200 bg-yellow-50 p-4`,children:(0,f.jsx)(`p`,{className:`text-sm text-yellow-700`,children:`SQL queries are not supported yet. Please provide data directly.`})}):(0,f.jsxs)(`div`,{style:y,className:`flex w-full flex-col justify-center p-4 border border-gray-200 rounded-lg bg-white`,children:[(0,f.jsxs)(`div`,{className:`flex flex-col items-start gap-1 pb-1`,children:[(0,f.jsx)(`p`,{className:`text-sm font-medium text-gray-600`,style:h?.color?{color:h.color}:void 0,children:h?.text??r}),g?(0,f.jsx)(`p`,{className:`text-xs text-gray-500`,style:g.color?{color:g.color}:void 0,children:g.text}):null]}),(0,f.jsxs)(`div`,{className:`justify-center pt-2`,children:[(0,f.jsx)(`p`,{className:`text-4xl font-bold tracking-tight text-gray-900`,style:v?.color?{color:v.color}:void 0,children:v?.text??m}),_?(0,f.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,style:_.color?{color:_.color}:void 0,children:_.text}):null]})]})}function dc({sql:e,data:t,name:n,value:r,title:i,height:a=`400px`,showLabels:o=!0,showLegend:s=!1,sort:c=`descending`}){let[l,d]=(0,u.useState)(o),[p,m]=(0,u.useState)(s),h=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),g=(0,u.useMemo)(()=>{if(!h?.rows?.length)return null;let e=h.rows.map(e=>({name:String(e[n]??``),value:Number(e[r]??0)}));return ic({title:i?{text:i}:void 0,tooltip:{trigger:`item`,formatter:`{b}: {c}`},toolbox:{feature:{myToggleLabels:{show:!0,title:l?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>d(e=>!e)},myToggleLegend:{show:!0,title:p?`Hide Legend`:`Show Legend`,icon:`path://M4 6h16M4 12h16M4 18h16`,onclick:()=>m(e=>!e)}}},legend:p?{show:!0,top:`bottom`}:void 0,series:[{type:`funnel`,left:`10%`,top:60,bottom:20,width:`80%`,min:0,minSize:`0%`,maxSize:`100%`,sort:c,gap:4,label:{show:l,position:`inside`,formatter:`{b}: {c}`},emphasis:{label:{fontSize:14}},data:e}]})},[h,n,r,i,c,l,p]),_={height:typeof a==`number`?`${a}px`:a,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:{..._,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-yellow-200 bg-yellow-50 p-4`,children:(0,f.jsx)(`p`,{className:`text-sm text-yellow-700`,children:`SQL queries are not supported yet. Please provide data directly.`})}):g?(0,f.jsx)(ac,{option:g,style:_}):(0,f.jsx)(`div`,{style:{..._,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-gray-200 bg-gray-50`,children:(0,f.jsx)(`p`,{className:`text-sm text-gray-500`,children:`No data`})})}var fc=e=>e==null||e===``?`—`:typeof e==`object`?JSON.stringify(e):String(e);function pc({sql:e,data:t,title:n,height:r=`400px`,columns:i,maxRows:a}){let o=(0,u.useMemo)(()=>{if(t){let e=t;return{rows:e,columns:e.length>0?Object.keys(e[0]):[]}}return null},[t]),s=(0,u.useMemo)(()=>{let e=o?.columns?.length?o.columns:[];return i?.length?i.filter(t=>e.includes(t)):e},[o,i]),c=(0,u.useMemo)(()=>{let e=o?.rows??[];return!a||a<=0?e:e.slice(0,a)},[o,a]),l={height:typeof r==`number`?`${r}px`:r,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:{...l,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-yellow-200 bg-yellow-50 p-4`,children:(0,f.jsx)(`p`,{className:`text-sm text-yellow-700`,children:`SQL queries are not supported yet. Please provide data directly.`})}):!s.length||!c.length?(0,f.jsx)(`div`,{style:{...l,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-gray-200 bg-gray-50`,children:(0,f.jsx)(`p`,{className:`text-sm text-gray-500`,children:`No data`})}):(0,f.jsxs)(`div`,{style:l,className:`overflow-hidden rounded-lg border border-gray-200 bg-white`,children:[n?(0,f.jsx)(`div`,{className:`border-b border-gray-100 bg-gray-50 px-4 py-3`,children:(0,f.jsx)(`p`,{className:`text-sm font-semibold text-gray-700`,children:n})}):null,(0,f.jsx)(`div`,{className:`h-full overflow-auto`,children:(0,f.jsxs)(`table`,{className:`w-full border-collapse`,children:[(0,f.jsx)(`thead`,{className:`bg-gray-50 sticky top-0`,children:(0,f.jsx)(`tr`,{children:s.map(e=>(0,f.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium text-gray-500 uppercase tracking-wide border-b border-gray-200`,children:e},e))})}),(0,f.jsx)(`tbody`,{children:c.map((e,t)=>(0,f.jsx)(`tr`,{className:`border-b border-gray-100 last:border-0 hover:bg-gray-50 transition-colors`,children:s.map(n=>(0,f.jsx)(`td`,{className:`px-4 py-3 text-sm text-gray-700`,children:(0,f.jsx)(`div`,{className:`max-w-[240px] truncate hover:overflow-visible hover:whitespace-normal hover:max-w-none`,children:fc(e[n])})},`${t}-${n}`))},String(e._erica_id??t)))})]})})]})}function mc({sql:e,data:t,name:n,value:r,title:i,height:a=`400px`,donut:o=!1,showLabels:s=!0,showLegend:c=!0}){let[l,d]=(0,u.useState)(s),[p,m]=(0,u.useState)(c),h=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),g=(0,u.useMemo)(()=>{if(!h?.rows?.length)return null;let e=h.rows.map(e=>({name:String(e[n]??``),value:Number(e[r]??0)}));return ic({title:i?{text:i}:void 0,tooltip:{trigger:`item`,formatter:`{a} <br/>{b}: {c} ({d}%)`},toolbox:{feature:{myToggleLabels:{show:!0,title:l?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>d(e=>!e)},myToggleLegend:{show:!0,title:p?`Hide Legend`:`Show Legend`,icon:`path://M4 6h16M4 12h16M4 18h16`,onclick:()=>m(e=>!e)}}},legend:p?{show:!0,orient:`vertical`,left:`left`}:void 0,series:[{name:i??`Data`,type:`pie`,radius:o?[`40%`,`70%`]:`70%`,data:e,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:`rgba(0, 0, 0, 0.5)`}},label:{show:l,formatter:`{b}: {c} ({d}%)`}}]})},[h,n,r,i,o,l,p]),_={height:typeof a==`number`?`${a}px`:a,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:{..._,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-yellow-200 bg-yellow-50 p-4`,children:(0,f.jsx)(`p`,{className:`text-sm text-yellow-700`,children:`SQL queries are not supported yet. Please provide data directly.`})}):g?(0,f.jsx)(ac,{option:g,style:_}):(0,f.jsx)(`div`,{style:{..._,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-gray-200 bg-gray-50`,children:(0,f.jsx)(`p`,{className:`text-sm text-gray-500`,children:`No data`})})}function hc({sql:e,data:t,x:n,y:r,seriesBy:i,size:a,color:o,title:s,height:c=`400px`,xAxisName:l,yAxisName:d,seriesNames:p}){let[m,h]=(0,u.useState)(!1),g=(0,u.useMemo)(()=>Array.isArray(r)?r:[r],[r]),_=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),v=(0,u.useMemo)(()=>{if(!_?.rows?.length)return null;let e=(e,t)=>{let r=[Number(e[n]??0),Number(e[t]??0)];return a&&r.push(Number(e[a]??0)),o&&r.push(String(e[o]??``)),r},t=i?_.rows.reduce((e,t)=>{let n=String(t[i]??`Unknown`);return e[n]||(e[n]=[]),e[n].push(t),e},{}):null,r=(e,t)=>({name:t,type:`scatter`,symbolSize:a?e=>Math.sqrt(e[2])*2:10,data:e,label:m?{show:!0,formatter:e=>{let t=e.value;return`${t[0]}, ${t[1]}`}}:void 0,itemStyle:o?{color:e=>{let t=e.value,n=t[t.length-1],r=[`#5470c6`,`#91cc75`,`#fac858`,`#ee6666`,`#73c0de`,`#3ba272`,`#fc8452`,`#9a60b4`,`#ea7ccc`];return r[n.split(``).reduce((e,t)=>e+t.charCodeAt(0),0)%r.length]}}:void 0}),c=t?Object.entries(t).flatMap(([t,n])=>g.map(i=>{let a=p?.[t]??t,o=p?.[i]??i,s=g.length>1?`${a} - ${o}`:a;return r(n.map(t=>e(t,i)),s)})):g.map(t=>r(_.rows.map(n=>e(n,t)),p?.[t]??t));return ic({title:s?{text:s}:void 0,tooltip:{trigger:`item`,formatter:e=>{let t=e.value,r=`${e.seriesName?`${e.seriesName}<br/>`:``}${n}: ${t[0]}<br/>${d??`Value`}: ${t[1]}`,i=2;return a&&(r+=`<br/>${a}: ${t[i++]}`),o&&(r+=`<br/>${o}: ${t[i]}`),r}},toolbox:{feature:{myToggleLabels:{show:!0,title:m?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>h(e=>!e)}}},xAxis:{type:`value`,name:l,scale:!0},yAxis:{type:`value`,name:d,scale:!0},legend:c.length>1?{show:!0}:void 0,series:c})},[_,n,g,i,a,o,s,l,d,m,p]),y={height:typeof c==`number`?`${c}px`:c,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:{...y,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-yellow-200 bg-yellow-50 p-4`,children:(0,f.jsx)(`p`,{className:`text-sm text-yellow-700`,children:`SQL queries are not supported yet. Please provide data directly.`})}):v?(0,f.jsx)(ac,{option:v,style:y}):(0,f.jsx)(`div`,{style:{...y,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`rounded-lg border border-gray-200 bg-gray-50`,children:(0,f.jsx)(`p`,{className:`text-sm text-gray-500`,children:`No data`})})}function gc({type:e,errors:t}){return(0,f.jsxs)(`div`,{className:`rounded-lg border border-red-200 bg-red-50 p-4`,children:[(0,f.jsxs)(`p`,{className:`mb-2 text-xs font-semibold text-red-700`,children:[`Erica Chart syntax error — `,(0,f.jsx)(`code`,{children:e})]}),(0,f.jsx)(`ul`,{className:`list-inside list-disc space-y-0.5`,children:t.map(e=>(0,f.jsx)(`li`,{className:`text-xs text-red-600`,children:e.message},e.field))})]})}function _c(e){let{type:t,attrs:n}=e,r=Xs(t,n);if(!r.valid)return(0,f.jsx)(gc,{type:t,errors:r.errors});switch(t){case`bar`:return(0,f.jsx)(oc,{sql:n.sql,data:rc(n.data),x:n.x,y:ec(n.y)??n.y,title:n.title,height:$s(n.height),color:ec(n.color),xAxisName:n.xAxisName,yAxisName:n.yAxisName,horizontal:Zs(n.horizontal),stack:Zs(n.stack),seriesNames:nc(n.seriesNames)});case`line`:return(0,f.jsx)(sc,{sql:n.sql,data:rc(n.data),x:n.x,y:ec(n.y)??n.y,title:n.title,height:$s(n.height),color:ec(n.color),xAxisName:n.xAxisName||n.x_title,yAxisName:n.yAxisName||n.y_title,smooth:Zs(n.smooth),area:Zs(n.area),seriesNames:nc(n.seriesNames),secondary_y:ec(n.secondary_y),secondary_title:n.secondary_title,prefix:n.prefix,suffix:n.suffix});case`bignumber`:return(0,f.jsx)(uc,{sql:n.sql,data:rc(n.data),value:n.value,title:n.title,subtitle:n.subtitle,description:n.description,height:$s(n.height),prefix:n.prefix,suffix:n.suffix,decimals:Qs(n.decimals)});case`funnel`:return(0,f.jsx)(dc,{sql:n.sql,data:rc(n.data),name:n.name||n.label||n.stage||n.x,value:n.value||n.y,title:n.title,height:$s(n.height),showLabels:Zs(n.showLabels),showLegend:Zs(n.showLegend),sort:n.sort});case`scatter`:return(0,f.jsx)(hc,{sql:n.sql,data:rc(n.data),x:n.x,y:ec(n.y)??n.y,seriesBy:n.seriesBy,size:n.size,color:n.color,title:n.title,height:$s(n.height),xAxisName:n.xAxisName,yAxisName:n.yAxisName,seriesNames:nc(n.seriesNames)});case`pie`:return(0,f.jsx)(mc,{sql:n.sql,data:rc(n.data),name:n.name||n.label||n.x,value:n.value||n.y,title:n.title,height:$s(n.height),donut:Zs(n.donut),showLabels:Zs(n.showLabels),showLegend:Zs(n.showLegend)});case`table`:return(0,f.jsx)(pc,{sql:n.sql,data:rc(n.data),title:n.title,height:$s(n.height),columns:tc(n.columns),maxRows:Qs(n.maxRows)});default:return(0,f.jsxs)(`div`,{className:`rounded-lg border border-gray-200 bg-white p-4`,children:[(0,f.jsxs)(`div`,{className:`mb-2 text-sm font-semibold text-gray-700`,children:[`Chart type "`,t,`" not implemented yet`]}),(0,f.jsx)(`pre`,{className:`text-xs text-gray-600 overflow-auto max-h-96`,children:JSON.stringify(n,null,2)})]})}}function vc({markdown:e}){return(0,f.jsx)(`div`,{className:`space-y-4`,children:(0,u.useMemo)(()=>Ys(e),[e]).map((e,t)=>e.kind===`text`?e.content.trim()?(0,f.jsx)(`div`,{className:`whitespace-pre-wrap text-sm text-gray-700`,children:e.content},t):null:(0,f.jsx)(`div`,{className:`w-full`,children:_c(e.node)},t))})}function yc({chartConfig:e}){return(0,f.jsx)(`div`,{className:`w-full min-h-[400px]`,children:(0,f.jsx)(vc,{markdown:e})})}function bc({path:e}){let t=(0,u.useContext)(Zt)?.threadId||``,{data:n,isLoading:r}=Lt({queryKey:[`artifact`,t,e],queryFn:async()=>await Ws.get(t,e),enabled:!!t&&!!e});return r?(0,f.jsx)(`div`,{className:`text-sm text-gray-500`,children:`loading chart...`}):n?(0,f.jsx)(yc,{chartConfig:n}):(0,f.jsx)(`div`,{className:`text-sm text-gray-500`,children:`No chart data available`})}var xc=(0,u.createContext)(null);function Sc({children:e}){let[t,n]=(0,u.useState)(!1),[r,i]=(0,u.useState)(null),[a,o]=(0,u.useState)(`Artifacts`);return(0,f.jsx)(xc.Provider,{value:{isOpen:t,onOpen:()=>n(!0),onClose:()=>n(!1),content:r,setContent:i,title:a,setTitle:o},children:e})}var Cc=()=>(0,u.useContext)(xc)||{isOpen:!1,onOpen:()=>{},onClose:()=>{},content:null,setContent:()=>{},title:`Artifacts`,setTitle:()=>{}};function wc(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Tc=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ec=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dc={};function Oc(e,t){return((t||Dc).jsx?Ec:Tc).test(e)}var kc=/[ \t\n\f\r]/g;function Ac(e){return typeof e==`object`?e.type===`text`?jc(e.value):!1:jc(e)}function jc(e){return e.replace(kc,``)===``}var Mc=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Mc.prototype.normal={},Mc.prototype.property={},Mc.prototype.space=void 0;function Nc(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Mc(n,r,t)}function Pc(e){return e.toLowerCase()}var B=class{constructor(e,t){this.attribute=t,this.property=e}};B.prototype.attribute=``,B.prototype.booleanish=!1,B.prototype.boolean=!1,B.prototype.commaOrSpaceSeparated=!1,B.prototype.commaSeparated=!1,B.prototype.defined=!1,B.prototype.mustUseProperty=!1,B.prototype.number=!1,B.prototype.overloadedBoolean=!1,B.prototype.property=``,B.prototype.spaceSeparated=!1,B.prototype.space=void 0;var Fc=s({boolean:()=>V,booleanish:()=>H,commaOrSpaceSeparated:()=>zc,commaSeparated:()=>Rc,number:()=>U,overloadedBoolean:()=>Lc,spaceSeparated:()=>W}),Ic=0,V=Bc(),H=Bc(),Lc=Bc(),U=Bc(),W=Bc(),Rc=Bc(),zc=Bc();function Bc(){return 2**++Ic}var Vc=Object.keys(Fc),Hc=class extends B{constructor(e,t,n,r){let i=-1;if(super(e,t),Uc(this,`space`,r),typeof n==`number`)for(;++i<Vc.length;){let e=Vc[i];Uc(this,Vc[i],(n&Fc[e])===Fc[e])}}};Hc.prototype.defined=!0;function Uc(e,t,n){n&&(e[t]=n)}function Wc(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Hc(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Pc(r)]=r,n[Pc(a.attribute)]=r}return new Mc(t,n,e.space)}var Gc=Wc({properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:H,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:W,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:U,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:W,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:H,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Kc(e,t){return t in e?e[t]:t}function qc(e,t){return Kc(e,t.toLowerCase())}var Jc=Wc({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Rc,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:W,autoFocus:V,autoPlay:V,blocking:W,capture:null,charSet:null,checked:V,cite:null,className:W,cols:U,colSpan:null,content:null,contentEditable:H,controls:V,controlsList:W,coords:U|Rc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:Lc,draggable:H,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:W,height:U,hidden:Lc,high:U,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:W,itemRef:W,itemScope:V,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:V,optimum:U,pattern:null,ping:W,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:W,required:V,reversed:V,rows:U,rowSpan:U,sandbox:W,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:H,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:H,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:H,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:V,disableRemotePlayback:V,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:qc}),Yc=Wc({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:zc,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:W,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Rc,g2:Rc,glyphName:Rc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:zc,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zc,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zc,rev:zc,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zc,requiredFeatures:zc,requiredFonts:zc,requiredFormats:zc,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:zc,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zc,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zc,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Kc}),Xc=Wc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Zc=Wc({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:qc}),Qc=Wc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),$c={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},el=/[A-Z]/g,tl=/-[a-z]/g,nl=/^data[-\w.:]+$/i;function rl(e,t){let n=Pc(t),r=t,i=B;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&nl.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(tl,al);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!tl.test(e)){let n=e.replace(el,il);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Hc}return new i(r,t)}function il(e){return`-`+e.toLowerCase()}function al(e){return e.charAt(1).toUpperCase()}var ol=Nc([Gc,Jc,Xc,Zc,Qc],`html`),sl=Nc([Gc,Yc,Xc,Zc,Qc],`svg`);function cl(e){return e.join(` `).trim()}var ll=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
44
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function qa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Ya(t,`input`,e.processors),output:Ya(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function L(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return L(r.element,n);if(r.type===`set`)return L(r.valueType,n);if(r.type===`lazy`)return L(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return L(r.innerType,n);if(r.type===`intersection`)return L(r.left,n)||L(r.right,n);if(r.type===`record`||r.type===`map`)return L(r.keyType,n)||L(r.valueType,n);if(r.type===`pipe`)return L(r.in,n)||L(r.out,n);if(r.type===`object`){for(let e in r.shape)if(L(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(L(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(L(e,n))return!0;return!!(r.rest&&L(r.rest,n))}return!1}var Ja=(e,t={})=>n=>{let r=Ga({...n,processors:t});return I(e,r),Ka(r,e),qa(r,e)},Ya=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ga({...i??{},target:a,io:t,processors:n});return I(e,o),Ka(o,e),qa(o,e)},Xa={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Za=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Xa[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Qa=(e,t,n,r)=>{n.not={}},$a=(e,t,n,r)=>{let i=e._zod.def,a=rn(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},eo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},to=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},no=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=I(a.element,t,{...r,path:[...r.path,`items`]})},ro=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=I(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=I(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},io=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>I(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ao=(e,t,n,r)=>{let i=e._zod.def,a=I(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=I(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},oo=(e,t,n,r)=>{let i=e._zod.def,a=I(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},so=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},co=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},lo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},uo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},fo=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;I(a,t,r);let o=t.seen.get(e);o.ref=a},po=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},mo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ho=j(`ZodISODateTime`,(e,t)=>{ei.init(e,t),z.init(e,t)});function go(e){return ba(ho,e)}var _o=j(`ZodISODate`,(e,t)=>{ti.init(e,t),z.init(e,t)});function vo(e){return xa(_o,e)}var yo=j(`ZodISOTime`,(e,t)=>{ni.init(e,t),z.init(e,t)});function bo(e){return Sa(yo,e)}var xo=j(`ZodISODuration`,(e,t)=>{ri.init(e,t),z.init(e,t)});function So(e){return Ca(xo,e)}var Co=(e,t)=>{Ln.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Bn(e,t)},flatten:{value:t=>zn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,an,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,an,2)}},isEmpty:{get(){return e.issues.length===0}}})};j(`ZodError`,Co);var wo=j(`ZodError`,Co,{Parent:Error}),To=Vn(wo),Eo=Hn(wo),Do=Un(wo),Oo=Gn(wo),ko=qn(wo),Ao=Jn(wo),jo=Yn(wo),Mo=Xn(wo),No=Zn(wo),Po=Qn(wo),Fo=$n(wo),Io=er(wo),R=j(`ZodType`,(e,t)=>(P.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ya(e,`input`),output:Ya(e,`output`)}}),e.toJSONSchema=Ja(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(dn(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>xn(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>To(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Do(e,t,n),e.parseAsync=async(t,n)=>Eo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Oo(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ko(e,t,n),e.decode=(t,n)=>Ao(e,t,n),e.encodeAsync=async(t,n)=>jo(e,t,n),e.decodeAsync=async(t,n)=>Mo(e,t,n),e.safeEncode=(t,n)=>No(e,t,n),e.safeDecode=(t,n)=>Po(e,t,n),e.safeEncodeAsync=async(t,n)=>Fo(e,t,n),e.safeDecodeAsync=async(t,n)=>Io(e,t,n),e.refine=(t,n)=>e.check(Bs(t,n)),e.superRefine=t=>e.check(Vs(t)),e.overwrite=t=>e.check(Fa(t)),e.optional=()=>Ss(e),e.exactOptional=()=>ws(e),e.nullable=()=>Es(e),e.nullish=()=>Ss(Es(e)),e.nonoptional=t=>Ms(e,t),e.array=()=>us(e),e.or=t=>ms([e,t]),e.and=t=>gs(e,t),e.transform=t=>Is(e,bs(t)),e.default=t=>Os(e,t),e.prefault=t=>As(e,t),e.catch=t=>Ps(e,t),e.pipe=t=>Is(e,t),e.readonly=()=>Rs(e),e.describe=t=>{let n=e.clone();return Xi.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Xi.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Xi.get(e);let n=e.clone();return Xi.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Lo=j(`_ZodString`,(e,t)=>{Hr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(ka(...t)),e.includes=(...t)=>e.check(Ma(...t)),e.startsWith=(...t)=>e.check(Na(...t)),e.endsWith=(...t)=>e.check(Pa(...t)),e.min=(...t)=>e.check(Da(...t)),e.max=(...t)=>e.check(Ea(...t)),e.length=(...t)=>e.check(Oa(...t)),e.nonempty=(...t)=>e.check(Da(1,...t)),e.lowercase=t=>e.check(Aa(t)),e.uppercase=t=>e.check(ja(t)),e.trim=()=>e.check(La()),e.normalize=(...t)=>e.check(Ia(...t)),e.toLowerCase=()=>e.check(Ra()),e.toUpperCase=()=>e.check(za()),e.slugify=()=>e.check(Ba())}),Ro=j(`ZodString`,(e,t)=>{Hr.init(e,t),Lo.init(e,t),e.email=t=>e.check(Qi(Bo,t)),e.url=t=>e.check(ia(Uo,t)),e.jwt=t=>e.check(ya(is,t)),e.emoji=t=>e.check(aa(Wo,t)),e.guid=t=>e.check($i(Vo,t)),e.uuid=t=>e.check(ea(Ho,t)),e.uuidv4=t=>e.check(ta(Ho,t)),e.uuidv6=t=>e.check(na(Ho,t)),e.uuidv7=t=>e.check(ra(Ho,t)),e.nanoid=t=>e.check(oa(Go,t)),e.guid=t=>e.check($i(Vo,t)),e.cuid=t=>e.check(sa(Ko,t)),e.cuid2=t=>e.check(ca(qo,t)),e.ulid=t=>e.check(la(Jo,t)),e.base64=t=>e.check(ga(ts,t)),e.base64url=t=>e.check(_a(ns,t)),e.xid=t=>e.check(ua(Yo,t)),e.ksuid=t=>e.check(da(Xo,t)),e.ipv4=t=>e.check(fa(Zo,t)),e.ipv6=t=>e.check(pa(Qo,t)),e.cidrv4=t=>e.check(ma($o,t)),e.cidrv6=t=>e.check(ha(es,t)),e.e164=t=>e.check(va(rs,t)),e.datetime=t=>e.check(go(t)),e.date=t=>e.check(vo(t)),e.time=t=>e.check(bo(t)),e.duration=t=>e.check(So(t))});function zo(e){return Zi(Ro,e)}var z=j(`ZodStringFormat`,(e,t)=>{F.init(e,t),Lo.init(e,t)}),Bo=j(`ZodEmail`,(e,t)=>{Gr.init(e,t),z.init(e,t)}),Vo=j(`ZodGUID`,(e,t)=>{Ur.init(e,t),z.init(e,t)}),Ho=j(`ZodUUID`,(e,t)=>{Wr.init(e,t),z.init(e,t)}),Uo=j(`ZodURL`,(e,t)=>{Kr.init(e,t),z.init(e,t)}),Wo=j(`ZodEmoji`,(e,t)=>{qr.init(e,t),z.init(e,t)}),Go=j(`ZodNanoID`,(e,t)=>{Jr.init(e,t),z.init(e,t)}),Ko=j(`ZodCUID`,(e,t)=>{Yr.init(e,t),z.init(e,t)}),qo=j(`ZodCUID2`,(e,t)=>{Xr.init(e,t),z.init(e,t)}),Jo=j(`ZodULID`,(e,t)=>{Zr.init(e,t),z.init(e,t)}),Yo=j(`ZodXID`,(e,t)=>{Qr.init(e,t),z.init(e,t)}),Xo=j(`ZodKSUID`,(e,t)=>{$r.init(e,t),z.init(e,t)}),Zo=j(`ZodIPv4`,(e,t)=>{ii.init(e,t),z.init(e,t)}),Qo=j(`ZodIPv6`,(e,t)=>{ai.init(e,t),z.init(e,t)}),$o=j(`ZodCIDRv4`,(e,t)=>{oi.init(e,t),z.init(e,t)}),es=j(`ZodCIDRv6`,(e,t)=>{si.init(e,t),z.init(e,t)}),ts=j(`ZodBase64`,(e,t)=>{li.init(e,t),z.init(e,t)}),ns=j(`ZodBase64URL`,(e,t)=>{di.init(e,t),z.init(e,t)}),rs=j(`ZodE164`,(e,t)=>{fi.init(e,t),z.init(e,t)}),is=j(`ZodJWT`,(e,t)=>{mi.init(e,t),z.init(e,t)}),as=j(`ZodUnknown`,(e,t)=>{hi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function os(){return wa(as)}var ss=j(`ZodNever`,(e,t)=>{gi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r)});function cs(e){return Ta(ss,e)}var ls=j(`ZodArray`,(e,t)=>{vi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Da(t,n)),e.nonempty=t=>e.check(Da(1,t)),e.max=(t,n)=>e.check(Ea(t,n)),e.length=(t,n)=>e.check(Oa(t,n)),e.unwrap=()=>e.element});function us(e,t){return Va(ls,e,t)}var ds=j(`ZodObject`,(e,t)=>{Ci.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),M(e,`shape`,()=>t.shape),e.keyof=()=>vs(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:os()}),e.loose=()=>e.clone({...e._zod.def,catchall:os()}),e.strict=()=>e.clone({...e._zod.def,catchall:cs()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Tn(e,t),e.safeExtend=t=>En(e,t),e.merge=t=>Dn(e,t),e.pick=t=>Cn(e,t),e.omit=t=>wn(e,t),e.partial=(...t)=>On(xs,e,t[0]),e.required=(...t)=>kn(js,e,t[0])});function fs(e,t){return new ds({type:`object`,shape:e??{},...N(t)})}var ps=j(`ZodUnion`,(e,t)=>{Ti.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.options=t.options});function ms(e,t){return new ps({type:`union`,options:e,...N(t)})}var hs=j(`ZodIntersection`,(e,t)=>{Ei.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)});function gs(e,t){return new hs({type:`intersection`,left:e,right:t})}var _s=j(`ZodEnum`,(e,t)=>{ki.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new _s({...t,checks:[],...N(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new _s({...t,checks:[],...N(r),entries:i})}});function vs(e,t){return new _s({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...N(t)})}var ys=j(`ZodTransform`,(e,t)=>{Ai.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new en(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Fn(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Fn(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function bs(e){return new ys({type:`transform`,transform:e})}var xs=j(`ZodOptional`,(e,t)=>{Mi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ss(e){return new xs({type:`optional`,innerType:e})}var Cs=j(`ZodExactOptional`,(e,t)=>{Ni.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ws(e){return new Cs({type:`optional`,innerType:e})}var Ts=j(`ZodNullable`,(e,t)=>{Pi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Es(e){return new Ts({type:`nullable`,innerType:e})}var Ds=j(`ZodDefault`,(e,t)=>{Fi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Os(e,t){return new Ds({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():vn(t)}})}var ks=j(`ZodPrefault`,(e,t)=>{Li.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function As(e,t){return new ks({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():vn(t)}})}var js=j(`ZodNonOptional`,(e,t)=>{Ri.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ms(e,t){return new js({type:`nonoptional`,innerType:e,...N(t)})}var Ns=j(`ZodCatch`,(e,t)=>{Bi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ps(e,t){return new Ns({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Fs=j(`ZodPipe`,(e,t)=>{Vi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.in=t.in,e.out=t.out});function Is(e,t){return new Fs({type:`pipe`,in:e,out:t})}var Ls=j(`ZodReadonly`,(e,t)=>{Ui.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rs(e){return new Ls({type:`readonly`,innerType:e})}var zs=j(`ZodCustom`,(e,t)=>{Gi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r)});function Bs(e,t={}){return Ha(zs,e,t)}function Vs(e){return Ua(e)}fs({chartConfig:zo().describe(`Erica chart config syntax.`)});var Hs=fs({compiled_chart:fs({path:zo().describe(`Path to the chart JSON file.`)}).describe(`Compiled chart`)});fs({title:zo().describe(`Title of the report.`),reportContent:zo().describe(`Markdown content of the report.`)});var Us=fs({compiled_report:fs({title:zo().describe(`Title of the report.`),path:zo().describe(`Path to the compiled report.`)})}),Ws={get:async(e,t)=>{let{data:n}=await Gt({path:{threadId:e,filename:t},throwOnError:!0});return n}},Gs=[`bar`,`line`,`pie`,`bignumber`,`table`,`scatter`,`funnel`],Ks=/(\w+)=(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|(true|false|-?(?:\d+\.?\d*|\.\d+)))/g;function qs(e){let t={},n=new RegExp(Ks.source,Ks.flags),r;for(;(r=n.exec(e))!==null;){let e=r[2]??r[3]??r[4]??``;r[2]===void 0?r[3]!==void 0&&(e=e.replace(/\\'/g,`'`).replace(/\\\\/g,`\\`)):e=e.replace(/\\"/g,`"`).replace(/\\\\/g,`\\`),t[r[1]]=e}return t}var Js=/\{%\s*(\w+)\s+((?:(?!\/%\})[\s\S])*)\/%\}/g;function Ys(e){let t=[],n=0,r=new RegExp(Js.source,Js.flags),i;for(;(i=r.exec(e))!==null;){let[r,a,o]=i,s=i.index;s>n&&t.push({kind:`text`,content:e.slice(n,s)});let c=a.toLowerCase();if(Gs.includes(c)){let e={type:c,attrs:qs(o),raw:r};t.push({kind:`chart`,node:e})}else t.push({kind:`text`,content:r});n=s+r.length}return n<e.length&&t.push({kind:`text`,content:e.slice(n)}),t}function Xs(e,t){let n=[];switch(e){case`bar`:case`line`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.x||n.push({field:`x`,message:`x is required`}),t.y||n.push({field:`y`,message:`y is required`});break;case`pie`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.name||n.push({field:`name`,message:`name is required`}),t.value||n.push({field:`value`,message:`value is required`});break;case`bignumber`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.value||n.push({field:`value`,message:`value is required`});break;case`table`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`});break;case`scatter`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.x||n.push({field:`x`,message:`x is required`}),t.y||n.push({field:`y`,message:`y is required`});break;case`funnel`:!t.sql&&!t.data&&n.push({field:`sql`,message:`sql or data is required`}),t.name||n.push({field:`name`,message:`name is required`}),t.value||n.push({field:`value`,message:`value is required`});break}return n.length>0?{valid:!1,errors:n}:{valid:!0}}function Zs(e){if(e===void 0)return;let t=e.toLowerCase();if(t===`true`||t===`1`||t===`yes`)return!0;if(t===`false`||t===`0`||t===`no`)return!1}function Qs(e){if(e===void 0)return;let t=Number(e);return isNaN(t)?void 0:t}function $s(e){if(e===void 0)return;let t=Number(e);return isNaN(t)?e:t}function ec(e){if(e!==void 0)return e.includes(`,`)?e.split(`,`).map(e=>e.trim()):e}function tc(e){if(e!==void 0)return e.split(`,`).map(e=>e.trim())}function nc(e){if(e!==void 0)try{return JSON.parse(e)}catch{return}}function rc(e){if(e!==void 0)try{return JSON.parse(e)}catch{return}}function ic(e){let t={};for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function ac({option:e,style:t={height:`400px`,width:`100%`},settings:n={notMerge:!0},theme:r}){let i=(0,u.useRef)(null),a=(0,u.useRef)(null);return(0,u.useEffect)(()=>{i.current&&(a.current=p.init(i.current,r));let e=()=>{a.current?.resize()};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e),a.current?.dispose()}},[r]),(0,u.useEffect)(()=>{if(a.current&&e){let t={...e,grid:{left:30,right:30,top:100,bottom:50,containLabel:!0},toolbox:{show:!0,...e.toolbox,feature:{saveAsImage:{show:!0,title:`Download`,pixelRatio:2},restore:{show:!0},...e.toolbox?.feature||{}}}};a.current.setOption(t,n)}},[e,n]),(0,f.jsx)(`div`,{ref:i,style:t})}function oc({sql:e,data:t,x:n,y:r,title:i,height:a=`400px`,color:o,xAxisName:s,yAxisName:c,horizontal:l=!1,stack:d=!1,seriesNames:p}){let[m,h]=(0,u.useState)(!1),g=(0,u.useMemo)(()=>Array.isArray(r)?r:[r],[r]),_=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),v=(0,u.useMemo)(()=>{if(!_?.rows?.length)return null;let e=_.rows.map(e=>String(e[n]??``)),t=g.map(e=>({name:p?.[e]??e,type:`bar`,data:_.rows.map(t=>t[e]??null),stack:d?`total`:void 0,label:m?{show:!0,position:l?`right`:`top`}:void 0}));return ic({title:i?{text:i}:void 0,tooltip:{trigger:`axis`,axisPointer:{type:`shadow`}},toolbox:{feature:{myToggleLabels:{show:!0,title:m?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>h(e=>!e)}}},legend:g.length>1?{show:!0}:void 0,color:o?Array.isArray(o)?o:[o]:void 0,grid:{containLabel:!0},...l?{xAxis:{type:`value`,name:s},yAxis:{type:`category`,data:e,name:c}}:{xAxis:{type:`category`,data:e,name:s},yAxis:{type:`value`,name:c}},series:t})},[_,n,g,i,o,s,c,l,p,m,d]),y={height:typeof a==`number`?`${a}px`:a,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:y,className:`bar-chart-sql-warning`,children:(0,f.jsx)(`p`,{className:`bar-chart-sql-warning-text`,children:`SQL queries are not supported yet. Please provide data directly.`})}):v?(0,f.jsx)(ac,{option:v,style:y}):(0,f.jsx)(`div`,{style:y,className:`bar-chart-no-data`,children:(0,f.jsx)(`p`,{className:`bar-chart-no-data-text`,children:`No data`})})}function sc({sql:e,data:t,x:n,y:r,title:i,height:a=`400px`,color:o,xAxisName:s,yAxisName:c,smooth:l=!1,area:d=!1,seriesNames:p,secondary_y:m,secondary_title:h,prefix:g,suffix:_}){let[v,y]=(0,u.useState)(!1),b=(0,u.useMemo)(()=>Array.isArray(r)?r:[r],[r]),x=(0,u.useMemo)(()=>m?Array.isArray(m)?m:[m]:[],[m]),S=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),C=(0,u.useMemo)(()=>{if(!S?.rows?.length)return null;let e=S.rows.map(e=>String(e[n]??``)),t=b.map(e=>({name:p?.[e]??e,type:`line`,data:S.rows.map(t=>t[e]??null),smooth:l,areaStyle:d?{}:void 0,yAxisIndex:0,label:v?{show:!0,position:`top`}:void 0})),r=x.map(e=>({name:p?.[e]??e,type:`line`,data:S.rows.map(t=>t[e]??null),smooth:l,yAxisIndex:1,label:v?{show:!0,position:`top`}:void 0})),a=[...t,...r],u=x.length>0;return ic({title:i?{text:i}:void 0,tooltip:{trigger:`axis`,valueFormatter:e=>`${g||``}${String(e??``)}${_||``}`},toolbox:{feature:{myToggleLabels:{show:!0,title:v?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>y(e=>!e)}}},legend:b.length>1||u?{show:!0}:void 0,color:o?Array.isArray(o)?o:[o]:void 0,grid:{containLabel:!0},xAxis:{type:`category`,data:e,name:s},yAxis:u?[{type:`value`,name:c},{type:`value`,name:h}]:{type:`value`,name:c},series:a})},[S,n,b,x,i,o,s,c,h,l,d,p,v,g,_]),w={height:typeof a==`number`?`${a}px`:a,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:w,className:`line-chart-sql-warning`,children:(0,f.jsx)(`p`,{className:`line-chart-sql-warning-text`,children:`SQL queries are not supported yet. Please provide data directly.`})}):C?(0,f.jsx)(ac,{option:C,style:w}):(0,f.jsx)(`div`,{style:w,className:`line-chart-no-data`,children:(0,f.jsx)(`p`,{className:`line-chart-no-data-text`,children:`No data`})})}var cc={red:`#dc2626`,green:`#16a34a`,blue:`#2563eb`,yellow:`#ca8a04`,orange:`#ea580c`,purple:`#9333ea`,pink:`#db2777`,gray:`#6b7280`,black:`#111827`,white:`#ffffff`},lc=e=>{if(!e)return null;let t=e.indexOf(`|`);if(t===-1)return{text:e};let n=e.slice(0,t).trim().toLowerCase(),r=e.slice(t+1).trim();return r?{text:r,color:cc[n]??n}:{text:e}};function uc({sql:e,data:t,value:n,title:r=`Big Number`,subtitle:i,description:a,height:o=`170px`,prefix:s=``,suffix:c=``,decimals:l=0}){let d=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),p=(0,u.useMemo)(()=>d?.rows?.length?d.rows[0]?.[n]??null:null,[d,n]),m=(0,u.useMemo)(()=>{if(p==null||p===``)return`--`;let e=Number(p);return Number.isNaN(e)?String(p):`${s}${e.toLocaleString(void 0,{minimumFractionDigits:l,maximumFractionDigits:l})}${c}`},[p,s,c,l]),h=(0,u.useMemo)(()=>lc(r),[r]),g=(0,u.useMemo)(()=>lc(i),[i]),_=(0,u.useMemo)(()=>lc(a),[a]),v=(0,u.useMemo)(()=>lc(m),[m]);return e&&!t?(0,f.jsx)(`div`,{className:`big-number-warning`,children:(0,f.jsx)(`p`,{className:`big-number-warning-text`,children:`SQL queries are not supported yet. Please provide data directly.`})}):(0,f.jsxs)(`div`,{className:`big-number-container`,children:[(0,f.jsxs)(`div`,{className:`big-number-header`,children:[(0,f.jsx)(`p`,{className:`big-number-title`,style:h?.color?{color:h.color}:void 0,children:h?.text??r}),g?(0,f.jsx)(`p`,{className:`big-number-subtitle`,style:g.color?{color:g.color}:void 0,children:g.text}):null]}),(0,f.jsxs)(`div`,{className:`big-number-value-section`,children:[(0,f.jsx)(`p`,{className:`big-number-value`,style:v?.color?{color:v.color}:void 0,children:v?.text??m}),_?(0,f.jsx)(`p`,{className:`big-number-description`,style:_.color?{color:_.color}:void 0,children:_.text}):null]})]})}function dc({sql:e,data:t,name:n,value:r,title:i,height:a=`400px`,showLabels:o=!0,showLegend:s=!1,sort:c=`descending`}){let[l,d]=(0,u.useState)(o),[p,m]=(0,u.useState)(s),h=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),g=(0,u.useMemo)(()=>{if(!h?.rows?.length)return null;let e=h.rows.map(e=>({name:String(e[n]??``),value:Number(e[r]??0)}));return ic({title:i?{text:i}:void 0,tooltip:{trigger:`item`,formatter:`{b}: {c}`},toolbox:{feature:{myToggleLabels:{show:!0,title:l?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>d(e=>!e)},myToggleLegend:{show:!0,title:p?`Hide Legend`:`Show Legend`,icon:`path://M4 6h16M4 12h16M4 18h16`,onclick:()=>m(e=>!e)}}},legend:p?{show:!0,top:`bottom`}:void 0,series:[{type:`funnel`,left:`10%`,top:60,bottom:20,width:`80%`,min:0,minSize:`0%`,maxSize:`100%`,sort:c,gap:4,label:{show:l,position:`inside`,formatter:`{b}: {c}`},emphasis:{label:{fontSize:14}},data:e}]})},[h,n,r,i,c,l,p]),_={height:typeof a==`number`?`${a}px`:a,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:_,className:`funnel-chart-sql-warning`,children:(0,f.jsx)(`p`,{className:`funnel-chart-sql-warning-text`,children:`SQL queries are not supported yet. Please provide data directly.`})}):g?(0,f.jsx)(ac,{option:g,style:_}):(0,f.jsx)(`div`,{style:_,className:`funnel-chart-no-data`,children:(0,f.jsx)(`p`,{className:`funnel-chart-no-data-text`,children:`No data`})})}var fc=e=>e==null||e===``?`—`:typeof e==`object`?JSON.stringify(e):String(e);function pc({sql:e,data:t,title:n,height:r=`400px`,columns:i,maxRows:a}){let o=(0,u.useMemo)(()=>{if(t){let e=t;return{rows:e,columns:e.length>0?Object.keys(e[0]):[]}}return null},[t]),s=(0,u.useMemo)(()=>{let e=o?.columns?.length?o.columns:[];return i?.length?i.filter(t=>e.includes(t)):e},[o,i]),c=(0,u.useMemo)(()=>{let e=o?.rows??[];return!a||a<=0?e:e.slice(0,a)},[o,a]),l={height:typeof r==`number`?`${r}px`:r,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:{...l,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`table-chart-sql-warning`,children:(0,f.jsx)(`p`,{className:`table-chart-sql-warning-text`,children:`SQL queries are not supported yet. Please provide data directly.`})}):!s.length||!c.length?(0,f.jsx)(`div`,{style:{...l,display:`flex`,alignItems:`center`,justifyContent:`center`},className:`table-chart-no-data`,children:(0,f.jsx)(`p`,{className:`table-chart-no-data-text`,children:`No data`})}):(0,f.jsxs)(`div`,{style:l,className:`table-chart-container`,children:[n?(0,f.jsx)(`div`,{className:`table-chart-title-wrapper`,children:(0,f.jsx)(`p`,{className:`table-chart-title`,children:n})}):null,(0,f.jsx)(`div`,{className:`table-chart-table-wrapper`,children:(0,f.jsxs)(`table`,{className:`table-chart-table`,children:[(0,f.jsx)(`thead`,{className:`table-chart-thead`,children:(0,f.jsx)(`tr`,{children:s.map(e=>(0,f.jsx)(`th`,{className:`table-chart-th`,children:e},e))})}),(0,f.jsx)(`tbody`,{children:c.map((e,t)=>(0,f.jsx)(`tr`,{className:`table-chart-tr`,children:s.map(n=>(0,f.jsx)(`td`,{className:`table-chart-td`,children:(0,f.jsx)(`div`,{className:`table-chart-cell-content`,children:fc(e[n])})},`${t}-${n}`))},String(e._erica_id??t)))})]})})]})}function mc({sql:e,data:t,name:n,value:r,title:i,height:a=`400px`,donut:o=!1,showLabels:s=!0,showLegend:c=!0}){let[l,d]=(0,u.useState)(s),[p,m]=(0,u.useState)(c),h=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),g=(0,u.useMemo)(()=>{if(!h?.rows?.length)return null;let e=h.rows.map(e=>({name:String(e[n]??``),value:Number(e[r]??0)}));return ic({title:i?{text:i}:void 0,tooltip:{trigger:`item`,formatter:`{a} <br/>{b}: {c} ({d}%)`},toolbox:{feature:{myToggleLabels:{show:!0,title:l?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>d(e=>!e)},myToggleLegend:{show:!0,title:p?`Hide Legend`:`Show Legend`,icon:`path://M4 6h16M4 12h16M4 18h16`,onclick:()=>m(e=>!e)}}},legend:p?{show:!0,orient:`vertical`,left:`left`}:void 0,series:[{name:i??`Data`,type:`pie`,radius:o?[`40%`,`70%`]:`70%`,data:e,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:`rgba(0, 0, 0, 0.5)`}},label:{show:l,formatter:`{b}: {c} ({d}%)`}}]})},[h,n,r,i,o,l,p]),_={height:typeof a==`number`?`${a}px`:a,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:_,className:`pie-chart-sql-warning`,children:(0,f.jsx)(`p`,{className:`pie-chart-sql-warning-text`,children:`SQL queries are not supported yet. Please provide data directly.`})}):g?(0,f.jsx)(ac,{option:g,style:_}):(0,f.jsx)(`div`,{style:_,className:`pie-chart-no-data`,children:(0,f.jsx)(`p`,{className:`pie-chart-no-data-text`,children:`No data`})})}function hc({sql:e,data:t,x:n,y:r,seriesBy:i,size:a,color:o,title:s,height:c=`400px`,xAxisName:l,yAxisName:d,seriesNames:p}){let[m,h]=(0,u.useState)(!1),g=(0,u.useMemo)(()=>Array.isArray(r)?r:[r],[r]),_=(0,u.useMemo)(()=>t?{rows:t}:null,[t]),v=(0,u.useMemo)(()=>{if(!_?.rows?.length)return null;let e=(e,t)=>{let r=[Number(e[n]??0),Number(e[t]??0)];return a&&r.push(Number(e[a]??0)),o&&r.push(String(e[o]??``)),r},t=i?_.rows.reduce((e,t)=>{let n=String(t[i]??`Unknown`);return e[n]||(e[n]=[]),e[n].push(t),e},{}):null,r=(e,t)=>({name:t,type:`scatter`,symbolSize:a?e=>Math.sqrt(e[2])*2:10,data:e,label:m?{show:!0,formatter:e=>{let t=e.value;return`${t[0]}, ${t[1]}`}}:void 0,itemStyle:o?{color:e=>{let t=e.value,n=t[t.length-1],r=[`#5470c6`,`#91cc75`,`#fac858`,`#ee6666`,`#73c0de`,`#3ba272`,`#fc8452`,`#9a60b4`,`#ea7ccc`];return r[n.split(``).reduce((e,t)=>e+t.charCodeAt(0),0)%r.length]}}:void 0}),c=t?Object.entries(t).flatMap(([t,n])=>g.map(i=>{let a=p?.[t]??t,o=p?.[i]??i,s=g.length>1?`${a} - ${o}`:a;return r(n.map(t=>e(t,i)),s)})):g.map(t=>r(_.rows.map(n=>e(n,t)),p?.[t]??t));return ic({title:s?{text:s}:void 0,tooltip:{trigger:`item`,formatter:e=>{let t=e.value,r=`${e.seriesName?`${e.seriesName}<br/>`:``}${n}: ${t[0]}<br/>${d??`Value`}: ${t[1]}`,i=2;return a&&(r+=`<br/>${a}: ${t[i++]}`),o&&(r+=`<br/>${o}: ${t[i]}`),r}},toolbox:{feature:{myToggleLabels:{show:!0,title:m?`Hide Labels`:`Show Labels`,icon:`path://M3 3h18v18H3z M6 6h12v2H6z M6 10h8v2H6z`,onclick:()=>h(e=>!e)}}},xAxis:{type:`value`,name:l,scale:!0},yAxis:{type:`value`,name:d,scale:!0},legend:c.length>1?{show:!0}:void 0,series:c})},[_,n,g,i,a,o,s,l,d,m,p]),y={height:typeof c==`number`?`${c}px`:c,width:`100%`};return e&&!t?(0,f.jsx)(`div`,{style:y,className:`scatter-chart-sql-warning`,children:(0,f.jsx)(`p`,{className:`scatter-chart-sql-warning-text`,children:`SQL queries are not supported yet. Please provide data directly.`})}):v?(0,f.jsx)(ac,{option:v,style:y}):(0,f.jsx)(`div`,{style:y,className:`scatter-chart-no-data`,children:(0,f.jsx)(`p`,{className:`scatter-chart-no-data-text`,children:`No data`})})}function gc({type:e,errors:t}){return(0,f.jsxs)(`div`,{className:`erica-chart-error`,children:[(0,f.jsxs)(`p`,{className:`erica-chart-error-title`,children:[`Erica Chart syntax error — `,(0,f.jsx)(`code`,{children:e})]}),(0,f.jsx)(`ul`,{className:`erica-chart-error-list`,children:t.map(e=>(0,f.jsx)(`li`,{className:`erica-chart-error-item`,children:e.message},e.field))})]})}function _c(e){let{type:t,attrs:n}=e,r=Xs(t,n);if(!r.valid)return(0,f.jsx)(gc,{type:t,errors:r.errors});switch(t){case`bar`:return(0,f.jsx)(oc,{sql:n.sql,data:rc(n.data),x:n.x,y:ec(n.y)??n.y,title:n.title,height:$s(n.height),color:ec(n.color),xAxisName:n.xAxisName,yAxisName:n.yAxisName,horizontal:Zs(n.horizontal),stack:Zs(n.stack),seriesNames:nc(n.seriesNames)});case`line`:return(0,f.jsx)(sc,{sql:n.sql,data:rc(n.data),x:n.x,y:ec(n.y)??n.y,title:n.title,height:$s(n.height),color:ec(n.color),xAxisName:n.xAxisName||n.x_title,yAxisName:n.yAxisName||n.y_title,smooth:Zs(n.smooth),area:Zs(n.area),seriesNames:nc(n.seriesNames),secondary_y:ec(n.secondary_y),secondary_title:n.secondary_title,prefix:n.prefix,suffix:n.suffix});case`bignumber`:return(0,f.jsx)(uc,{sql:n.sql,data:rc(n.data),value:n.value,title:n.title,subtitle:n.subtitle,description:n.description,height:$s(n.height),prefix:n.prefix,suffix:n.suffix,decimals:Qs(n.decimals)});case`funnel`:return(0,f.jsx)(dc,{sql:n.sql,data:rc(n.data),name:n.name||n.label||n.stage||n.x,value:n.value||n.y,title:n.title,height:$s(n.height),showLabels:Zs(n.showLabels),showLegend:Zs(n.showLegend),sort:n.sort});case`scatter`:return(0,f.jsx)(hc,{sql:n.sql,data:rc(n.data),x:n.x,y:ec(n.y)??n.y,seriesBy:n.seriesBy,size:n.size,color:n.color,title:n.title,height:$s(n.height),xAxisName:n.xAxisName,yAxisName:n.yAxisName,seriesNames:nc(n.seriesNames)});case`pie`:return(0,f.jsx)(mc,{sql:n.sql,data:rc(n.data),name:n.name||n.label||n.x,value:n.value||n.y,title:n.title,height:$s(n.height),donut:Zs(n.donut),showLabels:Zs(n.showLabels),showLegend:Zs(n.showLegend)});case`table`:return(0,f.jsx)(pc,{sql:n.sql,data:rc(n.data),title:n.title,height:$s(n.height),columns:tc(n.columns),maxRows:Qs(n.maxRows)});default:return(0,f.jsxs)(`div`,{className:`erica-chart-unimplemented`,children:[(0,f.jsxs)(`div`,{className:`erica-chart-unimplemented-title`,children:[`Chart type "`,t,`" not implemented yet`]}),(0,f.jsx)(`pre`,{className:`erica-chart-unimplemented-pre`,children:JSON.stringify(n,null,2)})]})}}function vc({markdown:e}){return(0,f.jsx)(`div`,{className:`erica-chart-container`,children:(0,u.useMemo)(()=>Ys(e),[e]).map((e,t)=>e.kind===`text`?e.content.trim()?(0,f.jsx)(`div`,{className:`erica-chart-text`,children:e.content},t):null:(0,f.jsx)(`div`,{className:`erica-chart-wrapper`,children:_c(e.node)},t))})}function yc({chartConfig:e}){return(0,f.jsx)(`div`,{className:`chart-card-container`,children:(0,f.jsx)(vc,{markdown:e})})}function bc({path:e}){let t=(0,u.useContext)(Zt)?.threadId||``,{data:n,isLoading:r}=Lt({queryKey:[`artifact`,t,e],queryFn:async()=>await Ws.get(t,e),enabled:!!t&&!!e});return r?(0,f.jsx)(`div`,{className:`chart-loader-loading`,children:`loading chart...`}):n?(0,f.jsx)(yc,{chartConfig:n}):(0,f.jsx)(`div`,{className:`chart-loader-no-data`,children:`No chart data available`})}var xc=(0,u.createContext)(null);function Sc({children:e}){let[t,n]=(0,u.useState)(!1),[r,i]=(0,u.useState)(null),[a,o]=(0,u.useState)(`Artifacts`);return(0,f.jsx)(xc.Provider,{value:{isOpen:t,onOpen:()=>n(!0),onClose:()=>n(!1),content:r,setContent:i,title:a,setTitle:o},children:e})}var Cc=()=>(0,u.useContext)(xc)||{isOpen:!1,onOpen:()=>{},onClose:()=>{},content:null,setContent:()=>{},title:`Artifacts`,setTitle:()=>{}};function wc(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Tc=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ec=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dc={};function Oc(e,t){return((t||Dc).jsx?Ec:Tc).test(e)}var kc=/[ \t\n\f\r]/g;function Ac(e){return typeof e==`object`?e.type===`text`?jc(e.value):!1:jc(e)}function jc(e){return e.replace(kc,``)===``}var Mc=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Mc.prototype.normal={},Mc.prototype.property={},Mc.prototype.space=void 0;function Nc(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Mc(n,r,t)}function Pc(e){return e.toLowerCase()}var B=class{constructor(e,t){this.attribute=t,this.property=e}};B.prototype.attribute=``,B.prototype.booleanish=!1,B.prototype.boolean=!1,B.prototype.commaOrSpaceSeparated=!1,B.prototype.commaSeparated=!1,B.prototype.defined=!1,B.prototype.mustUseProperty=!1,B.prototype.number=!1,B.prototype.overloadedBoolean=!1,B.prototype.property=``,B.prototype.spaceSeparated=!1,B.prototype.space=void 0;var Fc=s({boolean:()=>V,booleanish:()=>H,commaOrSpaceSeparated:()=>zc,commaSeparated:()=>Rc,number:()=>U,overloadedBoolean:()=>Lc,spaceSeparated:()=>W}),Ic=0,V=Bc(),H=Bc(),Lc=Bc(),U=Bc(),W=Bc(),Rc=Bc(),zc=Bc();function Bc(){return 2**++Ic}var Vc=Object.keys(Fc),Hc=class extends B{constructor(e,t,n,r){let i=-1;if(super(e,t),Uc(this,`space`,r),typeof n==`number`)for(;++i<Vc.length;){let e=Vc[i];Uc(this,Vc[i],(n&Fc[e])===Fc[e])}}};Hc.prototype.defined=!0;function Uc(e,t,n){n&&(e[t]=n)}function Wc(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Hc(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Pc(r)]=r,n[Pc(a.attribute)]=r}return new Mc(t,n,e.space)}var Gc=Wc({properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:H,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:W,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:U,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:W,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:H,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Kc(e,t){return t in e?e[t]:t}function qc(e,t){return Kc(e,t.toLowerCase())}var Jc=Wc({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Rc,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:W,autoFocus:V,autoPlay:V,blocking:W,capture:null,charSet:null,checked:V,cite:null,className:W,cols:U,colSpan:null,content:null,contentEditable:H,controls:V,controlsList:W,coords:U|Rc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:Lc,draggable:H,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:W,height:U,hidden:Lc,high:U,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:W,itemRef:W,itemScope:V,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:V,optimum:U,pattern:null,ping:W,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:W,required:V,reversed:V,rows:U,rowSpan:U,sandbox:W,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:H,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:H,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:H,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:V,disableRemotePlayback:V,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:qc}),Yc=Wc({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:zc,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:W,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Rc,g2:Rc,glyphName:Rc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:zc,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zc,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zc,rev:zc,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zc,requiredFeatures:zc,requiredFonts:zc,requiredFormats:zc,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:zc,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zc,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zc,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Kc}),Xc=Wc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Zc=Wc({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:qc}),Qc=Wc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),$c={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},el=/[A-Z]/g,tl=/-[a-z]/g,nl=/^data[-\w.:]+$/i;function rl(e,t){let n=Pc(t),r=t,i=B;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&nl.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(tl,al);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!tl.test(e)){let n=e.replace(el,il);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Hc}return new i(r,t)}function il(e){return`-`+e.toLowerCase()}function al(e){return e.charAt(1).toUpperCase()}var ol=Nc([Gc,Jc,Xc,Zc,Qc],`html`),sl=Nc([Gc,Yc,Xc,Zc,Qc],`svg`);function cl(e){return e.join(` `).trim()}var ll=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
45
45
|
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function ee(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),ee()}function _(e){return e?e.replace(l,p):p}t.exports=g})),ul=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(ll());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),dl=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),fl=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ul()),r=dl();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),pl=hl(`end`),ml=hl(`start`);function hl(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function gl(e){let t=ml(e),n=pl(e);if(t&&n)return{start:t,end:n}}function _l(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?yl(e.position):`start`in e||`end`in e?yl(e):`line`in e||`column`in e?vl(e):``}function vl(e){return bl(e&&e.line)+`:`+bl(e&&e.column)}function yl(e){return vl(e&&e.start)+`-`+vl(e&&e.end)}function bl(e){return e&&typeof e==`number`?e:1}var G=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=_l(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};G.prototype.file=``,G.prototype.name=``,G.prototype.reason=``,G.prototype.message=``,G.prototype.stack=``,G.prototype.column=void 0,G.prototype.line=void 0,G.prototype.ancestors=void 0,G.prototype.cause=void 0,G.prototype.fatal=void 0,G.prototype.place=void 0,G.prototype.ruleId=void 0,G.prototype.source=void 0;var xl=l(fl(),1),Sl={}.hasOwnProperty,Cl=new Map,wl=/[A-Z]/g,Tl=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),El=new Set([`td`,`th`]),Dl=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ol(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=zl(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Rl(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?sl:ol,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=kl(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function kl(e,t,n){if(t.type===`element`)return Al(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return jl(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Nl(e,t,n);if(t.type===`mdxjsEsm`)return Ml(e,t);if(t.type===`root`)return Pl(e,t,n);if(t.type===`text`)return Fl(e,t)}function Al(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=sl,e.schema=i),e.ancestors.push(t);let a=Gl(e,t.tagName,!1),o=Bl(e,t),s=Hl(e,t);return Tl.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Ac(e):!0})),Il(e,o,a,t),Ll(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function jl(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Kl(e,t.position)}function Ml(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Kl(e,t.position)}function Nl(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=sl,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Gl(e,t.name,!0),o=Vl(e,t),s=Hl(e,t);return Il(e,o,a,t),Ll(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Pl(e,t,n){let r={};return Ll(r,Hl(e,t)),e.create(t,e.Fragment,r,n)}function Fl(e,t){return t.value}function Il(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ll(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Rl(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function zl(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ml(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Bl(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Sl.call(t.properties,i)){let a=Ul(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&El.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Vl(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Kl(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Kl(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Hl(e,t){let n=[],r=-1,i=e.passKeys?new Map:Cl;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=kl(e,a,o);s!==void 0&&n.push(s)}return n}function Ul(e,t,n){let r=rl(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wc(n):cl(n)),r.property===`style`){let t=typeof n==`object`?n:Wl(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ql(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?$c[r.property]||r.property:r.attribute,n]}}function Wl(e,t){try{return(0,xl.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new G("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Dl+`#cannot-parse-style-attribute`,r}}function Gl(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Oc(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Oc(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Sl.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Kl(e)}function Kl(e,t){let n=new G("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Dl+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ql(e){let t={},n;for(n in e)Sl.call(e,n)&&(t[Jl(n)]=e[n]);return t}function Jl(e){let t=e.replace(wl,Yl);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Yl(e){return`-`+e.toLowerCase()}var Xl={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Zl={};function Ql(e,t){let n=t||Zl;return $l(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function $l(e,t,n){if(tu(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return eu(e.children,t,n)}return Array.isArray(e)?eu(e,t,n):``}function eu(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=$l(e[i],t,n);return r.join(``)}function tu(e){return!!(e&&typeof e==`object`)}var nu=document.createElement(`i`);function ru(e){let t=`&`+e+`;`;nu.innerHTML=t;let n=nu.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function K(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function iu(e,t){return e.length>0?(K(e,e.length,0,t),e):t}var au={}.hasOwnProperty;function ou(e){let t={},n=-1;for(;++n<e.length;)su(t,e[n]);return t}function su(e,t){let n;for(n in t){let r=(au.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){au.call(r,a)||(r[a]=[]);let e=i[a];cu(r[a],Array.isArray(e)?e:e?[e]:[])}}}function cu(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);K(e,0,0,r)}function lu(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function uu(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var q=vu(/[A-Za-z]/),J=vu(/[\dA-Za-z]/),du=vu(/[#-'*+\--9=?A-Z^-~]/);function fu(e){return e!==null&&(e<32||e===127)}var pu=vu(/\d/),mu=vu(/[\dA-Fa-f]/),hu=vu(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var gu=vu(/\p{P}|\p{S}/u),_u=vu(/\s/);function vu(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function yu(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&J(e.charCodeAt(n+1))&&J(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var bu={tokenize:xu};function xu(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Su={tokenize:wu},Cu={tokenize:Tu};function wu(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return K(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Cu,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Cu,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;K(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Tu(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Eu(e){if(e===null||X(e)||_u(e))return 1;if(gu(e))return 2}function Du(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Ou={name:`attention`,resolveAll:ku,tokenize:Au};function ku(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};ju(d,-c),ju(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=iu(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=iu(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=iu(l,Du(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=iu(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=iu(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,K(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Au(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Eu(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Eu(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ju(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Mu={name:`autolink`,tokenize:Nu};function Nu(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return q(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||J(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||J(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||fu(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):du(t)?(e.consume(t),l):n(t)}function u(e){return J(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||J(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Pu={partial:!0,tokenize:Fu};function Fu(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var Iu={continuation:{tokenize:Ru},exit:zu,name:`blockQuote`,tokenize:Lu};function Lu(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ru(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Iu,t,n)(r)}}function zu(e){e.exit(`blockQuote`)}var Bu={name:`characterEscape`,tokenize:Vu};function Vu(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return hu(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Hu={name:`characterReference`,tokenize:Uu};function Uu(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=J,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=mu,u):(e.enter(`characterReferenceValue`),a=7,o=pu,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===J&&!ru(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Wu={partial:!0,tokenize:qu},Gu={concrete:!0,name:`codeFenced`,tokenize:Ku};function Ku(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Wu,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(Wu,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function qu(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Ju={name:`codeIndented`,tokenize:Xu},Yu={partial:!0,tokenize:Zu};function Xu(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(Yu,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Zu(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}var Qu={name:`codeText`,previous:ed,resolve:$u,tokenize:td};function $u(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ed(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function td(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var nd=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&rd(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),rd(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),rd(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);rd(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);rd(this.left,t.reverse())}}};function rd(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function id(e){let t={},n=-1,r,i,a,o,s,c,l,u=new nd(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,ad(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return K(e,0,1/0,u.slice(0)),!l}function ad(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var od={resolve:cd,tokenize:ld},sd={partial:!0,tokenize:ud};function cd(e){return id(e),e}function ld(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(sd,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ud(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function dd(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||fu(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||fu(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function fd(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function pd(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function md(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var hd={name:`definition`,tokenize:_d},gd={partial:!0,tokenize:vd};function _d(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return fd.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=uu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?md(e,l)(t):l(t)}function l(t){return dd(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(gd,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function vd(e,t,n){return r;function r(t){return X(t)?md(e,i)(t):n(t)}function i(t){return pd(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var yd={name:`hardBreakEscape`,tokenize:bd};function bd(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var xd={name:`headingAtx`,resolve:Sd,tokenize:Cd};function Sd(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},K(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Cd(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var wd=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Td=[`pre`,`script`,`style`,`textarea`],Ed={concrete:!0,name:`htmlFlow`,resolveTo:kd,tokenize:Ad},Dd={partial:!0,tokenize:Md},Od={partial:!0,tokenize:jd};function kd(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ad(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ce):q(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):q(a)?(e.consume(a),i=4,r.interrupt?t:ce):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ce):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return q(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Td.includes(l)?(i=1,r.interrupt?t(s):D(s)):wd.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||J(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||q(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Y(t)?D(t):Z(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),ae):t===62&&i===4?(e.consume(t),le):t===63&&i===3?(e.consume(t),ce):t===93&&i===5?(e.consume(t),se):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Dd,ue,te)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(Od,ne,ue)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||Y(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),ce):D(t)}function ae(t){return t===47?(e.consume(t),o=``,oe):D(t)}function oe(t){if(t===62){let n=o.toLowerCase();return Td.includes(n)?(e.consume(t),le):D(t)}return q(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),oe):D(t)}function se(t){return t===93?(e.consume(t),ce):D(t)}function ce(t){return t===62?(e.consume(t),le):t===45&&i===2?(e.consume(t),ce):D(t)}function le(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),ue(t)):(e.consume(t),le)}function ue(n){return e.exit(`htmlFlow`),t(n)}}function jd(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Md(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Pu,t,n)}}var Nd={name:`htmlText`,tokenize:Pd};function Pd(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):q(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):q(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,ae(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,ae(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):Y(t)?(o=v,ae(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,ae(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return q(t)?(e.consume(t),S):n(t)}function S(t){return t===45||J(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,ae(t)):Z(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||J(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||q(t)?(e.consume(t),E):Y(t)?(o=T,ae(t)):Z(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):Y(t)?(o=ee,ae(t)):Z(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):Y(t)?(o=D,ae(t)):Z(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):Y(t)?(o=te,ae(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||X(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ae(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),oe}function oe(t){return Z(t)?Q(e,se,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):se(t)}function se(t){return e.enter(`htmlTextData`),o(t)}}var Fd={name:`labelEnd`,resolveAll:zd,resolveTo:Bd,tokenize:Vd},Id={tokenize:Hd},Ld={tokenize:Ud},Rd={tokenize:Wd};function zd(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&K(e,0,e.length,n),e}function Bd(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=iu(s,e.slice(a+1,a+r+3)),s=iu(s,[[`enter`,u,t]]),s=iu(s,Du(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=iu(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=iu(s,e.slice(o+1)),s=iu(s,[[`exit`,c,t]]),K(e,a,e.length,s),e}function Vd(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(uu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Id,u,o?u:d)(t):t===91?e.attempt(Ld,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Rd,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Hd(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?md(e,a)(t):a(t)}function a(t){return t===41?u(t):dd(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?md(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?pd(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?md(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Ud(e,t,n){let r=this;return i;function i(t){return fd.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(uu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Wd(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Gd={name:`labelStartImage`,resolveAll:Fd.resolveAll,tokenize:Kd};function Kd(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var qd={name:`labelStartLink`,resolveAll:Fd.resolveAll,tokenize:Jd};function Jd(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Yd={name:`lineEnding`,tokenize:Xd};function Xd(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var Zd={name:`thematicBreak`,tokenize:Qd};function Qd(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var $={continuation:{tokenize:nf},exit:af,name:`list`,tokenize:tf},$d={partial:!0,tokenize:of},ef={partial:!0,tokenize:rf};function tf(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:pu(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Zd,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return pu(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Pu,r.interrupt?n:u,e.attempt($d,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function nf(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Pu,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ef,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt($,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function rf(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function af(e){e.exit(this.containerState.type)}function of(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var sf={name:`setextUnderline`,resolveTo:cf,tokenize:lf};function cf(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function lf(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var uf={tokenize:df};function df(e){let t=this,n=e.attempt(Pu,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(od,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ff={resolveAll:gf()},pf=hf(`string`),mf=hf(`text`);function hf(e){return{resolveAll:gf(e===`text`?_f:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function gf(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function _f(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var vf=s({attentionMarkers:()=>Ef,contentInitial:()=>bf,disable:()=>Df,document:()=>yf,flow:()=>Sf,flowInitial:()=>xf,insideSpan:()=>Tf,string:()=>Cf,text:()=>wf}),yf={42:$,43:$,45:$,48:$,49:$,50:$,51:$,52:$,53:$,54:$,55:$,56:$,57:$,62:Iu},bf={91:hd},xf={[-2]:Ju,[-1]:Ju,32:Ju},Sf={35:xd,42:Zd,45:[sf,Zd],60:Ed,61:sf,95:Zd,96:Gu,126:Gu},Cf={38:Hu,92:Bu},wf={[-5]:Yd,[-4]:Yd,[-3]:Yd,33:Gd,38:Hu,42:Ou,60:[Mu,Nd],91:qd,92:[yd,Bu],93:Fd,95:Ou,96:Qu},Tf={null:[Ou,ff]},Ef={null:[42,95]},Df={null:[]};function Of(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=iu(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Du(a,l.events,l),l.events):[]}function f(e,t){return Af(p(e),t)}function p(e){return kf(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&K(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function kf(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Af(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
46
46
|
`;break;case-3:o=`\r
|
|
47
47
|
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function jf(e){let t={constructs:ou([vf,...(e||{}).extensions||[]]),content:n(bu),defined:[],document:n(Su),flow:n(uf),lazy:{},string:n(pf),text:n(mf)};return t;function n(e){return n;function n(n){return Of(t,e,n)}}}function Mf(e){for(;!id(e););return e}var Nf=/[\0\t\n\r]/g;function Pf(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Nf.lastIndex=u,c=Nf.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Ff=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function If(e){return e.replace(Ff,Lf)}function Lf(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return lu(n.slice(t?2:1),t?16:10)}return ru(n)||e}var Rf={}.hasOwnProperty;function zf(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Bf(n)(Mf(jf(n).document().write(Pf()(e,t,!0))))}function Bf(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(k),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(Se),blockQuote:a(ve),characterEscape:T,characterReference:T,codeFenced:a(ye),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ye,o),codeText:a(be,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(xe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(O),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(we,o),htmlFlowData:T,htmlText:a(we,o),htmlTextData:T,image:a(Te),label:o,link:a(k),listItem:a(De),listItemValue:f,listOrdered:a(Ee,d),listUnordered:a(Ee),paragraph:a(Oe),reference:de,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Se),strong:a(ke),thematicBreak:a(je)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:_e,autolinkProtocol:ge,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:me,characterReference:he,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(ae),label:se,labelText:oe,lineEnding:ee,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:fe,resourceDestinationString:ce,resourceTitleString:le,resource:ue,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Hf(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Rf.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Wf).call(a,void 0,e[0])}for(r.position={start:Vf(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Vf(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Vf(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Wf).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+_l({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Vf(e.end)}function u(){return Ql(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=uu(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ae(),n.position={start:Vf(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Vf(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Vf(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function oe(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=If(t),n.identifier=uu(t).toLowerCase()}function se(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function le(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ue(){this.data.inReference=void 0}function de(){this.data.referenceType=`collapsed`}function fe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=uu(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function pe(e){this.data.characterReferenceType=e.type}function me(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=lu(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ru(t);let i=this.stack[this.stack.length-1];i.value+=r}function he(e){let t=this.stack.pop();t.position.end=Vf(e.end)}function ge(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function _e(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ve(){return{type:`blockquote`,children:[]}}function ye(){return{type:`code`,lang:null,meta:null,value:``}}function be(){return{type:`inlineCode`,value:``}}function xe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function O(){return{type:`emphasis`,children:[]}}function Se(){return{type:`heading`,depth:0,children:[]}}function Ce(){return{type:`break`}}function we(){return{type:`html`,value:``}}function Te(){return{type:`image`,title:null,url:``,alt:null}}function k(){return{type:`link`,title:null,url:``,children:[]}}function Ee(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function De(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Oe(){return{type:`paragraph`,children:[]}}function ke(){return{type:`strong`,children:[]}}function Ae(){return{type:`text`,value:``}}function je(){return{type:`thematicBreak`}}}function Vf(e){return{line:e.line,column:e.column,offset:e.offset}}function Hf(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Hf(e,r):Uf(e,r)}}function Uf(e,t){let n;for(n in t)if(Rf.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Wf(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+_l({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_l({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+_l({start:t.start,end:t.end})+`) is still open`)}function Gf(e){let t=this;t.parser=n;function n(n){return zf(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Kf(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function qf(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
@@ -73,5 +73,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
73
73
|
`,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{before:`[^:]`,character:`:`,after:`[A-Za-z]`,inConstruct:[`phrasing`]},{atBreak:!0,character:`:`,after:`:`}]};function n(e,t,n,i){let a=n.createTracker(i),o=Bv(e),s=n.enter(e.type),c=a.move(o+(e.name||``)),l;if(e.type===`containerDirective`){let t=(e.children||[])[0];l=zv(t)?t:void 0}else l=e;if(l&&l.children&&l.children.length>0){let t=n.enter(`label`),r=`${e.type}Label`,i=n.enter(r);c+=a.move(`[`),c+=a.move(n.containerPhrasing(l,{...a.current(),before:c,after:`]`})),c+=a.move(`]`),i(),t()}if(c+=a.move(r(e,n)),e.type===`containerDirective`){let t=(e.children||[])[0],r=e;zv(t)&&(r=Object.assign({},e,{children:e.children.slice(1)})),r&&r.children&&r.children.length>0&&(c+=a.move(`
|
|
74
74
|
`),c+=a.move(n.containerFlow(r,a.current()))),c+=a.move(`
|
|
75
75
|
`+o)}return s(),c}function r(e,n){let r=e.attributes||{},a=[],o,s,c,l;for(l in r)if(vv.call(r,l)&&r[l]!==void 0&&r[l]!==null){let u=String(r[l]);if(l===`id`)c=t.preferShortcut!==!1&&bv.test(u)?`#`+u:i(`id`,u,e,n);else if(l===`class`){let r=u.split(/[\t\n\r ]+/g),a=[],c=[],l=-1;for(;++l<r.length;)(t.preferShortcut!==!1&&bv.test(r[l])?c:a).push(r[l]);o=a.length>0?i(`class`,a.join(` `),e,n):``,s=c.length>0?`.`+c.join(`.`):``}else a.push(i(l,u,e,n))}return o&&a.unshift(o),s&&a.unshift(s),c&&a.unshift(c),a.length>0?`{`+a.join(` `)+`}`:``}function i(e,n,r,i){if(t.collapseEmptyAttributes!==!1&&!n)return e;if(t.preferUnquoted&&xv.test(n))return e+`=`+n;let a=t.quote||i.options.quote||`"`,o=a===`"`?`'`:`"`,s=t.quoteSmart&&Qm(n,a)>Qm(n,o)?o:a,c=r.type===`textDirective`?[s]:[s,`
|
|
76
|
-
`,`\r`];return e+`=`+s+_v(n,{subset:c})+s}}function wv(e){Dv.call(this,`containerDirective`,e)}function Tv(e){Dv.call(this,`leafDirective`,e)}function Ev(e){Dv.call(this,`textDirective`,e)}function Dv(e,t){this.enter({type:e,name:``,attributes:{},children:[]},t)}function Ov(e){let t=this.stack[this.stack.length-1];t.type===`containerDirective`||t.type===`leafDirective`||t.type,t.name=this.sliceSerialize(e)}function kv(e){this.enter({type:`paragraph`,data:{directiveLabel:!0},children:[]},e)}function Av(e){this.exit(e)}function jv(){this.data.directiveAttributes=[],this.buffer()}function Mv(e){this.data.directiveAttributes.push([`id`,av(this.sliceSerialize(e),{attribute:!0})])}function Nv(e){this.data.directiveAttributes.push([`class`,av(this.sliceSerialize(e),{attribute:!0})])}function Pv(e){let t=this.data.directiveAttributes;t[t.length-1][1]=av(this.sliceSerialize(e),{attribute:!0})}function Fv(e){this.data.directiveAttributes.push([this.sliceSerialize(e),``])}function Iv(){let e=this.data.directiveAttributes,t={},n=-1;for(;++n<e.length;){let r=e[n];r[0]===`class`&&t.class?t.class+=` `+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();let r=this.stack[this.stack.length-1];r.type===`containerDirective`||r.type===`leafDirective`||r.type,r.attributes=t}function Lv(e){this.exit(e)}function Rv(){return`:`}function zv(e){return!!(e&&e.type===`paragraph`&&e.data&&e.data.directiveLabel)}function Bv(e){let t=0;return e.type===`containerDirective`?(qp(e,function(e,n){if(e.type===`containerDirective`){let e=n.length,r=0;for(;e--;)n[e].type===`containerDirective`&&r++;r>t&&(t=r)}}),t+=3):t=e.type===`leafDirective`?2:1,`:`.repeat(t)}function Vv(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):m&&Z(t)?Q(e,v,`whitespace`)(t):!m&&X(t)?md(e,v)(t):t===null||Y(t)||_u(t)||gu(t)&&t!==45&&t!==95?ne(t):(e.enter(a),e.enter(c),e.consume(t),S)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||X(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||X(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===null||Y(t)||_u(t)||gu(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&Z(t)?Q(e,C,`whitespace`)(t):!m&&X(t)?md(e,C)(t):C(t)):(e.consume(t),S)}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&Y(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,E):m&&Z(t)?Q(e,w,`whitespace`)(t):!m&&X(t)?md(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||X(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function E(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),te):(e.enter(d),ee(t))}function ee(t){return t===g?(e.exit(d),E(t)):t===null?n(t):Y(t)?m?n(t):md(e,ee)(t):(e.enter(p),e.consume(t),D)}function D(t){return t===g||t===null||Y(t)?(e.exit(p),ee(t)):(e.consume(t),D)}function te(e){return e===125||X(e)?v(e):ne(e)}function ne(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function Hv(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):Y(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function Uv(e,t,n,r){let i=this;return a;function a(t){return t===null||Y(t)||gu(t)||_u(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||Y(a)||_u(a)||gu(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}var Wv={tokenize:Jv,concrete:!0},Gv={tokenize:Yv,partial:!0},Kv={tokenize:Xv,partial:!0},qv={tokenize:Zv,partial:!0};function Jv(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),Uv.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(Gv,d,d)(t):d(t)}function d(t){return t===123?e.attempt(Kv,f,f)(t):f(t)}function f(t){return Q(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):Y(i)?r.interrupt?t(i):e.attempt(qv,m,C)(i):n(i)}function m(t){return t===null?C(t):Y(t)?e.check(qv,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?Q(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):Y(t)?e.check(qv,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return Y(t)?e.check(qv,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function Yv(e,t,n){return Hv(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function Xv(e,t,n){return Vv(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function Zv(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Qv={tokenize:ty},$v={tokenize:ny,partial:!0},ey={tokenize:ry,partial:!0};function ty(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),Uv.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt($v,s,s)(t):s(t)}function s(t){return t===123?e.attempt(ey,c,c)(t):c(t)}function c(t){return Q(e,l,`whitespace`)(t)}function l(r){return r===null||Y(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function ny(e,t,n){return Hv(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function ry(e,t,n){return Vv(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}var iy={tokenize:cy,previous:sy},ay={tokenize:ly,partial:!0},oy={tokenize:uy,partial:!0};function sy(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function cy(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),Uv.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(ay,o,o)(t):o(t)}function o(t){return t===123?e.attempt(oy,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function ly(e,t,n){return Hv(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function uy(e,t,n){return Vv(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function dy(){return{text:{58:iy},flow:{58:[Wv,Qv]}}}function fy(){let e=this.data(),t=e.micromarkExtensions||=[],n=e.fromMarkdownExtensions||=[],r=e.toMarkdownExtensions||=[];t.push(dy()),n.push(Sv()),r.push(Cv())}function py({markdown:e}){return(0,f.jsx)(`div`,{className:`report-artifact`,children:(0,f.jsx)(qm,{remarkPlugins:[fy,()=>e=>{let t=e=>{let n=[`grid`,`column`].includes(e.name);[`containerDirective`,`leafDirective`,`textDirective`].includes(e.type)&&n&&(e.data=e.data||{},e.data.hName=e.name,e.data.hProperties=e.attributes||{}),e.children&&e.children.forEach(t)};t(e)},Z_],components:{h1:({children:e})=>(0,f.jsx)(`h1`,{children:e}),h2:({children:e})=>(0,f.jsx)(`h2`,{children:e}),h3:({children:e})=>(0,f.jsx)(`h3`,{children:e}),p:({children:e})=>(0,f.jsx)(`p`,{children:e}),ul:({children:e})=>(0,f.jsx)(`ul`,{children:e}),ol:({children:e})=>(0,f.jsx)(`ol`,{children:e}),li:({children:e})=>(0,f.jsx)(`li`,{children:e}),a:({children:e,href:t})=>(0,f.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:e}),blockquote:({children:e})=>(0,f.jsx)(`blockquote`,{children:e}),hr:()=>(0,f.jsx)(`hr`,{}),table:({children:e})=>(0,f.jsx)(`div`,{className:`report-artifact-table-wrapper`,children:(0,f.jsx)(`table`,{children:e})}),thead:({children:e})=>(0,f.jsx)(`thead`,{children:e}),th:({children:e})=>(0,f.jsx)(`th`,{children:e}),td:({children:e})=>(0,f.jsx)(`td`,{children:e}),code:e=>{let{children:t,className:n,...r}=e;return/language-(\w+)/.exec(n||``)?.[1]===`ericachart`?(0,f.jsx)(vc,{markdown:t}):(0,f.jsx)(`code`,{...r,className:n,children:t})},grid:({children:e,columns:t})=>(0,f.jsx)(`div`,{className:`report-grid report-grid--cols-${t?Number(t):2}`,children:e})},children:e})})}function my({title:e,reportContent:t}){let n=Cc(),r=()=>{n.setTitle(e),n.setContent((0,f.jsx)(py,{markdown:t})),n.onOpen()};return(0,f.jsx)(`div`,{onClick:r,className:`report-item-card`,children:(0,f.jsxs)(`div`,{className:`report-item-content`,children:[(0,f.jsx)(`div`,{className:`report-item-icon-wrapper`,children:(0,f.jsx)(`svg`,{className:`report-item-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})})}),(0,f.jsxs)(`div`,{className:`report-item-text-wrapper`,children:[(0,f.jsx)(`span`,{className:`report-item-title`,children:e}),(0,f.jsx)(`span`,{className:`report-item-subtitle`,children:`Business Report`})]}),(0,f.jsx)(`button`,{onClick:r,className:`report-item-button`,children:`Show Report`})]})})}function hy({path:e,title:t}){let n=e.split(`/`),r=n[5],i=n[6],{data:a,isLoading:o}=Lt({queryKey:[`artifact`,r,e],queryFn:()=>Ws.get(r,i),enabled:!!r&&!!e});return o?(0,f.jsx)(`div`,{className:`text-sm text-gray-500`,children:`loading report...`}):a?(0,f.jsx)(my,{title:t,reportContent:a}):(0,f.jsx)(`div`,{className:`text-sm text-gray-500`,children:`No report data available`})}function gy({message:e,datasetUuid:t,upsertKey:n,rows:r,previewRows:i,hiddenCount:a,onApprove:o,onReject:s}){let[c,l]=(0,u.useState)(!1),[d,p]=(0,u.useState)(``),m=()=>{c?s(d||void 0):l(!0)},h=i.length>0?Object.keys(i[0]):[];return(0,f.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-white p-4 shadow-sm`,children:[(0,f.jsxs)(`div`,{className:`mb-4`,children:[(0,f.jsx)(`h3`,{className:`text-sm font-semibold text-gray-900 mb-2`,children:e}),t&&(0,f.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`Dataset: `,(0,f.jsx)(`code`,{className:`bg-gray-100 px-1 rounded`,children:t})]}),n&&n.length>0&&(0,f.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`Upsert Key: `,(0,f.jsx)(`code`,{className:`bg-gray-100 px-1 rounded`,children:n.join(`, `)})]})]}),i.length>0&&(0,f.jsxs)(`div`,{className:`mb-4 overflow-x-auto`,children:[(0,f.jsxs)(`table`,{className:`min-w-full text-xs border border-gray-200 rounded-lg`,children:[(0,f.jsx)(`thead`,{className:`bg-gray-50`,children:(0,f.jsx)(`tr`,{children:h.map(e=>(0,f.jsx)(`th`,{className:`px-3 py-2 text-left font-semibold text-gray-700 border-b border-gray-200`,children:e},e))})}),(0,f.jsx)(`tbody`,{children:i.map((e,t)=>(0,f.jsx)(`tr`,{className:`border-b border-gray-100 last:border-0`,children:h.map(t=>(0,f.jsx)(`td`,{className:`px-3 py-2 text-gray-600`,children:String(e[t]??``)},t))},t))})]}),a>0&&(0,f.jsxs)(`p`,{className:`text-xs text-gray-500 mt-2`,children:[`... and `,a,` more row`,a===1?``:`s`]})]}),(0,f.jsxs)(`div`,{className:`text-xs text-gray-600 mb-4`,children:[`Total rows: `,r.length]}),c&&(0,f.jsxs)(`div`,{className:`mb-4`,children:[(0,f.jsx)(`label`,{className:`block text-xs font-medium text-gray-700 mb-1`,children:`Rejection reason (optional):`}),(0,f.jsx)(`input`,{type:`text`,value:d,onChange:e=>p(e.target.value),className:`w-full px-3 py-2 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,placeholder:`Enter reason...`})]}),(0,f.jsxs)(`div`,{className:`flex gap-2`,children:[(0,f.jsx)(`button`,{onClick:o,className:`flex-1 px-4 py-2 text-sm font-medium text-white bg-green-600 rounded-lg hover:bg-green-700 transition-colors`,children:`Approve`}),(0,f.jsx)(`button`,{onClick:m,className:`flex-1 px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700 transition-colors`,children:c?`Confirm Reject`:`Reject`}),c&&(0,f.jsx)(`button`,{onClick:()=>{l(!1),p(``)},className:`px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors`,children:`Cancel`})]})]})}function _y({name:e}){let t=(0,u.useContext)(Zt);return(0,u.useEffect)(()=>{t&&t.setStep(e)},[e,t]),null}function vy(){return(0,d.useRenderTool)({name:`showChart`,parameters:Hs,render:({parameters:e})=>e.compiled_chart?.path?(0,f.jsx)(bc,{path:e.compiled_chart.path}):(0,f.jsx)(`div`,{children:`No chart path provided`})},[]),(0,d.useRenderTool)({name:`showReport`,parameters:Us,render:({parameters:e})=>e.compiled_report?.path?(0,f.jsx)(hy,{path:e.compiled_report.path,title:e.compiled_report.title}):(0,f.jsx)(`div`,{children:`No report path provided`})},[]),(0,d.useDefaultRenderTool)({render:({name:e})=>(0,f.jsx)(_y,{name:e})},[]),(0,d.useInterrupt)({render:({event:e,resolve:t})=>{let n={};try{n=typeof e.value==`string`?JSON.parse(e.value):e.value}catch{}if(n?.type===`write_to_dataset`){let{message:e,action:r}=n,i=r?.rows??[],a=i.slice(0,3),o=i.length-a.length;return(0,f.jsx)(gy,{message:e??`Approve this action?`,datasetUuid:r?.dataset_uuid,upsertKey:r?.upsert_key,rows:i,previewRows:a,hiddenCount:o,onApprove:()=>t({approved:!0}),onReject:e=>t({approved:!1,...e?{reason:e}:{}})})}return(0,f.jsx)(`div`,{className:`rounded-xl border border-gray-200 bg-white p-4 text-sm`,children:(0,f.jsx)(`p`,{children:typeof e.value==`string`?e.value:JSON.stringify(e.value)})})}}),null}var yy=e=>e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/([A-Z])([A-Z][a-z])/g,`$1 $2`).replace(/[_-]/g,` `).toLowerCase().trim().replace(/\s+/g,` `);function by(){let e=(0,u.useContext)(Zt),t=`digesting`;return e?.step&&(t=e.step===`ls`?`listing files`:yy(e.step)),(0,f.jsxs)(`div`,{className:`chat-message-spinner-container`,children:[(0,f.jsx)(`div`,{className:`chat-message-spinner-icon`}),(0,f.jsxs)(`div`,{className:`chat-message-spinner-text`,children:[t,(0,f.jsxs)(`span`,{className:`chat-message-spinner-dots`,children:[(0,f.jsx)(`span`,{className:`chat-message-spinner-dot chat-message-spinner-dot--1`,children:`.`}),(0,f.jsx)(`span`,{className:`chat-message-spinner-dot chat-message-spinner-dot--2`,children:`.`}),(0,f.jsx)(`span`,{className:`chat-message-spinner-dot chat-message-spinner-dot--3`,children:`.`})]})]})]})}function xy({message:e}){return(0,f.jsxs)(`div`,{className:`loading-message-container`,children:[(0,f.jsx)(`div`,{className:`loading-message-spinner`}),(0,f.jsxs)(`div`,{className:`loading-message-text`,children:[e,(0,f.jsxs)(`span`,{className:`loading-message-dots`,children:[(0,f.jsx)(`span`,{className:`loading-message-dot loading-message-dot--1`,children:`.`}),(0,f.jsx)(`span`,{className:`loading-message-dot loading-message-dot--2`,children:`.`}),(0,f.jsx)(`span`,{className:`loading-message-dot loading-message-dot--3`,children:`.`})]})]})]})}var Sy=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Cy=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),wy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ty=e=>{let t=wy(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ey={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Dy=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Oy=(0,u.createContext)({}),ky=()=>(0,u.useContext)(Oy),Ay=(0,u.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=ky()??{},h=r??f?Number(n??d)*24/Number(t??l):n??d;return(0,u.createElement)(`svg`,{ref:c,...Ey,width:t??l??Ey.width,height:t??l??Ey.height,stroke:e??p,strokeWidth:h,className:Sy(`lucide`,m,i),...!a&&!Dy(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,u.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),jy=(e,t)=>{let n=(0,u.forwardRef)(({className:n,...r},i)=>(0,u.createElement)(Ay,{ref:i,iconNode:t,className:Sy(`lucide-${Cy(Ty(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ty(e),n},My=jy(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ny=jy(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Py=jy(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Fy(e){if(!e)return``;let t=e.split(`:`);return(t.length>1?t.slice(1).join(` `):e).replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Iy(e){if(!e)return``;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return n<1?`just now`:n<60?`${n}m ago`:r<24?`${r}h ago`:i<7?`${i}d ago`:new Date(e).toLocaleDateString()}function Ly({onNewChat:e,onThreadSelect:t}){let[n,r]=(0,u.useState)(!1),i=(0,u.useRef)(null),a=(0,d.useCopilotChatConfiguration)(),{data:o=[],isLoading:s}=Jt();(0,u.useEffect)(()=>{function e(e){i.current&&!i.current.contains(e.target)&&r(!1)}if(n)return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[n]);function c(e){r(!1),t?.(e)}return(0,f.jsxs)(`div`,{className:`erica-header`,children:[(0,f.jsxs)(`h2`,{className:`erica-header-title`,children:[`SPP AI `,(0,f.jsx)(`span`,{className:`erica-header-version`,children:`v1.1.0`})]}),(0,f.jsxs)(`div`,{className:`erica-header-controls`,ref:i,children:[(0,f.jsx)(`button`,{onClick:e,className:`erica-new-chat-button`,title:`Start new chat`,children:(0,f.jsx)(Ny,{className:`erica-icon-sm`})}),(0,f.jsxs)(`button`,{onClick:()=>r(!n),className:`erica-threads-toggle`,title:`Recent threads`,children:[(0,f.jsxs)(`span`,{className:`erica-threads-toggle-text`,children:[`Riwayat `,o.length>0&&`(${o.length})`]}),(0,f.jsx)(My,{className:`erica-threads-toggle-icon ${n?`erica-threads-toggle-icon--open`:``}`})]}),a?.setModalOpen&&(0,f.jsx)(`button`,{onClick:()=>a.setModalOpen(!1),className:`erica-close-button`,title:`Close sidebar`,children:(0,f.jsx)(Py,{className:`erica-icon-sm`})}),n&&(0,f.jsx)(`div`,{className:`erica-threads-dropdown`,children:(0,f.jsxs)(`div`,{className:`erica-threads-dropdown-content`,children:[(0,f.jsx)(`div`,{className:`erica-threads-dropdown-header`,children:`Riwayat Terakhir`}),s&&(0,f.jsx)(`div`,{className:`erica-threads-empty`,children:`Loading threads...`}),!s&&o.length===0&&(0,f.jsx)(`div`,{className:`erica-threads-empty`,children:`No conversations yet`}),!s&&o.map(e=>{let t=Fy(e.agent),n=Iy(e.last_run_at??e.created_at);return(0,f.jsx)(`button`,{onClick:()=>c(e.uid),className:`erica-thread-item`,children:(0,f.jsxs)(`div`,{className:`erica-thread-item-content`,children:[(0,f.jsx)(`span`,{className:`erica-thread-title`,children:typeof e.thread_metadata?.title==`string`?e.thread_metadata.title:e.last_message??`New conversation`}),(0,f.jsxs)(`div`,{className:`erica-thread-meta`,children:[t&&(0,f.jsx)(`span`,{className:`erica-thread-agent`,children:t}),n&&(0,f.jsx)(`span`,{className:`erica-thread-time`,children:n})]})]})},e.uid)})]})})]})]})}var Ry=(0,u.createContext)(void 0);function zy({accountUid:e,children:t}){return(0,f.jsx)(Ry.Provider,{value:{accountUid:e},children:t})}function By(){let e=(0,u.useContext)(Ry);if(!e)throw Error(`useAccount must be used within AccountProvider`);return e}var Vy={upload:async(e,t,n)=>{let{data:r}=await Bt({body:{file:e,prefix:t,ocr:n},throwOnError:!0});return r.data},download:async(e,t)=>{let n=e.split(`/`),r=n[n.length-1],i=n.slice(-3,-1).join(`/`),{data:a}=await Vt({path:{filename:r},query:i?{prefix:i}:{},parseAs:`blob`,throwOnError:!0}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}};function Hy({attachment:e}){let{accountUid:t}=By(),[n,r]=(0,u.useState)(!1);async function i(){r(!0);try{await Vy.download(t,e.file_path,e.original_name)}finally{r(!1)}}return(0,f.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:i,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i())},title:e.original_name,className:`group inline-flex items-center gap-1.5 max-w-[200px] bg-gray-100 hover:bg-gray-200 rounded-full pl-2 pr-2.5 py-1 cursor-pointer transition-colors`,children:[n?(0,f.jsx)(`div`,{className:`w-3 h-3 border-2 border-blue-600 border-t-transparent rounded-full animate-spin shrink-0`}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`svg`,{className:`w-3 h-3 shrink-0 text-gray-400 group-hover:hidden`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13`})}),(0,f.jsx)(`svg`,{className:`w-3 h-3 shrink-0 text-gray-500 hidden group-hover:block`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})})]}),(0,f.jsx)(`span`,{className:`text-xs text-gray-600 truncate leading-none`,children:e.original_name})]})}function Uy({children:e}){let t=String(e).trim(),n=[];try{n=JSON.parse(t)}catch{return null}return n.length===0?null:(0,f.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-1.5 py-1`,children:n.map((e,t)=>(0,f.jsx)(Hy,{attachment:e},t))})}function Wy(e){eh(e,[/\r?\n|\r/g,Gy])}function Gy(){return{type:`break`}}function Ky(){return function(e){Wy(e)}}var qy=()=>e=>{let t=e=>{[`containerDirective`,`leafDirective`,`textDirective`].includes(e.type)&&e.name===`tool_call_content`&&(e.data=e.data||{},e.data.hName=e.name,e.data.hProperties=e.attributes||{},e.children=[]),e.children&&e.children.forEach(t)};t(e)},Jy=()=>e=>{let t=e=>{e.type===`textDirective`&&e.name===`resource`&&(e.data=e.data||{},e.data.hName=`resource`,e.data.hProperties=e.attributes||{}),e.children&&e.children.forEach(t)};t(e)};function Yy({runtimeUrl:e,widgetToken:t}){let[n,r]=(0,u.useState)(void 0),[i,a]=(0,u.useState)(!0),[o,s]=(0,u.useState)(!1),[c,l]=(0,u.useState)(0),[p,m]=(0,u.useState)(!0),h=(0,u.useMemo)(()=>{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean);return n.length>2&&n.pop(),t.pathname=`/`+n.join(`/`),t.toString()},[e]);(0,u.useMemo)(()=>{he(h,t)},[h,t]);let{data:g,isLoading:_}=Yt(i,c),{isLoading:v,isSuccess:y}=Xt(n||``,o);(0,u.useEffect)(()=>{g&&(r(g),a(!1),s(!0),m(!0))},[g]),(0,u.useEffect)(()=>()=>{n&&p&&Kt.deleteSandbox(n).catch(()=>{})},[n,p]);let b=(0,u.useCallback)(()=>{r(void 0),a(!0),s(!1),l(e=>e+1),m(!0)},[]),x=(0,u.useCallback)(e=>{r(e),a(!1),s(!1),m(!1)},[]);function S({threadId:e,isLoadingThreadId:t,isLoadingSandbox:n,isSandboxReady:r,isNewThread:i,handleNewChat:a,handleThreadSelect:o}){let s=`Halo! Saya asisten AI SPP, ada yg bisa saya bantu?`;t?s=(0,f.jsx)(xy,{message:`Initializing conversation`}):i&&n?s=(0,f.jsx)(xy,{message:`Preparing workspace`}):i&&!r&&(s=(0,f.jsx)(xy,{message:`Setting up environment`}));let c=(0,u.useCallback)(()=>(0,f.jsx)(Ly,{onNewChat:a,onThreadSelect:o}),[a,o]);return(0,f.jsxs)(`div`,{className:`h-full w-full`,children:[(0,f.jsx)(vy,{}),(0,f.jsx)(d.CopilotSidebar,{header:c,labels:{chatInputPlaceholder:`Ketik pertanyaan Anda di sini...`,welcomeMessageText:s,chatDisclaimerText:`AI dapat membuat kesalahan. Harap verifikasi informasi penting.`},threadId:e,messageView:{cursor:by,userMessage:{messageRenderer:({content:e,className:t})=>(0,f.jsx)(`div`,{className:[`cpk:prose cpk:dark:prose-invert cpk:bg-muted cpk:relative cpk:max-w-[80%] cpk:rounded-[18px] cpk:px-4 cpk:py-1.5 cpk:data-[multiline]:py-3 cpk:inline-block`,t].filter(Boolean).join(` `),children:(0,f.jsx)(qm,{remarkPlugins:[Ky,Z_,fy,Jy],components:{pre:({children:e})=>(0,f.jsx)(f.Fragment,{children:e}),code({children:e,className:t}){return/language-(\w+)/.exec(t||``)?.[1]===`attachments`?(0,f.jsx)(Uy,{children:e}):(0,f.jsx)(`code`,{className:t,style:{fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:`0.85em`},children:e})},resource:({children:e})=>(0,f.jsxs)(`span`,{className:`inline-flex items-center bg-blue-100 text-blue-700 rounded-md px-1.5 py-px text-sm mx-0.5 font-medium`,children:[`@`,e]})},children:e})})},assistantMessage:{className:`prose lg:prose-xl`,toolbarVisible:!1,markdownRenderer:({content:e})=>!e||e.trim()===``?(0,f.jsx)(f.Fragment,{}):(0,f.jsx)(qm,{remarkPlugins:[Ky,Z_,fy,qy],components:{tool_call_content:({children:e,...t})=>(0,f.jsx)(`div`,{className:`tool-call-content`,...t,children:e})},children:e})}}})]})}return(0,f.jsx)(d.CopilotChatConfigurationProvider,{isModalDefaultOpen:!1,children:(0,f.jsx)(Qt,{threadId:n,children:(0,f.jsx)(d.CopilotKit,{runtimeUrl:e,headers:{Authorization:`Bearer ${t}`},properties:{agent:`account:agent_demo_smi`},threadId:n,enableInspector:!1,children:(0,f.jsx)(S,{threadId:n,isLoadingThreadId:_,isLoadingSandbox:v,isSandboxReady:y,isNewThread:p,handleNewChat:b,handleThreadSelect:x})})})})}var Xy=new bt({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});function Zy({accountUid:e,children:t}){return(0,f.jsx)(Ct,{client:Xy,children:(0,f.jsx)(zy,{accountUid:e,children:(0,f.jsx)(Sc,{children:t})})})}function Qy(){let{isOpen:e,onClose:t,content:n,title:r}=Cc(),[i,a]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{e?setTimeout(()=>a(!0),10):a(!1)},[e]),e?(0,f.jsxs)(`div`,{className:`erica-artifact-container`,children:[(0,f.jsx)(`div`,{className:`erica-artifact-backdrop ${i?`erica-artifact-backdrop--visible`:``}`,onClick:t}),(0,f.jsxs)(`div`,{className:`erica-artifact-drawer ${i?`erica-artifact-drawer--open`:``}`,children:[(0,f.jsxs)(`div`,{className:`erica-artifact-header`,children:[(0,f.jsx)(`h2`,{className:`erica-artifact-title`,children:r}),(0,f.jsx)(`button`,{onClick:t,className:`erica-artifact-close-button`,"aria-label":`Close drawer`,children:(0,f.jsx)(Py,{className:`erica-icon-md`})})]}),(0,f.jsx)(`div`,{className:`erica-artifact-body`,children:n})]})]}):null}exports.ArtifactProvider=Sc,exports.EricaChat=Yy,exports.EricaDrawer=Qy,exports.EricaProvider=Zy;
|
|
76
|
+
`,`\r`];return e+`=`+s+_v(n,{subset:c})+s}}function wv(e){Dv.call(this,`containerDirective`,e)}function Tv(e){Dv.call(this,`leafDirective`,e)}function Ev(e){Dv.call(this,`textDirective`,e)}function Dv(e,t){this.enter({type:e,name:``,attributes:{},children:[]},t)}function Ov(e){let t=this.stack[this.stack.length-1];t.type===`containerDirective`||t.type===`leafDirective`||t.type,t.name=this.sliceSerialize(e)}function kv(e){this.enter({type:`paragraph`,data:{directiveLabel:!0},children:[]},e)}function Av(e){this.exit(e)}function jv(){this.data.directiveAttributes=[],this.buffer()}function Mv(e){this.data.directiveAttributes.push([`id`,av(this.sliceSerialize(e),{attribute:!0})])}function Nv(e){this.data.directiveAttributes.push([`class`,av(this.sliceSerialize(e),{attribute:!0})])}function Pv(e){let t=this.data.directiveAttributes;t[t.length-1][1]=av(this.sliceSerialize(e),{attribute:!0})}function Fv(e){this.data.directiveAttributes.push([this.sliceSerialize(e),``])}function Iv(){let e=this.data.directiveAttributes,t={},n=-1;for(;++n<e.length;){let r=e[n];r[0]===`class`&&t.class?t.class+=` `+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();let r=this.stack[this.stack.length-1];r.type===`containerDirective`||r.type===`leafDirective`||r.type,r.attributes=t}function Lv(e){this.exit(e)}function Rv(){return`:`}function zv(e){return!!(e&&e.type===`paragraph`&&e.data&&e.data.directiveLabel)}function Bv(e){let t=0;return e.type===`containerDirective`?(qp(e,function(e,n){if(e.type===`containerDirective`){let e=n.length,r=0;for(;e--;)n[e].type===`containerDirective`&&r++;r>t&&(t=r)}}),t+=3):t=e.type===`leafDirective`?2:1,`:`.repeat(t)}function Vv(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):m&&Z(t)?Q(e,v,`whitespace`)(t):!m&&X(t)?md(e,v)(t):t===null||Y(t)||_u(t)||gu(t)&&t!==45&&t!==95?ne(t):(e.enter(a),e.enter(c),e.consume(t),S)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||X(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||X(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===null||Y(t)||_u(t)||gu(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&Z(t)?Q(e,C,`whitespace`)(t):!m&&X(t)?md(e,C)(t):C(t)):(e.consume(t),S)}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&Y(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,E):m&&Z(t)?Q(e,w,`whitespace`)(t):!m&&X(t)?md(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||X(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function E(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),te):(e.enter(d),ee(t))}function ee(t){return t===g?(e.exit(d),E(t)):t===null?n(t):Y(t)?m?n(t):md(e,ee)(t):(e.enter(p),e.consume(t),D)}function D(t){return t===g||t===null||Y(t)?(e.exit(p),ee(t)):(e.consume(t),D)}function te(e){return e===125||X(e)?v(e):ne(e)}function ne(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function Hv(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):Y(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function Uv(e,t,n,r){let i=this;return a;function a(t){return t===null||Y(t)||gu(t)||_u(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||Y(a)||_u(a)||gu(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}var Wv={tokenize:Jv,concrete:!0},Gv={tokenize:Yv,partial:!0},Kv={tokenize:Xv,partial:!0},qv={tokenize:Zv,partial:!0};function Jv(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),Uv.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(Gv,d,d)(t):d(t)}function d(t){return t===123?e.attempt(Kv,f,f)(t):f(t)}function f(t){return Q(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):Y(i)?r.interrupt?t(i):e.attempt(qv,m,C)(i):n(i)}function m(t){return t===null?C(t):Y(t)?e.check(qv,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?Q(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):Y(t)?e.check(qv,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return Y(t)?e.check(qv,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function Yv(e,t,n){return Hv(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function Xv(e,t,n){return Vv(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function Zv(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Qv={tokenize:ty},$v={tokenize:ny,partial:!0},ey={tokenize:ry,partial:!0};function ty(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),Uv.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt($v,s,s)(t):s(t)}function s(t){return t===123?e.attempt(ey,c,c)(t):c(t)}function c(t){return Q(e,l,`whitespace`)(t)}function l(r){return r===null||Y(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function ny(e,t,n){return Hv(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function ry(e,t,n){return Vv(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}var iy={tokenize:cy,previous:sy},ay={tokenize:ly,partial:!0},oy={tokenize:uy,partial:!0};function sy(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function cy(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),Uv.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(ay,o,o)(t):o(t)}function o(t){return t===123?e.attempt(oy,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function ly(e,t,n){return Hv(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function uy(e,t,n){return Vv(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function dy(){return{text:{58:iy},flow:{58:[Wv,Qv]}}}function fy(){let e=this.data(),t=e.micromarkExtensions||=[],n=e.fromMarkdownExtensions||=[],r=e.toMarkdownExtensions||=[];t.push(dy()),n.push(Sv()),r.push(Cv())}function py({markdown:e}){return(0,f.jsx)(`div`,{className:`report-artifact`,children:(0,f.jsx)(qm,{remarkPlugins:[fy,()=>e=>{let t=e=>{let n=[`grid`,`column`].includes(e.name);[`containerDirective`,`leafDirective`,`textDirective`].includes(e.type)&&n&&(e.data=e.data||{},e.data.hName=e.name,e.data.hProperties=e.attributes||{}),e.children&&e.children.forEach(t)};t(e)},Z_],components:{h1:({children:e})=>(0,f.jsx)(`h1`,{children:e}),h2:({children:e})=>(0,f.jsx)(`h2`,{children:e}),h3:({children:e})=>(0,f.jsx)(`h3`,{children:e}),p:({children:e})=>(0,f.jsx)(`p`,{children:e}),ul:({children:e})=>(0,f.jsx)(`ul`,{children:e}),ol:({children:e})=>(0,f.jsx)(`ol`,{children:e}),li:({children:e})=>(0,f.jsx)(`li`,{children:e}),a:({children:e,href:t})=>(0,f.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:e}),blockquote:({children:e})=>(0,f.jsx)(`blockquote`,{children:e}),hr:()=>(0,f.jsx)(`hr`,{}),table:({children:e})=>(0,f.jsx)(`div`,{className:`report-artifact-table-wrapper`,children:(0,f.jsx)(`table`,{children:e})}),thead:({children:e})=>(0,f.jsx)(`thead`,{children:e}),th:({children:e})=>(0,f.jsx)(`th`,{children:e}),td:({children:e})=>(0,f.jsx)(`td`,{children:e}),code:e=>{let{children:t,className:n,...r}=e;return/language-(\w+)/.exec(n||``)?.[1]===`ericachart`?(0,f.jsx)(vc,{markdown:t}):(0,f.jsx)(`code`,{...r,className:n,children:t})},grid:({children:e,columns:t})=>(0,f.jsx)(`div`,{className:`report-grid report-grid--cols-${t?Number(t):2}`,children:e})},children:e})})}function my({title:e,reportContent:t}){let n=Cc(),r=()=>{n.setTitle(e),n.setContent((0,f.jsx)(py,{markdown:t})),n.onOpen()};return(0,f.jsx)(`div`,{onClick:r,className:`report-item-card`,children:(0,f.jsxs)(`div`,{className:`report-item-content`,children:[(0,f.jsx)(`div`,{className:`report-item-icon-wrapper`,children:(0,f.jsx)(`svg`,{className:`report-item-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})})}),(0,f.jsxs)(`div`,{className:`report-item-text-wrapper`,children:[(0,f.jsx)(`span`,{className:`report-item-title`,children:e}),(0,f.jsx)(`span`,{className:`report-item-subtitle`,children:`Business Report`})]}),(0,f.jsx)(`button`,{onClick:r,className:`report-item-button`,children:`Show Report`})]})})}function hy({path:e,title:t}){let n=e.split(`/`),r=n[5],i=n[6],{data:a,isLoading:o}=Lt({queryKey:[`artifact`,r,e],queryFn:()=>Ws.get(r,i),enabled:!!r&&!!e});return o?(0,f.jsx)(`div`,{className:`report-loader-loading`,children:`loading report...`}):a?(0,f.jsx)(my,{title:t,reportContent:a}):(0,f.jsx)(`div`,{className:`report-loader-no-data`,children:`No report data available`})}function gy({message:e,datasetUuid:t,upsertKey:n,rows:r,previewRows:i,hiddenCount:a,onApprove:o,onReject:s}){let[c,l]=(0,u.useState)(!1),[d,p]=(0,u.useState)(``),m=()=>{c?s(d||void 0):l(!0)},h=i.length>0?Object.keys(i[0]):[];return(0,f.jsxs)(`div`,{className:`dataset-approval-card`,children:[(0,f.jsxs)(`div`,{className:`dataset-approval-header`,children:[(0,f.jsx)(`h3`,{className:`dataset-approval-title`,children:e}),t&&(0,f.jsxs)(`p`,{className:`dataset-approval-meta`,children:[`Dataset: `,(0,f.jsx)(`code`,{className:`dataset-approval-code`,children:t})]}),n&&n.length>0&&(0,f.jsxs)(`p`,{className:`dataset-approval-meta`,children:[`Upsert Key: `,(0,f.jsx)(`code`,{className:`dataset-approval-code`,children:n.join(`, `)})]})]}),i.length>0&&(0,f.jsxs)(`div`,{className:`dataset-approval-table-wrapper`,children:[(0,f.jsxs)(`table`,{className:`dataset-approval-table`,children:[(0,f.jsx)(`thead`,{className:`dataset-approval-thead`,children:(0,f.jsx)(`tr`,{children:h.map(e=>(0,f.jsx)(`th`,{className:`dataset-approval-th`,children:e},e))})}),(0,f.jsx)(`tbody`,{children:i.map((e,t)=>(0,f.jsx)(`tr`,{className:`dataset-approval-tr`,children:h.map(t=>(0,f.jsx)(`td`,{className:`dataset-approval-td`,children:String(e[t]??``)},t))},t))})]}),a>0&&(0,f.jsxs)(`p`,{className:`dataset-approval-hidden-count`,children:[`... and `,a,` more row`,a===1?``:`s`]})]}),(0,f.jsxs)(`div`,{className:`dataset-approval-total`,children:[`Total rows: `,r.length]}),c&&(0,f.jsxs)(`div`,{className:`dataset-approval-reject-section`,children:[(0,f.jsx)(`label`,{className:`dataset-approval-reject-label`,children:`Rejection reason (optional):`}),(0,f.jsx)(`input`,{type:`text`,value:d,onChange:e=>p(e.target.value),className:`dataset-approval-reject-input`,placeholder:`Enter reason...`})]}),(0,f.jsxs)(`div`,{className:`dataset-approval-buttons`,children:[(0,f.jsx)(`button`,{onClick:o,className:`dataset-approval-btn dataset-approval-btn-approve`,children:`Approve`}),(0,f.jsx)(`button`,{onClick:m,className:`dataset-approval-btn dataset-approval-btn-reject`,children:c?`Confirm Reject`:`Reject`}),c&&(0,f.jsx)(`button`,{onClick:()=>{l(!1),p(``)},className:`dataset-approval-btn-cancel`,children:`Cancel`})]})]})}function _y({name:e}){let t=(0,u.useContext)(Zt);return(0,u.useEffect)(()=>{t&&t.setStep(e)},[e,t]),null}function vy(){return(0,d.useRenderTool)({name:`showChart`,parameters:Hs,render:({parameters:e})=>e.compiled_chart?.path?(0,f.jsx)(bc,{path:e.compiled_chart.path}):(0,f.jsx)(`div`,{children:`No chart path provided`})},[]),(0,d.useRenderTool)({name:`showReport`,parameters:Us,render:({parameters:e})=>e.compiled_report?.path?(0,f.jsx)(hy,{path:e.compiled_report.path,title:e.compiled_report.title}):(0,f.jsx)(`div`,{children:`No report path provided`})},[]),(0,d.useDefaultRenderTool)({render:({name:e})=>(0,f.jsx)(_y,{name:e})},[]),(0,d.useInterrupt)({render:({event:e,resolve:t})=>{let n={};try{n=typeof e.value==`string`?JSON.parse(e.value):e.value}catch{}if(n?.type===`write_to_dataset`){let{message:e,action:r}=n,i=r?.rows??[],a=i.slice(0,3),o=i.length-a.length;return(0,f.jsx)(gy,{message:e??`Approve this action?`,datasetUuid:r?.dataset_uuid,upsertKey:r?.upsert_key,rows:i,previewRows:a,hiddenCount:o,onApprove:()=>t({approved:!0}),onReject:e=>t({approved:!1,...e?{reason:e}:{}})})}return(0,f.jsx)(`div`,{className:`tools-interrupt-fallback`,children:(0,f.jsx)(`p`,{children:typeof e.value==`string`?e.value:JSON.stringify(e.value)})})}}),null}var yy=e=>e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/([A-Z])([A-Z][a-z])/g,`$1 $2`).replace(/[_-]/g,` `).toLowerCase().trim().replace(/\s+/g,` `);function by(){let e=(0,u.useContext)(Zt),t=`digesting`;return e?.step&&(t=e.step===`ls`?`listing files`:yy(e.step)),(0,f.jsxs)(`div`,{className:`chat-message-spinner-container`,children:[(0,f.jsx)(`div`,{className:`chat-message-spinner-icon`}),(0,f.jsxs)(`div`,{className:`chat-message-spinner-text`,children:[t,(0,f.jsxs)(`span`,{className:`chat-message-spinner-dots`,children:[(0,f.jsx)(`span`,{className:`chat-message-spinner-dot chat-message-spinner-dot--1`,children:`.`}),(0,f.jsx)(`span`,{className:`chat-message-spinner-dot chat-message-spinner-dot--2`,children:`.`}),(0,f.jsx)(`span`,{className:`chat-message-spinner-dot chat-message-spinner-dot--3`,children:`.`})]})]})]})}function xy({message:e}){return(0,f.jsxs)(`div`,{className:`loading-message-container`,children:[(0,f.jsx)(`div`,{className:`loading-message-spinner`}),(0,f.jsxs)(`div`,{className:`loading-message-text`,children:[e,(0,f.jsxs)(`span`,{className:`loading-message-dots`,children:[(0,f.jsx)(`span`,{className:`loading-message-dot loading-message-dot--1`,children:`.`}),(0,f.jsx)(`span`,{className:`loading-message-dot loading-message-dot--2`,children:`.`}),(0,f.jsx)(`span`,{className:`loading-message-dot loading-message-dot--3`,children:`.`})]})]})]})}var Sy=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Cy=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),wy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ty=e=>{let t=wy(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ey={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Dy=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Oy=(0,u.createContext)({}),ky=()=>(0,u.useContext)(Oy),Ay=(0,u.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=ky()??{},h=r??f?Number(n??d)*24/Number(t??l):n??d;return(0,u.createElement)(`svg`,{ref:c,...Ey,width:t??l??Ey.width,height:t??l??Ey.height,stroke:e??p,strokeWidth:h,className:Sy(`lucide`,m,i),...!a&&!Dy(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,u.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),jy=(e,t)=>{let n=(0,u.forwardRef)(({className:n,...r},i)=>(0,u.createElement)(Ay,{ref:i,iconNode:t,className:Sy(`lucide-${Cy(Ty(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ty(e),n},My=jy(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ny=jy(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Py=jy(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Fy(e){if(!e)return``;let t=e.split(`:`);return(t.length>1?t.slice(1).join(` `):e).replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Iy(e){if(!e)return``;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return n<1?`just now`:n<60?`${n}m ago`:r<24?`${r}h ago`:i<7?`${i}d ago`:new Date(e).toLocaleDateString()}function Ly({onNewChat:e,onThreadSelect:t}){let[n,r]=(0,u.useState)(!1),i=(0,u.useRef)(null),a=(0,d.useCopilotChatConfiguration)(),{data:o=[],isLoading:s}=Jt();(0,u.useEffect)(()=>{function e(e){i.current&&!i.current.contains(e.target)&&r(!1)}if(n)return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[n]);function c(e){r(!1),t?.(e)}return(0,f.jsxs)(`div`,{className:`erica-header`,children:[(0,f.jsxs)(`h2`,{className:`erica-header-title`,children:[`SPP AI `,(0,f.jsx)(`span`,{className:`erica-header-version`,children:`v1.1.3`})]}),(0,f.jsxs)(`div`,{className:`erica-header-controls`,ref:i,children:[(0,f.jsx)(`button`,{onClick:e,className:`erica-new-chat-button`,title:`Start new chat`,children:(0,f.jsx)(Ny,{className:`erica-icon-sm`})}),(0,f.jsxs)(`button`,{onClick:()=>r(!n),className:`erica-threads-toggle`,title:`Recent threads`,children:[(0,f.jsxs)(`span`,{className:`erica-threads-toggle-text`,children:[`Riwayat `,o.length>0&&`(${o.length})`]}),(0,f.jsx)(My,{className:`erica-threads-toggle-icon ${n?`erica-threads-toggle-icon--open`:``}`})]}),a?.setModalOpen&&(0,f.jsx)(`button`,{onClick:()=>a.setModalOpen(!1),className:`erica-close-button`,title:`Close sidebar`,children:(0,f.jsx)(Py,{className:`erica-icon-sm`})}),n&&(0,f.jsx)(`div`,{className:`erica-threads-dropdown`,children:(0,f.jsxs)(`div`,{className:`erica-threads-dropdown-content`,children:[(0,f.jsx)(`div`,{className:`erica-threads-dropdown-header`,children:`Riwayat Terakhir`}),s&&(0,f.jsx)(`div`,{className:`erica-threads-empty`,children:`Loading threads...`}),!s&&o.length===0&&(0,f.jsx)(`div`,{className:`erica-threads-empty`,children:`No conversations yet`}),!s&&o.map(e=>{let t=Fy(e.agent),n=Iy(e.last_run_at??e.created_at);return(0,f.jsx)(`button`,{onClick:()=>c(e.uid),className:`erica-thread-item`,children:(0,f.jsxs)(`div`,{className:`erica-thread-item-content`,children:[(0,f.jsx)(`span`,{className:`erica-thread-title`,children:typeof e.thread_metadata?.title==`string`?e.thread_metadata.title:e.last_message??`New conversation`}),(0,f.jsxs)(`div`,{className:`erica-thread-meta`,children:[t&&(0,f.jsx)(`span`,{className:`erica-thread-agent`,children:t}),n&&(0,f.jsx)(`span`,{className:`erica-thread-time`,children:n})]})]})},e.uid)})]})})]})]})}var Ry=(0,u.createContext)(void 0);function zy({accountUid:e,children:t}){return(0,f.jsx)(Ry.Provider,{value:{accountUid:e},children:t})}function By(){let e=(0,u.useContext)(Ry);if(!e)throw Error(`useAccount must be used within AccountProvider`);return e}var Vy={upload:async(e,t,n)=>{let{data:r}=await Bt({body:{file:e,prefix:t,ocr:n},throwOnError:!0});return r.data},download:async(e,t)=>{let n=e.split(`/`),r=n[n.length-1],i=n.slice(-3,-1).join(`/`),{data:a}=await Vt({path:{filename:r},query:i?{prefix:i}:{},parseAs:`blob`,throwOnError:!0}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}};function Hy({attachment:e}){let{accountUid:t}=By(),[n,r]=(0,u.useState)(!1);async function i(){r(!0);try{await Vy.download(t,e.file_path,e.original_name)}finally{r(!1)}}return(0,f.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:i,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i())},title:e.original_name,className:`attachment-item`,children:[n?(0,f.jsx)(`div`,{className:`attachment-item-spinner`}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`svg`,{className:`attachment-item-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13`})}),(0,f.jsx)(`svg`,{className:`attachment-item-icon-download`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})})]}),(0,f.jsx)(`span`,{className:`attachment-item-text`,children:e.original_name})]})}function Uy({children:e}){let t=String(e).trim(),n=[];try{n=JSON.parse(t)}catch{return null}return n.length===0?null:(0,f.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-1.5 py-1`,children:n.map((e,t)=>(0,f.jsx)(Hy,{attachment:e},t))})}function Wy({message:e=`Hai! Saya SPP AI, siap membantu Anda!`,isOpen:t=!1,showDuration:n=1e4,hideDuration:r=3e4,initialDelay:i=5e3}){let[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(t){o(!1);return}if(!s){let e=setTimeout(()=>{o(!0),c(!0)},i);return()=>clearTimeout(e)}if(a){let e=setTimeout(()=>{o(!1)},n);return()=>clearTimeout(e)}else{let e=setTimeout(()=>{o(!0)},r);return()=>clearTimeout(e)}},[t,n,r,i,a,s]),!a||t?null:(0,f.jsx)(`div`,{className:`chat-toggle-greeting-wrapper`,children:(0,f.jsxs)(`div`,{className:`chat-toggle-greeting-bubble`,children:[e,(0,f.jsx)(`button`,{onClick:()=>{o(!1)},className:`chat-toggle-greeting-close`,"aria-label":`Dismiss greeting`,children:(0,f.jsx)(Py,{})})]})})}function Gy(e){eh(e,[/\r?\n|\r/g,Ky])}function Ky(){return{type:`break`}}function qy(){return function(e){Gy(e)}}var Jy=()=>e=>{let t=e=>{[`containerDirective`,`leafDirective`,`textDirective`].includes(e.type)&&e.name===`tool_call_content`&&(e.data=e.data||{},e.data.hName=e.name,e.data.hProperties=e.attributes||{},e.children=[]),e.children&&e.children.forEach(t)};t(e)},Yy=()=>e=>{let t=e=>{e.type===`textDirective`&&e.name===`resource`&&(e.data=e.data||{},e.data.hName=`resource`,e.data.hProperties=e.attributes||{}),e.children&&e.children.forEach(t)};t(e)};function Xy({runtimeUrl:e,widgetToken:t}){let[n,r]=(0,u.useState)(void 0),[i,a]=(0,u.useState)(!0),[o,s]=(0,u.useState)(!1),[c,l]=(0,u.useState)(0),[p,m]=(0,u.useState)(!0),[h,g]=(0,u.useState)(!1),_=(0,u.useMemo)(()=>{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean);return n.length>2&&n.pop(),t.pathname=`/`+n.join(`/`),t.toString()},[e]);(0,u.useMemo)(()=>{he(_,t)},[_,t]);let{data:v,isLoading:y}=Yt(i,c),{isLoading:b,isSuccess:x}=Xt(n||``,o);(0,u.useEffect)(()=>{x&&p&&h&&g(!0)},[x,p,h]),(0,u.useEffect)(()=>{v&&(r(v),a(!1),s(!0),m(!0))},[v]),(0,u.useEffect)(()=>()=>{n&&p&&Kt.deleteSandbox(n).catch(()=>{})},[n,p]);let S=(0,u.useCallback)(()=>{r(void 0),a(!0),s(!1),l(e=>e+1),m(!0),g(!0)},[]),C=(0,u.useCallback)(e=>{r(e),a(!1),s(!1),m(!1),g(!0)},[]);function w({threadId:e,isLoadingThreadId:t,isLoadingSandbox:n,isSandboxReady:r,isNewThread:i,handleNewChat:a,handleThreadSelect:o}){let s=`Halo! Saya asisten AI SPP, ada yg bisa saya bantu?`;t?s=(0,f.jsx)(xy,{message:`Initializing conversation`}):i&&n?s=(0,f.jsx)(xy,{message:`Preparing workspace`}):i&&!r&&(s=(0,f.jsx)(xy,{message:`Setting up environment`}));let c=(0,u.useCallback)(()=>(0,f.jsx)(Ly,{onNewChat:a,onThreadSelect:o}),[a,o]);return(0,f.jsxs)(`div`,{className:`erica-chat-container`,children:[(0,f.jsx)(vy,{}),(0,f.jsx)(Wy,{message:`Hai! Saya SPP AI, siap membantu Anda!`,isOpen:h,initialDelay:1e4,showDuration:1e4,hideDuration:3e4}),(0,f.jsx)(d.CopilotSidebar,{welcomeScreen:!0,header:c,labels:{chatInputPlaceholder:`Ketik pertanyaan Anda di sini...`,welcomeMessageText:s,chatDisclaimerText:`AI dapat membuat kesalahan. Harap verifikasi informasi penting.`},threadId:e,messageView:{cursor:by,userMessage:{messageRenderer:({content:e,className:t})=>(0,f.jsx)(`div`,{className:[`cpk:prose cpk:dark:prose-invert cpk:bg-smi cpk:relative cpk:max-w-[80%] cpk:rounded-[18px] cpk:px-4 cpk:py-1.5 cpk:data-[multiline]:py-3 cpk:inline-block`,t].filter(Boolean).join(` `),children:(0,f.jsx)(qm,{remarkPlugins:[qy,Z_,fy,Yy],components:{pre:({children:e})=>(0,f.jsx)(f.Fragment,{children:e}),code({children:e,className:t}){return/language-(\w+)/.exec(t||``)?.[1]===`attachments`?(0,f.jsx)(Uy,{children:e}):(0,f.jsx)(`code`,{className:t,style:{fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:`0.85em`},children:e})},resource:({children:e})=>(0,f.jsxs)(`span`,{className:`erica-resource-tag`,children:[`@`,e]})},children:e})})},assistantMessage:{className:`prose lg:prose-xl`,toolbarVisible:!1,markdownRenderer:({content:e})=>!e||e.trim()===``?(0,f.jsx)(f.Fragment,{}):(0,f.jsx)(qm,{remarkPlugins:[qy,Z_,fy,Jy],components:{tool_call_content:({children:e,...t})=>(0,f.jsx)(`div`,{className:`tool-call-content`,...t,children:e})},children:e})}},defaultOpen:h})]})}return(0,f.jsx)(d.CopilotChatConfigurationProvider,{children:(0,f.jsx)(Qt,{threadId:n,children:(0,f.jsx)(d.CopilotKit,{runtimeUrl:e,headers:{Authorization:`Bearer ${t}`},properties:{agent:`account:agent_demo_smi`},threadId:n,enableInspector:!1,children:(0,f.jsx)(w,{threadId:n,isLoadingThreadId:y,isLoadingSandbox:b,isSandboxReady:x,isNewThread:p,handleNewChat:S,handleThreadSelect:C})})})})}var Zy=new bt({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});function Qy({accountUid:e,children:t}){return(0,f.jsx)(Ct,{client:Zy,children:(0,f.jsx)(zy,{accountUid:e,children:(0,f.jsx)(Sc,{children:t})})})}function $y(){let{isOpen:e,onClose:t,content:n,title:r}=Cc(),[i,a]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{e?setTimeout(()=>a(!0),10):a(!1)},[e]),e?(0,f.jsxs)(`div`,{className:`erica-artifact-container`,children:[(0,f.jsx)(`div`,{className:`erica-artifact-backdrop ${i?`erica-artifact-backdrop--visible`:``}`,onClick:t}),(0,f.jsxs)(`div`,{className:`erica-artifact-drawer ${i?`erica-artifact-drawer--open`:``}`,children:[(0,f.jsxs)(`div`,{className:`erica-artifact-header`,children:[(0,f.jsx)(`h2`,{className:`erica-artifact-title`,children:r}),(0,f.jsx)(`button`,{onClick:t,className:`erica-artifact-close-button`,"aria-label":`Close drawer`,children:(0,f.jsx)(Py,{className:`erica-icon-md`})})]}),(0,f.jsx)(`div`,{className:`erica-artifact-body`,children:n})]})]}):null}exports.ArtifactProvider=Sc,exports.EricaChat=Xy,exports.EricaDrawer=$y,exports.EricaProvider=Qy;
|
|
77
77
|
//# sourceMappingURL=index.cjs.map
|