@bmx-labs/chat-widget 0.0.7 → 0.0.8
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/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{createPortal as i}from"react-dom";import{Component as r,Fragment as o,createContext as s,createElement as a,default as l,forwardRef as c,useCallback as u,useContext as d,useEffect as h,useId as p,useInsertionEffect as f,useLayoutEffect as m,useMemo as g,useRef as b,useState as y}from"react";var v={62:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var i=(0,r.default)(e),o="function"==typeof t;return i.forEach(function(e){if("declaration"===e.type){var i=e.property,r=e.value;o?t(i,r,e):r&&((n=n||{})[i]=r)}}),n};var r=i(n(401))},74:e=>{function t(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(n=>{const i=e[n],r=typeof i;"object"!==r&&"function"!==r||Object.isFrozen(i)||t(i)}),e}class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}const o=e=>!!e.scope;class s{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!o(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){o(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const a=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class l{constructor(){this.rootNode=a(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=a({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function u(e){return e?"string"==typeof e?e:e.source:null}function d(e){return f("(?=",e,")")}function h(e){return f("(?:",e,")*")}function p(e){return f("(?:",e,")?")}function f(...e){return e.map(e=>u(e)).join("")}function m(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map(e=>u(e)).join("|")+")"}function g(e){return new RegExp(e.toString()+"|").exec("").length-1}const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function y(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;const t=n;let i=u(e),r="";for(;i.length>0;){const e=b.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r}).map(e=>`(${e})`).join(t)}const v="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",E={begin:"\\\\[\\s\\S]",relevance:0},S={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[E]},A={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[E]},C=function(e,t,n={}){const i=r({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:f(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},N=C("//","$"),M=C("/\\*","\\*/"),T=C("#","$"),O={scope:"number",begin:w,relevance:0},D={scope:"number",begin:_,relevance:0},I={scope:"number",begin:k,relevance:0},R={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[E,{begin:/\[/,end:/\]/,relevance:0,contains:[E]}]},P={scope:"title",begin:v,relevance:0},L={scope:"title",begin:x,relevance:0},F={begin:"\\.\\s*"+x,relevance:0};var B=Object.freeze({__proto__:null,APOS_STRING_MODE:S,BACKSLASH_ESCAPE:E,BINARY_NUMBER_MODE:I,BINARY_NUMBER_RE:k,COMMENT:C,C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:N,C_NUMBER_MODE:D,C_NUMBER_RE:_,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:T,IDENT_RE:v,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:F,NUMBER_MODE:O,NUMBER_RE:w,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:A,REGEXP_MODE:R,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:P,UNDERSCORE_IDENT_RE:x,UNDERSCORE_TITLE_MODE:L});function z(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function j(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function U(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=z,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function V(e,t){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function $(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function H(e,t){void 0===e.relevance&&(e.relevance=1)}const q=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=f(n.beforeMatch,d(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},K=["of","and","for","in","not","or","if","then","parent","list","value"];function G(e,t,n="keyword"){const i=Object.create(null);return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(n){Object.assign(i,G(e[n],t,n))}),i;function r(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){const n=t.split("|");i[n[0]]=[e,W(n[0],n[1])]})}}function W(e,t){return t?Number(t):function(e){return K.includes(e.toLowerCase())}(e)?0:1}const Z={},X=e=>{console.error(e)},Y=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Q=(e,t)=>{Z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Z[`${e}/${t}`]=!0)},J=new Error;function ee(e,t,{key:n}){let i=0;const r=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+i]=r[e],o[e+i]=!0,i+=g(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function te(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw X("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),J;if("object"!=typeof e.beginScope||null===e.beginScope)throw X("beginScope must be object"),J;ee(e,e.begin,{key:"beginScope"}),e.begin=y(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw X("skip, excludeEnd, returnEnd not compatible with endScope: {}"),J;if("object"!=typeof e.endScope||null===e.endScope)throw X("endScope must be object"),J;ee(e,e.end,{key:"endScope"}),e.end=y(e.end,{joinWith:""})}}(e)}function ne(e){function t(t,n){return new RegExp(u(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=g(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=t(y(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),i=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=r(e.classNameAliases||{}),function n(o,s){const a=o;if(o.isCompiled)return a;[j,$,te,q].forEach(e=>e(o,s)),e.compilerExtensions.forEach(e=>e(o,s)),o.__beforeBegin=null,[U,V,H].forEach(e=>e(o,s)),o.isCompiled=!0;let l=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),l=o.keywords.$pattern,delete o.keywords.$pattern),l=l||/\w+/,o.keywords&&(o.keywords=G(o.keywords,e.case_insensitive)),a.keywordPatternRe=t(l,!0),s&&(o.begin||(o.begin=/\B|\b/),a.beginRe=t(a.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(a.endRe=t(a.end)),a.terminatorEnd=u(a.end)||"",o.endsWithParent&&s.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(a.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(e){return function(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return r(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ie(e)?r(e,{starts:e.starts?r(e.starts):null}):Object.isFrozen(e)?r(e):e}("self"===e?o:e)})),o.contains.forEach(function(e){n(e,a)}),o.starts&&n(o.starts,s),a.matcher=function(e){const t=new i;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function ie(e){return!!e&&(e.endsWithParent||ie(e.starts))}class re extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const oe=i,se=r,ae=Symbol("nomatch"),le=function(e){const i=Object.create(null),r=Object.create(null),o=[];let s=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function g(e){return u.noHighlightRe.test(e)}function b(e,t,n){let i="",r="";"object"==typeof t?(i=e,n=t.ignoreIllegals,r=t.language):(Q("10.7.0","highlight(lang, code, ...args) has been deprecated."),Q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,i=t),void 0===n&&(n=!0);const o={code:i,language:r};A("before:highlight",o);const s=o.result?o.result:y(o.language,o.code,n);return s.code=o.code,A("after:highlight",s),s}function y(e,t,r,o){const l=Object.create(null);function c(e,t){return e.keywords[t]}function d(){if(!C.keywords)return void M.addText(T);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(T),n="";for(;t;){n+=T.substring(e,t.index);const i=E.case_insensitive?t[0].toLowerCase():t[0],r=c(C,i);if(r){const[e,o]=r;if(M.addText(n),n="",l[i]=(l[i]||0)+1,l[i]<=7&&(O+=o),e.startsWith("_"))n+=t[0];else{const n=E.classNameAliases[e]||e;p(t[0],n)}}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(T)}n+=T.substring(e),M.addText(n)}function h(){null!=C.subLanguage?function(){if(""===T)return;let e=null;if("string"==typeof C.subLanguage){if(!i[C.subLanguage])return void M.addText(T);e=y(C.subLanguage,T,!0,N[C.subLanguage]),N[C.subLanguage]=e._top}else e=v(T,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(O+=e.relevance),M.__addSublanguage(e._emitter,e.language)}():d(),T=""}function p(e,t){""!==e&&(M.startScope(t),M.addText(e),M.endScope())}function f(e,t){let n=1;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue}const i=E.classNameAliases[e[n]]||e[n],r=t[n];i?p(r,i):(T=r,d(),T=""),n++}}function m(e,t){return e.scope&&"string"==typeof e.scope&&M.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(p(T,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),T=""):e.beginScope._multi&&(f(e.beginScope,t),T="")),C=Object.create(e,{parent:{value:C}}),C}function g(e,t,i){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,i);if(r){if(e["on:end"]){const i=new n(e);e["on:end"](t,i),i.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return g(e.parent,t,i)}function b(e){return 0===C.matcher.regexIndex?(T+=e[0],1):(R=!0,0)}function x(e){const n=e[0],i=t.substring(e.index),r=g(C,e,i);if(!r)return ae;const o=C;C.endScope&&C.endScope._wrap?(h(),p(n,C.endScope._wrap)):C.endScope&&C.endScope._multi?(h(),f(C.endScope,e)):o.skip?T+=n:(o.returnEnd||o.excludeEnd||(T+=n),h(),o.excludeEnd&&(T=n));do{C.scope&&M.closeNode(),C.skip||C.subLanguage||(O+=C.relevance),C=C.parent}while(C!==r.parent);return r.starts&&m(r.starts,e),o.returnEnd?0:n.length}let w={};function _(i,o){const a=o&&o[0];if(T+=i,null==a)return h(),0;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===a){if(T+=t.slice(o.index,o.index+1),!s){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=w.rule,t}return 1}if(w=o,"begin"===o.type)return function(e){const t=e[0],i=e.rule,r=new n(i),o=[i.__beforeBegin,i["on:begin"]];for(const n of o)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return i.skip?T+=t:(i.excludeBegin&&(T+=t),h(),i.returnBegin||i.excludeBegin||(T=t)),m(i,e),i.returnBegin?0:t.length}(o);if("illegal"===o.type&&!r){const e=new Error('Illegal lexeme "'+a+'" for mode "'+(C.scope||"<unnamed>")+'"');throw e.mode=C,e}if("end"===o.type){const e=x(o);if(e!==ae)return e}if("illegal"===o.type&&""===a)return T+="\n",1;if(I>1e5&&I>3*o.index)throw new Error("potential infinite loop, way more iterations than matches");return T+=a,a.length}const E=k(e);if(!E)throw X(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const S=ne(E);let A="",C=o||S;const N={},M=new u.__emitter(u);!function(){const e=[];for(let t=C;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}();let T="",O=0,D=0,I=0,R=!1;try{if(E.__emitTokens)E.__emitTokens(t,M);else{for(C.matcher.considerAll();;){I++,R?R=!1:C.matcher.considerAll(),C.matcher.lastIndex=D;const e=C.matcher.exec(t);if(!e)break;const n=_(t.substring(D,e.index),e);D=e.index+n}_(t.substring(D))}return M.finalize(),A=M.toHTML(),{language:e,value:A,relevance:O,illegal:!1,_emitter:M,_top:C}}catch(n){if(n.message&&n.message.includes("Illegal"))return{language:e,value:oe(t),illegal:!0,relevance:0,_illegalBy:{message:n.message,index:D,context:t.slice(D-100,D+100),mode:n.mode,resultSoFar:A},_emitter:M};if(s)return{language:e,value:oe(t),illegal:!1,relevance:0,errorRaised:n,_emitter:M,_top:C};throw n}}function v(e,t){t=t||u.languages||Object.keys(i);const n=function(e){const t={value:oe(e),illegal:!1,relevance:0,_top:l,_emitter:new u.__emitter(u)};return t._emitter.addText(e),t}(e),r=t.filter(k).filter(S).map(t=>y(t,e,!1));r.unshift(n);const o=r.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(k(e.language).supersetOf===t.language)return 1;if(k(t.language).supersetOf===e.language)return-1}return 0}),[s,a]=o,c=s;return c.secondBest=a,c}function x(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=u.languageDetectRe.exec(t);if(n){const t=k(n[1]);return t||(Y(a.replace("{}",n[1])),Y("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>g(e)||k(e))}(e);if(g(n))return;if(A("before:highlightElement",{el:e,language:n}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),u.throwUnescapedHTML))throw new re("One of your code blocks includes unescaped HTML.",e.innerHTML);t=e;const i=t.textContent,o=n?b(i,{language:n,ignoreIllegals:!0}):v(i);e.innerHTML=o.value,e.dataset.highlighted="yes",function(e,t,n){const i=t&&r[t]||n;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,n,o.language),e.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest&&(e.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance}),A("after:highlightElement",{el:e,result:o,text:i})}let w=!1;function _(){if("loading"===document.readyState)return w||window.addEventListener("DOMContentLoaded",function(){_()},!1),void(w=!0);document.querySelectorAll(u.cssSelector).forEach(x)}function k(e){return e=(e||"").toLowerCase(),i[e]||i[r[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{r[e.toLowerCase()]=t})}function S(e){const t=k(e);return t&&!t.disableAutodetect}function A(e,t){const n=e;o.forEach(function(e){e[n]&&e[n](t)})}Object.assign(e,{highlight:b,highlightAuto:v,highlightAll:_,highlightElement:x,highlightBlock:function(e){return Q("10.7.0","highlightBlock will be removed entirely in v12.0"),Q("10.7.0","Please use highlightElement now."),x(e)},configure:function(e){u=se(u,e)},initHighlighting:()=>{_(),Q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){_(),Q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(t,n){let r=null;try{r=n(e)}catch(e){if(X("Language definition for '{}' could not be registered.".replace("{}",t)),!s)throw e;X(e),r=l}r.name||(r.name=t),i[t]=r,r.rawDefinition=n.bind(null,e),r.aliases&&E(r.aliases,{languageName:t})},unregisterLanguage:function(e){delete i[e];for(const t of Object.keys(r))r[t]===e&&delete r[t]},listLanguages:function(){return Object.keys(i)},getLanguage:k,registerAliases:E,autoDetection:S,inherit:se,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),o.push(e)},removePlugin:function(e){const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString="11.11.1",e.regex={concat:f,lookahead:d,either:m,optional:p,anyNumberOfTimes:h};for(const e in B)"object"==typeof B[e]&&t(B[e]);return Object.assign(e,B),e},ce=le({});ce.newInstance=()=>le({}),e.exports=ce,ce.HighlightJS=ce,ce.default=ce},401:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,h=1;function p(e){var t=e.match(n);t&&(d+=t.length);var i=e.lastIndexOf("\n");h=~i?e.length-i:h+e.length}function f(){var e={line:d,column:h};return function(t){return t.position=new m(e),v(),t}}function m(e){this.start=e,this.end={line:d,column:h},this.source=l.source}m.prototype.content=e;var g=[];function b(t){var n=new Error(l.source+":"+d+":"+h+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=h,n.source=e,!l.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var i=n[0];return p(i),e=e.slice(i.length),n}}function v(){y(i)}function x(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return b("End of comment missing");var i=e.slice(2,n-2);return h+=2,p(i),e=e.slice(n),h+=2,t({type:"comment",comment:i})}}function _(){var e=f(),n=y(r);if(n){if(w(),!y(o))return b("property missing ':'");var i=y(s),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:i?u(i[0].replace(t,c)):c});return y(a),l}}return v(),function(){var e,t=[];for(x(t);e=_();)!1!==e&&(t.push(e),x(t));return t}()}},426:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||r.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,l):e.replace(o,l)).replace(i,a))}},598:function(e,t,n){var i=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(62)),r=n(426);function o(e,t){var n={};return e&&"string"==typeof e?((0,i.default)(e,function(e,i){e&&i&&(n[(0,r.camelCase)(e,t)]=i)}),n):n}o.default=o,e.exports=o},710:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},a=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<p;++h)if(null!=(t=arguments[h]))for(n in t)i=l(d,n),d!==(r=l(t,n))&&(f&&r&&(s(r)||(c=o(r)))?(c?(c=!1,u=i&&o(i)?i:[]):u=i&&s(i)?i:{},a(d,{name:n,newValue:e(f,u,r)})):void 0!==r&&a(d,{name:n,newValue:r}));return d}}},x={};function w(e){var t=x[e];if(void 0!==t)return t.exports;var n=x[e]={exports:{}};return v[e].call(n.exports,n,n.exports,w),n.exports}w.d=(e,t)=>{for(var n in t)w.o(t,n)&&!w.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},w.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var _={};w.r(_),w.d(_,{boolean:()=>La,booleanish:()=>Fa,commaOrSpaceSeparated:()=>Va,commaSeparated:()=>Ua,number:()=>za,overloadedBoolean:()=>Ba,spaceSeparated:()=>ja});var k={};function E(e=400){return{async sendMessage(t,n){const i={id:`${Date.now()}-assistant`,role:"assistant",content:`Echo: ${n}`,createdAt:Date.now()};return await new Promise(t=>setTimeout(t,e)),i}}}function S(e){const{baseUrl:t,endpoint:n="/common/ai/chat",headers:i={}}=e;return{async sendMessage(e,r,{signal:o}={}){const s=`${t.replace(/\/$/,"")}${n}`,a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify({history:e,input:r}),signal:o});if(!a.ok){const e=await a.text();throw new Error(`API error ${a.status}: ${e}`)}return await a.json()}}}w.r(k),w.d(k,{attentionMarkers:()=>bu,contentInitial:()=>du,disable:()=>yu,document:()=>uu,flow:()=>pu,flowInitial:()=>hu,insideSpan:()=>gu,string:()=>fu,text:()=>mu});const A={development:()=>S({baseUrl:"http://localhost:8080",endpoint:"/common/ai/chat"}),production:e=>S({baseUrl:e??"",endpoint:"/common/ai/chat"}),custom:e=>S(e)};var C,N={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},M=l.createContext&&l.createContext(N),T=["attr","size","title"];function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},O.apply(this,arguments)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){var i,r,o,s;i=e,r=t,o=n[t],s=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r),(r="symbol"==typeof s?s:s+"")in i?Object.defineProperty(i,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R(e){return e&&e.map((e,t)=>l.createElement(e.tag,I({key:t},e.attr),R(e.child)))}function P(e){return t=>l.createElement(L,O({attr:I({},e.attr)},t),R(e.child))}function L(e){var t=t=>{var n,{attr:i,size:r,title:o}=e,s=function(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,T),a=r||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),l.createElement("svg",O({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,s,{className:n,style:I(I({color:e.color||t.color},t.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&l.createElement("title",null,o),e.children)};return void 0!==M?l.createElement(M.Consumer,null,e=>t(e)):t(N)}function F(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function B(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 249.93a10.58 10.58 0 0 0-9.36-9.94L429 235.84a5.42 5.42 0 0 1-4.5-4.67c-.49-3.15-1-6.42-1.7-9.52a5.52 5.52 0 0 1 2.63-5.85l22.78-12.65a10.35 10.35 0 0 0 5-12.83l-3.95-10.9a10.32 10.32 0 0 0-12.13-6.51l-25.55 5a5.51 5.51 0 0 1-5.82-2.81c-1.49-2.79-3.11-5.63-4.8-8.42a5.6 5.6 0 0 1 .44-6.5l17-19.64a10.42 10.42 0 0 0 .39-13.76l-7.42-8.91a10.24 10.24 0 0 0-13.58-2l-22.37 13.43a5.39 5.39 0 0 1-6.39-.63c-2.47-2.17-5-4.26-7.37-6.19a5.45 5.45 0 0 1-1.72-6.21l9.26-24.4a10.35 10.35 0 0 0-4.31-13.07l-10.09-5.89a10.3 10.3 0 0 0-13.45 2.83L325 96.28a4.6 4.6 0 0 1-5.6 1.72c-.61-.25-5.77-2.36-9.78-3.7a5.42 5.42 0 0 1-3.74-5.23l.39-26.07a10.48 10.48 0 0 0-8.57-10.88l-11.45-2a10.45 10.45 0 0 0-11.75 7.17L266 82.1a5.46 5.46 0 0 1-5.36 3.65h-9.75a5.5 5.5 0 0 1-5.3-3.67l-8.46-24.67a10.46 10.46 0 0 0-11.77-7.25l-11.47 2a10.46 10.46 0 0 0-8.56 10.79l.4 26.16a5.45 5.45 0 0 1-3.86 5.25c-2.29.89-7.26 2.79-9.52 3.63-2 .72-4.18-.07-5.94-2.1l-16.26-20A10.3 10.3 0 0 0 156.69 73l-10.06 5.83A10.36 10.36 0 0 0 142.31 92l9.25 24.34a5.54 5.54 0 0 1-1.7 6.23c-2.43 2-4.92 4-7.4 6.22a5.38 5.38 0 0 1-6.35.64L114 115.74a10.4 10.4 0 0 0-13.61 2L93 126.63a10.31 10.31 0 0 0 .37 13.75L110.45 160a5.42 5.42 0 0 1 .45 6.45c-1.71 2.72-3.34 5.58-4.82 8.44a5.53 5.53 0 0 1-5.86 2.82l-25.51-4.93a10.34 10.34 0 0 0-12.14 6.51l-4 10.88a10.38 10.38 0 0 0 5 12.85l22.78 12.65a5.39 5.39 0 0 1 2.65 5.92l-.24 1.27c-.52 2.79-1 5.43-1.46 8.24a5.48 5.48 0 0 1-4.46 4.64l-25.69 4.15A10.42 10.42 0 0 0 48 250.16v11.58A10.26 10.26 0 0 0 57.16 272l25.68 4.14a5.41 5.41 0 0 1 4.5 4.67c.49 3.16 1 6.42 1.7 9.52a5.52 5.52 0 0 1-2.63 5.85l-22.77 12.67a10.35 10.35 0 0 0-5 12.83l4 10.9a10.33 10.33 0 0 0 12.13 6.51l25.55-4.95a5.49 5.49 0 0 1 5.82 2.81c1.5 2.8 3.11 5.63 4.8 8.42a5.58 5.58 0 0 1-.44 6.5l-17 19.63a10.41 10.41 0 0 0-.5 13.77l7.41 8.91a10.23 10.23 0 0 0 13.58 2l22.37-13.43a5.39 5.39 0 0 1 6.39.63c2.48 2.17 5 4.26 7.37 6.19a5.47 5.47 0 0 1 1.73 6.21l-9.27 24.4a10.35 10.35 0 0 0 4.31 13.07l10.11 5.84a10.3 10.3 0 0 0 13.45-2.82L187 415.92c1.4-1.73 3.6-2.5 5.23-1.84 3.48 1.44 5.81 2.25 9.94 3.63a5.44 5.44 0 0 1 3.75 5.23l-.4 26.05a10.5 10.5 0 0 0 8.57 10.88l11.45 2a10.43 10.43 0 0 0 11.75-7.17l8.5-24.77a5.45 5.45 0 0 1 5.36-3.65h9.75a5.49 5.49 0 0 1 5.3 3.67l8.47 24.67a10.48 10.48 0 0 0 10 7.41 9.74 9.74 0 0 0 1.78-.16l11.47-2a10.46 10.46 0 0 0 8.56-10.79l-.4-26.16a5.43 5.43 0 0 1 3.75-5.2c3.84-1.29 6.54-2.33 8.91-3.25l.6-.23c3.1-1.07 4.6.23 5.47 1.31l16.75 20.63A10.3 10.3 0 0 0 355 439l10.07-5.83a10.35 10.35 0 0 0 4.31-13.1l-9.24-24.34a5.52 5.52 0 0 1 1.69-6.23c2.43-2 4.92-4 7.4-6.22a5.39 5.39 0 0 1 6.38-.62l22.39 13.4a10.39 10.39 0 0 0 13.61-2l7.4-8.9a10.31 10.31 0 0 0-.37-13.75l-17.06-19.67a5.42 5.42 0 0 1-.45-6.45c1.71-2.71 3.34-5.57 4.82-8.44a5.55 5.55 0 0 1 5.86-2.82l25.48 4.97a10.34 10.34 0 0 0 12.14-6.51l3.95-10.88a10.37 10.37 0 0 0-5-12.84l-22.8-12.67a5.4 5.4 0 0 1-2.61-5.89l.24-1.27c.52-2.79 1-5.43 1.46-8.24a5.48 5.48 0 0 1 4.46-4.64l25.69-4.14a10.43 10.43 0 0 0 9.18-10.28v-11.71zm-282.45 94a15.8 15.8 0 0 1-25.47 2.66 135.06 135.06 0 0 1 .42-181.65 15.81 15.81 0 0 1 25.5 2.77l45.65 80.35a15.85 15.85 0 0 1 0 15.74zM256 391.11a134.75 134.75 0 0 1-28.31-3 15.81 15.81 0 0 1-10.23-23.36l46-80a15.79 15.79 0 0 1 13.7-7.93h92.14a15.8 15.8 0 0 1 15.1 20.53c-17.49 54.32-68.4 93.76-128.4 93.76zm7.51-163.9L218 147.07a15.81 15.81 0 0 1 10.31-23.3 134 134 0 0 1 27.69-2.88c60 0 110.91 39.44 128.37 93.79a15.8 15.8 0 0 1-15.1 20.53h-92a15.78 15.78 0 0 1-13.76-8z"},child:[]}]})(e)}function z(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m441 336.2-.06-.05c-9.93-9.18-22.78-11.34-32.16-12.92l-.69-.12c-9.05-1.49-10.48-2.5-14.58-6.17-2.44-2.17-5.35-5.65-5.35-9.94s2.91-7.77 5.34-9.94l30.28-26.87c25.92-22.91 40.2-53.66 40.2-86.59s-14.25-63.68-40.2-86.6c-35.89-31.59-85-49-138.37-49C223.72 48 162 71.37 116 112.11c-43.87 38.77-68 90.71-68 146.24s24.16 107.47 68 146.23c21.75 19.24 47.49 34.18 76.52 44.42a266.17 266.17 0 0 0 86.87 15h1.81c61 0 119.09-20.57 159.39-56.4 9.7-8.56 15.15-20.83 15.34-34.56.21-14.17-5.37-27.95-14.93-36.84zM112 208a32 32 0 1 1 32 32 32 32 0 0 1-32-32zm40 135a32 32 0 1 1 32-32 32 32 0 0 1-32 32zm40-199a32 32 0 1 1 32 32 32 32 0 0 1-32-32zm64 271a48 48 0 1 1 48-48 48 48 0 0 1-48 48zm72-239a32 32 0 1 1 32-32 32 32 0 0 1-32 32z"},child:[]}]})(e)}function j(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72z"},child:[]},{tag:"path",attr:{d:"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80z"},child:[]}]})(e)}function U(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 400a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm128 256a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zM128 272a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48z"},child:[]}]})(e)}function V(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32",d:"m400 148-21.12-24.57A191.43 191.43 0 0 0 240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 0 0 181.07-128"},child:[]},{tag:"path",attr:{d:"M464 97.42V208a16 16 0 0 1-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"},child:[]}]})(e)}function $(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m476.59 227.05-.16-.07L49.35 49.84A23.56 23.56 0 0 0 27.14 52 24.65 24.65 0 0 0 16 72.59v113.29a24 24 0 0 0 19.52 23.57l232.93 43.07a4 4 0 0 1 0 7.86L35.53 303.45A24 24 0 0 0 16 327v113.31A23.57 23.57 0 0 0 26.59 460a23.94 23.94 0 0 0 13.22 4 24.55 24.55 0 0 0 9.52-1.93L476.4 285.94l.19-.09a32 32 0 0 0 0-58.8z"},child:[]}]})(e)}function H(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M384 336a63.78 63.78 0 0 0-46.12 19.7l-148-83.27a63.85 63.85 0 0 0 0-32.86l148-83.27a63.8 63.8 0 1 0-15.73-27.87l-148 83.27a64 64 0 1 0 0 88.6l148 83.27A64 64 0 1 0 384 336z"},child:[]}]})(e)}function q(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8z"},child:[]},{tag:"path",attr:{d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32zM192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416zM272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14z"},child:[]}]})(e)}function K(e){return P({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M17.41 6.59 15 5.5l2.41-1.09L18.5 2l1.09 2.41L22 5.5l-2.41 1.09L18.5 9l-1.09-2.41zm3.87 6.13L20.5 11l-.78 1.72-1.72.78 1.72.78.78 1.72.78-1.72L23 13.5l-1.72-.78zm-5.04 1.65 1.94 1.47-2.5 4.33-2.24-.94c-.2.13-.42.26-.64.37l-.3 2.4h-5l-.3-2.41c-.22-.11-.43-.23-.64-.37l-2.24.94-2.5-4.33 1.94-1.47c-.01-.11-.01-.24-.01-.36s0-.25.01-.37l-1.94-1.47 2.5-4.33 2.24.94c.2-.13.42-.26.64-.37L7.5 6h5l.3 2.41c.22.11.43.23.64.37l2.24-.94 2.5 4.33-1.94 1.47c.01.12.01.24.01.37s0 .24-.01.36zM13 14c0-1.66-1.34-3-3-3s-3 1.34-3 3 1.34 3 3 3 3-1.34 3-3z"},child:[]}]})(e)}function G({title:e,onClose:i,onSettings:r}){return n("div",{className:"bmxcb__header",children:[n("div",{className:"bmxcb__header-brand",children:[t("img",{src:"https://www.bmx.trade/images/logo.png",alt:"BMX",className:"bmxcb__header-logo"}),t("span",{className:"bmxcb__header-title",children:e})]}),n("div",{className:"bmxcb__header-actions",children:[t("button",{className:"bmxcb__settings-button",onClick:r,"aria-label":"Open settings",children:t(K,{size:18})}),t("button",{className:"bmxcb__close",onClick:i,"aria-label":"Close",children:t(F,{size:18})})]})]})}function W(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy((...t)=>e(...t),{get:(n,i)=>"create"===i?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function Z(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}!function(e){e.USER="user",e.ASSISTANT="assistant",e.SYSTEM="system"}(C||(C={}));const X=e=>Array.isArray(e);function Y(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function Q(e){return"string"==typeof e||Array.isArray(e)}function J(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function ee(e,t,n,i){if("function"==typeof t){const[r,o]=J(i);t=t(void 0!==n?n:e.custom,r,o)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[r,o]=J(i);t=t(void 0!==n?n:e.custom,r,o)}return t}function te(e,t,n){const i=e.getProps();return ee(i,t,void 0!==n?n:i.custom,e)}const ne=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ie=["initial",...ne];function re(e){let t;return()=>(void 0===t&&(t=e()),t)}const oe=re(()=>void 0!==window.ScrollTimeline);class se{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map(n=>oe()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0);return()=>{n.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ae extends se{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function le(e,t){return e?e[t]||e.default||e:void 0}const ce=2e4;function ue(e){let t=0,n=e.next(t);for(;!n.done&&t<ce;)t+=50,n=e.next(t);return t>=ce?1/0:t}function de(e){return"function"==typeof e}function he(e,t){e.timeline=t,e.onfinish=null}const pe=e=>Array.isArray(e)&&"number"==typeof e[0],fe={linearEasing:void 0};function me(e,t){const n=re(e);return()=>{var e;return null!==(e=fe[t])&&void 0!==e?e:n()}}const ge=me(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),be=(e,t,n)=>{const i=t-e;return 0===i?1:(n-e)/i},ye=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let t=0;t<r;t++)i+=e(be(0,r-1,t))+", ";return`linear(${i.substring(0,i.length-2)})`};function ve(e){return Boolean("function"==typeof e&&ge()||!e||"string"==typeof e&&(e in we||ge())||pe(e)||Array.isArray(e)&&e.every(ve))}const xe=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,we={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xe([0,.65,.55,1]),circOut:xe([.55,0,1,.45]),backIn:xe([.31,.01,.66,-.59]),backOut:xe([.33,1.53,.69,.99])};function _e(e,t){return e?"function"==typeof e&&ge()?ye(e,t):pe(e)?xe(e):Array.isArray(e)?e.map(e=>_e(e,t)||we.easeOut):we[e]:void 0}const ke={x:!1,y:!1};function Ee(){return ke.x||ke.y}function Se(e,t){const n=function(e){if(e instanceof Element)return[e];if("string"==typeof e){let t=document;const n=t.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}(e),i=new AbortController;return[n,{passive:!0,...t,signal:i.signal},()=>i.abort()]}function Ae(e){return t=>{"touch"===t.pointerType||Ee()||e(t)}}const Ce=(e,t)=>!!t&&(e===t||Ce(e,t.parentElement)),Ne=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Me=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),Te=new WeakSet;function Oe(e){return t=>{"Enter"===t.key&&e(t)}}function De(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Ie(e){return Ne(e)&&!Ee()}const Re=e=>1e3*e,Pe=e=>e/1e3,Le=e=>e,Fe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Be=new Set(Fe),ze=new Set(["width","height","top","left","right","bottom",...Fe]),je=e=>X(e)?e[e.length-1]||0:e,Ue=["read","resolveKeyframes","update","preRender","render","postRender"];function Ve(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Ue.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,i=!1,r=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){o.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,r=!1,s=!1)=>{const a=s&&i?t:n;return r&&o.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{s=e,i?r=!0:(i=!0,[t,n]=[n,t],t.forEach(a),t.clear(),i=!1,r&&(r=!1,l.process(e)))}};return l}(o),e),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=s,p=()=>{const o=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(o-r.timestamp,40),1),r.timestamp=o,r.isProcessing=!0,a.process(r),l.process(r),c.process(r),u.process(r),d.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(p))};return{schedule:Ue.reduce((t,o)=>{const a=s[o];return t[o]=(t,o=!1,s=!1)=>(n||(n=!0,i=!0,r.isProcessing||e(p)),a.schedule(t,o,s)),t},{}),cancel:e=>{for(let t=0;t<Ue.length;t++)s[Ue[t]].cancel(e)},state:r,steps:s}}const{schedule:$e,cancel:He,state:qe,steps:Ke}=Ve("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Le,!0);let Ge;function We(){Ge=void 0}const Ze={now:()=>(void 0===Ge&&Ze.set(qe.isProcessing?qe.timestamp:performance.now()),Ge),set:e=>{Ge=e,queueMicrotask(We)}};function Xe(e,t){-1===e.indexOf(t)&&e.push(t)}function Ye(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qe{constructor(){this.subscriptions=[]}add(e){return Xe(this.subscriptions,e),()=>Ye(this.subscriptions,e)}notify(e,t,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(let r=0;r<i;r++){const i=this.subscriptions[r];i&&i(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Je(e,t){return t?e*(1e3/t):0}const et={current:void 0};class tt{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Ze.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Ze.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Qe);const n=this.events[e].add(t);return"change"===e?()=>{n(),$e.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return et.current&&et.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Ze.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Je(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function nt(e,t){return new tt(e,t)}function it(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,nt(n))}const rt=e=>Boolean(e&&e.getVelocity);function ot(e,t){const n=e.getValue("willChange");if(i=n,Boolean(rt(i)&&i.add))return n.add(t);var i}const st=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),at="data-"+st("framerAppearId");function lt(e){return e.props[at]}const ct=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ut(e,t,n,i){if(e===t&&n===i)return Le;return r=>0===r||1===r?r:ct(function(e,t,n,i,r){let o,s,a=0;do{s=t+(n-t)/2,o=ct(s,i,r)-e,o>0?n=s:t=s}while(Math.abs(o)>1e-7&&++a<12);return s}(r,0,1,e,n),t,i)}const dt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ht=e=>t=>1-e(1-t),pt=ut(.33,1.53,.69,.99),ft=ht(pt),mt=dt(ft),gt=e=>(e*=2)<1?.5*ft(e):.5*(2-Math.pow(2,-10*(e-1))),bt=e=>1-Math.sin(Math.acos(e)),yt=ht(bt),vt=dt(bt),xt=e=>/^0[^.\s]+$/u.test(e);function wt(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||xt(e)}const _t=(e,t,n)=>n>t?t:n<e?e:n,kt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Et={...kt,transform:e=>_t(0,1,e)},St={...kt,default:1},At=e=>Math.round(1e5*e)/1e5,Ct=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Nt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Mt=(e,t)=>n=>Boolean("string"==typeof n&&Nt.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Tt=(e,t,n)=>i=>{if("string"!=typeof i)return i;const[r,o,s,a]=i.match(Ct);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Ot={...kt,transform:e=>Math.round((e=>_t(0,255,e))(e))},Dt={test:Mt("rgb","red"),parse:Tt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Ot.transform(e)+", "+Ot.transform(t)+", "+Ot.transform(n)+", "+At(Et.transform(i))+")"},It={test:Mt("#"),parse:function(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:Dt.transform},Rt=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Pt=Rt("deg"),Lt=Rt("%"),Ft=Rt("px"),Bt=Rt("vh"),zt=Rt("vw"),jt={...Lt,parse:e=>Lt.parse(e)/100,transform:e=>Lt.transform(100*e)},Ut={test:Mt("hsl","hue"),parse:Tt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Lt.transform(At(t))+", "+Lt.transform(At(n))+", "+At(Et.transform(i))+")"},Vt={test:e=>Dt.test(e)||It.test(e)||Ut.test(e),parse:e=>Dt.test(e)?Dt.parse(e):Ut.test(e)?Ut.parse(e):It.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Dt.transform(e):Ut.transform(e)},$t=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Ht="number",qt="color",Kt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Gt(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const s=t.replace(Kt,e=>(Vt.test(e)?(i.color.push(o),r.push(qt),n.push(Vt.parse(e))):e.startsWith("var(")?(i.var.push(o),r.push("var"),n.push(e)):(i.number.push(o),r.push(Ht),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:s,indexes:i,types:r}}function Wt(e){return Gt(e).values}function Zt(e){const{split:t,types:n}=Gt(e),i=t.length;return e=>{let r="";for(let o=0;o<i;o++)if(r+=t[o],void 0!==e[o]){const t=n[o];r+=t===Ht?At(e[o]):t===qt?Vt.transform(e[o]):e[o]}return r}}const Xt=e=>"number"==typeof e?0:e,Yt={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Ct))||void 0===t?void 0:t.length)||0)+((null===(n=e.match($t))||void 0===n?void 0:n.length)||0)>0},parse:Wt,createTransformer:Zt,getAnimatableNone:function(e){const t=Wt(e);return Zt(e)(t.map(Xt))}},Qt=new Set(["brightness","contrast","saturate","opacity"]);function Jt(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[i]=n.match(Ct)||[];if(!i)return e;const r=n.replace(i,"");let o=Qt.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+r+")"}const en=/\b([a-z-]*)\(.*?\)/gu,tn={...Yt,getAnimatableNone:e=>{const t=e.match(en);return t?t.map(Jt).join(" "):e}},nn={borderWidth:Ft,borderTopWidth:Ft,borderRightWidth:Ft,borderBottomWidth:Ft,borderLeftWidth:Ft,borderRadius:Ft,radius:Ft,borderTopLeftRadius:Ft,borderTopRightRadius:Ft,borderBottomRightRadius:Ft,borderBottomLeftRadius:Ft,width:Ft,maxWidth:Ft,height:Ft,maxHeight:Ft,top:Ft,right:Ft,bottom:Ft,left:Ft,padding:Ft,paddingTop:Ft,paddingRight:Ft,paddingBottom:Ft,paddingLeft:Ft,margin:Ft,marginTop:Ft,marginRight:Ft,marginBottom:Ft,marginLeft:Ft,backgroundPositionX:Ft,backgroundPositionY:Ft},rn={rotate:Pt,rotateX:Pt,rotateY:Pt,rotateZ:Pt,scale:St,scaleX:St,scaleY:St,scaleZ:St,skew:Pt,skewX:Pt,skewY:Pt,distance:Ft,translateX:Ft,translateY:Ft,translateZ:Ft,x:Ft,y:Ft,z:Ft,perspective:Ft,transformPerspective:Ft,opacity:Et,originX:jt,originY:jt,originZ:Ft},on={...kt,transform:Math.round},sn={...nn,...rn,zIndex:on,size:Ft,fillOpacity:Et,strokeOpacity:Et,numOctaves:on},an={...sn,color:Vt,backgroundColor:Vt,outlineColor:Vt,fill:Vt,stroke:Vt,borderColor:Vt,borderTopColor:Vt,borderRightColor:Vt,borderBottomColor:Vt,borderLeftColor:Vt,filter:tn,WebkitFilter:tn},ln=e=>an[e];function cn(e,t){let n=ln(e);return n!==tn&&(n=Yt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const un=new Set(["auto","none","0"]),dn=e=>e===kt||e===Ft,hn=(e,t)=>parseFloat(e.split(", ")[t]),pn=(e,t)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return hn(r[1],t);{const t=i.match(/^matrix\((.+)\)$/u);return t?hn(t[1],e):0}},fn=new Set(["x","y","z"]),mn=Fe.filter(e=>!fn.has(e)),gn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:pn(4,13),y:pn(5,14)};gn.translateX=gn.x,gn.translateY=gn.y;const bn=new Set;let yn=!1,vn=!1;function xn(){if(vn){const e=Array.from(bn).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return mn.forEach(n=>{const i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{var i;null===(i=e.getValue(t))||void 0===i||i.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}vn=!1,yn=!1,bn.forEach(e=>e.complete()),bn.clear()}function wn(){bn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(vn=!0)})}class _n{constructor(e,t,n,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(bn.add(this),yn||(yn=!0,$e.read(wn),$e.resolveKeyframes(xn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:i}=this;for(let r=0;r<e.length;r++)if(null===e[r])if(0===r){const r=null==i?void 0:i.get(),o=e[e.length-1];if(void 0!==r)e[0]=r;else if(n&&t){const i=n.readValue(t,o);null!=i&&(e[0]=i)}void 0===e[0]&&(e[0]=o),i&&void 0===r&&i.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),bn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,bn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let kn=Le,En=Le;const Sn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),An=e=>t=>"string"==typeof t&&t.startsWith(e),Cn=An("--"),Nn=An("var(--"),Mn=e=>!!Nn(e)&&Tn.test(e.split("/*")[0].trim()),Tn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,On=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dn(e,t,n=1){En(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[i,r]=function(e){const t=On.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${null!=n?n:i}`,r]}(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const e=o.trim();return Sn(e)?parseFloat(e):e}return Mn(r)?Dn(r,t,n+1):r}const In=e=>t=>t.test(e),Rn=[kt,Ft,Lt,Pt,zt,Bt,{test:e=>"auto"===e,parse:e=>e}],Pn=e=>Rn.find(In(e));class Ln extends _n{constructor(e,t,n,i,r){super(e,t,n,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let i=e[n];if("string"==typeof i&&(i=i.trim(),Mn(i))){const r=Dn(i,t.current);void 0!==r&&(e[n]=r),n===e.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!ze.has(n)||2!==e.length)return;const[i,r]=e,o=Pn(i),s=Pn(r);if(o!==s)if(dn(o)&&dn(s))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)wt(e[t])&&n.push(t);n.length&&function(e,t,n){let i,r=0;for(;r<e.length&&!i;){const t=e[r];"string"==typeof t&&!un.has(t)&&Gt(t).values.length&&(i=e[r]),r++}if(i&&n)for(const r of t)e[r]=cn(n,i)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gn[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const i=t[t.length-1];void 0!==i&&e.getValue(n,i).jump(i,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=gn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Fn=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Yt.test(e)&&"0"!==e||e.startsWith("url(")));function Bn(e,t,n,i){const r=e[0];if(null===r)return!1;if("display"===t||"visibility"===t)return!0;const o=e[e.length-1],s=Fn(r,t),a=Fn(o,t);return kn(s===a,`You are trying to animate ${t} from "${r}" to "${o}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${o} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||de(n))&&i)}const zn=e=>null!==e;function jn(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(zn),o=t&&"loop"!==n&&t%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}class Un{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ze.now(),this.options={autoplay:e,delay:t,type:n,repeat:i,repeatDelay:r,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(wn(),xn()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Ze.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:r,delay:o,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Bn(e,n,i,r)){if(!o)return a&&a(jn(e,this.options,t)),s&&s(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Vn=(e,t,n)=>e+(t-e)*n;function $n(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Hn(e,t){return n=>n>0?t:e}const qn=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},Kn=[It,Dt,Ut];function Gn(e){const t=(n=e,Kn.find(e=>e.test(n)));var n;if(kn(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let i=t.parse(e);return t===Ut&&(i=function({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,n/=100;let r=0,o=0,s=0;if(t/=100){const i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;r=$n(a,i,e+1/3),o=$n(a,i,e),s=$n(a,i,e-1/3)}else r=o=s=n;return{red:Math.round(255*r),green:Math.round(255*o),blue:Math.round(255*s),alpha:i}}(i)),i}const Wn=(e,t)=>{const n=Gn(e),i=Gn(t);if(!n||!i)return Hn(e,t);const r={...n};return e=>(r.red=qn(n.red,i.red,e),r.green=qn(n.green,i.green,e),r.blue=qn(n.blue,i.blue,e),r.alpha=Vn(n.alpha,i.alpha,e),Dt.transform(r))},Zn=(e,t)=>n=>t(e(n)),Xn=(...e)=>e.reduce(Zn),Yn=new Set(["none","hidden"]);function Qn(e,t){return n=>Vn(e,t,n)}function Jn(e){return"number"==typeof e?Qn:"string"==typeof e?Mn(e)?Hn:Vt.test(e)?Wn:ni:Array.isArray(e)?ei:"object"==typeof e?Vt.test(e)?Wn:ti:Hn}function ei(e,t){const n=[...e],i=n.length,r=e.map((e,n)=>Jn(e)(e,t[n]));return e=>{for(let t=0;t<i;t++)n[t]=r[t](e);return n}}function ti(e,t){const n={...e,...t},i={};for(const r in n)void 0!==e[r]&&void 0!==t[r]&&(i[r]=Jn(e[r])(e[r],t[r]));return e=>{for(const t in i)n[t]=i[t](e);return n}}const ni=(e,t)=>{const n=Yt.createTransformer(t),i=Gt(e),r=Gt(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Yn.has(e)&&!r.values.length||Yn.has(t)&&!i.values.length?function(e,t){return Yn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Xn(ei(function(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],a=e.indexes[s][r[s]],l=null!==(n=e.values[a])&&void 0!==n?n:0;i[o]=l,r[s]++}return i}(i,r),r.values),n):(kn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Hn(e,t))};function ii(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?Vn(e,t,n):Jn(e)(e,t)}function ri(e,t,n){const i=Math.max(t-5,0);return Je(n-e(i),t-i)}const oi=.01,si=2,ai=.005,li=.5;const ci=12;function ui(e,t){return e*Math.sqrt(1-t*t)}const di=["duration","bounce"],hi=["stiffness","damping","mass"];function pi(e,t){return t.some(t=>void 0!==e[t])}function fi(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!pi(e,hi)&&pi(e,di))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(1.2*n),r=i*i,o=2*_t(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:1,stiffness:r,damping:o}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:i=1}){let r,o;kn(e<=Re(10),"Spring duration must be 10 seconds or less");let s=1-t;s=_t(.05,1,s),e=_t(.01,10,Pe(e)),s<1?(r=t=>{const i=t*s,r=i*e;return.001-(i-n)/ui(t,s)*Math.exp(-r)},o=t=>{const i=t*s*e,o=i*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-i),c=ui(Math.pow(t,2),s);return(.001-r(t)>0?-1:1)*((o-a)*l)/c}):(r=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let i=n;for(let n=1;n<ci;n++)i-=e(i)/t(i);return i}(r,o,5/e);if(e=Re(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,2)*i;return{stiffness:t,damping:2*s*Math.sqrt(i*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Pe(n.velocity||0)}),f=h||0,m=c/(2*Math.sqrt(l*u)),g=s-o,b=Pe(Math.sqrt(l/u)),y=Math.abs(g)<5;let v;if(i||(i=y?oi:si),r||(r=y?ai:li),m<1){const e=ui(b,m);v=t=>{const n=Math.exp(-m*b*t);return s-n*((f+m*b*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)v=e=>s-Math.exp(-b*e)*(g+(f+b*g)*e);else{const e=b*Math.sqrt(m*m-1);v=t=>{const n=Math.exp(-m*b*t),i=Math.min(e*t,300);return s-n*((f+m*b*g)*Math.sinh(i)+e*g*Math.cosh(i))/e}}const x={calculatedDuration:p&&d||null,next:e=>{const t=v(e);if(p)a.done=e>=d;else{let n=0;m<1&&(n=0===e?Re(f):ri(v,e,t));const o=Math.abs(n)<=i,l=Math.abs(s-t)<=r;a.done=o&&l}return a.value=a.done?s:t,a},toString:()=>{const e=Math.min(ue(x),ce),t=ye(t=>x.next(e*t).value,e,30);return e+"ms "+t}};return x}function mi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let f=n*t;const m=d+f,g=void 0===s?m:s(m);g!==m&&(f=g-d);const b=e=>-f*Math.exp(-e/i),y=e=>g+b(e),v=e=>{const t=b(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let x,w;const _=e=>{var t;t=h.value,(void 0!==a&&t<a||void 0!==l&&t>l)&&(x=e,w=fi({keyframes:[h.value,p(h.value)],velocity:ri(y,e,h.value),damping:r,stiffness:o,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,v(e),_(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&v(e),h)}}}const gi=ut(.42,0,1,1),bi=ut(0,0,.58,1),yi=ut(.42,0,.58,1),vi={linear:Le,easeIn:gi,easeInOut:yi,easeOut:bi,circIn:bt,circInOut:vt,circOut:yt,backIn:ft,backInOut:mt,backOut:pt,anticipate:gt},xi=e=>{if(pe(e)){En(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,i,r]=e;return ut(t,n,i,r)}return"string"==typeof e?(En(void 0!==vi[e],`Invalid easing type '${e}'`),vi[e]):e};function wi({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=(e=>Array.isArray(e)&&"number"!=typeof e[0])(i)?i.map(xi):xi(i),o={done:!1,value:t[0]},s=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=be(0,t,i);e.push(Vn(n,1,r))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:i,mixer:r}={}){const o=e.length;if(En(o===t.length,"Both input and output ranges must be the same length"),1===o)return()=>t[0];if(2===o&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const i=[],r=n||ii,o=e.length-1;for(let n=0;n<o;n++){let o=r(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||Le:t;o=Xn(e,o)}i.push(o)}return i}(t,i,r),l=a.length,c=n=>{if(s&&n<e[0])return t[0];let i=0;if(l>1)for(;i<e.length-2&&!(n<e[i+1]);i++);const r=be(e[i],e[i+1],n);return a[i](r)};return n?t=>c(_t(e[0],e[o-1],t)):c}(s,t,{ease:Array.isArray(r)?r:(l=t,c=r,l.map(()=>c||yi).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(o.value=a(t),o.done=t>=e,o)}}const _i=e=>{const t=({timestamp:t})=>e(t);return{start:()=>$e.update(t,!0),stop:()=>He(t),now:()=>qe.isProcessing?qe.timestamp:Ze.now()}},ki={decay:mi,inertia:mi,tween:wi,keyframes:wi,spring:fi},Ei=e=>e/100;class Si extends Un{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:i,keyframes:r}=this.options,o=(null==i?void 0:i.KeyframeResolver)||_n;this.resolver=new o(r,(e,t)=>this.onKeyframesResolved(e,t),t,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,s=de(t)?t:ki[t]||wi;let a,l;s!==wi&&"number"!=typeof e[0]&&(a=Xn(Ei,ii(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===r&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-o})),null===c.calculatedDuration&&(c.calculatedDuration=ue(c));const{calculatedDuration:u}=c,d=u+i;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-i}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return r.next(0);const{delay:d,repeat:h,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),b=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,v=r;if(h){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,h+1),Boolean(t%2)&&("reverse"===p?(n=1-n,f&&(n-=f/u)):"mirror"===p&&(v=o)),y=_t(0,1,n)*u}const x=b?{done:!1,value:a[0]}:v.next(y);s&&(x.value=s(x.value));let{done:w}=x;b||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==i&&(x.value=jn(a,this.options,i)),m&&m(x.value),_&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Pe(e.calculatedDuration):0}get time(){return Pe(this.currentTime)}set time(e){e=Re(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Pe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=_i,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Ai=new Set(["opacity","clipPath","filter","transform"]),Ci=re(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ni={anticipate:gt,backInOut:mt,circInOut:vt};class Mi extends Un{constructor(e){super(e);const{name:t,motionValue:n,element:i,keyframes:r}=this.options;this.resolver=new Ln(r,(e,t)=>this.onKeyframesResolved(e,t),t,n,i),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:i,ease:r,type:o,motionValue:s,name:a,startTime:l}=this.options;if(!s.owner||!s.owner.current)return!1;var c;if("string"==typeof r&&ge()&&r in Ni&&(r=Ni[r]),de((c=this.options).type)||"spring"===c.type||!ve(c.ease)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new Si({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),r.push(i.value),o+=10;return{times:void 0,keyframes:r,duration:o-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,i=u.times,r=u.ease,o="keyframes"}const u=function(e,t,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=_e(a,r);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(s.owner.current,a,e,{...this.options,duration:n,times:i,ease:r});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(he(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;s.set(jn(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:n,times:i,type:o,ease:r,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Pe(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Pe(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Re(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Le;const{animation:n}=t;he(n,e)}else this.pendingTimeline=e;return Le}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:i,type:r,ease:o,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new Si({...c,keyframes:n,duration:i,type:r,ease:o,times:s,isGenerator:!0}),d=Re(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:r,damping:o,type:s}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return Ci()&&n&&Ai.has(n)&&!a&&!l&&!i&&"mirror"!==r&&0!==o&&"inertia"!==s}}const Ti={type:"spring",stiffness:500,damping:25,restSpeed:10},Oi={type:"keyframes",duration:.8},Di={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ii=(e,{keyframes:t})=>t.length>2?Oi:Be.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Ti:Di,Ri=(e,t,n,i={},r,o)=>s=>{const a=le(i,e)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=Re(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:r};(function({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...Ii(e,u)}),u.duration&&(u.duration=Re(u.duration)),u.repeatDelay&&(u.repeatDelay=Re(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!o&&void 0!==t.get()){const e=jn(u.keyframes,a);if(void 0!==e)return $e.update(()=>{u.onUpdate(e),u.onComplete()}),new ae([])}return!o&&Mi.supports(u)?new Mi(u):new Si(u)};function Pi({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,i}function Li(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;i&&(s=i);const c=[],u=r&&e.animationState&&e.animationState.getState()[r];for(const t in l){const i=e.getValue(t,null!==(o=e.latestValues[t])&&void 0!==o?o:null),r=l[t];if(void 0===r||u&&Pi(u,t))continue;const a={delay:n,...le(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=lt(e);if(n){const e=window.MotionHandoffAnimation(n,t,$e);null!==e&&(a.startTime=e,d=!0)}}ot(e,t),i.start(Ri(t,i,r,e.shouldReduceMotion&&ze.has(t)?{type:!1}:a,e,d));const h=i.animation;h&&c.push(h)}return a&&Promise.all(c).then(()=>{$e.update(()=>{a&&function(e,t){const n=te(e,t);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const t in o)it(e,t,je(o[t]))}(e,a)})}),c}function Fi(e,t,n={}){var i;const r=te(e,t,"exit"===n.type?null===(i=e.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Li(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:s,staggerDirection:a}=o;return function(e,t,n=0,i=0,r=1,o){const s=[],a=(e.variantChildren.size-1)*i,l=1===r?(e=0)=>e*i:(e=0)=>a-e*i;return Array.from(e.variantChildren).sort(Bi).forEach((e,i)=>{e.notify("AnimationStart",t),s.push(Fi(e,t,{...o,delay:n+l(i)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(s)}(e,t,r+i,s,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then(()=>t())}return Promise.all([s(),a(n.delay)])}function Bi(e,t){return e.sortNodePosition(t)}const zi=ie.length;function ji(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&ji(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<zi;n++){const i=ie[n],r=e.props[i];(Q(r)||!1===r)&&(t[i]=r)}return t}const Ui=[...ne].reverse(),Vi=ne.length;function $i(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let i;if(e.notify("AnimationStart",t),Array.isArray(t)){const r=t.map(t=>Fi(e,t,n));i=Promise.all(r)}else if("string"==typeof t)i=Fi(e,t,n);else{const r="function"==typeof t?te(e,t,n.custom):t;i=Promise.all(Li(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=Ki(),i=!0;const r=t=>(n,i)=>{var r;const o=te(e,i,"exit"===t?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);if(o){const{transition:e,transitionEnd:t,...i}=o;n={...n,...i,...t}}return n};function o(o){const{props:s}=e,a=ji(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<Vi;t++){const h=Ui[t],p=n[h],f=void 0!==s[h]?s[h]:a[h],m=Q(f),g=h===o?p.isActive:null;!1===g&&(d=t);let b=f===a[h]&&f!==s[h]&&m;if(b&&i&&e.manuallyAnimateOnMount&&(b=!1),p.protectedKeys={...u},!p.isActive&&null===g||!f&&!p.prevProp||Z(f)||"boolean"==typeof f)continue;const y=Hi(p.prevProp,f);let v=y||h===o&&p.isActive&&!b&&m||t>d&&m,x=!1;const w=Array.isArray(f)?f:[f];let _=w.reduce(r(h),{});!1===g&&(_={});const{prevResolvedValues:k={}}=p,E={...k,..._},S=t=>{v=!0,c.has(t)&&(x=!0,c.delete(t)),p.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in E){const t=_[e],n=k[e];if(u.hasOwnProperty(e))continue;let i=!1;i=X(t)&&X(n)?!Y(t,n):t!==n,i?null!=t?S(e):c.add(e):void 0!==t&&c.has(e)?S(e):p.protectedKeys[e]=!0}p.prevProp=f,p.prevResolvedValues=_,p.isActive&&(u={...u,..._}),i&&e.blockInitialAnimation&&(v=!1),v&&(!b||!y||x)&&l.push(...w.map(e=>({animation:e,options:{type:h}})))}if(c.size){const t={};c.forEach(n=>{const i=e.getBaseTarget(n),r=e.getValue(n);r&&(r.liveStyle=!0),t[n]=null!=i?i:null}),l.push({animation:t})}let h=Boolean(l.length);return!i||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(h=!1),i=!1,h?t(l):Promise.resolve()}return{animateChanges:o,setActive:function(t,i){var r;if(n[t].isActive===i)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,i)}),n[t].isActive=i;const s=o(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Ki(),i=!0}}}function Hi(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Y(t,e)}function qi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ki(){return{animate:qi(!0),whileInView:qi(),whileHover:qi(),whileTap:qi(),whileDrag:qi(),whileFocus:qi(),exit:qi()}}class Gi{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Wi=0;const Zi={animation:{Feature:class extends Gi{constructor(e){super(e),e.animationState||(e.animationState=$i(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Z(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Gi{constructor(){super(...arguments),this.id=Wi++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function Xi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function Yi(e){return{point:{x:e.pageX,y:e.pageY}}}function Qi(e,t,n,i){return Xi(e,t,(e=>t=>Ne(t)&&e(t,Yi(t)))(n),i)}const Ji=(e,t)=>Math.abs(e-t);class er{constructor(e,t,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=ir(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Ji(e.x,t.x),i=Ji(e.y,t.y);return Math.sqrt(n**2+i**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:i}=e,{timestamp:r}=qe;this.history.push({...i,timestamp:r});const{onStart:o,onMove:s}=this.handlers;t||(o&&o(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=tr(t,this.transformPagePoint),$e.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:r}=this.handlers;if(this.dragSnapToOrigin&&r&&r(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=ir("pointercancel"===e.type?this.lastMoveEventInfo:tr(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),i&&i(e,o)},!Ne(e))return;this.dragSnapToOrigin=r,this.handlers=t,this.transformPagePoint=n,this.contextWindow=i||window;const o=tr(Yi(e),this.transformPagePoint),{point:s}=o,{timestamp:a}=qe;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,ir(o,this.history)),this.removeListeners=Xn(Qi(this.contextWindow,"pointermove",this.handlePointerMove),Qi(this.contextWindow,"pointerup",this.handlePointerUp),Qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),He(this.updatePoint)}}function tr(e,t){return t?{point:t(e.point)}:e}function nr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ir({point:e},t){return{point:e,delta:nr(e,or(t)),offset:nr(e,rr(t)),velocity:sr(t,.1)}}function rr(e){return e[0]}function or(e){return e[e.length-1]}function sr(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=or(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Re(t)));)n--;if(!i)return{x:0,y:0};const o=Pe(r.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const s={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ar(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function lr(e){return e.max-e.min}function cr(e,t,n,i=.5){e.origin=i,e.originPoint=Vn(t.min,t.max,e.origin),e.scale=lr(n)/lr(t),e.translate=Vn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function ur(e,t,n,i){cr(e.x,t.x,n.x,i?i.originX:void 0),cr(e.y,t.y,n.y,i?i.originY:void 0)}function dr(e,t,n){e.min=n.min+t.min,e.max=e.min+lr(t)}function hr(e,t,n){e.min=t.min-n.min,e.max=e.min+lr(t)}function pr(e,t,n){hr(e.x,t.x,n.x),hr(e.y,t.y,n.y)}function fr(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function mr(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}const gr=.35;function br(e,t,n){return{min:yr(e,t),max:yr(e,n)}}function yr(e,t){return"number"==typeof e?e:e[t]||0}const vr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function xr(e){return[e("x"),e("y")]}function wr({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function _r(e){return void 0===e||1===e}function kr({scale:e,scaleX:t,scaleY:n}){return!_r(e)||!_r(t)||!_r(n)}function Er(e){return kr(e)||Sr(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Sr(e){return Ar(e.x)||Ar(e.y)}function Ar(e){return e&&"0%"!==e}function Cr(e,t,n){return n+t*(e-n)}function Nr(e,t,n,i,r){return void 0!==r&&(e=Cr(e,r,i)),Cr(e,n,i)+t}function Mr(e,t=0,n=1,i,r){e.min=Nr(e.min,t,n,i,r),e.max=Nr(e.max,t,n,i,r)}function Tr(e,{x:t,y:n}){Mr(e.x,t.translate,t.scale,t.originPoint),Mr(e.y,n.translate,n.scale,n.originPoint)}const Or=.999999999999,Dr=1.0000000000001;function Ir(e,t){e.min=e.min+t,e.max=e.max+t}function Rr(e,t,n,i,r=.5){Mr(e,t,n,Vn(e.min,e.max,r),i)}function Pr(e,t){Rr(e.x,t.x,t.scaleX,t.scale,t.originX),Rr(e.y,t.y,t.scaleY,t.scale,t.originY)}function Lr(e,t){return wr(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}const Fr=({current:e})=>e?e.ownerDocument.defaultView:null,Br=new WeakMap;class zr{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new er(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Yi(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:i,onDragStart:r}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?ke[o]?null:(ke[o]=!0,()=>{ke[o]=!1}):ke.x||ke.y?null:(ke.x=ke.y=!0,()=>{ke.x=ke.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xr(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Lt.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[e];i&&(t=lr(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),r&&$e.postRender(()=>r(e,t)),ot(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:r,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:s}=t;if(i&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&r&&r(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),o&&o(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>xr(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:Fr(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=t;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&$e.postRender(()=>r(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:i}=this.getProps();if(!n||!jr(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=function(e,{min:t,max:n},i){return void 0!==t&&e<t?e=i?Vn(t,e,i.min):Math.max(e,t):void 0!==n&&e>n&&(e=i?Vn(n,e,i.max):Math.min(e,n)),e}(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,r=this.constraints;t&&ar(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(e,{top:t,left:n,bottom:i,right:r}){return{x:fr(e.x,n,r),y:fr(e.y,t,i)}}(i.layoutBox,t),this.elastic=function(e=gr){return!1===e?e=0:!0===e&&(e=gr),{x:br(e,"left","right"),y:br(e,"top","bottom")}}(n),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&xr(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(i.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!ar(e))return!1;const n=e.current;En(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=function(e,t,n){const i=Lr(e,n),{scroll:r}=t;return r&&(Ir(i.x,r.offset.x),Ir(i.y,r.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(e,t){return{x:mr(e.x,t.x),y:mr(e.y,t.y)}}(i.layout.layoutBox,r);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=wr(e))}return o}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=xr(s=>{if(!jr(s,t,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...r,...l};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return ot(this.visualElement,e),n.start(Ri(e,n,0,t,this.visualElement,!1))}stopAnimation(){xr(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){xr(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){xr(t=>{const{drag:n}=this.getProps();if(!jr(t,n,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(t);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[t];r.set(e[t]-Vn(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ar(t)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};xr(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();i[e]=function(e,t){let n=.5;const i=lr(e),r=lr(t);return r>i?n=be(t.min,t.max-i,e.min):i>r&&(n=be(e.min,e.max-r,t.min)),_t(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),xr(t=>{if(!jr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:r,max:o}=this.constraints[t];n.set(Vn(r,o,i[t]))})}addListeners(){if(!this.visualElement.current)return;Br.set(this.visualElement,this);const e=Qi(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();ar(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),$e.read(t);const r=Xi(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(xr(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=gr,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:s}}}function jr(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Ur=e=>(t,n)=>{e&&$e.postRender(()=>e(t,n))},Vr=s(null),$r=s({}),Hr=s({}),qr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Kr(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Gr={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Ft.test(e))return e;e=parseFloat(e)}return`${Kr(e,t.target.x)}% ${Kr(e,t.target.y)}%`}},Wr={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=Yt.parse(e);if(r.length>5)return i;const o=Yt.createTransformer(e),s="number"!=typeof r[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;r[0+s]/=a,r[1+s]/=l;const c=Vn(a,l,.5);return"number"==typeof r[2+s]&&(r[2+s]/=c),"number"==typeof r[3+s]&&(r[3+s]/=c),o(r)}},Zr={},{schedule:Xr,cancel:Yr}=Ve(queueMicrotask,!1);class Qr extends r{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:i}=this.props,{projection:r}=e;var o;o=eo,Object.assign(Zr,o),r&&(t.group&&t.group.add(r),n&&n.register&&i&&n.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),qr.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:i,isPresent:r}=this.props,o=n.projection;return o?(o.isPresent=r,i||e.layoutDependency!==t||void 0===t?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||$e.postRender(()=>{const e=o.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Xr.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Jr(e){const[n,i]=function(e=!0){const t=d(Vr);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,o=p();h(()=>{e&&r(o)},[e]);const s=u(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,s]:[!0]}(),r=d($r);return t(Qr,{...e,layoutGroup:r,switchLayoutGroup:d(Hr),isPresent:n,safeToRemove:i})}const eo={borderRadius:{...Gr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gr,borderTopRightRadius:Gr,borderBottomLeftRadius:Gr,borderBottomRightRadius:Gr,boxShadow:Wr},to=(e,t)=>e.depth-t.depth;class no{constructor(){this.children=[],this.isDirty=!1}add(e){Xe(this.children,e),this.isDirty=!0}remove(e){Ye(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(to),this.isDirty=!1,this.children.forEach(e)}}function io(e){const t=rt(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const ro=["TopLeft","TopRight","BottomLeft","BottomRight"],oo=ro.length,so=e=>"string"==typeof e?parseFloat(e):e,ao=e=>"number"==typeof e||Ft.test(e);function lo(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const co=ho(0,.5,yt),uo=ho(.5,.95,Le);function ho(e,t,n){return i=>i<e?0:i>t?1:n(be(e,t,i))}function po(e,t){e.min=t.min,e.max=t.max}function fo(e,t){po(e.x,t.x),po(e.y,t.y)}function mo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function go(e,t,n,i,r){return e=Cr(e-=t,1/n,i),void 0!==r&&(e=Cr(e,1/r,i)),e}function bo(e,t,[n,i,r],o,s){!function(e,t=0,n=1,i=.5,r,o=e,s=e){if(Lt.test(t)&&(t=parseFloat(t),t=Vn(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=Vn(o.min,o.max,i);e===o&&(a-=t),e.min=go(e.min,t,n,a,r),e.max=go(e.max,t,n,a,r)}(e,t[n],t[i],t[r],t.scale,o,s)}const yo=["x","scaleX","originX"],vo=["y","scaleY","originY"];function xo(e,t,n,i){bo(e.x,t,yo,n?n.x:void 0,i?i.x:void 0),bo(e.y,t,vo,n?n.y:void 0,i?i.y:void 0)}function wo(e){return 0===e.translate&&1===e.scale}function _o(e){return wo(e.x)&&wo(e.y)}function ko(e,t){return e.min===t.min&&e.max===t.max}function Eo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function So(e,t){return Eo(e.x,t.x)&&Eo(e.y,t.y)}function Ao(e){return lr(e.x)/lr(e.y)}function Co(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class No{constructor(){this.members=[]}add(e){Xe(this.members,e),e.scheduleRender()}remove(e){if(Ye(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Mo={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},To="undefined"!=typeof window&&void 0!==window.MotionDebug,Oo=["","X","Y","Z"],Do={visibility:"hidden"};let Io=0;function Ro(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function Po(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lt(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",$e,!(t||i))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&Po(i)}function Lo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Io++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,To&&(Mo.totalNodes=Mo.resolvedTargetDeltas=Mo.recalculatedProjection=0),this.nodes.forEach(zo),this.nodes.forEach(Ko),this.nodes.forEach(Go),this.nodes.forEach(jo),To&&window.MotionDebug.record(Mo)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new no)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Qe),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var i;this.isSVG=(i=t)instanceof SVGElement&&"svg"!==i.tagName,this.instance=t;const{layoutId:r,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||r)&&(this.isLayoutDirty=!0),e){let n;const i=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Ze.now(),i=({timestamp:r})=>{const o=r-n;o>=t&&(He(i),e(o-t))};return $e.read(i,!0),()=>He(i)}(i,250),qr.hasAnimatedSinceResize&&(qr.hasAnimatedSinceResize=!1,this.nodes.forEach(qo))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const r=this.options.transition||s.getDefaultTransition()||Jo,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!So(this.targetLayout,i)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...le(r,"layout"),onPlay:o,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||qo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,He(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Wo),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Po(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Vo);this.isUpdating||this.nodes.forEach($o),this.isUpdating=!1,this.nodes.forEach(Ho),this.nodes.forEach(Fo),this.nodes.forEach(Bo),this.clearAllSnapshots();const e=Ze.now();qe.delta=_t(0,1e3/60,e-qe.timestamp),qe.timestamp=e,qe.isProcessing=!0,Ke.update.process(qe),Ke.preRender.process(qe),Ke.render.process(qe),qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Uo),this.sharedNodes.forEach(Zo)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,$e.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){$e.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=i(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!r)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!_o(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;e&&(t||Er(this.latestValues)||o)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var i;return e&&(n=this.removeTransform(n)),ns((i=n).x),ns(i.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(rs)){const{scroll:e}=this.root;e&&(Ir(n.x,e.offset.x),Ir(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(fo(n,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return n;for(let t=0;t<this.path.length;t++){const i=this.path[t],{scroll:r,options:o}=i;i!==this.root&&r&&o.layoutScroll&&(r.wasRoot&&fo(n,e),Ir(n.x,r.offset.x),Ir(n.y,r.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};fo(n,e);for(let e=0;e<this.path.length;e++){const i=this.path[e];!t&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Pr(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Er(i.latestValues)&&Pr(n,i.latestValues)}return Er(this.latestValues)&&Pr(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};fo(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!n.instance)continue;if(!Er(n.latestValues))continue;kr(n.latestValues)&&n.updateSnapshot();const i=vr();fo(i,n.measurePageBox()),xo(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Er(this.latestValues)&&xo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(e||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:r,layoutId:o}=this.options;if(this.layout&&(r||o)){if(this.resolvedRelativeTargetAt=qe.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},pr(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),fo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,dr(s.x,a.x,l.x),dr(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):fo(this.target,this.layout.layoutBox),Tr(this.target,this.targetDelta)):fo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},pr(this.relativeTargetOrigin,this.target,e.target),fo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}To&&Mo.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!kr(this.parent.latestValues)&&!Sr(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===qe.timestamp&&(i=!1),i)return;const{layout:r,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!o)return;fo(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,i=!1){const r=n.length;if(!r)return;let o,s;t.x=t.y=1;for(let a=0;a<r;a++){o=n[a],s=o.projectionDelta;const{visualElement:r}=o.options;r&&r.props.style&&"contents"===r.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Pr(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Tr(e,s)),i&&Er(o.latestValues)&&Pr(e,o.latestValues))}t.x<Dr&&t.x>Or&&(t.x=1),t.y<Dr&&t.y>Or&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(mo(this.prevProjectionDelta.x,this.projectionDelta.x),mo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),ur(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Co(this.projectionDelta.x,this.prevProjectionDelta.x)&&Co(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),To&&Mo.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,i=n?n.latestValues:{},r={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Qo));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h;Xo(o.x,e.x,n),Xo(o.y,e.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pr(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,i){Yo(e.x,t.x,n.x,i),Yo(e.y,t.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,s,n),d&&(l=this.relativeTarget,h=d,ko(l.x,h.x)&&ko(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),fo(d,this.relativeTarget)),a&&(this.animationValues=r,function(e,t,n,i,r,o){r?(e.opacity=Vn(0,void 0!==n.opacity?n.opacity:1,co(i)),e.opacityExit=Vn(void 0!==t.opacity?t.opacity:1,0,uo(i))):o&&(e.opacity=Vn(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let r=0;r<oo;r++){const o=`border${ro[r]}Radius`;let s=lo(t,o),a=lo(n,o);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||ao(s)===ao(a)?(e[o]=Math.max(Vn(so(s),so(a),i),0),(Lt.test(a)||Lt.test(s))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=Vn(t.rotate||0,n.rotate||0,i))}(r,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(He(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$e.update(()=>{qr.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const i=rt(0)?0:nt(0);return i.start(Ri("",i,1e3,n)),i.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:i,latestValues:r}=e;if(t&&n&&i){if(this!==e&&this.layout&&i&&is(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=lr(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const i=lr(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+i}fo(t,n),Pr(t,r),ur(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new No),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const i={};n.z&&Ro("z",e,i,this.animationValues);for(let t=0;t<Oo.length;t++)Ro(`rotate${Oo[t]}`,e,i,this.animationValues),Ro(`skew${Oo[t]}`,e,i,this.animationValues);e.render();for(const t in i)e.setStaticValue(t,i[t]),this.animationValues&&(this.animationValues[t]=i[t]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Do;const i={visibility:""},r=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=io(null==e?void 0:e.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=io(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!Er(this.latestValues)&&(t.transform=r?r({},""):"none",this.hasProjected=!1),t}const s=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(e,t,n){let i="";const r=e.x.translate/t.x,o=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((r||o||s)&&(i=`translate3d(${r}px, ${o}px, ${s}px) `),1===t.x&&1===t.y||(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:r,rotateY:o,skewX:s,skewY:a}=n;e&&(i=`perspective(${e}px) ${i}`),t&&(i+=`rotate(${t}deg) `),r&&(i+=`rotateX(${r}deg) `),o&&(i+=`rotateY(${o}deg) `),s&&(i+=`skewX(${s}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),r&&(i.transform=r(s,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(t=s.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:i.opacity=o===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Zr){if(void 0===s[e])continue;const{correct:t,applyTo:n}=Zr[e],r="none"===i.transform?s[e]:t(s[e],o);if(n){const e=n.length;for(let t=0;t<e;t++)i[n[t]]=r}else i[e]=r}return this.options.layoutId&&(i.pointerEvents=o===this?io(null==e?void 0:e.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(Vo),this.root.sharedNodes.clear()}}}function Fo(e){e.updateLayout()}function Bo(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:i}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;"size"===r?xr(e=>{const i=o?n.measuredBox[e]:n.layoutBox[e],r=lr(i);i.min=t[e].min,i.max=i.min+r}):is(r,n.layoutBox,t)&&xr(i=>{const r=o?n.measuredBox[i]:n.layoutBox[i],s=lr(t[i]);r.max=r.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+s)});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ur(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?ur(a,e.applyTransform(i,!0),n.measuredBox):ur(a,t,n.layoutBox);const l=!_o(s);let c=!1;if(!e.resumeFrom){const i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:r,layout:o}=i;if(r&&o){const s={x:{min:0,max:0},y:{min:0,max:0}};pr(s,n.layoutBox,r.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};pr(a,t,o.layoutBox),So(s,a)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function zo(e){To&&Mo.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function jo(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Uo(e){e.clearSnapshot()}function Vo(e){e.clearMeasurements()}function $o(e){e.isLayoutDirty=!1}function Ho(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ko(e){e.resolveTargetDelta()}function Go(e){e.calcProjection()}function Wo(e){e.resetSkewAndRotation()}function Zo(e){e.removeLeadSnapshot()}function Xo(e,t,n){e.translate=Vn(t.translate,0,n),e.scale=Vn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Yo(e,t,n,i){e.min=Vn(t.min,n.min,i),e.max=Vn(t.max,n.max,i)}function Qo(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Jo={duration:.45,ease:[.4,0,.1,1]},es=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ts=es("applewebkit/")&&!es("chrome/")?Math.round:Le;function ns(e){e.min=ts(e.min),e.max=ts(e.max)}function is(e,t,n){return"position"===e||"preserve-aspect"===e&&(i=Ao(t),r=Ao(n),!(Math.abs(i-r)<=.2));var i,r}function rs(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const os=Lo({attachResizeListener:(e,t)=>Xi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ss={current:void 0},as=Lo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ss.current){const e=new os({});e.mount(window),e.setOptions({layoutScroll:!0}),ss.current=e}return ss.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),ls={pan:{Feature:class extends Gi{constructor(){super(...arguments),this.removePointerDownListener=Le}onPointerDown(e){this.session=new er(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Fr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ur(e),onStart:Ur(t),onMove:n,onEnd:(e,t)=>{delete this.session,i&&$e.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=Qi(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Gi{constructor(e){super(e),this.removeGroupControls=Le,this.removeListeners=Le,this.controls=new zr(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Le}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:as,MeasureLayout:Jr}};function cs(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover","Start"===n);const r=i["onHover"+n];r&&$e.postRender(()=>r(t,Yi(t)))}function us(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap","Start"===n);const r=i["onTap"+("End"===n?"":n)];r&&$e.postRender(()=>r(t,Yi(t)))}const ds=new WeakMap,hs=new WeakMap,ps=e=>{const t=ds.get(e.target);t&&t(e)},fs=e=>{e.forEach(ps)};const ms={some:0,all:1},gs={inView:{Feature:class extends Gi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:i="some",once:r}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:ms[i]};return function(e,t,n){const i=function({root:e,...t}){const n=e||document;hs.has(n)||hs.set(n,{});const i=hs.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(fs,{root:e,...t})),i[r]}(t);return ds.set(e,n),i.observe(e),()=>{ds.delete(e),i.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,r&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=t?n:i;o&&o(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Gi{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[i,r,o]=Se(e,n),s=e=>{const i=e.currentTarget;if(!Ie(e)||Te.has(i))return;Te.add(i);const o=t(e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Ie(e)&&Te.has(i)&&(Te.delete(i),"function"==typeof o&&o(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||Ce(i,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",a,r),window.addEventListener("pointercancel",l,r)};return i.forEach(e=>{(function(e){return Me.has(e.tagName)||-1!==e.tabIndex})(e)||null!==e.getAttribute("tabindex")||(e.tabIndex=0),(n.useGlobalTarget?window:e).addEventListener("pointerdown",s,r),e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const i=Oe(()=>{if(Te.has(n))return;De(n,"down");const e=Oe(()=>{De(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>De(n,"cancel"),t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)})(e,r),r)}),o}(e,e=>(us(this.node,e,"Start"),(e,{success:t})=>us(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Gi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xn(Xi(this.node.current,"focus",()=>this.onFocus()),Xi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Gi{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[i,r,o]=Se(e,n),s=Ae(e=>{const{target:n}=e,i=t(e);if("function"!=typeof i||!n)return;const o=Ae(e=>{i(e),n.removeEventListener("pointerleave",o)});n.addEventListener("pointerleave",o,r)});return i.forEach(e=>{e.addEventListener("pointerenter",s,r)}),o}(e,e=>(cs(this.node,e,"Start"),e=>cs(this.node,e,"End"))))}unmount(){}}}},bs={layout:{ProjectionNode:as,MeasureLayout:Jr}},ys=s({strict:!1}),vs=s({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),xs=s({});function ws(e){return Z(e.animate)||ie.some(t=>Q(e[t]))}function _s(e){return Boolean(ws(e)||e.variants)}function ks(e){return Array.isArray(e)?e.join(" "):e}const Es="undefined"!=typeof window,Ss={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},As={};for(const e in Ss)As[e]={isEnabled:t=>Ss[e].some(e=>!!t[e])};const Cs=Symbol.for("motionComponentSymbol");function Ns(e,t,n){return u(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&("function"==typeof n?n(i):ar(n)&&(n.current=i))},[t])}const Ms=Es?m:h;function Ts(e,t,n,i,r){var o,s;const{visualElement:a}=d(xs),l=d(ys),c=d(Vr),u=d(vs).reducedMotion,p=b(null);i=i||l.renderer,!p.current&&i&&(p.current=i(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const m=p.current,g=d(Hr);!m||m.projection||!r||"html"!==m.type&&"svg"!==m.type||function(e,t,n,i){const{layoutId:r,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Os(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:Boolean(s)||a&&ar(a),visualElement:e,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:c})}(p.current,n,r,g);const y=b(!1);f(()=>{m&&y.current&&m.update(n,c)});const v=n[at],x=b(Boolean(v)&&!(null===(o=window.MotionHandoffIsComplete)||void 0===o?void 0:o.call(window,v))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,v)));return Ms(()=>{m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),Xr.render(m.render),x.current&&m.animationState&&m.animationState.animateChanges())}),h(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,v)}),x.current=!1))}),m}function Os(e){if(e)return!1!==e.options.allowProjection?e.projection:Os(e.parent)}function Ds({preloadedFeatures:e,createVisualElement:i,useRender:r,useVisualState:o,Component:s}){var a,l;function u(e,a){let l;const c={...d(vs),...e,layoutId:Is(e)},{isStatic:u}=c,h=function(e){const{initial:t,animate:n}=function(e,t){if(ws(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Q(t)?t:void 0,animate:Q(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,d(xs));return g(()=>({initial:t,animate:n}),[ks(t),ks(n)])}(e),p=o(e,u);if(!u&&Es){d(ys).strict;const e=function(e){const{drag:t,layout:n}=As;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(c);l=e.MeasureLayout,h.visualElement=Ts(s,p,c,i,e.ProjectionNode)}return n(xs.Provider,{value:h,children:[l&&h.visualElement?t(l,{visualElement:h.visualElement,...c}):null,r(s,e,Ns(p,h.visualElement,a),p,u,h.visualElement)]})}e&&function(e){for(const t in e)As[t]={...As[t],...e[t]}}(e),u.displayName=`motion.${"string"==typeof s?s:`create(${null!==(l=null!==(a=s.displayName)&&void 0!==a?a:s.name)&&void 0!==l?l:""})`}`;const h=c(u);return h[Cs]=s,h}function Is({layoutId:e}){const t=d($r).id;return t&&void 0!==e?t+"-"+e:e}const Rs=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ps(e){return"string"==typeof e&&!e.includes("-")&&!!(Rs.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ls=e=>(t,n)=>{const i=d(xs),r=d(Vr),o=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,o){const s={latestValues:Fs(i,r,o,e),renderState:t()};return n&&(s.onMount=e=>n({props:i,current:e,...s}),s.onUpdate=e=>n(e)),s}(e,t,i,r);return n?o():function(e){const t=b(null);return null===t.current&&(t.current=e()),t.current}(o)};function Fs(e,t,n,i){const r={},o=i(e,{});for(const e in o)r[e]=io(o[e]);let{initial:s,animate:a}=e;const l=ws(e),c=_s(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!Z(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const i=ee(e,t[n]);if(i){const{transitionEnd:e,transition:t,...n}=i;for(const e in n){let t=n[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(r[e]=t)}for(const t in e)r[t]=e[t]}}}return r}const Bs=(e,t)=>t&&"number"==typeof e?t.transform(e):e,zs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},js=Fe.length;function Us(e,t,n){const{style:i,vars:r,transformOrigin:o}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(Be.has(e))s=!0;else if(Cn(e))r[e]=n;else{const t=Bs(n,sn[e]);e.startsWith("origin")?(a=!0,o[e]=t):i[e]=t}}if(t.transform||(s||n?i.transform=function(e,t,n){let i="",r=!0;for(let o=0;o<js;o++){const s=Fe[o],a=e[s];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(s.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const e=Bs(a,sn[s]);l||(r=!1,i+=`${zs[s]||s}(${e}) `),n&&(t[s]=e)}}return i=i.trim(),n?i=n(t,r?"":i):r&&(i="none"),i}(t,e.transform,n):i.transform&&(i.transform="none")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=o;i.transformOrigin=`${e} ${t} ${n}`}}const Vs={offset:"stroke-dashoffset",array:"stroke-dasharray"},$s={offset:"strokeDashoffset",array:"strokeDasharray"};function Hs(e,t,n){return"string"==typeof e?e:Ft.transform(t+n*e)}function qs(e,{attrX:t,attrY:n,attrScale:i,originX:r,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(Us(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:f}=e;h.transform&&(f&&(p.transform=h.transform),delete h.transform),f&&(void 0!==r||void 0!==o||p.transform)&&(p.transformOrigin=function(e,t,n){return`${Hs(t,e.x,e.width)} ${Hs(n,e.y,e.height)}`}(f,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==t&&(h.x=t),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(e,t,n=1,i=0,r=!0){e.pathLength=1;const o=r?Vs:$s;e[o.offset]=Ft.transform(-i);const s=Ft.transform(t),a=Ft.transform(n);e[o.array]=`${s} ${a}`}(h,s,a,l,!1)}const Ks=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Gs(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const t in n)e.style.setProperty(t,n[t])}const Ws=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Zs(e,t,n,i){Gs(e,t,void 0,i);for(const n in t.attrs)e.setAttribute(Ws.has(n)?n:st(n),t.attrs[n])}function Xs(e,{layout:t,layoutId:n}){return Be.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Zr[e]||"opacity"===e)}function Ys(e,t,n){var i;const{style:r}=e,o={};for(const s in r)(rt(r[s])||t.style&&rt(t.style[s])||Xs(s,e)||void 0!==(null===(i=null==n?void 0:n.getValue(s))||void 0===i?void 0:i.liveStyle))&&(o[s]=r[s]);return o}function Qs(e,t,n){const i=Ys(e,t,n);for(const n in e)(rt(e[n])||rt(t[n]))&&(i[-1!==Fe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return i}const Js=["x","y","width","height","cx","cy","r"],ea={useVisualState:Ls({scrapeMotionValuesFromProps:Qs,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let o=!!e.drag;if(!o)for(const e in r)if(Be.has(e)){o=!0;break}if(!o)return;let s=!t;if(t)for(let n=0;n<Js.length;n++){const i=Js[n];e[i]!==t[i]&&(s=!0)}s&&$e.read(()=>{!function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(e){t.dimensions={x:0,y:0,width:0,height:0}}}(n,i),$e.render(()=>{qs(i,r,Ks(n.tagName),e.transformTemplate),Zs(n,i)})})}})},ta={useVisualState:Ls({scrapeMotionValuesFromProps:Ys,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function na(e,t,n){for(const i in t)rt(t[i])||Xs(i,n)||(e[i]=t[i])}function ia(e,t){const n={},i=function(e,t){const n={};return na(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return g(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Us(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const ra=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function oa(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ra.has(e)}let sa=e=>!oa(e);try{(aa=require("@emotion/is-prop-valid").default)&&(sa=e=>e.startsWith("on")?!oa(e):aa(e))}catch(e){}var aa;function la(e,t,n,i){const r=g(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return qs(n,t,Ks(i),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};na(t,e.style,e),r.style={...t,...r.style}}return r}function ca(e=!1){return(t,n,i,{latestValues:r},s)=>{const l=(Ps(t)?la:ia)(n,r,s,t),c=function(e,t,n){const i={};for(const r in e)"values"===r&&"object"==typeof e.values||(sa(r)||!0===n&&oa(r)||!t&&!oa(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}(n,"string"==typeof t,e),u=t!==o?{...c,...l,ref:i}:{},{children:d}=n,h=g(()=>rt(d)?d.get():d,[d]);return a(t,{...u,children:h})}}function ua(e,t){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Ds({...Ps(n)?ea:ta,preloadedFeatures:e,useRender:ca(i),createVisualElement:t,Component:n})}}const da={current:null},ha={current:!1},pa=[...Rn,Vt,Yt],fa=new WeakMap,ma=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ga{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_n,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Ze.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,$e.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=o;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=ws(t),this.isVariantNode=_s(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==a[e]&&rt(t)&&t.set(a[e],!1)}}mount(e){this.current=e,fa.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),ha.current||function(){if(ha.current=!0,Es)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>da.current=e.matches;e.addListener(t),t()}else da.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||da.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fa.delete(this.current),this.projection&&this.projection.unmount(),He(this.notifyUpdate),He(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Be.has(e),i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&$e.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=t.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),r(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in As){const t=As[e];if(!t)continue;const{isEnabled:n,Feature:i}=t;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ma.length;t++){const n=ma[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=e["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(e,t,n){for(const i in t){const r=t[i],o=n[i];if(rt(r))e.addValue(i,r);else if(rt(o))e.addValue(i,nt(r,{owner:e}));else if(o!==r)if(e.hasValue(i)){const t=e.getValue(i);!0===t.liveStyle?t.jump(r):t.hasAnimated||t.set(r)}else{const t=e.getStaticValue(i);e.addValue(i,nt(void 0!==t?t:r,{owner:e}))}}for(const i in n)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=nt(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let i=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var r;return null!=i&&("string"==typeof i&&(Sn(i)||xt(i))?i=parseFloat(i):(r=i,!pa.find(In(r))&&Yt.test(t)&&(i=cn(e,t))),this.setBaseTarget(e,rt(i)?i.get():i)),rt(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const r=ee(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);r&&(i=r[e])}if(n&&void 0!==i)return i;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||rt(r)?void 0!==this.initialValues[e]&&void 0===i?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new Qe),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class ba extends ga{constructor(){super(...arguments),this.KeyframeResolver=Ln}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;rt(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class ya extends ba{constructor(){super(...arguments),this.type="html",this.renderInstance=Gs}readValueFromInstance(e,t){if(Be.has(t)){const e=ln(t);return e&&e.default||0}{const i=(n=e,window.getComputedStyle(n)),r=(Cn(t)?i.getPropertyValue(t):i[t])||0;return"string"==typeof r?r.trim():r}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Lr(e,t)}build(e,t,n){Us(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ys(e,t,n)}}class va extends ba{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vr}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Be.has(t)){const e=ln(t);return e&&e.default||0}return t=Ws.has(t)?t:st(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Qs(e,t,n)}build(e,t,n){qs(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,i){Zs(e,t,0,i)}mount(e){this.isSVGTag=Ks(e.tagName),super.mount(e)}}const xa=W(ua({...Zi,...gs,...ls,...bs},(e,t)=>Ps(e)?new va(t):new ya(t,{allowProjection:e!==o})));function wa(e){try{return(e?new Date(e):new Date).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function _a({content:e,createdAt:i}){return t(xa.div,{className:"bmxcb__message bmxcb__message--user",initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:400,damping:25,duration:.3},layout:!0,children:n("div",{className:"bmxcb__message-content",children:[t("div",{className:"bmxcb__message-text",children:e}),t("div",{className:"bmxcb__message-footer bmxcb__message-footer--user",children:t("div",{className:"bmxcb__message-time bmxcb__message-time--user",children:wa(i)})})]})})}function ka(){}function Ea(){}const Sa=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Aa=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ca={};function Na(e,t){return((t||Ca).jsx?Aa:Sa).test(e)}const Ma=/[ \t\n\f\r]/g;function Ta(e){return""===e.replace(Ma,"")}class Oa{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Da(e,t){const n={},i={};for(const t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new Oa(n,i,t)}function Ia(e){return e.toLowerCase()}Oa.prototype.normal={},Oa.prototype.property={},Oa.prototype.space=void 0;class Ra{constructor(e,t){this.attribute=t,this.property=e}}Ra.prototype.attribute="",Ra.prototype.booleanish=!1,Ra.prototype.boolean=!1,Ra.prototype.commaOrSpaceSeparated=!1,Ra.prototype.commaSeparated=!1,Ra.prototype.defined=!1,Ra.prototype.mustUseProperty=!1,Ra.prototype.number=!1,Ra.prototype.overloadedBoolean=!1,Ra.prototype.property="",Ra.prototype.spaceSeparated=!1,Ra.prototype.space=void 0;let Pa=0;const La=$a(),Fa=$a(),Ba=$a(),za=$a(),ja=$a(),Ua=$a(),Va=$a();function $a(){return 2**++Pa}const Ha=Object.keys(_);class qa extends Ra{constructor(e,t,n,i){let r=-1;if(super(e,t),Ka(this,"space",i),"number"==typeof n)for(;++r<Ha.length;){const e=Ha[r];Ka(this,Ha[r],(n&_[e])===_[e])}}}function Ka(e,t,n){n&&(e[t]=n)}function Ga(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const o=new qa(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[Ia(i)]=i,n[Ia(o.attribute)]=i}return new Oa(t,n,e.space)}qa.prototype.defined=!0;const Wa=Ga({properties:{ariaActiveDescendant:null,ariaAtomic:Fa,ariaAutoComplete:null,ariaBusy:Fa,ariaChecked:Fa,ariaColCount:za,ariaColIndex:za,ariaColSpan:za,ariaControls:ja,ariaCurrent:null,ariaDescribedBy:ja,ariaDetails:null,ariaDisabled:Fa,ariaDropEffect:ja,ariaErrorMessage:null,ariaExpanded:Fa,ariaFlowTo:ja,ariaGrabbed:Fa,ariaHasPopup:null,ariaHidden:Fa,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ja,ariaLevel:za,ariaLive:null,ariaModal:Fa,ariaMultiLine:Fa,ariaMultiSelectable:Fa,ariaOrientation:null,ariaOwns:ja,ariaPlaceholder:null,ariaPosInSet:za,ariaPressed:Fa,ariaReadOnly:Fa,ariaRelevant:null,ariaRequired:Fa,ariaRoleDescription:ja,ariaRowCount:za,ariaRowIndex:za,ariaRowSpan:za,ariaSelected:Fa,ariaSetSize:za,ariaSort:null,ariaValueMax:za,ariaValueMin:za,ariaValueNow:za,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Za(e,t){return t in e?e[t]:t}function Xa(e,t){return Za(e,t.toLowerCase())}const Ya=Ga({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ua,acceptCharset:ja,accessKey:ja,action:null,allow:null,allowFullScreen:La,allowPaymentRequest:La,allowUserMedia:La,alt:null,as:null,async:La,autoCapitalize:null,autoComplete:ja,autoFocus:La,autoPlay:La,blocking:ja,capture:null,charSet:null,checked:La,cite:null,className:ja,cols:za,colSpan:null,content:null,contentEditable:Fa,controls:La,controlsList:ja,coords:za|Ua,crossOrigin:null,data:null,dateTime:null,decoding:null,default:La,defer:La,dir:null,dirName:null,disabled:La,download:Ba,draggable:Fa,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:La,formTarget:null,headers:ja,height:za,hidden:Ba,high:za,href:null,hrefLang:null,htmlFor:ja,httpEquiv:ja,id:null,imageSizes:null,imageSrcSet:null,inert:La,inputMode:null,integrity:null,is:null,isMap:La,itemId:null,itemProp:ja,itemRef:ja,itemScope:La,itemType:ja,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:La,low:za,manifest:null,max:null,maxLength:za,media:null,method:null,min:null,minLength:za,multiple:La,muted:La,name:null,nonce:null,noModule:La,noValidate:La,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:La,optimum:za,pattern:null,ping:ja,placeholder:null,playsInline:La,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:La,referrerPolicy:null,rel:ja,required:La,reversed:La,rows:za,rowSpan:za,sandbox:ja,scope:null,scoped:La,seamless:La,selected:La,shadowRootClonable:La,shadowRootDelegatesFocus:La,shadowRootMode:null,shape:null,size:za,sizes:null,slot:null,span:za,spellCheck:Fa,src:null,srcDoc:null,srcLang:null,srcSet:null,start:za,step:null,style:null,tabIndex:za,target:null,title:null,translate:null,type:null,typeMustMatch:La,useMap:null,value:Fa,width:za,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ja,axis:null,background:null,bgColor:null,border:za,borderColor:null,bottomMargin:za,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:La,declare:La,event:null,face:null,frame:null,frameBorder:null,hSpace:za,leftMargin:za,link:null,longDesc:null,lowSrc:null,marginHeight:za,marginWidth:za,noResize:La,noHref:La,noShade:La,noWrap:La,object:null,profile:null,prompt:null,rev:null,rightMargin:za,rules:null,scheme:null,scrolling:Fa,standby:null,summary:null,text:null,topMargin:za,valueType:null,version:null,vAlign:null,vLink:null,vSpace:za,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:La,disableRemotePlayback:La,prefix:null,property:null,results:za,security:null,unselectable:null},space:"html",transform:Xa}),Qa=Ga({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:Va,accentHeight:za,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:za,amplitude:za,arabicForm:null,ascent:za,attributeName:null,attributeType:null,azimuth:za,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:za,by:null,calcMode:null,capHeight:za,className:ja,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:za,diffuseConstant:za,direction:null,display:null,dur:null,divisor:za,dominantBaseline:null,download:La,dx:null,dy:null,edgeMode:null,editable:null,elevation:za,enableBackground:null,end:null,event:null,exponent:za,externalResourcesRequired:null,fill:null,fillOpacity:za,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:Ua,g2:Ua,glyphName:Ua,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:za,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:za,horizOriginX:za,horizOriginY:za,id:null,ideographic:za,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:za,k:za,k1:za,k2:za,k3:za,k4:za,kernelMatrix:Va,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:za,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:za,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:za,overlineThickness:za,paintOrder:null,panose1:null,path:null,pathLength:za,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ja,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:za,pointsAtY:za,pointsAtZ:za,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Va,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Va,rev:Va,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Va,requiredFeatures:Va,requiredFonts:Va,requiredFormats:Va,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:za,specularExponent:za,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:za,strikethroughThickness:za,string:null,stroke:null,strokeDashArray:Va,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:za,strokeOpacity:za,strokeWidth:null,style:null,surfaceScale:za,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Va,tabIndex:za,tableValues:null,target:null,targetX:za,targetY:za,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Va,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:za,underlineThickness:za,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:za,values:null,vAlphabetic:za,vMathematical:za,vectorEffect:null,vHanging:za,vIdeographic:za,version:null,vertAdvY:za,vertOriginX:za,vertOriginY:za,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:za,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Za}),Ja=Ga({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),el=Ga({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xa}),tl=Ga({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),nl=Da([Wa,Ya,Ja,el,tl],"html"),il=Da([Wa,Qa,Ja,el,tl],"svg"),rl=/[A-Z]/g,ol=/-[a-z]/g,sl=/^data[-\w.:]+$/i;function al(e){return"-"+e.toLowerCase()}function ll(e){return e.charAt(1).toUpperCase()}const cl={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"};var ul=w(598);const dl=pl("end"),hl=pl("start");function pl(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function fl(e){return e&&"object"==typeof e?"position"in e||"type"in e?gl(e.position):"start"in e||"end"in e?gl(e):"line"in e||"column"in e?ml(e):"":""}function ml(e){return bl(e&&e.line)+":"+bl(e&&e.column)}function gl(e){return ml(e&&e.start)+"-"+ml(e&&e.end)}function bl(e){return e&&"number"==typeof e?e:1}class yl extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let i="",r={},o=!1;if(t&&(r="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?i=e:!r.cause&&e&&(o=!0,i=e.message,r.cause=e),!r.ruleId&&!r.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?r.ruleId=n:(r.source=n.slice(0,e),r.ruleId=n.slice(e+1))}if(!r.place&&r.ancestors&&r.ancestors){const e=r.ancestors[r.ancestors.length-1];e&&(r.place=e.position)}const s=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=fl(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&"string"==typeof r.cause.stack?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}yl.prototype.file="",yl.prototype.name="",yl.prototype.reason="",yl.prototype.message="",yl.prototype.stack="",yl.prototype.column=void 0,yl.prototype.line=void 0,yl.prototype.ancestors=void 0,yl.prototype.cause=void 0,yl.prototype.fatal=void 0,yl.prototype.place=void 0,yl.prototype.ruleId=void 0,yl.prototype.source=void 0;const vl={}.hasOwnProperty,xl=new Map,wl=/[A-Z]/g,_l=new Set(["table","tbody","thead","tfoot","tr"]),kl=new Set(["td","th"]),El="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Sl(e,t,n){return"element"===t.type?function(e,t,n){const i=e.schema;let r=i;"svg"===t.tagName.toLowerCase()&&"html"===i.space&&(r=il,e.schema=r),e.ancestors.push(t);const o=Tl(e,t.tagName,!1),s=function(e,t){const n={};let i,r;for(r in t.properties)if("children"!==r&&vl.call(t.properties,r)){const o=Ml(e,r,t.properties[r]);if(o){const[r,s]=o;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&kl.has(t.tagName)?i=s:n[r]=s}}return i&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=i),n}(e,t);let a=Nl(e,t);return _l.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&Ta(t.value):Ta(t));var t})),Al(e,s,o,t),Cl(s,a),e.ancestors.pop(),e.schema=i,e.create(t,o,s,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ol(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const i=e.schema;let r=i;"svg"===t.name&&"html"===i.space&&(r=il,e.schema=r),e.ancestors.push(t);const o=null===t.name?e.Fragment:Tl(e,t.name,!0),s=function(e,t){const n={};for(const i of t.attributes)if("mdxJsxExpressionAttribute"===i.type)if(i.data&&i.data.estree&&e.evaluater){const t=i.data.estree.body[0];ka(t.type);const r=t.expression;ka(r.type);const o=r.properties[0];ka(o.type),Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Ol(e,t.position);else{const r=i.name;let o;if(i.value&&"object"==typeof i.value)if(i.value.data&&i.value.data.estree&&e.evaluater){const t=i.value.data.estree.body[0];ka(t.type),o=e.evaluater.evaluateExpression(t.expression)}else Ol(e,t.position);else o=null===i.value||i.value;n[r]=o}return n}(e,t),a=Nl(e,t);return Al(e,s,o,t),Cl(s,a),e.ancestors.pop(),e.schema=i,e.create(t,o,s,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ol(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const i={};return Cl(i,Nl(e,t)),e.create(t,e.Fragment,i,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Al(e,t,n,i){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Cl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Nl(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:xl;for(;++i<t.children.length;){const o=t.children[i];let s;if(e.passKeys){const e="element"===o.type?o.tagName:"mdxJsxFlowElement"===o.type||"mdxJsxTextElement"===o.type?o.name:void 0;if(e){const t=r.get(e)||0;s=e+"-"+t,r.set(e,t+1)}}const a=Sl(e,o,s);void 0!==a&&n.push(a)}return n}function Ml(e,t,n){const i=function(e,t){const n=Ia(t);let i=t,r=Ra;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&sl.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(ol,ll);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!ol.test(e)){let n=e.replace(rl,al);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}r=qa}return new r(i,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===i.property){let t="object"==typeof n?n:function(e,t){try{return ul(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,i=new yl("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=El+"#cannot-parse-style-attribute",i}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)vl.call(e,n)&&(t[Dl(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&i.space?cl[i.property]||i.property:i.attribute,n]}}function Tl(e,t,n){let i;if(n)if(t.includes(".")){const e=t.split(".");let n,r=-1;for(;++r<e.length;){const t=Na(e[r])?{type:"Identifier",name:e[r]}:{type:"Literal",value:e[r]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(r&&"Literal"===t.type),optional:!1}:t}i=n}else i=Na(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else i={type:"Literal",value:t};if("Literal"===i.type){const t=i.value;return vl.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ol(e)}function Ol(e,t){const n=new yl("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=El+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Dl(e){let t=e.replace(wl,Il);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Il(e){return"-"+e.toLowerCase()}const Rl={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"]},Pl={};function Ll(e,t){const n=t||Pl;return Fl(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function Fl(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Bl(e.children,t,n)}return Array.isArray(e)?Bl(e,t,n):""}function Bl(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=Fl(e[r],t,n);return i.join("")}function zl(e,t,n,i){const r=e.length;let o,s=0;if(t=t<0?-t>r?0:r+t:t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<i.length;)o=i.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function jl(e,t){return e.length>0?(zl(e,e.length,0,t),e):t}class Ul{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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){const n=null==t?Number.POSITIVE_INFINITY:t;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){const i=t||0;this.setCursor(Math.trunc(e));const r=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Vl(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Vl(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Vl(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Vl(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Vl(this.left,t.reverse())}}}function Vl(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 $l(e){const t={};let n,i,r,o,s,a,l,c=-1;const u=new Ul(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(a=n[1]._tokenizer.events,r=0,r<a.length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Hl(u,c)),c=t[c],l=!0);else if(n[1]._container){for(r=c,i=void 0;r--;)if(o=u.get(r),"lineEnding"===o[1].type||"lineEndingBlank"===o[1].type)"enter"===o[0]&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=r);else if("linePrefix"!==o[1].type&&"listItemIndent"!==o[1].type)break;i&&(n[1].end={...u.get(i)[1].start},s=u.slice(i,c),s.unshift(n),u.splice(i,c-i+1,s))}}return zl(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function Hl(e,t){const n=e.get(t)[1],i=e.get(t)[2];let r=t-1;const o=[];let s=n._tokenizer;s||(s=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,h=-1,p=n,f=0,m=0;const g=[m];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(u=i.sliceStream(p),p.next||u.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<a.length;)"exit"===a[h][0]&&"enter"===a[h-1][0]&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),h=g.length;h--;){const t=a.slice(g[h],g[h+1]),n=o.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),h=-1;++h<l.length;)c[f+l[h][0]]=f+l[h][1],f+=l[h][1]-l[h][0]-1;return c}const ql={}.hasOwnProperty;function Kl(e){const t={};let n=-1;for(;++n<e.length;)Gl(t,e[n]);return t}function Gl(e,t){let n;for(n in t){const i=(ql.call(e,n)?e[n]:void 0)||(e[n]={}),r=t[n];let o;if(r)for(o in r){ql.call(i,o)||(i[o]=[]);const e=r[o];Wl(i[o],Array.isArray(e)?e:e?[e]:[])}}}function Wl(e,t){let n=-1;const i=[];for(;++n<t.length;)("after"===t[n].add?e:i).push(t[n]);zl(e,0,0,i)}const Zl=ac(/[A-Za-z]/),Xl=ac(/[\dA-Za-z]/),Yl=ac(/[#-'*+\--9=?A-Z^-~]/);function Ql(e){return null!==e&&(e<32||127===e)}const Jl=ac(/\d/),ec=ac(/[\dA-Fa-f]/),tc=ac(/[!-/:-@[-`{-~]/);function nc(e){return null!==e&&e<-2}function ic(e){return null!==e&&(e<0||32===e)}function rc(e){return-2===e||-1===e||32===e}const oc=ac(/\p{P}|\p{S}/u),sc=ac(/\s/);function ac(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function lc(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let o=0;return function(i){return rc(i)?(e.enter(n),s(i)):t(i)};function s(i){return rc(i)&&o++<r?(e.consume(i),s):(e.exit(n),t(i))}}const cc={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),lc(e,t,"linePrefix");e.consume(n)},function(t){return e.enter("paragraph"),i(t)});let n;return t;function i(t){const i=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=i),n=i,r(t)}function r(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):nc(t)?(e.consume(t),e.exit("chunkText"),i):(e.consume(t),r)}}},uc={tokenize:function(e){const t=this,n=[];let i,r,o,s=0;return a;function a(i){if(s<n.length){const r=n[s];return t.containerState=r[1],e.attempt(r[0].continuation,l,c)(i)}return c(i)}function l(e){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const n=t.events.length;let r,o=n;for(;o--;)if("exit"===t.events[o][0]&&"chunkFlow"===t.events[o][1].type){r=t.events[o][1].end;break}b(s);let a=n;for(;a<t.events.length;)t.events[a][1].end={...r},a++;return zl(t.events,o+1,0,t.events.slice(n)),t.events.length=a,c(e)}return a(e)}function c(r){if(s===n.length){if(!i)return h(r);if(i.currentConstruct&&i.currentConstruct.concrete)return f(r);t.interrupt=Boolean(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dc,u,d)(r)}function u(e){return i&&y(),b(s),h(e)}function d(e){return t.parser.lazy[t.now().line]=s!==n.length,o=t.now().offset,f(e)}function h(n){return t.containerState={},e.attempt(dc,p,f)(n)}function p(e){return s++,n.push([t.currentConstruct,t.containerState]),h(e)}function f(n){return null===n?(i&&y(),b(0),void e.consume(n)):(i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),b(0),void e.consume(n)):nc(n)?(e.consume(n),g(e.exit("chunkFlow")),s=0,t.interrupt=void 0,a):(e.consume(n),m)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=r,r&&(r.next=e),r=e,i.defineSkip(e.start),i.write(a),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;const n=t.events.length;let r,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(r){a=t.events[l][1].end;break}r=!0}for(b(s),e=n;e<t.events.length;)t.events[e][1].end={...a},e++;zl(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function b(i){let r=n.length;for(;r-- >i;){const i=n[r];t.containerState=i[1],i[0].exit.call(t,e)}n.length=i}function y(){i.write([null]),r=void 0,i=void 0,t.containerState._closeFlow=void 0}}},dc={tokenize:function(e,t,n){return lc(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},hc={partial:!0,tokenize:function(e,t,n){return function(t){return rc(t)?lc(e,i,"linePrefix")(t):i(t)};function i(e){return null===e||nc(e)?t(e):n(e)}}},pc={resolve:function(e){return $l(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(t)};function i(t){return null===t?r(t):nc(t)?e.check(fc,o,r)(t):(e.consume(t),i)}function r(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}}},fc={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),lc(e,r,"linePrefix")};function r(r){if(null===r||nc(r))return n(r);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}},mc={tokenize:function(e){const t=this,n=e.attempt(hc,function(i){if(null!==i)return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(i)},e.attempt(this.parser.constructs.flowInitial,i,lc(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pc,i)),"linePrefix")));return n;function i(i){if(null!==i)return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(i)}}},gc={resolveAll:xc()},bc=vc("string"),yc=vc("text");function vc(e){return{resolveAll:xc("text"===e?wc:void 0),tokenize:function(t){const n=this,i=this.parser.constructs[e],r=t.attempt(i,o,s);return o;function o(e){return l(e)?r(e):s(e)}function s(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),r(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=i[e];let r=-1;if(t)for(;++r<t.length;){const e=t[r];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function xc(e){return function(t,n){let i,r=-1;for(;++r<=t.length;)void 0===i?t[r]&&"data"===t[r][1].type&&(i=r,r++):t[r]&&"data"===t[r][1].type||(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 wc(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const i=e[n-1][1],r=t.sliceStream(i);let o,s=r.length,a=-1,l=0;for(;s--;){const e=r[s];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)l++,a--;if(a)break;a=-1}else if(-2===e)o=!0,l++;else if(-1!==e){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const r={type:n===e.length||o||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:i.start._bufferIndex+a,_index:i.start._index+s,line:i.end.line,column:i.end.column-l,offset:i.end.offset-l},end:{...i.end}};i.end={...r.start},i.start.offset===i.end.offset?Object.assign(i,r):(e.splice(n,0,["enter",r,t],["exit",r,t]),n+=2)}n++}return e}const _c={name:"thematicBreak",tokenize:function(e,t,n){let i,r=0;return function(t){return e.enter("thematicBreak"),function(e){return i=e,o(e)}(t)};function o(o){return o===i?(e.enter("thematicBreakSequence"),s(o)):r>=3&&(null===o||nc(o))?(e.exit("thematicBreak"),t(o)):n(o)}function s(t){return t===i?(e.consume(t),r++,s):(e.exit("thematicBreakSequence"),rc(t)?lc(e,o,"whitespace")(t):o(t))}}},kc={continuation:{tokenize:function(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(hc,function(n){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,lc(e,t,"listItemIndent",i.containerState.size+1)(n)},function(n){return i.containerState.furtherBlankLines||!rc(n)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(n)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Sc,t,r)(n))});function r(r){return i.containerState._closeFlow=!0,i.interrupt=void 0,lc(e,e.attempt(kc,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(r)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const i=this,r=i.events[i.events.length-1];let o=r&&"linePrefix"===r[1].type?r[2].sliceSerialize(r[1],!0).length:0,s=0;return function(t){const r=i.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===r?!i.containerState.marker||t===i.containerState.marker:Jl(t)){if(i.containerState.type||(i.containerState.type=r,e.enter(r,{_container:!0})),"listUnordered"===r)return e.enter("listItemPrefix"),42===t||45===t?e.check(_c,n,l)(t):l(t);if(!i.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return Jl(t)&&++s<10?(e.consume(t),a):(!i.interrupt||s<2)&&(i.containerState.marker?t===i.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||t,e.check(hc,i.interrupt?n:c,e.attempt(Ec,d,u))}function c(e){return i.containerState.initialBlankLine=!0,o++,d(e)}function u(t){return rc(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},Ec={partial:!0,tokenize:function(e,t,n){const i=this;return lc(e,function(e){const r=i.events[i.events.length-1];return!rc(e)&&r&&"listItemPrefixWhitespace"===r[1].type?t(e):n(e)},"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},Sc={partial:!0,tokenize:function(e,t,n){const i=this;return lc(e,function(e){const r=i.events[i.events.length-1];return r&&"listItemIndent"===r[1].type&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(e):n(e)},"listItemIndent",i.containerState.size+1)}},Ac={continuation:{tokenize:function(e,t,n){const i=this;return function(t){return rc(t)?lc(e,r,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):r(t)};function r(i){return e.attempt(Ac,t,n)(i)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const i=this;return function(t){if(62===t){const n=i.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),r}return n(t)};function r(n){return rc(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function Cc(e,t,n,i,r,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(i),e.enter(r),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||Ql(t)?n(t):(e.enter(i),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||nc(t)?n(t):(e.consume(t),92===t?p:h)}function p(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function f(r){return u||null!==r&&41!==r&&!ic(r)?u<c&&40===r?(e.consume(r),u++,f):41===r?(e.consume(r),u--,f):null===r||32===r||40===r||Ql(r)?n(r):(e.consume(r),92===r?m:f):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(r))}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function Nc(e,t,n,i,r,o){const s=this;let a,l=0;return function(t){return e.enter(i),e.enter(r),e.consume(t),e.exit(r),e.enter(o),c};function c(d){return l>999||null===d||91===d||93===d&&!a||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):93===d?(e.exit(o),e.enter(r),e.consume(d),e.exit(r),e.exit(i),t):nc(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||nc(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!rc(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Mc(e,t,n,i,r,o){let s;return function(t){return 34===t||39===t||40===t?(e.enter(i),e.enter(r),e.consume(t),e.exit(r),s=40===t?41:t,a):n(t)};function a(n){return n===s?(e.enter(r),e.consume(n),e.exit(r),e.exit(i),t):(e.enter(o),l(n))}function l(t){return t===s?(e.exit(o),a(s)):null===t?n(t):nc(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),lc(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===s||null===t||nc(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===s||92===t?(e.consume(t),c):c(t)}}function Tc(e,t){let n;return function i(r){return nc(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):rc(r)?lc(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}function Oc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dc={name:"definition",tokenize:function(e,t,n){const i=this;let r;return function(t){return e.enter("definition"),function(t){return Nc.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return r=Oc(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return ic(t)?Tc(e,a)(t):a(t)}function a(t){return Cc(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Ic,c,c)(t)}function c(t){return rc(t)?lc(e,u,"whitespace")(t):u(t)}function u(o){return null===o||nc(o)?(e.exit("definition"),i.parser.defined.push(r),t(o)):n(o)}}},Ic={partial:!0,tokenize:function(e,t,n){return function(t){return ic(t)?Tc(e,i)(t):n(t)};function i(t){return Mc(e,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function r(t){return rc(t)?lc(e,o,"whitespace")(t):o(t)}function o(e){return null===e||nc(e)?t(e):n(e)}}},Rc={name:"codeIndented",tokenize:function(e,t,n){const i=this;return function(t){return e.enter("codeIndented"),lc(e,r,"linePrefix",5)(t)};function r(e){const t=i.events[i.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?a(t):nc(t)?e.attempt(Pc,o,a)(t):(e.enter("codeFlowValue"),s(t))}function s(t){return null===t||nc(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),s)}function a(n){return e.exit("codeIndented"),t(n)}}},Pc={partial:!0,tokenize:function(e,t,n){const i=this;return r;function r(t){return i.parser.lazy[i.now().line]?n(t):nc(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r):lc(e,o,"linePrefix",5)(t)}function o(e){const o=i.events[i.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):nc(e)?r(e):n(e)}}},Lc={name:"headingAtx",resolve:function(e,t){let n,i,r=e.length-2,o=3;return"whitespace"===e[o][1].type&&(o+=2),r-2>o&&"whitespace"===e[r][1].type&&(r-=2),"atxHeadingSequence"===e[r][1].type&&(o===r-1||r-4>o&&"whitespace"===e[r-2][1].type)&&(r-=o+1===r?2:4),r>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[r][1].end},i={type:"chunkText",start:e[o][1].start,end:e[r][1].end,contentType:"text"},zl(e,o,r-o+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e},tokenize:function(e,t,n){let i=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),r(t)}(t)};function r(t){return 35===t&&i++<6?(e.consume(t),r):null===t||ic(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),s(n)):null===n||nc(n)?(e.exit("atxHeading"),t(n)):rc(n)?lc(e,o,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function s(t){return 35===t?(e.consume(t),s):(e.exit("atxHeadingSequence"),o(t))}function a(t){return null===t||35===t||ic(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),a)}}},Fc={name:"setextUnderline",resolveTo:function(e,t){let n,i,r,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(i=o)}else"content"===e[o][1].type&&e.splice(o,1),r||"definition"!==e[o][1].type||(r=o);const s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",r?(e.splice(i,0,["enter",s,t]),e.splice(r+1,0,["exit",e[n][1],t]),e[n][1].end={...e[r][1].end}):e[n][1]=s,e.push(["exit",s,t]),e},tokenize:function(e,t,n){const i=this;let r;return function(t){let s,a=i.events.length;for(;a--;)if("lineEnding"!==i.events[a][1].type&&"linePrefix"!==i.events[a][1].type&&"content"!==i.events[a][1].type){s="paragraph"===i.events[a][1].type;break}return i.parser.lazy[i.now().line]||!i.interrupt&&!s?n(t):(e.enter("setextHeadingLine"),r=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t))};function o(t){return t===r?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),rc(t)?lc(e,s,"lineSuffix")(t):s(t))}function s(i){return null===i||nc(i)?(e.exit("setextHeadingLine"),t(i)):n(i)}}},Bc=["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"],zc=["pre","script","style","textarea"],jc={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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},tokenize:function(e,t,n){const i=this;let r,o,s,a,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),o=!0,p):63===a?(e.consume(a),r=3,i.interrupt?t:R):Zl(a)?(e.consume(a),s=String.fromCharCode(a),f):n(a)}function u(o){return 45===o?(e.consume(o),r=2,d):91===o?(e.consume(o),r=5,a=0,h):Zl(o)?(e.consume(o),r=4,i.interrupt?t:R):n(o)}function d(r){return 45===r?(e.consume(r),i.interrupt?t:R):n(r)}function h(r){return r==="CDATA[".charCodeAt(a++)?(e.consume(r),6===a?i.interrupt?t:A:h):n(r)}function p(t){return Zl(t)?(e.consume(t),s=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||ic(a)){const l=47===a,c=s.toLowerCase();return l||o||!zc.includes(c)?Bc.includes(s.toLowerCase())?(r=6,l?(e.consume(a),m):i.interrupt?t(a):A(a)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(a):o?g(a):b(a)):(r=1,i.interrupt?t(a):A(a))}return 45===a||Xl(a)?(e.consume(a),s+=String.fromCharCode(a),f):n(a)}function m(r){return 62===r?(e.consume(r),i.interrupt?t:A):n(r)}function g(t){return rc(t)?(e.consume(t),g):E(t)}function b(t){return 47===t?(e.consume(t),E):58===t||95===t||Zl(t)?(e.consume(t),y):rc(t)?(e.consume(t),b):E(t)}function y(t){return 45===t||46===t||58===t||95===t||Xl(t)?(e.consume(t),y):v(t)}function v(t){return 61===t?(e.consume(t),x):rc(t)?(e.consume(t),v):b(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):rc(t)?(e.consume(t),x):_(t)}function w(t){return t===l?(e.consume(t),l=null,k):null===t||nc(t)?n(t):(e.consume(t),w)}function _(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||ic(t)?v(t):(e.consume(t),_)}function k(e){return 47===e||62===e||rc(e)?b(e):n(e)}function E(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||nc(t)?A(t):rc(t)?(e.consume(t),S):n(t)}function A(t){return 45===t&&2===r?(e.consume(t),T):60===t&&1===r?(e.consume(t),O):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),R):93===t&&5===r?(e.consume(t),I):!nc(t)||6!==r&&7!==r?null===t||nc(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),A):(e.exit("htmlFlowData"),e.check(Uc,L,C)(t))}function C(t){return e.check(Vc,N,L)(t)}function N(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return null===t||nc(t)?C(t):(e.enter("htmlFlowData"),A(t))}function T(t){return 45===t?(e.consume(t),R):A(t)}function O(t){return 47===t?(e.consume(t),s="",D):A(t)}function D(t){if(62===t){const n=s.toLowerCase();return zc.includes(n)?(e.consume(t),P):A(t)}return Zl(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),D):A(t)}function I(t){return 93===t?(e.consume(t),R):A(t)}function R(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),R):A(t)}function P(t){return null===t||nc(t)?(e.exit("htmlFlowData"),L(t)):(e.consume(t),P)}function L(n){return e.exit("htmlFlow"),t(n)}}},Uc={partial:!0,tokenize:function(e,t,n){return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(hc,t,n)}}},Vc={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return nc(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r):n(t)};function r(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},$c={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r)};function r(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},Hc={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const i=this,r={partial:!0,tokenize:function(e,t,n){let r=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),rc(t)?lc(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===o?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===o?(r++,e.consume(t),c):r>=a?(e.exit("codeFencedFenceSequence"),rc(t)?lc(e,u,"whitespace")(t):u(t)):n(t)}function u(i){return null===i||nc(i)?(e.exit("codeFencedFence"),t(i)):n(i)}}};let o,s=0,a=0;return function(t){return function(t){const n=i.events[i.events.length-1];return s=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===o?(a++,e.consume(t),l):a<3?n(t):(e.exit("codeFencedFenceSequence"),rc(t)?lc(e,c,"whitespace")(t):c(t))}function c(n){return null===n||nc(n)?(e.exit("codeFencedFence"),i.interrupt?t(n):e.check($c,p,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||nc(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):rc(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lc(e,d,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),u)}function d(t){return null===t||nc(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(t))}function h(t){return null===t||nc(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===o?n(t):(e.consume(t),h)}function p(t){return e.attempt(r,y,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return s>0&&rc(t)?lc(e,g,"linePrefix",s+1)(t):g(t)}function g(t){return null===t||nc(t)?e.check($c,p,y)(t):(e.enter("codeFlowValue"),b(t))}function b(t){return null===t||nc(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),b)}function y(n){return e.exit("codeFenced"),t(n)}}},qc=document.createElement("i");function Kc(e){const t="&"+e+";";qc.innerHTML=t;const n=qc.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const Gc={name:"characterReference",tokenize:function(e,t,n){const i=this;let r,o,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,o=Xl,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=ec,c):(e.enter("characterReferenceValue"),r=7,o=Jl,c(t))}function c(a){if(59===a&&s){const r=e.exit("characterReferenceValue");return o!==Xl||Kc(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return o(a)&&s++<r?(e.consume(a),c):n(a)}}},Wc={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),i};function i(i){return tc(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}},Zc={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),lc(e,t,"linePrefix")}}};function Xc(e,t,n){const i=[];let r=-1;for(;++r<e.length;){const o=e[r].resolveAll;o&&!i.includes(o)&&(t=o(t,n),i.push(o))}return t}const Yc={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),"labelImage"===i.type||"labelLink"===i.type||"labelEnd"===i.type){const e="labelImage"===i.type?4:2;i.type="data",t+=e}}return e.length!==n.length&&zl(e,0,e.length,n),e},resolveTo:function(e,t){let n,i,r,o,s=e.length,a=0;for(;s--;)if(n=e[s][1],i){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(r){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(i=s,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(r=s);const l={type:"labelLink"===e[i][1].type?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[r][1].end}},u={type:"labelText",start:{...e[i+a+2][1].end},end:{...e[r-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=jl(o,e.slice(i+1,i+a+3)),o=jl(o,[["enter",u,t]]),o=jl(o,Xc(t.parser.constructs.insideSpan.null,e.slice(i+a+4,r-3),t)),o=jl(o,[["exit",u,t],e[r-2],e[r-1],["exit",c,t]]),o=jl(o,e.slice(r+1)),o=jl(o,[["exit",l,t]]),zl(e,i,e.length,o),e},tokenize:function(e,t,n){const i=this;let r,o,s=i.events.length;for(;s--;)if(("labelImage"===i.events[s][1].type||"labelLink"===i.events[s][1].type)&&!i.events[s][1]._balanced){r=i.events[s][1];break}return function(t){return r?r._inactive?u(t):(o=i.parser.defined.includes(Oc(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(Qc,c,o?c:u)(t):91===t?e.attempt(Jc,c,o?l:u)(t):o?c(t):u(t)}function l(t){return e.attempt(eu,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},Qc={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),i};function i(t){return ic(t)?Tc(e,r)(t):r(t)}function r(t){return 41===t?c(t):Cc(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return ic(t)?Tc(e,a)(t):c(t)}function s(e){return n(e)}function a(t){return 34===t||39===t||40===t?Mc(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return ic(t)?Tc(e,c)(t):c(t)}function c(i){return 41===i?(e.enter("resourceMarker"),e.consume(i),e.exit("resourceMarker"),e.exit("resource"),t):n(i)}}},Jc={tokenize:function(e,t,n){const i=this;return function(t){return Nc.call(i,e,r,o,"reference","referenceMarker","referenceString")(t)};function r(e){return i.parser.defined.includes(Oc(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},eu={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),i};function i(i){return 93===i?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}},tu={name:"labelStartImage",resolveAll:Yc.resolveAll,tokenize:function(e,t,n){const i=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),r};function r(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in i.parser.constructs?n(e):t(e)}}};function nu(e){return null===e||ic(e)||sc(e)?1:oc(e)?2:void 0}const iu={name:"attention",resolveAll:function(e,t){let n,i,r,o,s,a,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},h={...e[u][1].start};ru(d,-a),ru(h,a),o={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:h},r={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},i={type:a>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},e[n][1].end={...o.start},e[u][1].start={...s.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=jl(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=jl(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",r,t]]),l=jl(l,Xc(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=jl(l,[["exit",r,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=jl(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,zl(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=nu(i);let o;return function(t){return o=t,e.enter("attentionSequence"),s(t)};function s(a){if(a===o)return e.consume(a),s;const l=e.exit("attentionSequence"),c=nu(a),u=!c||2===c&&r||n.includes(a),d=!r||2===r&&c||n.includes(i);return l._open=Boolean(42===o?u:u&&(r||!d)),l._close=Boolean(42===o?d:d&&(c||!u)),t(a)}}};function ru(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ou={name:"autolink",tokenize:function(e,t,n){let i=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),r};function r(t){return Zl(t)?(e.consume(t),o):64===t?n(t):l(t)}function o(e){return 43===e||45===e||46===e||Xl(e)?(i=1,s(e)):l(e)}function s(t){return 58===t?(e.consume(t),i=0,a):(43===t||45===t||46===t||Xl(t))&&i++<32?(e.consume(t),s):(i=0,l(t))}function a(i){return 62===i?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):null===i||32===i||60===i||Ql(i)?n(i):(e.consume(i),a)}function l(t){return 64===t?(e.consume(t),c):Yl(t)?(e.consume(t),l):n(t)}function c(e){return Xl(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),i=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||Xl(t))&&i++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}},su={name:"htmlText",tokenize:function(e,t,n){const i=this;let r,o,s;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),y):Zl(t)?(e.consume(t),k):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),o=0,p):Zl(t)?(e.consume(t),b):n(t)}function c(t){return 45===t?(e.consume(t),h):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):nc(t)?(s=u,D(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),h):u(t)}function h(e){return 62===e?O(e):45===e?d(e):u(e)}function p(t){return t==="CDATA[".charCodeAt(o++)?(e.consume(t),6===o?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):nc(t)?(s=f,D(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?O(t):93===t?(e.consume(t),g):f(t)}function b(t){return null===t||62===t?O(t):nc(t)?(s=b,D(t)):(e.consume(t),b)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):nc(t)?(s=y,D(t)):(e.consume(t),y)}function v(e){return 62===e?O(e):y(e)}function x(t){return Zl(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||Xl(t)?(e.consume(t),w):_(t)}function _(t){return nc(t)?(s=_,D(t)):rc(t)?(e.consume(t),_):O(t)}function k(t){return 45===t||Xl(t)?(e.consume(t),k):47===t||62===t||ic(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),O):58===t||95===t||Zl(t)?(e.consume(t),S):nc(t)?(s=E,D(t)):rc(t)?(e.consume(t),E):O(t)}function S(t){return 45===t||46===t||58===t||95===t||Xl(t)?(e.consume(t),S):A(t)}function A(t){return 61===t?(e.consume(t),C):nc(t)?(s=A,D(t)):rc(t)?(e.consume(t),A):E(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,N):nc(t)?(s=C,D(t)):rc(t)?(e.consume(t),C):(e.consume(t),M)}function N(t){return t===r?(e.consume(t),r=void 0,T):null===t?n(t):nc(t)?(s=N,D(t)):(e.consume(t),N)}function M(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||ic(t)?E(t):(e.consume(t),M)}function T(e){return 47===e||62===e||ic(e)?E(e):n(e)}function O(i){return 62===i?(e.consume(i),e.exit("htmlTextData"),e.exit("htmlText"),t):n(i)}function D(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return rc(t)?lc(e,R,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):R(t)}function R(t){return e.enter("htmlTextData"),s(t)}}},au={name:"labelStartLink",resolveAll:Yc.resolveAll,tokenize:function(e,t,n){const i=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),r};function r(e){return 94===e&&"_hiddenFootnoteSupport"in i.parser.constructs?n(e):t(e)}}},lu={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),i};function i(i){return nc(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}},cu={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,i=e.length-4,r=3;if(!("lineEnding"!==e[r][1].type&&"space"!==e[r][1].type||"lineEnding"!==e[i][1].type&&"space"!==e[i][1].type))for(t=r;++t<i;)if("codeTextData"===e[t][1].type){e[r][1].type="codeTextPadding",e[i][1].type="codeTextPadding",r+=2,i-=2;break}for(t=r-1,i++;++t<=i;)void 0===n?t!==i&&"lineEnding"!==e[t][1].type&&(n=t):t!==i&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),i-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let i,r,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),s(t)};function s(t){return 96===t?(e.consume(t),o++,s):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(r=e.enter("codeTextSequence"),i=0,c(t)):nc(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||nc(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),i++,c):i===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(r.type="codeTextData",l(n))}}},uu={42:kc,43:kc,45:kc,48:kc,49:kc,50:kc,51:kc,52:kc,53:kc,54:kc,55:kc,56:kc,57:kc,62:Ac},du={91:Dc},hu={[-2]:Rc,[-1]:Rc,32:Rc},pu={35:Lc,42:_c,45:[Fc,_c],60:jc,61:Fc,95:_c,96:Hc,126:Hc},fu={38:Gc,92:Wc},mu={[-5]:Zc,[-4]:Zc,[-3]:Zc,33:tu,38:Gc,42:iu,60:[ou,su],91:au,92:[lu,Wc],93:Yc,95:iu,96:cu},gu={null:[iu,gc]},bu={null:[42,95]},yu={null:[]};function vu(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},o=[];let s=[],a=[],l=!0;const c={attempt:b(function(e,t){y(e,t.from)}),check:b(g),consume:function(e){nc(e)?(i.line++,i.column=1,i.offset+=-3===e?2:1,v()):-1!==e&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),u.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:b(g,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){r[e.line]=e.column,v()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const i=[];let r;for(;++n<e.length;){const o=e[n];let s;if("string"==typeof o)s=o;else switch(o){case-5:s="\r";break;case-4:s="\n";break;case-3:s="\r\n";break;case-2:s=t?" ":"\t";break;case-1:if(!t&&r)continue;s=" ";break;default:s=String.fromCharCode(o)}r=-2===o,i.push(s)}return i.join("")}(p(e),t)},sliceStream:p,write:function(e){return s=jl(s,e),function(){let e;for(;i._index<s.length;){const t=s[i._index];if("string"==typeof t)for(e=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===e&&i._bufferIndex<t.length;)m(t.charCodeAt(i._bufferIndex));else m(t)}}(),null!==s[s.length-1]?[]:(y(t,0),u.events=Xc(o,u.events,u),u.events)}};let d,h=t.tokenize.call(u,c);return t.resolveAll&&o.push(t),u;function p(e){return function(e,t){const n=t.start._index,i=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex;let s;if(n===r)s=[e[n].slice(i,o)];else{if(s=e.slice(n,r),i>-1){const e=s[0];"string"==typeof e?s[0]=e.slice(i):s.shift()}o>0&&s.push(e[r].slice(0,o))}return s}(s,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:r,offset:o}=i;return{_bufferIndex:e,_index:t,line:n,column:r,offset:o}}function m(e){l=void 0,d=e,h=h(e)}function g(e,t){t.restore()}function b(e,t){return function(n,r,o){let s,d,h,p;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):function(e){return function(t){const n=null!==t&&e[t],i=null!==t&&e.null;return m([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(i)?i:i?[i]:[]])(t)}}(n);function m(e){return s=e,d=0,0===e.length?o:g(e[d])}function g(e){return function(n){return p=function(){const e=f(),t=u.previous,n=u.currentConstruct,r=u.events.length,o=Array.from(a);return{from:r,restore:function(){i=e,u.previous=t,u.currentConstruct=n,u.events.length=r,a=o,v()}}}(),h=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?y():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,b,y)(n)}}function b(t){return l=!0,e(h,p),r}function y(e){return l=!0,p.restore(),++d<s.length?g(s[d]):o}}}function y(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&zl(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function v(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}const xu=/[\0\t\n\r]/g;function wu(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const _u=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ku(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return wu(n.slice(t?2:1),t?16:10)}return Kc(n)||e}const Eu={}.hasOwnProperty;function Su(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(y),autolinkProtocol:u,autolinkEmail:u,atxHeading:r(m),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(f),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(f,o),codeText:r(function(){return{type:"inlineCode",value:""}},o),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(g),hardBreakTrailing:r(g),htmlFlow:r(b,o),htmlFlowData:u,htmlText:r(b,o),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:o,link:r(y),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(m),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:a(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let i;n?(i=wu(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):i=Kc(t);this.stack[this.stack.length-1].value+=i},characterReference:function(e){this.stack.pop().position.end=Au(e.end)},codeFenced:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:a(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Oc(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(h),hardBreakTrailing:a(h),htmlFlow:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:a(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const 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}),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(_u,ku)}(t),n.identifier=Oc(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak)return n.children[n.children.length-1].position.end=Au(e.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),d.call(this,e))},link:a(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const 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}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Oc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};Cu(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let r={type:"root",children:[]};const a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:c,data:n},u=[];let d=-1;for(;++d<e.length;)"listOrdered"!==e[d][1].type&&"listUnordered"!==e[d][1].type||("enter"===e[d][0]?u.push(d):d=i(e,u.pop(),d));for(d=-1;++d<e.length;){const n=t[e[d][0]];Eu.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){const e=a.tokenStack[a.tokenStack.length-1];(e[1]||Mu).call(a,void 0,e[0])}for(r.position={start:Au(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Au(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 i,r,o,s,a=t-1,l=-1,c=!1;for(;++a<=n;){const t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,s=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!i||s||l||o||(o=a),s=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:s=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(i){let s=a;for(r=void 0;s--;){const t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;r&&(e[r][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",r=s}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}o&&(!r||o<r)&&(i._spread=!0),i.end=Object.assign({},r?e[r][1].start:t[1].end),e.splice(r||a,0,["exit",i,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){const r={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};i=r,e.splice(a,0,["enter",r,t[2]]),a++,n++,o=void 0,s=!0}}}return e[t][1]._spread=c,n}function r(e,t){return function(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:Au(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){const n=this.stack.pop(),i=this.tokenStack.pop();if(!i)throw new Error("Cannot close `"+e.type+"` ("+fl({start:e.start,end:e.end})+"): it’s not open");i[0].type!==e.type&&(t?t.call(this,e,i[0]):(i[1]||Mu).call(this,e,i[0])),n.position.end=Au(e.end)}function c(){return Ll(this.stack.pop())}function u(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n={type:"text",value:""},n.position={start:Au(e.start),end:void 0},t.push(n)),this.stack.push(n)}function d(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Au(e.end)}function h(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function f(){return{type:"code",lang:null,meta:null,value:""}}function m(){return{type:"heading",depth:0,children:[]}}function g(){return{type:"break"}}function b(){return{type:"html",value:""}}function y(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}}(n)(function(e){for(;!$l(e););return e}(function(e){const t={constructs:Kl([k,...(e||{}).extensions||[]]),content:n(cc),defined:[],document:n(uc),flow:n(mc),lazy:{},string:n(bc),text:n(yc)};return t;function n(e){return function(n){return vu(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",i=!0;return function(r,o,s){const a=[];let l,c,u,d,h;for(r=n+("string"==typeof r?r.toString():new TextDecoder(o||void 0).decode(r)),u=0,n="",i&&(65279===r.charCodeAt(0)&&u++,i=void 0);u<r.length;){if(xu.lastIndex=u,l=xu.exec(r),d=l&&void 0!==l.index?l.index:r.length,h=r.charCodeAt(d),!l){n=r.slice(u);break}if(10===h&&u===d&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),u<d&&(a.push(r.slice(u,d)),t+=d-u),h){case 0:a.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),a.push(-2);t++<c;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return s&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))}function Au(e){return{line:e.line,column:e.column,offset:e.offset}}function Cu(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Cu(e,i):Nu(e,i)}}function Nu(e,t){let n;for(n in t)if(Eu.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Mu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fl({start:t.start,end:t.end})+") is still open")}function Tu(e){const t=this;t.parser=function(n){return Su(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const Ou="object"==typeof self?self:globalThis,Du=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),i=r=>{if(e.has(r))return e.get(r);const[o,s]=t[r];switch(o){case 0:case-1:return n(s,r);case 1:{const e=n([],r);for(const t of s)e.push(i(t));return e}case 2:{const e=n({},r);for(const[t,n]of s)e[i(t)]=i(n);return e}case 3:return n(new Date(s),r);case 4:{const{source:e,flags:t}=s;return n(new RegExp(e,t),r)}case 5:{const e=n(new Map,r);for(const[t,n]of s)e.set(i(t),i(n));return e}case 6:{const e=n(new Set,r);for(const t of s)e.add(i(t));return e}case 7:{const{name:e,message:t}=s;return n(new Ou[e](t),r)}case 8:return n(BigInt(s),r);case"BigInt":return n(Object(BigInt(s)),r);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:e}=new Uint8Array(s);return n(new DataView(e),s)}}return n(new Ou[o](s),r)};return i})(new Map,e)(0),Iu="",{toString:Ru}={},{keys:Pu}=Object,Lu=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Ru.call(e).slice(8,-1);switch(n){case"Array":return[1,Iu];case"Object":return[2,Iu];case"Date":return[3,Iu];case"RegExp":return[4,Iu];case"Map":return[5,Iu];case"Set":return[6,Iu];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Fu=([e,t])=>0===e&&("function"===t||"symbol"===t),Bu=(e,{json:t,lossy:n}={})=>{const i=[];return((e,t,n,i)=>{const r=(e,t)=>{const r=i.push(e)-1;return n.set(t,r),r},o=i=>{if(n.has(i))return n.get(i);let[s,a]=Lu(i);switch(s){case 0:{let t=i;switch(a){case"bigint":s=8,t=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return r([-1],i)}return r([s,t],i)}case 1:{if(a){let e=i;return"DataView"===a?e=new Uint8Array(i.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(i)),r([a,[...e]],i)}const e=[],t=r([s,e],i);for(const t of i)e.push(o(t));return t}case 2:{if(a)switch(a){case"BigInt":return r([a,i.toString()],i);case"Boolean":case"Number":case"String":return r([a,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());const n=[],l=r([s,n],i);for(const t of Pu(i))!e&&Fu(Lu(i[t]))||n.push([o(t),o(i[t])]);return l}case 3:return r([s,i.toISOString()],i);case 4:{const{source:e,flags:t}=i;return r([s,{source:e,flags:t}],i)}case 5:{const t=[],n=r([s,t],i);for(const[n,r]of i)(e||!Fu(Lu(n))&&!Fu(Lu(r)))&&t.push([o(n),o(r)]);return n}case 6:{const t=[],n=r([s,t],i);for(const n of i)!e&&Fu(Lu(n))||t.push(o(n));return n}}const{message:l}=i;return r([s,{name:a,message:l}],i)};return o})(!(t||n),!!t,new Map,i)(e),i},zu="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Du(Bu(e,t)):structuredClone(e):(e,t)=>Du(Bu(e,t));function ju(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(37===o&&Xl(e.charCodeAt(n+1))&&Xl(e.charCodeAt(n+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(s=String.fromCharCode(o,t),r=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(i,n),encodeURIComponent(s)),i=n+r+1,s=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function Uu(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Vu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const $u=function(e){if(null==e)return qu;if("function"==typeof e)return Hu(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$u(e[n]);return Hu(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):function(e){const t=e;return Hu(function(n){const i=n;let r;for(r in e)if(i[r]!==t[r])return!1;return!0})}(e);if("string"==typeof e)return t=e,Hu(function(e){return e&&e.type===t});var t;throw new Error("Expected function, string, or object as test")};function Hu(e){return function(t,n,i){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,i||void 0))}}function qu(){return!0}const Ku=[],Gu=!1;function Wu(e,t,n,i){let r;"function"==typeof t&&"function"!=typeof n?(i=n,n=t):r=t;const o=$u(r),s=i?-1:1;!function e(r,a,l){const c=r&&"object"==typeof r?r:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+r.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,h=Ku;if((!t||o(r,a,l[l.length-1]||void 0))&&(h=function(e){return Array.isArray(e)?e:"number"==typeof e?[true,e]:null==e?Ku:[e]}(n(r,l)),h[0]===Gu))return h;if("children"in r&&r.children){const t=r;if(t.children&&"skip"!==h[0])for(u=(i?t.children.length:-1)+s,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===Gu)return c;u="number"==typeof c[1]?c[1]:u+s}}return h}}(e,void 0,[])()}function Zu(e,t,n,i){let r,o,s;"function"==typeof t&&"function"!=typeof n?(o=void 0,s=t,r=n):(o=t,s=n,r=i),Wu(e,o,function(e,t){const n=t[t.length-1],i=n?n.children.indexOf(e):void 0;return s(e,i,n)},r)}function Xu(e,t){const n=t.referenceType;let i="]";if("collapsed"===n?i+="[]":"full"===n&&(i+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),o=r[0];o&&"text"===o.type?o.value="["+o.value:r.unshift({type:"text",value:"["});const s=r[r.length-1];return s&&"text"===s.type?s.value+=i:r.push({type:"text",value:i}),r}function Yu(e){const t=e.spread;return null==t?e.children.length>1:t}function Qu(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),r=0;const o=[];for(;i;)o.push(Ju(t.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return o.push(Ju(t.slice(r),r>0,!1)),o.join("")}function Ju(e,t,n){let i=0,r=e.length;if(t){let t=e.codePointAt(i);for(;9===t||32===t;)i++,t=e.codePointAt(i)}if(n){let t=e.codePointAt(r-1);for(;9===t||32===t;)r--,t=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}const ed={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",i={};t.lang&&(i.className=["language-"+t.lang]);let r={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(r.data={meta:t.meta}),e.patch(t,r),r=e.applyData(t,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(t,r),r},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=ju(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let s,a=e.footnoteCounts.get(i);void 0===a?(a=0,e.footnoteOrder.push(i),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(i,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Xu(e,t);const r={src:ju(i.url||""),alt:t.alt};null!==i.title&&void 0!==i.title&&(r.title=i.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:ju(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Xu(e,t);const r={href:ju(i.url||"")};null!==i.title&&void 0!==i.title&&(r.title=i.title);const o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:ju(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},listItem:function(e,t,n){const i=e.all(t),r=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=Yu(n[i])}return t}(n):Yu(t),o={},s=[];if("boolean"==typeof t.checked){const e=i[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},i.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<i.length;){const e=i[a];(r||0!==a||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||r?s.push(e):s.push(...e.children)}const l=i[i.length-1];l&&(r||"element"!==l.type||"p"!==l.tagName)&&s.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},i=e.all(t);let r=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++r<i.length;){const e=i[r];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),i=n.shift(),r=[];if(i){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],n),r.push(n)}if(n.length>0){const i={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=hl(t.children[1]),s=dl(t.children[t.children.length-1]);o&&s&&(i.position={start:o,end:s}),r.push(i)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const i=n?n.children:void 0,r=0===(i?i.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,s=o?o.length:t.children.length;let a=-1;const l=[];for(;++a<s;){const n=t.children[a],i={},s=o?o[a]:void 0;s&&(i.align=s);let c={type:"element",tagName:r,properties:i,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:Qu(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:td,yaml:td,definition:td,footnoteDefinition:td};function td(){}const nd={}.hasOwnProperty,id={};function rd(e,t){e.position&&(t.position=function(e){const t=hl(e),n=dl(e);if(t&&n)return{start:t,end:n}}(e))}function od(e,t){let n=t;if(e&&e.data){const t=e.data.hName,i=e.data.hChildren,r=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&r&&Object.assign(n.properties,zu(r)),"children"in n&&n.children&&null!=i&&(n.children=i)}return n}function sd(e,t){const n=t.data||{},i=!("value"in t)||nd.call(n,"hProperties")||nd.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,i),e.applyData(t,i)}function ad(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:"\n"});++i<e.length;)i&&n.push({type:"text",value:"\n"}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function ld(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function cd(e,t){const n=function(e,t){const n=t||id,i=new Map,r=new Map,o=new Map,s={...ed,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let i=-1;for(;++i<n.length;){const r=a.one(n[i],e);if(r){if(i&&"break"===n[i-1].type&&(Array.isArray(r)||"text"!==r.type||(r.value=ld(r.value)),!Array.isArray(r)&&"element"===r.type)){const e=r.children[0];e&&"text"===e.type&&(e.value=ld(e.value))}Array.isArray(r)?t.push(...r):t.push(r)}}}return t},applyData:od,definitionById:i,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:s,one:function(e,t){const n=e.type,i=a.handlers[n];if(nd.call(a.handlers,n)&&i)return i(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,i=zu(n);return i.children=a.all(e),i}return zu(e)}return(a.options.unknownHandler||sd)(a,e,t)},options:n,patch:rd,wrap:ad};return Zu(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?i:r,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a}(e,t),i=n.one(e,void 0),r=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Uu,i=e.options.footnoteBackLabel||Vu,r=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const r=e.footnoteById.get(e.footnoteOrder[l]);if(!r)continue;const o=e.all(r),s=String(r.identifier).toUpperCase(),c=ju(s.toLowerCase());let u=0;const d=[],h=e.footnoteCounts.get(s);for(;void 0!==h&&++u<=h;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof i?i:i(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else o.push(...d);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(r,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...zu(s),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(n),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&o.children.push({type:"text",value:"\n"},r),o}function ud(e,t){return e&&"run"in e?async function(n,i){const r=cd(n,{file:i,...t});await e.run(r,i)}:function(n,i){return cd(n,{file:i,...e||t})}}function dd(e){if(e)throw e}var hd=w(710);function pd(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}const fd=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');vd(e);let n,i=0,r=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){i=o+1;break}}else r<0&&(n=!0,r=o+1);return r<0?"":e.slice(i,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){i=o+1;break}}else s<0&&(n=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return i===r?r=s:r<0&&(r=e.length),e.slice(i,r)},md=function(e){if(vd(e),0===e.length)return".";let t,n=-1,i=e.length;for(;--i;)if(47===e.codePointAt(i)){if(t){n=i;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},gd=function(e){vd(e);let t,n=e.length,i=-1,r=0,o=-1,s=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)i<0&&(t=!0,i=n+1),46===a?o<0?o=n:1!==s&&(s=1):o>-1&&(s=-1);else if(t){r=n+1;break}}return o<0||i<0||0===s||1===s&&o===i-1&&o===r+1?"":e.slice(o,i)},bd=function(...e){let t,n=-1;for(;++n<e.length;)vd(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){vd(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,i,r="",o=0,s=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(s===l-1||1===a);else if(s!==l-1&&2===a){if(r.length<2||2!==o||46!==r.codePointAt(r.length-1)||46!==r.codePointAt(r.length-2))if(r.length>2){if(i=r.lastIndexOf("/"),i!==r.length-1){i<0?(r="",o=0):(r=r.slice(0,i),o=r.length-1-r.lastIndexOf("/")),s=l,a=0;continue}}else if(r.length>0){r="",o=0,s=l,a=0;continue}t&&(r=r.length>0?r+"/..":"..",o=2)}else r.length>0?r+="/"+e.slice(s+1,l):r=e.slice(s+1,l),o=l-s-1;s=l,a=0}else 46===n&&a>-1?a++:a=-1}return r}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},yd="/";function vd(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xd=function(){return"/"};function wd(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}const _d=["history","path","basename","stem","extname","dirname"];class kd{constructor(e){let t;t=e?wd(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":xd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,i=-1;for(;++i<_d.length;){const e=_d[i];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)_d.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?fd(this.path):void 0}set basename(e){Sd(e,"basename"),Ed(e,"basename"),this.path=bd(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?md(this.path):void 0}set dirname(e){Ad(this.basename,"dirname"),this.path=bd(e||"",this.basename)}get extname(){return"string"==typeof this.path?gd(this.path):void 0}set extname(e){if(Ed(e,"extname"),Ad(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=bd(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){wd(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!wd(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),Sd(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?fd(this.path,this.extname):void 0}set stem(e){Sd(e,"stem"),Ed(e,"stem"),this.path=bd(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const i=this.message(e,t,n);throw i.fatal=!0,i}info(e,t,n){const i=this.message(e,t,n);return i.fatal=void 0,i}message(e,t,n){const i=new yl(e,t,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Ed(e,t){if(e&&e.includes(yd))throw new Error("`"+t+"` cannot be a path: did not expect `"+yd+"`")}function Sd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ad(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Cd=function(e){const t=this.constructor.prototype,n=t[e],i=function(){return n.apply(i,arguments)};return Object.setPrototypeOf(i,t),i},Nd={}.hasOwnProperty;class Md extends Cd{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){const e=[],t={run:function(...t){let n=-1;const i=t.pop();if("function"!=typeof i)throw new TypeError("Expected function as last argument, not "+i);!function r(o,...s){const a=e[++n];let l=-1;if(o)i(o);else{for(;++l<t.length;)null!==s[l]&&void 0!==s[l]||(s[l]=t[l]);t=s,a?function(e,t){let n;return function(...t){const o=e.length>t.length;let s;o&&t.push(i);try{s=e.apply(this,t)}catch(e){if(o&&n)throw e;return i(e)}o||(s&&s.then&&"function"==typeof s.then?s.then(r,i):s instanceof Error?i(s):r(s))};function i(e,...i){n||(n=!0,t(e,...i))}function r(e){i(null,e)}}(a,r)(...s):i(null,...s)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){const e=new Md;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(hd(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(Id("data",this.frozen),this.namespace[e]=t,this):Nd.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Id("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const i=t.call(e,...n);"function"==typeof i&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Ld(e),n=this.parser||this.Parser;return Od("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Od("process",this.parser||this.Parser),Dd("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(i,r){const o=Ld(e),s=n.parse(o);function a(e,n){e||!n?r(e):i?i(n):t(void 0,n)}n.run(s,o,function(e,t,i){if(e||!t||!i)return a(e);const r=t,o=n.stringify(r,i);var s;"string"==typeof(s=o)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(s)?i.value=o:i.result=o,a(e,i)})}}processSync(e){let t,n=!1;return this.freeze(),Od("processSync",this.parser||this.Parser),Dd("processSync",this.compiler||this.Compiler),this.process(e,function(e,i){n=!0,dd(e),t=i}),Pd("processSync","process",n),t}run(e,t,n){Rd(e),this.freeze();const i=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?r(void 0,n):new Promise(r);function r(r,o){const s=Ld(t);i.run(e,s,function(t,i,s){const a=i||e;t?o(t):r?r(a):n(void 0,a,s)})}}runSync(e,t){let n,i=!1;return this.run(e,t,function(e,t){dd(e),n=t,i=!0}),Pd("runSync","run",i),n}stringify(e,t){this.freeze();const n=Ld(t),i=this.compiler||this.Compiler;return Dd("stringify",i),Rd(e),i(e,n)}use(e,...t){const n=this.attachers,i=this.namespace;if(Id("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?s(e):o(e)}return this;function r(e){if("function"==typeof e)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(t,n)}else o(e)}}function o(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(e.plugins),e.settings&&(i.settings=hd(!0,i.settings,e.settings))}function s(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;)r(e[t])}}function a(e,t){let i=-1,r=-1;for(;++i<n.length;)if(n[i][0]===e){r=i;break}if(-1===r)n.push([e,...t]);else if(t.length>0){let[i,...o]=t;const s=n[r][1];pd(s)&&pd(i)&&(i=hd(!0,s,i)),n[r]=[e,i,...o]}}}}const Td=(new Md).freeze();function Od(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Dd(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function Id(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Rd(e){if(!pd(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Pd(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ld(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new kd(e)}const Fd=[],Bd={allowDangerousHtml:!0},zd=/^(https?|ircs?|mailto|xmpp)$/i,jd=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ud(i){const r=function(e){const t=e.rehypePlugins||Fd,n=e.remarkPlugins||Fd,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Bd}:Bd;return Td().use(Tu).use(n).use(ud,i).use(t)}(i),o=function(e){const t=e.children||"",n=new kd;return"string"==typeof t&&(n.value=t),n}(i);return function(i,r){const o=r.allowedElements,s=r.allowElement,a=r.components,l=r.disallowedElements,c=r.skipHtml,u=r.unwrapDisallowed,d=r.urlTransform||Vd;for(const e of jd)Object.hasOwn(r,e.from)&&Ea((e.from,e.to&&e.to,e.id));return Zu(i,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return c?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Rl)if(Object.hasOwn(Rl,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],i=Rl[t];(null===i||i.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let i=o?!o.includes(e.tagName):!!l&&l.includes(e.tagName);if(!i&&s&&"number"==typeof t&&(i=!s(e,t,n)),i&&n&&"number"==typeof t)return u&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=function(e,t){return function(n,i,r,o){const s=Array.isArray(r.children),a=hl(n);return t(i,r,o,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=t.jsx,o=t.jsxs,i=function(e,t,n,i){const s=Array.isArray(n.children)?o:r;return i?s(t,n,i):s(t,n)}}var r,o;const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?il:nl,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},a=Sl(s,e,void 0);return a&&"string"!=typeof a?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}(i,{Fragment:e,components:a,ignoreInvalidStyle:!0,jsx:t,jsxs:n,passKeys:!0,passNode:!0})}(r.runSync(r.parse(o),o),i)}function Vd(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return-1===t||-1!==r&&t>r||-1!==n&&t>n||-1!==i&&t>i||zd.test(e.slice(0,t))?e:""}function $d(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;-1!==r;)i++,r=n.indexOf(t,r+t.length);return i}function Hd(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function qd(e){return"function"==typeof e?e:function(){return e}}const Kd="phrasing",Gd=["autolink","link","image","label"];function Wd(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Zd(e){this.config.enter.autolinkProtocol.call(this,e)}function Xd(e){this.config.exit.autolinkProtocol.call(this,e)}function Yd(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Qd(e){this.config.exit.autolinkEmail.call(this,e)}function Jd(e){this.exit(e)}function eh(e){!function(e,t,n){const i=$u((n||{}).ignore||[]),r=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const e=n[i];t.push([Hd(e[0]),qd(e[1])])}return t}(t);let o=-1;for(;++o<r.length;)Wu(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){const e=t[s],r=n?n.children:void 0;if(i(e,r?r.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],i=r[o][0],s=r[o][1];let a=0;const l=n.children.indexOf(e);let c=!1,u=[];i.lastIndex=0;let d=i.exec(e.value);for(;d;){const n=d.index,r={index:d.index,input:d.input,stack:[...t,e]};let o=s(...d,r);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?i.lastIndex=n+1:(a!==n&&u.push({type:"text",value:e.value.slice(a,n)}),Array.isArray(o)?u.push(...o):o&&u.push(o),a=n+d[0].length,c=!0),!i.global)break;d=i.exec(e.value)}return c?(a<e.value.length&&u.push({type:"text",value:e.value.slice(a)}),n.children.splice(l,1,...u)):u=[e],l+u.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,th],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,nh]],{ignore:["link","linkReference"]})}function th(e,t,n,i,r){let o="";if(!ih(r))return!1;if(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!function(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}(n))return!1;const s=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=$d(e,"(");let o=$d(e,")");for(;-1!==i&&r>o;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),o++;return[e,n]}(n+i);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function nh(e,t,n,i){return!(!ih(i,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ih(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||sc(n)||oc(n))&&(!t||47!==n)}function rh(){this.buffer()}function oh(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function sh(){this.buffer()}function ah(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lh(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ch(e){this.exit(e)}function uh(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dh(e){this.exit(e)}function hh(e,t,n,i){const r=n.createTracker(i);let o=r.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=r.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=r.move("]"),o}function ph(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,i,r){const o=i.createTracker(r);let s=o.move("[^");const a=i.enter("footnoteDefinition"),l=i.enter("label");return s+=o.move(i.safe(i.associationId(e),{before:s,after:"]"})),l(),s+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),s+=o.move((t?"\n":" ")+i.indentLines(i.containerFlow(e,o.current()),t?mh:fh))),a(),s},footnoteReference:hh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function fh(e,t,n){return 0===t?e:mh(e,0,n)}function mh(e,t,n){return(n?"":" ")+e}hh.peek=function(){return"["};const gh=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function bh(e){this.enter({type:"delete",children:[]},e)}function yh(e){this.exit(e)}function vh(e,t,n,i){const r=n.createTracker(i),o=n.enter("strikethrough");let s=r.move("~~");return s+=n.containerPhrasing(e,{...r.current(),before:s,after:"~"}),s+=r.move("~~"),o(),s}function xh(e){return e.length}function wh(e){return null==e?"":String(e)}function _h(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function kh(e,t,n){return">"+(n?"":" ")+e}function Eh(e,t){return Sh(e,t.inConstruct,!0)&&!Sh(e,t.notInConstruct,!1)}function Sh(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Ah(e,t,n,i){let r=-1;for(;++r<n.unsafe.length;)if("\n"===n.unsafe[r].character&&Eh(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return"\\\n"}function Ch(e,t,n){return(n?"":" ")+e}function Nh(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Mh(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Th(e,t,n){const i=nu(e),r=nu(t);return void 0===i?void 0===r?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===r?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===i?void 0===r?{inside:!1,outside:!1}:1===r?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===r?{inside:!1,outside:!1}:1===r?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Oh(e,t,n,i){const r=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),o=n.enter("emphasis"),s=n.createTracker(i),a=s.move(r);let l=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()}));const c=l.charCodeAt(0),u=Th(i.before.charCodeAt(i.before.length-1),c,r);u.inside&&(l=Mh(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Th(i.after.charCodeAt(0),d,r);h.inside&&(l=l.slice(0,-1)+Mh(d));const p=s.move(r);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function Dh(e){return e.value||""}function Ih(e,t,n,i){const r=Nh(n),o='"'===r?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+r),c+=l.move(n.safe(e.title,{before:c,after:r,...l.current()})),c+=l.move(r),a()),c+=l.move(")"),s(),c}function Rh(e,t,n,i){const r=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(i);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),"full"!==r&&c&&c===d?"shortcut"===r?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(d+"]"),l}function Ph(e,t,n){let i=e.value||"",r="`",o=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<n.unsafe.length;){const e=n.unsafe[o],t=n.compilePattern(e);let r;if(e.atBreak)for(;r=t.exec(i);){let e=r.index;10===i.charCodeAt(e)&&13===i.charCodeAt(e-1)&&e--,i=i.slice(0,e)+" "+i.slice(r.index+1)}}return r+i+r}function Lh(e,t){const n=Ll(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function Fh(e,t,n,i){const r=Nh(n),o='"'===r?"Quote":"Apostrophe",s=n.createTracker(i);let a,l;if(Lh(e,n)){const t=n.stack;n.stack=[],a=n.enter("autolink");let i=s.move("<");return i+=s.move(n.containerPhrasing(e,{before:i,after:">",...s.current()})),i+=s.move(">"),a(),n.stack=t,i}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=s.move(" "+r),c+=s.move(n.safe(e.title,{before:c,after:r,...s.current()})),c+=s.move(r),l()),c+=s.move(")"),a(),c}function Bh(e,t,n,i){const r=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(i);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),"full"!==r&&c&&c===d?"shortcut"===r?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(d+"]"),l}function zh(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function jh(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}vh.peek=function(){return"~"},Oh.peek=function(e,t,n){return n.options.emphasis||"*"},Dh.peek=function(){return"<"},Ih.peek=function(){return"!"},Rh.peek=function(){return"!"},Ph.peek=function(){return"`"},Fh.peek=function(e,t,n){return Lh(e,n)?"<":"["},Bh.peek=function(){return"["};const Uh=$u(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Vh(e,t,n,i){const r=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),o=n.enter("strong"),s=n.createTracker(i),a=s.move(r+r);let l=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()}));const c=l.charCodeAt(0),u=Th(i.before.charCodeAt(i.before.length-1),c,r);u.inside&&(l=Mh(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Th(i.after.charCodeAt(0),d,r);h.inside&&(l=l.slice(0,-1)+Mh(d));const p=s.move(r+r);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}Vh.peek=function(e,t,n){return n.options.strong||"*"};const $h={blockquote:function(e,t,n,i){const r=n.enter("blockquote"),o=n.createTracker(i);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),kh);return r(),s},break:Ah,code:function(e,t,n,i){const r=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),o=e.value||"",s="`"===r?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(o,Ch);return e(),t}const a=n.createTracker(i),l=r.repeat(Math.max(function(e,t){const n=String(e);let i=n.indexOf(t),r=i,o=0,s=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==i;)i===r?++o>s&&(s=o):o=1,r=i+t.length,i=n.indexOf(t,r);return s}(o,r)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const t=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...a.current()})),t()}return u+=a.move("\n"),o&&(u+=a.move(o+"\n")),u+=a.move(l),c(),u},definition:function(e,t,n,i){const r=Nh(n),o='"'===r?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+r),c+=l.move(n.safe(e.title,{before:c,after:r,...l.current()})),c+=l.move(r),a()),s(),c},emphasis:Oh,hardBreak:Ah,heading:function(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(i);if(function(e,t){let n=!1;return Zu(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,Gu}),Boolean((!e.depth||e.depth<3)&&Ll(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),i=n.enter("phrasing"),s=n.containerPhrasing(e,{...o.current(),before:"\n",after:"\n"});return i(),t(),s+"\n"+(1===r?"=":"-").repeat(s.length-(Math.max(s.lastIndexOf("\r"),s.lastIndexOf("\n"))+1))}const s="#".repeat(r),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...o.current()});return/^[\t ]/.test(c)&&(c=Mh(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c},html:Dh,image:Ih,imageReference:Rh,inlineCode:Ph,link:Fh,linkReference:Bh,list:function(e,t,n,i){const r=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):zh(n);const a=e.ordered?"."===s?")":".":function(e){const t=zh(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&s===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==s&&"-"!==s||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),jh(n)===s&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,i);return n.bulletLastUsed=s,n.bulletCurrent=o,r(),c},listItem:function(e,t,n,i){const r=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let o=n.bulletCurrent||zh(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let s=o.length+1;("tab"===r||"mixed"===r&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));const a=n.createTracker(i);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?o:o+" ".repeat(s-o.length))+e});return l(),c},paragraph:function(e,t,n,i){const r=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,i);return o(),r(),s},root:function(e,t,n,i){return(e.children.some(function(e){return Uh(e)})?n.containerPhrasing:n.containerFlow).call(n,e,i)},strong:Vh,text:function(e,t,n,i){return n.safe(e.value,i)},thematicBreak:function(e,t,n){const i=(jh(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?i.slice(0,-1):i}};function Hh(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function qh(e){this.exit(e),this.data.inTable=void 0}function Kh(e){this.enter({type:"tableRow",children:[]},e)}function Gh(e){this.exit(e)}function Wh(e){this.enter({type:"tableCell",children:[]},e)}function Zh(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Xh));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Xh(e,t){return"|"===t?t:e}function Yh(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let i=$h.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(i=i.replace(/\|/g,"\\$&")),i},table:function(e,t,n,i){return a(function(e,t,n){const i=e.children;let r=-1;const o=[],s=t.enter("table");for(;++r<i.length;)o[r]=l(i[r],t,n);return s(),o}(e,n,i),e.align)},tableCell:s,tableRow:function(e,t,n,i){const r=a([l(e,n,i)]);return r.slice(0,r.indexOf("\n"))}}};function s(e,t,n,i){const r=n.enter("tableCell"),s=n.enter("phrasing"),a=n.containerPhrasing(e,{...i,before:o,after:o});return s(),r(),a}function a(e,t){return function(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||xh,o=[],s=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],i=[];let o=-1;for(e[u].length>c&&(c=e[u].length);++o<e[u].length;){const s=wh(e[u][o]);if(!1!==n.alignDelimiters){const e=r(s);i[o]=e,(void 0===l[o]||e>l[o])&&(l[o]=e)}t.push(s)}s[u]=t,a[u]=i}let d=-1;if("object"==typeof i&&"length"in i)for(;++d<c;)o[d]=_h(i[d]);else{const e=_h(i);for(;++d<c;)o[d]=e}d=-1;const h=[],p=[];for(;++d<c;){const e=o[d];let t="",i="";99===e?(t=":",i=":"):108===e?t=":":114===e&&(i=":");let r=!1===n.alignDelimiters?1:Math.max(1,l[d]-t.length-i.length);const s=t+"-".repeat(r)+i;!1!==n.alignDelimiters&&(r=t.length+r+i.length,r>l[d]&&(l[d]=r),p[d]=r),h[d]=s}s.splice(1,0,h),a.splice(1,0,p),u=-1;const f=[];for(;++u<s.length;){const e=s[u],t=a[u];d=-1;const i=[];for(;++d<c;){const r=e[d]||"";let s="",a="";if(!1!==n.alignDelimiters){const e=l[d]-(t[d]||0),n=o[d];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),a=" ".repeat(e/2-.5)):(s=" ".repeat(e/2),a=s):a=" ".repeat(e)}!1===n.delimiterStart||d||i.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===r||!1===n.delimiterStart&&!d||i.push(" "),!1!==n.alignDelimiters&&i.push(s),i.push(r),!1!==n.alignDelimiters&&i.push(a),!1!==n.padding&&i.push(" "),!1===n.delimiterEnd&&d===c-1||i.push("|")}f.push(!1===n.delimiterEnd?i.join("").replace(/ +$/,""):i.join(""))}return f.join("\n")}(e,{align:t,alignDelimiters:i,padding:n,stringLength:r})}function l(e,t,n){const i=e.children;let r=-1;const o=[],a=t.enter("tableRow");for(;++r<i.length;)o[r]=s(i[r],0,t,n);return a(),o}}function Qh(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function Jh(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const i=t.children;let r,o=-1;for(;++o<i.length;){const e=i[o];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function ep(e,t,n,i){const r=e.children[0],o="boolean"==typeof e.checked&&r&&"paragraph"===r.type,s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(i);o&&a.move(s);let l=$h.listItem(e,t,n,{...i,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}const tp={tokenize:function(e,t,n){let i=0;return function t(o){return(87===o||119===o)&&i<3?(i++,e.consume(o),t):46===o&&3===i?(e.consume(o),r):n(o)};function r(e){return null===e?n(e):t(e)}},partial:!0},np={tokenize:function(e,t,n){let i,r,o;return s;function s(t){return 46===t||95===t?e.check(rp,l,a)(t):null===t||ic(t)||sc(t)||45!==t&&oc(t)?l(t):(o=!0,e.consume(t),s)}function a(t){return 95===t?i=!0:(r=i,i=void 0),e.consume(t),s}function l(e){return r||i||!o?n(e):t(e)}},partial:!0},ip={tokenize:function(e,t){let n=0,i=0;return r;function r(s){return 40===s?(n++,e.consume(s),r):41===s&&i<n?o(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(rp,t,o)(s):null===s||ic(s)||sc(s)?t(s):(e.consume(s),r)}function o(t){return 41===t&&i++,e.consume(t),r}},partial:!0},rp={tokenize:function(e,t,n){return i;function i(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),i):38===s?(e.consume(s),o):93===s?(e.consume(s),r):60===s||null===s||ic(s)||sc(s)?t(s):n(s)}function r(e){return null===e||40===e||91===e||ic(e)||sc(e)?t(e):i(e)}function o(e){return Zl(e)?s(e):n(e)}function s(t){return 59===t?(e.consume(t),i):Zl(t)?(e.consume(t),s):n(t)}},partial:!0},op={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(e){return Xl(e)?n(e):t(e)}},partial:!0},sp={name:"wwwAutolink",tokenize:function(e,t,n){const i=this;return function(t){return 87!==t&&119!==t||!dp.call(i,i.previous)||mp(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(tp,e.attempt(np,e.attempt(ip,r),n),n)(t))};function r(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:dp},ap={name:"protocolAutolink",tokenize:function(e,t,n){const i=this;let r="",o=!1;return function(t){return 72!==t&&104!==t||!hp.call(i,i.previous)||mp(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(t),e.consume(t),s)};function s(t){if(Zl(t)&&r.length<5)return r+=String.fromCodePoint(t),e.consume(t),s;if(58===t){const n=r.toLowerCase();if("http"===n||"https"===n)return e.consume(t),a}return n(t)}function a(t){return 47===t?(e.consume(t),o?l:(o=!0,a)):n(t)}function l(t){return null===t||Ql(t)||ic(t)||sc(t)||oc(t)?n(t):e.attempt(np,e.attempt(ip,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:hp},lp={name:"emailAutolink",tokenize:function(e,t,n){const i=this;let r,o;return function(t){return fp(t)&&pp.call(i,i.previous)&&!mp(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(t)):n(t)};function s(t){return fp(t)?(e.consume(t),s):64===t?(e.consume(t),a):n(t)}function a(t){return 46===t?e.check(op,c,l)(t):45===t||95===t||Xl(t)?(o=!0,e.consume(t),a):c(t)}function l(t){return e.consume(t),r=!0,a}function c(s){return o&&r&&Zl(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:pp},cp={};let up=48;for(;up<123;)cp[up]=lp,up++,58===up?up=65:91===up&&(up=97);function dp(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||ic(e)}function hp(e){return!Zl(e)}function pp(e){return!(47===e||fp(e))}function fp(e){return 43===e||45===e||46===e||95===e||Xl(e)}function mp(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if(("labelLink"===i.type||"labelImage"===i.type)&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}cp[43]=lp,cp[45]=lp,cp[46]=lp,cp[95]=lp,cp[72]=[lp,ap],cp[104]=[lp,ap],cp[87]=[lp,sp],cp[119]=[lp,sp];const gp={tokenize:function(e,t,n){const i=this;return lc(e,function(e){const r=i.events[i.events.length-1];return r&&"gfmFootnoteDefinitionIndent"===r[1].type&&4===r[2].sliceSerialize(r[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function bp(e,t,n){const i=this;let r=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;r--;){const e=i.events[r][1];if("labelImage"===e.type){s=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(r){if(!s||!s._balanced)return n(r);const a=Oc(i.sliceSerialize({start:s.end,end:i.now()}));return 94===a.codePointAt(0)&&o.includes(a.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(r),e.exit("gfmFootnoteCallLabelMarker"),t(r)):n(r)}}function yp(e,t){let n,i=e.length;for(;i--;)if("labelImage"===e[i][1].type&&"enter"===e[i][0]){n=e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[i+1],e[i+2],["enter",r,t],e[i+3],e[i+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(i,e.length-i+1,...l),e}function vp(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),a};function a(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(a){if(s>999||93===a&&!o||null===a||91===a||ic(a))return n(a);if(93===a){e.exit("chunkString");const o=e.exit("gfmFootnoteCallString");return r.includes(Oc(i.sliceSerialize(o)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(a)}return ic(a)||(o=!0),s++,e.consume(a),92===a?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function xp(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s,a=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(a>999||93===t&&!s||null===t||91===t||ic(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return o=Oc(i.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return ic(t)||(s=!0),a++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),r.includes(o)||r.push(o),lc(e,h,"gfmFootnoteDefinitionWhitespace")):n(t)}function h(e){return t(e)}}function wp(e,t,n){return e.check(hc,t,e.attempt(gp,t,n))}function _p(e){e.exit("gfmFootnoteDefinition")}function kp(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,i){const r=this.previous,o=this.events;let s=0;return function(t){return 126===r&&"characterEscape"!==o[o.length-1][1].type?i(t):(e.enter("strikethroughSequenceTemporary"),a(t))};function a(o){const l=nu(r);if(126===o)return s>1?i(o):(e.consume(o),s++,a);if(s<2&&!t)return i(o);const c=e.exit("strikethroughSequenceTemporary"),u=nu(o);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(o)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let i=n;for(;i--;)if("exit"===e[i][0]&&"strikethroughSequenceTemporary"===e[i][1].type&&e[i][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[i][1].end.offset-e[i][1].start.offset){e[n][1].type="strikethroughSequence",e[i][1].type="strikethroughSequence";const r={type:"strikethrough",start:Object.assign({},e[i][1].start),end:Object.assign({},e[n][1].end)},o={type:"strikethroughText",start:Object.assign({},e[i][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",r,t],["enter",e[i][1],t],["exit",e[i][1],t],["enter",o,t]],a=t.parser.constructs.insideSpan.null;a&&zl(s,s.length,0,Xc(a,e.slice(i+1,n),t)),zl(s,s.length,0,[["exit",o,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",r,t]]),zl(e,i-1,n-i+3,s),n=i+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class Ep{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,i){let r=0;if(0!==n||0!==i.length){for(;r<e.map.length;){if(e.map[r][0]===t)return e.map[r][1]+=n,void e.map[r][2].push(...i);r+=1}e.map.push([t,n,i])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(const t of i)e.push(t);i=n.pop()}this.map.length=0}}function Sp(e,t){let n=!1;const i=[];for(;t<e.length;){const r=e[t];if(n){if("enter"===r[0])"tableContent"===r[1].type&&i.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===r[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=i.length-1;i[e]="left"===i[e]?"center":"right"}}else if("tableDelimiterRow"===r[1].type)break}else"enter"===r[0]&&"tableDelimiterRow"===r[1].type&&(n=!0);t+=1}return i}function Ap(e,t,n){const i=this;let r,o=0,s=0;return function(e){let t=i.events.length-1;for(;t>-1;){const e=i.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const r=t>-1?i.events[t][1].type:null,o="tableHead"===r||"tableRow"===r?x:a;return o===x&&i.parser.lazy[i.now().line]?n(e):o(e)};function a(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(r=!0,s+=1),l(e)}(t)}function l(t){return null===t?n(t):nc(t)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):rc(t)?lc(e,l,"whitespace")(t):(s+=1,r&&(r=!1,o+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||ic(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(t):(e.enter("tableDelimiterRow"),r=!1,rc(t)?lc(e,h,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):h(t))}function h(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):v(t)}function p(t){return rc(t)?lc(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(s+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(s+=1,m(t)):null===t||nc(t)?y(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(t))}function b(t){return rc(t)?lc(e,y,"whitespace")(t):y(t)}function y(n){return 124===n?h(n):(null===n||nc(n))&&r&&o===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function x(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||nc(n)?(e.exit("tableRow"),t(n)):rc(n)?lc(e,w,"whitespace")(n):(e.enter("data"),_(n))}function _(t){return null===t||124===t||ic(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?k:_)}function k(t){return 92===t||124===t?(e.consume(t),_):_(t)}}function Cp(e,t){let n,i,r,o=-1,s=!0,a=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const h=new Ep;for(;++o<e.length;){const p=e[o],f=p[1];"enter"===p[0]?"tableHead"===f.type?(u=!1,0!==d&&(Mp(h,t,d,n,i),i=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(o,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,r=void 0,l=[0,0,0,0],c=[0,o+1,0,0],u&&(u=!1,i={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(o,0,[["enter",i,t]])),a="tableDelimiterRow"===f.type?2:i?3:1):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(c[0]=c[1],r=Np(h,t,l,a,void 0,r)),l=c,c=[l[1],o,0,0])):(s=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],r=Np(h,t,l,a,void 0,r),l=[0,0,0,0]),c[2]=o)):"tableHead"===f.type?(u=!0,d=o):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=o,0!==l[1]?(c[0]=c[1],r=Np(h,t,l,a,o,r)):0!==c[1]&&(r=Np(h,t,c,a,o,r)),a=0):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=o)}for(0!==d&&Mp(h,t,d,n,i),h.consume(t.events),o=-1;++o<t.events.length;){const e=t.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=Sp(t.events,o))}return e}function Np(e,t,n,i,r,o){const s=1===i?"tableHeader":2===i?"tableDelimiter":"tableData";0!==n[0]&&(o.end=Object.assign({},Tp(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const a=Tp(t.events,n[1]);if(o={type:s,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",o,t]]),0!==n[2]){const r=Tp(t.events,n[2]),o=Tp(t.events,n[3]),s={type:"tableContent",start:Object.assign({},r),end:Object.assign({},o)};if(e.add(n[2],0,[["enter",s,t]]),2!==i){const i=t.events[n[2]],r=t.events[n[3]];if(i[1].end=Object.assign({},r[1].end),i[1].type="chunkText",i[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,i=n[3]-n[2]-1;e.add(t,i,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==r&&(o.end=Object.assign({},Tp(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function Mp(e,t,n,i,r){const o=[],s=Tp(t.events,n);r&&(r.end=Object.assign({},s),o.push(["exit",r,t])),i.end=Object.assign({},s),o.push(["exit",i,t]),e.add(n+1,0,o)}function Tp(e,t){const n=e[t],i="enter"===n[0]?"start":"end";return n[1][i]}const Op={name:"tasklistCheck",tokenize:function(e,t,n){const i=this;return function(t){return null===i.previous&&i._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),r):n(t)};function r(t){return ic(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),o):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),o):n(t)}function o(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(i){return nc(i)?t(i):rc(i)?e.check({tokenize:Dp},t,n)(i):n(i)}}};function Dp(e,t,n){return lc(e,function(e){return null===e?n(e):t(e)},"whitespace")}const Ip={},Rp=function(e,t,n){const i=$u(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if("number"==typeof t){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if((t=e.children.indexOf(t))<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(i(e.children[t],t,e))return e.children[t]},Pp=function(e){if(null==e)return Fp;if("string"==typeof e)return t=e,Lp(function(e){return e.tagName===t});var t;if("object"==typeof e)return function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Pp(e[n]);return Lp(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e);if("function"==typeof e)return Lp(e);throw new Error("Expected function, string, or array as `test`")};function Lp(e){return function(t,n,i){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e&&"tagName"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,i||void 0))}}function Fp(e){return Boolean(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}const Bp=/\n/g,zp=/[\t ]+/g,jp=Pp("br"),Up=Pp(function(e){return"td"===e.tagName||"th"===e.tagName}),Vp=Pp("p"),$p=Pp("tr"),Hp=Pp(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return Boolean((e.properties||{}).hidden)},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),qp=Pp(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Kp(e,t,n){return"element"===e.type?function(e,t,n){const i=Zp(e,n),r=e.children||[];let o,s,a=-1,l=[];if(Hp(e))return l;for(jp(e)||$p(e)&&Rp(t,e,$p)?s="\n":Vp(e)?(o=2,s=2):qp(e)&&(o=1,s=1);++a<r.length;)l=l.concat(Kp(r[a],e,{whitespace:i,breakBefore:a?void 0:o,breakAfter:a<r.length-1?jp(r[a+1]):s}));return Up(e)&&Rp(t,e,Up)&&l.push("\t"),o&&l.unshift(o),s&&l.push(s),l}(e,t,n):"text"===e.type?"normal"===n.whitespace?Gp(e,n):function(e){return[String(e.value)]}(e):[]}function Gp(e,t){const n=String(e.value),i=[],r=[];let o=0;for(;o<=n.length;){Bp.lastIndex=o;const e=Bp.exec(n),r=e&&"index"in e?e.index:n.length;i.push(Wp(n.slice(o,r).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==o||t.breakBefore,r!==n.length||t.breakAfter)),o=r+1}let s,a=-1;for(;++a<i.length;)8203===i[a].charCodeAt(i[a].length-1)||a<i.length-1&&8203===i[a+1].charCodeAt(0)?(r.push(i[a]),s=void 0):i[a]?("number"==typeof s&&r.push(s),r.push(i[a]),s=0):0!==a&&a!==i.length-1||r.push(0);return r}function Wp(e,t,n){const i=[];let r,o=0;for(;o<e.length;){zp.lastIndex=o;const n=zp.exec(e);r=n?n.index:e.length,o||r||!n||t||i.push(""),o!==r&&i.push(e.slice(o,r)),o=n?r+n[0].length:r}return o===r||n||i.push(""),i.join(" ")}function Zp(e,t){if("element"===e.type){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}const Xp=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Yp=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Qp=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Jp=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ef=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();var tf="[0-9](_*[0-9])*",nf=`\\.(${tf})`,rf="[0-9a-fA-F](_*[0-9a-fA-F])*",of={className:"number",variants:[{begin:`(\\b(${tf})((${nf})|\\.)?|(${nf}))[eE][+-]?(${tf})[fFdD]?\\b`},{begin:`\\b(${tf})((${nf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${nf})[fFdD]?\\b`},{begin:`\\b(${tf})[fFdD]\\b`},{begin:`\\b0[xX]((${rf})\\.?|(${rf})?\\.(${rf}))[pP][+-]?(${tf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${rf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function sf(e,t,n){return-1===n?"":e.replace(t,i=>sf(e,t,n-1))}const af="[A-Za-z$_][0-9A-Za-z$_]*",lf=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],cf=["true","false","null","undefined","NaN","Infinity"],uf=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],df=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ff=[].concat(hf,uf,df);var mf="[0-9](_*[0-9])*",gf=`\\.(${mf})`,bf="[0-9a-fA-F](_*[0-9a-fA-F])*",yf={className:"number",variants:[{begin:`(\\b(${mf})((${gf})|\\.)?|(${gf}))[eE][+-]?(${mf})[fFdD]?\\b`},{begin:`\\b(${mf})((${gf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${gf})[fFdD]?\\b`},{begin:`\\b(${mf})[fFdD]\\b`},{begin:`\\b0[xX]((${bf})\\.?|(${bf})?\\.(${bf}))[pP][+-]?(${mf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${bf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const vf=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],xf=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),wf=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),_f=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),kf=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Ef=wf.concat(_f).sort().reverse(),Sf=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Af=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Cf=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Nf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Mf=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Tf(e){return e?"string"==typeof e?e:e.source:null}function Of(e){return Df("(?=",e,")")}function Df(...e){return e.map(e=>Tf(e)).join("")}function If(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map(e=>Tf(e)).join("|")+")"}const Rf=e=>Df(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Pf=["Protocol","Type"].map(Rf),Lf=["init","self"].map(Rf),Ff=["Any","Self"],Bf=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],zf=["false","nil","true"],jf=["assignment","associativity","higherThan","left","lowerThan","none","right"],Uf=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Vf=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],$f=If(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Hf=If($f,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),qf=Df($f,Hf,"*"),Kf=If(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Gf=If(Kf,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Wf=Df(Kf,Gf,"*"),Zf=Df(/[A-Z]/,Gf,"*"),Xf=["attached","autoclosure",Df(/convention\(/,If("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Df(/objc\(/,Wf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Yf=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"],Qf="[A-Za-z$_][0-9A-Za-z$_]*",Jf=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],em=["true","false","null","undefined","NaN","Infinity"],tm=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],nm=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],im=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rm=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],om=[].concat(im,tm,nm),sm={arduino:function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",h={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[p,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:h,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,p,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:h,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n},bash:function(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(a);const l={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},c=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),u={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[c,e.SHEBANG(),u,l,o,s,{match:/(\/[a-z._-]+)+/},a,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},n]}},c:function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",h={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},p=[c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:p.concat([{begin:/\(/,end:/\)/,keywords:h,contains:p.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:h,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:h,disableAutodetect:!0,illegal:"</",contains:[].concat(f,m,p,[c,{begin:e.IDENT_RE+"::",keywords:h},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:h}}},cpp:function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",h={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[p,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:h,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,p,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:h,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},csharp:function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),i={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},r={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=e.inherit(r,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.C_BLOCK_COMMENT_MODE],a.contains=[u,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const d={variants:[{className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},p=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},d,i,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+p+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[d,i,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}},css:function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),i=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Qp.join("|")+")"},{begin:":(:)?("+Jp.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ef.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...i,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...i,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Yp.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...i,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Xp.join("|")+")\\b"}]}},diff:function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},go:function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}},graphql:function(e){const t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}},ini:function(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[i,o,r,s,n,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[i,a,o,r,s,n]}}]}},java:function(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+sf("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),r={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:r,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:r,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,of,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},of,o]}},javascript:function(e){const t=e.regex,n=af,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,i=e.input[n];if("<"===i||","===i)return void t.ignoreMatch();let r;">"===i&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const o=e.input.substring(n);((r=o.match(/^\s*=/))||(r=o.match(/^\s+extends\s+/))&&0===r.index)&&t.ignoreMatch()}},r={$pattern:af,keyword:lf,literal:cf,built_in:ff,"variable.language":pf},o="[0-9](_?[0-9])*",s=`\\.(${o})`,a="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={className:"number",variants:[{begin:`(\\b(${a})((${s})|\\.)?|(${s}))[eE][+-]?(${o})\\b`},{begin:`\\b(${a})\\b((${s})\\b|\\.)?|(${s})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},u={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},d={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,c]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},m=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,d,h,p,{match:/\$\d+/},l];c.contains=m.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(m)});const g=[].concat(f,c.contains),b=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:r,contains:["self"].concat(g)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:b},v={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...uf,...df]}},w={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},_={match:t.concat(/\b/,function(e){return t.concat("(?!",e.join("|"),")")}([...hf,"super","import"].map(e=>`${e}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,d,h,p,f,{match:/\$\d+/},l,x,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},_,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,E,{match:/\$[(.]/}]}},json:function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}},kotlin:function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},r={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[r,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,r,i]}]};i.contains.push(o);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},l=yf,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=u;return d.variants[1].contains=[u],u.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,s,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,s,a,o,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,a]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}},less:function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=Ef,i="[\\w-]+",r="("+i+"|@\\{"+i+"\\})",o=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:xf.join(" ")},u={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,u,l("variable","@@?"+i,10),l("variable","@\\{"+i+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const d=s.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},p={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+kf.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},m={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:d}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,l("keyword","all\\b"),l("variable","@\\{"+i+"\\}"),{begin:"\\b("+vf.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",r,0),l("selector-id","#"+r),l("selector-class","\\."+r,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+wf.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+_f.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:i+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,m,b,p,g,h,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:o}},lua:function(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}},makefile:function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},i={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},r={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,i,r,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o]}},markdown:function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},r={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},o=e.inherit(i,{contains:[]}),s=e.inherit(r,{contains:[]});i.contains.push(s),r.contains.push(o);let a=[t,n];return[i,r,o,s].forEach(e=>{e.contains=e.contains.concat(a)}),a=a.concat(i,r),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,r,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}},objectivec:function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},perl:function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},r={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},s={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},a={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[e.BACKSLASH_ESCAPE,r,a],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(e,i,r="\\1")=>{const o="\\1"===r?r:t.concat(r,i);return t.concat(t.concat("(?:",e,")"),i,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,r,n)},h=(e,i,r)=>t.concat(t.concat("(?:",e,")"),i,/(?:\\.|[^\\\/])*?/,r,n),p=[a,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",t.either(...u,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",t.either(...u,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return r.contains=p,o.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:p}},php:function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+i},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c="[ \t\n]",u={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),l,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(a),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},d={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["false","null","true"],p=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],f=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],m={keyword:p,literal:(e=>{const t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(h),built_in:f},g=e=>e.map(e=>e.replace(/\|\d+$/,"")),b={variants:[{match:[/new/,t.concat(c,"+"),t.concat("(?!",g(f).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},y=t.concat(i,"\\b(?!\\()"),v={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),y],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),y],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},x={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:m,contains:[x,s,v,e.C_BLOCK_COMMENT_MODE,u,d,b]},_={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",g(p).join("\\b|"),"|",g(f).join("\\b|"),"\\b)"),i,t.concat(c,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(_);const k=[x,v,e.C_BLOCK_COMMENT_MODE,u,d,b],E={begin:t.concat(/#\[\s*\\?/,t.either(r,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...k]},...k,{scope:"meta",variants:[{match:r},{match:o}]}]};return{case_insensitive:!1,keywords:m,contains:[E,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},s,_,v,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},b,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",E,s,v,e.C_BLOCK_COMMENT_MODE,u,d]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},u,d]}},"php-template":function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}},plaintext:function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}},python:function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],r={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:r,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",u=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,d=`\\b|${i.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${u}))[eE][+-]?(${c})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${c})[jJ](?=${d})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:r,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:["self",o,h,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,h,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:r,illegal:/(<\/|\?)|=>/,contains:[o,h,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,f,l]}]}},"python-repl":function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}},r:function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[o,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},ruby:function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},p={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},f=[u,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[p]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);c.contains=f,p.contains=f;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:o,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(f)}},rust:function(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:a},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:a,type:l}},{className:"punctuation",begin:"->"},o]}},scss:function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=Nf,i=Cf,r="@[a-z-]+",o={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Sf.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Mf.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Af.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}},shell:function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}},sql:function(e){const t=e.regex,n=e.COMMENT("--","$"),i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],r=i,o=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!i.includes(e)),s={match:t.concat(/\b/,t.either(...r),/\s*\(/),relevance:0,keywords:{built_in:r}};function a(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}const l={scope:"keyword",match:a(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const i=n;return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:i(e)?`${e}|0`:e)}(o,{when:e=>e.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:a(["double precision","large object","with timezone","without timezone"])},l,s,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},swift:function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,If(...Pf,...Lf)],className:{2:"keyword"}},o={match:Df(/\./,If(...Bf)),relevance:0},s=Bf.filter(e=>"string"==typeof e).concat(["_|0"]),a={variants:[{className:"keyword",match:If(...Bf.filter(e=>"string"!=typeof e).concat(Ff).map(Rf),...Lf)}]},l={$pattern:If(/\b\w+/,/#\w+/),keyword:s.concat(Uf),literal:zf},c=[r,o,a],u=[{match:Df(/\./,If(...Vf)),relevance:0},{className:"built_in",match:Df(/\b/,If(...Vf),/(?=\()/)}],d={match:/->/,relevance:0},h=[d,{className:"operator",relevance:0,variants:[{match:qf},{match:`\\.(\\.|${Hf})+`}]}],p="([0-9]_*)+",f="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e="")=>({className:"subst",variants:[{match:Df(/\\/,e,/[0\\tnr"']/)},{match:Df(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:Df(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst",label:"interpol",begin:Df(/\\/,e,/\(/),end:/\)/}),v=(e="")=>({begin:Df(e,/"""/),end:Df(/"""/,e),contains:[g(e),b(e),y(e)]}),x=(e="")=>({begin:Df(e,/"/),end:Df(/"/,e),contains:[g(e),y(e)]}),w={className:"string",variants:[v(),v("#"),v("##"),v("###"),x(),x("#"),x("##"),x("###")]},_=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},E=e=>{const t=Df(e,/\//),n=Df(/\//,e);return{begin:t,end:n,contains:[..._,{scope:"comment",begin:`#(?!.*${n})`,end:/$/}]}},S={scope:"regexp",variants:[E("###"),E("##"),E("#"),k]},A={match:Df(/`/,Wf,/`/)},C=[A,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${Gf}+`}],N=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Yf,contains:[...h,m,w]}]}},{scope:"keyword",match:Df(/@/,If(...Xf),Of(If(/\(/,/\s+/)))},{scope:"meta",match:Df(/@/,Wf)}],M={match:Of(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Df(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Gf,"+")},{className:"type",match:Zf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Df(/\s+&\s+/,Of(Zf)),relevance:0}]},T={begin:/</,end:/>/,keywords:l,contains:[...i,...c,...N,d,M]};M.contains.push(T);const O={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:Df(Wf,/\s*:/),keywords:"_|0",relevance:0},...i,S,...c,...u,...h,m,w,...C,...N,M]},D={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,M]},I={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:If(Of(Df(Wf,/\s*:/)),Of(Df(Wf,/\s+/,Wf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Wf}]},...i,...c,...h,m,w,...N,M,O],endsParent:!0,illegal:/["']/},R={match:[/(func|macro)/,/\s+/,If(A.match,Wf,qf)],className:{1:"keyword",3:"title.function"},contains:[D,I,t],illegal:[/\[/,/%/]},P={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[D,I,t],illegal:/\[|%/},L={match:[/operator/,/\s+/,qf],className:{1:"keyword",3:"title"}},F={begin:[/precedencegroup/,/\s+/,Zf],className:{1:"keyword",3:"title"},contains:[M],keywords:[...jf,...zf],end:/}/},B={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Wf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:l,contains:[D,...c,{begin:/:/,end:/\{/,keywords:l,contains:[{scope:"title.class.inherited",match:Zf},...c],relevance:0}]};for(const e of w.variants){const t=e.contains.find(e=>"interpol"===e.label);t.keywords=l;const n=[...c,...u,...h,m,w,...C];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...i,R,P,{match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},{match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},B,L,F,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},S,...c,...u,...h,m,w,...C,...N,M,O]}},typescript:function(e){const t=e.regex,n=function(e){const t=e.regex,n=Qf,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,i=e.input[n];if("<"===i||","===i)return void t.ignoreMatch();let r;">"===i&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const o=e.input.substring(n);((r=o.match(/^\s*=/))||(r=o.match(/^\s+extends\s+/))&&0===r.index)&&t.ignoreMatch()}},r={$pattern:Qf,keyword:Jf,literal:em,built_in:om,"variable.language":rm},o="[0-9](_?[0-9])*",s=`\\.(${o})`,a="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={className:"number",variants:[{begin:`(\\b(${a})((${s})|\\.)?|(${s}))[eE][+-]?(${o})\\b`},{begin:`\\b(${a})\\b((${s})\\b|\\.)?|(${s})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},u={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},d={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,c]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},m=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,d,h,p,{match:/\$\d+/},l];c.contains=m.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(m)});const g=[].concat(f,c.contains),b=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:r,contains:["self"].concat(g)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:b},v={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tm,...nm]}},w={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},_={match:t.concat(/\b/,function(e){return t.concat("(?!",e.join("|"),")")}([...im,"super","import"].map(e=>`${e}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,d,h,p,f,{match:/\$\d+/},l,x,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},_,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,E,{match:/\$[(.]/}]}}(e),i=Qf,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},a={$pattern:Qf,keyword:Jf.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:em,built_in:om.concat(r),"variable.language":rm},l={className:"meta",begin:"@"+i},c=(e,t,n)=>{const i=e.contains.findIndex(e=>e.label===t);if(-1===i)throw new Error("can not find mode to replace");e.contains.splice(i,1,n)};Object.assign(n.keywords,a),n.exports.PARAMS_CONTAINS.push(l);const u=n.contains.find(e=>"attr"===e.scope),d=Object.assign({},u,{match:t.concat(i,t.lookahead(/\s*\?:/))});return n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,u,d]),n.contains=n.contains.concat([l,o,s,d]),c(n,"shebang",e.SHEBANG()),c(n,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),n.contains.find(e=>"func.def"===e.label).relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n},vbnet:function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,r=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,n),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,r,/ *#/)},{begin:t.concat(/# */,t.either(i,n),/ +/,t.either(r,o),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}},wasm:function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}},xml:function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(r,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[r,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[r,o,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},yaml:function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},r=e.inherit(i,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},s={begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},a={begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},s,a,{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},i],c=[...l];return c.pop(),c.push(r),o.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:l}}},am=w(74),lm={};class cm{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const n=this.stack[this.stack.length-1],i=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):n.children.push(...i)}openNode(e){const t=this,n={type:"element",tagName:"span",properties:{className:e.split(".").map(function(e,n){return n?e+"_".repeat(n):t.options.classPrefix+e})},children:[]};this.stack[this.stack.length-1].children.push(n),this.stack.push(n)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const um={},dm={a:({href:e,children:n,...i})=>t("a",{href:e,target:"_blank",rel:"noopener noreferrer",...i,children:n})},hm=[function(e){const t=e||Ip,n=this.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),r=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(function(e){return Kl([{text:cp},{document:{91:{name:"gfmFootnoteDefinition",tokenize:xp,continuation:{tokenize:wp},exit:_p}},text:{91:{name:"gfmFootnoteCall",tokenize:vp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:bp,resolveTo:yp}}},kp(e),{flow:{null:{name:"table",tokenize:Ap,resolveAll:Cp}}},{text:{91:Op}}])}(t)),r.push([{transforms:[eh],enter:{literalAutolink:Wd,literalAutolinkEmail:Zd,literalAutolinkHttp:Zd,literalAutolinkWww:Zd},exit:{literalAutolink:Jd,literalAutolinkEmail:Qd,literalAutolinkHttp:Xd,literalAutolinkWww:Yd}},{enter:{gfmFootnoteCallString:rh,gfmFootnoteCall:oh,gfmFootnoteDefinitionLabelString:sh,gfmFootnoteDefinition:ah},exit:{gfmFootnoteCallString:lh,gfmFootnoteCall:ch,gfmFootnoteDefinitionLabelString:uh,gfmFootnoteDefinition:dh}},{canContainEols:["delete"],enter:{strikethrough:bh},exit:{strikethrough:yh}},{enter:{table:Hh,tableData:Wh,tableHeader:Wh,tableRow:Kh},exit:{codeText:Zh,table:qh,tableData:Gh,tableHeader:Gh,tableRow:Gh}},{exit:{taskListCheckValueChecked:Qh,taskListCheckValueUnchecked:Qh,paragraph:Jh}}]),o.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Kd,notInConstruct:Gd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Kd,notInConstruct:Gd},{character:":",before:"[ps]",after:"\\/",inConstruct:Kd,notInConstruct:Gd}]},ph(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gh}],handlers:{delete:vh}},Yh(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ep}}]}}(t))}],pm=[function(e){const t=e||um,n=t.aliases,i=t.detect||!1,r=t.languages||sm,o=t.plainText,s=t.prefix,a=t.subset;let l="hljs";const c=function(e){const t=am.newInstance();return e&&r(e),{highlight:n,highlightAuto:function(e,r){const o=(r||lm).subset||i();let s,a=-1,l=0;for(;++a<o.length;){const i=o[a];if(!t.getLanguage(i))continue;const c=n(i,e,r);c.data&&void 0!==c.data.relevance&&c.data.relevance>l&&(l=c.data.relevance,s=c)}return s||{type:"root",children:[],data:{language:void 0,relevance:l}}},listLanguages:i,register:r,registerAlias:function(e,n){if("string"==typeof e)t.registerAliases("string"==typeof n?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){const i=e[n];t.registerAliases("string"==typeof i?i:[...i],{languageName:n})}}},registered:function(e){return Boolean(t.getLanguage(e))}};function n(e,n,i){const r=i||lm,o="string"==typeof r.prefix?r.prefix:"hljs-";if(!t.getLanguage(e))throw new Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:cm,classPrefix:o});const s=t.highlight(n,{ignoreIllegals:!0,language:e});if(s.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:s.errorRaised});const a=s._emitter.root,l=a.data;return l.language=s.language,l.relevance=s.relevance,a}function i(){return t.listLanguages()}function r(e,n){if("string"==typeof e)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}}(r);if(n&&c.registerAlias(n),s){const e=s.indexOf("-");l=-1===e?s:s.slice(0,e)}return function(e,t){Zu(e,"element",function(e,n,r){if("code"!==e.tagName||!r||"element"!==r.type||"pre"!==r.tagName)return;const u=function(e){const t=e.properties.className;let n,i=-1;if(Array.isArray(t)){for(;++i<t.length;){const e=String(t[i]);if("no-highlight"===e||"nohighlight"===e)return!1;n||"lang-"!==e.slice(0,5)||(n=e.slice(5)),n||"language-"!==e.slice(0,9)||(n=e.slice(9))}return n}}(e);if(!1===u||!u&&!i||u&&o&&o.includes(u))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(l)||e.properties.className.unshift(l);const d=function(e){const t={whitespace:"pre"}||{},n="children"in e?e.children:[],i=qp(e),r=Zp(e,{whitespace:t.whitespace||"normal",breakBefore:!1,breakAfter:!1}),o=[];"text"!==e.type&&"comment"!==e.type||o.push(...Gp(e,{whitespace:r,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<n.length;)o.push(...Kp(n[s],e,{whitespace:r,breakBefore:s?void 0:i,breakAfter:s<n.length-1?jp(n[s+1]):i}));const a=[];let l;for(s=-1;++s<o.length;){const e=o[s];"number"==typeof e?void 0!==l&&e>l&&(l=e):e&&(void 0!==l&&l>-1&&a.push("\n".repeat(l)||" "),l=-1,a.push(e))}return a.join("")}(e);let h;try{h=u?c.highlight(u,d,{prefix:s}):c.highlightAuto(d,{prefix:s,subset:a})}catch(n){const i=n;if(u&&/Unknown language/.test(i.message))return void t.message("Cannot highlight as `"+u+"`, it’s not registered",{ancestors:[r,e],cause:i,place:e.position,ruleId:"missing-language",source:"rehype-highlight"});throw i}!u&&h.data&&h.data.language&&e.properties.className.push("language-"+h.data.language),h.children.length>0&&(e.children=h.children)})}}];function fm({content:e,createdAt:i}){const[r,o]=y(!1),s=async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch(e){console.error("Failed to copy text: ",e)}};return n(xa.div,{className:"bmxcb__message bmxcb__message--assistant",initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:400,damping:25,duration:.3},layout:!0,children:[t("div",{className:"bmxcb__message-avatar",children:n("div",{className:"bmxcb__avatar",children:[t("div",{className:"bmxcb__avatar-glow"}),t("img",{src:"https://www.bmx.trade/images/favicon.svg",alt:"BMX",className:"bmxcb__avatar-icon"})]})}),n("div",{className:"bmxcb__message-content",children:[t("div",{className:"bmxcb__markdown",children:t(Ud,{remarkPlugins:hm,rehypePlugins:pm,components:dm,children:e})}),n("div",{className:"bmxcb__message-footer",children:[t("div",{className:"bmxcb__message-time",children:wa(i)}),n("div",{className:"bmxcb__message-actions",children:[t("button",{className:"bmxcb__message-action",onClick:s,"aria-label":r?"Copied!":"Copy message",title:r?"Copied!":"Copy message",children:t(j,{size:14})}),t("button",{className:"bmxcb__message-action",onClick:async()=>{if(navigator.share)try{await navigator.share({title:"BMX Chat Response",text:e})}catch(e){console.error("Error sharing: ",e)}else s()},"aria-label":"Share message",title:"Share message",children:t(H,{size:14})})]})]})]})]})}function mm({message:e}){return e.role===C.USER?t(_a,{content:e.content,createdAt:e.createdAt}):e.role===C.ASSISTANT?t(fm,{content:e.content,createdAt:e.createdAt}):t(_a,{content:e.content})}function gm(){return n("div",{className:"bmxcb__message bmxcb__message--assistant",children:[t("div",{className:"bmxcb__message-avatar",children:n("div",{className:"bmxcb__avatar",children:[t("div",{className:"bmxcb__avatar-glow"}),t("img",{src:"https://www.bmx.trade/images/favicon.svg",alt:"BMX",className:"bmxcb__avatar-icon"})]})}),t("div",{className:"bmxcb__message-content",children:n("div",{className:"bmxcb__typing",children:[t(xa.span,{className:"bmxcb__dot",animate:{opacity:[.2,1,.2]},transition:{repeat:1/0,duration:1.2,delay:0}}),t(xa.span,{className:"bmxcb__dot",animate:{opacity:[.2,1,.2]},transition:{repeat:1/0,duration:1.2,delay:.2}}),t(xa.span,{className:"bmxcb__dot",animate:{opacity:[.2,1,.2]},transition:{repeat:1/0,duration:1.2,delay:.4}})]})})]})}const bm=({onSuggestionClick:e})=>{const i=(t,n)=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e?.(n))};return t("div",{className:"bmxcb__empty-state",children:n("div",{className:"bmxcb__empty-state-content",children:[t("h3",{className:"bmxcb__empty-state-title",children:"Welcome to BMX Chat"}),t("p",{className:"bmxcb__empty-state-description",children:"Ask me anything about BMX documentation, products, or features!"}),n("div",{className:"bmxcb__empty-state-suggestions",children:[t("span",{className:"bmxcb__empty-state-suggestion",children:"Try asking:"}),n("div",{className:"bmxcb__empty-state-suggestion-chips",children:[t("button",{className:"bmxcb__empty-state-chip",onClick:()=>e?.("What is BMX?"),onKeyDown:e=>i(e,"What is BMX?"),"aria-label":"Ask: What is BMX?",children:'"What is BMX?"'}),t("button",{className:"bmxcb__empty-state-chip",onClick:()=>e?.("How to trade?"),onKeyDown:e=>i(e,"How to trade?"),"aria-label":"Ask: How to trade?",children:'"How to trade?"'}),t("button",{className:"bmxcb__empty-state-chip",onClick:()=>e?.("BMX Deli Swap"),onKeyDown:e=>i(e,"BMX Deli Swap"),"aria-label":"Ask: BMX Deli Swap",children:'"BMX Deli Swap"'})]})]})]})})};function ym(e){return P({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function vm({messages:i,sending:r,onSuggestionClick:o}){const s=b(null),a=b(null),[l,c]=y(!1),u=()=>{s.current?.scrollIntoView({behavior:"smooth"})};h(()=>{u()},[i]);const d=0===i.length;return t("div",{className:"bmxcb__messages "+(d?"bmxcb__messages--empty":""),ref:a,onScroll:()=>{if(a.current){const{scrollTop:e,scrollHeight:t,clientHeight:n}=a.current;c(!(t-e-n<100))}},children:d?t(bm,{onSuggestionClick:o}):n(e,{children:[i.map(e=>t(mm,{message:e},e.id)),r&&t(gm,{}),t("div",{ref:s}),l&&t("button",{className:"bmxcb__scroll-to-bottom",onClick:u,"aria-label":"Scroll to bottom",children:t(ym,{size:14})})]})})}const xm=c(({input:e,setInput:i,onKeyDown:r,onSend:o,placeholder:s,sending:a},l)=>{const c=b(null),u=l||c;return h(()=>{const e=u&&"object"==typeof u&&"current"in u?u.current:null;if(e){e.style.height="auto";const t=120,n=Math.min(e.scrollHeight,t);e.style.height=`${n}px`,e.scrollHeight>t?e.style.overflowY="auto":e.style.overflowY="hidden"}},[e,u]),n(xa.div,{className:"bmxcb__inputRow",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1,duration:.3},children:[t(xa.textarea,{ref:u,className:"bmxcb__input",value:e,onChange:e=>i(e.target.value),onKeyDown:r,placeholder:s,rows:1,whileFocus:{scale:1.02},transition:{type:"spring",stiffness:400,damping:25},"aria-label":"Message input"}),t(xa.button,{className:"bmxcb__send",onClick:o,disabled:a||!e.trim(),whileHover:{scale:1.05,y:-1},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:25},"aria-label":a?"Sending...":"Send message",children:t(xa.div,{animate:a?{rotate:360}:{rotate:0},transition:{duration:1,repeat:a?1/0:0,ease:"linear"},children:t(a?V:$,{size:16})})})]})}),wm=(e=768)=>{const[t,n]=y(window.matchMedia(`(max-width: ${e}px)`).matches);return h(()=>{const t=window.matchMedia(`(max-width: ${e}px)`),i=e=>n(e.matches);return t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[e]),t};function _m(e,t){const[n,i]=y(()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(n){return console.warn(`Error reading localStorage key "${e}":`,n),t}});return[n,t=>{if("undefined"!=typeof window)try{i(t),window.localStorage.setItem(e,JSON.stringify(t))}catch(t){console.warn(`Error setting localStorage key "${e}":`,t)}else i(t)}]}const km={hue:0,hoverIntensity:.5,rotateOnHover:!0};function Em(){const[e,t]=_m("bmx-chat-settings",km);return{settings:e,updateHue:n=>{t({...e,hue:n})},updateHoverIntensity:n=>{t({...e,hoverIntensity:n})},updateRotateOnHover:n=>{t({...e,rotateOnHover:n})}}}function Sm({onClose:e,onClearHistory:i,history:r}){const{settings:o,updateHue:s,updateHoverIntensity:a,updateRotateOnHover:l}=Em(),c=wm();return n(xa.div,{className:"bmxcb__settings-panel",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.2},children:[n("div",{className:"bmxcb__settings-header",children:[n("div",{className:"bmxcb__settings-title",children:[t(B,{size:18}),"Settings"]}),t("button",{className:"bmxcb__settings-close",onClick:e,"aria-label":"Close settings",children:t(F,{size:18})})]}),n("div",{className:"bmxcb__settings-content",children:[!c&&n("div",{className:"bmxcb__settings-section",children:[n("h3",{className:"bmxcb__settings-section-title",children:[t(U,{size:16}),"Keyboard Shortcuts"]}),n("div",{className:"bmxcb__settings-shortcuts",children:[n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Ctrl"}),t("span",{children:"+"}),t("kbd",{className:"bmxcb__settings-kbd",children:"K"}),t("span",{children:"Toggle chat panel"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Ctrl"}),t("span",{children:"+"}),t("kbd",{className:"bmxcb__settings-kbd",children:"/"}),t("span",{children:"Toggle settings"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Esc"}),t("span",{children:"Close panel/settings"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("span",{children:"Click outside"}),t("span",{children:"Close panel"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Tab"}),t("span",{children:"Navigate forward"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Shift"}),t("span",{children:"+"}),t("kbd",{className:"bmxcb__settings-kbd",children:"Tab"}),t("span",{children:"Navigate backward"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Enter"}),t("span",{children:"Send message / Activate"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Shift"}),t("span",{children:"+"}),t("kbd",{className:"bmxcb__settings-kbd",children:"Enter"}),t("span",{children:"New line in input"})]})]})]}),n("div",{className:"bmxcb__settings-section",children:[n("h3",{className:"bmxcb__settings-section-title",children:[t(z,{size:16}),"Orb Appearance"]}),n("div",{className:"bmxcb__settings-group",children:[n("label",{className:"bmxcb__settings-label",children:["Color Hue: ",o.hue,"°"]}),t("input",{type:"range",min:"0",max:"360",value:o.hue,onChange:e=>s(Number(e.target.value)),className:"bmxcb__settings-slider"})]}),n("div",{className:"bmxcb__settings-group",children:[n("label",{className:"bmxcb__settings-label",children:["Hover Intensity: ",Math.round(100*o.hoverIntensity),"%"]}),t("input",{type:"range",min:"0",max:"1",step:"0.1",value:o.hoverIntensity,onChange:e=>a(Number(e.target.value)),className:"bmxcb__settings-slider"})]}),t("div",{className:"bmxcb__settings-group",children:n("label",{className:"bmxcb__settings-checkbox-label",children:[t("input",{type:"checkbox",checked:o.rotateOnHover,onChange:e=>l(e.target.checked),className:"bmxcb__settings-checkbox"}),t("span",{children:"Rotate on hover"})]})})]}),r.length>0&&t("div",{className:"bmxcb__settings-section",children:n("button",{className:"bmxcb__settings-clear-button",onClick:()=>{i(),e()},children:[t(q,{size:16}),"Clear Chat History"]})})]})]})}const Am=c(({title:i,messages:r,input:o,setInput:s,onKeyDown:a,onSend:l,onClose:c,placeholder:u,sending:d,showSettings:p,onToggleSettings:f,onClearHistory:m,onSuggestionClick:g},y)=>{const v=b(null),x=wm();return h(()=>{p||!v.current||x||v.current.focus()},[p,x]),t(xa.div,{ref:y,className:"bmxcb__panel",role:"dialog","aria-modal":"true","aria-label":"BMX Chat",onKeyDown:e=>{if("Tab"===e.key){const t=y&&"object"==typeof y&&"current"in y?y.current:null,n=t?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(n&&n.length>0){const t=n[0],i=n[n.length-1];e.shiftKey?document.activeElement===t&&(e.preventDefault(),i.focus()):document.activeElement===i&&(e.preventDefault(),t.focus())}}},initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{type:"spring",stiffness:300,damping:30,duration:.3},children:p?t(Sm,{onClose:f,onClearHistory:m,history:r}):n(e,{children:[t(G,{title:i,onClose:c,onSettings:f}),t(vm,{messages:r,sending:d,onSuggestionClick:g}),t(xm,{ref:v,input:o,setInput:s,onKeyDown:a,onSend:l,placeholder:u,sending:d})]})})});function Cm(e){let t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function Nm(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Mm(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Tm(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Om(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function Dm(e){let t=e[0],n=e[1],i=e[2];return t*t+n*n+i*i}function Im(e,t){let n=t[0],i=t[1],r=t[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Rm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Pm(e,t,n){let i=t[0],r=t[1],o=t[2],s=n[0],a=n[1],l=n[2];return e[0]=r*l-o*a,e[1]=o*s-i*l,e[2]=i*a-r*s,e}const Lm=function(){const e=[0,0,0],t=[0,0,0];return function(n,i){Nm(e,n),Nm(t,i),Im(e,e),Im(t,t);let r=Rm(e,t);return r>1?0:r<-1?Math.PI:Math.acos(r)}}();class Fm extends Array{constructor(e=0,t=e,n=e){return super(e,t,n),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(e){this[0]=e}set y(e){this[1]=e}set z(e){this[2]=e}set(e,t=e,n=e){return e.length?this.copy(e):(function(e,t,n,i){e[0]=t,e[1]=n,e[2]=i}(this,e,t,n),this)}copy(e){return Nm(this,e),this}add(e,t){return t?Mm(this,e,t):Mm(this,this,e),this}sub(e,t){return t?Tm(this,e,t):Tm(this,this,e),this}multiply(e){var t,n,i;return e.length?(n=this,i=e,(t=this)[0]=n[0]*i[0],t[1]=n[1]*i[1],t[2]=n[2]*i[2]):Om(this,this,e),this}divide(e){var t,n,i;return e.length?(n=this,i=e,(t=this)[0]=n[0]/i[0],t[1]=n[1]/i[1],t[2]=n[2]/i[2]):Om(this,this,1/e),this}inverse(e=this){var t,n;return n=e,(t=this)[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],this}len(){return Cm(this)}distance(e){return e?function(e,t){let n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+i*i+r*r)}(this,e):Cm(this)}squaredLen(){return Dm(this)}squaredDistance(e){return e?function(e,t){let n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return n*n+i*i+r*r}(this,e):Dm(this)}negate(e=this){var t,n;return n=e,(t=this)[0]=-n[0],t[1]=-n[1],t[2]=-n[2],this}cross(e,t){return t?Pm(this,e,t):Pm(this,this,e),this}scale(e){return Om(this,this,e),this}normalize(){return Im(this,this),this}dot(e){return Rm(this,e)}equals(e){return t=e,this[0]===t[0]&&this[1]===t[1]&&this[2]===t[2];var t}applyMatrix3(e){return function(e,t,n){let i=t[0],r=t[1],o=t[2];e[0]=i*n[0]+r*n[3]+o*n[6],e[1]=i*n[1]+r*n[4]+o*n[7],e[2]=i*n[2]+r*n[5]+o*n[8]}(this,this,e),this}applyMatrix4(e){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=n[3]*i+n[7]*r+n[11]*o+n[15];s=s||1,e[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/s,e[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/s,e[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/s}(this,this,e),this}scaleRotateMatrix4(e){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=n[3]*i+n[7]*r+n[11]*o+n[15];s=s||1,e[0]=(n[0]*i+n[4]*r+n[8]*o)/s,e[1]=(n[1]*i+n[5]*r+n[9]*o)/s,e[2]=(n[2]*i+n[6]*r+n[10]*o)/s}(this,this,e),this}applyQuaternion(e){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=n[0],a=n[1],l=n[2],c=a*o-l*r,u=l*i-s*o,d=s*r-a*i,h=a*d-l*u,p=l*c-s*d,f=s*u-a*c,m=2*n[3];c*=m,u*=m,d*=m,h*=2,p*=2,f*=2,e[0]=i+c+h,e[1]=r+u+p,e[2]=o+d+f}(this,this,e),this}angle(e){return Lm(this,e)}lerp(e,t){return function(e,t,n,i){let r=t[0],o=t[1],s=t[2];e[0]=r+i*(n[0]-r),e[1]=o+i*(n[1]-o),e[2]=s+i*(n[2]-s)}(this,this,e,t),this}smoothLerp(e,t,n){return function(e,t,n,i,r){const o=Math.exp(-i*r);let s=t[0],a=t[1],l=t[2];e[0]=n[0]+(s-n[0])*o,e[1]=n[1]+(a-n[1])*o,e[2]=n[2]+(l-n[2])*o}(this,this,e,t,n),this}clone(){return new Fm(this[0],this[1],this[2])}fromArray(e,t=0){return this[0]=e[t],this[1]=e[t+1],this[2]=e[t+2],this}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}transformDirection(e){const t=this[0],n=this[1],i=this[2];return this[0]=e[0]*t+e[4]*n+e[8]*i,this[1]=e[1]*t+e[5]*n+e[9]*i,this[2]=e[2]*t+e[6]*n+e[10]*i,this.normalize()}}const Bm=new Fm;let zm=1;class jm{constructor({canvas:e=document.createElement("canvas"),width:t=300,height:n=150,dpr:i=1,alpha:r=!1,depth:o=!0,stencil:s=!1,antialias:a=!1,premultipliedAlpha:l=!1,preserveDrawingBuffer:c=!1,powerPreference:u="default",autoClear:d=!0,webgl:h=2}={}){const p={alpha:r,depth:o,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u};this.dpr=i,this.alpha=r,this.color=!0,this.depth=o,this.stencil=s,this.premultipliedAlpha=l,this.autoClear=d,this.id=zm++,2===h&&(this.gl=e.getContext("webgl2",p)),this.isWebgl2=!!this.gl,this.gl||(this.gl=e.getContext("webgl",p)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(t,n),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(e,t){this.width=e,this.height=t,this.gl.canvas.width=e*this.dpr,this.gl.canvas.height=t*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:e+"px",height:t+"px"})}setViewport(e,t,n=0,i=0){this.state.viewport.width===e&&this.state.viewport.height===t||(this.state.viewport.width=e,this.state.viewport.height=t,this.state.viewport.x=n,this.state.viewport.y=i,this.gl.viewport(n,i,e,t))}setScissor(e,t,n=0,i=0){this.gl.scissor(n,i,e,t)}enable(e){!0!==this.state[e]&&(this.gl.enable(e),this.state[e]=!0)}disable(e){!1!==this.state[e]&&(this.gl.disable(e),this.state[e]=!1)}setBlendFunc(e,t,n,i){this.state.blendFunc.src===e&&this.state.blendFunc.dst===t&&this.state.blendFunc.srcAlpha===n&&this.state.blendFunc.dstAlpha===i||(this.state.blendFunc.src=e,this.state.blendFunc.dst=t,this.state.blendFunc.srcAlpha=n,this.state.blendFunc.dstAlpha=i,void 0!==n?this.gl.blendFuncSeparate(e,t,n,i):this.gl.blendFunc(e,t))}setBlendEquation(e,t){e=e||this.gl.FUNC_ADD,this.state.blendEquation.modeRGB===e&&this.state.blendEquation.modeAlpha===t||(this.state.blendEquation.modeRGB=e,this.state.blendEquation.modeAlpha=t,void 0!==t?this.gl.blendEquationSeparate(e,t):this.gl.blendEquation(e))}setCullFace(e){this.state.cullFace!==e&&(this.state.cullFace=e,this.gl.cullFace(e))}setFrontFace(e){this.state.frontFace!==e&&(this.state.frontFace=e,this.gl.frontFace(e))}setDepthMask(e){this.state.depthMask!==e&&(this.state.depthMask=e,this.gl.depthMask(e))}setDepthFunc(e){this.state.depthFunc!==e&&(this.state.depthFunc=e,this.gl.depthFunc(e))}setStencilMask(e){this.state.stencilMask!==e&&(this.state.stencilMask=e,this.gl.stencilMask(e))}setStencilFunc(e,t,n){this.state.stencilFunc===e&&this.state.stencilRef===t&&this.state.stencilFuncMask===n||(this.state.stencilFunc=e||this.gl.ALWAYS,this.state.stencilRef=t||0,this.state.stencilFuncMask=n||0,this.gl.stencilFunc(e||this.gl.ALWAYS,t||0,n||0))}setStencilOp(e,t,n){this.state.stencilFail===e&&this.state.stencilDepthFail===t&&this.state.stencilDepthPass===n||(this.state.stencilFail=e,this.state.stencilDepthFail=t,this.state.stencilDepthPass=n,this.gl.stencilOp(e,t,n))}activeTexture(e){this.state.activeTextureUnit!==e&&(this.state.activeTextureUnit=e,this.gl.activeTexture(this.gl.TEXTURE0+e))}bindFramebuffer({target:e=this.gl.FRAMEBUFFER,buffer:t=null}={}){this.state.framebuffer!==t&&(this.state.framebuffer=t,this.gl.bindFramebuffer(e,t))}getExtension(e,t,n){return t&&this.gl[t]?this.gl[t].bind(this.gl):(this.extensions[e]||(this.extensions[e]=this.gl.getExtension(e)),t?this.extensions[e]?this.extensions[e][n].bind(this.extensions[e]):null:this.extensions[e])}sortOpaque(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program.id!==t.program.id?e.program.id-t.program.id:e.zDepth!==t.zDepth?e.zDepth-t.zDepth:t.id-e.id}sortTransparent(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.zDepth!==t.zDepth?t.zDepth-e.zDepth:t.id-e.id}sortUI(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program.id!==t.program.id?e.program.id-t.program.id:t.id-e.id}getRenderList({scene:e,camera:t,frustumCull:n,sort:i}){let r=[];if(t&&n&&t.updateFrustum(),e.traverse(e=>{if(!e.visible)return!0;e.draw&&(n&&e.frustumCulled&&t&&!t.frustumIntersectsMesh(e)||r.push(e))}),i){const e=[],n=[],i=[];r.forEach(r=>{r.program.transparent?r.program.depthTest?n.push(r):i.push(r):e.push(r),r.zDepth=0,0===r.renderOrder&&r.program.depthTest&&t&&(r.worldMatrix.getTranslation(Bm),Bm.applyMatrix4(t.projectionViewMatrix),r.zDepth=Bm.z)}),e.sort(this.sortOpaque),n.sort(this.sortTransparent),i.sort(this.sortUI),r=e.concat(n,i)}return r}render({scene:e,camera:t,target:n=null,update:i=!0,sort:r=!0,frustumCull:o=!0,clear:s}){null===n?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(n),this.setViewport(n.width,n.height)),(s||this.autoClear&&!1!==s)&&(!this.depth||n&&!n.depth||(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!n||n.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),i&&e.updateMatrixWorld(),t&&t.updateMatrixWorld(),this.getRenderList({scene:e,camera:t,frustumCull:o,sort:r}).forEach(e=>{e.draw({camera:t})})}}const Um=new Fm;let Vm=1,$m=1,Hm=!1;class qm{constructor(e,t={}){e.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=e,this.attributes=t,this.id=Vm++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let e in t)this.addAttribute(e,t[e])}addAttribute(e,t){if(this.attributes[e]=t,t.id=$m++,t.size=t.size||1,t.type=t.type||(t.data.constructor===Float32Array?this.gl.FLOAT:t.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),t.target="index"===e?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,t.normalized=t.normalized||!1,t.stride=t.stride||0,t.offset=t.offset||0,t.count=t.count||(t.stride?t.data.byteLength/t.stride:t.data.length/t.size),t.divisor=t.instanced||0,t.needsUpdate=!1,t.usage=t.usage||this.gl.STATIC_DRAW,t.buffer||this.updateAttribute(t),t.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==t.count*t.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,t.count*t.divisor);this.instancedCount=t.count*t.divisor}else"index"===e?this.drawRange.count=t.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,t.count))}updateAttribute(e){const t=!e.buffer;t&&(e.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==e.buffer&&(this.gl.bindBuffer(e.target,e.buffer),this.glState.boundBuffer=e.buffer),t?this.gl.bufferData(e.target,e.data,e.usage):this.gl.bufferSubData(e.target,0,e.data),e.needsUpdate=!1}setIndex(e){this.addAttribute("index",e)}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}setInstancedCount(e){this.instancedCount=e}createVAO(e){this.VAOs[e.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[e.attributeOrder]),this.bindAttributes(e)}bindAttributes(e){e.attributeLocations.forEach((e,{name:t,type:n})=>{if(!this.attributes[t])return void console.warn(`active attribute ${t} not being supplied`);const i=this.attributes[t];this.gl.bindBuffer(i.target,i.buffer),this.glState.boundBuffer=i.buffer;let r=1;35674===n&&(r=2),35675===n&&(r=3),35676===n&&(r=4);const o=i.size/r,s=1===r?0:r*r*4,a=1===r?0:4*r;for(let t=0;t<r;t++)this.gl.vertexAttribPointer(e+t,o,i.type,i.normalized,i.stride+s,i.offset+t*a),this.gl.enableVertexAttribArray(e+t),this.gl.renderer.vertexAttribDivisor(e+t,i.divisor)}),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:e,mode:t=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${e.attributeOrder}`&&(this.VAOs[e.attributeOrder]||this.createVAO(e),this.gl.renderer.bindVertexArray(this.VAOs[e.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${e.attributeOrder}`),e.attributeLocations.forEach((e,{name:t})=>{const n=this.attributes[t];n.needsUpdate&&this.updateAttribute(n)});let n=2;this.attributes.index?.type===this.gl.UNSIGNED_INT&&(n=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(t,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*n,this.instancedCount):this.gl.renderer.drawArraysInstanced(t,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(t,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*n):this.gl.drawArrays(t,this.drawRange.start,this.drawRange.count)}getPosition(){const e=this.attributes.position;return e.data?e:Hm?void 0:(console.warn("No position buffer data found to compute bounds"),Hm=!0)}computeBoundingBox(e){e||(e=this.getPosition());const t=e.data,n=e.size;this.bounds||(this.bounds={min:new Fm,max:new Fm,center:new Fm,scale:new Fm,radius:1/0});const i=this.bounds.min,r=this.bounds.max,o=this.bounds.center,s=this.bounds.scale;i.set(1/0),r.set(-1/0);for(let e=0,o=t.length;e<o;e+=n){const n=t[e],o=t[e+1],s=t[e+2];i.x=Math.min(n,i.x),i.y=Math.min(o,i.y),i.z=Math.min(s,i.z),r.x=Math.max(n,r.x),r.y=Math.max(o,r.y),r.z=Math.max(s,r.z)}s.sub(r,i),o.add(i,r).divide(2)}computeBoundingSphere(e){e||(e=this.getPosition());const t=e.data,n=e.size;this.bounds||this.computeBoundingBox(e);let i=0;for(let e=0,r=t.length;e<r;e+=n)Um.fromArray(t,e),i=Math.max(i,this.bounds.center.squaredDistance(Um));this.bounds.radius=Math.sqrt(i)}remove(){for(let e in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[e]),delete this.VAOs[e];for(let e in this.attributes)this.gl.deleteBuffer(this.attributes[e].buffer),delete this.attributes[e]}}class Km extends qm{constructor(e,{attributes:t={}}={}){Object.assign(t,{position:{size:2,data:new Float32Array([-1,-1,3,-1,-1,3])},uv:{size:2,data:new Float32Array([0,0,2,0,0,2])}}),super(e,t)}}let Gm=1;const Wm={};class Zm{constructor(e,{vertex:t,fragment:n,uniforms:i={},transparent:r=!1,cullFace:o=e.BACK,frontFace:s=e.CCW,depthTest:a=!0,depthWrite:l=!0,depthFunc:c=e.LEQUAL}={}){e.canvas||console.error("gl not passed as first argument to Program"),this.gl=e,this.uniforms=i,this.id=Gm++,t||console.warn("vertex shader not supplied"),n||console.warn("fragment shader not supplied"),this.transparent=r,this.cullFace=o,this.frontFace=s,this.depthTest=a,this.depthWrite=l,this.depthFunc=c,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=e.createShader(e.VERTEX_SHADER),this.fragmentShader=e.createShader(e.FRAGMENT_SHADER),this.program=e.createProgram(),e.attachShader(this.program,this.vertexShader),e.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:t,fragment:n})}setShaders({vertex:e,fragment:t}){if(e&&(this.gl.shaderSource(this.vertexShader,e),this.gl.compileShader(this.vertexShader),""!==this.gl.getShaderInfoLog(this.vertexShader)&&console.warn(`${this.gl.getShaderInfoLog(this.vertexShader)}\nVertex Shader\n${Ym(e)}`)),t&&(this.gl.shaderSource(this.fragmentShader,t),this.gl.compileShader(this.fragmentShader),""!==this.gl.getShaderInfoLog(this.fragmentShader)&&console.warn(`${this.gl.getShaderInfoLog(this.fragmentShader)}\nFragment Shader\n${Ym(t)}`)),this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return console.warn(this.gl.getProgramInfoLog(this.program));this.uniformLocations=new Map;let n=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS);for(let e=0;e<n;e++){let t=this.gl.getActiveUniform(this.program,e);this.uniformLocations.set(t,this.gl.getUniformLocation(this.program,t.name));const n=t.name.match(/(\w+)/g);t.uniformName=n[0],t.nameComponents=n.slice(1)}this.attributeLocations=new Map;const i=[],r=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES);for(let e=0;e<r;e++){const t=this.gl.getActiveAttrib(this.program,e),n=this.gl.getAttribLocation(this.program,t.name);-1!==n&&(i[n]=t.name,this.attributeLocations.set(t,n))}this.attributeOrder=i.join("")}setBlendFunc(e,t,n,i){this.blendFunc.src=e,this.blendFunc.dst=t,this.blendFunc.srcAlpha=n,this.blendFunc.dstAlpha=i,e&&(this.transparent=!0)}setBlendEquation(e,t){this.blendEquation.modeRGB=e,this.blendEquation.modeAlpha=t}setStencilFunc(e,t,n){this.stencilRef=t,this.stencilFunc.func=e,this.stencilFunc.ref=t,this.stencilFunc.mask=n}setStencilOp(e,t,n){this.stencilOp.stencilFail=e,this.stencilOp.depthFail=t,this.stencilOp.depthPass=n}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha),this.stencilFunc.func||this.stencilOp.stencilFail?this.gl.renderer.enable(this.gl.STENCIL_TEST):this.gl.renderer.disable(this.gl.STENCIL_TEST),this.gl.renderer.setStencilFunc(this.stencilFunc.func,this.stencilFunc.ref,this.stencilFunc.mask),this.gl.renderer.setStencilOp(this.stencilOp.stencilFail,this.stencilOp.depthFail,this.stencilOp.depthPass)}use({flipFaces:e=!1}={}){let t=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach((e,n)=>{let i=this.uniforms[n.uniformName];for(const e of n.nameComponents){if(!i)break;if(!(e in i)){if(Array.isArray(i.value))break;i=void 0;break}i=i[e]}if(!i)return Jm(`Active uniform ${n.name} has not been supplied`);if(i&&void 0===i.value)return Jm(`${n.name} uniform is missing a value parameter`);if(i.value.texture)return t+=1,i.value.update(t),Xm(this.gl,n.type,e,t);if(i.value.length&&i.value[0].texture){const r=[];return i.value.forEach(e=>{t+=1,e.update(t),r.push(t)}),Xm(this.gl,n.type,e,r)}Xm(this.gl,n.type,e,i.value)}),this.applyState(),e&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function Xm(e,t,n,i){i=i.length?function(e){const t=e.length,n=e[0].length;if(void 0===n)return e;const i=t*n;let r=Wm[i];r||(Wm[i]=r=new Float32Array(i));for(let i=0;i<t;i++)r.set(e[i],i*n);return r}(i):i;const r=e.renderer.state.uniformLocations.get(n);if(i.length)if(void 0===r||r.length!==i.length)e.renderer.state.uniformLocations.set(n,i.slice(0));else{if(function(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}(r,i))return;r.set?r.set(i):function(e,t){for(let n=0,i=e.length;n<i;n++)e[n]=t[n]}(r,i),e.renderer.state.uniformLocations.set(n,r)}else{if(r===i)return;e.renderer.state.uniformLocations.set(n,i)}switch(t){case 5126:return i.length?e.uniform1fv(n,i):e.uniform1f(n,i);case 35664:return e.uniform2fv(n,i);case 35665:return e.uniform3fv(n,i);case 35666:return e.uniform4fv(n,i);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return i.length?e.uniform1iv(n,i):e.uniform1i(n,i);case 35671:case 35667:return e.uniform2iv(n,i);case 35672:case 35668:return e.uniform3iv(n,i);case 35673:case 35669:return e.uniform4iv(n,i);case 35674:return e.uniformMatrix2fv(n,!1,i);case 35675:return e.uniformMatrix3fv(n,!1,i);case 35676:return e.uniformMatrix4fv(n,!1,i)}}function Ym(e){let t=e.split("\n");for(let e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}let Qm=0;function Jm(e){Qm>100||(console.warn(e),Qm++,Qm>100&&console.warn("More than 100 program warnings - stopping logs."))}function eg(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=n[0],l=n[1],c=n[2],u=n[3];return e[0]=i*u+s*a+r*c-o*l,e[1]=r*u+s*l+o*a-i*c,e[2]=o*u+s*c+i*l-r*a,e[3]=s*u-i*a-r*l-o*c,e}class tg extends Array{constructor(e=0,t=0,n=0,i=1){super(e,t,n,i),this.onChange=()=>{},this._target=this;const r=["0","1","2","3"];return new Proxy(this,{set(e,t){const n=Reflect.set(...arguments);return n&&r.includes(t)&&e.onChange(),n}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(e){this._target[0]=e,this.onChange()}set y(e){this._target[1]=e,this.onChange()}set z(e){this._target[2]=e,this.onChange()}set w(e){this._target[3]=e,this.onChange()}identity(){var e;return(e=this._target)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.onChange(),this}set(e,t,n,i){return e.length?this.copy(e):(function(e,t,n,i,r){e[0]=t,e[1]=n,e[2]=i,e[3]=r}(this._target,e,t,n,i),this.onChange(),this)}rotateX(e){return function(e,t,n){n*=.5;let i=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(n),l=Math.cos(n);e[0]=i*l+s*a,e[1]=r*l+o*a,e[2]=o*l-r*a,e[3]=s*l-i*a}(this._target,this._target,e),this.onChange(),this}rotateY(e){return function(e,t,n){n*=.5;let i=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(n),l=Math.cos(n);e[0]=i*l-o*a,e[1]=r*l+s*a,e[2]=o*l+i*a,e[3]=s*l-r*a}(this._target,this._target,e),this.onChange(),this}rotateZ(e){return function(e,t,n){n*=.5;let i=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(n),l=Math.cos(n);e[0]=i*l+r*a,e[1]=r*l-i*a,e[2]=o*l+s*a,e[3]=s*l-o*a}(this._target,this._target,e),this.onChange(),this}inverse(e=this._target){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=n*n+i*i+r*r+o*o,a=s?1/s:0;e[0]=-n*a,e[1]=-i*a,e[2]=-r*a,e[3]=o*a}(this._target,e),this.onChange(),this}conjugate(e=this._target){var t,n;return n=e,(t=this._target)[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],this.onChange(),this}copy(e){return t=this._target,n=e,t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],this.onChange(),this;var t,n}normalize(e=this._target){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=n*n+i*i+r*r+o*o;s>0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=i*s,e[2]=r*s,e[3]=o*s}(this._target,e),this.onChange(),this}multiply(e,t){return t?eg(this._target,e,t):eg(this._target,this._target,e),this.onChange(),this}dot(e){return t=this._target,n=e,t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3];var t,n}fromMatrix3(e){return function(e,t){let n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);let r=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*r+r]-t[3*o+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*r+o]-t[3*o+r])*n,e[r]=(t[3*r+i]+t[3*i+r])*n,e[o]=(t[3*o+i]+t[3*i+o])*n}}(this._target,e),this.onChange(),this}fromEuler(e,t){return function(e,t,n="YXZ"){let i=Math.sin(.5*t[0]),r=Math.cos(.5*t[0]),o=Math.sin(.5*t[1]),s=Math.cos(.5*t[1]),a=Math.sin(.5*t[2]),l=Math.cos(.5*t[2]);"XYZ"===n?(e[0]=i*s*l+r*o*a,e[1]=r*o*l-i*s*a,e[2]=r*s*a+i*o*l,e[3]=r*s*l-i*o*a):"YXZ"===n?(e[0]=i*s*l+r*o*a,e[1]=r*o*l-i*s*a,e[2]=r*s*a-i*o*l,e[3]=r*s*l+i*o*a):"ZXY"===n?(e[0]=i*s*l-r*o*a,e[1]=r*o*l+i*s*a,e[2]=r*s*a+i*o*l,e[3]=r*s*l-i*o*a):"ZYX"===n?(e[0]=i*s*l-r*o*a,e[1]=r*o*l+i*s*a,e[2]=r*s*a-i*o*l,e[3]=r*s*l+i*o*a):"YZX"===n?(e[0]=i*s*l+r*o*a,e[1]=r*o*l+i*s*a,e[2]=r*s*a-i*o*l,e[3]=r*s*l-i*o*a):"XZY"===n&&(e[0]=i*s*l-r*o*a,e[1]=r*o*l-i*s*a,e[2]=r*s*a+i*o*l,e[3]=r*s*l+i*o*a)}(this._target,e,e.order),t||this.onChange(),this}fromAxisAngle(e,t){return function(e,t,n){n*=.5;let i=Math.sin(n);e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n)}(this._target,e,t),this.onChange(),this}slerp(e,t){return function(e,t,n,i){let r,o,s,a,l,c=t[0],u=t[1],d=t[2],h=t[3],p=n[0],f=n[1],m=n[2],g=n[3];o=c*p+u*f+d*m+h*g,o<0&&(o=-o,p=-p,f=-f,m=-m,g=-g),1-o>1e-6?(r=Math.acos(o),s=Math.sin(r),a=Math.sin((1-i)*r)/s,l=Math.sin(i*r)/s):(a=1-i,l=i),e[0]=a*c+l*p,e[1]=a*u+l*f,e[2]=a*d+l*m,e[3]=a*h+l*g}(this._target,this._target,e,t),this.onChange(),this}fromArray(e,t=0){return this._target[0]=e[t],this._target[1]=e[t+1],this._target[2]=e[t+2],this._target[3]=e[t+3],this.onChange(),this}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}}function ng(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],p=e[12],f=e[13],m=e[14],g=e[15];return(t*s-n*o)*(d*g-h*m)-(t*a-i*o)*(u*g-h*f)+(t*l-r*o)*(u*m-d*f)+(n*a-i*s)*(c*g-h*p)-(n*l-r*s)*(c*m-d*p)+(i*l-r*a)*(c*f-u*p)}function ig(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],f=t[11],m=t[12],g=t[13],b=t[14],y=t[15],v=n[0],x=n[1],w=n[2],_=n[3];return e[0]=v*i+x*a+w*d+_*m,e[1]=v*r+x*l+w*h+_*g,e[2]=v*o+x*c+w*p+_*b,e[3]=v*s+x*u+w*f+_*y,v=n[4],x=n[5],w=n[6],_=n[7],e[4]=v*i+x*a+w*d+_*m,e[5]=v*r+x*l+w*h+_*g,e[6]=v*o+x*c+w*p+_*b,e[7]=v*s+x*u+w*f+_*y,v=n[8],x=n[9],w=n[10],_=n[11],e[8]=v*i+x*a+w*d+_*m,e[9]=v*r+x*l+w*h+_*g,e[10]=v*o+x*c+w*p+_*b,e[11]=v*s+x*u+w*f+_*y,v=n[12],x=n[13],w=n[14],_=n[15],e[12]=v*i+x*a+w*d+_*m,e[13]=v*r+x*l+w*h+_*g,e[14]=v*o+x*c+w*p+_*b,e[15]=v*s+x*u+w*f+_*y,e}function rg(e,t){let n=t[0],i=t[1],r=t[2],o=t[4],s=t[5],a=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,i,r),e[1]=Math.hypot(o,s,a),e[2]=Math.hypot(l,c,u),e}const og=function(){const e=[1,1,1];return function(t,n){let i=e;rg(i,n);let r=1/i[0],o=1/i[1],s=1/i[2],a=n[0]*r,l=n[1]*o,c=n[2]*s,u=n[4]*r,d=n[5]*o,h=n[6]*s,p=n[8]*r,f=n[9]*o,m=n[10]*s,g=a+d+m,b=0;return g>0?(b=2*Math.sqrt(g+1),t[3]=.25*b,t[0]=(h-f)/b,t[1]=(p-c)/b,t[2]=(l-u)/b):a>d&&a>m?(b=2*Math.sqrt(1+a-d-m),t[3]=(h-f)/b,t[0]=.25*b,t[1]=(l+u)/b,t[2]=(p+c)/b):d>m?(b=2*Math.sqrt(1+d-a-m),t[3]=(p-c)/b,t[0]=(l+u)/b,t[1]=.25*b,t[2]=(h+f)/b):(b=2*Math.sqrt(1+m-a-d),t[3]=(l-u)/b,t[0]=(p+c)/b,t[1]=(h+f)/b,t[2]=.25*b),t}}();function sg(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function ag(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}class lg extends Array{constructor(e=1,t=0,n=0,i=0,r=0,o=1,s=0,a=0,l=0,c=0,u=1,d=0,h=0,p=0,f=0,m=1){return super(e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,m),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(e){this[12]=e}set y(e){this[13]=e}set z(e){this[14]=e}set w(e){this[15]=e}set(e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,m){return e.length?this.copy(e):(function(e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,m,g){e[0]=t,e[1]=n,e[2]=i,e[3]=r,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e[9]=u,e[10]=d,e[11]=h,e[12]=p,e[13]=f,e[14]=m,e[15]=g}(this,e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,m),this)}translate(e,t=this){return function(e,t,n){let i,r,o,s,a,l,c,u,d,h,p,f,m=n[0],g=n[1],b=n[2];t===e?(e[12]=t[0]*m+t[4]*g+t[8]*b+t[12],e[13]=t[1]*m+t[5]*g+t[9]*b+t[13],e[14]=t[2]*m+t[6]*g+t[10]*b+t[14],e[15]=t[3]*m+t[7]*g+t[11]*b+t[15]):(i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],f=t[11],e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=h,e[10]=p,e[11]=f,e[12]=i*m+a*g+d*b+t[12],e[13]=r*m+l*g+h*b+t[13],e[14]=o*m+c*g+p*b+t[14],e[15]=s*m+u*g+f*b+t[15])}(this,t,e),this}rotate(e,t,n=this){return function(e,t,n,i){let r,o,s,a,l,c,u,d,h,p,f,m,g,b,y,v,x,w,_,k,E,S,A,C,N=i[0],M=i[1],T=i[2],O=Math.hypot(N,M,T);Math.abs(O)<1e-6||(O=1/O,N*=O,M*=O,T*=O,r=Math.sin(n),o=Math.cos(n),s=1-o,a=t[0],l=t[1],c=t[2],u=t[3],d=t[4],h=t[5],p=t[6],f=t[7],m=t[8],g=t[9],b=t[10],y=t[11],v=N*N*s+o,x=M*N*s+T*r,w=T*N*s-M*r,_=N*M*s-T*r,k=M*M*s+o,E=T*M*s+N*r,S=N*T*s+M*r,A=M*T*s-N*r,C=T*T*s+o,e[0]=a*v+d*x+m*w,e[1]=l*v+h*x+g*w,e[2]=c*v+p*x+b*w,e[3]=u*v+f*x+y*w,e[4]=a*_+d*k+m*E,e[5]=l*_+h*k+g*E,e[6]=c*_+p*k+b*E,e[7]=u*_+f*k+y*E,e[8]=a*S+d*A+m*C,e[9]=l*S+h*A+g*C,e[10]=c*S+p*A+b*C,e[11]=u*S+f*A+y*C,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,n,e,t),this}scale(e,t=this){return function(e,t,n){let i=n[0],r=n[1],o=n[2];e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]}(this,t,"number"==typeof e?[e,e,e]:e),this}add(e,t){return t?sg(this,e,t):sg(this,this,e),this}sub(e,t){return t?ag(this,e,t):ag(this,this,e),this}multiply(e,t){var n,i,r;return e.length?t?ig(this,e,t):ig(this,this,e):(i=this,r=e,(n=this)[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=i[3]*r,n[4]=i[4]*r,n[5]=i[5]*r,n[6]=i[6]*r,n[7]=i[7]*r,n[8]=i[8]*r,n[9]=i[9]*r,n[10]=i[10]*r,n[11]=i[11]*r,n[12]=i[12]*r,n[13]=i[13]*r,n[14]=i[14]*r,n[15]=i[15]*r),this}identity(){var e;return(e=this)[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}copy(e){var t,n;return n=e,(t=this)[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}fromPerspective({fov:e,aspect:t,near:n,far:i}={}){return function(e,t,n,i,r){let o=1/Math.tan(t/2),s=1/(i-r);e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(r+i)*s,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*r*i*s,e[15]=0}(this,e,t,n,i),this}fromOrthogonal({left:e,right:t,bottom:n,top:i,near:r,far:o}){return function(e,t,n,i,r,o,s){let a=1/(t-n),l=1/(i-r),c=1/(o-s);e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*a,e[13]=(r+i)*l,e[14]=(s+o)*c,e[15]=1}(this,e,t,n,i,r,o),this}fromQuaternion(e){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=n+n,a=i+i,l=r+r,c=n*s,u=i*s,d=i*a,h=r*s,p=r*a,f=r*l,m=o*s,g=o*a,b=o*l;e[0]=1-d-f,e[1]=u+b,e[2]=h-g,e[3]=0,e[4]=u-b,e[5]=1-c-f,e[6]=p+m,e[7]=0,e[8]=h+g,e[9]=p-m,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this}setPosition(e){return this.x=e[0],this.y=e[1],this.z=e[2],this}inverse(e=this){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],p=t[11],f=t[12],m=t[13],g=t[14],b=t[15],y=n*a-i*s,v=n*l-r*s,x=n*c-o*s,w=i*l-r*a,_=i*c-o*a,k=r*c-o*l,E=u*m-d*f,S=u*g-h*f,A=u*b-p*f,C=d*g-h*m,N=d*b-p*m,M=h*b-p*g,T=y*M-v*N+x*C+w*A-_*S+k*E;T&&(T=1/T,e[0]=(a*M-l*N+c*C)*T,e[1]=(r*N-i*M-o*C)*T,e[2]=(m*k-g*_+b*w)*T,e[3]=(h*_-d*k-p*w)*T,e[4]=(l*A-s*M-c*S)*T,e[5]=(n*M-r*A+o*S)*T,e[6]=(g*x-f*k-b*v)*T,e[7]=(u*k-h*x+p*v)*T,e[8]=(s*N-a*A+c*E)*T,e[9]=(i*A-n*N-o*E)*T,e[10]=(f*_-m*x+b*y)*T,e[11]=(d*x-u*_-p*y)*T,e[12]=(a*S-s*C-l*E)*T,e[13]=(n*C-i*S+r*E)*T,e[14]=(m*v-f*w-g*y)*T,e[15]=(u*w-d*v+h*y)*T)}(this,e),this}compose(e,t,n){return function(e,t,n,i){const r=e,o=t[0],s=t[1],a=t[2],l=t[3],c=o+o,u=s+s,d=a+a,h=o*c,p=o*u,f=o*d,m=s*u,g=s*d,b=a*d,y=l*c,v=l*u,x=l*d,w=i[0],_=i[1],k=i[2];r[0]=(1-(m+b))*w,r[1]=(p+x)*w,r[2]=(f-v)*w,r[3]=0,r[4]=(p-x)*_,r[5]=(1-(h+b))*_,r[6]=(g+y)*_,r[7]=0,r[8]=(f+v)*k,r[9]=(g-y)*k,r[10]=(1-(h+m))*k,r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1}(this,e,t,n),this}decompose(e,t,n){return function(e,t,n,i){let r=Cm([e[0],e[1],e[2]]);const o=Cm([e[4],e[5],e[6]]),s=Cm([e[8],e[9],e[10]]);ng(e)<0&&(r=-r),n[0]=e[12],n[1]=e[13],n[2]=e[14];const a=e.slice(),l=1/r,c=1/o,u=1/s;a[0]*=l,a[1]*=l,a[2]*=l,a[4]*=c,a[5]*=c,a[6]*=c,a[8]*=u,a[9]*=u,a[10]*=u,og(t,a),i[0]=r,i[1]=o,i[2]=s}(this,e,t,n),this}getRotation(e){return og(e,this),this}getTranslation(e){var t,n;return n=this,(t=e)[0]=n[12],t[1]=n[13],t[2]=n[14],this}getScaling(e){return rg(e,this),this}getMaxScaleOnAxis(){return function(e){let t=e[0],n=e[1],i=e[2],r=e[4],o=e[5],s=e[6],a=e[8],l=e[9],c=e[10];const u=t*t+n*n+i*i,d=r*r+o*o+s*s,h=a*a+l*l+c*c;return Math.sqrt(Math.max(u,d,h))}(this)}lookAt(e,t,n){return function(e,t,n,i){let r=t[0],o=t[1],s=t[2],a=i[0],l=i[1],c=i[2],u=r-n[0],d=o-n[1],h=s-n[2],p=u*u+d*d+h*h;0===p?h=1:(p=1/Math.sqrt(p),u*=p,d*=p,h*=p);let f=l*h-c*d,m=c*u-a*h,g=a*d-l*u;p=f*f+m*m+g*g,0===p&&(c?a+=1e-6:l?c+=1e-6:l+=1e-6,f=l*h-c*d,m=c*u-a*h,g=a*d-l*u,p=f*f+m*m+g*g),p=1/Math.sqrt(p),f*=p,m*=p,g*=p,e[0]=f,e[1]=m,e[2]=g,e[3]=0,e[4]=d*g-h*m,e[5]=h*f-u*g,e[6]=u*m-d*f,e[7]=0,e[8]=u,e[9]=d,e[10]=h,e[11]=0,e[12]=r,e[13]=o,e[14]=s,e[15]=1}(this,e,t,n),this}determinant(){return ng(this)}fromArray(e,t=0){return this[0]=e[t],this[1]=e[t+1],this[2]=e[t+2],this[3]=e[t+3],this[4]=e[t+4],this[5]=e[t+5],this[6]=e[t+6],this[7]=e[t+7],this[8]=e[t+8],this[9]=e[t+9],this[10]=e[t+10],this[11]=e[t+11],this[12]=e[t+12],this[13]=e[t+13],this[14]=e[t+14],this[15]=e[t+15],this}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e[t+4]=this[4],e[t+5]=this[5],e[t+6]=this[6],e[t+7]=this[7],e[t+8]=this[8],e[t+9]=this[9],e[t+10]=this[10],e[t+11]=this[11],e[t+12]=this[12],e[t+13]=this[13],e[t+14]=this[14],e[t+15]=this[15],e}}const cg=new lg;class ug extends Array{constructor(e=0,t=e,n=e,i="YXZ"){super(e,t,n),this.order=i,this.onChange=()=>{},this._target=this;const r=["0","1","2"];return new Proxy(this,{set(e,t){const n=Reflect.set(...arguments);return n&&r.includes(t)&&e.onChange(),n}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(e){this._target[0]=e,this.onChange()}set y(e){this._target[1]=e,this.onChange()}set z(e){this._target[2]=e,this.onChange()}set(e,t=e,n=e){return e.length?this.copy(e):(this._target[0]=e,this._target[1]=t,this._target[2]=n,this.onChange(),this)}copy(e){return this._target[0]=e[0],this._target[1]=e[1],this._target[2]=e[2],this.onChange(),this}reorder(e){return this._target.order=e,this.onChange(),this}fromRotationMatrix(e,t=this.order){return function(e,t,n="YXZ"){"XYZ"===n?(e[1]=Math.asin(Math.min(Math.max(t[8],-1),1)),Math.abs(t[8])<.99999?(e[0]=Math.atan2(-t[9],t[10]),e[2]=Math.atan2(-t[4],t[0])):(e[0]=Math.atan2(t[6],t[5]),e[2]=0)):"YXZ"===n?(e[0]=Math.asin(-Math.min(Math.max(t[9],-1),1)),Math.abs(t[9])<.99999?(e[1]=Math.atan2(t[8],t[10]),e[2]=Math.atan2(t[1],t[5])):(e[1]=Math.atan2(-t[2],t[0]),e[2]=0)):"ZXY"===n?(e[0]=Math.asin(Math.min(Math.max(t[6],-1),1)),Math.abs(t[6])<.99999?(e[1]=Math.atan2(-t[2],t[10]),e[2]=Math.atan2(-t[4],t[5])):(e[1]=0,e[2]=Math.atan2(t[1],t[0]))):"ZYX"===n?(e[1]=Math.asin(-Math.min(Math.max(t[2],-1),1)),Math.abs(t[2])<.99999?(e[0]=Math.atan2(t[6],t[10]),e[2]=Math.atan2(t[1],t[0])):(e[0]=0,e[2]=Math.atan2(-t[4],t[5]))):"YZX"===n?(e[2]=Math.asin(Math.min(Math.max(t[1],-1),1)),Math.abs(t[1])<.99999?(e[0]=Math.atan2(-t[9],t[5]),e[1]=Math.atan2(-t[2],t[0])):(e[0]=0,e[1]=Math.atan2(t[8],t[10]))):"XZY"===n&&(e[2]=Math.asin(-Math.min(Math.max(t[4],-1),1)),Math.abs(t[4])<.99999?(e[0]=Math.atan2(t[6],t[5]),e[1]=Math.atan2(t[8],t[0])):(e[0]=Math.atan2(-t[9],t[10]),e[1]=0))}(this._target,e,t),this.onChange(),this}fromQuaternion(e,t=this.order,n){return cg.fromQuaternion(e),this._target.fromRotationMatrix(cg,t),n||this.onChange(),this}fromArray(e,t=0){return this._target[0]=e[t],this._target[1]=e[t+1],this._target[2]=e[t+2],this}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}}class dg{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new lg,this.worldMatrix=new lg,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new Fm,this.quaternion=new tg,this.scale=new Fm(1),this.rotation=new ug,this.up=new Fm(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(e,t=!0){this.parent&&e!==this.parent&&this.parent.removeChild(this,!1),this.parent=e,t&&e&&e.addChild(this,!1)}addChild(e,t=!0){~this.children.indexOf(e)||this.children.push(e),t&&e.setParent(this,!1)}removeChild(e,t=!0){~this.children.indexOf(e)&&this.children.splice(this.children.indexOf(e),1),t&&e.setParent(null,!1)}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||e)&&(null===this.parent?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,e=!0);for(let t=0,n=this.children.length;t<n;t++)this.children[t].updateMatrixWorld(e)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(e){if(!e(this))for(let t=0,n=this.children.length;t<n;t++)this.children[t].traverse(e)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(e,t=!1){t?this.matrix.lookAt(this.position,e,this.up):this.matrix.lookAt(e,this.position,this.up),this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}}function hg(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=n[0],p=n[1],f=n[2],m=n[3],g=n[4],b=n[5],y=n[6],v=n[7],x=n[8];return e[0]=h*i+p*s+f*c,e[1]=h*r+p*a+f*u,e[2]=h*o+p*l+f*d,e[3]=m*i+g*s+b*c,e[4]=m*r+g*a+b*u,e[5]=m*o+g*l+b*d,e[6]=y*i+v*s+x*c,e[7]=y*r+v*a+x*u,e[8]=y*o+v*l+x*d,e}class pg extends Array{constructor(e=1,t=0,n=0,i=0,r=1,o=0,s=0,a=0,l=1){return super(e,t,n,i,r,o,s,a,l),this}set(e,t,n,i,r,o,s,a,l){return e.length?this.copy(e):(function(e,t,n,i,r,o,s,a,l,c){e[0]=t,e[1]=n,e[2]=i,e[3]=r,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c}(this,e,t,n,i,r,o,s,a,l),this)}translate(e,t=this){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=n[0],p=n[1];e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=h*i+p*s+c,e[7]=h*r+p*a+u,e[8]=h*o+p*l+d}(this,t,e),this}rotate(e,t=this){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(n),p=Math.cos(n);e[0]=p*i+h*s,e[1]=p*r+h*a,e[2]=p*o+h*l,e[3]=p*s-h*i,e[4]=p*a-h*r,e[5]=p*l-h*o,e[6]=c,e[7]=u,e[8]=d}(this,t,e),this}scale(e,t=this){return function(e,t,n){let i=n[0],r=n[1];e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8]}(this,t,e),this}multiply(e,t){return t?hg(this,e,t):hg(this,this,e),this}identity(){var e;return(e=this)[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this}copy(e){var t,n;return n=e,(t=this)[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}fromMatrix4(e){var t,n;return n=e,(t=this)[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],this}fromQuaternion(e){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=n+n,a=i+i,l=r+r,c=n*s,u=i*s,d=i*a,h=r*s,p=r*a,f=r*l,m=o*s,g=o*a,b=o*l;e[0]=1-d-f,e[3]=u-b,e[6]=h+g,e[1]=u+b,e[4]=1-c-f,e[7]=p-m,e[2]=h-g,e[5]=p+m,e[8]=1-c-d}(this,e),this}fromBasis(e,t,n){return this.set(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2]),this}inverse(e=this){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=u*s-a*c,h=-u*o+a*l,p=c*o-s*l,f=n*d+i*h+r*p;f&&(f=1/f,e[0]=d*f,e[1]=(-u*i+r*c)*f,e[2]=(a*i-r*s)*f,e[3]=h*f,e[4]=(u*n-r*l)*f,e[5]=(-a*n+r*o)*f,e[6]=p*f,e[7]=(-c*n+i*l)*f,e[8]=(s*n-i*o)*f)}(this,e),this}getNormalMatrix(e){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],p=t[11],f=t[12],m=t[13],g=t[14],b=t[15],y=n*a-i*s,v=n*l-r*s,x=n*c-o*s,w=i*l-r*a,_=i*c-o*a,k=r*c-o*l,E=u*m-d*f,S=u*g-h*f,A=u*b-p*f,C=d*g-h*m,N=d*b-p*m,M=h*b-p*g,T=y*M-v*N+x*C+w*A-_*S+k*E;T&&(T=1/T,e[0]=(a*M-l*N+c*C)*T,e[1]=(l*A-s*M-c*S)*T,e[2]=(s*N-a*A+c*E)*T,e[3]=(r*N-i*M-o*C)*T,e[4]=(n*M-r*A+o*S)*T,e[5]=(i*A-n*N-o*E)*T,e[6]=(m*k-g*_+b*w)*T,e[7]=(g*x-f*k-b*v)*T,e[8]=(f*_-m*x+b*y)*T)}(this,e),this}}let fg=0;class mg extends dg{constructor(e,{geometry:t,program:n,mode:i=e.TRIANGLES,frustumCulled:r=!0,renderOrder:o=0}={}){super(),e.canvas||console.error("gl not passed as first argument to Mesh"),this.gl=e,this.id=fg++,this.geometry=t,this.program=n,this.mode=i,this.frustumCulled=r,this.renderOrder=o,this.modelViewMatrix=new lg,this.normalMatrix=new pg,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(e){return this.beforeRenderCallbacks.push(e),this}onAfterRender(e){return this.afterRenderCallbacks.push(e),this}draw({camera:e}={}){e&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=e.projectionMatrix,this.program.uniforms.cameraPosition.value=e.worldPosition,this.program.uniforms.viewMatrix.value=e.viewMatrix,this.modelViewMatrix.multiply(e.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix),this.beforeRenderCallbacks.forEach(t=>t&&t({mesh:this,camera:e}));let t=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:t}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach(t=>t&&t({mesh:this,camera:e}))}}function gg({settings:e,forceHoverState:n=!1}){if("undefined"==typeof window)return t("div",{className:"orb-container"});const i=b(null);return h(()=>{const t=i.current;if(!t)return;const{hue:r,hoverIntensity:o,rotateOnHover:s}=e;let a=[];const l=setTimeout(()=>{if(!t||!t.isConnected)return;const e=new jm({alpha:!0,premultipliedAlpha:!1}),i=e.gl;i.clearColor(0,0,0,0);const l=i.canvas;l.style.visibility="visible",l.style.opacity="1",l.style.display="block",l.style.position="relative",l.style.zIndex="1",t.appendChild(l);const c=new Km(i),u=new Zm(i,{vertex:"\n precision highp float;\n attribute vec2 position;\n attribute vec2 uv;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4(position, 0.0, 1.0);\n }\n ",fragment:"\n precision highp float;\n\n uniform float iTime;\n uniform vec3 iResolution;\n uniform float hue;\n uniform float hover;\n uniform float rot;\n uniform float hoverIntensity;\n varying vec2 vUv;\n\n vec3 rgb2yiq(vec3 c) {\n float y = dot(c, vec3(0.299, 0.587, 0.114));\n float i = dot(c, vec3(0.596, -0.274, -0.322));\n float q = dot(c, vec3(0.211, -0.523, 0.312));\n return vec3(y, i, q);\n }\n \n vec3 yiq2rgb(vec3 c) {\n float r = c.x + 0.956 * c.y + 0.621 * c.z;\n float g = c.x - 0.272 * c.y - 0.647 * c.z;\n float b = c.x - 1.106 * c.y + 1.703 * c.z;\n return vec3(r, g, b);\n }\n \n vec3 adjustHue(vec3 color, float hueDeg) {\n float hueRad = hueDeg * 3.14159265 / 180.0;\n vec3 yiq = rgb2yiq(color);\n float cosA = cos(hueRad);\n float sinA = sin(hueRad);\n float i = yiq.y * cosA - yiq.z * sinA;\n float q = yiq.y * sinA + yiq.z * cosA;\n yiq.y = i;\n yiq.z = q;\n return yiq2rgb(yiq);\n }\n \n vec3 hash33(vec3 p3) {\n p3 = fract(p3 * vec3(0.1031, 0.11369, 0.13787));\n p3 += dot(p3, p3.yxz + 19.19);\n return -1.0 + 2.0 * fract(vec3(\n p3.x + p3.y,\n p3.x + p3.z,\n p3.y + p3.z\n ) * p3.zyx);\n }\n \n float snoise3(vec3 p) {\n const float K1 = 0.333333333;\n const float K2 = 0.166666667;\n vec3 i = floor(p + (p.x + p.y + p.z) * K1);\n vec3 d0 = p - (i - (i.x + i.y + i.z) * K2);\n vec3 e = step(vec3(0.0), d0 - d0.yzx);\n vec3 i1 = e * (1.0 - e.zxy);\n vec3 i2 = 1.0 - e.zxy * (1.0 - e);\n vec3 d1 = d0 - (i1 - K2);\n vec3 d2 = d0 - (i2 - K1);\n vec3 d3 = d0 - 0.5;\n vec4 h = max(0.6 - vec4(\n dot(d0, d0),\n dot(d1, d1),\n dot(d2, d2),\n dot(d3, d3)\n ), 0.0);\n vec4 n = h * h * h * h * vec4(\n dot(d0, hash33(i)),\n dot(d1, hash33(i + i1)),\n dot(d2, hash33(i + i2)),\n dot(d3, hash33(i + 1.0))\n );\n return dot(vec4(31.316), n);\n }\n \n vec4 extractAlpha(vec3 colorIn) {\n float a = max(max(colorIn.r, colorIn.g), colorIn.b);\n return vec4(colorIn.rgb / (a + 1e-5), a);\n }\n \n const vec3 baseColor1 = vec3(0.611765, 0.262745, 0.996078);\n const vec3 baseColor2 = vec3(0.298039, 0.760784, 0.913725);\n const vec3 baseColor3 = vec3(0.062745, 0.078431, 0.600000);\n const float innerRadius = 0.6;\n const float noiseScale = 0.65;\n \n float light1(float intensity, float attenuation, float dist) {\n return intensity / (1.0 + dist * attenuation);\n }\n \n float light2(float intensity, float attenuation, float dist) {\n return intensity / (1.0 + dist * dist * attenuation);\n }\n \n vec4 draw(vec2 uv) {\n vec3 color1 = adjustHue(baseColor1, hue);\n vec3 color2 = adjustHue(baseColor2, hue);\n vec3 color3 = adjustHue(baseColor3, hue);\n \n float ang = atan(uv.y, uv.x);\n float len = length(uv);\n float invLen = len > 0.0 ? 1.0 / len : 0.0;\n \n float n0 = snoise3(vec3(uv * noiseScale, iTime * 0.5)) * 0.5 + 0.5;\n float r0 = mix(mix(innerRadius, 1.0, 0.4), mix(innerRadius, 1.0, 0.6), n0);\n float d0 = distance(uv, (r0 * invLen) * uv);\n float v0 = light1(1.0, 10.0, d0);\n v0 *= smoothstep(r0 * 1.05, r0, len);\n float cl = cos(ang + iTime * 2.0) * 0.5 + 0.5;\n \n float a = iTime * -1.0;\n vec2 pos = vec2(cos(a), sin(a)) * r0;\n float d = distance(uv, pos);\n float v1 = light2(1.5, 5.0, d);\n v1 *= light1(1.0, 50.0, d0);\n \n float v2 = smoothstep(1.0, mix(innerRadius, 1.0, n0 * 0.5), len);\n float v3 = smoothstep(innerRadius, mix(innerRadius, 1.0, 0.5), len);\n \n vec3 col = mix(color1, color2, cl);\n col = mix(color3, col, v0);\n col = (col + v1) * v2 * v3;\n col = clamp(col, 0.0, 1.0);\n \n return extractAlpha(col);\n }\n \n vec4 mainImage(vec2 fragCoord) {\n vec2 center = iResolution.xy * 0.5;\n float size = min(iResolution.x, iResolution.y);\n vec2 uv = (fragCoord - center) / size * 2.0;\n \n float angle = rot;\n float s = sin(angle);\n float c = cos(angle);\n uv = vec2(c * uv.x - s * uv.y, s * uv.x + c * uv.y);\n \n uv.x += hover * hoverIntensity * 0.1 * sin(uv.y * 10.0 + iTime);\n uv.y += hover * hoverIntensity * 0.1 * sin(uv.x * 10.0 + iTime);\n \n return draw(uv);\n }\n \n void main() {\n vec2 fragCoord = vUv * iResolution.xy;\n vec4 col = mainImage(fragCoord);\n gl_FragColor = vec4(col.rgb * col.a, col.a);\n }\n ",uniforms:{iTime:{value:0},iResolution:{value:new Fm(i.canvas.width,i.canvas.height,i.canvas.width/i.canvas.height)},hue:{value:r},hover:{value:0},rot:{value:0},hoverIntensity:{value:o}}}),d=new mg(i,{geometry:c,program:u});function h(){if(!t)return;const n=window.devicePixelRatio||1,r=t.clientWidth,o=t.clientHeight,s=Math.min(r,o);e.setSize(s*n,s*n),i.canvas.style.width=s+"px",i.canvas.style.height=s+"px",i.canvas.style.display="block",i.canvas.style.objectFit="contain",u.uniforms.iResolution.value.set(s*n,s*n,s*n/(s*n))}window.addEventListener("resize",h),h();let p=0,f=0,m=0;const g=e=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,r=e.clientY-n.top,o=n.width,s=n.height,a=Math.min(o,s),l=(i-o/2)/a*2,c=(r-s/2)/a*2;p=Math.sqrt(l*l+c*c)<.8?1:0},b=()=>{p=0};let y;t.addEventListener("mousemove",g),t.addEventListener("mouseleave",b);const v=t=>{y=requestAnimationFrame(v);const i=.001*(t-f);f=t,u.uniforms.iTime.value=.001*t,u.uniforms.hue.value=r,u.uniforms.hoverIntensity.value=o;const a=n?1:p;u.uniforms.hover.value+=.1*(a-u.uniforms.hover.value),s&&a>.5&&(m+=.3*i),u.uniforms.rot.value=m,e.render({scene:d})};y=requestAnimationFrame(v),a=[()=>cancelAnimationFrame(y),()=>window.removeEventListener("resize",h),()=>t.removeEventListener("mousemove",g),()=>t.removeEventListener("mouseleave",b),()=>{t.contains(l)&&t.removeChild(l)},()=>i.getExtension("WEBGL_lose_context")?.loseContext()]},10);return()=>{clearTimeout(l),a.forEach(e=>e())}},[e,n]),t("div",{ref:i,className:"orb-container"})}const bg=c(({open:e,onClick:n,forceHoverState:i=!1},r)=>{const{settings:o}=Em();return t(xa.button,{ref:r,className:"bmxcb__orb-button","aria-label":e?"Close chat":"Open chat",onClick:n,whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:25},children:t(gg,{settings:o,forceHoverState:i})})}),yg=c(({open:e,onClick:n,forceHoverState:i=!1},r)=>t(bg,{ref:r,open:e,onClick:n,forceHoverState:i}));function vg({api:r,projectId:o,zIndex:s=2147483e3,storage:a="local",storageKey:l="bmx-chat-bot-history",placeholder:c="Ask about this project…",title:d="Assistant",children:p}){const[f,m]=y(!1),[v,x]=y(""),[w,_]=y(!1),k=b(null),E=b(null),S=b(null),{mounted:A,root:C}=function({zIndex:e=2147483e3}){const[t,n]=y(!1);h(()=>{n(!0)},[]);const i=g(()=>{if(!t||"undefined"==typeof document)return null;const n=document.createElement("div");return n.setAttribute("data-bmx-chat-bot-root",""),n.style.all="initial",n.style.fontFamily="var(--bmx-font-family)",n.style.position="fixed",n.style.right="16px",n.style.bottom="16px",n.style.zIndex=String(e),n},[t,e]);return h(()=>{if(i&&"undefined"!=typeof document)return document.body.appendChild(i),()=>{try{document.body.removeChild(i)}catch{}}},[i]),{mounted:t,root:i}}({zIndex:s}),{messages:N,setMessages:M,sending:T,setSending:O,clearHistory:D}=function({storage:e="local",storageKey:t="bmx-chat-bot-history"}){const[n,i]=y([]),[r,o]=y(!1);h(()=>{if("undefined"!=typeof window&&"local"===e)try{const e=window.localStorage.getItem(t);e&&i(JSON.parse(e))}catch{}},[e,t]),h(()=>{if("undefined"!=typeof window&&"local"===e)try{window.localStorage.setItem(t,JSON.stringify(n))}catch{}},[n,e,t]);const s=u(()=>{if(i([]),"undefined"!=typeof window&&"local"===e)try{window.localStorage.removeItem(t)}catch{}},[e,t]),a=u(e=>{i(t=>[...t,e])},[]);return{messages:n,setMessages:i,sending:r,setSending:o,clearHistory:s,addMessage:a}}({storage:a,storageKey:l}),{sendMessage:I}=function({api:e,messages:t,projectId:n,setMessages:i,setSending:r}){const o=b(null);return{sendMessage:u(async s=>{const a=s.trim();if(!a)return;const l={id:`${Date.now()}-user`,role:"user",content:a,createdAt:Date.now()};i(e=>[...e,l]),r(!0),o.current?.abort(),o.current=new AbortController;try{const r=await e.sendMessage([...t,l],a,{projectId:n,signal:o.current.signal});i(e=>[...e,r])}catch(e){const t={id:`${Date.now()}-error`,role:"assistant",content:"Sorry, something went wrong. Please try again.",createdAt:Date.now()};i(e=>[...e,t])}finally{r(!1)}},[e,t,n,i,r])}}({api:r,messages:N,projectId:o,setMessages:M,setSending:O}),R=u(()=>{m(e=>!e)},[]),P=u(()=>{m(!1),_(!1)},[]),L=u(()=>{_(e=>!e)},[]);!function({open:e,showSettings:t,onToggleChat:n,onToggleSettings:i,onClose:r,chatButtonRef:o,chatPanelRef:s}){const a=u(a=>{if("Escape"!==a.key)return(a.ctrlKey||a.metaKey)&&"k"===a.key?(a.preventDefault(),n(),void(e?setTimeout(()=>o.current?.focus(),100):setTimeout(()=>{const e=s.current?.querySelector("textarea");e?.focus()},100))):(a.ctrlKey||a.metaKey)&&"/"===a.key?(a.preventDefault(),void(e&&i())):void 0;t?i():e&&(r(),setTimeout(()=>o.current?.focus(),100))},[e,t,n,i,r,o,s]);h(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[a])}({open:f,showSettings:w,onToggleChat:R,onToggleSettings:L,onClose:P,chatButtonRef:k,chatPanelRef:E}),function({isOpen:e,widgetRef:t,onClose:n,chatButtonRef:i}){const r=u(r=>{e&&t.current&&(t.current.contains(r.target)||(n(),setTimeout(()=>i.current?.focus(),100)))},[e,t,n,i]);h(()=>{if(e){const e=setTimeout(()=>{document.addEventListener("mousedown",r)},100);return()=>{clearTimeout(e),document.removeEventListener("mousedown",r)}}},[e,r])}({isOpen:f,widgetRef:S,onClose:P,chatButtonRef:k});const F=u(async()=>{const e=v.trim();e&&!T&&(x(""),await I(e))},[v,T,I]),B=u(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),F())},[F]);return A&&C?n(e,{children:[p??null,i(n("div",{className:"bmxcb",ref:S,children:[t(yg,{ref:k,open:f,onClick:R,forceHoverState:!1}),f&&t(Am,{ref:E,title:d,messages:N,input:v,setInput:x,onKeyDown:B,onSend:()=>{F()},onClose:P,placeholder:c,sending:T,showSettings:w,onToggleSettings:L,onClearHistory:D,onSuggestionClick:async e=>{x(e),m(!0),x(""),await I(e)}})]}),C)]}):t(e,{children:p??null})}export{vg as BmxChatBot,A as RestAdapters,E as createMockAdapter,S as createRestAdapter,Em as useChatSettings,_m as useLocalStorage};
|
|
1
|
+
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{createPortal as i}from"react-dom";import{Component as r,Fragment as o,createContext as s,createElement as a,default as l,forwardRef as c,useCallback as u,useContext as d,useEffect as h,useId as p,useInsertionEffect as f,useLayoutEffect as m,useMemo as g,useRef as b,useState as y}from"react";var v={62:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var i=(0,r.default)(e),o="function"==typeof t;return i.forEach(function(e){if("declaration"===e.type){var i=e.property,r=e.value;o?t(i,r,e):r&&((n=n||{})[i]=r)}}),n};var r=i(n(401))},74:e=>{function t(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(n=>{const i=e[n],r=typeof i;"object"!==r&&"function"!==r||Object.isFrozen(i)||t(i)}),e}class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}const o=e=>!!e.scope;class s{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!o(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){o(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const a=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class l{constructor(){this.rootNode=a(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=a({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function u(e){return e?"string"==typeof e?e:e.source:null}function d(e){return f("(?=",e,")")}function h(e){return f("(?:",e,")*")}function p(e){return f("(?:",e,")?")}function f(...e){return e.map(e=>u(e)).join("")}function m(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map(e=>u(e)).join("|")+")"}function g(e){return new RegExp(e.toString()+"|").exec("").length-1}const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function y(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;const t=n;let i=u(e),r="";for(;i.length>0;){const e=b.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r}).map(e=>`(${e})`).join(t)}const v="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",E={begin:"\\\\[\\s\\S]",relevance:0},S={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[E]},A={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[E]},C=function(e,t,n={}){const i=r({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:f(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},N=C("//","$"),M=C("/\\*","\\*/"),T=C("#","$"),O={scope:"number",begin:w,relevance:0},D={scope:"number",begin:_,relevance:0},I={scope:"number",begin:k,relevance:0},R={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[E,{begin:/\[/,end:/\]/,relevance:0,contains:[E]}]},P={scope:"title",begin:v,relevance:0},L={scope:"title",begin:x,relevance:0},F={begin:"\\.\\s*"+x,relevance:0};var B=Object.freeze({__proto__:null,APOS_STRING_MODE:S,BACKSLASH_ESCAPE:E,BINARY_NUMBER_MODE:I,BINARY_NUMBER_RE:k,COMMENT:C,C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:N,C_NUMBER_MODE:D,C_NUMBER_RE:_,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:T,IDENT_RE:v,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:F,NUMBER_MODE:O,NUMBER_RE:w,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:A,REGEXP_MODE:R,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:P,UNDERSCORE_IDENT_RE:x,UNDERSCORE_TITLE_MODE:L});function z(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function j(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function U(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=z,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function V(e,t){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function $(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function H(e,t){void 0===e.relevance&&(e.relevance=1)}const q=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=f(n.beforeMatch,d(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},K=["of","and","for","in","not","or","if","then","parent","list","value"];function G(e,t,n="keyword"){const i=Object.create(null);return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(n){Object.assign(i,G(e[n],t,n))}),i;function r(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){const n=t.split("|");i[n[0]]=[e,W(n[0],n[1])]})}}function W(e,t){return t?Number(t):function(e){return K.includes(e.toLowerCase())}(e)?0:1}const Z={},X=e=>{console.error(e)},Y=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Q=(e,t)=>{Z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Z[`${e}/${t}`]=!0)},J=new Error;function ee(e,t,{key:n}){let i=0;const r=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+i]=r[e],o[e+i]=!0,i+=g(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function te(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw X("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),J;if("object"!=typeof e.beginScope||null===e.beginScope)throw X("beginScope must be object"),J;ee(e,e.begin,{key:"beginScope"}),e.begin=y(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw X("skip, excludeEnd, returnEnd not compatible with endScope: {}"),J;if("object"!=typeof e.endScope||null===e.endScope)throw X("endScope must be object"),J;ee(e,e.end,{key:"endScope"}),e.end=y(e.end,{joinWith:""})}}(e)}function ne(e){function t(t,n){return new RegExp(u(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=g(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=t(y(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),i=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=r(e.classNameAliases||{}),function n(o,s){const a=o;if(o.isCompiled)return a;[j,$,te,q].forEach(e=>e(o,s)),e.compilerExtensions.forEach(e=>e(o,s)),o.__beforeBegin=null,[U,V,H].forEach(e=>e(o,s)),o.isCompiled=!0;let l=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),l=o.keywords.$pattern,delete o.keywords.$pattern),l=l||/\w+/,o.keywords&&(o.keywords=G(o.keywords,e.case_insensitive)),a.keywordPatternRe=t(l,!0),s&&(o.begin||(o.begin=/\B|\b/),a.beginRe=t(a.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(a.endRe=t(a.end)),a.terminatorEnd=u(a.end)||"",o.endsWithParent&&s.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(a.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(e){return function(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return r(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ie(e)?r(e,{starts:e.starts?r(e.starts):null}):Object.isFrozen(e)?r(e):e}("self"===e?o:e)})),o.contains.forEach(function(e){n(e,a)}),o.starts&&n(o.starts,s),a.matcher=function(e){const t=new i;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function ie(e){return!!e&&(e.endsWithParent||ie(e.starts))}class re extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const oe=i,se=r,ae=Symbol("nomatch"),le=function(e){const i=Object.create(null),r=Object.create(null),o=[];let s=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function g(e){return u.noHighlightRe.test(e)}function b(e,t,n){let i="",r="";"object"==typeof t?(i=e,n=t.ignoreIllegals,r=t.language):(Q("10.7.0","highlight(lang, code, ...args) has been deprecated."),Q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,i=t),void 0===n&&(n=!0);const o={code:i,language:r};A("before:highlight",o);const s=o.result?o.result:y(o.language,o.code,n);return s.code=o.code,A("after:highlight",s),s}function y(e,t,r,o){const l=Object.create(null);function c(e,t){return e.keywords[t]}function d(){if(!C.keywords)return void M.addText(T);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(T),n="";for(;t;){n+=T.substring(e,t.index);const i=E.case_insensitive?t[0].toLowerCase():t[0],r=c(C,i);if(r){const[e,o]=r;if(M.addText(n),n="",l[i]=(l[i]||0)+1,l[i]<=7&&(O+=o),e.startsWith("_"))n+=t[0];else{const n=E.classNameAliases[e]||e;p(t[0],n)}}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(T)}n+=T.substring(e),M.addText(n)}function h(){null!=C.subLanguage?function(){if(""===T)return;let e=null;if("string"==typeof C.subLanguage){if(!i[C.subLanguage])return void M.addText(T);e=y(C.subLanguage,T,!0,N[C.subLanguage]),N[C.subLanguage]=e._top}else e=v(T,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(O+=e.relevance),M.__addSublanguage(e._emitter,e.language)}():d(),T=""}function p(e,t){""!==e&&(M.startScope(t),M.addText(e),M.endScope())}function f(e,t){let n=1;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue}const i=E.classNameAliases[e[n]]||e[n],r=t[n];i?p(r,i):(T=r,d(),T=""),n++}}function m(e,t){return e.scope&&"string"==typeof e.scope&&M.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(p(T,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),T=""):e.beginScope._multi&&(f(e.beginScope,t),T="")),C=Object.create(e,{parent:{value:C}}),C}function g(e,t,i){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,i);if(r){if(e["on:end"]){const i=new n(e);e["on:end"](t,i),i.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return g(e.parent,t,i)}function b(e){return 0===C.matcher.regexIndex?(T+=e[0],1):(R=!0,0)}function x(e){const n=e[0],i=t.substring(e.index),r=g(C,e,i);if(!r)return ae;const o=C;C.endScope&&C.endScope._wrap?(h(),p(n,C.endScope._wrap)):C.endScope&&C.endScope._multi?(h(),f(C.endScope,e)):o.skip?T+=n:(o.returnEnd||o.excludeEnd||(T+=n),h(),o.excludeEnd&&(T=n));do{C.scope&&M.closeNode(),C.skip||C.subLanguage||(O+=C.relevance),C=C.parent}while(C!==r.parent);return r.starts&&m(r.starts,e),o.returnEnd?0:n.length}let w={};function _(i,o){const a=o&&o[0];if(T+=i,null==a)return h(),0;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===a){if(T+=t.slice(o.index,o.index+1),!s){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=w.rule,t}return 1}if(w=o,"begin"===o.type)return function(e){const t=e[0],i=e.rule,r=new n(i),o=[i.__beforeBegin,i["on:begin"]];for(const n of o)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return i.skip?T+=t:(i.excludeBegin&&(T+=t),h(),i.returnBegin||i.excludeBegin||(T=t)),m(i,e),i.returnBegin?0:t.length}(o);if("illegal"===o.type&&!r){const e=new Error('Illegal lexeme "'+a+'" for mode "'+(C.scope||"<unnamed>")+'"');throw e.mode=C,e}if("end"===o.type){const e=x(o);if(e!==ae)return e}if("illegal"===o.type&&""===a)return T+="\n",1;if(I>1e5&&I>3*o.index)throw new Error("potential infinite loop, way more iterations than matches");return T+=a,a.length}const E=k(e);if(!E)throw X(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const S=ne(E);let A="",C=o||S;const N={},M=new u.__emitter(u);!function(){const e=[];for(let t=C;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}();let T="",O=0,D=0,I=0,R=!1;try{if(E.__emitTokens)E.__emitTokens(t,M);else{for(C.matcher.considerAll();;){I++,R?R=!1:C.matcher.considerAll(),C.matcher.lastIndex=D;const e=C.matcher.exec(t);if(!e)break;const n=_(t.substring(D,e.index),e);D=e.index+n}_(t.substring(D))}return M.finalize(),A=M.toHTML(),{language:e,value:A,relevance:O,illegal:!1,_emitter:M,_top:C}}catch(n){if(n.message&&n.message.includes("Illegal"))return{language:e,value:oe(t),illegal:!0,relevance:0,_illegalBy:{message:n.message,index:D,context:t.slice(D-100,D+100),mode:n.mode,resultSoFar:A},_emitter:M};if(s)return{language:e,value:oe(t),illegal:!1,relevance:0,errorRaised:n,_emitter:M,_top:C};throw n}}function v(e,t){t=t||u.languages||Object.keys(i);const n=function(e){const t={value:oe(e),illegal:!1,relevance:0,_top:l,_emitter:new u.__emitter(u)};return t._emitter.addText(e),t}(e),r=t.filter(k).filter(S).map(t=>y(t,e,!1));r.unshift(n);const o=r.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(k(e.language).supersetOf===t.language)return 1;if(k(t.language).supersetOf===e.language)return-1}return 0}),[s,a]=o,c=s;return c.secondBest=a,c}function x(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=u.languageDetectRe.exec(t);if(n){const t=k(n[1]);return t||(Y(a.replace("{}",n[1])),Y("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>g(e)||k(e))}(e);if(g(n))return;if(A("before:highlightElement",{el:e,language:n}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),u.throwUnescapedHTML))throw new re("One of your code blocks includes unescaped HTML.",e.innerHTML);t=e;const i=t.textContent,o=n?b(i,{language:n,ignoreIllegals:!0}):v(i);e.innerHTML=o.value,e.dataset.highlighted="yes",function(e,t,n){const i=t&&r[t]||n;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,n,o.language),e.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest&&(e.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance}),A("after:highlightElement",{el:e,result:o,text:i})}let w=!1;function _(){if("loading"===document.readyState)return w||window.addEventListener("DOMContentLoaded",function(){_()},!1),void(w=!0);document.querySelectorAll(u.cssSelector).forEach(x)}function k(e){return e=(e||"").toLowerCase(),i[e]||i[r[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{r[e.toLowerCase()]=t})}function S(e){const t=k(e);return t&&!t.disableAutodetect}function A(e,t){const n=e;o.forEach(function(e){e[n]&&e[n](t)})}Object.assign(e,{highlight:b,highlightAuto:v,highlightAll:_,highlightElement:x,highlightBlock:function(e){return Q("10.7.0","highlightBlock will be removed entirely in v12.0"),Q("10.7.0","Please use highlightElement now."),x(e)},configure:function(e){u=se(u,e)},initHighlighting:()=>{_(),Q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){_(),Q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(t,n){let r=null;try{r=n(e)}catch(e){if(X("Language definition for '{}' could not be registered.".replace("{}",t)),!s)throw e;X(e),r=l}r.name||(r.name=t),i[t]=r,r.rawDefinition=n.bind(null,e),r.aliases&&E(r.aliases,{languageName:t})},unregisterLanguage:function(e){delete i[e];for(const t of Object.keys(r))r[t]===e&&delete r[t]},listLanguages:function(){return Object.keys(i)},getLanguage:k,registerAliases:E,autoDetection:S,inherit:se,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),o.push(e)},removePlugin:function(e){const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString="11.11.1",e.regex={concat:f,lookahead:d,either:m,optional:p,anyNumberOfTimes:h};for(const e in B)"object"==typeof B[e]&&t(B[e]);return Object.assign(e,B),e},ce=le({});ce.newInstance=()=>le({}),e.exports=ce,ce.HighlightJS=ce,ce.default=ce},401:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,h=1;function p(e){var t=e.match(n);t&&(d+=t.length);var i=e.lastIndexOf("\n");h=~i?e.length-i:h+e.length}function f(){var e={line:d,column:h};return function(t){return t.position=new m(e),v(),t}}function m(e){this.start=e,this.end={line:d,column:h},this.source=l.source}m.prototype.content=e;var g=[];function b(t){var n=new Error(l.source+":"+d+":"+h+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=h,n.source=e,!l.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var i=n[0];return p(i),e=e.slice(i.length),n}}function v(){y(i)}function x(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return b("End of comment missing");var i=e.slice(2,n-2);return h+=2,p(i),e=e.slice(n),h+=2,t({type:"comment",comment:i})}}function _(){var e=f(),n=y(r);if(n){if(w(),!y(o))return b("property missing ':'");var i=y(s),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:i?u(i[0].replace(t,c)):c});return y(a),l}}return v(),function(){var e,t=[];for(x(t);e=_();)!1!==e&&(t.push(e),x(t));return t}()}},426:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||r.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,l):e.replace(o,l)).replace(i,a))}},598:function(e,t,n){var i=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(62)),r=n(426);function o(e,t){var n={};return e&&"string"==typeof e?((0,i.default)(e,function(e,i){e&&i&&(n[(0,r.camelCase)(e,t)]=i)}),n):n}o.default=o,e.exports=o},710:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},a=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<p;++h)if(null!=(t=arguments[h]))for(n in t)i=l(d,n),d!==(r=l(t,n))&&(f&&r&&(s(r)||(c=o(r)))?(c?(c=!1,u=i&&o(i)?i:[]):u=i&&s(i)?i:{},a(d,{name:n,newValue:e(f,u,r)})):void 0!==r&&a(d,{name:n,newValue:r}));return d}}},x={};function w(e){var t=x[e];if(void 0!==t)return t.exports;var n=x[e]={exports:{}};return v[e].call(n.exports,n,n.exports,w),n.exports}w.d=(e,t)=>{for(var n in t)w.o(t,n)&&!w.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},w.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var _={};w.r(_),w.d(_,{boolean:()=>Fa,booleanish:()=>Ba,commaOrSpaceSeparated:()=>$a,commaSeparated:()=>Va,number:()=>ja,overloadedBoolean:()=>za,spaceSeparated:()=>Ua});var k={};function E(e=400){return{async sendMessage(t,n){const i={id:`${Date.now()}-assistant`,role:"assistant",content:`Echo: ${n}`,createdAt:Date.now()};return await new Promise(t=>setTimeout(t,e)),i}}}function S(e){const{baseUrl:t,endpoint:n="/common/ai/chat",headers:i={}}=e;return{async sendMessage(e,r,{signal:o}={}){const s=`${t.replace(/\/$/,"")}${n}`,a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify({history:e,input:r}),signal:o});if(!a.ok){const e=await a.text();throw new Error(`API error ${a.status}: ${e}`)}return await a.json()}}}w.r(k),w.d(k,{attentionMarkers:()=>yu,contentInitial:()=>hu,disable:()=>vu,document:()=>du,flow:()=>fu,flowInitial:()=>pu,insideSpan:()=>bu,string:()=>mu,text:()=>gu});const A={development:()=>S({baseUrl:"http://localhost:8080",endpoint:"/common/ai/chat"}),production:e=>S({baseUrl:e??"",endpoint:"/common/ai/chat"}),custom:e=>S(e)};var C,N={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},M=l.createContext&&l.createContext(N),T=["attr","size","title"];function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},O.apply(this,arguments)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){var i,r,o,s;i=e,r=t,o=n[t],s=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r),(r="symbol"==typeof s?s:s+"")in i?Object.defineProperty(i,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R(e){return e&&e.map((e,t)=>l.createElement(e.tag,I({key:t},e.attr),R(e.child)))}function P(e){return t=>l.createElement(L,O({attr:I({},e.attr)},t),R(e.child))}function L(e){var t=t=>{var n,{attr:i,size:r,title:o}=e,s=function(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,T),a=r||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),l.createElement("svg",O({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,s,{className:n,style:I(I({color:e.color||t.color},t.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&l.createElement("title",null,o),e.children)};return void 0!==M?l.createElement(M.Consumer,null,e=>t(e)):t(N)}function F(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32",d:"M87.49 380c1.19-4.38-1.44-10.47-3.95-14.86a44.86 44.86 0 0 0-2.54-3.8 199.81 199.81 0 0 1-33-110C47.65 139.09 140.73 48 255.83 48 356.21 48 440 117.54 459.58 209.85a199 199 0 0 1 4.42 41.64c0 112.41-89.49 204.93-204.59 204.93-18.3 0-43-4.6-56.47-8.37s-26.92-8.77-30.39-10.11a31.09 31.09 0 0 0-11.12-2.07 30.71 30.71 0 0 0-12.09 2.43l-67.83 24.48a16 16 0 0 1-4.67 1.22 9.6 9.6 0 0 1-9.57-9.74 15.85 15.85 0 0 1 .6-3.29z"},child:[]}]})(e)}function B(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function z(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 249.93a10.58 10.58 0 0 0-9.36-9.94L429 235.84a5.42 5.42 0 0 1-4.5-4.67c-.49-3.15-1-6.42-1.7-9.52a5.52 5.52 0 0 1 2.63-5.85l22.78-12.65a10.35 10.35 0 0 0 5-12.83l-3.95-10.9a10.32 10.32 0 0 0-12.13-6.51l-25.55 5a5.51 5.51 0 0 1-5.82-2.81c-1.49-2.79-3.11-5.63-4.8-8.42a5.6 5.6 0 0 1 .44-6.5l17-19.64a10.42 10.42 0 0 0 .39-13.76l-7.42-8.91a10.24 10.24 0 0 0-13.58-2l-22.37 13.43a5.39 5.39 0 0 1-6.39-.63c-2.47-2.17-5-4.26-7.37-6.19a5.45 5.45 0 0 1-1.72-6.21l9.26-24.4a10.35 10.35 0 0 0-4.31-13.07l-10.09-5.89a10.3 10.3 0 0 0-13.45 2.83L325 96.28a4.6 4.6 0 0 1-5.6 1.72c-.61-.25-5.77-2.36-9.78-3.7a5.42 5.42 0 0 1-3.74-5.23l.39-26.07a10.48 10.48 0 0 0-8.57-10.88l-11.45-2a10.45 10.45 0 0 0-11.75 7.17L266 82.1a5.46 5.46 0 0 1-5.36 3.65h-9.75a5.5 5.5 0 0 1-5.3-3.67l-8.46-24.67a10.46 10.46 0 0 0-11.77-7.25l-11.47 2a10.46 10.46 0 0 0-8.56 10.79l.4 26.16a5.45 5.45 0 0 1-3.86 5.25c-2.29.89-7.26 2.79-9.52 3.63-2 .72-4.18-.07-5.94-2.1l-16.26-20A10.3 10.3 0 0 0 156.69 73l-10.06 5.83A10.36 10.36 0 0 0 142.31 92l9.25 24.34a5.54 5.54 0 0 1-1.7 6.23c-2.43 2-4.92 4-7.4 6.22a5.38 5.38 0 0 1-6.35.64L114 115.74a10.4 10.4 0 0 0-13.61 2L93 126.63a10.31 10.31 0 0 0 .37 13.75L110.45 160a5.42 5.42 0 0 1 .45 6.45c-1.71 2.72-3.34 5.58-4.82 8.44a5.53 5.53 0 0 1-5.86 2.82l-25.51-4.93a10.34 10.34 0 0 0-12.14 6.51l-4 10.88a10.38 10.38 0 0 0 5 12.85l22.78 12.65a5.39 5.39 0 0 1 2.65 5.92l-.24 1.27c-.52 2.79-1 5.43-1.46 8.24a5.48 5.48 0 0 1-4.46 4.64l-25.69 4.15A10.42 10.42 0 0 0 48 250.16v11.58A10.26 10.26 0 0 0 57.16 272l25.68 4.14a5.41 5.41 0 0 1 4.5 4.67c.49 3.16 1 6.42 1.7 9.52a5.52 5.52 0 0 1-2.63 5.85l-22.77 12.67a10.35 10.35 0 0 0-5 12.83l4 10.9a10.33 10.33 0 0 0 12.13 6.51l25.55-4.95a5.49 5.49 0 0 1 5.82 2.81c1.5 2.8 3.11 5.63 4.8 8.42a5.58 5.58 0 0 1-.44 6.5l-17 19.63a10.41 10.41 0 0 0-.5 13.77l7.41 8.91a10.23 10.23 0 0 0 13.58 2l22.37-13.43a5.39 5.39 0 0 1 6.39.63c2.48 2.17 5 4.26 7.37 6.19a5.47 5.47 0 0 1 1.73 6.21l-9.27 24.4a10.35 10.35 0 0 0 4.31 13.07l10.11 5.84a10.3 10.3 0 0 0 13.45-2.82L187 415.92c1.4-1.73 3.6-2.5 5.23-1.84 3.48 1.44 5.81 2.25 9.94 3.63a5.44 5.44 0 0 1 3.75 5.23l-.4 26.05a10.5 10.5 0 0 0 8.57 10.88l11.45 2a10.43 10.43 0 0 0 11.75-7.17l8.5-24.77a5.45 5.45 0 0 1 5.36-3.65h9.75a5.49 5.49 0 0 1 5.3 3.67l8.47 24.67a10.48 10.48 0 0 0 10 7.41 9.74 9.74 0 0 0 1.78-.16l11.47-2a10.46 10.46 0 0 0 8.56-10.79l-.4-26.16a5.43 5.43 0 0 1 3.75-5.2c3.84-1.29 6.54-2.33 8.91-3.25l.6-.23c3.1-1.07 4.6.23 5.47 1.31l16.75 20.63A10.3 10.3 0 0 0 355 439l10.07-5.83a10.35 10.35 0 0 0 4.31-13.1l-9.24-24.34a5.52 5.52 0 0 1 1.69-6.23c2.43-2 4.92-4 7.4-6.22a5.39 5.39 0 0 1 6.38-.62l22.39 13.4a10.39 10.39 0 0 0 13.61-2l7.4-8.9a10.31 10.31 0 0 0-.37-13.75l-17.06-19.67a5.42 5.42 0 0 1-.45-6.45c1.71-2.71 3.34-5.57 4.82-8.44a5.55 5.55 0 0 1 5.86-2.82l25.48 4.97a10.34 10.34 0 0 0 12.14-6.51l3.95-10.88a10.37 10.37 0 0 0-5-12.84l-22.8-12.67a5.4 5.4 0 0 1-2.61-5.89l.24-1.27c.52-2.79 1-5.43 1.46-8.24a5.48 5.48 0 0 1 4.46-4.64l25.69-4.14a10.43 10.43 0 0 0 9.18-10.28v-11.71zm-282.45 94a15.8 15.8 0 0 1-25.47 2.66 135.06 135.06 0 0 1 .42-181.65 15.81 15.81 0 0 1 25.5 2.77l45.65 80.35a15.85 15.85 0 0 1 0 15.74zM256 391.11a134.75 134.75 0 0 1-28.31-3 15.81 15.81 0 0 1-10.23-23.36l46-80a15.79 15.79 0 0 1 13.7-7.93h92.14a15.8 15.8 0 0 1 15.1 20.53c-17.49 54.32-68.4 93.76-128.4 93.76zm7.51-163.9L218 147.07a15.81 15.81 0 0 1 10.31-23.3 134 134 0 0 1 27.69-2.88c60 0 110.91 39.44 128.37 93.79a15.8 15.8 0 0 1-15.1 20.53h-92a15.78 15.78 0 0 1-13.76-8z"},child:[]}]})(e)}function j(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m441 336.2-.06-.05c-9.93-9.18-22.78-11.34-32.16-12.92l-.69-.12c-9.05-1.49-10.48-2.5-14.58-6.17-2.44-2.17-5.35-5.65-5.35-9.94s2.91-7.77 5.34-9.94l30.28-26.87c25.92-22.91 40.2-53.66 40.2-86.59s-14.25-63.68-40.2-86.6c-35.89-31.59-85-49-138.37-49C223.72 48 162 71.37 116 112.11c-43.87 38.77-68 90.71-68 146.24s24.16 107.47 68 146.23c21.75 19.24 47.49 34.18 76.52 44.42a266.17 266.17 0 0 0 86.87 15h1.81c61 0 119.09-20.57 159.39-56.4 9.7-8.56 15.15-20.83 15.34-34.56.21-14.17-5.37-27.95-14.93-36.84zM112 208a32 32 0 1 1 32 32 32 32 0 0 1-32-32zm40 135a32 32 0 1 1 32-32 32 32 0 0 1-32 32zm40-199a32 32 0 1 1 32 32 32 32 0 0 1-32-32zm64 271a48 48 0 1 1 48-48 48 48 0 0 1-48 48zm72-239a32 32 0 1 1 32-32 32 32 0 0 1-32 32z"},child:[]}]})(e)}function U(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72z"},child:[]},{tag:"path",attr:{d:"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80z"},child:[]}]})(e)}function V(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 400a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm128 256a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zM128 272a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0-128a48 48 0 1 0 48 48 48 48 0 0 0-48-48z"},child:[]}]})(e)}function $(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32",d:"m400 148-21.12-24.57A191.43 191.43 0 0 0 240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 0 0 181.07-128"},child:[]},{tag:"path",attr:{d:"M464 97.42V208a16 16 0 0 1-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"},child:[]}]})(e)}function H(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m476.59 227.05-.16-.07L49.35 49.84A23.56 23.56 0 0 0 27.14 52 24.65 24.65 0 0 0 16 72.59v113.29a24 24 0 0 0 19.52 23.57l232.93 43.07a4 4 0 0 1 0 7.86L35.53 303.45A24 24 0 0 0 16 327v113.31A23.57 23.57 0 0 0 26.59 460a23.94 23.94 0 0 0 13.22 4 24.55 24.55 0 0 0 9.52-1.93L476.4 285.94l.19-.09a32 32 0 0 0 0-58.8z"},child:[]}]})(e)}function q(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M384 336a63.78 63.78 0 0 0-46.12 19.7l-148-83.27a63.85 63.85 0 0 0 0-32.86l148-83.27a63.8 63.8 0 1 0-15.73-27.87l-148 83.27a64 64 0 1 0 0 88.6l148 83.27A64 64 0 1 0 384 336z"},child:[]}]})(e)}function K(e){return P({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8z"},child:[]},{tag:"path",attr:{d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32zM192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416zM272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14z"},child:[]}]})(e)}function G(e){return P({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M17.41 6.59 15 5.5l2.41-1.09L18.5 2l1.09 2.41L22 5.5l-2.41 1.09L18.5 9l-1.09-2.41zm3.87 6.13L20.5 11l-.78 1.72-1.72.78 1.72.78.78 1.72.78-1.72L23 13.5l-1.72-.78zm-5.04 1.65 1.94 1.47-2.5 4.33-2.24-.94c-.2.13-.42.26-.64.37l-.3 2.4h-5l-.3-2.41c-.22-.11-.43-.23-.64-.37l-2.24.94-2.5-4.33 1.94-1.47c-.01-.11-.01-.24-.01-.36s0-.25.01-.37l-1.94-1.47 2.5-4.33 2.24.94c.2-.13.42-.26.64-.37L7.5 6h5l.3 2.41c.22.11.43.23.64.37l2.24-.94 2.5 4.33-1.94 1.47c.01.12.01.24.01.37s0 .24-.01.36zM13 14c0-1.66-1.34-3-3-3s-3 1.34-3 3 1.34 3 3 3 3-1.34 3-3z"},child:[]}]})(e)}function W({title:e,onClose:i,onSettings:r}){return n("div",{className:"bmxcb__header",children:[n("div",{className:"bmxcb__header-brand",children:[t("img",{src:"https://www.bmx.trade/images/logo.png",alt:"BMX",className:"bmxcb__header-logo"}),t("span",{className:"bmxcb__header-title",children:e})]}),n("div",{className:"bmxcb__header-actions",children:[t("button",{className:"bmxcb__settings-button",onClick:r,"aria-label":"Open settings",children:t(G,{size:18})}),t("button",{className:"bmxcb__close",onClick:i,"aria-label":"Close",children:t(B,{size:18})})]})]})}function Z(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy((...t)=>e(...t),{get:(n,i)=>"create"===i?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function X(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}!function(e){e.USER="user",e.ASSISTANT="assistant",e.SYSTEM="system"}(C||(C={}));const Y=e=>Array.isArray(e);function Q(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function J(e){return"string"==typeof e||Array.isArray(e)}function ee(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function te(e,t,n,i){if("function"==typeof t){const[r,o]=ee(i);t=t(void 0!==n?n:e.custom,r,o)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[r,o]=ee(i);t=t(void 0!==n?n:e.custom,r,o)}return t}function ne(e,t,n){const i=e.getProps();return te(i,t,void 0!==n?n:i.custom,e)}const ie=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],re=["initial",...ie];function oe(e){let t;return()=>(void 0===t&&(t=e()),t)}const se=oe(()=>void 0!==window.ScrollTimeline);class ae{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map(n=>se()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0);return()=>{n.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class le extends ae{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function ce(e,t){return e?e[t]||e.default||e:void 0}const ue=2e4;function de(e){let t=0,n=e.next(t);for(;!n.done&&t<ue;)t+=50,n=e.next(t);return t>=ue?1/0:t}function he(e){return"function"==typeof e}function pe(e,t){e.timeline=t,e.onfinish=null}const fe=e=>Array.isArray(e)&&"number"==typeof e[0],me={linearEasing:void 0};function ge(e,t){const n=oe(e);return()=>{var e;return null!==(e=me[t])&&void 0!==e?e:n()}}const be=ge(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),ye=(e,t,n)=>{const i=t-e;return 0===i?1:(n-e)/i},ve=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let t=0;t<r;t++)i+=e(ye(0,r-1,t))+", ";return`linear(${i.substring(0,i.length-2)})`};function xe(e){return Boolean("function"==typeof e&&be()||!e||"string"==typeof e&&(e in _e||be())||fe(e)||Array.isArray(e)&&e.every(xe))}const we=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,_e={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:we([0,.65,.55,1]),circOut:we([.55,0,1,.45]),backIn:we([.31,.01,.66,-.59]),backOut:we([.33,1.53,.69,.99])};function ke(e,t){return e?"function"==typeof e&&be()?ve(e,t):fe(e)?we(e):Array.isArray(e)?e.map(e=>ke(e,t)||_e.easeOut):_e[e]:void 0}const Ee={x:!1,y:!1};function Se(){return Ee.x||Ee.y}function Ae(e,t){const n=function(e){if(e instanceof Element)return[e];if("string"==typeof e){let t=document;const n=t.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}(e),i=new AbortController;return[n,{passive:!0,...t,signal:i.signal},()=>i.abort()]}function Ce(e){return t=>{"touch"===t.pointerType||Se()||e(t)}}const Ne=(e,t)=>!!t&&(e===t||Ne(e,t.parentElement)),Me=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Te=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),Oe=new WeakSet;function De(e){return t=>{"Enter"===t.key&&e(t)}}function Ie(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Re(e){return Me(e)&&!Se()}const Pe=e=>1e3*e,Le=e=>e/1e3,Fe=e=>e,Be=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ze=new Set(Be),je=new Set(["width","height","top","left","right","bottom",...Be]),Ue=e=>Y(e)?e[e.length-1]||0:e,Ve=["read","resolveKeyframes","update","preRender","render","postRender"];function $e(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Ve.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,i=!1,r=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){o.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,r=!1,s=!1)=>{const a=s&&i?t:n;return r&&o.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{s=e,i?r=!0:(i=!0,[t,n]=[n,t],t.forEach(a),t.clear(),i=!1,r&&(r=!1,l.process(e)))}};return l}(o),e),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=s,p=()=>{const o=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(o-r.timestamp,40),1),r.timestamp=o,r.isProcessing=!0,a.process(r),l.process(r),c.process(r),u.process(r),d.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(p))};return{schedule:Ve.reduce((t,o)=>{const a=s[o];return t[o]=(t,o=!1,s=!1)=>(n||(n=!0,i=!0,r.isProcessing||e(p)),a.schedule(t,o,s)),t},{}),cancel:e=>{for(let t=0;t<Ve.length;t++)s[Ve[t]].cancel(e)},state:r,steps:s}}const{schedule:He,cancel:qe,state:Ke,steps:Ge}=$e("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Fe,!0);let We;function Ze(){We=void 0}const Xe={now:()=>(void 0===We&&Xe.set(Ke.isProcessing?Ke.timestamp:performance.now()),We),set:e=>{We=e,queueMicrotask(Ze)}};function Ye(e,t){-1===e.indexOf(t)&&e.push(t)}function Qe(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Je{constructor(){this.subscriptions=[]}add(e){return Ye(this.subscriptions,e),()=>Qe(this.subscriptions,e)}notify(e,t,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(let r=0;r<i;r++){const i=this.subscriptions[r];i&&i(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function et(e,t){return t?e*(1e3/t):0}const tt={current:void 0};class nt{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Xe.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Xe.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Je);const n=this.events[e].add(t);return"change"===e?()=>{n(),He.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return tt.current&&tt.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Xe.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return et(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function it(e,t){return new nt(e,t)}function rt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,it(n))}const ot=e=>Boolean(e&&e.getVelocity);function st(e,t){const n=e.getValue("willChange");if(i=n,Boolean(ot(i)&&i.add))return n.add(t);var i}const at=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),lt="data-"+at("framerAppearId");function ct(e){return e.props[lt]}const ut=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function dt(e,t,n,i){if(e===t&&n===i)return Fe;return r=>0===r||1===r?r:ut(function(e,t,n,i,r){let o,s,a=0;do{s=t+(n-t)/2,o=ut(s,i,r)-e,o>0?n=s:t=s}while(Math.abs(o)>1e-7&&++a<12);return s}(r,0,1,e,n),t,i)}const ht=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pt=e=>t=>1-e(1-t),ft=dt(.33,1.53,.69,.99),mt=pt(ft),gt=ht(mt),bt=e=>(e*=2)<1?.5*mt(e):.5*(2-Math.pow(2,-10*(e-1))),yt=e=>1-Math.sin(Math.acos(e)),vt=pt(yt),xt=ht(yt),wt=e=>/^0[^.\s]+$/u.test(e);function _t(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||wt(e)}const kt=(e,t,n)=>n>t?t:n<e?e:n,Et={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},St={...Et,transform:e=>kt(0,1,e)},At={...Et,default:1},Ct=e=>Math.round(1e5*e)/1e5,Nt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Mt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Tt=(e,t)=>n=>Boolean("string"==typeof n&&Mt.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ot=(e,t,n)=>i=>{if("string"!=typeof i)return i;const[r,o,s,a]=i.match(Nt);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Dt={...Et,transform:e=>Math.round((e=>kt(0,255,e))(e))},It={test:Tt("rgb","red"),parse:Ot("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Dt.transform(e)+", "+Dt.transform(t)+", "+Dt.transform(n)+", "+Ct(St.transform(i))+")"},Rt={test:Tt("#"),parse:function(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:It.transform},Pt=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Lt=Pt("deg"),Ft=Pt("%"),Bt=Pt("px"),zt=Pt("vh"),jt=Pt("vw"),Ut={...Ft,parse:e=>Ft.parse(e)/100,transform:e=>Ft.transform(100*e)},Vt={test:Tt("hsl","hue"),parse:Ot("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Ft.transform(Ct(t))+", "+Ft.transform(Ct(n))+", "+Ct(St.transform(i))+")"},$t={test:e=>It.test(e)||Rt.test(e)||Vt.test(e),parse:e=>It.test(e)?It.parse(e):Vt.test(e)?Vt.parse(e):Rt.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?It.transform(e):Vt.transform(e)},Ht=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,qt="number",Kt="color",Gt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wt(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const s=t.replace(Gt,e=>($t.test(e)?(i.color.push(o),r.push(Kt),n.push($t.parse(e))):e.startsWith("var(")?(i.var.push(o),r.push("var"),n.push(e)):(i.number.push(o),r.push(qt),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:s,indexes:i,types:r}}function Zt(e){return Wt(e).values}function Xt(e){const{split:t,types:n}=Wt(e),i=t.length;return e=>{let r="";for(let o=0;o<i;o++)if(r+=t[o],void 0!==e[o]){const t=n[o];r+=t===qt?Ct(e[o]):t===Kt?$t.transform(e[o]):e[o]}return r}}const Yt=e=>"number"==typeof e?0:e,Qt={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Nt))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Ht))||void 0===n?void 0:n.length)||0)>0},parse:Zt,createTransformer:Xt,getAnimatableNone:function(e){const t=Zt(e);return Xt(e)(t.map(Yt))}},Jt=new Set(["brightness","contrast","saturate","opacity"]);function en(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[i]=n.match(Nt)||[];if(!i)return e;const r=n.replace(i,"");let o=Jt.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+r+")"}const tn=/\b([a-z-]*)\(.*?\)/gu,nn={...Qt,getAnimatableNone:e=>{const t=e.match(tn);return t?t.map(en).join(" "):e}},rn={borderWidth:Bt,borderTopWidth:Bt,borderRightWidth:Bt,borderBottomWidth:Bt,borderLeftWidth:Bt,borderRadius:Bt,radius:Bt,borderTopLeftRadius:Bt,borderTopRightRadius:Bt,borderBottomRightRadius:Bt,borderBottomLeftRadius:Bt,width:Bt,maxWidth:Bt,height:Bt,maxHeight:Bt,top:Bt,right:Bt,bottom:Bt,left:Bt,padding:Bt,paddingTop:Bt,paddingRight:Bt,paddingBottom:Bt,paddingLeft:Bt,margin:Bt,marginTop:Bt,marginRight:Bt,marginBottom:Bt,marginLeft:Bt,backgroundPositionX:Bt,backgroundPositionY:Bt},on={rotate:Lt,rotateX:Lt,rotateY:Lt,rotateZ:Lt,scale:At,scaleX:At,scaleY:At,scaleZ:At,skew:Lt,skewX:Lt,skewY:Lt,distance:Bt,translateX:Bt,translateY:Bt,translateZ:Bt,x:Bt,y:Bt,z:Bt,perspective:Bt,transformPerspective:Bt,opacity:St,originX:Ut,originY:Ut,originZ:Bt},sn={...Et,transform:Math.round},an={...rn,...on,zIndex:sn,size:Bt,fillOpacity:St,strokeOpacity:St,numOctaves:sn},ln={...an,color:$t,backgroundColor:$t,outlineColor:$t,fill:$t,stroke:$t,borderColor:$t,borderTopColor:$t,borderRightColor:$t,borderBottomColor:$t,borderLeftColor:$t,filter:nn,WebkitFilter:nn},cn=e=>ln[e];function un(e,t){let n=cn(e);return n!==nn&&(n=Qt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const dn=new Set(["auto","none","0"]),hn=e=>e===Et||e===Bt,pn=(e,t)=>parseFloat(e.split(", ")[t]),fn=(e,t)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return pn(r[1],t);{const t=i.match(/^matrix\((.+)\)$/u);return t?pn(t[1],e):0}},mn=new Set(["x","y","z"]),gn=Be.filter(e=>!mn.has(e)),bn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:fn(4,13),y:fn(5,14)};bn.translateX=bn.x,bn.translateY=bn.y;const yn=new Set;let vn=!1,xn=!1;function wn(){if(xn){const e=Array.from(yn).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return gn.forEach(n=>{const i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{var i;null===(i=e.getValue(t))||void 0===i||i.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}xn=!1,vn=!1,yn.forEach(e=>e.complete()),yn.clear()}function _n(){yn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xn=!0)})}class kn{constructor(e,t,n,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(yn.add(this),vn||(vn=!0,He.read(_n),He.resolveKeyframes(wn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:i}=this;for(let r=0;r<e.length;r++)if(null===e[r])if(0===r){const r=null==i?void 0:i.get(),o=e[e.length-1];if(void 0!==r)e[0]=r;else if(n&&t){const i=n.readValue(t,o);null!=i&&(e[0]=i)}void 0===e[0]&&(e[0]=o),i&&void 0===r&&i.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),yn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,yn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let En=Fe,Sn=Fe;const An=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Cn=e=>t=>"string"==typeof t&&t.startsWith(e),Nn=Cn("--"),Mn=Cn("var(--"),Tn=e=>!!Mn(e)&&On.test(e.split("/*")[0].trim()),On=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Dn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function In(e,t,n=1){Sn(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[i,r]=function(e){const t=Dn.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${null!=n?n:i}`,r]}(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const e=o.trim();return An(e)?parseFloat(e):e}return Tn(r)?In(r,t,n+1):r}const Rn=e=>t=>t.test(e),Pn=[Et,Bt,Ft,Lt,jt,zt,{test:e=>"auto"===e,parse:e=>e}],Ln=e=>Pn.find(Rn(e));class Fn extends kn{constructor(e,t,n,i,r){super(e,t,n,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let i=e[n];if("string"==typeof i&&(i=i.trim(),Tn(i))){const r=In(i,t.current);void 0!==r&&(e[n]=r),n===e.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!je.has(n)||2!==e.length)return;const[i,r]=e,o=Ln(i),s=Ln(r);if(o!==s)if(hn(o)&&hn(s))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)_t(e[t])&&n.push(t);n.length&&function(e,t,n){let i,r=0;for(;r<e.length&&!i;){const t=e[r];"string"==typeof t&&!dn.has(t)&&Wt(t).values.length&&(i=e[r]),r++}if(i&&n)for(const r of t)e[r]=un(n,i)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=bn[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const i=t[t.length-1];void 0!==i&&e.getValue(n,i).jump(i,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=bn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Bn=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Qt.test(e)&&"0"!==e||e.startsWith("url(")));function zn(e,t,n,i){const r=e[0];if(null===r)return!1;if("display"===t||"visibility"===t)return!0;const o=e[e.length-1],s=Bn(r,t),a=Bn(o,t);return En(s===a,`You are trying to animate ${t} from "${r}" to "${o}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${o} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||he(n))&&i)}const jn=e=>null!==e;function Un(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(jn),o=t&&"loop"!==n&&t%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}class Vn{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Xe.now(),this.options={autoplay:e,delay:t,type:n,repeat:i,repeatDelay:r,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(_n(),wn()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Xe.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:r,delay:o,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!zn(e,n,i,r)){if(!o)return a&&a(Un(e,this.options,t)),s&&s(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const $n=(e,t,n)=>e+(t-e)*n;function Hn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qn(e,t){return n=>n>0?t:e}const Kn=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},Gn=[Rt,It,Vt];function Wn(e){const t=(n=e,Gn.find(e=>e.test(n)));var n;if(En(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let i=t.parse(e);return t===Vt&&(i=function({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,n/=100;let r=0,o=0,s=0;if(t/=100){const i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;r=Hn(a,i,e+1/3),o=Hn(a,i,e),s=Hn(a,i,e-1/3)}else r=o=s=n;return{red:Math.round(255*r),green:Math.round(255*o),blue:Math.round(255*s),alpha:i}}(i)),i}const Zn=(e,t)=>{const n=Wn(e),i=Wn(t);if(!n||!i)return qn(e,t);const r={...n};return e=>(r.red=Kn(n.red,i.red,e),r.green=Kn(n.green,i.green,e),r.blue=Kn(n.blue,i.blue,e),r.alpha=$n(n.alpha,i.alpha,e),It.transform(r))},Xn=(e,t)=>n=>t(e(n)),Yn=(...e)=>e.reduce(Xn),Qn=new Set(["none","hidden"]);function Jn(e,t){return n=>$n(e,t,n)}function ei(e){return"number"==typeof e?Jn:"string"==typeof e?Tn(e)?qn:$t.test(e)?Zn:ii:Array.isArray(e)?ti:"object"==typeof e?$t.test(e)?Zn:ni:qn}function ti(e,t){const n=[...e],i=n.length,r=e.map((e,n)=>ei(e)(e,t[n]));return e=>{for(let t=0;t<i;t++)n[t]=r[t](e);return n}}function ni(e,t){const n={...e,...t},i={};for(const r in n)void 0!==e[r]&&void 0!==t[r]&&(i[r]=ei(e[r])(e[r],t[r]));return e=>{for(const t in i)n[t]=i[t](e);return n}}const ii=(e,t)=>{const n=Qt.createTransformer(t),i=Wt(e),r=Wt(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Qn.has(e)&&!r.values.length||Qn.has(t)&&!i.values.length?function(e,t){return Qn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Yn(ti(function(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],a=e.indexes[s][r[s]],l=null!==(n=e.values[a])&&void 0!==n?n:0;i[o]=l,r[s]++}return i}(i,r),r.values),n):(En(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),qn(e,t))};function ri(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?$n(e,t,n):ei(e)(e,t)}function oi(e,t,n){const i=Math.max(t-5,0);return et(n-e(i),t-i)}const si=.01,ai=2,li=.005,ci=.5;const ui=12;function di(e,t){return e*Math.sqrt(1-t*t)}const hi=["duration","bounce"],pi=["stiffness","damping","mass"];function fi(e,t){return t.some(t=>void 0!==e[t])}function mi(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!fi(e,pi)&&fi(e,hi))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(1.2*n),r=i*i,o=2*kt(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:1,stiffness:r,damping:o}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:i=1}){let r,o;En(e<=Pe(10),"Spring duration must be 10 seconds or less");let s=1-t;s=kt(.05,1,s),e=kt(.01,10,Le(e)),s<1?(r=t=>{const i=t*s,r=i*e;return.001-(i-n)/di(t,s)*Math.exp(-r)},o=t=>{const i=t*s*e,o=i*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-i),c=di(Math.pow(t,2),s);return(.001-r(t)>0?-1:1)*((o-a)*l)/c}):(r=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let i=n;for(let n=1;n<ui;n++)i-=e(i)/t(i);return i}(r,o,5/e);if(e=Pe(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,2)*i;return{stiffness:t,damping:2*s*Math.sqrt(i*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Le(n.velocity||0)}),f=h||0,m=c/(2*Math.sqrt(l*u)),g=s-o,b=Le(Math.sqrt(l/u)),y=Math.abs(g)<5;let v;if(i||(i=y?si:ai),r||(r=y?li:ci),m<1){const e=di(b,m);v=t=>{const n=Math.exp(-m*b*t);return s-n*((f+m*b*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)v=e=>s-Math.exp(-b*e)*(g+(f+b*g)*e);else{const e=b*Math.sqrt(m*m-1);v=t=>{const n=Math.exp(-m*b*t),i=Math.min(e*t,300);return s-n*((f+m*b*g)*Math.sinh(i)+e*g*Math.cosh(i))/e}}const x={calculatedDuration:p&&d||null,next:e=>{const t=v(e);if(p)a.done=e>=d;else{let n=0;m<1&&(n=0===e?Pe(f):oi(v,e,t));const o=Math.abs(n)<=i,l=Math.abs(s-t)<=r;a.done=o&&l}return a.value=a.done?s:t,a},toString:()=>{const e=Math.min(de(x),ue),t=ve(t=>x.next(e*t).value,e,30);return e+"ms "+t}};return x}function gi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let f=n*t;const m=d+f,g=void 0===s?m:s(m);g!==m&&(f=g-d);const b=e=>-f*Math.exp(-e/i),y=e=>g+b(e),v=e=>{const t=b(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let x,w;const _=e=>{var t;t=h.value,(void 0!==a&&t<a||void 0!==l&&t>l)&&(x=e,w=mi({keyframes:[h.value,p(h.value)],velocity:oi(y,e,h.value),damping:r,stiffness:o,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,v(e),_(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&v(e),h)}}}const bi=dt(.42,0,1,1),yi=dt(0,0,.58,1),vi=dt(.42,0,.58,1),xi={linear:Fe,easeIn:bi,easeInOut:vi,easeOut:yi,circIn:yt,circInOut:xt,circOut:vt,backIn:mt,backInOut:gt,backOut:ft,anticipate:bt},wi=e=>{if(fe(e)){Sn(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,i,r]=e;return dt(t,n,i,r)}return"string"==typeof e?(Sn(void 0!==xi[e],`Invalid easing type '${e}'`),xi[e]):e};function _i({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=(e=>Array.isArray(e)&&"number"!=typeof e[0])(i)?i.map(wi):wi(i),o={done:!1,value:t[0]},s=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=ye(0,t,i);e.push($n(n,1,r))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:i,mixer:r}={}){const o=e.length;if(Sn(o===t.length,"Both input and output ranges must be the same length"),1===o)return()=>t[0];if(2===o&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const i=[],r=n||ri,o=e.length-1;for(let n=0;n<o;n++){let o=r(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||Fe:t;o=Yn(e,o)}i.push(o)}return i}(t,i,r),l=a.length,c=n=>{if(s&&n<e[0])return t[0];let i=0;if(l>1)for(;i<e.length-2&&!(n<e[i+1]);i++);const r=ye(e[i],e[i+1],n);return a[i](r)};return n?t=>c(kt(e[0],e[o-1],t)):c}(s,t,{ease:Array.isArray(r)?r:(l=t,c=r,l.map(()=>c||vi).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(o.value=a(t),o.done=t>=e,o)}}const ki=e=>{const t=({timestamp:t})=>e(t);return{start:()=>He.update(t,!0),stop:()=>qe(t),now:()=>Ke.isProcessing?Ke.timestamp:Xe.now()}},Ei={decay:gi,inertia:gi,tween:_i,keyframes:_i,spring:mi},Si=e=>e/100;class Ai extends Vn{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:i,keyframes:r}=this.options,o=(null==i?void 0:i.KeyframeResolver)||kn;this.resolver=new o(r,(e,t)=>this.onKeyframesResolved(e,t),t,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,s=he(t)?t:Ei[t]||_i;let a,l;s!==_i&&"number"!=typeof e[0]&&(a=Yn(Si,ri(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===r&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-o})),null===c.calculatedDuration&&(c.calculatedDuration=de(c));const{calculatedDuration:u}=c,d=u+i;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-i}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return r.next(0);const{delay:d,repeat:h,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),b=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,v=r;if(h){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,h+1),Boolean(t%2)&&("reverse"===p?(n=1-n,f&&(n-=f/u)):"mirror"===p&&(v=o)),y=kt(0,1,n)*u}const x=b?{done:!1,value:a[0]}:v.next(y);s&&(x.value=s(x.value));let{done:w}=x;b||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==i&&(x.value=Un(a,this.options,i)),m&&m(x.value),_&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Le(e.calculatedDuration):0}get time(){return Le(this.currentTime)}set time(e){e=Pe(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Le(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=ki,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Ci=new Set(["opacity","clipPath","filter","transform"]),Ni=oe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Mi={anticipate:bt,backInOut:gt,circInOut:xt};class Ti extends Vn{constructor(e){super(e);const{name:t,motionValue:n,element:i,keyframes:r}=this.options;this.resolver=new Fn(r,(e,t)=>this.onKeyframesResolved(e,t),t,n,i),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:i,ease:r,type:o,motionValue:s,name:a,startTime:l}=this.options;if(!s.owner||!s.owner.current)return!1;var c;if("string"==typeof r&&be()&&r in Mi&&(r=Mi[r]),he((c=this.options).type)||"spring"===c.type||!xe(c.ease)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new Ai({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),r.push(i.value),o+=10;return{times:void 0,keyframes:r,duration:o-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,i=u.times,r=u.ease,o="keyframes"}const u=function(e,t,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=ke(a,r);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(s.owner.current,a,e,{...this.options,duration:n,times:i,ease:r});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(pe(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;s.set(Un(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:n,times:i,type:o,ease:r,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Le(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Le(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Pe(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Fe;const{animation:n}=t;pe(n,e)}else this.pendingTimeline=e;return Fe}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:i,type:r,ease:o,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new Ai({...c,keyframes:n,duration:i,type:r,ease:o,times:s,isGenerator:!0}),d=Pe(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:r,damping:o,type:s}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return Ni()&&n&&Ci.has(n)&&!a&&!l&&!i&&"mirror"!==r&&0!==o&&"inertia"!==s}}const Oi={type:"spring",stiffness:500,damping:25,restSpeed:10},Di={type:"keyframes",duration:.8},Ii={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ri=(e,{keyframes:t})=>t.length>2?Di:ze.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Oi:Ii,Pi=(e,t,n,i={},r,o)=>s=>{const a=ce(i,e)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=Pe(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:r};(function({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...Ri(e,u)}),u.duration&&(u.duration=Pe(u.duration)),u.repeatDelay&&(u.repeatDelay=Pe(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!o&&void 0!==t.get()){const e=Un(u.keyframes,a);if(void 0!==e)return He.update(()=>{u.onUpdate(e),u.onComplete()}),new le([])}return!o&&Ti.supports(u)?new Ti(u):new Ai(u)};function Li({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,i}function Fi(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;i&&(s=i);const c=[],u=r&&e.animationState&&e.animationState.getState()[r];for(const t in l){const i=e.getValue(t,null!==(o=e.latestValues[t])&&void 0!==o?o:null),r=l[t];if(void 0===r||u&&Li(u,t))continue;const a={delay:n,...ce(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=ct(e);if(n){const e=window.MotionHandoffAnimation(n,t,He);null!==e&&(a.startTime=e,d=!0)}}st(e,t),i.start(Pi(t,i,r,e.shouldReduceMotion&&je.has(t)?{type:!1}:a,e,d));const h=i.animation;h&&c.push(h)}return a&&Promise.all(c).then(()=>{He.update(()=>{a&&function(e,t){const n=ne(e,t);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const t in o)rt(e,t,Ue(o[t]))}(e,a)})}),c}function Bi(e,t,n={}){var i;const r=ne(e,t,"exit"===n.type?null===(i=e.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Fi(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:s,staggerDirection:a}=o;return function(e,t,n=0,i=0,r=1,o){const s=[],a=(e.variantChildren.size-1)*i,l=1===r?(e=0)=>e*i:(e=0)=>a-e*i;return Array.from(e.variantChildren).sort(zi).forEach((e,i)=>{e.notify("AnimationStart",t),s.push(Bi(e,t,{...o,delay:n+l(i)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(s)}(e,t,r+i,s,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then(()=>t())}return Promise.all([s(),a(n.delay)])}function zi(e,t){return e.sortNodePosition(t)}const ji=re.length;function Ui(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Ui(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<ji;n++){const i=re[n],r=e.props[i];(J(r)||!1===r)&&(t[i]=r)}return t}const Vi=[...ie].reverse(),$i=ie.length;function Hi(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let i;if(e.notify("AnimationStart",t),Array.isArray(t)){const r=t.map(t=>Bi(e,t,n));i=Promise.all(r)}else if("string"==typeof t)i=Bi(e,t,n);else{const r="function"==typeof t?ne(e,t,n.custom):t;i=Promise.all(Fi(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=Gi(),i=!0;const r=t=>(n,i)=>{var r;const o=ne(e,i,"exit"===t?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);if(o){const{transition:e,transitionEnd:t,...i}=o;n={...n,...i,...t}}return n};function o(o){const{props:s}=e,a=Ui(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<$i;t++){const h=Vi[t],p=n[h],f=void 0!==s[h]?s[h]:a[h],m=J(f),g=h===o?p.isActive:null;!1===g&&(d=t);let b=f===a[h]&&f!==s[h]&&m;if(b&&i&&e.manuallyAnimateOnMount&&(b=!1),p.protectedKeys={...u},!p.isActive&&null===g||!f&&!p.prevProp||X(f)||"boolean"==typeof f)continue;const y=qi(p.prevProp,f);let v=y||h===o&&p.isActive&&!b&&m||t>d&&m,x=!1;const w=Array.isArray(f)?f:[f];let _=w.reduce(r(h),{});!1===g&&(_={});const{prevResolvedValues:k={}}=p,E={...k,..._},S=t=>{v=!0,c.has(t)&&(x=!0,c.delete(t)),p.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in E){const t=_[e],n=k[e];if(u.hasOwnProperty(e))continue;let i=!1;i=Y(t)&&Y(n)?!Q(t,n):t!==n,i?null!=t?S(e):c.add(e):void 0!==t&&c.has(e)?S(e):p.protectedKeys[e]=!0}p.prevProp=f,p.prevResolvedValues=_,p.isActive&&(u={...u,..._}),i&&e.blockInitialAnimation&&(v=!1),v&&(!b||!y||x)&&l.push(...w.map(e=>({animation:e,options:{type:h}})))}if(c.size){const t={};c.forEach(n=>{const i=e.getBaseTarget(n),r=e.getValue(n);r&&(r.liveStyle=!0),t[n]=null!=i?i:null}),l.push({animation:t})}let h=Boolean(l.length);return!i||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(h=!1),i=!1,h?t(l):Promise.resolve()}return{animateChanges:o,setActive:function(t,i){var r;if(n[t].isActive===i)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,i)}),n[t].isActive=i;const s=o(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Gi(),i=!0}}}function qi(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Q(t,e)}function Ki(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Gi(){return{animate:Ki(!0),whileInView:Ki(),whileHover:Ki(),whileTap:Ki(),whileDrag:Ki(),whileFocus:Ki(),exit:Ki()}}class Wi{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Zi=0;const Xi={animation:{Feature:class extends Wi{constructor(e){super(e),e.animationState||(e.animationState=Hi(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();X(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Wi{constructor(){super(...arguments),this.id=Zi++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function Yi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function Qi(e){return{point:{x:e.pageX,y:e.pageY}}}function Ji(e,t,n,i){return Yi(e,t,(e=>t=>Me(t)&&e(t,Qi(t)))(n),i)}const er=(e,t)=>Math.abs(e-t);class tr{constructor(e,t,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=rr(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=er(e.x,t.x),i=er(e.y,t.y);return Math.sqrt(n**2+i**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:i}=e,{timestamp:r}=Ke;this.history.push({...i,timestamp:r});const{onStart:o,onMove:s}=this.handlers;t||(o&&o(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=nr(t,this.transformPagePoint),He.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:r}=this.handlers;if(this.dragSnapToOrigin&&r&&r(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=rr("pointercancel"===e.type?this.lastMoveEventInfo:nr(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),i&&i(e,o)},!Me(e))return;this.dragSnapToOrigin=r,this.handlers=t,this.transformPagePoint=n,this.contextWindow=i||window;const o=nr(Qi(e),this.transformPagePoint),{point:s}=o,{timestamp:a}=Ke;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,rr(o,this.history)),this.removeListeners=Yn(Ji(this.contextWindow,"pointermove",this.handlePointerMove),Ji(this.contextWindow,"pointerup",this.handlePointerUp),Ji(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),qe(this.updatePoint)}}function nr(e,t){return t?{point:t(e.point)}:e}function ir(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rr({point:e},t){return{point:e,delta:ir(e,sr(t)),offset:ir(e,or(t)),velocity:ar(t,.1)}}function or(e){return e[0]}function sr(e){return e[e.length-1]}function ar(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=sr(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Pe(t)));)n--;if(!i)return{x:0,y:0};const o=Le(r.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const s={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function lr(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function cr(e){return e.max-e.min}function ur(e,t,n,i=.5){e.origin=i,e.originPoint=$n(t.min,t.max,e.origin),e.scale=cr(n)/cr(t),e.translate=$n(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function dr(e,t,n,i){ur(e.x,t.x,n.x,i?i.originX:void 0),ur(e.y,t.y,n.y,i?i.originY:void 0)}function hr(e,t,n){e.min=n.min+t.min,e.max=e.min+cr(t)}function pr(e,t,n){e.min=t.min-n.min,e.max=e.min+cr(t)}function fr(e,t,n){pr(e.x,t.x,n.x),pr(e.y,t.y,n.y)}function mr(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function gr(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}const br=.35;function yr(e,t,n){return{min:vr(e,t),max:vr(e,n)}}function vr(e,t){return"number"==typeof e?e:e[t]||0}const xr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function wr(e){return[e("x"),e("y")]}function _r({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function kr(e){return void 0===e||1===e}function Er({scale:e,scaleX:t,scaleY:n}){return!kr(e)||!kr(t)||!kr(n)}function Sr(e){return Er(e)||Ar(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ar(e){return Cr(e.x)||Cr(e.y)}function Cr(e){return e&&"0%"!==e}function Nr(e,t,n){return n+t*(e-n)}function Mr(e,t,n,i,r){return void 0!==r&&(e=Nr(e,r,i)),Nr(e,n,i)+t}function Tr(e,t=0,n=1,i,r){e.min=Mr(e.min,t,n,i,r),e.max=Mr(e.max,t,n,i,r)}function Or(e,{x:t,y:n}){Tr(e.x,t.translate,t.scale,t.originPoint),Tr(e.y,n.translate,n.scale,n.originPoint)}const Dr=.999999999999,Ir=1.0000000000001;function Rr(e,t){e.min=e.min+t,e.max=e.max+t}function Pr(e,t,n,i,r=.5){Tr(e,t,n,$n(e.min,e.max,r),i)}function Lr(e,t){Pr(e.x,t.x,t.scaleX,t.scale,t.originX),Pr(e.y,t.y,t.scaleY,t.scale,t.originY)}function Fr(e,t){return _r(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}const Br=({current:e})=>e?e.ownerDocument.defaultView:null,zr=new WeakMap;class jr{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new tr(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Qi(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:i,onDragStart:r}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?Ee[o]?null:(Ee[o]=!0,()=>{Ee[o]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wr(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Ft.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[e];i&&(t=cr(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),r&&He.postRender(()=>r(e,t)),st(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:r,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:s}=t;if(i&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&r&&r(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),o&&o(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>wr(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:Br(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=t;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&He.postRender(()=>r(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:i}=this.getProps();if(!n||!Ur(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=function(e,{min:t,max:n},i){return void 0!==t&&e<t?e=i?$n(t,e,i.min):Math.max(e,t):void 0!==n&&e>n&&(e=i?$n(n,e,i.max):Math.min(e,n)),e}(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,r=this.constraints;t&&lr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(e,{top:t,left:n,bottom:i,right:r}){return{x:mr(e.x,n,r),y:mr(e.y,t,i)}}(i.layoutBox,t),this.elastic=function(e=br){return!1===e?e=0:!0===e&&(e=br),{x:yr(e,"left","right"),y:yr(e,"top","bottom")}}(n),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&wr(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(i.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!lr(e))return!1;const n=e.current;Sn(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=function(e,t,n){const i=Fr(e,n),{scroll:r}=t;return r&&(Rr(i.x,r.offset.x),Rr(i.y,r.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(e,t){return{x:gr(e.x,t.x),y:gr(e.y,t.y)}}(i.layout.layoutBox,r);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=_r(e))}return o}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=wr(s=>{if(!Ur(s,t,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...r,...l};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return st(this.visualElement,e),n.start(Pi(e,n,0,t,this.visualElement,!1))}stopAnimation(){wr(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){wr(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){wr(t=>{const{drag:n}=this.getProps();if(!Ur(t,n,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(t);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[t];r.set(e[t]-$n(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!lr(t)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};wr(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();i[e]=function(e,t){let n=.5;const i=cr(e),r=cr(t);return r>i?n=ye(t.min,t.max-i,e.min):i>r&&(n=ye(e.min,e.max-r,t.min)),kt(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),wr(t=>{if(!Ur(t,e,null))return;const n=this.getAxisMotionValue(t),{min:r,max:o}=this.constraints[t];n.set($n(r,o,i[t]))})}addListeners(){if(!this.visualElement.current)return;zr.set(this.visualElement,this);const e=Ji(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();lr(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),He.read(t);const r=Yi(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(wr(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=br,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:s}}}function Ur(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Vr=e=>(t,n)=>{e&&He.postRender(()=>e(t,n))},$r=s(null),Hr=s({}),qr=s({}),Kr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gr(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wr={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Bt.test(e))return e;e=parseFloat(e)}return`${Gr(e,t.target.x)}% ${Gr(e,t.target.y)}%`}},Zr={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=Qt.parse(e);if(r.length>5)return i;const o=Qt.createTransformer(e),s="number"!=typeof r[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;r[0+s]/=a,r[1+s]/=l;const c=$n(a,l,.5);return"number"==typeof r[2+s]&&(r[2+s]/=c),"number"==typeof r[3+s]&&(r[3+s]/=c),o(r)}},Xr={},{schedule:Yr,cancel:Qr}=$e(queueMicrotask,!1);class Jr extends r{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:i}=this.props,{projection:r}=e;var o;o=to,Object.assign(Xr,o),r&&(t.group&&t.group.add(r),n&&n.register&&i&&n.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),Kr.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:i,isPresent:r}=this.props,o=n.projection;return o?(o.isPresent=r,i||e.layoutDependency!==t||void 0===t?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||He.postRender(()=>{const e=o.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Yr.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function eo(e){const[n,i]=function(e=!0){const t=d($r);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,o=p();h(()=>{e&&r(o)},[e]);const s=u(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,s]:[!0]}(),r=d(Hr);return t(Jr,{...e,layoutGroup:r,switchLayoutGroup:d(qr),isPresent:n,safeToRemove:i})}const to={borderRadius:{...Wr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wr,borderTopRightRadius:Wr,borderBottomLeftRadius:Wr,borderBottomRightRadius:Wr,boxShadow:Zr},no=(e,t)=>e.depth-t.depth;class io{constructor(){this.children=[],this.isDirty=!1}add(e){Ye(this.children,e),this.isDirty=!0}remove(e){Qe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(no),this.isDirty=!1,this.children.forEach(e)}}function ro(e){const t=ot(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const oo=["TopLeft","TopRight","BottomLeft","BottomRight"],so=oo.length,ao=e=>"string"==typeof e?parseFloat(e):e,lo=e=>"number"==typeof e||Bt.test(e);function co(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const uo=po(0,.5,vt),ho=po(.5,.95,Fe);function po(e,t,n){return i=>i<e?0:i>t?1:n(ye(e,t,i))}function fo(e,t){e.min=t.min,e.max=t.max}function mo(e,t){fo(e.x,t.x),fo(e.y,t.y)}function go(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function bo(e,t,n,i,r){return e=Nr(e-=t,1/n,i),void 0!==r&&(e=Nr(e,1/r,i)),e}function yo(e,t,[n,i,r],o,s){!function(e,t=0,n=1,i=.5,r,o=e,s=e){if(Ft.test(t)&&(t=parseFloat(t),t=$n(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=$n(o.min,o.max,i);e===o&&(a-=t),e.min=bo(e.min,t,n,a,r),e.max=bo(e.max,t,n,a,r)}(e,t[n],t[i],t[r],t.scale,o,s)}const vo=["x","scaleX","originX"],xo=["y","scaleY","originY"];function wo(e,t,n,i){yo(e.x,t,vo,n?n.x:void 0,i?i.x:void 0),yo(e.y,t,xo,n?n.y:void 0,i?i.y:void 0)}function _o(e){return 0===e.translate&&1===e.scale}function ko(e){return _o(e.x)&&_o(e.y)}function Eo(e,t){return e.min===t.min&&e.max===t.max}function So(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ao(e,t){return So(e.x,t.x)&&So(e.y,t.y)}function Co(e){return cr(e.x)/cr(e.y)}function No(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Mo{constructor(){this.members=[]}add(e){Ye(this.members,e),e.scheduleRender()}remove(e){if(Qe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const To={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Oo="undefined"!=typeof window&&void 0!==window.MotionDebug,Do=["","X","Y","Z"],Io={visibility:"hidden"};let Ro=0;function Po(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function Lo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ct(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",He,!(t||i))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&Lo(i)}function Fo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Ro++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Oo&&(To.totalNodes=To.resolvedTargetDeltas=To.recalculatedProjection=0),this.nodes.forEach(jo),this.nodes.forEach(Go),this.nodes.forEach(Wo),this.nodes.forEach(Uo),Oo&&window.MotionDebug.record(To)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new io)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Je),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var i;this.isSVG=(i=t)instanceof SVGElement&&"svg"!==i.tagName,this.instance=t;const{layoutId:r,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||r)&&(this.isLayoutDirty=!0),e){let n;const i=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Xe.now(),i=({timestamp:r})=>{const o=r-n;o>=t&&(qe(i),e(o-t))};return He.read(i,!0),()=>qe(i)}(i,250),Kr.hasAnimatedSinceResize&&(Kr.hasAnimatedSinceResize=!1,this.nodes.forEach(Ko))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const r=this.options.transition||s.getDefaultTransition()||es,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Ao(this.targetLayout,i)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...ce(r,"layout"),onPlay:o,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Ko(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,qe(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Zo),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Lo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach($o);this.isUpdating||this.nodes.forEach(Ho),this.isUpdating=!1,this.nodes.forEach(qo),this.nodes.forEach(Bo),this.nodes.forEach(zo),this.clearAllSnapshots();const e=Xe.now();Ke.delta=kt(0,1e3/60,e-Ke.timestamp),Ke.timestamp=e,Ke.isProcessing=!0,Ge.update.process(Ke),Ge.preRender.process(Ke),Ge.render.process(Ke),Ke.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Yr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Vo),this.sharedNodes.forEach(Xo)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,He.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){He.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=i(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!r)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!ko(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;e&&(t||Sr(this.latestValues)||o)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var i;return e&&(n=this.removeTransform(n)),is((i=n).x),is(i.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(os)){const{scroll:e}=this.root;e&&(Rr(n.x,e.offset.x),Rr(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(mo(n,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return n;for(let t=0;t<this.path.length;t++){const i=this.path[t],{scroll:r,options:o}=i;i!==this.root&&r&&o.layoutScroll&&(r.wasRoot&&mo(n,e),Rr(n.x,r.offset.x),Rr(n.y,r.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};mo(n,e);for(let e=0;e<this.path.length;e++){const i=this.path[e];!t&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Lr(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Sr(i.latestValues)&&Lr(n,i.latestValues)}return Sr(this.latestValues)&&Lr(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};mo(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!n.instance)continue;if(!Sr(n.latestValues))continue;Er(n.latestValues)&&n.updateSnapshot();const i=xr();mo(i,n.measurePageBox()),wo(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Sr(this.latestValues)&&wo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ke.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(e||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:r,layoutId:o}=this.options;if(this.layout&&(r||o)){if(this.resolvedRelativeTargetAt=Ke.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},fr(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),mo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,hr(s.x,a.x,l.x),hr(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):mo(this.target,this.layout.layoutBox),Or(this.target,this.targetDelta)):mo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},fr(this.relativeTargetOrigin,this.target,e.target),mo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Oo&&To.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!Er(this.parent.latestValues)&&!Ar(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===Ke.timestamp&&(i=!1),i)return;const{layout:r,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!o)return;mo(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,i=!1){const r=n.length;if(!r)return;let o,s;t.x=t.y=1;for(let a=0;a<r;a++){o=n[a],s=o.projectionDelta;const{visualElement:r}=o.options;r&&r.props.style&&"contents"===r.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Lr(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Or(e,s)),i&&Sr(o.latestValues)&&Lr(e,o.latestValues))}t.x<Ir&&t.x>Dr&&(t.x=1),t.y<Ir&&t.y>Dr&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(go(this.prevProjectionDelta.x,this.projectionDelta.x),go(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),dr(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&No(this.projectionDelta.x,this.prevProjectionDelta.x)&&No(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Oo&&To.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,i=n?n.latestValues:{},r={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Jo));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h;Yo(o.x,e.x,n),Yo(o.y,e.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fr(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,i){Qo(e.x,t.x,n.x,i),Qo(e.y,t.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,s,n),d&&(l=this.relativeTarget,h=d,Eo(l.x,h.x)&&Eo(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),mo(d,this.relativeTarget)),a&&(this.animationValues=r,function(e,t,n,i,r,o){r?(e.opacity=$n(0,void 0!==n.opacity?n.opacity:1,uo(i)),e.opacityExit=$n(void 0!==t.opacity?t.opacity:1,0,ho(i))):o&&(e.opacity=$n(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let r=0;r<so;r++){const o=`border${oo[r]}Radius`;let s=co(t,o),a=co(n,o);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||lo(s)===lo(a)?(e[o]=Math.max($n(ao(s),ao(a),i),0),(Ft.test(a)||Ft.test(s))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=$n(t.rotate||0,n.rotate||0,i))}(r,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(qe(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=He.update(()=>{Kr.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const i=ot(0)?0:it(0);return i.start(Pi("",i,1e3,n)),i.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:i,latestValues:r}=e;if(t&&n&&i){if(this!==e&&this.layout&&i&&rs(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=cr(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const i=cr(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+i}mo(t,n),Lr(t,r),dr(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Mo),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const i={};n.z&&Po("z",e,i,this.animationValues);for(let t=0;t<Do.length;t++)Po(`rotate${Do[t]}`,e,i,this.animationValues),Po(`skew${Do[t]}`,e,i,this.animationValues);e.render();for(const t in i)e.setStaticValue(t,i[t]),this.animationValues&&(this.animationValues[t]=i[t]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Io;const i={visibility:""},r=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=ro(null==e?void 0:e.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=ro(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!Sr(this.latestValues)&&(t.transform=r?r({},""):"none",this.hasProjected=!1),t}const s=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(e,t,n){let i="";const r=e.x.translate/t.x,o=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((r||o||s)&&(i=`translate3d(${r}px, ${o}px, ${s}px) `),1===t.x&&1===t.y||(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:r,rotateY:o,skewX:s,skewY:a}=n;e&&(i=`perspective(${e}px) ${i}`),t&&(i+=`rotate(${t}deg) `),r&&(i+=`rotateX(${r}deg) `),o&&(i+=`rotateY(${o}deg) `),s&&(i+=`skewX(${s}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),r&&(i.transform=r(s,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(t=s.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:i.opacity=o===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Xr){if(void 0===s[e])continue;const{correct:t,applyTo:n}=Xr[e],r="none"===i.transform?s[e]:t(s[e],o);if(n){const e=n.length;for(let t=0;t<e;t++)i[n[t]]=r}else i[e]=r}return this.options.layoutId&&(i.pointerEvents=o===this?ro(null==e?void 0:e.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach($o),this.root.sharedNodes.clear()}}}function Bo(e){e.updateLayout()}function zo(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:i}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;"size"===r?wr(e=>{const i=o?n.measuredBox[e]:n.layoutBox[e],r=cr(i);i.min=t[e].min,i.max=i.min+r}):rs(r,n.layoutBox,t)&&wr(i=>{const r=o?n.measuredBox[i]:n.layoutBox[i],s=cr(t[i]);r.max=r.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+s)});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};dr(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?dr(a,e.applyTransform(i,!0),n.measuredBox):dr(a,t,n.layoutBox);const l=!ko(s);let c=!1;if(!e.resumeFrom){const i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:r,layout:o}=i;if(r&&o){const s={x:{min:0,max:0},y:{min:0,max:0}};fr(s,n.layoutBox,r.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};fr(a,t,o.layoutBox),Ao(s,a)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function jo(e){Oo&&To.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Uo(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Vo(e){e.clearSnapshot()}function $o(e){e.clearMeasurements()}function Ho(e){e.isLayoutDirty=!1}function qo(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ko(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Go(e){e.resolveTargetDelta()}function Wo(e){e.calcProjection()}function Zo(e){e.resetSkewAndRotation()}function Xo(e){e.removeLeadSnapshot()}function Yo(e,t,n){e.translate=$n(t.translate,0,n),e.scale=$n(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Qo(e,t,n,i){e.min=$n(t.min,n.min,i),e.max=$n(t.max,n.max,i)}function Jo(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const es={duration:.45,ease:[.4,0,.1,1]},ts=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ns=ts("applewebkit/")&&!ts("chrome/")?Math.round:Fe;function is(e){e.min=ns(e.min),e.max=ns(e.max)}function rs(e,t,n){return"position"===e||"preserve-aspect"===e&&(i=Co(t),r=Co(n),!(Math.abs(i-r)<=.2));var i,r}function os(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const ss=Fo({attachResizeListener:(e,t)=>Yi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),as={current:void 0},ls=Fo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!as.current){const e=new ss({});e.mount(window),e.setOptions({layoutScroll:!0}),as.current=e}return as.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),cs={pan:{Feature:class extends Wi{constructor(){super(...arguments),this.removePointerDownListener=Fe}onPointerDown(e){this.session=new tr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Br(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Vr(e),onStart:Vr(t),onMove:n,onEnd:(e,t)=>{delete this.session,i&&He.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=Ji(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Wi{constructor(e){super(e),this.removeGroupControls=Fe,this.removeListeners=Fe,this.controls=new jr(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fe}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ls,MeasureLayout:eo}};function us(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover","Start"===n);const r=i["onHover"+n];r&&He.postRender(()=>r(t,Qi(t)))}function ds(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap","Start"===n);const r=i["onTap"+("End"===n?"":n)];r&&He.postRender(()=>r(t,Qi(t)))}const hs=new WeakMap,ps=new WeakMap,fs=e=>{const t=hs.get(e.target);t&&t(e)},ms=e=>{e.forEach(fs)};const gs={some:0,all:1},bs={inView:{Feature:class extends Wi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:i="some",once:r}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:gs[i]};return function(e,t,n){const i=function({root:e,...t}){const n=e||document;ps.has(n)||ps.set(n,{});const i=ps.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(ms,{root:e,...t})),i[r]}(t);return hs.set(e,n),i.observe(e),()=>{hs.delete(e),i.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,r&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=t?n:i;o&&o(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Wi{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[i,r,o]=Ae(e,n),s=e=>{const i=e.currentTarget;if(!Re(e)||Oe.has(i))return;Oe.add(i);const o=t(e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Re(e)&&Oe.has(i)&&(Oe.delete(i),"function"==typeof o&&o(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||Ne(i,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",a,r),window.addEventListener("pointercancel",l,r)};return i.forEach(e=>{(function(e){return Te.has(e.tagName)||-1!==e.tabIndex})(e)||null!==e.getAttribute("tabindex")||(e.tabIndex=0),(n.useGlobalTarget?window:e).addEventListener("pointerdown",s,r),e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const i=De(()=>{if(Oe.has(n))return;Ie(n,"down");const e=De(()=>{Ie(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Ie(n,"cancel"),t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)})(e,r),r)}),o}(e,e=>(ds(this.node,e,"Start"),(e,{success:t})=>ds(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Wi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Yn(Yi(this.node.current,"focus",()=>this.onFocus()),Yi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Wi{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[i,r,o]=Ae(e,n),s=Ce(e=>{const{target:n}=e,i=t(e);if("function"!=typeof i||!n)return;const o=Ce(e=>{i(e),n.removeEventListener("pointerleave",o)});n.addEventListener("pointerleave",o,r)});return i.forEach(e=>{e.addEventListener("pointerenter",s,r)}),o}(e,e=>(us(this.node,e,"Start"),e=>us(this.node,e,"End"))))}unmount(){}}}},ys={layout:{ProjectionNode:ls,MeasureLayout:eo}},vs=s({strict:!1}),xs=s({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),ws=s({});function _s(e){return X(e.animate)||re.some(t=>J(e[t]))}function ks(e){return Boolean(_s(e)||e.variants)}function Es(e){return Array.isArray(e)?e.join(" "):e}const Ss="undefined"!=typeof window,As={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Cs={};for(const e in As)Cs[e]={isEnabled:t=>As[e].some(e=>!!t[e])};const Ns=Symbol.for("motionComponentSymbol");function Ms(e,t,n){return u(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&("function"==typeof n?n(i):lr(n)&&(n.current=i))},[t])}const Ts=Ss?m:h;function Os(e,t,n,i,r){var o,s;const{visualElement:a}=d(ws),l=d(vs),c=d($r),u=d(xs).reducedMotion,p=b(null);i=i||l.renderer,!p.current&&i&&(p.current=i(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const m=p.current,g=d(qr);!m||m.projection||!r||"html"!==m.type&&"svg"!==m.type||function(e,t,n,i){const{layoutId:r,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ds(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:Boolean(s)||a&&lr(a),visualElement:e,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:c})}(p.current,n,r,g);const y=b(!1);f(()=>{m&&y.current&&m.update(n,c)});const v=n[lt],x=b(Boolean(v)&&!(null===(o=window.MotionHandoffIsComplete)||void 0===o?void 0:o.call(window,v))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,v)));return Ts(()=>{m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),Yr.render(m.render),x.current&&m.animationState&&m.animationState.animateChanges())}),h(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,v)}),x.current=!1))}),m}function Ds(e){if(e)return!1!==e.options.allowProjection?e.projection:Ds(e.parent)}function Is({preloadedFeatures:e,createVisualElement:i,useRender:r,useVisualState:o,Component:s}){var a,l;function u(e,a){let l;const c={...d(xs),...e,layoutId:Rs(e)},{isStatic:u}=c,h=function(e){const{initial:t,animate:n}=function(e,t){if(_s(e)){const{initial:t,animate:n}=e;return{initial:!1===t||J(t)?t:void 0,animate:J(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,d(ws));return g(()=>({initial:t,animate:n}),[Es(t),Es(n)])}(e),p=o(e,u);if(!u&&Ss){d(vs).strict;const e=function(e){const{drag:t,layout:n}=Cs;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(c);l=e.MeasureLayout,h.visualElement=Os(s,p,c,i,e.ProjectionNode)}return n(ws.Provider,{value:h,children:[l&&h.visualElement?t(l,{visualElement:h.visualElement,...c}):null,r(s,e,Ms(p,h.visualElement,a),p,u,h.visualElement)]})}e&&function(e){for(const t in e)Cs[t]={...Cs[t],...e[t]}}(e),u.displayName=`motion.${"string"==typeof s?s:`create(${null!==(l=null!==(a=s.displayName)&&void 0!==a?a:s.name)&&void 0!==l?l:""})`}`;const h=c(u);return h[Ns]=s,h}function Rs({layoutId:e}){const t=d(Hr).id;return t&&void 0!==e?t+"-"+e:e}const Ps=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ls(e){return"string"==typeof e&&!e.includes("-")&&!!(Ps.indexOf(e)>-1||/[A-Z]/u.test(e))}const Fs=e=>(t,n)=>{const i=d(ws),r=d($r),o=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,o){const s={latestValues:Bs(i,r,o,e),renderState:t()};return n&&(s.onMount=e=>n({props:i,current:e,...s}),s.onUpdate=e=>n(e)),s}(e,t,i,r);return n?o():function(e){const t=b(null);return null===t.current&&(t.current=e()),t.current}(o)};function Bs(e,t,n,i){const r={},o=i(e,{});for(const e in o)r[e]=ro(o[e]);let{initial:s,animate:a}=e;const l=_s(e),c=ks(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!X(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const i=te(e,t[n]);if(i){const{transitionEnd:e,transition:t,...n}=i;for(const e in n){let t=n[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(r[e]=t)}for(const t in e)r[t]=e[t]}}}return r}const zs=(e,t)=>t&&"number"==typeof e?t.transform(e):e,js={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Us=Be.length;function Vs(e,t,n){const{style:i,vars:r,transformOrigin:o}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(ze.has(e))s=!0;else if(Nn(e))r[e]=n;else{const t=zs(n,an[e]);e.startsWith("origin")?(a=!0,o[e]=t):i[e]=t}}if(t.transform||(s||n?i.transform=function(e,t,n){let i="",r=!0;for(let o=0;o<Us;o++){const s=Be[o],a=e[s];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(s.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const e=zs(a,an[s]);l||(r=!1,i+=`${js[s]||s}(${e}) `),n&&(t[s]=e)}}return i=i.trim(),n?i=n(t,r?"":i):r&&(i="none"),i}(t,e.transform,n):i.transform&&(i.transform="none")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=o;i.transformOrigin=`${e} ${t} ${n}`}}const $s={offset:"stroke-dashoffset",array:"stroke-dasharray"},Hs={offset:"strokeDashoffset",array:"strokeDasharray"};function qs(e,t,n){return"string"==typeof e?e:Bt.transform(t+n*e)}function Ks(e,{attrX:t,attrY:n,attrScale:i,originX:r,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(Vs(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:f}=e;h.transform&&(f&&(p.transform=h.transform),delete h.transform),f&&(void 0!==r||void 0!==o||p.transform)&&(p.transformOrigin=function(e,t,n){return`${qs(t,e.x,e.width)} ${qs(n,e.y,e.height)}`}(f,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==t&&(h.x=t),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(e,t,n=1,i=0,r=!0){e.pathLength=1;const o=r?$s:Hs;e[o.offset]=Bt.transform(-i);const s=Bt.transform(t),a=Bt.transform(n);e[o.array]=`${s} ${a}`}(h,s,a,l,!1)}const Gs=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ws(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const t in n)e.style.setProperty(t,n[t])}const Zs=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Xs(e,t,n,i){Ws(e,t,void 0,i);for(const n in t.attrs)e.setAttribute(Zs.has(n)?n:at(n),t.attrs[n])}function Ys(e,{layout:t,layoutId:n}){return ze.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Xr[e]||"opacity"===e)}function Qs(e,t,n){var i;const{style:r}=e,o={};for(const s in r)(ot(r[s])||t.style&&ot(t.style[s])||Ys(s,e)||void 0!==(null===(i=null==n?void 0:n.getValue(s))||void 0===i?void 0:i.liveStyle))&&(o[s]=r[s]);return o}function Js(e,t,n){const i=Qs(e,t,n);for(const n in e)(ot(e[n])||ot(t[n]))&&(i[-1!==Be.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return i}const ea=["x","y","width","height","cx","cy","r"],ta={useVisualState:Fs({scrapeMotionValuesFromProps:Js,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let o=!!e.drag;if(!o)for(const e in r)if(ze.has(e)){o=!0;break}if(!o)return;let s=!t;if(t)for(let n=0;n<ea.length;n++){const i=ea[n];e[i]!==t[i]&&(s=!0)}s&&He.read(()=>{!function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(e){t.dimensions={x:0,y:0,width:0,height:0}}}(n,i),He.render(()=>{Ks(i,r,Gs(n.tagName),e.transformTemplate),Xs(n,i)})})}})},na={useVisualState:Fs({scrapeMotionValuesFromProps:Qs,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function ia(e,t,n){for(const i in t)ot(t[i])||Ys(i,n)||(e[i]=t[i])}function ra(e,t){const n={},i=function(e,t){const n={};return ia(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return g(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Vs(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const oa=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function sa(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||oa.has(e)}let aa=e=>!sa(e);try{(la=require("@emotion/is-prop-valid").default)&&(aa=e=>e.startsWith("on")?!sa(e):la(e))}catch(e){}var la;function ca(e,t,n,i){const r=g(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ks(n,t,Gs(i),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};ia(t,e.style,e),r.style={...t,...r.style}}return r}function ua(e=!1){return(t,n,i,{latestValues:r},s)=>{const l=(Ls(t)?ca:ra)(n,r,s,t),c=function(e,t,n){const i={};for(const r in e)"values"===r&&"object"==typeof e.values||(aa(r)||!0===n&&sa(r)||!t&&!sa(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}(n,"string"==typeof t,e),u=t!==o?{...c,...l,ref:i}:{},{children:d}=n,h=g(()=>ot(d)?d.get():d,[d]);return a(t,{...u,children:h})}}function da(e,t){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Is({...Ls(n)?ta:na,preloadedFeatures:e,useRender:ua(i),createVisualElement:t,Component:n})}}const ha={current:null},pa={current:!1},fa=[...Pn,$t,Qt],ma=new WeakMap,ga=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ba{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=kn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Xe.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,He.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=o;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=_s(t),this.isVariantNode=ks(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==a[e]&&ot(t)&&t.set(a[e],!1)}}mount(e){this.current=e,ma.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),pa.current||function(){if(pa.current=!0,Ss)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ha.current=e.matches;e.addListener(t),t()}else ha.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||ha.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ma.delete(this.current),this.projection&&this.projection.unmount(),qe(this.notifyUpdate),qe(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=ze.has(e),i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&He.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=t.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),r(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Cs){const t=Cs[e];if(!t)continue;const{isEnabled:n,Feature:i}=t;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ga.length;t++){const n=ga[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=e["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(e,t,n){for(const i in t){const r=t[i],o=n[i];if(ot(r))e.addValue(i,r);else if(ot(o))e.addValue(i,it(r,{owner:e}));else if(o!==r)if(e.hasValue(i)){const t=e.getValue(i);!0===t.liveStyle?t.jump(r):t.hasAnimated||t.set(r)}else{const t=e.getStaticValue(i);e.addValue(i,it(void 0!==t?t:r,{owner:e}))}}for(const i in n)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=it(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let i=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var r;return null!=i&&("string"==typeof i&&(An(i)||wt(i))?i=parseFloat(i):(r=i,!fa.find(Rn(r))&&Qt.test(t)&&(i=un(e,t))),this.setBaseTarget(e,ot(i)?i.get():i)),ot(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const r=te(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);r&&(i=r[e])}if(n&&void 0!==i)return i;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||ot(r)?void 0!==this.initialValues[e]&&void 0===i?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new Je),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class ya extends ba{constructor(){super(...arguments),this.KeyframeResolver=Fn}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ot(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class va extends ya{constructor(){super(...arguments),this.type="html",this.renderInstance=Ws}readValueFromInstance(e,t){if(ze.has(t)){const e=cn(t);return e&&e.default||0}{const i=(n=e,window.getComputedStyle(n)),r=(Nn(t)?i.getPropertyValue(t):i[t])||0;return"string"==typeof r?r.trim():r}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Fr(e,t)}build(e,t,n){Vs(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Qs(e,t,n)}}class xa extends ya{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xr}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ze.has(t)){const e=cn(t);return e&&e.default||0}return t=Zs.has(t)?t:at(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Js(e,t,n)}build(e,t,n){Ks(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,i){Xs(e,t,0,i)}mount(e){this.isSVGTag=Gs(e.tagName),super.mount(e)}}const wa=Z(da({...Xi,...bs,...cs,...ys},(e,t)=>Ls(e)?new xa(t):new va(t,{allowProjection:e!==o})));function _a(e){try{return(e?new Date(e):new Date).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function ka({content:e,createdAt:i}){return t(wa.div,{className:"bmxcb__message bmxcb__message--user",initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:400,damping:25,duration:.3},layout:!0,children:n("div",{className:"bmxcb__message-content",children:[t("div",{className:"bmxcb__message-text",children:e}),t("div",{className:"bmxcb__message-footer bmxcb__message-footer--user",children:t("div",{className:"bmxcb__message-time bmxcb__message-time--user",children:_a(i)})})]})})}function Ea(){}function Sa(){}const Aa=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ca=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Na={};function Ma(e,t){return((t||Na).jsx?Ca:Aa).test(e)}const Ta=/[ \t\n\f\r]/g;function Oa(e){return""===e.replace(Ta,"")}class Da{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Ia(e,t){const n={},i={};for(const t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new Da(n,i,t)}function Ra(e){return e.toLowerCase()}Da.prototype.normal={},Da.prototype.property={},Da.prototype.space=void 0;class Pa{constructor(e,t){this.attribute=t,this.property=e}}Pa.prototype.attribute="",Pa.prototype.booleanish=!1,Pa.prototype.boolean=!1,Pa.prototype.commaOrSpaceSeparated=!1,Pa.prototype.commaSeparated=!1,Pa.prototype.defined=!1,Pa.prototype.mustUseProperty=!1,Pa.prototype.number=!1,Pa.prototype.overloadedBoolean=!1,Pa.prototype.property="",Pa.prototype.spaceSeparated=!1,Pa.prototype.space=void 0;let La=0;const Fa=Ha(),Ba=Ha(),za=Ha(),ja=Ha(),Ua=Ha(),Va=Ha(),$a=Ha();function Ha(){return 2**++La}const qa=Object.keys(_);class Ka extends Pa{constructor(e,t,n,i){let r=-1;if(super(e,t),Ga(this,"space",i),"number"==typeof n)for(;++r<qa.length;){const e=qa[r];Ga(this,qa[r],(n&_[e])===_[e])}}}function Ga(e,t,n){n&&(e[t]=n)}function Wa(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const o=new Ka(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[Ra(i)]=i,n[Ra(o.attribute)]=i}return new Da(t,n,e.space)}Ka.prototype.defined=!0;const Za=Wa({properties:{ariaActiveDescendant:null,ariaAtomic:Ba,ariaAutoComplete:null,ariaBusy:Ba,ariaChecked:Ba,ariaColCount:ja,ariaColIndex:ja,ariaColSpan:ja,ariaControls:Ua,ariaCurrent:null,ariaDescribedBy:Ua,ariaDetails:null,ariaDisabled:Ba,ariaDropEffect:Ua,ariaErrorMessage:null,ariaExpanded:Ba,ariaFlowTo:Ua,ariaGrabbed:Ba,ariaHasPopup:null,ariaHidden:Ba,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ua,ariaLevel:ja,ariaLive:null,ariaModal:Ba,ariaMultiLine:Ba,ariaMultiSelectable:Ba,ariaOrientation:null,ariaOwns:Ua,ariaPlaceholder:null,ariaPosInSet:ja,ariaPressed:Ba,ariaReadOnly:Ba,ariaRelevant:null,ariaRequired:Ba,ariaRoleDescription:Ua,ariaRowCount:ja,ariaRowIndex:ja,ariaRowSpan:ja,ariaSelected:Ba,ariaSetSize:ja,ariaSort:null,ariaValueMax:ja,ariaValueMin:ja,ariaValueNow:ja,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Xa(e,t){return t in e?e[t]:t}function Ya(e,t){return Xa(e,t.toLowerCase())}const Qa=Wa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Va,acceptCharset:Ua,accessKey:Ua,action:null,allow:null,allowFullScreen:Fa,allowPaymentRequest:Fa,allowUserMedia:Fa,alt:null,as:null,async:Fa,autoCapitalize:null,autoComplete:Ua,autoFocus:Fa,autoPlay:Fa,blocking:Ua,capture:null,charSet:null,checked:Fa,cite:null,className:Ua,cols:ja,colSpan:null,content:null,contentEditable:Ba,controls:Fa,controlsList:Ua,coords:ja|Va,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fa,defer:Fa,dir:null,dirName:null,disabled:Fa,download:za,draggable:Ba,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fa,formTarget:null,headers:Ua,height:ja,hidden:za,high:ja,href:null,hrefLang:null,htmlFor:Ua,httpEquiv:Ua,id:null,imageSizes:null,imageSrcSet:null,inert:Fa,inputMode:null,integrity:null,is:null,isMap:Fa,itemId:null,itemProp:Ua,itemRef:Ua,itemScope:Fa,itemType:Ua,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fa,low:ja,manifest:null,max:null,maxLength:ja,media:null,method:null,min:null,minLength:ja,multiple:Fa,muted:Fa,name:null,nonce:null,noModule:Fa,noValidate:Fa,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:Fa,optimum:ja,pattern:null,ping:Ua,placeholder:null,playsInline:Fa,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fa,referrerPolicy:null,rel:Ua,required:Fa,reversed:Fa,rows:ja,rowSpan:ja,sandbox:Ua,scope:null,scoped:Fa,seamless:Fa,selected:Fa,shadowRootClonable:Fa,shadowRootDelegatesFocus:Fa,shadowRootMode:null,shape:null,size:ja,sizes:null,slot:null,span:ja,spellCheck:Ba,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ja,step:null,style:null,tabIndex:ja,target:null,title:null,translate:null,type:null,typeMustMatch:Fa,useMap:null,value:Ba,width:ja,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ua,axis:null,background:null,bgColor:null,border:ja,borderColor:null,bottomMargin:ja,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Fa,declare:Fa,event:null,face:null,frame:null,frameBorder:null,hSpace:ja,leftMargin:ja,link:null,longDesc:null,lowSrc:null,marginHeight:ja,marginWidth:ja,noResize:Fa,noHref:Fa,noShade:Fa,noWrap:Fa,object:null,profile:null,prompt:null,rev:null,rightMargin:ja,rules:null,scheme:null,scrolling:Ba,standby:null,summary:null,text:null,topMargin:ja,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ja,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Fa,disableRemotePlayback:Fa,prefix:null,property:null,results:ja,security:null,unselectable:null},space:"html",transform:Ya}),Ja=Wa({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:$a,accentHeight:ja,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ja,amplitude:ja,arabicForm:null,ascent:ja,attributeName:null,attributeType:null,azimuth:ja,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ja,by:null,calcMode:null,capHeight:ja,className:Ua,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:ja,diffuseConstant:ja,direction:null,display:null,dur:null,divisor:ja,dominantBaseline:null,download:Fa,dx:null,dy:null,edgeMode:null,editable:null,elevation:ja,enableBackground:null,end:null,event:null,exponent:ja,externalResourcesRequired:null,fill:null,fillOpacity:ja,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:Va,g2:Va,glyphName:Va,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ja,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ja,horizOriginX:ja,horizOriginY:ja,id:null,ideographic:ja,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ja,k:ja,k1:ja,k2:ja,k3:ja,k4:ja,kernelMatrix:$a,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ja,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:ja,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:ja,overlineThickness:ja,paintOrder:null,panose1:null,path:null,pathLength:ja,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ua,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ja,pointsAtY:ja,pointsAtZ:ja,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$a,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$a,rev:$a,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$a,requiredFeatures:$a,requiredFonts:$a,requiredFormats:$a,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:ja,specularExponent:ja,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ja,strikethroughThickness:ja,string:null,stroke:null,strokeDashArray:$a,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ja,strokeOpacity:ja,strokeWidth:null,style:null,surfaceScale:ja,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$a,tabIndex:ja,tableValues:null,target:null,targetX:ja,targetY:ja,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$a,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ja,underlineThickness:ja,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ja,values:null,vAlphabetic:ja,vMathematical:ja,vectorEffect:null,vHanging:ja,vIdeographic:ja,version:null,vertAdvY:ja,vertOriginX:ja,vertOriginY:ja,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ja,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Xa}),el=Wa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),tl=Wa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ya}),nl=Wa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),il=Ia([Za,Qa,el,tl,nl],"html"),rl=Ia([Za,Ja,el,tl,nl],"svg"),ol=/[A-Z]/g,sl=/-[a-z]/g,al=/^data[-\w.:]+$/i;function ll(e){return"-"+e.toLowerCase()}function cl(e){return e.charAt(1).toUpperCase()}const ul={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"};var dl=w(598);const hl=fl("end"),pl=fl("start");function fl(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function ml(e){return e&&"object"==typeof e?"position"in e||"type"in e?bl(e.position):"start"in e||"end"in e?bl(e):"line"in e||"column"in e?gl(e):"":""}function gl(e){return yl(e&&e.line)+":"+yl(e&&e.column)}function bl(e){return gl(e&&e.start)+"-"+gl(e&&e.end)}function yl(e){return e&&"number"==typeof e?e:1}class vl extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let i="",r={},o=!1;if(t&&(r="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?i=e:!r.cause&&e&&(o=!0,i=e.message,r.cause=e),!r.ruleId&&!r.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?r.ruleId=n:(r.source=n.slice(0,e),r.ruleId=n.slice(e+1))}if(!r.place&&r.ancestors&&r.ancestors){const e=r.ancestors[r.ancestors.length-1];e&&(r.place=e.position)}const s=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=ml(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&"string"==typeof r.cause.stack?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vl.prototype.file="",vl.prototype.name="",vl.prototype.reason="",vl.prototype.message="",vl.prototype.stack="",vl.prototype.column=void 0,vl.prototype.line=void 0,vl.prototype.ancestors=void 0,vl.prototype.cause=void 0,vl.prototype.fatal=void 0,vl.prototype.place=void 0,vl.prototype.ruleId=void 0,vl.prototype.source=void 0;const xl={}.hasOwnProperty,wl=new Map,_l=/[A-Z]/g,kl=new Set(["table","tbody","thead","tfoot","tr"]),El=new Set(["td","th"]),Sl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Al(e,t,n){return"element"===t.type?function(e,t,n){const i=e.schema;let r=i;"svg"===t.tagName.toLowerCase()&&"html"===i.space&&(r=rl,e.schema=r),e.ancestors.push(t);const o=Ol(e,t.tagName,!1),s=function(e,t){const n={};let i,r;for(r in t.properties)if("children"!==r&&xl.call(t.properties,r)){const o=Tl(e,r,t.properties[r]);if(o){const[r,s]=o;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&El.has(t.tagName)?i=s:n[r]=s}}return i&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=i),n}(e,t);let a=Ml(e,t);return kl.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&Oa(t.value):Oa(t));var t})),Cl(e,s,o,t),Nl(s,a),e.ancestors.pop(),e.schema=i,e.create(t,o,s,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Dl(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const i=e.schema;let r=i;"svg"===t.name&&"html"===i.space&&(r=rl,e.schema=r),e.ancestors.push(t);const o=null===t.name?e.Fragment:Ol(e,t.name,!0),s=function(e,t){const n={};for(const i of t.attributes)if("mdxJsxExpressionAttribute"===i.type)if(i.data&&i.data.estree&&e.evaluater){const t=i.data.estree.body[0];Ea(t.type);const r=t.expression;Ea(r.type);const o=r.properties[0];Ea(o.type),Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Dl(e,t.position);else{const r=i.name;let o;if(i.value&&"object"==typeof i.value)if(i.value.data&&i.value.data.estree&&e.evaluater){const t=i.value.data.estree.body[0];Ea(t.type),o=e.evaluater.evaluateExpression(t.expression)}else Dl(e,t.position);else o=null===i.value||i.value;n[r]=o}return n}(e,t),a=Ml(e,t);return Cl(e,s,o,t),Nl(s,a),e.ancestors.pop(),e.schema=i,e.create(t,o,s,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Dl(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const i={};return Nl(i,Ml(e,t)),e.create(t,e.Fragment,i,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Cl(e,t,n,i){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Nl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ml(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:wl;for(;++i<t.children.length;){const o=t.children[i];let s;if(e.passKeys){const e="element"===o.type?o.tagName:"mdxJsxFlowElement"===o.type||"mdxJsxTextElement"===o.type?o.name:void 0;if(e){const t=r.get(e)||0;s=e+"-"+t,r.set(e,t+1)}}const a=Al(e,o,s);void 0!==a&&n.push(a)}return n}function Tl(e,t,n){const i=function(e,t){const n=Ra(t);let i=t,r=Pa;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&al.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(sl,cl);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!sl.test(e)){let n=e.replace(ol,ll);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}r=Ka}return new r(i,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===i.property){let t="object"==typeof n?n:function(e,t){try{return dl(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,i=new vl("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Sl+"#cannot-parse-style-attribute",i}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)xl.call(e,n)&&(t[Il(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&i.space?ul[i.property]||i.property:i.attribute,n]}}function Ol(e,t,n){let i;if(n)if(t.includes(".")){const e=t.split(".");let n,r=-1;for(;++r<e.length;){const t=Ma(e[r])?{type:"Identifier",name:e[r]}:{type:"Literal",value:e[r]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(r&&"Literal"===t.type),optional:!1}:t}i=n}else i=Ma(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else i={type:"Literal",value:t};if("Literal"===i.type){const t=i.value;return xl.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(i);Dl(e)}function Dl(e,t){const n=new vl("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=Sl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Il(e){let t=e.replace(_l,Rl);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Rl(e){return"-"+e.toLowerCase()}const Pl={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"]},Ll={};function Fl(e,t){const n=t||Ll;return Bl(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function Bl(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return zl(e.children,t,n)}return Array.isArray(e)?zl(e,t,n):""}function zl(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=Bl(e[r],t,n);return i.join("")}function jl(e,t,n,i){const r=e.length;let o,s=0;if(t=t<0?-t>r?0:r+t:t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<i.length;)o=i.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Ul(e,t){return e.length>0?(jl(e,e.length,0,t),e):t}class Vl{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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){const n=null==t?Number.POSITIVE_INFINITY:t;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){const i=t||0;this.setCursor(Math.trunc(e));const r=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&$l(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),$l(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),$l(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);$l(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);$l(this.left,t.reverse())}}}function $l(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 Hl(e){const t={};let n,i,r,o,s,a,l,c=-1;const u=new Vl(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(a=n[1]._tokenizer.events,r=0,r<a.length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,ql(u,c)),c=t[c],l=!0);else if(n[1]._container){for(r=c,i=void 0;r--;)if(o=u.get(r),"lineEnding"===o[1].type||"lineEndingBlank"===o[1].type)"enter"===o[0]&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=r);else if("linePrefix"!==o[1].type&&"listItemIndent"!==o[1].type)break;i&&(n[1].end={...u.get(i)[1].start},s=u.slice(i,c),s.unshift(n),u.splice(i,c-i+1,s))}}return jl(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function ql(e,t){const n=e.get(t)[1],i=e.get(t)[2];let r=t-1;const o=[];let s=n._tokenizer;s||(s=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,h=-1,p=n,f=0,m=0;const g=[m];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(u=i.sliceStream(p),p.next||u.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<a.length;)"exit"===a[h][0]&&"enter"===a[h-1][0]&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),h=g.length;h--;){const t=a.slice(g[h],g[h+1]),n=o.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),h=-1;++h<l.length;)c[f+l[h][0]]=f+l[h][1],f+=l[h][1]-l[h][0]-1;return c}const Kl={}.hasOwnProperty;function Gl(e){const t={};let n=-1;for(;++n<e.length;)Wl(t,e[n]);return t}function Wl(e,t){let n;for(n in t){const i=(Kl.call(e,n)?e[n]:void 0)||(e[n]={}),r=t[n];let o;if(r)for(o in r){Kl.call(i,o)||(i[o]=[]);const e=r[o];Zl(i[o],Array.isArray(e)?e:e?[e]:[])}}}function Zl(e,t){let n=-1;const i=[];for(;++n<t.length;)("after"===t[n].add?e:i).push(t[n]);jl(e,0,0,i)}const Xl=lc(/[A-Za-z]/),Yl=lc(/[\dA-Za-z]/),Ql=lc(/[#-'*+\--9=?A-Z^-~]/);function Jl(e){return null!==e&&(e<32||127===e)}const ec=lc(/\d/),tc=lc(/[\dA-Fa-f]/),nc=lc(/[!-/:-@[-`{-~]/);function ic(e){return null!==e&&e<-2}function rc(e){return null!==e&&(e<0||32===e)}function oc(e){return-2===e||-1===e||32===e}const sc=lc(/\p{P}|\p{S}/u),ac=lc(/\s/);function lc(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function cc(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let o=0;return function(i){return oc(i)?(e.enter(n),s(i)):t(i)};function s(i){return oc(i)&&o++<r?(e.consume(i),s):(e.exit(n),t(i))}}const uc={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),cc(e,t,"linePrefix");e.consume(n)},function(t){return e.enter("paragraph"),i(t)});let n;return t;function i(t){const i=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=i),n=i,r(t)}function r(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):ic(t)?(e.consume(t),e.exit("chunkText"),i):(e.consume(t),r)}}},dc={tokenize:function(e){const t=this,n=[];let i,r,o,s=0;return a;function a(i){if(s<n.length){const r=n[s];return t.containerState=r[1],e.attempt(r[0].continuation,l,c)(i)}return c(i)}function l(e){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const n=t.events.length;let r,o=n;for(;o--;)if("exit"===t.events[o][0]&&"chunkFlow"===t.events[o][1].type){r=t.events[o][1].end;break}b(s);let a=n;for(;a<t.events.length;)t.events[a][1].end={...r},a++;return jl(t.events,o+1,0,t.events.slice(n)),t.events.length=a,c(e)}return a(e)}function c(r){if(s===n.length){if(!i)return h(r);if(i.currentConstruct&&i.currentConstruct.concrete)return f(r);t.interrupt=Boolean(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hc,u,d)(r)}function u(e){return i&&y(),b(s),h(e)}function d(e){return t.parser.lazy[t.now().line]=s!==n.length,o=t.now().offset,f(e)}function h(n){return t.containerState={},e.attempt(hc,p,f)(n)}function p(e){return s++,n.push([t.currentConstruct,t.containerState]),h(e)}function f(n){return null===n?(i&&y(),b(0),void e.consume(n)):(i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),b(0),void e.consume(n)):ic(n)?(e.consume(n),g(e.exit("chunkFlow")),s=0,t.interrupt=void 0,a):(e.consume(n),m)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=r,r&&(r.next=e),r=e,i.defineSkip(e.start),i.write(a),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;const n=t.events.length;let r,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(r){a=t.events[l][1].end;break}r=!0}for(b(s),e=n;e<t.events.length;)t.events[e][1].end={...a},e++;jl(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function b(i){let r=n.length;for(;r-- >i;){const i=n[r];t.containerState=i[1],i[0].exit.call(t,e)}n.length=i}function y(){i.write([null]),r=void 0,i=void 0,t.containerState._closeFlow=void 0}}},hc={tokenize:function(e,t,n){return cc(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},pc={partial:!0,tokenize:function(e,t,n){return function(t){return oc(t)?cc(e,i,"linePrefix")(t):i(t)};function i(e){return null===e||ic(e)?t(e):n(e)}}},fc={resolve:function(e){return Hl(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(t)};function i(t){return null===t?r(t):ic(t)?e.check(mc,o,r)(t):(e.consume(t),i)}function r(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}}},mc={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),cc(e,r,"linePrefix")};function r(r){if(null===r||ic(r))return n(r);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}},gc={tokenize:function(e){const t=this,n=e.attempt(pc,function(i){if(null!==i)return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(i)},e.attempt(this.parser.constructs.flowInitial,i,cc(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fc,i)),"linePrefix")));return n;function i(i){if(null!==i)return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(i)}}},bc={resolveAll:wc()},yc=xc("string"),vc=xc("text");function xc(e){return{resolveAll:wc("text"===e?_c:void 0),tokenize:function(t){const n=this,i=this.parser.constructs[e],r=t.attempt(i,o,s);return o;function o(e){return l(e)?r(e):s(e)}function s(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),r(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=i[e];let r=-1;if(t)for(;++r<t.length;){const e=t[r];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function wc(e){return function(t,n){let i,r=-1;for(;++r<=t.length;)void 0===i?t[r]&&"data"===t[r][1].type&&(i=r,r++):t[r]&&"data"===t[r][1].type||(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 _c(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const i=e[n-1][1],r=t.sliceStream(i);let o,s=r.length,a=-1,l=0;for(;s--;){const e=r[s];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)l++,a--;if(a)break;a=-1}else if(-2===e)o=!0,l++;else if(-1!==e){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const r={type:n===e.length||o||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:i.start._bufferIndex+a,_index:i.start._index+s,line:i.end.line,column:i.end.column-l,offset:i.end.offset-l},end:{...i.end}};i.end={...r.start},i.start.offset===i.end.offset?Object.assign(i,r):(e.splice(n,0,["enter",r,t],["exit",r,t]),n+=2)}n++}return e}const kc={name:"thematicBreak",tokenize:function(e,t,n){let i,r=0;return function(t){return e.enter("thematicBreak"),function(e){return i=e,o(e)}(t)};function o(o){return o===i?(e.enter("thematicBreakSequence"),s(o)):r>=3&&(null===o||ic(o))?(e.exit("thematicBreak"),t(o)):n(o)}function s(t){return t===i?(e.consume(t),r++,s):(e.exit("thematicBreakSequence"),oc(t)?cc(e,o,"whitespace")(t):o(t))}}},Ec={continuation:{tokenize:function(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(pc,function(n){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,cc(e,t,"listItemIndent",i.containerState.size+1)(n)},function(n){return i.containerState.furtherBlankLines||!oc(n)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(n)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Ac,t,r)(n))});function r(r){return i.containerState._closeFlow=!0,i.interrupt=void 0,cc(e,e.attempt(Ec,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(r)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const i=this,r=i.events[i.events.length-1];let o=r&&"linePrefix"===r[1].type?r[2].sliceSerialize(r[1],!0).length:0,s=0;return function(t){const r=i.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===r?!i.containerState.marker||t===i.containerState.marker:ec(t)){if(i.containerState.type||(i.containerState.type=r,e.enter(r,{_container:!0})),"listUnordered"===r)return e.enter("listItemPrefix"),42===t||45===t?e.check(kc,n,l)(t):l(t);if(!i.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return ec(t)&&++s<10?(e.consume(t),a):(!i.interrupt||s<2)&&(i.containerState.marker?t===i.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||t,e.check(pc,i.interrupt?n:c,e.attempt(Sc,d,u))}function c(e){return i.containerState.initialBlankLine=!0,o++,d(e)}function u(t){return oc(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},Sc={partial:!0,tokenize:function(e,t,n){const i=this;return cc(e,function(e){const r=i.events[i.events.length-1];return!oc(e)&&r&&"listItemPrefixWhitespace"===r[1].type?t(e):n(e)},"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},Ac={partial:!0,tokenize:function(e,t,n){const i=this;return cc(e,function(e){const r=i.events[i.events.length-1];return r&&"listItemIndent"===r[1].type&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(e):n(e)},"listItemIndent",i.containerState.size+1)}},Cc={continuation:{tokenize:function(e,t,n){const i=this;return function(t){return oc(t)?cc(e,r,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):r(t)};function r(i){return e.attempt(Cc,t,n)(i)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const i=this;return function(t){if(62===t){const n=i.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),r}return n(t)};function r(n){return oc(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function Nc(e,t,n,i,r,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(i),e.enter(r),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||Jl(t)?n(t):(e.enter(i),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||ic(t)?n(t):(e.consume(t),92===t?p:h)}function p(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function f(r){return u||null!==r&&41!==r&&!rc(r)?u<c&&40===r?(e.consume(r),u++,f):41===r?(e.consume(r),u--,f):null===r||32===r||40===r||Jl(r)?n(r):(e.consume(r),92===r?m:f):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(r))}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function Mc(e,t,n,i,r,o){const s=this;let a,l=0;return function(t){return e.enter(i),e.enter(r),e.consume(t),e.exit(r),e.enter(o),c};function c(d){return l>999||null===d||91===d||93===d&&!a||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):93===d?(e.exit(o),e.enter(r),e.consume(d),e.exit(r),e.exit(i),t):ic(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||ic(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!oc(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Tc(e,t,n,i,r,o){let s;return function(t){return 34===t||39===t||40===t?(e.enter(i),e.enter(r),e.consume(t),e.exit(r),s=40===t?41:t,a):n(t)};function a(n){return n===s?(e.enter(r),e.consume(n),e.exit(r),e.exit(i),t):(e.enter(o),l(n))}function l(t){return t===s?(e.exit(o),a(s)):null===t?n(t):ic(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),cc(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===s||null===t||ic(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===s||92===t?(e.consume(t),c):c(t)}}function Oc(e,t){let n;return function i(r){return ic(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):oc(r)?cc(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}function Dc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ic={name:"definition",tokenize:function(e,t,n){const i=this;let r;return function(t){return e.enter("definition"),function(t){return Mc.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return r=Dc(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return rc(t)?Oc(e,a)(t):a(t)}function a(t){return Nc(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Rc,c,c)(t)}function c(t){return oc(t)?cc(e,u,"whitespace")(t):u(t)}function u(o){return null===o||ic(o)?(e.exit("definition"),i.parser.defined.push(r),t(o)):n(o)}}},Rc={partial:!0,tokenize:function(e,t,n){return function(t){return rc(t)?Oc(e,i)(t):n(t)};function i(t){return Tc(e,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function r(t){return oc(t)?cc(e,o,"whitespace")(t):o(t)}function o(e){return null===e||ic(e)?t(e):n(e)}}},Pc={name:"codeIndented",tokenize:function(e,t,n){const i=this;return function(t){return e.enter("codeIndented"),cc(e,r,"linePrefix",5)(t)};function r(e){const t=i.events[i.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?a(t):ic(t)?e.attempt(Lc,o,a)(t):(e.enter("codeFlowValue"),s(t))}function s(t){return null===t||ic(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),s)}function a(n){return e.exit("codeIndented"),t(n)}}},Lc={partial:!0,tokenize:function(e,t,n){const i=this;return r;function r(t){return i.parser.lazy[i.now().line]?n(t):ic(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r):cc(e,o,"linePrefix",5)(t)}function o(e){const o=i.events[i.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):ic(e)?r(e):n(e)}}},Fc={name:"headingAtx",resolve:function(e,t){let n,i,r=e.length-2,o=3;return"whitespace"===e[o][1].type&&(o+=2),r-2>o&&"whitespace"===e[r][1].type&&(r-=2),"atxHeadingSequence"===e[r][1].type&&(o===r-1||r-4>o&&"whitespace"===e[r-2][1].type)&&(r-=o+1===r?2:4),r>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[r][1].end},i={type:"chunkText",start:e[o][1].start,end:e[r][1].end,contentType:"text"},jl(e,o,r-o+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e},tokenize:function(e,t,n){let i=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),r(t)}(t)};function r(t){return 35===t&&i++<6?(e.consume(t),r):null===t||rc(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),s(n)):null===n||ic(n)?(e.exit("atxHeading"),t(n)):oc(n)?cc(e,o,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function s(t){return 35===t?(e.consume(t),s):(e.exit("atxHeadingSequence"),o(t))}function a(t){return null===t||35===t||rc(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),a)}}},Bc={name:"setextUnderline",resolveTo:function(e,t){let n,i,r,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(i=o)}else"content"===e[o][1].type&&e.splice(o,1),r||"definition"!==e[o][1].type||(r=o);const s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",r?(e.splice(i,0,["enter",s,t]),e.splice(r+1,0,["exit",e[n][1],t]),e[n][1].end={...e[r][1].end}):e[n][1]=s,e.push(["exit",s,t]),e},tokenize:function(e,t,n){const i=this;let r;return function(t){let s,a=i.events.length;for(;a--;)if("lineEnding"!==i.events[a][1].type&&"linePrefix"!==i.events[a][1].type&&"content"!==i.events[a][1].type){s="paragraph"===i.events[a][1].type;break}return i.parser.lazy[i.now().line]||!i.interrupt&&!s?n(t):(e.enter("setextHeadingLine"),r=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t))};function o(t){return t===r?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),oc(t)?cc(e,s,"lineSuffix")(t):s(t))}function s(i){return null===i||ic(i)?(e.exit("setextHeadingLine"),t(i)):n(i)}}},zc=["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"],jc=["pre","script","style","textarea"],Uc={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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},tokenize:function(e,t,n){const i=this;let r,o,s,a,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),o=!0,p):63===a?(e.consume(a),r=3,i.interrupt?t:R):Xl(a)?(e.consume(a),s=String.fromCharCode(a),f):n(a)}function u(o){return 45===o?(e.consume(o),r=2,d):91===o?(e.consume(o),r=5,a=0,h):Xl(o)?(e.consume(o),r=4,i.interrupt?t:R):n(o)}function d(r){return 45===r?(e.consume(r),i.interrupt?t:R):n(r)}function h(r){return r==="CDATA[".charCodeAt(a++)?(e.consume(r),6===a?i.interrupt?t:A:h):n(r)}function p(t){return Xl(t)?(e.consume(t),s=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||rc(a)){const l=47===a,c=s.toLowerCase();return l||o||!jc.includes(c)?zc.includes(s.toLowerCase())?(r=6,l?(e.consume(a),m):i.interrupt?t(a):A(a)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(a):o?g(a):b(a)):(r=1,i.interrupt?t(a):A(a))}return 45===a||Yl(a)?(e.consume(a),s+=String.fromCharCode(a),f):n(a)}function m(r){return 62===r?(e.consume(r),i.interrupt?t:A):n(r)}function g(t){return oc(t)?(e.consume(t),g):E(t)}function b(t){return 47===t?(e.consume(t),E):58===t||95===t||Xl(t)?(e.consume(t),y):oc(t)?(e.consume(t),b):E(t)}function y(t){return 45===t||46===t||58===t||95===t||Yl(t)?(e.consume(t),y):v(t)}function v(t){return 61===t?(e.consume(t),x):oc(t)?(e.consume(t),v):b(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):oc(t)?(e.consume(t),x):_(t)}function w(t){return t===l?(e.consume(t),l=null,k):null===t||ic(t)?n(t):(e.consume(t),w)}function _(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||rc(t)?v(t):(e.consume(t),_)}function k(e){return 47===e||62===e||oc(e)?b(e):n(e)}function E(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||ic(t)?A(t):oc(t)?(e.consume(t),S):n(t)}function A(t){return 45===t&&2===r?(e.consume(t),T):60===t&&1===r?(e.consume(t),O):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),R):93===t&&5===r?(e.consume(t),I):!ic(t)||6!==r&&7!==r?null===t||ic(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),A):(e.exit("htmlFlowData"),e.check(Vc,L,C)(t))}function C(t){return e.check($c,N,L)(t)}function N(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return null===t||ic(t)?C(t):(e.enter("htmlFlowData"),A(t))}function T(t){return 45===t?(e.consume(t),R):A(t)}function O(t){return 47===t?(e.consume(t),s="",D):A(t)}function D(t){if(62===t){const n=s.toLowerCase();return jc.includes(n)?(e.consume(t),P):A(t)}return Xl(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),D):A(t)}function I(t){return 93===t?(e.consume(t),R):A(t)}function R(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),R):A(t)}function P(t){return null===t||ic(t)?(e.exit("htmlFlowData"),L(t)):(e.consume(t),P)}function L(n){return e.exit("htmlFlow"),t(n)}}},Vc={partial:!0,tokenize:function(e,t,n){return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(pc,t,n)}}},$c={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return ic(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r):n(t)};function r(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},Hc={partial:!0,tokenize:function(e,t,n){const i=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),r)};function r(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},qc={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const i=this,r={partial:!0,tokenize:function(e,t,n){let r=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),oc(t)?cc(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===o?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===o?(r++,e.consume(t),c):r>=a?(e.exit("codeFencedFenceSequence"),oc(t)?cc(e,u,"whitespace")(t):u(t)):n(t)}function u(i){return null===i||ic(i)?(e.exit("codeFencedFence"),t(i)):n(i)}}};let o,s=0,a=0;return function(t){return function(t){const n=i.events[i.events.length-1];return s=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===o?(a++,e.consume(t),l):a<3?n(t):(e.exit("codeFencedFenceSequence"),oc(t)?cc(e,c,"whitespace")(t):c(t))}function c(n){return null===n||ic(n)?(e.exit("codeFencedFence"),i.interrupt?t(n):e.check(Hc,p,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||ic(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):oc(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),cc(e,d,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),u)}function d(t){return null===t||ic(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(t))}function h(t){return null===t||ic(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===o?n(t):(e.consume(t),h)}function p(t){return e.attempt(r,y,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return s>0&&oc(t)?cc(e,g,"linePrefix",s+1)(t):g(t)}function g(t){return null===t||ic(t)?e.check(Hc,p,y)(t):(e.enter("codeFlowValue"),b(t))}function b(t){return null===t||ic(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),b)}function y(n){return e.exit("codeFenced"),t(n)}}},Kc=document.createElement("i");function Gc(e){const t="&"+e+";";Kc.innerHTML=t;const n=Kc.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const Wc={name:"characterReference",tokenize:function(e,t,n){const i=this;let r,o,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,o=Yl,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=tc,c):(e.enter("characterReferenceValue"),r=7,o=ec,c(t))}function c(a){if(59===a&&s){const r=e.exit("characterReferenceValue");return o!==Yl||Gc(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return o(a)&&s++<r?(e.consume(a),c):n(a)}}},Zc={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),i};function i(i){return nc(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}},Xc={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),cc(e,t,"linePrefix")}}};function Yc(e,t,n){const i=[];let r=-1;for(;++r<e.length;){const o=e[r].resolveAll;o&&!i.includes(o)&&(t=o(t,n),i.push(o))}return t}const Qc={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),"labelImage"===i.type||"labelLink"===i.type||"labelEnd"===i.type){const e="labelImage"===i.type?4:2;i.type="data",t+=e}}return e.length!==n.length&&jl(e,0,e.length,n),e},resolveTo:function(e,t){let n,i,r,o,s=e.length,a=0;for(;s--;)if(n=e[s][1],i){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(r){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(i=s,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(r=s);const l={type:"labelLink"===e[i][1].type?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[r][1].end}},u={type:"labelText",start:{...e[i+a+2][1].end},end:{...e[r-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=Ul(o,e.slice(i+1,i+a+3)),o=Ul(o,[["enter",u,t]]),o=Ul(o,Yc(t.parser.constructs.insideSpan.null,e.slice(i+a+4,r-3),t)),o=Ul(o,[["exit",u,t],e[r-2],e[r-1],["exit",c,t]]),o=Ul(o,e.slice(r+1)),o=Ul(o,[["exit",l,t]]),jl(e,i,e.length,o),e},tokenize:function(e,t,n){const i=this;let r,o,s=i.events.length;for(;s--;)if(("labelImage"===i.events[s][1].type||"labelLink"===i.events[s][1].type)&&!i.events[s][1]._balanced){r=i.events[s][1];break}return function(t){return r?r._inactive?u(t):(o=i.parser.defined.includes(Dc(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(Jc,c,o?c:u)(t):91===t?e.attempt(eu,c,o?l:u)(t):o?c(t):u(t)}function l(t){return e.attempt(tu,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},Jc={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),i};function i(t){return rc(t)?Oc(e,r)(t):r(t)}function r(t){return 41===t?c(t):Nc(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return rc(t)?Oc(e,a)(t):c(t)}function s(e){return n(e)}function a(t){return 34===t||39===t||40===t?Tc(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return rc(t)?Oc(e,c)(t):c(t)}function c(i){return 41===i?(e.enter("resourceMarker"),e.consume(i),e.exit("resourceMarker"),e.exit("resource"),t):n(i)}}},eu={tokenize:function(e,t,n){const i=this;return function(t){return Mc.call(i,e,r,o,"reference","referenceMarker","referenceString")(t)};function r(e){return i.parser.defined.includes(Dc(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},tu={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),i};function i(i){return 93===i?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}},nu={name:"labelStartImage",resolveAll:Qc.resolveAll,tokenize:function(e,t,n){const i=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),r};function r(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in i.parser.constructs?n(e):t(e)}}};function iu(e){return null===e||rc(e)||ac(e)?1:sc(e)?2:void 0}const ru={name:"attention",resolveAll:function(e,t){let n,i,r,o,s,a,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},h={...e[u][1].start};ou(d,-a),ou(h,a),o={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:h},r={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},i={type:a>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},e[n][1].end={...o.start},e[u][1].start={...s.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Ul(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Ul(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",r,t]]),l=Ul(l,Yc(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=Ul(l,[["exit",r,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=Ul(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,jl(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=iu(i);let o;return function(t){return o=t,e.enter("attentionSequence"),s(t)};function s(a){if(a===o)return e.consume(a),s;const l=e.exit("attentionSequence"),c=iu(a),u=!c||2===c&&r||n.includes(a),d=!r||2===r&&c||n.includes(i);return l._open=Boolean(42===o?u:u&&(r||!d)),l._close=Boolean(42===o?d:d&&(c||!u)),t(a)}}};function ou(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const su={name:"autolink",tokenize:function(e,t,n){let i=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),r};function r(t){return Xl(t)?(e.consume(t),o):64===t?n(t):l(t)}function o(e){return 43===e||45===e||46===e||Yl(e)?(i=1,s(e)):l(e)}function s(t){return 58===t?(e.consume(t),i=0,a):(43===t||45===t||46===t||Yl(t))&&i++<32?(e.consume(t),s):(i=0,l(t))}function a(i){return 62===i?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):null===i||32===i||60===i||Jl(i)?n(i):(e.consume(i),a)}function l(t){return 64===t?(e.consume(t),c):Ql(t)?(e.consume(t),l):n(t)}function c(e){return Yl(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),i=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||Yl(t))&&i++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}},au={name:"htmlText",tokenize:function(e,t,n){const i=this;let r,o,s;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),y):Xl(t)?(e.consume(t),k):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),o=0,p):Xl(t)?(e.consume(t),b):n(t)}function c(t){return 45===t?(e.consume(t),h):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):ic(t)?(s=u,D(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),h):u(t)}function h(e){return 62===e?O(e):45===e?d(e):u(e)}function p(t){return t==="CDATA[".charCodeAt(o++)?(e.consume(t),6===o?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):ic(t)?(s=f,D(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?O(t):93===t?(e.consume(t),g):f(t)}function b(t){return null===t||62===t?O(t):ic(t)?(s=b,D(t)):(e.consume(t),b)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):ic(t)?(s=y,D(t)):(e.consume(t),y)}function v(e){return 62===e?O(e):y(e)}function x(t){return Xl(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||Yl(t)?(e.consume(t),w):_(t)}function _(t){return ic(t)?(s=_,D(t)):oc(t)?(e.consume(t),_):O(t)}function k(t){return 45===t||Yl(t)?(e.consume(t),k):47===t||62===t||rc(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),O):58===t||95===t||Xl(t)?(e.consume(t),S):ic(t)?(s=E,D(t)):oc(t)?(e.consume(t),E):O(t)}function S(t){return 45===t||46===t||58===t||95===t||Yl(t)?(e.consume(t),S):A(t)}function A(t){return 61===t?(e.consume(t),C):ic(t)?(s=A,D(t)):oc(t)?(e.consume(t),A):E(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,N):ic(t)?(s=C,D(t)):oc(t)?(e.consume(t),C):(e.consume(t),M)}function N(t){return t===r?(e.consume(t),r=void 0,T):null===t?n(t):ic(t)?(s=N,D(t)):(e.consume(t),N)}function M(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||rc(t)?E(t):(e.consume(t),M)}function T(e){return 47===e||62===e||rc(e)?E(e):n(e)}function O(i){return 62===i?(e.consume(i),e.exit("htmlTextData"),e.exit("htmlText"),t):n(i)}function D(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return oc(t)?cc(e,R,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):R(t)}function R(t){return e.enter("htmlTextData"),s(t)}}},lu={name:"labelStartLink",resolveAll:Qc.resolveAll,tokenize:function(e,t,n){const i=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),r};function r(e){return 94===e&&"_hiddenFootnoteSupport"in i.parser.constructs?n(e):t(e)}}},cu={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),i};function i(i){return ic(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}},uu={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,i=e.length-4,r=3;if(!("lineEnding"!==e[r][1].type&&"space"!==e[r][1].type||"lineEnding"!==e[i][1].type&&"space"!==e[i][1].type))for(t=r;++t<i;)if("codeTextData"===e[t][1].type){e[r][1].type="codeTextPadding",e[i][1].type="codeTextPadding",r+=2,i-=2;break}for(t=r-1,i++;++t<=i;)void 0===n?t!==i&&"lineEnding"!==e[t][1].type&&(n=t):t!==i&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),i-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let i,r,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),s(t)};function s(t){return 96===t?(e.consume(t),o++,s):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(r=e.enter("codeTextSequence"),i=0,c(t)):ic(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||ic(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),i++,c):i===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(r.type="codeTextData",l(n))}}},du={42:Ec,43:Ec,45:Ec,48:Ec,49:Ec,50:Ec,51:Ec,52:Ec,53:Ec,54:Ec,55:Ec,56:Ec,57:Ec,62:Cc},hu={91:Ic},pu={[-2]:Pc,[-1]:Pc,32:Pc},fu={35:Fc,42:kc,45:[Bc,kc],60:Uc,61:Bc,95:kc,96:qc,126:qc},mu={38:Wc,92:Zc},gu={[-5]:Xc,[-4]:Xc,[-3]:Xc,33:nu,38:Wc,42:ru,60:[su,au],91:lu,92:[cu,Zc],93:Qc,95:ru,96:uu},bu={null:[ru,bc]},yu={null:[42,95]},vu={null:[]};function xu(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},o=[];let s=[],a=[],l=!0;const c={attempt:b(function(e,t){y(e,t.from)}),check:b(g),consume:function(e){ic(e)?(i.line++,i.column=1,i.offset+=-3===e?2:1,v()):-1!==e&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),u.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:b(g,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){r[e.line]=e.column,v()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const i=[];let r;for(;++n<e.length;){const o=e[n];let s;if("string"==typeof o)s=o;else switch(o){case-5:s="\r";break;case-4:s="\n";break;case-3:s="\r\n";break;case-2:s=t?" ":"\t";break;case-1:if(!t&&r)continue;s=" ";break;default:s=String.fromCharCode(o)}r=-2===o,i.push(s)}return i.join("")}(p(e),t)},sliceStream:p,write:function(e){return s=Ul(s,e),function(){let e;for(;i._index<s.length;){const t=s[i._index];if("string"==typeof t)for(e=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===e&&i._bufferIndex<t.length;)m(t.charCodeAt(i._bufferIndex));else m(t)}}(),null!==s[s.length-1]?[]:(y(t,0),u.events=Yc(o,u.events,u),u.events)}};let d,h=t.tokenize.call(u,c);return t.resolveAll&&o.push(t),u;function p(e){return function(e,t){const n=t.start._index,i=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex;let s;if(n===r)s=[e[n].slice(i,o)];else{if(s=e.slice(n,r),i>-1){const e=s[0];"string"==typeof e?s[0]=e.slice(i):s.shift()}o>0&&s.push(e[r].slice(0,o))}return s}(s,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:r,offset:o}=i;return{_bufferIndex:e,_index:t,line:n,column:r,offset:o}}function m(e){l=void 0,d=e,h=h(e)}function g(e,t){t.restore()}function b(e,t){return function(n,r,o){let s,d,h,p;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):function(e){return function(t){const n=null!==t&&e[t],i=null!==t&&e.null;return m([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(i)?i:i?[i]:[]])(t)}}(n);function m(e){return s=e,d=0,0===e.length?o:g(e[d])}function g(e){return function(n){return p=function(){const e=f(),t=u.previous,n=u.currentConstruct,r=u.events.length,o=Array.from(a);return{from:r,restore:function(){i=e,u.previous=t,u.currentConstruct=n,u.events.length=r,a=o,v()}}}(),h=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?y():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,b,y)(n)}}function b(t){return l=!0,e(h,p),r}function y(e){return l=!0,p.restore(),++d<s.length?g(s[d]):o}}}function y(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&jl(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function v(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}const wu=/[\0\t\n\r]/g;function _u(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const ku=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Eu(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return _u(n.slice(t?2:1),t?16:10)}return Gc(n)||e}const Su={}.hasOwnProperty;function Au(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(y),autolinkProtocol:u,autolinkEmail:u,atxHeading:r(m),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(f),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(f,o),codeText:r(function(){return{type:"inlineCode",value:""}},o),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(g),hardBreakTrailing:r(g),htmlFlow:r(b,o),htmlFlowData:u,htmlText:r(b,o),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:o,link:r(y),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(m),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:a(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let i;n?(i=_u(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):i=Gc(t);this.stack[this.stack.length-1].value+=i},characterReference:function(e){this.stack.pop().position.end=Cu(e.end)},codeFenced:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:a(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Dc(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(h),hardBreakTrailing:a(h),htmlFlow:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:a(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:a(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const 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}),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(ku,Eu)}(t),n.identifier=Dc(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak)return n.children[n.children.length-1].position.end=Cu(e.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),d.call(this,e))},link:a(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const 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}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Dc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};Nu(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let r={type:"root",children:[]};const a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:c,data:n},u=[];let d=-1;for(;++d<e.length;)"listOrdered"!==e[d][1].type&&"listUnordered"!==e[d][1].type||("enter"===e[d][0]?u.push(d):d=i(e,u.pop(),d));for(d=-1;++d<e.length;){const n=t[e[d][0]];Su.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){const e=a.tokenStack[a.tokenStack.length-1];(e[1]||Tu).call(a,void 0,e[0])}for(r.position={start:Cu(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Cu(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 i,r,o,s,a=t-1,l=-1,c=!1;for(;++a<=n;){const t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,s=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!i||s||l||o||(o=a),s=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:s=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(i){let s=a;for(r=void 0;s--;){const t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;r&&(e[r][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",r=s}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}o&&(!r||o<r)&&(i._spread=!0),i.end=Object.assign({},r?e[r][1].start:t[1].end),e.splice(r||a,0,["exit",i,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){const r={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};i=r,e.splice(a,0,["enter",r,t[2]]),a++,n++,o=void 0,s=!0}}}return e[t][1]._spread=c,n}function r(e,t){return function(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:Cu(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){const n=this.stack.pop(),i=this.tokenStack.pop();if(!i)throw new Error("Cannot close `"+e.type+"` ("+ml({start:e.start,end:e.end})+"): it’s not open");i[0].type!==e.type&&(t?t.call(this,e,i[0]):(i[1]||Tu).call(this,e,i[0])),n.position.end=Cu(e.end)}function c(){return Fl(this.stack.pop())}function u(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n={type:"text",value:""},n.position={start:Cu(e.start),end:void 0},t.push(n)),this.stack.push(n)}function d(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Cu(e.end)}function h(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function f(){return{type:"code",lang:null,meta:null,value:""}}function m(){return{type:"heading",depth:0,children:[]}}function g(){return{type:"break"}}function b(){return{type:"html",value:""}}function y(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}}(n)(function(e){for(;!Hl(e););return e}(function(e){const t={constructs:Gl([k,...(e||{}).extensions||[]]),content:n(uc),defined:[],document:n(dc),flow:n(gc),lazy:{},string:n(yc),text:n(vc)};return t;function n(e){return function(n){return xu(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",i=!0;return function(r,o,s){const a=[];let l,c,u,d,h;for(r=n+("string"==typeof r?r.toString():new TextDecoder(o||void 0).decode(r)),u=0,n="",i&&(65279===r.charCodeAt(0)&&u++,i=void 0);u<r.length;){if(wu.lastIndex=u,l=wu.exec(r),d=l&&void 0!==l.index?l.index:r.length,h=r.charCodeAt(d),!l){n=r.slice(u);break}if(10===h&&u===d&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),u<d&&(a.push(r.slice(u,d)),t+=d-u),h){case 0:a.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),a.push(-2);t++<c;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return s&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))}function Cu(e){return{line:e.line,column:e.column,offset:e.offset}}function Nu(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Nu(e,i):Mu(e,i)}}function Mu(e,t){let n;for(n in t)if(Su.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Tu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ml({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ml({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ml({start:t.start,end:t.end})+") is still open")}function Ou(e){const t=this;t.parser=function(n){return Au(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const Du="object"==typeof self?self:globalThis,Iu=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),i=r=>{if(e.has(r))return e.get(r);const[o,s]=t[r];switch(o){case 0:case-1:return n(s,r);case 1:{const e=n([],r);for(const t of s)e.push(i(t));return e}case 2:{const e=n({},r);for(const[t,n]of s)e[i(t)]=i(n);return e}case 3:return n(new Date(s),r);case 4:{const{source:e,flags:t}=s;return n(new RegExp(e,t),r)}case 5:{const e=n(new Map,r);for(const[t,n]of s)e.set(i(t),i(n));return e}case 6:{const e=n(new Set,r);for(const t of s)e.add(i(t));return e}case 7:{const{name:e,message:t}=s;return n(new Du[e](t),r)}case 8:return n(BigInt(s),r);case"BigInt":return n(Object(BigInt(s)),r);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:e}=new Uint8Array(s);return n(new DataView(e),s)}}return n(new Du[o](s),r)};return i})(new Map,e)(0),Ru="",{toString:Pu}={},{keys:Lu}=Object,Fu=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Pu.call(e).slice(8,-1);switch(n){case"Array":return[1,Ru];case"Object":return[2,Ru];case"Date":return[3,Ru];case"RegExp":return[4,Ru];case"Map":return[5,Ru];case"Set":return[6,Ru];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Bu=([e,t])=>0===e&&("function"===t||"symbol"===t),zu=(e,{json:t,lossy:n}={})=>{const i=[];return((e,t,n,i)=>{const r=(e,t)=>{const r=i.push(e)-1;return n.set(t,r),r},o=i=>{if(n.has(i))return n.get(i);let[s,a]=Fu(i);switch(s){case 0:{let t=i;switch(a){case"bigint":s=8,t=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return r([-1],i)}return r([s,t],i)}case 1:{if(a){let e=i;return"DataView"===a?e=new Uint8Array(i.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(i)),r([a,[...e]],i)}const e=[],t=r([s,e],i);for(const t of i)e.push(o(t));return t}case 2:{if(a)switch(a){case"BigInt":return r([a,i.toString()],i);case"Boolean":case"Number":case"String":return r([a,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());const n=[],l=r([s,n],i);for(const t of Lu(i))!e&&Bu(Fu(i[t]))||n.push([o(t),o(i[t])]);return l}case 3:return r([s,i.toISOString()],i);case 4:{const{source:e,flags:t}=i;return r([s,{source:e,flags:t}],i)}case 5:{const t=[],n=r([s,t],i);for(const[n,r]of i)(e||!Bu(Fu(n))&&!Bu(Fu(r)))&&t.push([o(n),o(r)]);return n}case 6:{const t=[],n=r([s,t],i);for(const n of i)!e&&Bu(Fu(n))||t.push(o(n));return n}}const{message:l}=i;return r([s,{name:a,message:l}],i)};return o})(!(t||n),!!t,new Map,i)(e),i},ju="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Iu(zu(e,t)):structuredClone(e):(e,t)=>Iu(zu(e,t));function Uu(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(37===o&&Yl(e.charCodeAt(n+1))&&Yl(e.charCodeAt(n+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(s=String.fromCharCode(o,t),r=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(i,n),encodeURIComponent(s)),i=n+r+1,s=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function Vu(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function $u(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const Hu=function(e){if(null==e)return Ku;if("function"==typeof e)return qu(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Hu(e[n]);return qu(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):function(e){const t=e;return qu(function(n){const i=n;let r;for(r in e)if(i[r]!==t[r])return!1;return!0})}(e);if("string"==typeof e)return t=e,qu(function(e){return e&&e.type===t});var t;throw new Error("Expected function, string, or object as test")};function qu(e){return function(t,n,i){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,i||void 0))}}function Ku(){return!0}const Gu=[],Wu=!1;function Zu(e,t,n,i){let r;"function"==typeof t&&"function"!=typeof n?(i=n,n=t):r=t;const o=Hu(r),s=i?-1:1;!function e(r,a,l){const c=r&&"object"==typeof r?r:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+r.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,h=Gu;if((!t||o(r,a,l[l.length-1]||void 0))&&(h=function(e){return Array.isArray(e)?e:"number"==typeof e?[true,e]:null==e?Gu:[e]}(n(r,l)),h[0]===Wu))return h;if("children"in r&&r.children){const t=r;if(t.children&&"skip"!==h[0])for(u=(i?t.children.length:-1)+s,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===Wu)return c;u="number"==typeof c[1]?c[1]:u+s}}return h}}(e,void 0,[])()}function Xu(e,t,n,i){let r,o,s;"function"==typeof t&&"function"!=typeof n?(o=void 0,s=t,r=n):(o=t,s=n,r=i),Zu(e,o,function(e,t){const n=t[t.length-1],i=n?n.children.indexOf(e):void 0;return s(e,i,n)},r)}function Yu(e,t){const n=t.referenceType;let i="]";if("collapsed"===n?i+="[]":"full"===n&&(i+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),o=r[0];o&&"text"===o.type?o.value="["+o.value:r.unshift({type:"text",value:"["});const s=r[r.length-1];return s&&"text"===s.type?s.value+=i:r.push({type:"text",value:i}),r}function Qu(e){const t=e.spread;return null==t?e.children.length>1:t}function Ju(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),r=0;const o=[];for(;i;)o.push(ed(t.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return o.push(ed(t.slice(r),r>0,!1)),o.join("")}function ed(e,t,n){let i=0,r=e.length;if(t){let t=e.codePointAt(i);for(;9===t||32===t;)i++,t=e.codePointAt(i)}if(n){let t=e.codePointAt(r-1);for(;9===t||32===t;)r--,t=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}const td={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",i={};t.lang&&(i.className=["language-"+t.lang]);let r={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(r.data={meta:t.meta}),e.patch(t,r),r=e.applyData(t,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(t,r),r},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=Uu(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let s,a=e.footnoteCounts.get(i);void 0===a?(a=0,e.footnoteOrder.push(i),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(i,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Yu(e,t);const r={src:Uu(i.url||""),alt:t.alt};null!==i.title&&void 0!==i.title&&(r.title=i.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:Uu(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Yu(e,t);const r={href:Uu(i.url||"")};null!==i.title&&void 0!==i.title&&(r.title=i.title);const o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:Uu(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},listItem:function(e,t,n){const i=e.all(t),r=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=Qu(n[i])}return t}(n):Qu(t),o={},s=[];if("boolean"==typeof t.checked){const e=i[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},i.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<i.length;){const e=i[a];(r||0!==a||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||r?s.push(e):s.push(...e.children)}const l=i[i.length-1];l&&(r||"element"!==l.type||"p"!==l.tagName)&&s.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},i=e.all(t);let r=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++r<i.length;){const e=i[r];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),i=n.shift(),r=[];if(i){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],n),r.push(n)}if(n.length>0){const i={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=pl(t.children[1]),s=hl(t.children[t.children.length-1]);o&&s&&(i.position={start:o,end:s}),r.push(i)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const i=n?n.children:void 0,r=0===(i?i.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,s=o?o.length:t.children.length;let a=-1;const l=[];for(;++a<s;){const n=t.children[a],i={},s=o?o[a]:void 0;s&&(i.align=s);let c={type:"element",tagName:r,properties:i,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:Ju(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:nd,yaml:nd,definition:nd,footnoteDefinition:nd};function nd(){}const id={}.hasOwnProperty,rd={};function od(e,t){e.position&&(t.position=function(e){const t=pl(e),n=hl(e);if(t&&n)return{start:t,end:n}}(e))}function sd(e,t){let n=t;if(e&&e.data){const t=e.data.hName,i=e.data.hChildren,r=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&r&&Object.assign(n.properties,ju(r)),"children"in n&&n.children&&null!=i&&(n.children=i)}return n}function ad(e,t){const n=t.data||{},i=!("value"in t)||id.call(n,"hProperties")||id.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,i),e.applyData(t,i)}function ld(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:"\n"});++i<e.length;)i&&n.push({type:"text",value:"\n"}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function cd(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ud(e,t){const n=function(e,t){const n=t||rd,i=new Map,r=new Map,o=new Map,s={...td,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let i=-1;for(;++i<n.length;){const r=a.one(n[i],e);if(r){if(i&&"break"===n[i-1].type&&(Array.isArray(r)||"text"!==r.type||(r.value=cd(r.value)),!Array.isArray(r)&&"element"===r.type)){const e=r.children[0];e&&"text"===e.type&&(e.value=cd(e.value))}Array.isArray(r)?t.push(...r):t.push(r)}}}return t},applyData:sd,definitionById:i,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:s,one:function(e,t){const n=e.type,i=a.handlers[n];if(id.call(a.handlers,n)&&i)return i(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,i=ju(n);return i.children=a.all(e),i}return ju(e)}return(a.options.unknownHandler||ad)(a,e,t)},options:n,patch:od,wrap:ld};return Xu(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?i:r,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a}(e,t),i=n.one(e,void 0),r=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Vu,i=e.options.footnoteBackLabel||$u,r=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const r=e.footnoteById.get(e.footnoteOrder[l]);if(!r)continue;const o=e.all(r),s=String(r.identifier).toUpperCase(),c=Uu(s.toLowerCase());let u=0;const d=[],h=e.footnoteCounts.get(s);for(;void 0!==h&&++u<=h;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof i?i:i(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else o.push(...d);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(r,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ju(s),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(n),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&o.children.push({type:"text",value:"\n"},r),o}function dd(e,t){return e&&"run"in e?async function(n,i){const r=ud(n,{file:i,...t});await e.run(r,i)}:function(n,i){return ud(n,{file:i,...e||t})}}function hd(e){if(e)throw e}var pd=w(710);function fd(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}const md=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');xd(e);let n,i=0,r=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){i=o+1;break}}else r<0&&(n=!0,r=o+1);return r<0?"":e.slice(i,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){i=o+1;break}}else s<0&&(n=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return i===r?r=s:r<0&&(r=e.length),e.slice(i,r)},gd=function(e){if(xd(e),0===e.length)return".";let t,n=-1,i=e.length;for(;--i;)if(47===e.codePointAt(i)){if(t){n=i;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},bd=function(e){xd(e);let t,n=e.length,i=-1,r=0,o=-1,s=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)i<0&&(t=!0,i=n+1),46===a?o<0?o=n:1!==s&&(s=1):o>-1&&(s=-1);else if(t){r=n+1;break}}return o<0||i<0||0===s||1===s&&o===i-1&&o===r+1?"":e.slice(o,i)},yd=function(...e){let t,n=-1;for(;++n<e.length;)xd(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){xd(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,i,r="",o=0,s=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(s===l-1||1===a);else if(s!==l-1&&2===a){if(r.length<2||2!==o||46!==r.codePointAt(r.length-1)||46!==r.codePointAt(r.length-2))if(r.length>2){if(i=r.lastIndexOf("/"),i!==r.length-1){i<0?(r="",o=0):(r=r.slice(0,i),o=r.length-1-r.lastIndexOf("/")),s=l,a=0;continue}}else if(r.length>0){r="",o=0,s=l,a=0;continue}t&&(r=r.length>0?r+"/..":"..",o=2)}else r.length>0?r+="/"+e.slice(s+1,l):r=e.slice(s+1,l),o=l-s-1;s=l,a=0}else 46===n&&a>-1?a++:a=-1}return r}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},vd="/";function xd(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wd=function(){return"/"};function _d(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}const kd=["history","path","basename","stem","extname","dirname"];class Ed{constructor(e){let t;t=e?_d(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":wd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,i=-1;for(;++i<kd.length;){const e=kd[i];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)kd.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?md(this.path):void 0}set basename(e){Ad(e,"basename"),Sd(e,"basename"),this.path=yd(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?gd(this.path):void 0}set dirname(e){Cd(this.basename,"dirname"),this.path=yd(e||"",this.basename)}get extname(){return"string"==typeof this.path?bd(this.path):void 0}set extname(e){if(Sd(e,"extname"),Cd(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=yd(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){_d(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!_d(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),Ad(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?md(this.path,this.extname):void 0}set stem(e){Ad(e,"stem"),Sd(e,"stem"),this.path=yd(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const i=this.message(e,t,n);throw i.fatal=!0,i}info(e,t,n){const i=this.message(e,t,n);return i.fatal=void 0,i}message(e,t,n){const i=new vl(e,t,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Sd(e,t){if(e&&e.includes(vd))throw new Error("`"+t+"` cannot be a path: did not expect `"+vd+"`")}function Ad(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Cd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Nd=function(e){const t=this.constructor.prototype,n=t[e],i=function(){return n.apply(i,arguments)};return Object.setPrototypeOf(i,t),i},Md={}.hasOwnProperty;class Td extends Nd{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){const e=[],t={run:function(...t){let n=-1;const i=t.pop();if("function"!=typeof i)throw new TypeError("Expected function as last argument, not "+i);!function r(o,...s){const a=e[++n];let l=-1;if(o)i(o);else{for(;++l<t.length;)null!==s[l]&&void 0!==s[l]||(s[l]=t[l]);t=s,a?function(e,t){let n;return function(...t){const o=e.length>t.length;let s;o&&t.push(i);try{s=e.apply(this,t)}catch(e){if(o&&n)throw e;return i(e)}o||(s&&s.then&&"function"==typeof s.then?s.then(r,i):s instanceof Error?i(s):r(s))};function i(e,...i){n||(n=!0,t(e,...i))}function r(e){i(null,e)}}(a,r)(...s):i(null,...s)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){const e=new Td;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(pd(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(Rd("data",this.frozen),this.namespace[e]=t,this):Md.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Rd("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const i=t.call(e,...n);"function"==typeof i&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Fd(e),n=this.parser||this.Parser;return Dd("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Dd("process",this.parser||this.Parser),Id("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(i,r){const o=Fd(e),s=n.parse(o);function a(e,n){e||!n?r(e):i?i(n):t(void 0,n)}n.run(s,o,function(e,t,i){if(e||!t||!i)return a(e);const r=t,o=n.stringify(r,i);var s;"string"==typeof(s=o)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(s)?i.value=o:i.result=o,a(e,i)})}}processSync(e){let t,n=!1;return this.freeze(),Dd("processSync",this.parser||this.Parser),Id("processSync",this.compiler||this.Compiler),this.process(e,function(e,i){n=!0,hd(e),t=i}),Ld("processSync","process",n),t}run(e,t,n){Pd(e),this.freeze();const i=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?r(void 0,n):new Promise(r);function r(r,o){const s=Fd(t);i.run(e,s,function(t,i,s){const a=i||e;t?o(t):r?r(a):n(void 0,a,s)})}}runSync(e,t){let n,i=!1;return this.run(e,t,function(e,t){hd(e),n=t,i=!0}),Ld("runSync","run",i),n}stringify(e,t){this.freeze();const n=Fd(t),i=this.compiler||this.Compiler;return Id("stringify",i),Pd(e),i(e,n)}use(e,...t){const n=this.attachers,i=this.namespace;if(Rd("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?s(e):o(e)}return this;function r(e){if("function"==typeof e)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(t,n)}else o(e)}}function o(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(e.plugins),e.settings&&(i.settings=pd(!0,i.settings,e.settings))}function s(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;)r(e[t])}}function a(e,t){let i=-1,r=-1;for(;++i<n.length;)if(n[i][0]===e){r=i;break}if(-1===r)n.push([e,...t]);else if(t.length>0){let[i,...o]=t;const s=n[r][1];fd(s)&&fd(i)&&(i=pd(!0,s,i)),n[r]=[e,i,...o]}}}}const Od=(new Td).freeze();function Dd(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Id(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rd(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pd(e){if(!fd(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Ld(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fd(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Ed(e)}const Bd=[],zd={allowDangerousHtml:!0},jd=/^(https?|ircs?|mailto|xmpp)$/i,Ud=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Vd(i){const r=function(e){const t=e.rehypePlugins||Bd,n=e.remarkPlugins||Bd,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...zd}:zd;return Od().use(Ou).use(n).use(dd,i).use(t)}(i),o=function(e){const t=e.children||"",n=new Ed;return"string"==typeof t&&(n.value=t),n}(i);return function(i,r){const o=r.allowedElements,s=r.allowElement,a=r.components,l=r.disallowedElements,c=r.skipHtml,u=r.unwrapDisallowed,d=r.urlTransform||$d;for(const e of Ud)Object.hasOwn(r,e.from)&&Sa((e.from,e.to&&e.to,e.id));return Xu(i,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return c?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Pl)if(Object.hasOwn(Pl,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],i=Pl[t];(null===i||i.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let i=o?!o.includes(e.tagName):!!l&&l.includes(e.tagName);if(!i&&s&&"number"==typeof t&&(i=!s(e,t,n)),i&&n&&"number"==typeof t)return u&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=function(e,t){return function(n,i,r,o){const s=Array.isArray(r.children),a=pl(n);return t(i,r,o,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=t.jsx,o=t.jsxs,i=function(e,t,n,i){const s=Array.isArray(n.children)?o:r;return i?s(t,n,i):s(t,n)}}var r,o;const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?rl:il,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},a=Al(s,e,void 0);return a&&"string"!=typeof a?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}(i,{Fragment:e,components:a,ignoreInvalidStyle:!0,jsx:t,jsxs:n,passKeys:!0,passNode:!0})}(r.runSync(r.parse(o),o),i)}function $d(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return-1===t||-1!==r&&t>r||-1!==n&&t>n||-1!==i&&t>i||jd.test(e.slice(0,t))?e:""}function Hd(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;-1!==r;)i++,r=n.indexOf(t,r+t.length);return i}function qd(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function Kd(e){return"function"==typeof e?e:function(){return e}}const Gd="phrasing",Wd=["autolink","link","image","label"];function Zd(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xd(e){this.config.enter.autolinkProtocol.call(this,e)}function Yd(e){this.config.exit.autolinkProtocol.call(this,e)}function Qd(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Jd(e){this.config.exit.autolinkEmail.call(this,e)}function eh(e){this.exit(e)}function th(e){!function(e,t,n){const i=Hu((n||{}).ignore||[]),r=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const e=n[i];t.push([qd(e[0]),Kd(e[1])])}return t}(t);let o=-1;for(;++o<r.length;)Zu(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){const e=t[s],r=n?n.children:void 0;if(i(e,r?r.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],i=r[o][0],s=r[o][1];let a=0;const l=n.children.indexOf(e);let c=!1,u=[];i.lastIndex=0;let d=i.exec(e.value);for(;d;){const n=d.index,r={index:d.index,input:d.input,stack:[...t,e]};let o=s(...d,r);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?i.lastIndex=n+1:(a!==n&&u.push({type:"text",value:e.value.slice(a,n)}),Array.isArray(o)?u.push(...o):o&&u.push(o),a=n+d[0].length,c=!0),!i.global)break;d=i.exec(e.value)}return c?(a<e.value.length&&u.push({type:"text",value:e.value.slice(a)}),n.children.splice(l,1,...u)):u=[e],l+u.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,nh],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ih]],{ignore:["link","linkReference"]})}function nh(e,t,n,i,r){let o="";if(!rh(r))return!1;if(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!function(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}(n))return!1;const s=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=Hd(e,"(");let o=Hd(e,")");for(;-1!==i&&r>o;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),o++;return[e,n]}(n+i);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function ih(e,t,n,i){return!(!rh(i,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rh(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||ac(n)||sc(n))&&(!t||47!==n)}function oh(){this.buffer()}function sh(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ah(){this.buffer()}function lh(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ch(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Dc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uh(e){this.exit(e)}function dh(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Dc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hh(e){this.exit(e)}function ph(e,t,n,i){const r=n.createTracker(i);let o=r.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=r.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=r.move("]"),o}function fh(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,i,r){const o=i.createTracker(r);let s=o.move("[^");const a=i.enter("footnoteDefinition"),l=i.enter("label");return s+=o.move(i.safe(i.associationId(e),{before:s,after:"]"})),l(),s+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),s+=o.move((t?"\n":" ")+i.indentLines(i.containerFlow(e,o.current()),t?gh:mh))),a(),s},footnoteReference:ph},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function mh(e,t,n){return 0===t?e:gh(e,0,n)}function gh(e,t,n){return(n?"":" ")+e}ph.peek=function(){return"["};const bh=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function yh(e){this.enter({type:"delete",children:[]},e)}function vh(e){this.exit(e)}function xh(e,t,n,i){const r=n.createTracker(i),o=n.enter("strikethrough");let s=r.move("~~");return s+=n.containerPhrasing(e,{...r.current(),before:s,after:"~"}),s+=r.move("~~"),o(),s}function wh(e){return e.length}function _h(e){return null==e?"":String(e)}function kh(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function Eh(e,t,n){return">"+(n?"":" ")+e}function Sh(e,t){return Ah(e,t.inConstruct,!0)&&!Ah(e,t.notInConstruct,!1)}function Ah(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Ch(e,t,n,i){let r=-1;for(;++r<n.unsafe.length;)if("\n"===n.unsafe[r].character&&Sh(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return"\\\n"}function Nh(e,t,n){return(n?"":" ")+e}function Mh(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Th(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Oh(e,t,n){const i=iu(e),r=iu(t);return void 0===i?void 0===r?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===r?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===i?void 0===r?{inside:!1,outside:!1}:1===r?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===r?{inside:!1,outside:!1}:1===r?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Dh(e,t,n,i){const r=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),o=n.enter("emphasis"),s=n.createTracker(i),a=s.move(r);let l=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()}));const c=l.charCodeAt(0),u=Oh(i.before.charCodeAt(i.before.length-1),c,r);u.inside&&(l=Th(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Oh(i.after.charCodeAt(0),d,r);h.inside&&(l=l.slice(0,-1)+Th(d));const p=s.move(r);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function Ih(e){return e.value||""}function Rh(e,t,n,i){const r=Mh(n),o='"'===r?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+r),c+=l.move(n.safe(e.title,{before:c,after:r,...l.current()})),c+=l.move(r),a()),c+=l.move(")"),s(),c}function Ph(e,t,n,i){const r=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(i);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),"full"!==r&&c&&c===d?"shortcut"===r?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(d+"]"),l}function Lh(e,t,n){let i=e.value||"",r="`",o=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<n.unsafe.length;){const e=n.unsafe[o],t=n.compilePattern(e);let r;if(e.atBreak)for(;r=t.exec(i);){let e=r.index;10===i.charCodeAt(e)&&13===i.charCodeAt(e-1)&&e--,i=i.slice(0,e)+" "+i.slice(r.index+1)}}return r+i+r}function Fh(e,t){const n=Fl(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function Bh(e,t,n,i){const r=Mh(n),o='"'===r?"Quote":"Apostrophe",s=n.createTracker(i);let a,l;if(Fh(e,n)){const t=n.stack;n.stack=[],a=n.enter("autolink");let i=s.move("<");return i+=s.move(n.containerPhrasing(e,{before:i,after:">",...s.current()})),i+=s.move(">"),a(),n.stack=t,i}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=s.move(" "+r),c+=s.move(n.safe(e.title,{before:c,after:r,...s.current()})),c+=s.move(r),l()),c+=s.move(")"),a(),c}function zh(e,t,n,i){const r=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(i);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),"full"!==r&&c&&c===d?"shortcut"===r?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(d+"]"),l}function jh(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Uh(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}xh.peek=function(){return"~"},Dh.peek=function(e,t,n){return n.options.emphasis||"*"},Ih.peek=function(){return"<"},Rh.peek=function(){return"!"},Ph.peek=function(){return"!"},Lh.peek=function(){return"`"},Bh.peek=function(e,t,n){return Fh(e,n)?"<":"["},zh.peek=function(){return"["};const Vh=Hu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $h(e,t,n,i){const r=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),o=n.enter("strong"),s=n.createTracker(i),a=s.move(r+r);let l=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()}));const c=l.charCodeAt(0),u=Oh(i.before.charCodeAt(i.before.length-1),c,r);u.inside&&(l=Th(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Oh(i.after.charCodeAt(0),d,r);h.inside&&(l=l.slice(0,-1)+Th(d));const p=s.move(r+r);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}$h.peek=function(e,t,n){return n.options.strong||"*"};const Hh={blockquote:function(e,t,n,i){const r=n.enter("blockquote"),o=n.createTracker(i);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),Eh);return r(),s},break:Ch,code:function(e,t,n,i){const r=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),o=e.value||"",s="`"===r?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(o,Nh);return e(),t}const a=n.createTracker(i),l=r.repeat(Math.max(function(e,t){const n=String(e);let i=n.indexOf(t),r=i,o=0,s=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==i;)i===r?++o>s&&(s=o):o=1,r=i+t.length,i=n.indexOf(t,r);return s}(o,r)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const t=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...a.current()})),t()}return u+=a.move("\n"),o&&(u+=a.move(o+"\n")),u+=a.move(l),c(),u},definition:function(e,t,n,i){const r=Mh(n),o='"'===r?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+r),c+=l.move(n.safe(e.title,{before:c,after:r,...l.current()})),c+=l.move(r),a()),s(),c},emphasis:Dh,hardBreak:Ch,heading:function(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(i);if(function(e,t){let n=!1;return Xu(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,Wu}),Boolean((!e.depth||e.depth<3)&&Fl(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),i=n.enter("phrasing"),s=n.containerPhrasing(e,{...o.current(),before:"\n",after:"\n"});return i(),t(),s+"\n"+(1===r?"=":"-").repeat(s.length-(Math.max(s.lastIndexOf("\r"),s.lastIndexOf("\n"))+1))}const s="#".repeat(r),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...o.current()});return/^[\t ]/.test(c)&&(c=Th(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c},html:Ih,image:Rh,imageReference:Ph,inlineCode:Lh,link:Bh,linkReference:zh,list:function(e,t,n,i){const r=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):jh(n);const a=e.ordered?"."===s?")":".":function(e){const t=jh(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&s===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==s&&"-"!==s||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),Uh(n)===s&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,i);return n.bulletLastUsed=s,n.bulletCurrent=o,r(),c},listItem:function(e,t,n,i){const r=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let o=n.bulletCurrent||jh(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let s=o.length+1;("tab"===r||"mixed"===r&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));const a=n.createTracker(i);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?o:o+" ".repeat(s-o.length))+e});return l(),c},paragraph:function(e,t,n,i){const r=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,i);return o(),r(),s},root:function(e,t,n,i){return(e.children.some(function(e){return Vh(e)})?n.containerPhrasing:n.containerFlow).call(n,e,i)},strong:$h,text:function(e,t,n,i){return n.safe(e.value,i)},thematicBreak:function(e,t,n){const i=(Uh(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?i.slice(0,-1):i}};function qh(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function Kh(e){this.exit(e),this.data.inTable=void 0}function Gh(e){this.enter({type:"tableRow",children:[]},e)}function Wh(e){this.exit(e)}function Zh(e){this.enter({type:"tableCell",children:[]},e)}function Xh(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Yh));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Yh(e,t){return"|"===t?t:e}function Qh(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let i=Hh.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(i=i.replace(/\|/g,"\\$&")),i},table:function(e,t,n,i){return a(function(e,t,n){const i=e.children;let r=-1;const o=[],s=t.enter("table");for(;++r<i.length;)o[r]=l(i[r],t,n);return s(),o}(e,n,i),e.align)},tableCell:s,tableRow:function(e,t,n,i){const r=a([l(e,n,i)]);return r.slice(0,r.indexOf("\n"))}}};function s(e,t,n,i){const r=n.enter("tableCell"),s=n.enter("phrasing"),a=n.containerPhrasing(e,{...i,before:o,after:o});return s(),r(),a}function a(e,t){return function(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||wh,o=[],s=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],i=[];let o=-1;for(e[u].length>c&&(c=e[u].length);++o<e[u].length;){const s=_h(e[u][o]);if(!1!==n.alignDelimiters){const e=r(s);i[o]=e,(void 0===l[o]||e>l[o])&&(l[o]=e)}t.push(s)}s[u]=t,a[u]=i}let d=-1;if("object"==typeof i&&"length"in i)for(;++d<c;)o[d]=kh(i[d]);else{const e=kh(i);for(;++d<c;)o[d]=e}d=-1;const h=[],p=[];for(;++d<c;){const e=o[d];let t="",i="";99===e?(t=":",i=":"):108===e?t=":":114===e&&(i=":");let r=!1===n.alignDelimiters?1:Math.max(1,l[d]-t.length-i.length);const s=t+"-".repeat(r)+i;!1!==n.alignDelimiters&&(r=t.length+r+i.length,r>l[d]&&(l[d]=r),p[d]=r),h[d]=s}s.splice(1,0,h),a.splice(1,0,p),u=-1;const f=[];for(;++u<s.length;){const e=s[u],t=a[u];d=-1;const i=[];for(;++d<c;){const r=e[d]||"";let s="",a="";if(!1!==n.alignDelimiters){const e=l[d]-(t[d]||0),n=o[d];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),a=" ".repeat(e/2-.5)):(s=" ".repeat(e/2),a=s):a=" ".repeat(e)}!1===n.delimiterStart||d||i.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===r||!1===n.delimiterStart&&!d||i.push(" "),!1!==n.alignDelimiters&&i.push(s),i.push(r),!1!==n.alignDelimiters&&i.push(a),!1!==n.padding&&i.push(" "),!1===n.delimiterEnd&&d===c-1||i.push("|")}f.push(!1===n.delimiterEnd?i.join("").replace(/ +$/,""):i.join(""))}return f.join("\n")}(e,{align:t,alignDelimiters:i,padding:n,stringLength:r})}function l(e,t,n){const i=e.children;let r=-1;const o=[],a=t.enter("tableRow");for(;++r<i.length;)o[r]=s(i[r],0,t,n);return a(),o}}function Jh(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function ep(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const i=t.children;let r,o=-1;for(;++o<i.length;){const e=i[o];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function tp(e,t,n,i){const r=e.children[0],o="boolean"==typeof e.checked&&r&&"paragraph"===r.type,s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(i);o&&a.move(s);let l=Hh.listItem(e,t,n,{...i,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}const np={tokenize:function(e,t,n){let i=0;return function t(o){return(87===o||119===o)&&i<3?(i++,e.consume(o),t):46===o&&3===i?(e.consume(o),r):n(o)};function r(e){return null===e?n(e):t(e)}},partial:!0},ip={tokenize:function(e,t,n){let i,r,o;return s;function s(t){return 46===t||95===t?e.check(op,l,a)(t):null===t||rc(t)||ac(t)||45!==t&&sc(t)?l(t):(o=!0,e.consume(t),s)}function a(t){return 95===t?i=!0:(r=i,i=void 0),e.consume(t),s}function l(e){return r||i||!o?n(e):t(e)}},partial:!0},rp={tokenize:function(e,t){let n=0,i=0;return r;function r(s){return 40===s?(n++,e.consume(s),r):41===s&&i<n?o(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(op,t,o)(s):null===s||rc(s)||ac(s)?t(s):(e.consume(s),r)}function o(t){return 41===t&&i++,e.consume(t),r}},partial:!0},op={tokenize:function(e,t,n){return i;function i(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),i):38===s?(e.consume(s),o):93===s?(e.consume(s),r):60===s||null===s||rc(s)||ac(s)?t(s):n(s)}function r(e){return null===e||40===e||91===e||rc(e)||ac(e)?t(e):i(e)}function o(e){return Xl(e)?s(e):n(e)}function s(t){return 59===t?(e.consume(t),i):Xl(t)?(e.consume(t),s):n(t)}},partial:!0},sp={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(e){return Yl(e)?n(e):t(e)}},partial:!0},ap={name:"wwwAutolink",tokenize:function(e,t,n){const i=this;return function(t){return 87!==t&&119!==t||!hp.call(i,i.previous)||gp(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(np,e.attempt(ip,e.attempt(rp,r),n),n)(t))};function r(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:hp},lp={name:"protocolAutolink",tokenize:function(e,t,n){const i=this;let r="",o=!1;return function(t){return 72!==t&&104!==t||!pp.call(i,i.previous)||gp(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(t),e.consume(t),s)};function s(t){if(Xl(t)&&r.length<5)return r+=String.fromCodePoint(t),e.consume(t),s;if(58===t){const n=r.toLowerCase();if("http"===n||"https"===n)return e.consume(t),a}return n(t)}function a(t){return 47===t?(e.consume(t),o?l:(o=!0,a)):n(t)}function l(t){return null===t||Jl(t)||rc(t)||ac(t)||sc(t)?n(t):e.attempt(ip,e.attempt(rp,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:pp},cp={name:"emailAutolink",tokenize:function(e,t,n){const i=this;let r,o;return function(t){return mp(t)&&fp.call(i,i.previous)&&!gp(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(t)):n(t)};function s(t){return mp(t)?(e.consume(t),s):64===t?(e.consume(t),a):n(t)}function a(t){return 46===t?e.check(sp,c,l)(t):45===t||95===t||Yl(t)?(o=!0,e.consume(t),a):c(t)}function l(t){return e.consume(t),r=!0,a}function c(s){return o&&r&&Xl(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:fp},up={};let dp=48;for(;dp<123;)up[dp]=cp,dp++,58===dp?dp=65:91===dp&&(dp=97);function hp(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||rc(e)}function pp(e){return!Xl(e)}function fp(e){return!(47===e||mp(e))}function mp(e){return 43===e||45===e||46===e||95===e||Yl(e)}function gp(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if(("labelLink"===i.type||"labelImage"===i.type)&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}up[43]=cp,up[45]=cp,up[46]=cp,up[95]=cp,up[72]=[cp,lp],up[104]=[cp,lp],up[87]=[cp,ap],up[119]=[cp,ap];const bp={tokenize:function(e,t,n){const i=this;return cc(e,function(e){const r=i.events[i.events.length-1];return r&&"gfmFootnoteDefinitionIndent"===r[1].type&&4===r[2].sliceSerialize(r[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function yp(e,t,n){const i=this;let r=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;r--;){const e=i.events[r][1];if("labelImage"===e.type){s=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(r){if(!s||!s._balanced)return n(r);const a=Dc(i.sliceSerialize({start:s.end,end:i.now()}));return 94===a.codePointAt(0)&&o.includes(a.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(r),e.exit("gfmFootnoteCallLabelMarker"),t(r)):n(r)}}function vp(e,t){let n,i=e.length;for(;i--;)if("labelImage"===e[i][1].type&&"enter"===e[i][0]){n=e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[i+1],e[i+2],["enter",r,t],e[i+3],e[i+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(i,e.length-i+1,...l),e}function xp(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),a};function a(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(a){if(s>999||93===a&&!o||null===a||91===a||rc(a))return n(a);if(93===a){e.exit("chunkString");const o=e.exit("gfmFootnoteCallString");return r.includes(Dc(i.sliceSerialize(o)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(a)}return rc(a)||(o=!0),s++,e.consume(a),92===a?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function wp(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s,a=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(a>999||93===t&&!s||null===t||91===t||rc(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return o=Dc(i.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return rc(t)||(s=!0),a++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),r.includes(o)||r.push(o),cc(e,h,"gfmFootnoteDefinitionWhitespace")):n(t)}function h(e){return t(e)}}function _p(e,t,n){return e.check(pc,t,e.attempt(bp,t,n))}function kp(e){e.exit("gfmFootnoteDefinition")}function Ep(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,i){const r=this.previous,o=this.events;let s=0;return function(t){return 126===r&&"characterEscape"!==o[o.length-1][1].type?i(t):(e.enter("strikethroughSequenceTemporary"),a(t))};function a(o){const l=iu(r);if(126===o)return s>1?i(o):(e.consume(o),s++,a);if(s<2&&!t)return i(o);const c=e.exit("strikethroughSequenceTemporary"),u=iu(o);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(o)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let i=n;for(;i--;)if("exit"===e[i][0]&&"strikethroughSequenceTemporary"===e[i][1].type&&e[i][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[i][1].end.offset-e[i][1].start.offset){e[n][1].type="strikethroughSequence",e[i][1].type="strikethroughSequence";const r={type:"strikethrough",start:Object.assign({},e[i][1].start),end:Object.assign({},e[n][1].end)},o={type:"strikethroughText",start:Object.assign({},e[i][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",r,t],["enter",e[i][1],t],["exit",e[i][1],t],["enter",o,t]],a=t.parser.constructs.insideSpan.null;a&&jl(s,s.length,0,Yc(a,e.slice(i+1,n),t)),jl(s,s.length,0,[["exit",o,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",r,t]]),jl(e,i-1,n-i+3,s),n=i+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class Sp{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,i){let r=0;if(0!==n||0!==i.length){for(;r<e.map.length;){if(e.map[r][0]===t)return e.map[r][1]+=n,void e.map[r][2].push(...i);r+=1}e.map.push([t,n,i])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(const t of i)e.push(t);i=n.pop()}this.map.length=0}}function Ap(e,t){let n=!1;const i=[];for(;t<e.length;){const r=e[t];if(n){if("enter"===r[0])"tableContent"===r[1].type&&i.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===r[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=i.length-1;i[e]="left"===i[e]?"center":"right"}}else if("tableDelimiterRow"===r[1].type)break}else"enter"===r[0]&&"tableDelimiterRow"===r[1].type&&(n=!0);t+=1}return i}function Cp(e,t,n){const i=this;let r,o=0,s=0;return function(e){let t=i.events.length-1;for(;t>-1;){const e=i.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const r=t>-1?i.events[t][1].type:null,o="tableHead"===r||"tableRow"===r?x:a;return o===x&&i.parser.lazy[i.now().line]?n(e):o(e)};function a(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(r=!0,s+=1),l(e)}(t)}function l(t){return null===t?n(t):ic(t)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):oc(t)?cc(e,l,"whitespace")(t):(s+=1,r&&(r=!1,o+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||rc(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(t):(e.enter("tableDelimiterRow"),r=!1,oc(t)?cc(e,h,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):h(t))}function h(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):v(t)}function p(t){return oc(t)?cc(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(s+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(s+=1,m(t)):null===t||ic(t)?y(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(t))}function b(t){return oc(t)?cc(e,y,"whitespace")(t):y(t)}function y(n){return 124===n?h(n):(null===n||ic(n))&&r&&o===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function x(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||ic(n)?(e.exit("tableRow"),t(n)):oc(n)?cc(e,w,"whitespace")(n):(e.enter("data"),_(n))}function _(t){return null===t||124===t||rc(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?k:_)}function k(t){return 92===t||124===t?(e.consume(t),_):_(t)}}function Np(e,t){let n,i,r,o=-1,s=!0,a=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const h=new Sp;for(;++o<e.length;){const p=e[o],f=p[1];"enter"===p[0]?"tableHead"===f.type?(u=!1,0!==d&&(Tp(h,t,d,n,i),i=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(o,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,r=void 0,l=[0,0,0,0],c=[0,o+1,0,0],u&&(u=!1,i={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(o,0,[["enter",i,t]])),a="tableDelimiterRow"===f.type?2:i?3:1):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(c[0]=c[1],r=Mp(h,t,l,a,void 0,r)),l=c,c=[l[1],o,0,0])):(s=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],r=Mp(h,t,l,a,void 0,r),l=[0,0,0,0]),c[2]=o)):"tableHead"===f.type?(u=!0,d=o):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=o,0!==l[1]?(c[0]=c[1],r=Mp(h,t,l,a,o,r)):0!==c[1]&&(r=Mp(h,t,c,a,o,r)),a=0):!a||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=o)}for(0!==d&&Tp(h,t,d,n,i),h.consume(t.events),o=-1;++o<t.events.length;){const e=t.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=Ap(t.events,o))}return e}function Mp(e,t,n,i,r,o){const s=1===i?"tableHeader":2===i?"tableDelimiter":"tableData";0!==n[0]&&(o.end=Object.assign({},Op(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const a=Op(t.events,n[1]);if(o={type:s,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",o,t]]),0!==n[2]){const r=Op(t.events,n[2]),o=Op(t.events,n[3]),s={type:"tableContent",start:Object.assign({},r),end:Object.assign({},o)};if(e.add(n[2],0,[["enter",s,t]]),2!==i){const i=t.events[n[2]],r=t.events[n[3]];if(i[1].end=Object.assign({},r[1].end),i[1].type="chunkText",i[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,i=n[3]-n[2]-1;e.add(t,i,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==r&&(o.end=Object.assign({},Op(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function Tp(e,t,n,i,r){const o=[],s=Op(t.events,n);r&&(r.end=Object.assign({},s),o.push(["exit",r,t])),i.end=Object.assign({},s),o.push(["exit",i,t]),e.add(n+1,0,o)}function Op(e,t){const n=e[t],i="enter"===n[0]?"start":"end";return n[1][i]}const Dp={name:"tasklistCheck",tokenize:function(e,t,n){const i=this;return function(t){return null===i.previous&&i._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),r):n(t)};function r(t){return rc(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),o):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),o):n(t)}function o(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(i){return ic(i)?t(i):oc(i)?e.check({tokenize:Ip},t,n)(i):n(i)}}};function Ip(e,t,n){return cc(e,function(e){return null===e?n(e):t(e)},"whitespace")}const Rp={},Pp=function(e,t,n){const i=Hu(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if("number"==typeof t){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if((t=e.children.indexOf(t))<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(i(e.children[t],t,e))return e.children[t]},Lp=function(e){if(null==e)return Bp;if("string"==typeof e)return t=e,Fp(function(e){return e.tagName===t});var t;if("object"==typeof e)return function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lp(e[n]);return Fp(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e);if("function"==typeof e)return Fp(e);throw new Error("Expected function, string, or array as `test`")};function Fp(e){return function(t,n,i){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e&&"tagName"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,i||void 0))}}function Bp(e){return Boolean(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}const zp=/\n/g,jp=/[\t ]+/g,Up=Lp("br"),Vp=Lp(function(e){return"td"===e.tagName||"th"===e.tagName}),$p=Lp("p"),Hp=Lp("tr"),qp=Lp(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return Boolean((e.properties||{}).hidden)},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),Kp=Lp(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Gp(e,t,n){return"element"===e.type?function(e,t,n){const i=Xp(e,n),r=e.children||[];let o,s,a=-1,l=[];if(qp(e))return l;for(Up(e)||Hp(e)&&Pp(t,e,Hp)?s="\n":$p(e)?(o=2,s=2):Kp(e)&&(o=1,s=1);++a<r.length;)l=l.concat(Gp(r[a],e,{whitespace:i,breakBefore:a?void 0:o,breakAfter:a<r.length-1?Up(r[a+1]):s}));return Vp(e)&&Pp(t,e,Vp)&&l.push("\t"),o&&l.unshift(o),s&&l.push(s),l}(e,t,n):"text"===e.type?"normal"===n.whitespace?Wp(e,n):function(e){return[String(e.value)]}(e):[]}function Wp(e,t){const n=String(e.value),i=[],r=[];let o=0;for(;o<=n.length;){zp.lastIndex=o;const e=zp.exec(n),r=e&&"index"in e?e.index:n.length;i.push(Zp(n.slice(o,r).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==o||t.breakBefore,r!==n.length||t.breakAfter)),o=r+1}let s,a=-1;for(;++a<i.length;)8203===i[a].charCodeAt(i[a].length-1)||a<i.length-1&&8203===i[a+1].charCodeAt(0)?(r.push(i[a]),s=void 0):i[a]?("number"==typeof s&&r.push(s),r.push(i[a]),s=0):0!==a&&a!==i.length-1||r.push(0);return r}function Zp(e,t,n){const i=[];let r,o=0;for(;o<e.length;){jp.lastIndex=o;const n=jp.exec(e);r=n?n.index:e.length,o||r||!n||t||i.push(""),o!==r&&i.push(e.slice(o,r)),o=n?r+n[0].length:r}return o===r||n||i.push(""),i.join(" ")}function Xp(e,t){if("element"===e.type){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}const Yp=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Qp=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Jp=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ef=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),tf=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();var nf="[0-9](_*[0-9])*",rf=`\\.(${nf})`,of="[0-9a-fA-F](_*[0-9a-fA-F])*",sf={className:"number",variants:[{begin:`(\\b(${nf})((${rf})|\\.)?|(${rf}))[eE][+-]?(${nf})[fFdD]?\\b`},{begin:`\\b(${nf})((${rf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${rf})[fFdD]?\\b`},{begin:`\\b(${nf})[fFdD]\\b`},{begin:`\\b0[xX]((${of})\\.?|(${of})?\\.(${of}))[pP][+-]?(${nf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${of})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function af(e,t,n){return-1===n?"":e.replace(t,i=>af(e,t,n-1))}const lf="[A-Za-z$_][0-9A-Za-z$_]*",cf=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],uf=["true","false","null","undefined","NaN","Infinity"],df=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],hf=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],pf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ff=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mf=[].concat(pf,df,hf);var gf="[0-9](_*[0-9])*",bf=`\\.(${gf})`,yf="[0-9a-fA-F](_*[0-9a-fA-F])*",vf={className:"number",variants:[{begin:`(\\b(${gf})((${bf})|\\.)?|(${bf}))[eE][+-]?(${gf})[fFdD]?\\b`},{begin:`\\b(${gf})((${bf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${bf})[fFdD]?\\b`},{begin:`\\b(${gf})[fFdD]\\b`},{begin:`\\b0[xX]((${yf})\\.?|(${yf})?\\.(${yf}))[pP][+-]?(${gf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${yf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const xf=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],wf=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),_f=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),kf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ef=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Sf=_f.concat(kf).sort().reverse(),Af=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Cf=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Nf=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Mf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Tf=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Of(e){return e?"string"==typeof e?e:e.source:null}function Df(e){return If("(?=",e,")")}function If(...e){return e.map(e=>Of(e)).join("")}function Rf(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map(e=>Of(e)).join("|")+")"}const Pf=e=>If(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Lf=["Protocol","Type"].map(Pf),Ff=["init","self"].map(Pf),Bf=["Any","Self"],zf=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],jf=["false","nil","true"],Uf=["assignment","associativity","higherThan","left","lowerThan","none","right"],Vf=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],$f=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Hf=Rf(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),qf=Rf(Hf,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Kf=If(Hf,qf,"*"),Gf=Rf(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Wf=Rf(Gf,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Zf=If(Gf,Wf,"*"),Xf=If(/[A-Z]/,Wf,"*"),Yf=["attached","autoclosure",If(/convention\(/,Rf("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",If(/objc\(/,Zf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Qf=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"],Jf="[A-Za-z$_][0-9A-Za-z$_]*",em=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tm=["true","false","null","undefined","NaN","Infinity"],nm=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],im=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rm=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],om=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],sm=[].concat(rm,nm,im),am={arduino:function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",h={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[p,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:h,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,p,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:h,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n},bash:function(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(a);const l={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},c=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),u={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[c,e.SHEBANG(),u,l,o,s,{match:/(\/[a-z._-]+)+/},a,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},n]}},c:function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",h={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},p=[c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:p.concat([{begin:/\(/,end:/\)/,keywords:h,contains:p.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:h,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:h,disableAutodetect:!0,illegal:"</",contains:[].concat(f,m,p,[c,{begin:e.IDENT_RE+"::",keywords:h},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:h}}},cpp:function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",h={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[p,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:h,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,p,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:h,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},csharp:function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),i={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},r={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=e.inherit(r,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.C_BLOCK_COMMENT_MODE],a.contains=[u,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const d={variants:[{className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},p=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},d,i,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+p+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[d,i,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}},css:function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),i=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Jp.join("|")+")"},{begin:":(:)?("+ef.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...i,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...i,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Qp.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...i,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Yp.join("|")+")\\b"}]}},diff:function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},go:function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}},graphql:function(e){const t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}},ini:function(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[i,o,r,s,n,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[i,a,o,r,s,n]}}]}},java:function(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+af("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),r={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:r,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:r,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,sf,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},sf,o]}},javascript:function(e){const t=e.regex,n=lf,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,i=e.input[n];if("<"===i||","===i)return void t.ignoreMatch();let r;">"===i&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const o=e.input.substring(n);((r=o.match(/^\s*=/))||(r=o.match(/^\s+extends\s+/))&&0===r.index)&&t.ignoreMatch()}},r={$pattern:lf,keyword:cf,literal:uf,built_in:mf,"variable.language":ff},o="[0-9](_?[0-9])*",s=`\\.(${o})`,a="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={className:"number",variants:[{begin:`(\\b(${a})((${s})|\\.)?|(${s}))[eE][+-]?(${o})\\b`},{begin:`\\b(${a})\\b((${s})\\b|\\.)?|(${s})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},u={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},d={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,c]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},m=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,d,h,p,{match:/\$\d+/},l];c.contains=m.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(m)});const g=[].concat(f,c.contains),b=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:r,contains:["self"].concat(g)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:b},v={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...df,...hf]}},w={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},_={match:t.concat(/\b/,function(e){return t.concat("(?!",e.join("|"),")")}([...pf,"super","import"].map(e=>`${e}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,d,h,p,f,{match:/\$\d+/},l,x,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},_,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,E,{match:/\$[(.]/}]}},json:function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}},kotlin:function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},r={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[r,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,r,i]}]};i.contains.push(o);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},l=vf,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=u;return d.variants[1].contains=[u],u.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,s,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,s,a,o,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,a]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}},less:function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=Sf,i="[\\w-]+",r="("+i+"|@\\{"+i+"\\})",o=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:wf.join(" ")},u={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,u,l("variable","@@?"+i,10),l("variable","@\\{"+i+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const d=s.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},p={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ef.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},m={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:d}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,l("keyword","all\\b"),l("variable","@\\{"+i+"\\}"),{begin:"\\b("+xf.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",r,0),l("selector-id","#"+r),l("selector-class","\\."+r,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+_f.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+kf.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:i+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,m,b,p,g,h,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:o}},lua:function(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}},makefile:function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},i={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},r={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,i,r,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o]}},markdown:function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},r={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},o=e.inherit(i,{contains:[]}),s=e.inherit(r,{contains:[]});i.contains.push(s),r.contains.push(o);let a=[t,n];return[i,r,o,s].forEach(e=>{e.contains=e.contains.concat(a)}),a=a.concat(i,r),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,r,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}},objectivec:function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},perl:function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},r={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},s={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},a={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[e.BACKSLASH_ESCAPE,r,a],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(e,i,r="\\1")=>{const o="\\1"===r?r:t.concat(r,i);return t.concat(t.concat("(?:",e,")"),i,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,r,n)},h=(e,i,r)=>t.concat(t.concat("(?:",e,")"),i,/(?:\\.|[^\\\/])*?/,r,n),p=[a,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",t.either(...u,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",t.either(...u,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return r.contains=p,o.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:p}},php:function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+i},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c="[ \t\n]",u={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),l,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(a),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},d={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["false","null","true"],p=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],f=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],m={keyword:p,literal:(e=>{const t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(h),built_in:f},g=e=>e.map(e=>e.replace(/\|\d+$/,"")),b={variants:[{match:[/new/,t.concat(c,"+"),t.concat("(?!",g(f).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},y=t.concat(i,"\\b(?!\\()"),v={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),y],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),y],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},x={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:m,contains:[x,s,v,e.C_BLOCK_COMMENT_MODE,u,d,b]},_={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",g(p).join("\\b|"),"|",g(f).join("\\b|"),"\\b)"),i,t.concat(c,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(_);const k=[x,v,e.C_BLOCK_COMMENT_MODE,u,d,b],E={begin:t.concat(/#\[\s*\\?/,t.either(r,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...k]},...k,{scope:"meta",variants:[{match:r},{match:o}]}]};return{case_insensitive:!1,keywords:m,contains:[E,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},s,_,v,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},b,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",E,s,v,e.C_BLOCK_COMMENT_MODE,u,d]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},u,d]}},"php-template":function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}},plaintext:function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}},python:function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],r={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:r,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",u=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,d=`\\b|${i.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${u}))[eE][+-]?(${c})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${c})[jJ](?=${d})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:r,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:["self",o,h,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,h,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:r,illegal:/(<\/|\?)|=>/,contains:[o,h,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,f,l]}]}},"python-repl":function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}},r:function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[o,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},ruby:function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},p={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},f=[u,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[p]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);c.contains=f,p.contains=f;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:o,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(f)}},rust:function(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:a},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:a,type:l}},{className:"punctuation",begin:"->"},o]}},scss:function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=Mf,i=Nf,r="@[a-z-]+",o={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Af.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Tf.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Cf.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}},shell:function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}},sql:function(e){const t=e.regex,n=e.COMMENT("--","$"),i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],r=i,o=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!i.includes(e)),s={match:t.concat(/\b/,t.either(...r),/\s*\(/),relevance:0,keywords:{built_in:r}};function a(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}const l={scope:"keyword",match:a(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const i=n;return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:i(e)?`${e}|0`:e)}(o,{when:e=>e.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:a(["double precision","large object","with timezone","without timezone"])},l,s,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},swift:function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Rf(...Lf,...Ff)],className:{2:"keyword"}},o={match:If(/\./,Rf(...zf)),relevance:0},s=zf.filter(e=>"string"==typeof e).concat(["_|0"]),a={variants:[{className:"keyword",match:Rf(...zf.filter(e=>"string"!=typeof e).concat(Bf).map(Pf),...Ff)}]},l={$pattern:Rf(/\b\w+/,/#\w+/),keyword:s.concat(Vf),literal:jf},c=[r,o,a],u=[{match:If(/\./,Rf(...$f)),relevance:0},{className:"built_in",match:If(/\b/,Rf(...$f),/(?=\()/)}],d={match:/->/,relevance:0},h=[d,{className:"operator",relevance:0,variants:[{match:Kf},{match:`\\.(\\.|${qf})+`}]}],p="([0-9]_*)+",f="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e="")=>({className:"subst",variants:[{match:If(/\\/,e,/[0\\tnr"']/)},{match:If(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:If(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst",label:"interpol",begin:If(/\\/,e,/\(/),end:/\)/}),v=(e="")=>({begin:If(e,/"""/),end:If(/"""/,e),contains:[g(e),b(e),y(e)]}),x=(e="")=>({begin:If(e,/"/),end:If(/"/,e),contains:[g(e),y(e)]}),w={className:"string",variants:[v(),v("#"),v("##"),v("###"),x(),x("#"),x("##"),x("###")]},_=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},E=e=>{const t=If(e,/\//),n=If(/\//,e);return{begin:t,end:n,contains:[..._,{scope:"comment",begin:`#(?!.*${n})`,end:/$/}]}},S={scope:"regexp",variants:[E("###"),E("##"),E("#"),k]},A={match:If(/`/,Zf,/`/)},C=[A,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${Wf}+`}],N=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Qf,contains:[...h,m,w]}]}},{scope:"keyword",match:If(/@/,Rf(...Yf),Df(Rf(/\(/,/\s+/)))},{scope:"meta",match:If(/@/,Zf)}],M={match:Df(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:If(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Wf,"+")},{className:"type",match:Xf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:If(/\s+&\s+/,Df(Xf)),relevance:0}]},T={begin:/</,end:/>/,keywords:l,contains:[...i,...c,...N,d,M]};M.contains.push(T);const O={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:If(Zf,/\s*:/),keywords:"_|0",relevance:0},...i,S,...c,...u,...h,m,w,...C,...N,M]},D={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,M]},I={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:Rf(Df(If(Zf,/\s*:/)),Df(If(Zf,/\s+/,Zf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Zf}]},...i,...c,...h,m,w,...N,M,O],endsParent:!0,illegal:/["']/},R={match:[/(func|macro)/,/\s+/,Rf(A.match,Zf,Kf)],className:{1:"keyword",3:"title.function"},contains:[D,I,t],illegal:[/\[/,/%/]},P={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[D,I,t],illegal:/\[|%/},L={match:[/operator/,/\s+/,Kf],className:{1:"keyword",3:"title"}},F={begin:[/precedencegroup/,/\s+/,Xf],className:{1:"keyword",3:"title"},contains:[M],keywords:[...Uf,...jf],end:/}/},B={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Zf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:l,contains:[D,...c,{begin:/:/,end:/\{/,keywords:l,contains:[{scope:"title.class.inherited",match:Xf},...c],relevance:0}]};for(const e of w.variants){const t=e.contains.find(e=>"interpol"===e.label);t.keywords=l;const n=[...c,...u,...h,m,w,...C];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...i,R,P,{match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},{match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},B,L,F,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},S,...c,...u,...h,m,w,...C,...N,M,O]}},typescript:function(e){const t=e.regex,n=function(e){const t=e.regex,n=Jf,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,i=e.input[n];if("<"===i||","===i)return void t.ignoreMatch();let r;">"===i&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const o=e.input.substring(n);((r=o.match(/^\s*=/))||(r=o.match(/^\s+extends\s+/))&&0===r.index)&&t.ignoreMatch()}},r={$pattern:Jf,keyword:em,literal:tm,built_in:sm,"variable.language":om},o="[0-9](_?[0-9])*",s=`\\.(${o})`,a="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={className:"number",variants:[{begin:`(\\b(${a})((${s})|\\.)?|(${s}))[eE][+-]?(${o})\\b`},{begin:`\\b(${a})\\b((${s})\\b|\\.)?|(${s})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},u={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},d={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,c]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},m=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,d,h,p,{match:/\$\d+/},l];c.contains=m.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(m)});const g=[].concat(f,c.contains),b=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:r,contains:["self"].concat(g)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:b},v={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...nm,...im]}},w={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},_={match:t.concat(/\b/,function(e){return t.concat("(?!",e.join("|"),")")}([...rm,"super","import"].map(e=>`${e}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,d,h,p,f,{match:/\$\d+/},l,x,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},_,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,E,{match:/\$[(.]/}]}}(e),i=Jf,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},a={$pattern:Jf,keyword:em.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:tm,built_in:sm.concat(r),"variable.language":om},l={className:"meta",begin:"@"+i},c=(e,t,n)=>{const i=e.contains.findIndex(e=>e.label===t);if(-1===i)throw new Error("can not find mode to replace");e.contains.splice(i,1,n)};Object.assign(n.keywords,a),n.exports.PARAMS_CONTAINS.push(l);const u=n.contains.find(e=>"attr"===e.scope),d=Object.assign({},u,{match:t.concat(i,t.lookahead(/\s*\?:/))});return n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,u,d]),n.contains=n.contains.concat([l,o,s,d]),c(n,"shebang",e.SHEBANG()),c(n,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),n.contains.find(e=>"func.def"===e.label).relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n},vbnet:function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,r=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,n),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,r,/ *#/)},{begin:t.concat(/# */,t.either(i,n),/ +/,t.either(r,o),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}},wasm:function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}},xml:function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(r,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[r,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[r,o,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},yaml:function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},r=e.inherit(i,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},s={begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},a={begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},s,a,{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},i],c=[...l];return c.pop(),c.push(r),o.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:l}}},lm=w(74),cm={};class um{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const n=this.stack[this.stack.length-1],i=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):n.children.push(...i)}openNode(e){const t=this,n={type:"element",tagName:"span",properties:{className:e.split(".").map(function(e,n){return n?e+"_".repeat(n):t.options.classPrefix+e})},children:[]};this.stack[this.stack.length-1].children.push(n),this.stack.push(n)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const dm={},hm={a:({href:e,children:n,...i})=>t("a",{href:e,target:"_blank",rel:"noopener noreferrer",...i,children:n})},pm=[function(e){const t=e||Rp,n=this.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),r=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(function(e){return Gl([{text:up},{document:{91:{name:"gfmFootnoteDefinition",tokenize:wp,continuation:{tokenize:_p},exit:kp}},text:{91:{name:"gfmFootnoteCall",tokenize:xp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yp,resolveTo:vp}}},Ep(e),{flow:{null:{name:"table",tokenize:Cp,resolveAll:Np}}},{text:{91:Dp}}])}(t)),r.push([{transforms:[th],enter:{literalAutolink:Zd,literalAutolinkEmail:Xd,literalAutolinkHttp:Xd,literalAutolinkWww:Xd},exit:{literalAutolink:eh,literalAutolinkEmail:Jd,literalAutolinkHttp:Yd,literalAutolinkWww:Qd}},{enter:{gfmFootnoteCallString:oh,gfmFootnoteCall:sh,gfmFootnoteDefinitionLabelString:ah,gfmFootnoteDefinition:lh},exit:{gfmFootnoteCallString:ch,gfmFootnoteCall:uh,gfmFootnoteDefinitionLabelString:dh,gfmFootnoteDefinition:hh}},{canContainEols:["delete"],enter:{strikethrough:yh},exit:{strikethrough:vh}},{enter:{table:qh,tableData:Zh,tableHeader:Zh,tableRow:Gh},exit:{codeText:Xh,table:Kh,tableData:Wh,tableHeader:Wh,tableRow:Wh}},{exit:{taskListCheckValueChecked:Jh,taskListCheckValueUnchecked:Jh,paragraph:ep}}]),o.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gd,notInConstruct:Wd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gd,notInConstruct:Wd},{character:":",before:"[ps]",after:"\\/",inConstruct:Gd,notInConstruct:Wd}]},fh(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:bh}],handlers:{delete:xh}},Qh(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:tp}}]}}(t))}],fm=[function(e){const t=e||dm,n=t.aliases,i=t.detect||!1,r=t.languages||am,o=t.plainText,s=t.prefix,a=t.subset;let l="hljs";const c=function(e){const t=lm.newInstance();return e&&r(e),{highlight:n,highlightAuto:function(e,r){const o=(r||cm).subset||i();let s,a=-1,l=0;for(;++a<o.length;){const i=o[a];if(!t.getLanguage(i))continue;const c=n(i,e,r);c.data&&void 0!==c.data.relevance&&c.data.relevance>l&&(l=c.data.relevance,s=c)}return s||{type:"root",children:[],data:{language:void 0,relevance:l}}},listLanguages:i,register:r,registerAlias:function(e,n){if("string"==typeof e)t.registerAliases("string"==typeof n?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){const i=e[n];t.registerAliases("string"==typeof i?i:[...i],{languageName:n})}}},registered:function(e){return Boolean(t.getLanguage(e))}};function n(e,n,i){const r=i||cm,o="string"==typeof r.prefix?r.prefix:"hljs-";if(!t.getLanguage(e))throw new Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:um,classPrefix:o});const s=t.highlight(n,{ignoreIllegals:!0,language:e});if(s.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:s.errorRaised});const a=s._emitter.root,l=a.data;return l.language=s.language,l.relevance=s.relevance,a}function i(){return t.listLanguages()}function r(e,n){if("string"==typeof e)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}}(r);if(n&&c.registerAlias(n),s){const e=s.indexOf("-");l=-1===e?s:s.slice(0,e)}return function(e,t){Xu(e,"element",function(e,n,r){if("code"!==e.tagName||!r||"element"!==r.type||"pre"!==r.tagName)return;const u=function(e){const t=e.properties.className;let n,i=-1;if(Array.isArray(t)){for(;++i<t.length;){const e=String(t[i]);if("no-highlight"===e||"nohighlight"===e)return!1;n||"lang-"!==e.slice(0,5)||(n=e.slice(5)),n||"language-"!==e.slice(0,9)||(n=e.slice(9))}return n}}(e);if(!1===u||!u&&!i||u&&o&&o.includes(u))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(l)||e.properties.className.unshift(l);const d=function(e){const t={whitespace:"pre"}||{},n="children"in e?e.children:[],i=Kp(e),r=Xp(e,{whitespace:t.whitespace||"normal",breakBefore:!1,breakAfter:!1}),o=[];"text"!==e.type&&"comment"!==e.type||o.push(...Wp(e,{whitespace:r,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<n.length;)o.push(...Gp(n[s],e,{whitespace:r,breakBefore:s?void 0:i,breakAfter:s<n.length-1?Up(n[s+1]):i}));const a=[];let l;for(s=-1;++s<o.length;){const e=o[s];"number"==typeof e?void 0!==l&&e>l&&(l=e):e&&(void 0!==l&&l>-1&&a.push("\n".repeat(l)||" "),l=-1,a.push(e))}return a.join("")}(e);let h;try{h=u?c.highlight(u,d,{prefix:s}):c.highlightAuto(d,{prefix:s,subset:a})}catch(n){const i=n;if(u&&/Unknown language/.test(i.message))return void t.message("Cannot highlight as `"+u+"`, it’s not registered",{ancestors:[r,e],cause:i,place:e.position,ruleId:"missing-language",source:"rehype-highlight"});throw i}!u&&h.data&&h.data.language&&e.properties.className.push("language-"+h.data.language),h.children.length>0&&(e.children=h.children)})}}];function mm({content:e,createdAt:i}){const[r,o]=y(!1),s=async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch(e){console.error("Failed to copy text: ",e)}};return n(wa.div,{className:"bmxcb__message bmxcb__message--assistant",initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:400,damping:25,duration:.3},layout:!0,children:[t("div",{className:"bmxcb__message-avatar",children:n("div",{className:"bmxcb__avatar",children:[t("div",{className:"bmxcb__avatar-glow"}),t("img",{src:"https://www.bmx.trade/images/favicon.svg",alt:"BMX",className:"bmxcb__avatar-icon"})]})}),n("div",{className:"bmxcb__message-content",children:[t("div",{className:"bmxcb__markdown",children:t(Vd,{remarkPlugins:pm,rehypePlugins:fm,components:hm,children:e})}),n("div",{className:"bmxcb__message-footer",children:[t("div",{className:"bmxcb__message-time",children:_a(i)}),n("div",{className:"bmxcb__message-actions",children:[t("button",{className:"bmxcb__message-action",onClick:s,"aria-label":r?"Copied!":"Copy message",title:r?"Copied!":"Copy message",children:t(U,{size:14})}),t("button",{className:"bmxcb__message-action",onClick:async()=>{if(navigator.share)try{await navigator.share({title:"BMX Chat Response",text:e})}catch(e){console.error("Error sharing: ",e)}else s()},"aria-label":"Share message",title:"Share message",children:t(q,{size:14})})]})]})]})]})}function gm({message:e}){return e.role===C.USER?t(ka,{content:e.content,createdAt:e.createdAt}):e.role===C.ASSISTANT?t(mm,{content:e.content,createdAt:e.createdAt}):t(ka,{content:e.content})}function bm(){return n("div",{className:"bmxcb__message bmxcb__message--assistant",children:[t("div",{className:"bmxcb__message-avatar",children:n("div",{className:"bmxcb__avatar",children:[t("div",{className:"bmxcb__avatar-glow"}),t("img",{src:"https://www.bmx.trade/images/favicon.svg",alt:"BMX",className:"bmxcb__avatar-icon"})]})}),t("div",{className:"bmxcb__message-content",children:n("div",{className:"bmxcb__typing",children:[t(wa.span,{className:"bmxcb__dot",animate:{opacity:[.2,1,.2]},transition:{repeat:1/0,duration:1.2,delay:0}}),t(wa.span,{className:"bmxcb__dot",animate:{opacity:[.2,1,.2]},transition:{repeat:1/0,duration:1.2,delay:.2}}),t(wa.span,{className:"bmxcb__dot",animate:{opacity:[.2,1,.2]},transition:{repeat:1/0,duration:1.2,delay:.4}})]})})]})}const ym=({onSuggestionClick:e})=>{const i=(t,n)=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e?.(n))};return t("div",{className:"bmxcb__empty-state",children:n("div",{className:"bmxcb__empty-state-content",children:[t("h3",{className:"bmxcb__empty-state-title",children:"Welcome to BMX Chat"}),t("p",{className:"bmxcb__empty-state-description",children:"Ask me anything about BMX documentation, products, or features!"}),n("div",{className:"bmxcb__empty-state-suggestions",children:[t("span",{className:"bmxcb__empty-state-suggestion",children:"Try asking:"}),n("div",{className:"bmxcb__empty-state-suggestion-chips",children:[t("button",{className:"bmxcb__empty-state-chip",onClick:()=>e?.("What is BMX?"),onKeyDown:e=>i(e,"What is BMX?"),"aria-label":"Ask: What is BMX?",children:'"What is BMX?"'}),t("button",{className:"bmxcb__empty-state-chip",onClick:()=>e?.("How to trade?"),onKeyDown:e=>i(e,"How to trade?"),"aria-label":"Ask: How to trade?",children:'"How to trade?"'}),t("button",{className:"bmxcb__empty-state-chip",onClick:()=>e?.("BMX Deli Swap"),onKeyDown:e=>i(e,"BMX Deli Swap"),"aria-label":"Ask: BMX Deli Swap",children:'"BMX Deli Swap"'})]})]})]})})};function vm(e){return P({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"},child:[]}]})(e)}function xm({messages:i,sending:r,onSuggestionClick:o}){const s=b(null),a=b(null),[l,c]=y(!1),u=()=>{s.current?.scrollIntoView({behavior:"smooth"})};h(()=>{u()},[i]);const d=0===i.length;return t("div",{className:"bmxcb__messages "+(d?"bmxcb__messages--empty":""),ref:a,onScroll:()=>{if(a.current){const{scrollTop:e,scrollHeight:t,clientHeight:n}=a.current;c(!(t-e-n<100))}},children:d?t(ym,{onSuggestionClick:o}):n(e,{children:[i.map(e=>t(gm,{message:e},e.id)),r&&t(bm,{}),t("div",{ref:s}),l&&t("button",{className:"bmxcb__scroll-to-bottom",onClick:u,"aria-label":"Scroll to bottom",children:t(vm,{size:14})})]})})}const wm=c(({input:e,setInput:i,onKeyDown:r,onSend:o,placeholder:s,sending:a},l)=>{const c=b(null),u=l||c;return h(()=>{const e=u&&"object"==typeof u&&"current"in u?u.current:null;if(e){e.style.height="auto";const t=120,n=Math.min(e.scrollHeight,t);e.style.height=`${n}px`,e.scrollHeight>t?e.style.overflowY="auto":e.style.overflowY="hidden"}},[e,u]),n(wa.div,{className:"bmxcb__inputRow",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1,duration:.3},children:[t(wa.textarea,{ref:u,className:"bmxcb__input",value:e,onChange:e=>i(e.target.value),onKeyDown:r,placeholder:s,rows:1,whileFocus:{scale:1.02},transition:{type:"spring",stiffness:400,damping:25},"aria-label":"Message input"}),t(wa.button,{className:"bmxcb__send",onClick:o,disabled:a||!e.trim(),whileHover:{scale:1.05,y:-1},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:25},"aria-label":a?"Sending...":"Send message",children:t(wa.div,{animate:a?{rotate:360}:{rotate:0},transition:{duration:1,repeat:a?1/0:0,ease:"linear"},children:t(a?$:H,{size:16})})})]})}),_m=(e=768)=>{const[t,n]=y(window.matchMedia(`(max-width: ${e}px)`).matches);return h(()=>{const t=window.matchMedia(`(max-width: ${e}px)`),i=e=>n(e.matches);return t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[e]),t};function km(e,t){const[n,i]=y(()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(n){return console.warn(`Error reading localStorage key "${e}":`,n),t}});return[n,t=>{if("undefined"!=typeof window)try{i(t),window.localStorage.setItem(e,JSON.stringify(t))}catch(t){console.warn(`Error setting localStorage key "${e}":`,t)}else i(t)}]}const Em={hue:0,hoverIntensity:.5,rotateOnHover:!0};function Sm(){const[e,t]=km("bmx-chat-settings",Em);return{settings:e,updateHue:n=>{t({...e,hue:n})},updateHoverIntensity:n=>{t({...e,hoverIntensity:n})},updateRotateOnHover:n=>{t({...e,rotateOnHover:n})}}}function Am({onClose:e,onClearHistory:i,history:r}){const{settings:o,updateHue:s,updateHoverIntensity:a,updateRotateOnHover:l}=Sm(),c=_m();return n(wa.div,{className:"bmxcb__settings-panel",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.2},children:[n("div",{className:"bmxcb__settings-header",children:[n("div",{className:"bmxcb__settings-title",children:[t(z,{size:18}),"Settings"]}),t("button",{className:"bmxcb__settings-close",onClick:e,"aria-label":"Close settings",children:t(B,{size:18})})]}),n("div",{className:"bmxcb__settings-content",children:[!c&&n("div",{className:"bmxcb__settings-section",children:[n("h3",{className:"bmxcb__settings-section-title",children:[t(V,{size:16}),"Keyboard Shortcuts"]}),n("div",{className:"bmxcb__settings-shortcuts",children:[n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Ctrl"}),t("span",{children:"+"}),t("kbd",{className:"bmxcb__settings-kbd",children:"K"}),t("span",{children:"Toggle chat panel"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Ctrl"}),t("span",{children:"+"}),t("kbd",{className:"bmxcb__settings-kbd",children:"/"}),t("span",{children:"Toggle settings"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Esc"}),t("span",{children:"Close panel/settings"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("span",{children:"Click outside"}),t("span",{children:"Close panel"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Tab"}),t("span",{children:"Navigate forward"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Shift"}),t("span",{children:"+"}),t("kbd",{className:"bmxcb__settings-kbd",children:"Tab"}),t("span",{children:"Navigate backward"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Enter"}),t("span",{children:"Send message / Activate"})]}),n("div",{className:"bmxcb__settings-shortcut",children:[t("kbd",{className:"bmxcb__settings-kbd",children:"Shift"}),t("span",{children:"+"}),t("kbd",{className:"bmxcb__settings-kbd",children:"Enter"}),t("span",{children:"New line in input"})]})]})]}),n("div",{className:"bmxcb__settings-section",children:[n("h3",{className:"bmxcb__settings-section-title",children:[t(j,{size:16}),"Orb Appearance"]}),n("div",{className:"bmxcb__settings-group",children:[n("label",{className:"bmxcb__settings-label",children:["Color Hue: ",o.hue,"°"]}),t("input",{type:"range",min:"0",max:"360",value:o.hue,onChange:e=>s(Number(e.target.value)),className:"bmxcb__settings-slider"})]}),n("div",{className:"bmxcb__settings-group",children:[n("label",{className:"bmxcb__settings-label",children:["Hover Intensity: ",Math.round(100*o.hoverIntensity),"%"]}),t("input",{type:"range",min:"0",max:"1",step:"0.1",value:o.hoverIntensity,onChange:e=>a(Number(e.target.value)),className:"bmxcb__settings-slider"})]}),t("div",{className:"bmxcb__settings-group",children:n("label",{className:"bmxcb__settings-checkbox-label",children:[t("input",{type:"checkbox",checked:o.rotateOnHover,onChange:e=>l(e.target.checked),className:"bmxcb__settings-checkbox"}),t("span",{children:"Rotate on hover"})]})})]}),r.length>0&&t("div",{className:"bmxcb__settings-section",children:n("button",{className:"bmxcb__settings-clear-button",onClick:()=>{i(),e()},children:[t(K,{size:16}),"Clear Chat History"]})})]})]})}const Cm=c(({title:i,messages:r,input:o,setInput:s,onKeyDown:a,onSend:l,onClose:c,placeholder:u,sending:d,showSettings:p,onToggleSettings:f,onClearHistory:m,onSuggestionClick:g},y)=>{const v=b(null),x=_m();return h(()=>{p||!v.current||x||v.current.focus()},[p,x]),t(wa.div,{ref:y,className:"bmxcb__panel",role:"dialog","aria-modal":"true","aria-label":"BMX Chat",onKeyDown:e=>{if("Tab"===e.key){const t=y&&"object"==typeof y&&"current"in y?y.current:null,n=t?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(n&&n.length>0){const t=n[0],i=n[n.length-1];e.shiftKey?document.activeElement===t&&(e.preventDefault(),i.focus()):document.activeElement===i&&(e.preventDefault(),t.focus())}}},initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{type:"spring",stiffness:300,damping:30,duration:.3},children:p?t(Am,{onClose:f,onClearHistory:m,history:r}):n(e,{children:[t(W,{title:i,onClose:c,onSettings:f}),t(xm,{messages:r,sending:d,onSuggestionClick:g}),t(wm,{ref:v,input:o,setInput:s,onKeyDown:a,onSend:l,placeholder:u,sending:d})]})})});function Nm(e){let t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function Mm(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Tm(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Om(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Dm(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function Im(e){let t=e[0],n=e[1],i=e[2];return t*t+n*n+i*i}function Rm(e,t){let n=t[0],i=t[1],r=t[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Pm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Lm(e,t,n){let i=t[0],r=t[1],o=t[2],s=n[0],a=n[1],l=n[2];return e[0]=r*l-o*a,e[1]=o*s-i*l,e[2]=i*a-r*s,e}const Fm=function(){const e=[0,0,0],t=[0,0,0];return function(n,i){Mm(e,n),Mm(t,i),Rm(e,e),Rm(t,t);let r=Pm(e,t);return r>1?0:r<-1?Math.PI:Math.acos(r)}}();class Bm extends Array{constructor(e=0,t=e,n=e){return super(e,t,n),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(e){this[0]=e}set y(e){this[1]=e}set z(e){this[2]=e}set(e,t=e,n=e){return e.length?this.copy(e):(function(e,t,n,i){e[0]=t,e[1]=n,e[2]=i}(this,e,t,n),this)}copy(e){return Mm(this,e),this}add(e,t){return t?Tm(this,e,t):Tm(this,this,e),this}sub(e,t){return t?Om(this,e,t):Om(this,this,e),this}multiply(e){var t,n,i;return e.length?(n=this,i=e,(t=this)[0]=n[0]*i[0],t[1]=n[1]*i[1],t[2]=n[2]*i[2]):Dm(this,this,e),this}divide(e){var t,n,i;return e.length?(n=this,i=e,(t=this)[0]=n[0]/i[0],t[1]=n[1]/i[1],t[2]=n[2]/i[2]):Dm(this,this,1/e),this}inverse(e=this){var t,n;return n=e,(t=this)[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],this}len(){return Nm(this)}distance(e){return e?function(e,t){let n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+i*i+r*r)}(this,e):Nm(this)}squaredLen(){return Im(this)}squaredDistance(e){return e?function(e,t){let n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return n*n+i*i+r*r}(this,e):Im(this)}negate(e=this){var t,n;return n=e,(t=this)[0]=-n[0],t[1]=-n[1],t[2]=-n[2],this}cross(e,t){return t?Lm(this,e,t):Lm(this,this,e),this}scale(e){return Dm(this,this,e),this}normalize(){return Rm(this,this),this}dot(e){return Pm(this,e)}equals(e){return t=e,this[0]===t[0]&&this[1]===t[1]&&this[2]===t[2];var t}applyMatrix3(e){return function(e,t,n){let i=t[0],r=t[1],o=t[2];e[0]=i*n[0]+r*n[3]+o*n[6],e[1]=i*n[1]+r*n[4]+o*n[7],e[2]=i*n[2]+r*n[5]+o*n[8]}(this,this,e),this}applyMatrix4(e){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=n[3]*i+n[7]*r+n[11]*o+n[15];s=s||1,e[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/s,e[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/s,e[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/s}(this,this,e),this}scaleRotateMatrix4(e){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=n[3]*i+n[7]*r+n[11]*o+n[15];s=s||1,e[0]=(n[0]*i+n[4]*r+n[8]*o)/s,e[1]=(n[1]*i+n[5]*r+n[9]*o)/s,e[2]=(n[2]*i+n[6]*r+n[10]*o)/s}(this,this,e),this}applyQuaternion(e){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=n[0],a=n[1],l=n[2],c=a*o-l*r,u=l*i-s*o,d=s*r-a*i,h=a*d-l*u,p=l*c-s*d,f=s*u-a*c,m=2*n[3];c*=m,u*=m,d*=m,h*=2,p*=2,f*=2,e[0]=i+c+h,e[1]=r+u+p,e[2]=o+d+f}(this,this,e),this}angle(e){return Fm(this,e)}lerp(e,t){return function(e,t,n,i){let r=t[0],o=t[1],s=t[2];e[0]=r+i*(n[0]-r),e[1]=o+i*(n[1]-o),e[2]=s+i*(n[2]-s)}(this,this,e,t),this}smoothLerp(e,t,n){return function(e,t,n,i,r){const o=Math.exp(-i*r);let s=t[0],a=t[1],l=t[2];e[0]=n[0]+(s-n[0])*o,e[1]=n[1]+(a-n[1])*o,e[2]=n[2]+(l-n[2])*o}(this,this,e,t,n),this}clone(){return new Bm(this[0],this[1],this[2])}fromArray(e,t=0){return this[0]=e[t],this[1]=e[t+1],this[2]=e[t+2],this}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}transformDirection(e){const t=this[0],n=this[1],i=this[2];return this[0]=e[0]*t+e[4]*n+e[8]*i,this[1]=e[1]*t+e[5]*n+e[9]*i,this[2]=e[2]*t+e[6]*n+e[10]*i,this.normalize()}}const zm=new Bm;let jm=1;class Um{constructor({canvas:e=document.createElement("canvas"),width:t=300,height:n=150,dpr:i=1,alpha:r=!1,depth:o=!0,stencil:s=!1,antialias:a=!1,premultipliedAlpha:l=!1,preserveDrawingBuffer:c=!1,powerPreference:u="default",autoClear:d=!0,webgl:h=2}={}){const p={alpha:r,depth:o,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u};this.dpr=i,this.alpha=r,this.color=!0,this.depth=o,this.stencil=s,this.premultipliedAlpha=l,this.autoClear=d,this.id=jm++,2===h&&(this.gl=e.getContext("webgl2",p)),this.isWebgl2=!!this.gl,this.gl||(this.gl=e.getContext("webgl",p)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(t,n),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(e,t){this.width=e,this.height=t,this.gl.canvas.width=e*this.dpr,this.gl.canvas.height=t*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:e+"px",height:t+"px"})}setViewport(e,t,n=0,i=0){this.state.viewport.width===e&&this.state.viewport.height===t||(this.state.viewport.width=e,this.state.viewport.height=t,this.state.viewport.x=n,this.state.viewport.y=i,this.gl.viewport(n,i,e,t))}setScissor(e,t,n=0,i=0){this.gl.scissor(n,i,e,t)}enable(e){!0!==this.state[e]&&(this.gl.enable(e),this.state[e]=!0)}disable(e){!1!==this.state[e]&&(this.gl.disable(e),this.state[e]=!1)}setBlendFunc(e,t,n,i){this.state.blendFunc.src===e&&this.state.blendFunc.dst===t&&this.state.blendFunc.srcAlpha===n&&this.state.blendFunc.dstAlpha===i||(this.state.blendFunc.src=e,this.state.blendFunc.dst=t,this.state.blendFunc.srcAlpha=n,this.state.blendFunc.dstAlpha=i,void 0!==n?this.gl.blendFuncSeparate(e,t,n,i):this.gl.blendFunc(e,t))}setBlendEquation(e,t){e=e||this.gl.FUNC_ADD,this.state.blendEquation.modeRGB===e&&this.state.blendEquation.modeAlpha===t||(this.state.blendEquation.modeRGB=e,this.state.blendEquation.modeAlpha=t,void 0!==t?this.gl.blendEquationSeparate(e,t):this.gl.blendEquation(e))}setCullFace(e){this.state.cullFace!==e&&(this.state.cullFace=e,this.gl.cullFace(e))}setFrontFace(e){this.state.frontFace!==e&&(this.state.frontFace=e,this.gl.frontFace(e))}setDepthMask(e){this.state.depthMask!==e&&(this.state.depthMask=e,this.gl.depthMask(e))}setDepthFunc(e){this.state.depthFunc!==e&&(this.state.depthFunc=e,this.gl.depthFunc(e))}setStencilMask(e){this.state.stencilMask!==e&&(this.state.stencilMask=e,this.gl.stencilMask(e))}setStencilFunc(e,t,n){this.state.stencilFunc===e&&this.state.stencilRef===t&&this.state.stencilFuncMask===n||(this.state.stencilFunc=e||this.gl.ALWAYS,this.state.stencilRef=t||0,this.state.stencilFuncMask=n||0,this.gl.stencilFunc(e||this.gl.ALWAYS,t||0,n||0))}setStencilOp(e,t,n){this.state.stencilFail===e&&this.state.stencilDepthFail===t&&this.state.stencilDepthPass===n||(this.state.stencilFail=e,this.state.stencilDepthFail=t,this.state.stencilDepthPass=n,this.gl.stencilOp(e,t,n))}activeTexture(e){this.state.activeTextureUnit!==e&&(this.state.activeTextureUnit=e,this.gl.activeTexture(this.gl.TEXTURE0+e))}bindFramebuffer({target:e=this.gl.FRAMEBUFFER,buffer:t=null}={}){this.state.framebuffer!==t&&(this.state.framebuffer=t,this.gl.bindFramebuffer(e,t))}getExtension(e,t,n){return t&&this.gl[t]?this.gl[t].bind(this.gl):(this.extensions[e]||(this.extensions[e]=this.gl.getExtension(e)),t?this.extensions[e]?this.extensions[e][n].bind(this.extensions[e]):null:this.extensions[e])}sortOpaque(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program.id!==t.program.id?e.program.id-t.program.id:e.zDepth!==t.zDepth?e.zDepth-t.zDepth:t.id-e.id}sortTransparent(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.zDepth!==t.zDepth?t.zDepth-e.zDepth:t.id-e.id}sortUI(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program.id!==t.program.id?e.program.id-t.program.id:t.id-e.id}getRenderList({scene:e,camera:t,frustumCull:n,sort:i}){let r=[];if(t&&n&&t.updateFrustum(),e.traverse(e=>{if(!e.visible)return!0;e.draw&&(n&&e.frustumCulled&&t&&!t.frustumIntersectsMesh(e)||r.push(e))}),i){const e=[],n=[],i=[];r.forEach(r=>{r.program.transparent?r.program.depthTest?n.push(r):i.push(r):e.push(r),r.zDepth=0,0===r.renderOrder&&r.program.depthTest&&t&&(r.worldMatrix.getTranslation(zm),zm.applyMatrix4(t.projectionViewMatrix),r.zDepth=zm.z)}),e.sort(this.sortOpaque),n.sort(this.sortTransparent),i.sort(this.sortUI),r=e.concat(n,i)}return r}render({scene:e,camera:t,target:n=null,update:i=!0,sort:r=!0,frustumCull:o=!0,clear:s}){null===n?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(n),this.setViewport(n.width,n.height)),(s||this.autoClear&&!1!==s)&&(!this.depth||n&&!n.depth||(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!n||n.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),i&&e.updateMatrixWorld(),t&&t.updateMatrixWorld(),this.getRenderList({scene:e,camera:t,frustumCull:o,sort:r}).forEach(e=>{e.draw({camera:t})})}}const Vm=new Bm;let $m=1,Hm=1,qm=!1;class Km{constructor(e,t={}){e.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=e,this.attributes=t,this.id=$m++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let e in t)this.addAttribute(e,t[e])}addAttribute(e,t){if(this.attributes[e]=t,t.id=Hm++,t.size=t.size||1,t.type=t.type||(t.data.constructor===Float32Array?this.gl.FLOAT:t.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),t.target="index"===e?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,t.normalized=t.normalized||!1,t.stride=t.stride||0,t.offset=t.offset||0,t.count=t.count||(t.stride?t.data.byteLength/t.stride:t.data.length/t.size),t.divisor=t.instanced||0,t.needsUpdate=!1,t.usage=t.usage||this.gl.STATIC_DRAW,t.buffer||this.updateAttribute(t),t.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==t.count*t.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,t.count*t.divisor);this.instancedCount=t.count*t.divisor}else"index"===e?this.drawRange.count=t.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,t.count))}updateAttribute(e){const t=!e.buffer;t&&(e.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==e.buffer&&(this.gl.bindBuffer(e.target,e.buffer),this.glState.boundBuffer=e.buffer),t?this.gl.bufferData(e.target,e.data,e.usage):this.gl.bufferSubData(e.target,0,e.data),e.needsUpdate=!1}setIndex(e){this.addAttribute("index",e)}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}setInstancedCount(e){this.instancedCount=e}createVAO(e){this.VAOs[e.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[e.attributeOrder]),this.bindAttributes(e)}bindAttributes(e){e.attributeLocations.forEach((e,{name:t,type:n})=>{if(!this.attributes[t])return void console.warn(`active attribute ${t} not being supplied`);const i=this.attributes[t];this.gl.bindBuffer(i.target,i.buffer),this.glState.boundBuffer=i.buffer;let r=1;35674===n&&(r=2),35675===n&&(r=3),35676===n&&(r=4);const o=i.size/r,s=1===r?0:r*r*4,a=1===r?0:4*r;for(let t=0;t<r;t++)this.gl.vertexAttribPointer(e+t,o,i.type,i.normalized,i.stride+s,i.offset+t*a),this.gl.enableVertexAttribArray(e+t),this.gl.renderer.vertexAttribDivisor(e+t,i.divisor)}),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:e,mode:t=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${e.attributeOrder}`&&(this.VAOs[e.attributeOrder]||this.createVAO(e),this.gl.renderer.bindVertexArray(this.VAOs[e.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${e.attributeOrder}`),e.attributeLocations.forEach((e,{name:t})=>{const n=this.attributes[t];n.needsUpdate&&this.updateAttribute(n)});let n=2;this.attributes.index?.type===this.gl.UNSIGNED_INT&&(n=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(t,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*n,this.instancedCount):this.gl.renderer.drawArraysInstanced(t,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(t,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*n):this.gl.drawArrays(t,this.drawRange.start,this.drawRange.count)}getPosition(){const e=this.attributes.position;return e.data?e:qm?void 0:(console.warn("No position buffer data found to compute bounds"),qm=!0)}computeBoundingBox(e){e||(e=this.getPosition());const t=e.data,n=e.size;this.bounds||(this.bounds={min:new Bm,max:new Bm,center:new Bm,scale:new Bm,radius:1/0});const i=this.bounds.min,r=this.bounds.max,o=this.bounds.center,s=this.bounds.scale;i.set(1/0),r.set(-1/0);for(let e=0,o=t.length;e<o;e+=n){const n=t[e],o=t[e+1],s=t[e+2];i.x=Math.min(n,i.x),i.y=Math.min(o,i.y),i.z=Math.min(s,i.z),r.x=Math.max(n,r.x),r.y=Math.max(o,r.y),r.z=Math.max(s,r.z)}s.sub(r,i),o.add(i,r).divide(2)}computeBoundingSphere(e){e||(e=this.getPosition());const t=e.data,n=e.size;this.bounds||this.computeBoundingBox(e);let i=0;for(let e=0,r=t.length;e<r;e+=n)Vm.fromArray(t,e),i=Math.max(i,this.bounds.center.squaredDistance(Vm));this.bounds.radius=Math.sqrt(i)}remove(){for(let e in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[e]),delete this.VAOs[e];for(let e in this.attributes)this.gl.deleteBuffer(this.attributes[e].buffer),delete this.attributes[e]}}class Gm extends Km{constructor(e,{attributes:t={}}={}){Object.assign(t,{position:{size:2,data:new Float32Array([-1,-1,3,-1,-1,3])},uv:{size:2,data:new Float32Array([0,0,2,0,0,2])}}),super(e,t)}}let Wm=1;const Zm={};class Xm{constructor(e,{vertex:t,fragment:n,uniforms:i={},transparent:r=!1,cullFace:o=e.BACK,frontFace:s=e.CCW,depthTest:a=!0,depthWrite:l=!0,depthFunc:c=e.LEQUAL}={}){e.canvas||console.error("gl not passed as first argument to Program"),this.gl=e,this.uniforms=i,this.id=Wm++,t||console.warn("vertex shader not supplied"),n||console.warn("fragment shader not supplied"),this.transparent=r,this.cullFace=o,this.frontFace=s,this.depthTest=a,this.depthWrite=l,this.depthFunc=c,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=e.createShader(e.VERTEX_SHADER),this.fragmentShader=e.createShader(e.FRAGMENT_SHADER),this.program=e.createProgram(),e.attachShader(this.program,this.vertexShader),e.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:t,fragment:n})}setShaders({vertex:e,fragment:t}){if(e&&(this.gl.shaderSource(this.vertexShader,e),this.gl.compileShader(this.vertexShader),""!==this.gl.getShaderInfoLog(this.vertexShader)&&console.warn(`${this.gl.getShaderInfoLog(this.vertexShader)}\nVertex Shader\n${Qm(e)}`)),t&&(this.gl.shaderSource(this.fragmentShader,t),this.gl.compileShader(this.fragmentShader),""!==this.gl.getShaderInfoLog(this.fragmentShader)&&console.warn(`${this.gl.getShaderInfoLog(this.fragmentShader)}\nFragment Shader\n${Qm(t)}`)),this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return console.warn(this.gl.getProgramInfoLog(this.program));this.uniformLocations=new Map;let n=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS);for(let e=0;e<n;e++){let t=this.gl.getActiveUniform(this.program,e);this.uniformLocations.set(t,this.gl.getUniformLocation(this.program,t.name));const n=t.name.match(/(\w+)/g);t.uniformName=n[0],t.nameComponents=n.slice(1)}this.attributeLocations=new Map;const i=[],r=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES);for(let e=0;e<r;e++){const t=this.gl.getActiveAttrib(this.program,e),n=this.gl.getAttribLocation(this.program,t.name);-1!==n&&(i[n]=t.name,this.attributeLocations.set(t,n))}this.attributeOrder=i.join("")}setBlendFunc(e,t,n,i){this.blendFunc.src=e,this.blendFunc.dst=t,this.blendFunc.srcAlpha=n,this.blendFunc.dstAlpha=i,e&&(this.transparent=!0)}setBlendEquation(e,t){this.blendEquation.modeRGB=e,this.blendEquation.modeAlpha=t}setStencilFunc(e,t,n){this.stencilRef=t,this.stencilFunc.func=e,this.stencilFunc.ref=t,this.stencilFunc.mask=n}setStencilOp(e,t,n){this.stencilOp.stencilFail=e,this.stencilOp.depthFail=t,this.stencilOp.depthPass=n}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha),this.stencilFunc.func||this.stencilOp.stencilFail?this.gl.renderer.enable(this.gl.STENCIL_TEST):this.gl.renderer.disable(this.gl.STENCIL_TEST),this.gl.renderer.setStencilFunc(this.stencilFunc.func,this.stencilFunc.ref,this.stencilFunc.mask),this.gl.renderer.setStencilOp(this.stencilOp.stencilFail,this.stencilOp.depthFail,this.stencilOp.depthPass)}use({flipFaces:e=!1}={}){let t=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach((e,n)=>{let i=this.uniforms[n.uniformName];for(const e of n.nameComponents){if(!i)break;if(!(e in i)){if(Array.isArray(i.value))break;i=void 0;break}i=i[e]}if(!i)return eg(`Active uniform ${n.name} has not been supplied`);if(i&&void 0===i.value)return eg(`${n.name} uniform is missing a value parameter`);if(i.value.texture)return t+=1,i.value.update(t),Ym(this.gl,n.type,e,t);if(i.value.length&&i.value[0].texture){const r=[];return i.value.forEach(e=>{t+=1,e.update(t),r.push(t)}),Ym(this.gl,n.type,e,r)}Ym(this.gl,n.type,e,i.value)}),this.applyState(),e&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function Ym(e,t,n,i){i=i.length?function(e){const t=e.length,n=e[0].length;if(void 0===n)return e;const i=t*n;let r=Zm[i];r||(Zm[i]=r=new Float32Array(i));for(let i=0;i<t;i++)r.set(e[i],i*n);return r}(i):i;const r=e.renderer.state.uniformLocations.get(n);if(i.length)if(void 0===r||r.length!==i.length)e.renderer.state.uniformLocations.set(n,i.slice(0));else{if(function(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}(r,i))return;r.set?r.set(i):function(e,t){for(let n=0,i=e.length;n<i;n++)e[n]=t[n]}(r,i),e.renderer.state.uniformLocations.set(n,r)}else{if(r===i)return;e.renderer.state.uniformLocations.set(n,i)}switch(t){case 5126:return i.length?e.uniform1fv(n,i):e.uniform1f(n,i);case 35664:return e.uniform2fv(n,i);case 35665:return e.uniform3fv(n,i);case 35666:return e.uniform4fv(n,i);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return i.length?e.uniform1iv(n,i):e.uniform1i(n,i);case 35671:case 35667:return e.uniform2iv(n,i);case 35672:case 35668:return e.uniform3iv(n,i);case 35673:case 35669:return e.uniform4iv(n,i);case 35674:return e.uniformMatrix2fv(n,!1,i);case 35675:return e.uniformMatrix3fv(n,!1,i);case 35676:return e.uniformMatrix4fv(n,!1,i)}}function Qm(e){let t=e.split("\n");for(let e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}let Jm=0;function eg(e){Jm>100||(console.warn(e),Jm++,Jm>100&&console.warn("More than 100 program warnings - stopping logs."))}function tg(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=n[0],l=n[1],c=n[2],u=n[3];return e[0]=i*u+s*a+r*c-o*l,e[1]=r*u+s*l+o*a-i*c,e[2]=o*u+s*c+i*l-r*a,e[3]=s*u-i*a-r*l-o*c,e}class ng extends Array{constructor(e=0,t=0,n=0,i=1){super(e,t,n,i),this.onChange=()=>{},this._target=this;const r=["0","1","2","3"];return new Proxy(this,{set(e,t){const n=Reflect.set(...arguments);return n&&r.includes(t)&&e.onChange(),n}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(e){this._target[0]=e,this.onChange()}set y(e){this._target[1]=e,this.onChange()}set z(e){this._target[2]=e,this.onChange()}set w(e){this._target[3]=e,this.onChange()}identity(){var e;return(e=this._target)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.onChange(),this}set(e,t,n,i){return e.length?this.copy(e):(function(e,t,n,i,r){e[0]=t,e[1]=n,e[2]=i,e[3]=r}(this._target,e,t,n,i),this.onChange(),this)}rotateX(e){return function(e,t,n){n*=.5;let i=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(n),l=Math.cos(n);e[0]=i*l+s*a,e[1]=r*l+o*a,e[2]=o*l-r*a,e[3]=s*l-i*a}(this._target,this._target,e),this.onChange(),this}rotateY(e){return function(e,t,n){n*=.5;let i=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(n),l=Math.cos(n);e[0]=i*l-o*a,e[1]=r*l+s*a,e[2]=o*l+i*a,e[3]=s*l-r*a}(this._target,this._target,e),this.onChange(),this}rotateZ(e){return function(e,t,n){n*=.5;let i=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(n),l=Math.cos(n);e[0]=i*l+r*a,e[1]=r*l-i*a,e[2]=o*l+s*a,e[3]=s*l-o*a}(this._target,this._target,e),this.onChange(),this}inverse(e=this._target){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=n*n+i*i+r*r+o*o,a=s?1/s:0;e[0]=-n*a,e[1]=-i*a,e[2]=-r*a,e[3]=o*a}(this._target,e),this.onChange(),this}conjugate(e=this._target){var t,n;return n=e,(t=this._target)[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],this.onChange(),this}copy(e){return t=this._target,n=e,t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],this.onChange(),this;var t,n}normalize(e=this._target){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=n*n+i*i+r*r+o*o;s>0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=i*s,e[2]=r*s,e[3]=o*s}(this._target,e),this.onChange(),this}multiply(e,t){return t?tg(this._target,e,t):tg(this._target,this._target,e),this.onChange(),this}dot(e){return t=this._target,n=e,t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3];var t,n}fromMatrix3(e){return function(e,t){let n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);let r=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*r+r]-t[3*o+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*r+o]-t[3*o+r])*n,e[r]=(t[3*r+i]+t[3*i+r])*n,e[o]=(t[3*o+i]+t[3*i+o])*n}}(this._target,e),this.onChange(),this}fromEuler(e,t){return function(e,t,n="YXZ"){let i=Math.sin(.5*t[0]),r=Math.cos(.5*t[0]),o=Math.sin(.5*t[1]),s=Math.cos(.5*t[1]),a=Math.sin(.5*t[2]),l=Math.cos(.5*t[2]);"XYZ"===n?(e[0]=i*s*l+r*o*a,e[1]=r*o*l-i*s*a,e[2]=r*s*a+i*o*l,e[3]=r*s*l-i*o*a):"YXZ"===n?(e[0]=i*s*l+r*o*a,e[1]=r*o*l-i*s*a,e[2]=r*s*a-i*o*l,e[3]=r*s*l+i*o*a):"ZXY"===n?(e[0]=i*s*l-r*o*a,e[1]=r*o*l+i*s*a,e[2]=r*s*a+i*o*l,e[3]=r*s*l-i*o*a):"ZYX"===n?(e[0]=i*s*l-r*o*a,e[1]=r*o*l+i*s*a,e[2]=r*s*a-i*o*l,e[3]=r*s*l+i*o*a):"YZX"===n?(e[0]=i*s*l+r*o*a,e[1]=r*o*l+i*s*a,e[2]=r*s*a-i*o*l,e[3]=r*s*l-i*o*a):"XZY"===n&&(e[0]=i*s*l-r*o*a,e[1]=r*o*l-i*s*a,e[2]=r*s*a+i*o*l,e[3]=r*s*l+i*o*a)}(this._target,e,e.order),t||this.onChange(),this}fromAxisAngle(e,t){return function(e,t,n){n*=.5;let i=Math.sin(n);e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n)}(this._target,e,t),this.onChange(),this}slerp(e,t){return function(e,t,n,i){let r,o,s,a,l,c=t[0],u=t[1],d=t[2],h=t[3],p=n[0],f=n[1],m=n[2],g=n[3];o=c*p+u*f+d*m+h*g,o<0&&(o=-o,p=-p,f=-f,m=-m,g=-g),1-o>1e-6?(r=Math.acos(o),s=Math.sin(r),a=Math.sin((1-i)*r)/s,l=Math.sin(i*r)/s):(a=1-i,l=i),e[0]=a*c+l*p,e[1]=a*u+l*f,e[2]=a*d+l*m,e[3]=a*h+l*g}(this._target,this._target,e,t),this.onChange(),this}fromArray(e,t=0){return this._target[0]=e[t],this._target[1]=e[t+1],this._target[2]=e[t+2],this._target[3]=e[t+3],this.onChange(),this}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}}function ig(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],p=e[12],f=e[13],m=e[14],g=e[15];return(t*s-n*o)*(d*g-h*m)-(t*a-i*o)*(u*g-h*f)+(t*l-r*o)*(u*m-d*f)+(n*a-i*s)*(c*g-h*p)-(n*l-r*s)*(c*m-d*p)+(i*l-r*a)*(c*f-u*p)}function rg(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],f=t[11],m=t[12],g=t[13],b=t[14],y=t[15],v=n[0],x=n[1],w=n[2],_=n[3];return e[0]=v*i+x*a+w*d+_*m,e[1]=v*r+x*l+w*h+_*g,e[2]=v*o+x*c+w*p+_*b,e[3]=v*s+x*u+w*f+_*y,v=n[4],x=n[5],w=n[6],_=n[7],e[4]=v*i+x*a+w*d+_*m,e[5]=v*r+x*l+w*h+_*g,e[6]=v*o+x*c+w*p+_*b,e[7]=v*s+x*u+w*f+_*y,v=n[8],x=n[9],w=n[10],_=n[11],e[8]=v*i+x*a+w*d+_*m,e[9]=v*r+x*l+w*h+_*g,e[10]=v*o+x*c+w*p+_*b,e[11]=v*s+x*u+w*f+_*y,v=n[12],x=n[13],w=n[14],_=n[15],e[12]=v*i+x*a+w*d+_*m,e[13]=v*r+x*l+w*h+_*g,e[14]=v*o+x*c+w*p+_*b,e[15]=v*s+x*u+w*f+_*y,e}function og(e,t){let n=t[0],i=t[1],r=t[2],o=t[4],s=t[5],a=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,i,r),e[1]=Math.hypot(o,s,a),e[2]=Math.hypot(l,c,u),e}const sg=function(){const e=[1,1,1];return function(t,n){let i=e;og(i,n);let r=1/i[0],o=1/i[1],s=1/i[2],a=n[0]*r,l=n[1]*o,c=n[2]*s,u=n[4]*r,d=n[5]*o,h=n[6]*s,p=n[8]*r,f=n[9]*o,m=n[10]*s,g=a+d+m,b=0;return g>0?(b=2*Math.sqrt(g+1),t[3]=.25*b,t[0]=(h-f)/b,t[1]=(p-c)/b,t[2]=(l-u)/b):a>d&&a>m?(b=2*Math.sqrt(1+a-d-m),t[3]=(h-f)/b,t[0]=.25*b,t[1]=(l+u)/b,t[2]=(p+c)/b):d>m?(b=2*Math.sqrt(1+d-a-m),t[3]=(p-c)/b,t[0]=(l+u)/b,t[1]=.25*b,t[2]=(h+f)/b):(b=2*Math.sqrt(1+m-a-d),t[3]=(l-u)/b,t[0]=(p+c)/b,t[1]=(h+f)/b,t[2]=.25*b),t}}();function ag(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function lg(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}class cg extends Array{constructor(e=1,t=0,n=0,i=0,r=0,o=1,s=0,a=0,l=0,c=0,u=1,d=0,h=0,p=0,f=0,m=1){return super(e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,m),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(e){this[12]=e}set y(e){this[13]=e}set z(e){this[14]=e}set w(e){this[15]=e}set(e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,m){return e.length?this.copy(e):(function(e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,m,g){e[0]=t,e[1]=n,e[2]=i,e[3]=r,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e[9]=u,e[10]=d,e[11]=h,e[12]=p,e[13]=f,e[14]=m,e[15]=g}(this,e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,m),this)}translate(e,t=this){return function(e,t,n){let i,r,o,s,a,l,c,u,d,h,p,f,m=n[0],g=n[1],b=n[2];t===e?(e[12]=t[0]*m+t[4]*g+t[8]*b+t[12],e[13]=t[1]*m+t[5]*g+t[9]*b+t[13],e[14]=t[2]*m+t[6]*g+t[10]*b+t[14],e[15]=t[3]*m+t[7]*g+t[11]*b+t[15]):(i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],f=t[11],e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=h,e[10]=p,e[11]=f,e[12]=i*m+a*g+d*b+t[12],e[13]=r*m+l*g+h*b+t[13],e[14]=o*m+c*g+p*b+t[14],e[15]=s*m+u*g+f*b+t[15])}(this,t,e),this}rotate(e,t,n=this){return function(e,t,n,i){let r,o,s,a,l,c,u,d,h,p,f,m,g,b,y,v,x,w,_,k,E,S,A,C,N=i[0],M=i[1],T=i[2],O=Math.hypot(N,M,T);Math.abs(O)<1e-6||(O=1/O,N*=O,M*=O,T*=O,r=Math.sin(n),o=Math.cos(n),s=1-o,a=t[0],l=t[1],c=t[2],u=t[3],d=t[4],h=t[5],p=t[6],f=t[7],m=t[8],g=t[9],b=t[10],y=t[11],v=N*N*s+o,x=M*N*s+T*r,w=T*N*s-M*r,_=N*M*s-T*r,k=M*M*s+o,E=T*M*s+N*r,S=N*T*s+M*r,A=M*T*s-N*r,C=T*T*s+o,e[0]=a*v+d*x+m*w,e[1]=l*v+h*x+g*w,e[2]=c*v+p*x+b*w,e[3]=u*v+f*x+y*w,e[4]=a*_+d*k+m*E,e[5]=l*_+h*k+g*E,e[6]=c*_+p*k+b*E,e[7]=u*_+f*k+y*E,e[8]=a*S+d*A+m*C,e[9]=l*S+h*A+g*C,e[10]=c*S+p*A+b*C,e[11]=u*S+f*A+y*C,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,n,e,t),this}scale(e,t=this){return function(e,t,n){let i=n[0],r=n[1],o=n[2];e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]}(this,t,"number"==typeof e?[e,e,e]:e),this}add(e,t){return t?ag(this,e,t):ag(this,this,e),this}sub(e,t){return t?lg(this,e,t):lg(this,this,e),this}multiply(e,t){var n,i,r;return e.length?t?rg(this,e,t):rg(this,this,e):(i=this,r=e,(n=this)[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=i[3]*r,n[4]=i[4]*r,n[5]=i[5]*r,n[6]=i[6]*r,n[7]=i[7]*r,n[8]=i[8]*r,n[9]=i[9]*r,n[10]=i[10]*r,n[11]=i[11]*r,n[12]=i[12]*r,n[13]=i[13]*r,n[14]=i[14]*r,n[15]=i[15]*r),this}identity(){var e;return(e=this)[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}copy(e){var t,n;return n=e,(t=this)[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}fromPerspective({fov:e,aspect:t,near:n,far:i}={}){return function(e,t,n,i,r){let o=1/Math.tan(t/2),s=1/(i-r);e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(r+i)*s,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*r*i*s,e[15]=0}(this,e,t,n,i),this}fromOrthogonal({left:e,right:t,bottom:n,top:i,near:r,far:o}){return function(e,t,n,i,r,o,s){let a=1/(t-n),l=1/(i-r),c=1/(o-s);e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*a,e[13]=(r+i)*l,e[14]=(s+o)*c,e[15]=1}(this,e,t,n,i,r,o),this}fromQuaternion(e){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=n+n,a=i+i,l=r+r,c=n*s,u=i*s,d=i*a,h=r*s,p=r*a,f=r*l,m=o*s,g=o*a,b=o*l;e[0]=1-d-f,e[1]=u+b,e[2]=h-g,e[3]=0,e[4]=u-b,e[5]=1-c-f,e[6]=p+m,e[7]=0,e[8]=h+g,e[9]=p-m,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this}setPosition(e){return this.x=e[0],this.y=e[1],this.z=e[2],this}inverse(e=this){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],p=t[11],f=t[12],m=t[13],g=t[14],b=t[15],y=n*a-i*s,v=n*l-r*s,x=n*c-o*s,w=i*l-r*a,_=i*c-o*a,k=r*c-o*l,E=u*m-d*f,S=u*g-h*f,A=u*b-p*f,C=d*g-h*m,N=d*b-p*m,M=h*b-p*g,T=y*M-v*N+x*C+w*A-_*S+k*E;T&&(T=1/T,e[0]=(a*M-l*N+c*C)*T,e[1]=(r*N-i*M-o*C)*T,e[2]=(m*k-g*_+b*w)*T,e[3]=(h*_-d*k-p*w)*T,e[4]=(l*A-s*M-c*S)*T,e[5]=(n*M-r*A+o*S)*T,e[6]=(g*x-f*k-b*v)*T,e[7]=(u*k-h*x+p*v)*T,e[8]=(s*N-a*A+c*E)*T,e[9]=(i*A-n*N-o*E)*T,e[10]=(f*_-m*x+b*y)*T,e[11]=(d*x-u*_-p*y)*T,e[12]=(a*S-s*C-l*E)*T,e[13]=(n*C-i*S+r*E)*T,e[14]=(m*v-f*w-g*y)*T,e[15]=(u*w-d*v+h*y)*T)}(this,e),this}compose(e,t,n){return function(e,t,n,i){const r=e,o=t[0],s=t[1],a=t[2],l=t[3],c=o+o,u=s+s,d=a+a,h=o*c,p=o*u,f=o*d,m=s*u,g=s*d,b=a*d,y=l*c,v=l*u,x=l*d,w=i[0],_=i[1],k=i[2];r[0]=(1-(m+b))*w,r[1]=(p+x)*w,r[2]=(f-v)*w,r[3]=0,r[4]=(p-x)*_,r[5]=(1-(h+b))*_,r[6]=(g+y)*_,r[7]=0,r[8]=(f+v)*k,r[9]=(g-y)*k,r[10]=(1-(h+m))*k,r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1}(this,e,t,n),this}decompose(e,t,n){return function(e,t,n,i){let r=Nm([e[0],e[1],e[2]]);const o=Nm([e[4],e[5],e[6]]),s=Nm([e[8],e[9],e[10]]);ig(e)<0&&(r=-r),n[0]=e[12],n[1]=e[13],n[2]=e[14];const a=e.slice(),l=1/r,c=1/o,u=1/s;a[0]*=l,a[1]*=l,a[2]*=l,a[4]*=c,a[5]*=c,a[6]*=c,a[8]*=u,a[9]*=u,a[10]*=u,sg(t,a),i[0]=r,i[1]=o,i[2]=s}(this,e,t,n),this}getRotation(e){return sg(e,this),this}getTranslation(e){var t,n;return n=this,(t=e)[0]=n[12],t[1]=n[13],t[2]=n[14],this}getScaling(e){return og(e,this),this}getMaxScaleOnAxis(){return function(e){let t=e[0],n=e[1],i=e[2],r=e[4],o=e[5],s=e[6],a=e[8],l=e[9],c=e[10];const u=t*t+n*n+i*i,d=r*r+o*o+s*s,h=a*a+l*l+c*c;return Math.sqrt(Math.max(u,d,h))}(this)}lookAt(e,t,n){return function(e,t,n,i){let r=t[0],o=t[1],s=t[2],a=i[0],l=i[1],c=i[2],u=r-n[0],d=o-n[1],h=s-n[2],p=u*u+d*d+h*h;0===p?h=1:(p=1/Math.sqrt(p),u*=p,d*=p,h*=p);let f=l*h-c*d,m=c*u-a*h,g=a*d-l*u;p=f*f+m*m+g*g,0===p&&(c?a+=1e-6:l?c+=1e-6:l+=1e-6,f=l*h-c*d,m=c*u-a*h,g=a*d-l*u,p=f*f+m*m+g*g),p=1/Math.sqrt(p),f*=p,m*=p,g*=p,e[0]=f,e[1]=m,e[2]=g,e[3]=0,e[4]=d*g-h*m,e[5]=h*f-u*g,e[6]=u*m-d*f,e[7]=0,e[8]=u,e[9]=d,e[10]=h,e[11]=0,e[12]=r,e[13]=o,e[14]=s,e[15]=1}(this,e,t,n),this}determinant(){return ig(this)}fromArray(e,t=0){return this[0]=e[t],this[1]=e[t+1],this[2]=e[t+2],this[3]=e[t+3],this[4]=e[t+4],this[5]=e[t+5],this[6]=e[t+6],this[7]=e[t+7],this[8]=e[t+8],this[9]=e[t+9],this[10]=e[t+10],this[11]=e[t+11],this[12]=e[t+12],this[13]=e[t+13],this[14]=e[t+14],this[15]=e[t+15],this}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e[t+4]=this[4],e[t+5]=this[5],e[t+6]=this[6],e[t+7]=this[7],e[t+8]=this[8],e[t+9]=this[9],e[t+10]=this[10],e[t+11]=this[11],e[t+12]=this[12],e[t+13]=this[13],e[t+14]=this[14],e[t+15]=this[15],e}}const ug=new cg;class dg extends Array{constructor(e=0,t=e,n=e,i="YXZ"){super(e,t,n),this.order=i,this.onChange=()=>{},this._target=this;const r=["0","1","2"];return new Proxy(this,{set(e,t){const n=Reflect.set(...arguments);return n&&r.includes(t)&&e.onChange(),n}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(e){this._target[0]=e,this.onChange()}set y(e){this._target[1]=e,this.onChange()}set z(e){this._target[2]=e,this.onChange()}set(e,t=e,n=e){return e.length?this.copy(e):(this._target[0]=e,this._target[1]=t,this._target[2]=n,this.onChange(),this)}copy(e){return this._target[0]=e[0],this._target[1]=e[1],this._target[2]=e[2],this.onChange(),this}reorder(e){return this._target.order=e,this.onChange(),this}fromRotationMatrix(e,t=this.order){return function(e,t,n="YXZ"){"XYZ"===n?(e[1]=Math.asin(Math.min(Math.max(t[8],-1),1)),Math.abs(t[8])<.99999?(e[0]=Math.atan2(-t[9],t[10]),e[2]=Math.atan2(-t[4],t[0])):(e[0]=Math.atan2(t[6],t[5]),e[2]=0)):"YXZ"===n?(e[0]=Math.asin(-Math.min(Math.max(t[9],-1),1)),Math.abs(t[9])<.99999?(e[1]=Math.atan2(t[8],t[10]),e[2]=Math.atan2(t[1],t[5])):(e[1]=Math.atan2(-t[2],t[0]),e[2]=0)):"ZXY"===n?(e[0]=Math.asin(Math.min(Math.max(t[6],-1),1)),Math.abs(t[6])<.99999?(e[1]=Math.atan2(-t[2],t[10]),e[2]=Math.atan2(-t[4],t[5])):(e[1]=0,e[2]=Math.atan2(t[1],t[0]))):"ZYX"===n?(e[1]=Math.asin(-Math.min(Math.max(t[2],-1),1)),Math.abs(t[2])<.99999?(e[0]=Math.atan2(t[6],t[10]),e[2]=Math.atan2(t[1],t[0])):(e[0]=0,e[2]=Math.atan2(-t[4],t[5]))):"YZX"===n?(e[2]=Math.asin(Math.min(Math.max(t[1],-1),1)),Math.abs(t[1])<.99999?(e[0]=Math.atan2(-t[9],t[5]),e[1]=Math.atan2(-t[2],t[0])):(e[0]=0,e[1]=Math.atan2(t[8],t[10]))):"XZY"===n&&(e[2]=Math.asin(-Math.min(Math.max(t[4],-1),1)),Math.abs(t[4])<.99999?(e[0]=Math.atan2(t[6],t[5]),e[1]=Math.atan2(t[8],t[0])):(e[0]=Math.atan2(-t[9],t[10]),e[1]=0))}(this._target,e,t),this.onChange(),this}fromQuaternion(e,t=this.order,n){return ug.fromQuaternion(e),this._target.fromRotationMatrix(ug,t),n||this.onChange(),this}fromArray(e,t=0){return this._target[0]=e[t],this._target[1]=e[t+1],this._target[2]=e[t+2],this}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}}class hg{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new cg,this.worldMatrix=new cg,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new Bm,this.quaternion=new ng,this.scale=new Bm(1),this.rotation=new dg,this.up=new Bm(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(e,t=!0){this.parent&&e!==this.parent&&this.parent.removeChild(this,!1),this.parent=e,t&&e&&e.addChild(this,!1)}addChild(e,t=!0){~this.children.indexOf(e)||this.children.push(e),t&&e.setParent(this,!1)}removeChild(e,t=!0){~this.children.indexOf(e)&&this.children.splice(this.children.indexOf(e),1),t&&e.setParent(null,!1)}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||e)&&(null===this.parent?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,e=!0);for(let t=0,n=this.children.length;t<n;t++)this.children[t].updateMatrixWorld(e)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(e){if(!e(this))for(let t=0,n=this.children.length;t<n;t++)this.children[t].traverse(e)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(e,t=!1){t?this.matrix.lookAt(this.position,e,this.up):this.matrix.lookAt(e,this.position,this.up),this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}}function pg(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=n[0],p=n[1],f=n[2],m=n[3],g=n[4],b=n[5],y=n[6],v=n[7],x=n[8];return e[0]=h*i+p*s+f*c,e[1]=h*r+p*a+f*u,e[2]=h*o+p*l+f*d,e[3]=m*i+g*s+b*c,e[4]=m*r+g*a+b*u,e[5]=m*o+g*l+b*d,e[6]=y*i+v*s+x*c,e[7]=y*r+v*a+x*u,e[8]=y*o+v*l+x*d,e}class fg extends Array{constructor(e=1,t=0,n=0,i=0,r=1,o=0,s=0,a=0,l=1){return super(e,t,n,i,r,o,s,a,l),this}set(e,t,n,i,r,o,s,a,l){return e.length?this.copy(e):(function(e,t,n,i,r,o,s,a,l,c){e[0]=t,e[1]=n,e[2]=i,e[3]=r,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c}(this,e,t,n,i,r,o,s,a,l),this)}translate(e,t=this){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=n[0],p=n[1];e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=h*i+p*s+c,e[7]=h*r+p*a+u,e[8]=h*o+p*l+d}(this,t,e),this}rotate(e,t=this){return function(e,t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(n),p=Math.cos(n);e[0]=p*i+h*s,e[1]=p*r+h*a,e[2]=p*o+h*l,e[3]=p*s-h*i,e[4]=p*a-h*r,e[5]=p*l-h*o,e[6]=c,e[7]=u,e[8]=d}(this,t,e),this}scale(e,t=this){return function(e,t,n){let i=n[0],r=n[1];e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8]}(this,t,e),this}multiply(e,t){return t?pg(this,e,t):pg(this,this,e),this}identity(){var e;return(e=this)[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this}copy(e){var t,n;return n=e,(t=this)[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}fromMatrix4(e){var t,n;return n=e,(t=this)[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],this}fromQuaternion(e){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=n+n,a=i+i,l=r+r,c=n*s,u=i*s,d=i*a,h=r*s,p=r*a,f=r*l,m=o*s,g=o*a,b=o*l;e[0]=1-d-f,e[3]=u-b,e[6]=h+g,e[1]=u+b,e[4]=1-c-f,e[7]=p-m,e[2]=h-g,e[5]=p+m,e[8]=1-c-d}(this,e),this}fromBasis(e,t,n){return this.set(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2]),this}inverse(e=this){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=u*s-a*c,h=-u*o+a*l,p=c*o-s*l,f=n*d+i*h+r*p;f&&(f=1/f,e[0]=d*f,e[1]=(-u*i+r*c)*f,e[2]=(a*i-r*s)*f,e[3]=h*f,e[4]=(u*n-r*l)*f,e[5]=(-a*n+r*o)*f,e[6]=p*f,e[7]=(-c*n+i*l)*f,e[8]=(s*n-i*o)*f)}(this,e),this}getNormalMatrix(e){return function(e,t){let n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],p=t[11],f=t[12],m=t[13],g=t[14],b=t[15],y=n*a-i*s,v=n*l-r*s,x=n*c-o*s,w=i*l-r*a,_=i*c-o*a,k=r*c-o*l,E=u*m-d*f,S=u*g-h*f,A=u*b-p*f,C=d*g-h*m,N=d*b-p*m,M=h*b-p*g,T=y*M-v*N+x*C+w*A-_*S+k*E;T&&(T=1/T,e[0]=(a*M-l*N+c*C)*T,e[1]=(l*A-s*M-c*S)*T,e[2]=(s*N-a*A+c*E)*T,e[3]=(r*N-i*M-o*C)*T,e[4]=(n*M-r*A+o*S)*T,e[5]=(i*A-n*N-o*E)*T,e[6]=(m*k-g*_+b*w)*T,e[7]=(g*x-f*k-b*v)*T,e[8]=(f*_-m*x+b*y)*T)}(this,e),this}}let mg=0;class gg extends hg{constructor(e,{geometry:t,program:n,mode:i=e.TRIANGLES,frustumCulled:r=!0,renderOrder:o=0}={}){super(),e.canvas||console.error("gl not passed as first argument to Mesh"),this.gl=e,this.id=mg++,this.geometry=t,this.program=n,this.mode=i,this.frustumCulled=r,this.renderOrder=o,this.modelViewMatrix=new cg,this.normalMatrix=new fg,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(e){return this.beforeRenderCallbacks.push(e),this}onAfterRender(e){return this.afterRenderCallbacks.push(e),this}draw({camera:e}={}){e&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=e.projectionMatrix,this.program.uniforms.cameraPosition.value=e.worldPosition,this.program.uniforms.viewMatrix.value=e.viewMatrix,this.modelViewMatrix.multiply(e.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix),this.beforeRenderCallbacks.forEach(t=>t&&t({mesh:this,camera:e}));let t=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:t}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach(t=>t&&t({mesh:this,camera:e}))}}function bg({settings:e,forceHoverState:n=!1}){if("undefined"==typeof window)return t("div",{className:"orb-container"});const i=b(null);return h(()=>{const t=i.current;if(!t)return;const{hue:r,hoverIntensity:o,rotateOnHover:s}=e;let a=[];const l=setTimeout(()=>{if(!t||!t.isConnected)return;const e=new Um({alpha:!0,premultipliedAlpha:!1}),i=e.gl;i.clearColor(0,0,0,0);const l=i.canvas;l.style.visibility="visible",l.style.opacity="1",l.style.display="block",l.style.position="relative",l.style.zIndex="1",t.appendChild(l);const c=new Gm(i),u=new Xm(i,{vertex:"\n precision highp float;\n attribute vec2 position;\n attribute vec2 uv;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4(position, 0.0, 1.0);\n }\n ",fragment:"\n precision highp float;\n\n uniform float iTime;\n uniform vec3 iResolution;\n uniform float hue;\n uniform float hover;\n uniform float rot;\n uniform float hoverIntensity;\n varying vec2 vUv;\n\n vec3 rgb2yiq(vec3 c) {\n float y = dot(c, vec3(0.299, 0.587, 0.114));\n float i = dot(c, vec3(0.596, -0.274, -0.322));\n float q = dot(c, vec3(0.211, -0.523, 0.312));\n return vec3(y, i, q);\n }\n \n vec3 yiq2rgb(vec3 c) {\n float r = c.x + 0.956 * c.y + 0.621 * c.z;\n float g = c.x - 0.272 * c.y - 0.647 * c.z;\n float b = c.x - 1.106 * c.y + 1.703 * c.z;\n return vec3(r, g, b);\n }\n \n vec3 adjustHue(vec3 color, float hueDeg) {\n float hueRad = hueDeg * 3.14159265 / 180.0;\n vec3 yiq = rgb2yiq(color);\n float cosA = cos(hueRad);\n float sinA = sin(hueRad);\n float i = yiq.y * cosA - yiq.z * sinA;\n float q = yiq.y * sinA + yiq.z * cosA;\n yiq.y = i;\n yiq.z = q;\n return yiq2rgb(yiq);\n }\n \n vec3 hash33(vec3 p3) {\n p3 = fract(p3 * vec3(0.1031, 0.11369, 0.13787));\n p3 += dot(p3, p3.yxz + 19.19);\n return -1.0 + 2.0 * fract(vec3(\n p3.x + p3.y,\n p3.x + p3.z,\n p3.y + p3.z\n ) * p3.zyx);\n }\n \n float snoise3(vec3 p) {\n const float K1 = 0.333333333;\n const float K2 = 0.166666667;\n vec3 i = floor(p + (p.x + p.y + p.z) * K1);\n vec3 d0 = p - (i - (i.x + i.y + i.z) * K2);\n vec3 e = step(vec3(0.0), d0 - d0.yzx);\n vec3 i1 = e * (1.0 - e.zxy);\n vec3 i2 = 1.0 - e.zxy * (1.0 - e);\n vec3 d1 = d0 - (i1 - K2);\n vec3 d2 = d0 - (i2 - K1);\n vec3 d3 = d0 - 0.5;\n vec4 h = max(0.6 - vec4(\n dot(d0, d0),\n dot(d1, d1),\n dot(d2, d2),\n dot(d3, d3)\n ), 0.0);\n vec4 n = h * h * h * h * vec4(\n dot(d0, hash33(i)),\n dot(d1, hash33(i + i1)),\n dot(d2, hash33(i + i2)),\n dot(d3, hash33(i + 1.0))\n );\n return dot(vec4(31.316), n);\n }\n \n vec4 extractAlpha(vec3 colorIn) {\n float a = max(max(colorIn.r, colorIn.g), colorIn.b);\n return vec4(colorIn.rgb / (a + 1e-5), a);\n }\n \n const vec3 baseColor1 = vec3(0.611765, 0.262745, 0.996078);\n const vec3 baseColor2 = vec3(0.298039, 0.760784, 0.913725);\n const vec3 baseColor3 = vec3(0.062745, 0.078431, 0.600000);\n const float innerRadius = 0.6;\n const float noiseScale = 0.65;\n \n float light1(float intensity, float attenuation, float dist) {\n return intensity / (1.0 + dist * attenuation);\n }\n \n float light2(float intensity, float attenuation, float dist) {\n return intensity / (1.0 + dist * dist * attenuation);\n }\n \n vec4 draw(vec2 uv) {\n vec3 color1 = adjustHue(baseColor1, hue);\n vec3 color2 = adjustHue(baseColor2, hue);\n vec3 color3 = adjustHue(baseColor3, hue);\n \n float ang = atan(uv.y, uv.x);\n float len = length(uv);\n float invLen = len > 0.0 ? 1.0 / len : 0.0;\n \n float n0 = snoise3(vec3(uv * noiseScale, iTime * 0.5)) * 0.5 + 0.5;\n float r0 = mix(mix(innerRadius, 1.0, 0.4), mix(innerRadius, 1.0, 0.6), n0);\n float d0 = distance(uv, (r0 * invLen) * uv);\n float v0 = light1(1.0, 10.0, d0);\n v0 *= smoothstep(r0 * 1.05, r0, len);\n float cl = cos(ang + iTime * 2.0) * 0.5 + 0.5;\n \n float a = iTime * -1.0;\n vec2 pos = vec2(cos(a), sin(a)) * r0;\n float d = distance(uv, pos);\n float v1 = light2(1.5, 5.0, d);\n v1 *= light1(1.0, 50.0, d0);\n \n float v2 = smoothstep(1.0, mix(innerRadius, 1.0, n0 * 0.5), len);\n float v3 = smoothstep(innerRadius, mix(innerRadius, 1.0, 0.5), len);\n \n vec3 col = mix(color1, color2, cl);\n col = mix(color3, col, v0);\n col = (col + v1) * v2 * v3;\n col = clamp(col, 0.0, 1.0);\n \n return extractAlpha(col);\n }\n \n vec4 mainImage(vec2 fragCoord) {\n vec2 center = iResolution.xy * 0.5;\n float size = min(iResolution.x, iResolution.y);\n vec2 uv = (fragCoord - center) / size * 2.0;\n \n float angle = rot;\n float s = sin(angle);\n float c = cos(angle);\n uv = vec2(c * uv.x - s * uv.y, s * uv.x + c * uv.y);\n \n uv.x += hover * hoverIntensity * 0.1 * sin(uv.y * 10.0 + iTime);\n uv.y += hover * hoverIntensity * 0.1 * sin(uv.x * 10.0 + iTime);\n \n return draw(uv);\n }\n \n void main() {\n vec2 fragCoord = vUv * iResolution.xy;\n vec4 col = mainImage(fragCoord);\n gl_FragColor = vec4(col.rgb * col.a, col.a);\n }\n ",uniforms:{iTime:{value:0},iResolution:{value:new Bm(i.canvas.width,i.canvas.height,i.canvas.width/i.canvas.height)},hue:{value:r},hover:{value:0},rot:{value:0},hoverIntensity:{value:o}}}),d=new gg(i,{geometry:c,program:u});function h(){if(!t)return;const n=window.devicePixelRatio||1,r=t.clientWidth,o=t.clientHeight,s=Math.min(r,o);e.setSize(s*n,s*n),i.canvas.style.width=s+"px",i.canvas.style.height=s+"px",i.canvas.style.display="block",i.canvas.style.objectFit="contain",u.uniforms.iResolution.value.set(s*n,s*n,s*n/(s*n))}window.addEventListener("resize",h),h();let p=0,f=0,m=0;const g=e=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,r=e.clientY-n.top,o=n.width,s=n.height,a=Math.min(o,s),l=(i-o/2)/a*2,c=(r-s/2)/a*2;p=Math.sqrt(l*l+c*c)<.8?1:0},b=()=>{p=0};let y;t.addEventListener("mousemove",g),t.addEventListener("mouseleave",b);const v=t=>{y=requestAnimationFrame(v);const i=.001*(t-f);f=t,u.uniforms.iTime.value=.001*t,u.uniforms.hue.value=r,u.uniforms.hoverIntensity.value=o;const a=n?1:p;u.uniforms.hover.value+=.1*(a-u.uniforms.hover.value),s&&a>.5&&(m+=.3*i),u.uniforms.rot.value=m,e.render({scene:d})};y=requestAnimationFrame(v),a=[()=>cancelAnimationFrame(y),()=>window.removeEventListener("resize",h),()=>t.removeEventListener("mousemove",g),()=>t.removeEventListener("mouseleave",b),()=>{t.contains(l)&&t.removeChild(l)},()=>i.getExtension("WEBGL_lose_context")?.loseContext()]},10);return()=>{clearTimeout(l),a.forEach(e=>e())}},[e,n]),t("div",{ref:i,className:"orb-container"})}const yg=c(({open:e,onClick:i,forceHoverState:r=!1},o)=>{const{settings:s}=Sm(),[a,l]=y(!1);return h(()=>{const e=setTimeout(()=>{l(!0),setTimeout(()=>l(!1),4e3)},1e3);return()=>clearTimeout(e)},[]),n(wa.button,{ref:o,className:"bmxcb__orb-button","aria-label":e?"Close chat":"Open chat",onClick:i,whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:25},children:[a&&t("div",{className:"bmxcb__orb-banner",children:"Ask BMX Assistant"}),t(bg,{settings:s,forceHoverState:r}),t("div",{className:"bmxcb__orb-icon",children:t(F,{size:20})})]})}),vg=c(({open:e,onClick:n,forceHoverState:i=!1},r)=>t(yg,{ref:r,open:e,onClick:n,forceHoverState:i}));function xg({api:r,projectId:o,zIndex:s=2147483e3,storage:a="local",storageKey:l="bmx-chat-bot-history",placeholder:c="Ask about this project…",title:d="Assistant",children:p}){const[f,m]=y(!1),[v,x]=y(""),[w,_]=y(!1),k=b(null),E=b(null),S=b(null),{mounted:A,root:C}=function({zIndex:e=2147483e3}){const[t,n]=y(!1);h(()=>{n(!0)},[]);const i=g(()=>{if(!t||"undefined"==typeof document)return null;const n=document.createElement("div");return n.setAttribute("data-bmx-chat-bot-root",""),n.style.all="initial",n.style.fontFamily="var(--bmx-font-family)",n.style.position="fixed",n.style.right="16px",n.style.bottom="16px",n.style.zIndex=String(e),n},[t,e]);return h(()=>{if(i&&"undefined"!=typeof document)return document.body.appendChild(i),()=>{try{document.body.removeChild(i)}catch{}}},[i]),{mounted:t,root:i}}({zIndex:s}),{messages:N,setMessages:M,sending:T,setSending:O,clearHistory:D}=function({storage:e="local",storageKey:t="bmx-chat-bot-history"}){const[n,i]=y([]),[r,o]=y(!1);h(()=>{if("undefined"!=typeof window&&"local"===e)try{const e=window.localStorage.getItem(t);e&&i(JSON.parse(e))}catch{}},[e,t]),h(()=>{if("undefined"!=typeof window&&"local"===e)try{window.localStorage.setItem(t,JSON.stringify(n))}catch{}},[n,e,t]);const s=u(()=>{if(i([]),"undefined"!=typeof window&&"local"===e)try{window.localStorage.removeItem(t)}catch{}},[e,t]),a=u(e=>{i(t=>[...t,e])},[]);return{messages:n,setMessages:i,sending:r,setSending:o,clearHistory:s,addMessage:a}}({storage:a,storageKey:l}),{sendMessage:I}=function({api:e,messages:t,projectId:n,setMessages:i,setSending:r}){const o=b(null);return{sendMessage:u(async s=>{const a=s.trim();if(!a)return;const l={id:`${Date.now()}-user`,role:"user",content:a,createdAt:Date.now()};i(e=>[...e,l]),r(!0),o.current?.abort(),o.current=new AbortController;try{const r=await e.sendMessage([...t,l],a,{projectId:n,signal:o.current.signal});i(e=>[...e,r])}catch(e){const t={id:`${Date.now()}-error`,role:"assistant",content:"Sorry, something went wrong. Please try again.",createdAt:Date.now()};i(e=>[...e,t])}finally{r(!1)}},[e,t,n,i,r])}}({api:r,messages:N,projectId:o,setMessages:M,setSending:O}),R=u(()=>{m(e=>!e)},[]),P=u(()=>{m(!1),_(!1)},[]),L=u(()=>{_(e=>!e)},[]);!function({open:e,showSettings:t,onToggleChat:n,onToggleSettings:i,onClose:r,chatButtonRef:o,chatPanelRef:s}){const a=u(a=>{if("Escape"!==a.key)return(a.ctrlKey||a.metaKey)&&"k"===a.key?(a.preventDefault(),n(),void(e?setTimeout(()=>o.current?.focus(),100):setTimeout(()=>{const e=s.current?.querySelector("textarea");e?.focus()},100))):(a.ctrlKey||a.metaKey)&&"/"===a.key?(a.preventDefault(),void(e&&i())):void 0;t?i():e&&(r(),setTimeout(()=>o.current?.focus(),100))},[e,t,n,i,r,o,s]);h(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[a])}({open:f,showSettings:w,onToggleChat:R,onToggleSettings:L,onClose:P,chatButtonRef:k,chatPanelRef:E}),function({isOpen:e,widgetRef:t,onClose:n,chatButtonRef:i}){const r=u(r=>{e&&t.current&&(t.current.contains(r.target)||(n(),setTimeout(()=>i.current?.focus(),100)))},[e,t,n,i]);h(()=>{if(e){const e=setTimeout(()=>{document.addEventListener("mousedown",r)},100);return()=>{clearTimeout(e),document.removeEventListener("mousedown",r)}}},[e,r])}({isOpen:f,widgetRef:S,onClose:P,chatButtonRef:k});const F=u(async()=>{const e=v.trim();e&&!T&&(x(""),await I(e))},[v,T,I]),B=u(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),F())},[F]);return A&&C?n(e,{children:[p??null,i(n("div",{className:"bmxcb",ref:S,children:[t(vg,{ref:k,open:f,onClick:R,forceHoverState:!1}),f&&t(Cm,{ref:E,title:d,messages:N,input:v,setInput:x,onKeyDown:B,onSend:()=>{F()},onClose:P,placeholder:c,sending:T,showSettings:w,onToggleSettings:L,onClearHistory:D,onSuggestionClick:async e=>{x(e),m(!0),x(""),await I(e)}})]}),C)]}):t(e,{children:p??null})}export{xg as BmxChatBot,A as RestAdapters,E as createMockAdapter,S as createRestAdapter,Sm as useChatSettings,km as useLocalStorage};
|