[a-z]+):\]/.exec(e);if(!t||!t$.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return b$("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return"-"===e?function(e){return{type:"CharacterClassHyphen",raw:e}}(e):"&&"===e?function(e){return{type:"CharacterClassIntersector",raw:e}}(e):g$(e$(e),e)}function p$(e,{inCharClass:t}){let n=e[1];if("c"===n||"C"===n)return function(e){let t="c"===e[1]?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return g$(e$(t.toUpperCase())-64,e)}(e);if("dDhHsSwW".includes(n))return function(e){let t=e[1].toLowerCase();return b$({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}(e);if(e.startsWith(n$`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(3===e.length)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return function(e){let{p:t,neg:n,value:r}=/^\\(?[pP])\{(?\^?)(?[^}]+)/.exec(e).groups;return b$("property",e,{value:r,negate:"P"===t&&!n||"p"===t&&!!n})}(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join("");return g$(e$(e),t)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if("u"===n||"x"===n)return g$(function(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);let t="{"===e[2]?/^\\x\{\s*(?\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}(e),e);if(C$.has(n))return g$(C$.get(n),e);if(/\d/.test(n))return function(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}(t,e);if("\\"===e)throw new Error(n$`Incomplete escape "\"`);if("M"===n)throw new Error(`Unsupported meta "${e}"`);if(2===[...e].length)return g$(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function d$(e){return{type:"Alternator",raw:e}}function h$(e,t){return{type:"Assertion",kind:e,raw:t}}function m$(e){return{type:"Backreference",raw:e}}function g$(e,t){return{type:"Character",value:e,raw:t}}function f$(e){return{type:"CharacterClassClose",raw:e}}function y$(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function b$(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function v$(e,t,n={}){return"keep"===e?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:r$(n.flags),raw:t}}function _$(e){return{type:"GroupClose",raw:e}}function x$(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function k$(e){return{type:"Subroutine",raw:e}}var w$=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),C$=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function T$(e,t){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(e).groups;r??="";let i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),a=E$(n),s=E$(r),o={};if(a&&(o.enable=a),s&&(o.disable=s),e.endsWith(")"))return t.replaceCurrentModX(i),v$("flags",e,{flags:o});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,x$("group",e,{...(a||s)&&{flags:o}});throw new Error(`Unexpected flag modifier "${e}"`)}function A$(e){let t=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(""===r)throw new Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(",").filter(e=>""!==e).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[s,o,l]=a,c=w$.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(a.length>0)throw new Error(`Named callout arguments not allowed "${a}"`);break;case"error":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if("string"==typeof s)throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!a.length||a.length>2)throw new Error(`Named callout must have one or two arguments "${a}"`);if("string"==typeof s&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(2===a.length&&("number"==typeof o||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${o}"`);break;case"count":case"total_count":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(1===a.length&&("number"==typeof s||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(3!==a.length)throw new Error(`Named callout must have three arguments "${a}"`);if("string"==typeof s&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if("number"==typeof o||!/^(?:[<>!=]=|[<>])$/.test(o))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${o}"`);if("string"==typeof l&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return function(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}(c,r??null,i?.split(",")??null,e)}function S$(e){let t,n,r=null;if("{"===e[0]){let{minStr:i,maxStr:a}=/^\{(?\d*)(?:,(?\d*))?/.exec(e).groups,s=1e5;if(+i>s||a&&+a>s)throw new Error("Quantifier value unsupported in Oniguruma");if(t=+i,n=void 0===a?+i:""===a?1/0:+a,t>n&&(r="possessive",[t,n]=[n,t]),e.endsWith("?")){if("possessive"===r)throw new Error('Unsupported possessive interval quantifier chain with "?"');r="lazy"}else r||(r="greedy")}else t="+"===e[0]?1:0,n="?"===e[0]?1:1/0,r="+"===e[1]?"possessive":"?"===e[1]?"lazy":"greedy";return function(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}(r,t,n,e)}function E$(e){let t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function $$(e){let t,n=[],r=new RegExp(s$,"gy");for(;t=r.exec(e);){let e=t[0];if("{"===e[0]){let t=/^\{(?\d+),(?\d+)\}\??$/.exec(e);if(t){let{min:i,max:a}=t.groups;if(+i>+a&&e.endsWith("?")){r.lastIndex--,n.push(S$(e.slice(0,-1)));continue}}}n.push(S$(e))}return n}function R$(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(1!==e.body.length)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}var L$=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function I$(e,t={}){let n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=function(e,t={}){let n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if("string"!=typeof e)throw new Error("String expected as pattern");let r,i=function(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;na.at(-1),numOpenGroups:0,popModX(){a.pop()},pushModX(e){a.push(e)},replaceCurrentModX(e){a[a.length-1]=e},singleline:n.rules.singleline},o=[];for(o$.lastIndex=0;r=o$.exec(e);){let t=c$(s,e,r[0],o$.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),void 0!==t.lastIndex&&(o$.lastIndex=t.lastIndex)}let l=[],c=0;o.filter(e=>"GroupOpen"===e.type).forEach(e=>{"capturing"===e.kind?e.number=++c:"("===e.raw&&l.push(e)}),c||l.forEach((e,t)=>{e.kind="capturing",e.number=t+1});let u=c||l.length;return{tokens:o.map(e=>"EscapedNumber"===e.type?function(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&("0"!==i&&1===i.length||"0"!==i[0]&&+i<=t))return[m$(n)];let a=[],s=i.match(/^[0-7]+|\d/g);for(let e=0;e127)throw new Error(n$`Octal encoded byte above 177 unsupported "${n}"`)}else t=e$(r);a.push(g$(t,(0===e?"\\":"")+r))}return a}(e,u):e).flat(),flags:i}}(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case"Alternator":return N$();case"Assertion":return function({kind:e}){return M$(r$({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===n$`\B`||e===n$`\Y`})}(n);case"Backreference":return function({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(!t.skipBackrefValidation)throw new Error(`Not enough capturing groups defined to the left "${e}"`);a=!0}return t.hasNumberedRef=!0,D$(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return D$(r)}return i(+r)}(n,a);case"Character":return O$(n.value,{useLastValid:!!t.isCheckingRangeEnd});case"CharacterClassHyphen":return function(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,s=a.body.at(-1),o=r[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&"CharacterClass"!==s.type&&"CharacterClassRange"!==s.type&&o&&"CharacterClassOpen"!==o.type&&"CharacterClassClose"!==o.type&&"CharacterClassIntersector"!==o.type){let e=i(a,{...n,isCheckingRangeEnd:!0});if("Character"===s.type&&"Character"===e.type)return a.body.pop(),function(e,t){if(t.value1===e.body.length?e.body[0]:e)),t.nextIndex++,l}(n,a,t);case"CharacterSet":return function({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:s}=r;if("property"===e){let r=Y$(n);if(!t$.has(r)||s?.has(r))return W$(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:s});e="posix",n=r}return"posix"===e?function(e,t){let n=!!t?.negate;if(!t$.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}(n,{negate:t}):j$(e,{negate:t})}(n,a);case"Directive":return function(e,t={}){if("keep"===e)return{type:"Directive",kind:e};if("flags"===e)return{type:"Directive",kind:e,flags:r$(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}(n.kind,{flags:n.flags});case"GroupOpen":return function(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:s,walk:o}=t,l=function({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return{type:"AbsenceFunction",kind:"repeater",body:V$(void 0)};case"atomic":return B$({atomic:!0});case"capturing":return P$(i,{name:n});case"group":return B$({flags:e});case"lookahead":case"lookbehind":return z$({behind:"lookbehind"===t,negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}(e),c="AbsenceFunction"===l.type,u=Z$(l),p=u&&l.negate;if("CapturingGroup"===l.type&&(i.push(l),l.name&&function(e,t){return e.has(t)||e.set(t,[]),e.get(t)}(a,l.name).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=X$(r[t.nextIndex]);for(;"GroupClose"!==d.type;){if("Alternator"===d.type)l.body.push(N$()),t.nextIndex++;else{let e=l.body.at(-1),t=o(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||p});if(e.body.push(t),(u||n.isInLookbehind)&&!s){let e="Lookbehind includes a pattern not allowed by Oniguruma";if(p||n.isInNegLookbehind){if(G$(t)||"CapturingGroup"===t.type)throw new Error(e)}else if(G$(t)||Z$(t)&&t.negate)throw new Error(e)}}d=X$(r[t.nextIndex])}return t.nextIndex++,l}(n,a,t);case"NamedCallout":return function(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}(n.kind,n.tag,n.arguments);case"Quantifier":return function({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!function(e){return L$.has(e.type)}(a))throw new Error("Quantifier requires a repeatable token");let s=q$(e,t,n,a);return i.body.pop(),s}(n,a);case"Subroutine":return function({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw new Error("Invalid subroutine number")}else"0"===i&&(i=0);let s=U$(i);return r.push(s),s}(n,a);default:throw new Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},s=function(e){return{type:"Regex",body:V$(void 0),flags:e}}(function(e){return{type:"Flags",...e}}(r.flags)),o=s.body[0];for(;a.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");e&&(l[e-1].isSubroutined=!0)}else{if(!u.has(e))throw new Error(n$`Subroutine uses a group name that's not defined "\g<${e}>"`);if(u.get(e).length>1)throw new Error(n$`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}return s}function N$(e){return{type:"Alternative",body:K$(e?.body)}}function M$(e,t){let n={type:"Assertion",kind:e};return("word_boundary"===e||"text_segment_boundary"===e)&&(n.negate=!!t?.negate),n}function D$(e,t){let n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function P$(e,t){let n={name:void 0,isSubroutined:!1,...t};if(void 0!==n.name&&!function(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:V$(t?.body)}}function O$(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(!n.useLastValid)throw e>1310719?new Error(`Invalid code point out of range "\\x{${t}}"`):new Error(`Invalid code point out of range in JS "\\x{${t}}"`);e=1114111}return{type:"Character",value:e}}function F$(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:K$(e?.body)}}function j$(e,t){let n=!!t?.negate,r={type:"CharacterSet",kind:e};return("digit"===e||"hex"===e||"newline"===e||"space"===e||"word"===e)&&(r.negate=n),("text_segment"===e||"newline"===e&&!n)&&(r.variableLength=!0),r}function B$(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:V$(e?.body)}}function z$(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:V$(e?.body)}}function q$(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function U$(e){return{type:"Subroutine",ref:e}}function W$(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Y$(e));if(!r)if(n.normalizeUnknownPropertyNames)r=function(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(n$`Invalid Unicode property "\p{${e}}"`);return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function V$(e){if(void 0===e)e=[N$()];else if(!Array.isArray(e)||!e.length||!e.every(e=>"Alternative"===e.type))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function K$(e){if(void 0===e)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return e}function G$(e){return"LookaroundAssertion"===e.type&&"lookahead"===e.kind}function Z$(e){return"LookaroundAssertion"===e.type&&"lookbehind"===e.kind}function Y$(e){return e.replace(/[- _]+/g,"").toLowerCase()}function H$(e,t){return r$(e,("Character"===t?.type&&93===t.value?"Empty":"Unclosed")+" character class")}function X$(e){return r$(e,"Unclosed group")}function Q$(e,t,n=null){function r(e,t){for(let n=0;nJ$(l).splice(eR(o)+1),removeAllPrevSiblings(){let e=eR(o)+c;return c-=e,J$(l).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;l?l[Math.max(0,eR(o)+c)]=e:r$(s,"Can't replace root node")[o]=e,n&&i(e,s,o,l),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(J$(l).splice(Math.max(0,eR(o)+c),1,...e),c+=e.length-1,n){let t=0;for(let n=0;nA-Za-z\-]|<[=!]|\(DEFINE\))`;function nR(e,t){for(let n=0;n=t&&e[n]++}function rR(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var iR=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function aR(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1],s=0,o="";for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;i||r&&r===iR.DEFAULT!=!s?("["===e[0]?(s++,a.push("^"===e[1])):"]"===e&&s&&(s--,a.pop()),o+=e):o+=n instanceof Function?n(t,{context:s?iR.CHAR_CLASS:iR.DEFAULT,negated:a[a.length-1]}):n}return o}function sR(e,t,n,r){aR(e,t,n,r)}function oR(e,t,n){return!!function(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;let i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let a,s=0;for(;a=i.exec(e);){let{0:e,groups:{$skip:t}}=a;if(!(t||r&&r===iR.DEFAULT!=!s))return a;"["===e?s++:"]"===e&&s&&s--,i.lastIndex==a.index&&i.lastIndex++}return null}(e,t,0,n)}function lR(e,t){let n=/\\?./gsu;n.lastIndex=t;let r,i=e.length,a=0,s=1;for(;r=n.exec(e);){let[e]=r;if("["===e)a++;else if(a)"]"===e&&a--;else if("("===e)s++;else if(")"===e&&(s--,!s)){i=r.index;break}}return e.slice(t,i)}var cR=new RegExp(String.raw`(?${tR})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu"),uR=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,pR=new RegExp(String.raw`
\\(?: \d+
| c[A-Za-z]
| [gk]<[^>]+>
| [pPu]\{[^\}]+\}
| u[A-Fa-f\d]{4}
| x[A-Fa-f\d]{2}
)
| \((?: \? (?: [:=!>]
| <(?:[=!]|[^>]+>)
| [A-Za-z\-]+:
| \(DEFINE\)
))?
| (?${uR})(?[?+]?)(?[?*+\{]?)
| \\?.
`.replace(/\s+/g,""),"gsu"),dR=String.raw,hR=dR`\\g<(?[^>&]+)&R=(?[^>]+)>`,mR=dR`\(\?R=(?[^\)]+)\)|${hR}`,gR=dR`\(\?<(?![=!])(?[^>]+)>`,fR=dR`${gR}|(?\()(?!\?)`,yR=new RegExp(dR`${gR}|${mR}|\(\?|\\?.`,"gsu"),bR="Cannot use multiple overlapping recursions";function vR(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if((e=+e)<2||e>100)throw new Error(t)}function _R(e,t,n,r,i,a,s){let o=new Set;r&&sR(e+t,gR,({groups:{captureName:e}})=>{o.add(e)},iR.DEFAULT);let l=[n,r?o:null,i,a,s];return`${e}${xR(`(?:${e}`,"forward",...l)}(?:)${xR(`${t})`,"backward",...l)}${t}`}function xR(e,t,n,r,i,a,s){let o=e=>"forward"===t?e+2:n-e+2-1,l="";for(let t=0;t[^>]+)>`,({0:e,groups:{captureName:t,unnamed:o,backref:l}})=>{if(l&&r&&!r.has(l))return e;let c=`_$${n}`;if(o||t){let n=s+a.length+1;return a.push(n),kR(i,n),o?e:`(?<${t}${c}>`}return dR`\k<${l}${c}>`},iR.DEFAULT)}return l}function kR(e,t){for(let n=0;n=t&&e[n]++}function wR(e,t,n,r,i,a){if(e.size&&r){let s=0;sR(t,fR,()=>s++,iR.DEFAULT);let o=a-s+i,l=new Map;return e.forEach((e,t)=>{let i=(r-s*n)/n,a=s*n,c=t>o+s?t+r:t,u=[];for(let t of e)if(t<=o)u.push(t);else if(t>o+s+i)u.push(t+r);else if(t<=o+s)for(let e=0;e<=n;e++)u.push(t+s*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);l.set(c,u)}),l}return e}var CR=String.fromCodePoint,TR=String.raw,AR={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};function SR(e,{enable:t,disable:n}){return{dotAll:!(n?.dotAll||!t?.dotAll&&!e.dotAll),ignoreCase:!(n?.ignoreCase||!t?.ignoreCase&&!e.ignoreCase)}}function ER(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function $R(e,t){return RR[e]>=RR[t]}AR.bugFlagVLiteralHyphenIsRange=!!AR.unicodeSets&&(()=>{try{new RegExp(TR`[\d\-a]`,"v")}catch{return!0}return!1})(),AR.bugNestedClassIgnoresNegation=AR.unicodeSets&&new RegExp("[[^a]]","v").test("a");var RR={ES2025:2025,ES2024:2024,ES2018:2018},LR={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function IR(e={}){if("[object Object]"!=={}.toString.call(e))throw new Error("Unexpected options");if(void 0!==e.target&&!LR[e.target])throw new Error(`Unexpected target "${e.target}"`);let t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return"auto"===t.target&&(t.target=AR.flagGroups?"ES2025":AR.unicodeSets?"ES2024":"ES2018"),t}var NR=new Set([CR(304),CR(305)]),MR=TR`[\p{L}\p{M}\p{N}\p{Pc}]`;function DR(e){if(NR.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=jR.get(n),a=OR.get(n),s=FR.get(n);return 1===[...r].length&&t.add(r),s&&t.add(s),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var PR=new Map("C Other\nCc Control cntrl\nCf Format\nCn Unassigned\nCo Private_Use\nCs Surrogate\nL Letter\nLC Cased_Letter\nLl Lowercase_Letter\nLm Modifier_Letter\nLo Other_Letter\nLt Titlecase_Letter\nLu Uppercase_Letter\nM Mark Combining_Mark\nMc Spacing_Mark\nMe Enclosing_Mark\nMn Nonspacing_Mark\nN Number\nNd Decimal_Number digit\nNl Letter_Number\nNo Other_Number\nP Punctuation punct\nPc Connector_Punctuation\nPd Dash_Punctuation\nPe Close_Punctuation\nPf Final_Punctuation\nPi Initial_Punctuation\nPo Other_Punctuation\nPs Open_Punctuation\nS Symbol\nSc Currency_Symbol\nSk Modifier_Symbol\nSm Math_Symbol\nSo Other_Symbol\nZ Separator\nZl Line_Separator\nZp Paragraph_Separator\nZs Space_Separator\nASCII\nASCII_Hex_Digit AHex\nAlphabetic Alpha\nAny\nAssigned\nBidi_Control Bidi_C\nBidi_Mirrored Bidi_M\nCase_Ignorable CI\nCased\nChanges_When_Casefolded CWCF\nChanges_When_Casemapped CWCM\nChanges_When_Lowercased CWL\nChanges_When_NFKC_Casefolded CWKCF\nChanges_When_Titlecased CWT\nChanges_When_Uppercased CWU\nDash\nDefault_Ignorable_Code_Point DI\nDeprecated Dep\nDiacritic Dia\nEmoji\nEmoji_Component EComp\nEmoji_Modifier EMod\nEmoji_Modifier_Base EBase\nEmoji_Presentation EPres\nExtended_Pictographic ExtPict\nExtender Ext\nGrapheme_Base Gr_Base\nGrapheme_Extend Gr_Ext\nHex_Digit Hex\nIDS_Binary_Operator IDSB\nIDS_Trinary_Operator IDST\nID_Continue IDC\nID_Start IDS\nIdeographic Ideo\nJoin_Control Join_C\nLogical_Order_Exception LOE\nLowercase Lower\nMath\nNoncharacter_Code_Point NChar\nPattern_Syntax Pat_Syn\nPattern_White_Space Pat_WS\nQuotation_Mark QMark\nRadical\nRegional_Indicator RI\nSentence_Terminal STerm\nSoft_Dotted SD\nTerminal_Punctuation Term\nUnified_Ideograph UIdeo\nUppercase Upper\nVariation_Selector VS\nWhite_Space space\nXID_Continue XIDC\nXID_Start XIDS".split(/\s/).map(e=>[Y$(e),e])),OR=new Map([["s",CR(383)],[CR(383),"s"]]),FR=new Map([[CR(223),CR(7838)],[CR(107),CR(8490)],[CR(229),CR(8491)],[CR(969),CR(8486)]]),jR=new Map([zR(453),zR(456),zR(459),zR(498),...qR(8072,8079),...qR(8088,8095),...qR(8104,8111),zR(8124),zR(8140),zR(8188)]),BR=new Map([["alnum",TR`[\p{Alpha}\p{Nd}]`],["alpha",TR`\p{Alpha}`],["ascii",TR`\p{ASCII}`],["blank",TR`[\p{Zs}\t]`],["cntrl",TR`\p{Cc}`],["digit",TR`\p{Nd}`],["graph",TR`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",TR`\p{Lower}`],["print",TR`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",TR`[\p{P}\p{S}]`],["space",TR`\p{space}`],["upper",TR`\p{Upper}`],["word",TR`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",TR`\p{AHex}`]]);function zR(e){let t=CR(e);return[t.toLowerCase(),t]}function qR(e,t){return function(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}(e,t).map(e=>zR(e))}var UR=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]),WR={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if("repeater"!==i)throw new Error('Unsupported absence function "(?~|"');{let e=B$();e.body[0].body.push(z$({negate:!0,body:r}),W$("Any"));let i=B$();i.body[0].body.push(q$("greedy",0,1/0,e)),n(sL(i,t),{traverse:!0})}},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>"flags"===e.kind);for(let e=n+1;e\r\n|${i?TR`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if("hex"===l)n(aL(W$("AHex",{negate:c}),t));else if("newline"===l)n(sL(rL(c?"[^\n]":"(?>\r\n?|[\n\v\f
\u2028\u2029])"),t));else if("posix"===l)if(i||"graph"!==u&&"print"!==u)n(sL(iL(rL(BR.get(u)),c),t));else{if("strict"===r)throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:"!-~",print:" -~"}[u];c&&(e=`\0-${CR(e.codePointAt(0)-1)}${CR(e.codePointAt(2)+1)}-`),n(sL(rL(`[${e}]`),t))}else if("property"===l)PR.has(Y$(u))||(e.key="sc");else if("space"===l)n(aL(W$("space",{negate:c}),t));else{if("word"!==l)throw new Error(`Unexpected character set kind "${l}"`);n(sL(iL(rL(MR),c),t))}}else n(aL(j$("word",{negate:c}),t));else n(sL(iL(rL("[\t-\r ]"),c),t));else n(aL(j$("digit",{negate:c}),t))},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:s}){let{kind:o,flags:l}=e;if("flags"===o)if(l.enable||l.disable){let e=B$({flags:l});e.body[0].body=s(),i(sL(e,t),{traverse:!0})}else r();else{if("keep"!==o)throw new Error(`Unexpected directive kind "${o}"`);{let e=n.body[0],r=1===n.body.length&&R$(e,{type:"Group"})&&1===e.body[0].body.length?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw new Error(TR`Uses "\K" in a way that's unsupported`);let s=z$({behind:!0});s.body[0].body=a(),i(sL(s,t))}}},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if("word"===e.textSegmentMode)throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;"lookbehind"===n&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if("fail"!==r)throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`);n(sL(z$({negate:!0}),t))},Quantifier({node:e}){if("Quantifier"===e.body.type){let t=B$();t.body[0].body.push(e.body),e.body=sL(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(1===t.body.length&&"search_start"===t.body[0].kind)t.body.pop();else{let e=eL(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if("strict"===t&&n&&r)throw new Error(TR`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;"string"==typeof n&&!nL(n)&&(n=HR(n,t),e.ref=n)}},VR={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:s,openRefs:o,reffedNodesByReferencer:l}){let c=i.get(e);if(c&&o.has(e.number)){let r=aL(YR(e.number),t);return l.set(r,o.get(e.number)),void n(r)}o.set(e.number,e),s.set(e.number,[]),e.name&&ER(s,e.name,[]);let u=s.get(e.name??e.number);for(let t=0;t"Group"===e.type&&!!e.flags)),t=e?SR(r.globalFlags,e):r.globalFlags;(function(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase})(t,r.currentFlags)||(c=B$({flags:QR(t)}),c.body[0].body.push(l))}n(sL(c,t),{traverse:!o})}},KR={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan)return void(r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref));let i=r.reffedNodesByReferencer.get(e).filter(t=>function(e,t){let n=t;do{if("Regex"===n.type)return!1;if("Alternative"===n.type)continue;if(n===e)return!1;let t=JR(n.parent);for(let r of t){if(r===n)break;if(r===e||tL(r,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}(t,e));if(i.length)if(i.length>1){n(sL(B$({atomic:!0,body:i.reverse().map(e=>N$({body:[D$(e.number)]}))}),t))}else e.ref=i[0].number;else n(sL(z$({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function QR({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),e&&t||(n.disable={},!e&&(n.disable.dotAll=!0),t||(n.disable.ignoreCase=!0)),n}function JR(e){if(!e)throw new Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function eL(e){let t=e.find(e=>"search_start"===e.kind||function(e){let t={negate:null,negate:!1};return"LookaroundAssertion"===e.type&&(null===t.negate||e.negate===t.negate)&&1===e.body.length&&R$(e.body[0],{type:"Assertion",kind:"search_start"})}(e)||!function({type:e}){return"Assertion"===e||"Directive"===e||"LookaroundAssertion"===e}(e));if(!t)return null;if("search_start"===t.kind)return t;if("LookaroundAssertion"===t.type)return t.body[0].body[0];if("CapturingGroup"===t.type||"Group"===t.type){let e=[];for(let n of t.body){let t=eL(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function tL(e,t){let n=JR(e)??[];for(let e of n)if(e===t||tL(e,t))return!0;return!1}function nL(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function rL(e,t){let n=I$(e,{...t,unicodePropertyMap:PR}).body;return n.length>1||n[0].body.length>1?B$({body:n}):n[0].body[0]}function iL(e,t){return e.negate=t,e}function aL(e,t){return e.parent=t,e}function sL(e,t){return GR(e),e.parent=t,e}var oL={"*":{enter({node:e},t){if(yL(e)){let n=t.getCurrentModI();t.pushModI(e.flags?SR({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){yL(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){mL(CR(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),gL(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){"property"===e.kind&&UR.has(e.value)&&t.setHasCasedChar()}},lL={Alternative:({body:e},t,n)=>e.map(n).join(""),Assertion({kind:e,negate:t}){if("string_end"===e)return"$";if("string_start"===e)return"^";if("word_boundary"===e)return t?TR`\B`:TR`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if("number"!=typeof e)throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&"strict"===t.accuracy&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,s={ignoreCase:t.currentFlags.ignoreCase},o=t.originMap.get(e);return o&&(s.hidden=!0,a>o.number&&(s.transferTo=o.number)),t.captureMap.set(a,s),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){let n=CR(e),r=fL(e,{escDigit:"Backreference"===t.lastNode.type,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&mL(n)){let e=DR(n);return t.inCharClass?e.join(""):e.length>1?`[${e.join("")}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:s}=e;if("intersection"===r&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");AR.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(bL)&&(s=[O$(45),...s.filter(e=>!bL(e))]);let o=()=>`[${i?"^":""}${s.map(n).join("intersection"===r?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||AR.bugNestedClassIgnoresNegation)&&!i){let t=s.filter(e=>"CharacterClass"===e.type&&"union"===e.kind&&e.negate);if(t.length){let r=B$(),i=r.body[0];return r.parent=a,i.parent=r,s=s.filter(e=>!t.includes(e)),e.body=s,s.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=N$({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=o();return t.inCharClass=!1,r}let l=s[0];if("union"===r&&!i&&l&&((!t.useFlagV||!t.verbose)&&"union"===a.kind&&(!AR.bugFlagVLiteralHyphenIsRange||!t.useFlagV)||!t.verbose&&"intersection"===a.kind&&1===s.length&&"CharacterClassRange"!==l.type))return s.map(n).join("");if(!t.useFlagV&&"CharacterClass"===a.type)throw new Error("Uses nested character class in a way that requires min target ES2024");return o()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=fL(n,i),s=fL(r,i),o=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&function(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e{o.add(Array.isArray(e)?`${fL(e[0],i)}-${fL(e[1],i)}`:fL(e,i))}),`${a}-${s}${[...o].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if("dot"===e)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":TR`[^\n]`;if("digit"===e)return t?TR`\D`:TR`\d`;if("property"===e){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&UR.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?TR`\P`:TR`\p`}{${r?`${r}=`:""}${n}}`}if("word"===e)return t?TR`\W`:TR`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags:(e,t)=>(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":""),Group({atomic:e,body:t,flags:n,parent:r},i,a){let s=i.currentFlags;n&&(i.currentFlags=SR(s,n));let o=t.map(a).join("|"),l=i.verbose||1!==t.length||"Quantifier"===r.type||e||i.useFlagMods&&n?`(?${function(e,t,n){if(e)return">";let r="";if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?"i":"")+(e?.dotAll?"s":"")+(n?"-":"")+(n?.ignoreCase?"i":"")+(n?.dotAll?"s":"")}return`${r}:`}(e,n,i.useFlagMods)}${o})`:o;return i.currentFlags=s,l},LookaroundAssertion:({body:e,kind:t,negate:n},r,i)=>`(?${"lookahead"===t?"":"<"}${n?"!":"="}${e.map(i).join("|")})`,Quantifier:(e,t,n)=>n(e.body)+function({kind:e,max:t,min:n}){let r;return r=n||1!==t?n||t!==1/0?1===n&&t===1/0?"+":n===t?`{${n}}`:`{${n},${t===1/0?"":t}}`:"*":"?",r+{greedy:"",lazy:"?",possessive:"+"}[e]}(e),Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");let r=n.recursionLimit;return 0===t?`(?R=${r})`:TR`\g<${t}&R=${r}>`}},cL=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),uL=new Set(["-","\\","]","^","["]),pL=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),dL=new Map([[9,TR`\t`],[10,TR`\n`],[11,TR`\v`],[12,TR`\f`],[13,TR`\r`],[8232,TR`\u2028`],[8233,TR`\u2029`],[65279,TR`\uFEFF`]]),hL=/^\p{Cased}$/u;function mL(e){return hL.test(e)}function gL(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(65535===i||i>=131071)||65536===r&&i>=131071)return a;for(let e=r;e<=i;e++){let t=CR(e);if(!mL(t))continue;let s=DR(t).filter(e=>{let t=e.codePointAt(0);return ti});if(s.length&&(a.push(...s),n))break}return a}function fL(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(dL.has(e))return dL.get(e);if(e<32||e>126&&e<160||e>262143||t&&function(e){return e>47&&e<58}(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let i=n?r?pL:uL:cL,a=CR(e);return(i.has(a)?"\\":"")+a}function yL({type:e}){return"CapturingGroup"===e||"Group"===e||"LookaroundAssertion"===e}function bL({type:e,value:t}){return"Character"===e&&45===t}var vL=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#n=t,this.#e=function(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)ER(n,t,{}).transferTo=e;return n}(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if("clip_search"===this.#i&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(function(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n,r=[...t];t.length=1,this.hasIndices&&(n=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,r=new Map,i=0,a=0;for(;t=n.exec(e);){let{0:e,groups:{capture:n,name:s}}=t;"["===e?i++:i?"]"===e&&i--:n&&(a++,s&&r.set(a,s))}return r}function xL(e,t){let n=function(e,t){let n=IR(t),r=function(e,t){let n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};GR(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:$R(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Q$(e,WR,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Q$(e,VR,a),Q$(e,KR,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}(I$(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:PR}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=function(e,t){let n=IR(t),r=$R(n.target,"ES2024"),i=$R(n.target,"ES2025"),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,o=null;if(!i){let t=[e.flags.ignoreCase];Q$(e,oL,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?s=!0:o=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!(!e.flags.ignoreCase&&!s||o)},c=e,u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!(i||!s||!o),useFlagMods:i,useFlagV:r,verbose:n.verbose};function p(e){return u.lastNode=c,c=e,function(e,t){if(null==e)throw new Error(t??"Value expected");return e}(lL[e.type],`Unexpected node type "${e.type}"`)(e,u,p)}let d={pattern:e.body.map(p).join("|"),flags:p(e.flags),options:{...e.options}};return r||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&d._hiddenCaptures.push(t),e.transferTo&&ER(d._captureTransfers,e.transferTo,[]).push(t)}),d}(r,n),a=function(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t},i=t?.captureTransfers??new Map;if(!new RegExp(mR,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if("plugin"===r&&oR(e,dR`\(\?\(DEFINE\)`,iR.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");let a,s=[],o=oR(e,dR`\\[1-9]`,iR.DEFAULT),l=new Map,c=[],u=!1,p=0,d=0;for(yR.lastIndex=0;a=yR.exec(e);){let{0:t,groups:{captureName:h,rDepth:m,gRNameOrNum:g,gRDepth:f}}=a;if("["===t)p++;else if(p)"]"===t&&p--;else{if(m){if(vR(m),u)throw new Error(bR);if(o)throw new Error(("external"===r?"Backrefs":"Numbered backrefs")+" cannot be used with global recursion");let t=e.slice(0,a.index),l=e.slice(yR.lastIndex);if(oR(l,mR,iR.DEFAULT))throw new Error(bR);let c=+m-1;e=_R(t,l,c,!1,n,s,d),i=wR(i,t,c,s.length,0,d);break}if(g){vR(f);let p=!1;for(let e of c)if(e.name===g||e.num===+g){if(p=!0,e.hasRecursedWithin)throw new Error(bR);break}if(!p)throw new Error(dR`Recursive \g cannot be used outside the referenced group "${"external"===r?g:dR`\g<${g}&R=${f}>`}"`);let h=l.get(g),m=lR(e,h);if(o&&oR(m,dR`${gR}|\((?!\?)`,iR.DEFAULT))throw new Error(("external"===r?"Backrefs":"Numbered backrefs")+" cannot be used with recursion of capturing groups");let y=e.slice(h,a.index),b=m.slice(y.length+t.length),v=s.length,_=+f-1,x=_R(y,b,_,!0,n,s,d);i=wR(i,y,_,s.length-v,v,d);let k=e.slice(0,h),w=e.slice(h+m.length);e=`${k}${x}${w}`,yR.lastIndex+=x.length-t.length-y.length-b.length,c.forEach(e=>e.hasRecursedWithin=!0),u=!0}else if(h)d++,l.set(String(d),yR.lastIndex),l.set(h,yR.lastIndex),c.push({num:d,name:h});else if("("===t[0]){let e="("===t;e&&(d++,l.set(String(d),yR.lastIndex)),c.push(e?{num:d}:{})}else")"===t&&c.pop()}}return n.push(...s),{pattern:e,captureTransfers:i,hiddenCaptures:n}}(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),s=function(e){if(!new RegExp(`${uR}\\+`).test(e))return{pattern:e};let t,n=[],r=null,i=null,a="",s=0;for(pR.lastIndex=0;t=pR.exec(e);){let{0:o,index:l,groups:{qBase:c,qMod:u,invalidQ:p}}=t;if("["===o)s||(i=l),s++;else if("]"===o)s?s--:i=null;else if(!s)if("+"===u&&a&&!a.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${o}"`);let t=-1;if(/^\{\d+\}$/.test(c))e=rR(e,l+c.length,u,"");else{if(")"===a||"]"===a){let t=")"===a?r:i;if(null===t)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,t)}(?>${e.slice(t,l)}${c})${e.slice(l+o.length)}`}else e=`${e.slice(0,l-a.length)}(?>${a}${c})${e.slice(l+o.length)}`;t+=4}pR.lastIndex+=t}else"("===o[0]?n.push(l):")"===o&&(r=n.length?n.pop():null);a=o}return{pattern:e}}(a.pattern),o=function(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i,a=[0],s=[],o=0,l=0,c=NaN;do{i=!1;let t,u=0,p=0,d=!1;for(cR.lastIndex=Number.isNaN(c)?0:c+7;t=cR.exec(e);){let{0:h,index:m,groups:{capturingStart:g,noncapturingStart:f}}=t;if("["===h)u++;else if(u)"]"===h&&u--;else if("(?>"!==h||d){if(d&&f)p++;else if(g)d?p++:(o++,a.push(o+l));else if(")"===h&&d){if(!p){l++;let t=o+l;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,i=!0,s.push(t),nR(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}p--}}else c=m,d=!0}}while(i);return n.push(...s),{pattern:e=aR(e,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>a.length-1)throw new Error(`Backref "${e}" greater than number of captures`);return`\\${a[n]}`}return`\\${n}`},iR.DEFAULT),captureTransfers:r,hiddenCaptures:n}}(s.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),l={pattern:o.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=l.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(l.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return l}(e,t);return n.options?new vL(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}var kL,wL=class{constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if("string"!=typeof e)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}regexps;findNextMatchSync(e,t,n){let r="string"==typeof e?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>null==e?{start:4294967295,end:4294967295,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;ee[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function CL(e={}){let t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=e=>function(e,t){return xL(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}(e,{target:t.target}),{createScanner:e=>new wL(e,t),createString:e=>({content:e})}}function TL({tokens:e,selectedLine:t}){let n=1===e.tokens.length;return(0,b.jsx)("code",{children:e.tokens.map((e,r)=>{let i=t?.number===r+1;return(0,b.jsx)("span",{ref:i?t?.ref:void 0,className:`line ${n?"inline":"block px-2"} ${i?`${dT} bg-primary-200/25`:""}`,children:0===e.length?(0,b.jsx)("br",{}):e.map((e,t)=>(0,b.jsx)("span",{className:"token",style:XE(e),children:e.content},t))},r)})})}function AL({code:e,selectedLine:t}){let n=e.split("\n"),r=1===n.length;return(0,b.jsx)("code",{children:n.map((e,n)=>{let i=t?.number===n+1;return(0,b.jsx)("span",{ref:i?t?.ref:void 0,className:`line ${r?"inline":"block px-3"} ${i?`${dT} bg-primary-200/25`:""}`,children:0===e.length?(0,b.jsx)("br",{}):e.split(" ").map((e,t)=>(0,b.jsx)("span",{className:"token",children:`${0===t?"":" "}${e}`},t))},n)})})}function SL({code:e,language:t,selectedLine:n}){let r=(void 0===kL&&(kL=HE({...JE,engine:CL()})),kL);if(!r.getLoadedLanguages().includes(t))return(0,b.jsx)(AL,{code:e,selectedLine:n});let i=r.codeToTokens(e,{lang:t,theme:QE});return(0,b.jsx)(TL,{tokens:i,selectedLine:n})}function EL({code:e,language:t,lines:n,copyButton:r=!0,selectedLine:i,className:a,inline:s,size:o}){let l=s??(void 0===n&&1===e.split("\n").length),c=t?(0,b.jsx)(SL,{code:e,language:t,selectedLine:i}):(0,b.jsx)(AL,{code:e,selectedLine:i});return l?(0,b.jsx)(mT,{className:a,size:o,children:c}):(0,b.jsx)(hT,{code:e,lines:n,copyButton:r,className:a,size:o,selectedLine:i,children:c})}function $L(e){return Array.isArray?Array.isArray(e):"[object Array]"===DL(e)}function RL(e){return"string"==typeof e}function LL(e){return"number"==typeof e}function IL(e){return"object"==typeof e}function NL(e){return null!=e}function ML(e){return!e.trim().length}function DL(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var PL=Object.prototype.hasOwnProperty,OL=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=FL(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function FL(e){let t=null,n=null,r=null,i=1,a=null;if(RL(e)||$L(e))r=e,t=jL(e),n=BL(e);else{if(!PL.call(e,"name"))throw new Error("Missing name property in key");let s=e.name;if(r=s,PL.call(e,"weight")&&(i=e.weight,i<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(s));t=jL(s),n=BL(s),a=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:a}}function jL(e){return $L(e)?e:e.split(".")}function BL(e){return $L(e)?e.join("."):e}var zL={useExtendedSearch:!1,getFn:function(e,t){let n=[],r=!1,i=(e,t,a)=>{if(NL(e))if(t[a]){let s=e[t[a]];if(!NL(s))return;if(a===t.length-1&&(RL(s)||LL(s)||function(e){return!0===e||!1===e||function(e){return IL(e)&&null!==e}(e)&&"[object Boolean]"==DL(e)}(s)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(s));else if($L(s)){r=!0;for(let e=0,n=s.length;ee.score===t.score?e.idx{this._keysMap[e.id]=t})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,RL(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();RL(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t{let i=t.getFn?t.getFn(e):this.getFn(e,t.path);if(NL(i))if($L(i)){let e=[],t=[{nestedArrIndex:-1,value:i}];for(;t.length;){let{nestedArrIndex:n,value:r}=t.pop();if(NL(r))if(RL(r)&&!ML(r)){let t={v:r,i:n,n:this.norm.get(r)};e.push(t)}else $L(r)&&r.forEach((e,n)=>{t.push({nestedArrIndex:n,value:e})})}n.$[r]=e}else if(RL(i)&&!ML(i)){let e={v:i,n:this.norm.get(i)};n.$[r]=e}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function VL(e,t,{getFn:n=qL.getFn,fieldNormWeight:r=qL.fieldNormWeight}={}){let i=new WL({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(FL)),i.setSources(t),i.create(),i}function KL(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=qL.distance,ignoreLocation:a=qL.ignoreLocation}={}){let s=t/e.length;if(a)return s;let o=Math.abs(r-n);return i?s+o/i:o?1:s}var GL=32;function ZL(e){let t={};for(let n=0,r=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e,HL=class{constructor(e,{location:t=qL.location,threshold:n=qL.threshold,distance:r=qL.distance,includeMatches:i=qL.includeMatches,findAllMatches:a=qL.findAllMatches,minMatchCharLength:s=qL.minMatchCharLength,isCaseSensitive:o=qL.isCaseSensitive,ignoreDiacritics:l=qL.ignoreDiacritics,ignoreLocation:c=qL.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c},e=o?e:e.toLowerCase(),e=l?YL(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:ZL(e),startIndex:t})},p=this.pattern.length;if(p>GL){let e=0,t=p%GL,n=p-t;for(;e{let{isMatch:m,score:g,indices:f}=function(e,t,n,{location:r=qL.location,distance:i=qL.distance,threshold:a=qL.threshold,findAllMatches:s=qL.findAllMatches,minMatchCharLength:o=qL.minMatchCharLength,includeMatches:l=qL.includeMatches,ignoreLocation:c=qL.ignoreLocation}={}){if(t.length>GL)throw new Error("Pattern length exceeds max of 32.");let u,p=t.length,d=e.length,h=Math.max(0,Math.min(r,d)),m=a,g=h,f=o>1||l,y=f?Array(d):[];for(;(u=e.indexOf(t,g))>-1;){let e=KL(t,{currentLocation:u,expectedLocation:h,distance:i,ignoreLocation:c});if(m=Math.min(e,m),g=u+p,f){let e=0;for(;e=l;a-=1){let s=a-1,o=n[e.charAt(s)];if(f&&(y[s]=+!!o),k[a]=(k[a+1]<<1|1)&o,r&&(k[a]|=(b[a+1]|b[a])<<1|1|b[a+1]),k[a]&x&&(v=KL(t,{errors:r,currentLocation:s,expectedLocation:h,distance:i,ignoreLocation:c}),v<=m)){if(m=v,g=s,g<=h)break;l=Math.max(1,2*h-g)}}if(KL(t,{errors:r+1,currentLocation:h,expectedLocation:h,distance:i,ignoreLocation:c})>m)break;b=k}let k={isMatch:g>=0,score:Math.max(.001,v)};if(f){let e=function(e=[],t=qL.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let s=e.length;a=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}(y,o);e.length?l&&(k.indices=e):k.isMatch=!1}return k}(e,t,n,{location:i+h,distance:a,threshold:s,findAllMatches:o,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});m&&(d=!0),p+=g,m&&f&&(u=[...u,...f])});let h={isMatch:d,score:d?p/this.chunks.length:1};return d&&r&&(h.indices=u),h}},XL=class{constructor(e){this.pattern=e}static isMultiMatch(e){return QL(e,this.multiRegex)}static isSingleMatch(e){return QL(e,this.singleRegex)}search(){}};function QL(e,t){let n=e.match(t);return n?n[1]:null}var JL=class extends XL{constructor(e,{location:t=qL.location,threshold:n=qL.threshold,distance:r=qL.distance,includeMatches:i=qL.includeMatches,findAllMatches:a=qL.findAllMatches,minMatchCharLength:s=qL.minMatchCharLength,isCaseSensitive:o=qL.isCaseSensitive,ignoreDiacritics:l=qL.ignoreDiacritics,ignoreLocation:c=qL.ignoreLocation}={}){super(e),this._bitapSearch=new HL(e,{location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},eI=class extends XL{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,n=0,r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);let a=!!r.length;return{isMatch:a,score:a?0:1,indices:r}}},tI=[class extends XL{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},eI,class extends XL{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends XL{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends XL{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends XL{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends XL{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},JL],nI=tI.length,rI=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,iI=new Set([JL.type,eI.type]),aI=[];function sI(e,t){for(let n=0,r=aI.length;n!(!e[oI]&&!e.$or),uI=e=>({[oI]:Object.keys(e).map(t=>({[t]:e[t]}))});function pI(e,t,{auto:n=!0}={}){let r=e=>{let i=Object.keys(e),a=(e=>!!e[lI])(e);if(!a&&i.length>1&&!cI(e))return r(uI(e));if((e=>!$L(e)&&IL(e)&&!cI(e))(e)){let r=a?e[lI]:i[0],s=a?e.$val:e[r];if(!RL(s))throw new Error((e=>`Invalid value for key ${e}`)(r));let o={keyId:BL(r),pattern:s};return n&&(o.searcher=sI(s,t)),o}let s={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];$L(n)&&n.forEach(e=>{s.children.push(r(e))})}),s};return cI(e)||(e=uI(e)),r(e)}function dI(e,t){let n=e.matches;t.matches=[],NL(n)&&n.forEach(e=>{if(!NL(e.indices)||!e.indices.length)return;let{indices:n,value:r}=e,i={indices:n,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function hI(e,t){t.score=e.score}var mI=class{constructor(e,t={},n){this.options={...qL,...t},this.options.useExtendedSearch,this._keyStore=new OL(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof WL))throw new Error("Incorrect 'index' type");this._myIndex=t||VL(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){NL(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let n=0,r=this._docs.length;n{let n=1;e.matches.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=Math.pow(0===i&&a?Number.EPSILON:i,(a||1)*(t?1:r))}),e.score=n})}(o,{ignoreFieldNorm:s}),i&&o.sort(a),LL(t)&&t>-1&&(o=o.slice(0,t)),function(e,t,{includeMatches:n=qL.includeMatches,includeScore:r=qL.includeScore}={}){let i=[];return n&&i.push(dI),r&&i.push(hI),e.map(e=>{let{idx:n}=e,r={item:t[n],refIndex:n};return i.length&&i.forEach(t=>{t(e,r)}),r})}(o,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){let t=sI(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:e,i:n,n:i})=>{if(!NL(e))return;let{isMatch:a,score:s,indices:o}=t.searchIn(e);a&&r.push({item:e,idx:n,matches:[{score:s,value:e,norm:i,indices:o}]})}),r}_searchLogical(e){let t=pI(e,this.options),n=(e,t,r)=>{if(!e.children){let{keyId:n,searcher:i}=e,a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i});return a&&a.length?[{idx:r,item:t,matches:a}]:[]}let i=[];for(let a=0,s=e.children.length;a{if(NL(e)){let s=n(t,e,r);s.length&&(i[r]||(i[r]={idx:r,item:e,matches:[]},a.push(i[r])),s.forEach(({matches:e})=>{i[r].matches.push(...e)}))}}),a}_searchObjectList(e){let t=sI(e,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach(({$:e,i:r})=>{if(!NL(e))return;let a=[];n.forEach((n,r)=>{a.push(...this._findMatches({key:n,value:e[r],searcher:t}))}),a.length&&i.push({idx:r,item:e,matches:a})}),i}_findMatches({key:e,value:t,searcher:n}){if(!NL(t))return[];let r=[];if($L(t))t.forEach(({v:t,i,n:a})=>{if(!NL(t))return;let{isMatch:s,score:o,indices:l}=n.searchIn(t);s&&r.push({score:o,key:e,value:t,idx:i,norm:a,indices:l})});else{let{v:i,n:a}=t,{isMatch:s,score:o,indices:l}=n.searchIn(i);s&&r.push({score:o,key:e,value:i,norm:a,indices:l})}return r}};mI.version="7.1.0",mI.createIndex=VL,mI.parseIndex=function(e,{getFn:t=qL.getFn,fieldNormWeight:n=qL.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new WL({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a},mI.config=qL,mI.parseQuery=pI,function(...e){aI.push(...e)}(class{constructor(e,{isCaseSensitive:t=qL.isCaseSensitive,ignoreDiacritics:n=qL.ignoreDiacritics,includeMatches:r=qL.includeMatches,minMatchCharLength:i=qL.minMatchCharLength,ignoreLocation:a=qL.ignoreLocation,findAllMatches:s=qL.findAllMatches,location:o=qL.location,threshold:l=qL.threshold,distance:c=qL.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:s,ignoreLocation:a,location:o,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=n?YL(e):e,this.pattern=e,this.query=function(e,t={}){return e.split("|").map(e=>{let n=e.trim().split(rI).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;eo(e=>"open"===e?"closed":"open"),[]),p=(0,c.useCallback)(()=>o("full"),[]),d=(0,c.useCallback)(()=>o("closed"),[]),h=(0,c.useCallback)(e=>{if(e&&n?.current){let t=e.scrollTop+(n.current.getBoundingClientRect().top-e.getBoundingClientRect().top)-e.clientHeight/2;e.scrollTo({top:t,left:0,behavior:"smooth"})}},[n]),m=l?{duration:0}:{type:"tween",duration:.25,ease:"easeOut"},g=l?{duration:0}:{type:"tween",duration:.2,ease:"easeOut"},f=l?{duration:0}:{type:"spring",stiffness:320,damping:32},y={title:e,controls:t,onMinimize:u,onMaximize:p,onClose:d};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Zy,{children:"full"===s&&(0,b.jsx)(cT.div,{className:"bg-primary-950/30 fixed inset-0 z-40 backdrop-blur-sm",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:g,"aria-hidden":!0,onClick:u},"backdrop")}),(0,b.jsx)(Zy,{children:"full"===s&&(0,b.jsxs)(cT.div,{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96},transition:f,"aria-modal":!0,role:"dialog",className:`${fI} ${No} fixed inset-x-4 inset-y-[5vh] z-50 flex flex-col sm:inset-x-6 md:inset-x-8 ${i||""}`,children:[(0,b.jsx)(yI,{...y}),(0,b.jsx)("div",{ref:h,className:"bg-primary-900 min-h-0 flex-1 overflow-auto",children:a})]},"full-card")}),"full"!==s&&(0,b.jsxs)("div",{className:`${fI} ${No} relative w-full ${i||""}`,children:[(0,b.jsx)(yI,{...y}),(0,b.jsx)(cT.div,{initial:{height:"closed"===s?0:"auto"},animate:{height:"closed"===s?0:"auto"},transition:m,className:"bg-primary-900 w-full overflow-hidden",children:(0,b.jsx)("div",{ref:h,className:`w-full overflow-auto ${r??"max-h-[80vh]"}`,children:a})})]})]})}class vI{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function _I(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new vI(n,r,t)}function xI(e){return e.toLowerCase()}vI.prototype.normal={},vI.prototype.property={},vI.prototype.space=void 0;class kI{constructor(e,t){this.attribute=t,this.property=e}}kI.prototype.attribute="",kI.prototype.booleanish=!1,kI.prototype.boolean=!1,kI.prototype.commaOrSpaceSeparated=!1,kI.prototype.commaSeparated=!1,kI.prototype.defined=!1,kI.prototype.mustUseProperty=!1,kI.prototype.number=!1,kI.prototype.overloadedBoolean=!1,kI.prototype.property="",kI.prototype.spaceSeparated=!1,kI.prototype.space=void 0;let wI=0;const CI=LI(),TI=LI(),AI=LI(),SI=LI(),EI=LI(),$I=LI(),RI=LI();function LI(){return 2**++wI}const II=Object.keys(e);class NI extends kI{constructor(t,n,r,i){let a=-1;if(super(t,n),MI(this,"space",i),"number"==typeof r)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function OI(e,t){return t in e?e[t]:t}function FI(e,t){return OI(e,t.toLowerCase())}const jI=DI({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$I,acceptCharset:EI,accessKey:EI,action:null,allow:null,allowFullScreen:CI,allowPaymentRequest:CI,allowUserMedia:CI,alt:null,as:null,async:CI,autoCapitalize:null,autoComplete:EI,autoFocus:CI,autoPlay:CI,blocking:EI,capture:null,charSet:null,checked:CI,cite:null,className:EI,cols:SI,colSpan:null,content:null,contentEditable:TI,controls:CI,controlsList:EI,coords:SI|$I,crossOrigin:null,data:null,dateTime:null,decoding:null,default:CI,defer:CI,dir:null,dirName:null,disabled:CI,download:AI,draggable:TI,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:CI,formTarget:null,headers:EI,height:SI,hidden:AI,high:SI,href:null,hrefLang:null,htmlFor:EI,httpEquiv:EI,id:null,imageSizes:null,imageSrcSet:null,inert:CI,inputMode:null,integrity:null,is:null,isMap:CI,itemId:null,itemProp:EI,itemRef:EI,itemScope:CI,itemType:EI,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:CI,low:SI,manifest:null,max:null,maxLength:SI,media:null,method:null,min:null,minLength:SI,multiple:CI,muted:CI,name:null,nonce:null,noModule:CI,noValidate:CI,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:CI,optimum:SI,pattern:null,ping:EI,placeholder:null,playsInline:CI,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:CI,referrerPolicy:null,rel:EI,required:CI,reversed:CI,rows:SI,rowSpan:SI,sandbox:EI,scope:null,scoped:CI,seamless:CI,selected:CI,shadowRootClonable:CI,shadowRootDelegatesFocus:CI,shadowRootMode:null,shape:null,size:SI,sizes:null,slot:null,span:SI,spellCheck:TI,src:null,srcDoc:null,srcLang:null,srcSet:null,start:SI,step:null,style:null,tabIndex:SI,target:null,title:null,translate:null,type:null,typeMustMatch:CI,useMap:null,value:TI,width:SI,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:EI,axis:null,background:null,bgColor:null,border:SI,borderColor:null,bottomMargin:SI,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:CI,declare:CI,event:null,face:null,frame:null,frameBorder:null,hSpace:SI,leftMargin:SI,link:null,longDesc:null,lowSrc:null,marginHeight:SI,marginWidth:SI,noResize:CI,noHref:CI,noShade:CI,noWrap:CI,object:null,profile:null,prompt:null,rev:null,rightMargin:SI,rules:null,scheme:null,scrolling:TI,standby:null,summary:null,text:null,topMargin:SI,valueType:null,version:null,vAlign:null,vLink:null,vSpace:SI,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:CI,disableRemotePlayback:CI,prefix:null,property:null,results:SI,security:null,unselectable:null},space:"html",transform:FI}),BI=DI({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:RI,accentHeight:SI,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:SI,amplitude:SI,arabicForm:null,ascent:SI,attributeName:null,attributeType:null,azimuth:SI,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:SI,by:null,calcMode:null,capHeight:SI,className:EI,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:SI,diffuseConstant:SI,direction:null,display:null,dur:null,divisor:SI,dominantBaseline:null,download:CI,dx:null,dy:null,edgeMode:null,editable:null,elevation:SI,enableBackground:null,end:null,event:null,exponent:SI,externalResourcesRequired:null,fill:null,fillOpacity:SI,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:$I,g2:$I,glyphName:$I,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:SI,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:SI,horizOriginX:SI,horizOriginY:SI,id:null,ideographic:SI,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:SI,k:SI,k1:SI,k2:SI,k3:SI,k4:SI,kernelMatrix:RI,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:SI,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:SI,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:SI,overlineThickness:SI,paintOrder:null,panose1:null,path:null,pathLength:SI,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:EI,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:SI,pointsAtY:SI,pointsAtZ:SI,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:RI,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:RI,rev:RI,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:RI,requiredFeatures:RI,requiredFonts:RI,requiredFormats:RI,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:SI,specularExponent:SI,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:SI,strikethroughThickness:SI,string:null,stroke:null,strokeDashArray:RI,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:SI,strokeOpacity:SI,strokeWidth:null,style:null,surfaceScale:SI,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:RI,tabIndex:SI,tableValues:null,target:null,targetX:SI,targetY:SI,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:RI,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:SI,underlineThickness:SI,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:SI,values:null,vAlphabetic:SI,vMathematical:SI,vectorEffect:null,vHanging:SI,vIdeographic:SI,version:null,vertAdvY:SI,vertOriginX:SI,vertOriginY:SI,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:SI,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:OI}),zI=DI({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()}),qI=DI({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:FI}),UI=DI({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),WI=_I([PI,jI,zI,qI,UI],"html"),VI=_I([PI,BI,zI,qI,UI],"svg");function KI(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){-1===r&&(r=n.length,a=!0);const e=n.slice(i,r).trim();!e&&a||t.push(e),i=r+1,r=n.indexOf(",",i)}return t}const GI=/[#.]/g,ZI=/[A-Z]/g,YI=/-[a-z]/g,HI=/^data[-\w.:]+$/i;function XI(e,t){const n=xI(t);let r=t,i=kI;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&HI.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(YI,JI);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!YI.test(e)){let n=e.replace(ZI,QI);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=NI}return new i(r,t)}function QI(e){return"-"+e.toLowerCase()}function JI(e){return e.charAt(1).toUpperCase()}function eN(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function tN(e,t,n){const r=n?function(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}(n):void 0;return function(n,i,...a){let s;if(null==n){s={type:"root",children:[]};const e=i;a.unshift(e)}else{s=function(e,t){const n=e||"",r={};let i,a,s=0;for(;s":"")+")"})}return u;function u(){let c,u,p,d=IN;if((!t||a(i,o,l[l.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[true,e]:null==e?IN:[e]}(n(i,l)),d[0]===NN))return d;if("children"in i&&i.children){const t=i;if(t.children&&d[0]!==MN)for(u=(r?t.children.length:-1)+s,p=l.concat(t);u>-1&&ul&&(l=e):e&&(void 0!==l&&l>-1&&o.push("\n".repeat(l)||" "),l=-1,o.push(e))}return o.join("")}(u);let d;try{d=LN.default.renderToString(p,{...t,displayMode:l,throwOnError:!0})}catch(i){const a=i,s=a.name.toLowerCase();n.message("Could not render math with KaTeX",{ancestors:[...r,e],cause:a,place:e.position,ruleId:s,source:"rehype-katex"});try{d=LN.default.renderToString(p,{...t,displayMode:l,strict:"ignore",throwOnError:!1})}catch{d=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(i)},children:[{type:"text",value:p}]}]}}"string"==typeof d&&(d=function(e,t){return lN(t?.fragment?function(e){const t=document.createElement("template");return t.innerHTML=e,t.content}(e):pN.parseFromString(e,"text/html"),{})||{type:"root",children:[]}}(d,{fragment:!0}).children);const h=c.children.indexOf(u);return c.children.splice(h,1,...d),MN})}}function jN(){}function BN(){}const zN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UN={};function WN(e,t){return((t||UN).jsx?qN:zN).test(e)}const VN=/[ \t\n\f\r]/g;function KN(e){return""===e.replace(VN,"")}const GN={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 ZN=n(75333);const YN=XN("end"),HN=XN("start");function XN(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 QN(e){return e&&"object"==typeof e?"position"in e||"type"in e?eM(e.position):"start"in e||"end"in e?eM(e):"line"in e||"column"in e?JN(e):"":""}function JN(e){return tM(e&&e.line)+":"+tM(e&&e.column)}function eM(e){return JN(e&&e.start)+"-"+JN(e&&e.end)}function tM(e){return e&&"number"==typeof e?e:1}class nM extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=QN(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nM.prototype.file="",nM.prototype.name="",nM.prototype.reason="",nM.prototype.message="",nM.prototype.stack="",nM.prototype.column=void 0,nM.prototype.line=void 0,nM.prototype.ancestors=void 0,nM.prototype.cause=void 0,nM.prototype.fatal=void 0,nM.prototype.place=void 0,nM.prototype.ruleId=void 0,nM.prototype.source=void 0;const rM={}.hasOwnProperty,iM=new Map,aM=/[A-Z]/g,sM=new Set(["table","tbody","thead","tfoot","tr"]),oM=new Set(["td","th"]),lM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cM(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=VI,e.schema=i),e.ancestors.push(t);const a=mM(e,t.tagName,!1),s=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&rM.call(t.properties,i)){const a=hM(e,i,t.properties[i]);if(a){const[i,s]=a;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof s&&oM.has(t.tagName)?r=s:n[i]=s}}return r&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),n}(e,t);let o=dM(e,t);return sM.has(t.tagName)&&(o=o.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&KN(t.value):KN(t));var t})),uM(e,s,a,t),pM(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,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)}gM(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=VI,e.schema=i),e.ancestors.push(t);const a=null===t.name?e.Fragment:mM(e,t.name,!0),s=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];jN(t.type);const i=t.expression;jN(i.type);const a=i.properties[0];jN(a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else gM(e,t.position);else{const i=r.name;let a;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];jN(t.type),a=e.evaluater.evaluateExpression(t.expression)}else gM(e,t.position);else a=null===r.value||r.value;n[i]=a}return n}(e,t),o=dM(e,t);return uM(e,s,a,t),pM(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,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);gM(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return pM(r,dM(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function uM(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function pM(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dM(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:iM;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s0?(wM(e,e.length,0,t),e):t}class TM{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 ethis.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 r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&AM(this.left,n),i.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),AM(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),AM(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-1&&e.test(String.fromCharCode(t))}}function KM(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return function(r){return qM(r)?(e.enter(n),s(r)):t(r)};function s(r){return qM(r)&&a++a))return;const n=t.events.length;let i,o,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){o=t.events[l][1].end;break}i=!0}for(y(s),e=n;er;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function b(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},YM={tokenize:function(e,t,n){return KM(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},HM={partial:!0,tokenize:function(e,t,n){return function(t){return qM(t)?KM(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||BM(e)?t(e):n(e)}}},XM={resolve:function(e){return SM(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):BM(t)?e.check(QM,a,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},QM={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),KM(e,i,"linePrefix")};function i(i){if(null===i||BM(i))return n(i);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},JM={tokenize:function(e){const t=this,n=e.attempt(HM,function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)},e.attempt(this.parser.constructs.flowInitial,r,KM(e,e.attempt(this.parser.constructs.flow,r,e.attempt(XM,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},eD={resolveAll:iD()},tD=rD("string"),nD=rD("text");function rD(e){return{resolveAll:iD("text"===e?aD:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,a,s);return a;function a(e){return l(e)?i(e):s(e)}function s(e){if(null!==e)return t.enter("data"),t.consume(e),o;t.consume(e)}function o(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),o)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i=3&&(null===a||BM(a))?(e.exit("thematicBreak"),t(a)):n(a)}function s(t){return t===r?(e.consume(t),i++,s):(e.exit("thematicBreakSequence"),qM(t)?KM(e,a,"whitespace")(t):a(t))}}},oD={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(HM,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,KM(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!qM(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cD,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,KM(e,e.attempt(oD,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,s=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:OM(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(sD,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(t)}return n(t)};function o(t){return OM(t)&&++s<10?(e.consume(t),o):(!r.interrupt||s<2)&&(r.containerState.marker?t===r.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"),r.containerState.marker=r.containerState.marker||t,e.check(HM,r.interrupt?n:c,e.attempt(lD,p,u))}function c(e){return r.containerState.initialBlankLine=!0,a++,p(e)}function u(t){return qM(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),p):n(t)}function p(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},lD={partial:!0,tokenize:function(e,t,n){const r=this;return KM(e,function(e){const i=r.events[r.events.length-1];return!qM(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},cD={partial:!0,tokenize:function(e,t,n){const r=this;return KM(e,function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},uD={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return qM(t)?KM(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(uD,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return qM(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function pD(e,t,n,r,i,a,s,o,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),p):null===t||32===t||41===t||PM(t)?n(t):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),m(t))};function p(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(o),p(t)):null===t||60===t||BM(t)?n(t):(e.consume(t),92===t?h:d)}function h(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function m(i){return u||null!==i&&41!==i&&!zM(i)?u999||null===p||91===p||93===p&&!o||94===p&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):93===p?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):BM(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(t){return null===t||91===t||93===t||BM(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),o||(o=!qM(t)),92===t?p:u)}function p(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function hD(e,t,n,r,i,a){let s;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),s=40===t?41:t,o):n(t)};function o(n){return n===s?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===s?(e.exit(a),o(s)):null===t?n(t):BM(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),KM(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===s||null===t||BM(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 mD(e,t){let n;return function r(i){return BM(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):qM(i)?KM(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function gD(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const fD={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return dD.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function a(t){return i=gD(r.sliceSerialize(r.events[r.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 zM(t)?mD(e,o)(t):o(t)}function o(t){return pD(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(yD,c,c)(t)}function c(t){return qM(t)?KM(e,u,"whitespace")(t):u(t)}function u(a){return null===a||BM(a)?(e.exit("definition"),r.parser.defined.push(i),t(a)):n(a)}}},yD={partial:!0,tokenize:function(e,t,n){return function(t){return zM(t)?mD(e,r)(t):n(t)};function r(t){return hD(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return qM(t)?KM(e,a,"whitespace")(t):a(t)}function a(e){return null===e||BM(e)?t(e):n(e)}}},bD={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),KM(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?a(e):n(e)}function a(t){return null===t?o(t):BM(t)?e.attempt(vD,a,o)(t):(e.enter("codeFlowValue"),s(t))}function s(t){return null===t||BM(t)?(e.exit("codeFlowValue"),a(t)):(e.consume(t),s)}function o(n){return e.exit("codeIndented"),t(n)}}},vD={partial:!0,tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):BM(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):KM(e,a,"linePrefix",5)(t)}function a(e){const a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):BM(e)?i(e):n(e)}}},_D={name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;return"whitespace"===e[a][1].type&&(a+=2),i-2>a&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4),i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},wM(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||zM(t)?(e.exit("atxHeadingSequence"),a(t)):n(t)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),s(n)):null===n||BM(n)?(e.exit("atxHeading"),t(n)):qM(n)?KM(e,a,"whitespace")(n):(e.enter("atxHeadingText"),o(n))}function s(t){return 35===t?(e.consume(t),s):(e.exit("atxHeadingSequence"),a(t))}function o(t){return null===t||35===t||zM(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),o)}}},xD={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);const s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=s,e.push(["exit",s,t]),e},tokenize:function(e,t,n){const r=this;let i;return function(t){let s,o=r.events.length;for(;o--;)if("lineEnding"!==r.events[o][1].type&&"linePrefix"!==r.events[o][1].type&&"content"!==r.events[o][1].type){s="paragraph"===r.events[o][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!s?n(t):(e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),a(t)}(t))};function a(t){return t===i?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),qM(t)?KM(e,s,"lineSuffix")(t):s(t))}function s(r){return null===r||BM(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}},kD=["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"],wD=["pre","script","style","textarea"],CD={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 r=this;let i,a,s,o,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(o){return 33===o?(e.consume(o),u):47===o?(e.consume(o),a=!0,h):63===o?(e.consume(o),i=3,r.interrupt?t:M):NM(o)?(e.consume(o),s=String.fromCharCode(o),m):n(o)}function u(a){return 45===a?(e.consume(a),i=2,p):91===a?(e.consume(a),i=5,o=0,d):NM(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return 45===i?(e.consume(i),r.interrupt?t:M):n(i)}function d(i){return i==="CDATA[".charCodeAt(o++)?(e.consume(i),6===o?r.interrupt?t:A:d):n(i)}function h(t){return NM(t)?(e.consume(t),s=String.fromCharCode(t),m):n(t)}function m(o){if(null===o||47===o||62===o||zM(o)){const l=47===o,c=s.toLowerCase();return l||a||!wD.includes(c)?kD.includes(s.toLowerCase())?(i=6,l?(e.consume(o),g):r.interrupt?t(o):A(o)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(o):a?f(o):y(o)):(i=1,r.interrupt?t(o):A(o))}return 45===o||MM(o)?(e.consume(o),s+=String.fromCharCode(o),m):n(o)}function g(i){return 62===i?(e.consume(i),r.interrupt?t:A):n(i)}function f(t){return qM(t)?(e.consume(t),f):C(t)}function y(t){return 47===t?(e.consume(t),C):58===t||95===t||NM(t)?(e.consume(t),b):qM(t)?(e.consume(t),y):C(t)}function b(t){return 45===t||46===t||58===t||95===t||MM(t)?(e.consume(t),b):v(t)}function v(t){return 61===t?(e.consume(t),_):qM(t)?(e.consume(t),v):y(t)}function _(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):qM(t)?(e.consume(t),_):k(t)}function x(t){return t===l?(e.consume(t),l=null,w):null===t||BM(t)?n(t):(e.consume(t),x)}function k(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||zM(t)?v(t):(e.consume(t),k)}function w(e){return 47===e||62===e||qM(e)?y(e):n(e)}function C(t){return 62===t?(e.consume(t),T):n(t)}function T(t){return null===t||BM(t)?A(t):qM(t)?(e.consume(t),T):n(t)}function A(t){return 45===t&&2===i?(e.consume(t),R):60===t&&1===i?(e.consume(t),L):62===t&&4===i?(e.consume(t),D):63===t&&3===i?(e.consume(t),M):93===t&&5===i?(e.consume(t),N):!BM(t)||6!==i&&7!==i?null===t||BM(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),A):(e.exit("htmlFlowData"),e.check(TD,P,S)(t))}function S(t){return e.check(AD,E,P)(t)}function E(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),$}function $(t){return null===t||BM(t)?S(t):(e.enter("htmlFlowData"),A(t))}function R(t){return 45===t?(e.consume(t),M):A(t)}function L(t){return 47===t?(e.consume(t),s="",I):A(t)}function I(t){if(62===t){const n=s.toLowerCase();return wD.includes(n)?(e.consume(t),D):A(t)}return NM(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),I):A(t)}function N(t){return 93===t?(e.consume(t),M):A(t)}function M(t){return 62===t?(e.consume(t),D):45===t&&2===i?(e.consume(t),M):A(t)}function D(t){return null===t||BM(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),D)}function P(n){return e.exit("htmlFlow"),t(n)}}},TD={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(HM,t,n)}}},AD={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return BM(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},SD={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},ED={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),qM(t)?KM(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===a?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===a?(i++,e.consume(t),c):i>=o?(e.exit("codeFencedFenceSequence"),qM(t)?KM(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||BM(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let a,s=0,o=0;return function(t){return function(t){const n=r.events[r.events.length-1];return s=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,a=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===a?(o++,e.consume(t),l):o<3?n(t):(e.exit("codeFencedFenceSequence"),qM(t)?KM(e,c,"whitespace")(t):c(t))}function c(n){return null===n||BM(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(SD,h,b)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||BM(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):qM(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),KM(e,p,"whitespace")(t)):96===t&&t===a?n(t):(e.consume(t),u)}function p(t){return null===t||BM(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||BM(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===a?n(t):(e.consume(t),d)}function h(t){return e.attempt(i,b,m)(t)}function m(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),g}function g(t){return s>0&&qM(t)?KM(e,f,"linePrefix",s+1)(t):f(t)}function f(t){return null===t||BM(t)?e.check(SD,h,b)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||BM(t)?(e.exit("codeFlowValue"),f(t)):(e.consume(t),y)}function b(n){return e.exit("codeFenced"),t(n)}}},$D=document.createElement("i");function RD(e){const t="&"+e+";";$D.innerHTML=t;const n=$D.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const LD={name:"characterReference",tokenize:function(e,t,n){const r=this;let i,a,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,a=MM,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=FM,c):(e.enter("characterReferenceValue"),i=7,a=OM,c(t))}function c(o){if(59===o&&s){const i=e.exit("characterReferenceValue");return a!==MM||RD(r.sliceSerialize(i))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return a(o)&&s++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const p={...e[n][1].end},d={...e[u][1].start};qD(p,-o),qD(d,o),a={type:o>1?"strongSequence":"emphasisSequence",start:p,end:{...e[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:d},i={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:o>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[n][1].end={...a.start},e[u][1].start={...s.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=CM(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=CM(l,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),l=CM(l,MD(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=CM(l,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=CM(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,wM(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u-1){const e=s[0];"string"==typeof e?s[0]=e.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}(s,e)}function m(){const{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function g(e){l=void 0,p=e,d=d(e)}function f(e,t){t.restore()}function y(e,t){return function(n,i,a){let s,p,d,h;return Array.isArray(n)?g(n):"tokenize"in n?g([n]):function(e){return function(t){const n=null!==t&&e[t],r=null!==t&&e.null;return g([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function g(e){return s=e,p=0,0===e.length?a:f(e[p])}function f(e){return function(n){return h=function(){const e=m(),t=u.previous,n=u.currentConstruct,i=u.events.length,a=Array.from(o);return{from:i,restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=i,o=a,v()}}}(),d=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?b():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,y,b)(n)}}function y(t){return l=!0,e(d,h),i}function b(e){return l=!0,h.restore(),++p13&&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 sP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function oP(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return aP(n.slice(t?2:1),t?16:10)}return RD(n)||e}const lP={}.hasOwnProperty;function cP(e,n,r){return n&&"object"==typeof n&&(r=n,n=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(b),autolinkProtocol:u,autolinkEmail:u,atxHeading:i(g),blockQuote:i(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:i(m),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(m,a),codeText:i(function(){return{type:"inlineCode",value:""}},a),codeTextData:u,data:u,codeFlowValue:u,definition:i(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:i(f),hardBreakTrailing:i(f),htmlFlow:i(y,a),htmlFlowData:u,htmlText:i(y,a),htmlTextData:u,image:i(function(){return{type:"image",title:null,url:"",alt:null}}),label:a,link:i(b),listItem:i(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:i(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:i(v),paragraph:i(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(g),strong:i(function(){return{type:"strong",children:[]}}),thematicBreak:i(function(){return{type:"thematicBreak"}})},exit:{atxHeading:o(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:o(),autolinkEmail:function(e){p.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){p.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:o(),characterEscapeValue:p,characterReferenceMarkerHexadecimal:h,characterReferenceMarkerNumeric:h,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=aP(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=RD(t);this.stack[this.stack.length-1].value+=r},characterReference:function(e){this.stack.pop().position.end=uP(e.end)},codeFenced:o(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:p,codeIndented:o(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:o(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:p,data:p,definition:o(),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=gD(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:o(),hardBreakEscape:o(d),hardBreakTrailing:o(d),htmlFlow:o(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:p,htmlText:o(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:p,image:o(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(sP,oP)}(t),n.identifier=gD(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=uP(e.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),p.call(this,e))},link:o(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:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=gD(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:o(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:o(),thematicBreak:o()}};pP(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let i={type:"root",children:[]};const o={stack:[i],tokenStack:[],config:t,enter:s,exit:l,buffer:a,resume:c,data:n},u=[];let p=-1;for(;++p0){const e=o.tokenStack[o.tokenStack.length-1];(e[1]||hP).call(o,void 0,e[0])}for(i.position={start:uP(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:uP(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new gP[e](t)},yP=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case 0:case-1:return n(s,i);case 1:{const e=n([],i);for(const t of s)e.push(r(t));return e}case 2:{const e=n({},i);for(const[t,n]of s)e[r(t)]=r(n);return e}case 3:return n(new Date(s),i);case 4:{const{source:e,flags:t}=s;return n(new RegExp(e,t),i)}case 5:{const e=n(new Map,i);for(const[t,n]of s)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,i);for(const t of s)e.add(r(t));return e}case 7:{const{name:e,message:t}=s;return n(fP(e,t),i)}case 8:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);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(fP(a,s),i)};return r})(new Map,e)(0),bP="",{toString:vP}={},{keys:_P}=Object,xP=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=vP.call(e).slice(8,-1);switch(n){case"Array":return[1,bP];case"Object":return[2,bP];case"Date":return[3,bP];case"RegExp":return[4,bP];case"Map":return[5,bP];case"Set":return[6,bP];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},kP=([e,t])=>0===e&&("function"===t||"symbol"===t),wP=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const i=(e,t)=>{const i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[s,o]=xP(r);switch(s){case 0:{let t=r;switch(o){case"bigint":s=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);t=null;break;case"undefined":return i([-1],r)}return i([s,t],r)}case 1:{if(o){let e=r;return"DataView"===o?e=new Uint8Array(r.buffer):"ArrayBuffer"===o&&(e=new Uint8Array(r)),i([o,[...e]],r)}const e=[],t=i([s,e],r);for(const t of r)e.push(a(t));return t}case 2:{if(o)switch(o){case"BigInt":return i([o,r.toString()],r);case"Boolean":case"Number":case"String":return i([o,r.valueOf()],r)}if(t&&"toJSON"in r)return a(r.toJSON());const n=[],l=i([s,n],r);for(const t of _P(r))!e&&kP(xP(r[t]))||n.push([a(t),a(r[t])]);return l}case 3:return i([s,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return i([s,{source:e,flags:t}],r)}case 5:{const t=[],n=i([s,t],r);for(const[n,i]of r)(e||!kP(xP(n))&&!kP(xP(i)))&&t.push([a(n),a(i)]);return n}case 6:{const t=[],n=i([s,t],r);for(const n of r)!e&&kP(xP(n))||t.push(a(n));return n}}const{message:l}=r;return i([s,{name:o,message:l}],r)};return a})(!(t||n),!!t,new Map,r)(e),r},CP="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?yP(wP(e,t)):structuredClone(e):(e,t)=>yP(wP(e,t));function TP(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(s=String.fromCharCode(a,t),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function AP(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 SP(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function EP(e,t,n,r){let i,a,s;"function"==typeof t&&"function"!=typeof n?(a=void 0,s=t,i=n):(a=t,s=n,i=r),DN(e,a,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return s(e,r,n)},i)}function $P(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&"text"===a.type?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&"text"===s.type?s.value+=r:i.push({type:"text",value:r}),i}function RP(e){return e.spread??e.children.length>1}function LP(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(IP(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(IP(t.slice(i),i>0,!1)),a.join("")}function IP(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}const NP={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":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a},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-",r=String(t.identifier).toUpperCase(),i=TP(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);void 0===o?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),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(),r=e.definitionById.get(n);if(!r)return $P(e,t);const i={src:TP(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){const n={src:TP(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $P(e,t);const i={href:TP(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){const n={href:TP(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=HN(t.children[1]),s=YN(t.children[t.children.length-1]);a&&s&&(r.position={start:a,end:s}),i.push(r)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},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 r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,s=a?a.length:t.children.length;let o=-1;const l=[];for(;++o0&&n.push({type:"text",value:"\n"}),n}function zP(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function qP(e,t){const n=function(e,t){const n=t||PP,r=new Map,i=new Map,a=new Map,s={...NP,...n.handlers},o={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r0&&p.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const h=a[a.length-1];if(h&&"element"===h.type&&"p"===h.tagName){const e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...p)}else a.push(...p);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(i,m),o.push(m)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...CP(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:"\n"},i),a}function UP(e,t){return e&&"run"in e?async function(n,r){const i=qP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return qP(n,{file:r,...e||t})}}function WP(e){if(e)throw e}var VP=n(60710);function KP(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 GP=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');QP(e);let n,r=0,i=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let s=-1,o=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else s<0&&(n=!0,s=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(i=a):(o=-1,i=s));return r===i?i=s:i<0&&(i=e.length),e.slice(r,i)},ZP=function(e){if(QP(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},YP=function(e){QP(e);let t,n=e.length,r=-1,i=0,a=-1,s=0;for(;n--;){const o=e.codePointAt(n);if(47!==o)r<0&&(t=!0,r=n+1),46===o?a<0?a=n:1!==s&&(s=1):a>-1&&(s=-1);else if(t){i=n+1;break}}return a<0||r<0||0===s||1===s&&a===r-1&&a===i+1?"":e.slice(a,r)},HP=function(...e){let t,n=-1;for(;++n2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",a=0):(i=i.slice(0,r),a=i.length-1-i.lastIndexOf("/")),s=l,o=0;continue}}else if(i.length>0){i="",a=0,s=l,o=0;continue}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(s+1,l):i=e.slice(s+1,l),a=l-s-1;s=l,o=0}else 46===n&&o>-1?o++:o=-1}return i}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},XP="/";function QP(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const JP=function(){return"/"};function eO(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}const tO=["history","path","basename","stem","extname","dirname"];class nO{constructor(e){let t;t=e?eO(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?"":JP(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++rt.length;let s;a&&t.push(r);try{s=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(s&&s.then&&"function"==typeof s.then?s.then(i,r):s instanceof Error?r(s):i(s))};function r(e,...r){n||(n=!0,t(e,...r))}function i(e){r(null,e)}}(o,i)(...s):r(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 lO;let t=-1;for(;++t0){let[r,...a]=t;const s=n[i][1];KP(s)&&KP(r)&&(r=VP(!0,s,r)),n[i]=[e,r,...a]}}}}const cO=(new lO).freeze();function uO(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function pO(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function dO(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 hO(e){if(!KP(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function mO(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gO(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new nO(e)}const fO=[],yO={allowDangerousHtml:!0},bO=/^(https?|ircs?|mailto|xmpp)$/i,vO=[{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 _O(e){const t=function(e){const t=e.rehypePlugins||fO,n=e.remarkPlugins||fO,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yO}:yO;return cO().use(mP).use(n).use(UP,r).use(t)}(e),n=function(e){const t=e.children||"",n=new nO;return"string"==typeof t&&(n.value=t),n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||xO;for(const e of vO)Object.hasOwn(t,e.from)&&BN((e.from,e.to&&e.to,e.id));return EP(e,function(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return s?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in bM)if(Object.hasOwn(bM,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=bM[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let s=n?!n.includes(e.tagName):!!a&&a.includes(e.tagName);if(!s&&r&&"number"==typeof t&&(s=!r(e,t,i)),s&&i&&"number"==typeof t)return o&&e.children?i.children.splice(t,1,...e.children):i.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 r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return function(n,r,i,a){const s=Array.isArray(i.children),o=HN(n);return t(r,i,a,s,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.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");i=t.jsx,a=t.jsxs,r=function(e,t,n,r){const s=Array.isArray(n.children)?a:i;return r?s(t,n,r):s(t,n)}}var i,a;const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?VI:WI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},o=cM(s,e,void 0);return o&&"string"!=typeof o?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}(e,{Fragment:b.Fragment,components:i,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(n),n),e)}function xO(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return-1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||bO.test(e.slice(0,t))?e:""}function kO(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function wO(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 CO(e){return"function"==typeof e?e:function(){return e}}const TO="phrasing",AO=["autolink","link","image","label"];function SO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function EO(e){this.config.enter.autolinkProtocol.call(this,e)}function $O(e){this.config.exit.autolinkProtocol.call(this,e)}function RO(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 LO(e){this.config.exit.autolinkEmail.call(this,e)}function IO(e){this.exit(e)}function NO(e){!function(e,t,n){const r=dN((n||{}).ignore||[]),i=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 r=-1;for(;++r0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(o!==n&&u.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),o=n+p[0].length,c=!0),!r.global)break;p=r.exec(e.value)}return c?(o?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=kO(e,"(");let a=kO(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}(n+r);if(!s[0])return!1;const o={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function DO(e,t,n,r){return!(!PO(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function PO(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||WM(n)||UM(n))&&(!t||47!==n)}function OO(){this.buffer()}function FO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jO(){this.buffer()}function BO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gD(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qO(e){this.exit(e)}function UO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gD(this.sliceSerialize(e)).toLowerCase(),n.label=t}function WO(e){this.exit(e)}function VO(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function KO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,i){const a=r.createTracker(i);let s=a.move("[^");const o=r.enter("footnoteDefinition"),l=r.enter("label");return s+=a.move(r.safe(r.associationId(e),{before:s,after:"]"})),l(),s+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),s+=a.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,a.current()),t?ZO:GO))),o(),s},footnoteReference:VO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function GO(e,t,n){return 0===t?e:ZO(e,0,n)}function ZO(e,t,n){return(n?"":" ")+e}VO.peek=function(){return"["};const YO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function HO(e){this.enter({type:"delete",children:[]},e)}function XO(e){this.exit(e)}function QO(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function JO(e){return e.length}function eF(e){return null==e?"":String(e)}function tF(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 nF(e,t,n){return">"+(n?"":" ")+e}function rF(e,t){return iF(e,t.inConstruct,!0)&&!iF(e,t.notInConstruct,!1)}function iF(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++rs&&(s=a):a=1,i=r+t.length,r=n.indexOf(t,i);return s}function oF(e,t,n){return(n?"":" ")+e}function lF(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 cF(e){return""+e.toString(16).toUpperCase()+";"}function uF(e,t,n){const r=BD(e),i=BD(t);return void 0===r?void 0===i?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function pF(e,t,n,r){const i=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),a=n.enter("emphasis"),s=n.createTracker(r),o=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const c=l.charCodeAt(0),u=uF(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=cF(c)+l.slice(1));const p=l.charCodeAt(l.length-1),d=uF(r.after.charCodeAt(0),p,i);d.inside&&(l=l.slice(0,-1)+cF(p));const h=s.move(i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},o+l+h}function dF(e){return e.value||""}function hF(e,t,n,r){const i=lF(n),a='"'===i?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),c+=l.move(")"),s(),c}function mF(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const c=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const p=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=u,a(),"full"!==i&&c&&c===p?"shortcut"===i?l=l.slice(0,-1):l+=o.move("]"):l+=o.move(p+"]"),l}function gF(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}function yF(e,t,n,r){const i=lF(n),a='"'===i?"Quote":"Apostrophe",s=n.createTracker(r);let o,l;if(fF(e,n)){const t=n.stack;n.stack=[],o=n.enter("autolink");let r=s.move("<");return r+=s.move(n.containerPhrasing(e,{before:r,after:">",...s.current()})),r+=s.move(">"),o(),n.stack=t,r}o=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${a}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),o(),c}function bF(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const p=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=u,a(),"full"!==i&&c&&c===p?"shortcut"===i?l=l.slice(0,-1):l+=o.move("]"):l+=o.move(p+"]"),l}function vF(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 _F(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}QO.peek=function(){return"~"},pF.peek=function(e,t,n){return n.options.emphasis||"*"},dF.peek=function(){return"<"},hF.peek=function(){return"!"},mF.peek=function(){return"!"},gF.peek=function(){return"`"},yF.peek=function(e,t,n){return fF(e,n)?"<":"["},bF.peek=function(){return"["};const xF=dN(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function kF(e,t,n,r){const i=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),a=n.enter("strong"),s=n.createTracker(r),o=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const c=l.charCodeAt(0),u=uF(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=cF(c)+l.slice(1));const p=l.charCodeAt(l.length-1),d=uF(r.after.charCodeAt(0),p,i);d.inside&&(l=l.slice(0,-1)+cF(p));const h=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},o+l+h}kF.peek=function(e,t,n){return n.options.strong||"*"};const wF={blockquote:function(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(e,a.current()),nF);return i(),s},break:aF,code:function(e,t,n,r){const i=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),a=e.value||"",s="`"===i?"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(a,oF);return e(),t}const o=n.createTracker(r),l=i.repeat(Math.max(sF(a,i)+1,3)),c=n.enter("codeFenced");let u=o.move(l);if(e.lang){const t=n.enter(`codeFencedLang${s}`);u+=o.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...o.current()})),t()}return u+=o.move("\n"),a&&(u+=o.move(a+"\n")),u+=o.move(l),c(),u},definition:function(e,t,n,r){const i=lF(n),a='"'===i?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),o(),e.title&&(o=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),s(),c},emphasis:pF,hardBreak:aF,heading:function(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(function(e,t){let n=!1;return EP(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,NN}),Boolean((!e.depth||e.depth<3)&&_M(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),s=n.containerPhrasing(e,{...a.current(),before:"\n",after:"\n"});return r(),t(),s+"\n"+(1===i?"=":"-").repeat(s.length-(Math.max(s.lastIndexOf("\r"),s.lastIndexOf("\n"))+1))}const s="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");a.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...a.current()});return/^[\t ]/.test(c)&&(c=cF(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),o(),c},html:dF,image:hF,imageReference:mF,inlineCode:gF,link:yF,linkReference:bF,list:function(e,t,n,r){const i=n.enter("list"),a=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):vF(n);const o=e.ordered?"."===s?")":".":function(e){const t=vF(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),_F(n)===s&&t){let t=-1;for(;++t-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let s=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));const o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?a:a+" ".repeat(s-a.length))+e});return l(),c},paragraph:function(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),i(),s},root:function(e,t,n,r){return(e.children.some(function(e){return xF(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:kF,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(_F(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?r.slice(0,-1):r}};function CF(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 TF(e){this.exit(e),this.data.inTable=void 0}function AF(e){this.enter({type:"tableRow",children:[]},e)}function SF(e){this.exit(e)}function EF(e){this.enter({type:"tableCell",children:[]},e)}function $F(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RF(e,t){return"|"===t?t:e}function LF(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=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 r=wF.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){const r=e.children;let i=-1;const a=[],s=t.enter("table");for(;++ic&&(c=e[u].length);++al[a])&&(l[a]=e)}t.push(s)}s[u]=t,o[u]=r}let p=-1;if("object"==typeof r&&"length"in r)for(;++pl[p]&&(l[p]=i),h[p]=i),d[p]=s}s.splice(1,0,d),o.splice(1,0,h),u=-1;const m=[];for(;++u0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}UF[43]=qF,UF[45]=qF,UF[46]=qF,UF[95]=qF,UF[72]=[qF,zF],UF[104]=[qF,zF],UF[87]=[qF,BF],UF[119]=[qF,BF];const HF={tokenize:function(e,t,n){const r=this;return KM(e,function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function XF(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const e=r.events[i][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(i){if(!s||!s._balanced)return n(i);const o=gD(r.sliceSerialize({start:s.end,end:r.now()}));return 94===o.codePointAt(0)&&a.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)):n(i)}}function QF(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",a,t],["exit",a,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...l),e}function JF(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(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(o){if(s>999||93===o&&!a||null===o||91===o||zM(o))return n(o);if(93===o){e.exit("chunkString");const a=e.exit("gfmFootnoteCallString");return i.includes(gD(r.sliceSerialize(a)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return zM(o)||(a=!0),s++,e.consume(o),92===o?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function ej(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s,o=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(o>999||93===t&&!s||null===t||91===t||zM(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return a=gD(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return zM(t)||(s=!0),o++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),o++,c):c(t)}function p(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(a)||i.push(a),KM(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function tj(e,t,n){return e.check(HM,t,e.attempt(HF,t,n))}function nj(e){e.exit("gfmFootnoteDefinition")}function rj(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,a=this.events;let s=0;return function(t){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(t):(e.enter("strikethroughSequenceTemporary"),o(t))};function o(a){const l=BD(i);if(126===a)return s>1?r(a):(e.consume(a),s++,o);if(s<2&&!t)return r(a);const c=e.exit("strikethroughSequenceTemporary"),u=BD(a);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(a)}},resolveAll:function(e,t){let n=-1;for(;++n0;)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 r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function aj(e,t){let n=!1;const r=[];for(;t-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,a="tableHead"===i||"tableRow"===i?_:o;return a===_&&r.parser.lazy[r.now().line]?n(e):a(e)};function o(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(i=!0,s+=1),l(e)}(t)}function l(t){return null===t?n(t):BM(t)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p):n(t):qM(t)?KM(e,l,"whitespace")(t):(s+=1,i&&(i=!1,a+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||zM(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 p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,qM(t)?KM(e,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):d(t))}function d(t){return 45===t||58===t?m(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return qM(t)?KM(e,m,"whitespace")(t):m(t)}function m(t){return 58===t?(s+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(s+=1,g(t)):null===t||BM(t)?b(t):v(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),f(t)):v(t)}function f(t){return 45===t?(e.consume(t),f):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return qM(t)?KM(e,b,"whitespace")(t):b(t)}function b(n){return 124===n?d(n):(null===n||BM(n))&&i&&a===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function _(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||BM(n)?(e.exit("tableRow"),t(n)):qM(n)?KM(e,x,"whitespace")(n):(e.enter("data"),k(n))}function k(t){return null===t||124===t||zM(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?w:k)}function w(t){return 92===t||124===t?(e.consume(t),k):k(t)}}function oj(e,t){let n,r,i,a=-1,s=!0,o=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,p=0;const d=new ij;for(;++an[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==i&&(a.end=Object.assign({},uj(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function cj(e,t,n,r,i){const a=[],s=uj(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function uj(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const pj={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return zM(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return BM(r)?t(r):qM(r)?e.check({tokenize:dj},t,n)(r):n(r)}}};function dj(e,t,n){return KM(e,function(e){return null===e?n(e):t(e)},"whitespace")}const hj={};function mj(e){const t=e||hj,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),a=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return RM([{text:UF},{document:{91:{name:"gfmFootnoteDefinition",tokenize:ej,continuation:{tokenize:tj},exit:nj}},text:{91:{name:"gfmFootnoteCall",tokenize:JF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:XF,resolveTo:QF}}},rj(e),{flow:{null:{name:"table",tokenize:sj,resolveAll:oj}}},{text:{91:pj}}])}(t)),i.push([{transforms:[NO],enter:{literalAutolink:SO,literalAutolinkEmail:EO,literalAutolinkHttp:EO,literalAutolinkWww:EO},exit:{literalAutolink:IO,literalAutolinkEmail:LO,literalAutolinkHttp:$O,literalAutolinkWww:RO}},{enter:{gfmFootnoteCallString:OO,gfmFootnoteCall:FO,gfmFootnoteDefinitionLabelString:jO,gfmFootnoteDefinition:BO},exit:{gfmFootnoteCallString:zO,gfmFootnoteCall:qO,gfmFootnoteDefinitionLabelString:UO,gfmFootnoteDefinition:WO}},{canContainEols:["delete"],enter:{strikethrough:HO},exit:{strikethrough:XO}},{enter:{table:CF,tableData:EF,tableHeader:EF,tableRow:AF},exit:{codeText:$F,table:TF,tableData:SF,tableHeader:SF,tableRow:SF}},{exit:{taskListCheckValueChecked:IF,taskListCheckValueUnchecked:IF,paragraph:NF}}]),a.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:TO,notInConstruct:AO},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:TO,notInConstruct:AO},{character:":",before:"[ps]",after:"\\/",inConstruct:TO,notInConstruct:AO}]},KO(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:YO}],handlers:{delete:QO}},LF(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:MF}}]}}(t))}const gj={tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0;let s=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),o(t)};function o(t){return 36===t?(e.consume(t),s++,o):s<2?n(t):(e.exit("mathFlowFenceSequence"),KM(e,l,"whitespace")(t))}function l(t){return null===t||BM(t)?u(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return null===t||BM(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),u(t)):36===t?n(t):(e.consume(t),c)}function u(n){return e.exit("mathFlowFence"),r.interrupt?t(n):e.attempt(fj,p,g)(n)}function p(t){return e.attempt({tokenize:f,partial:!0},g,d)(t)}function d(t){return(a?KM(e,h,"linePrefix",a+1):h)(t)}function h(t){return null===t?g(t):BM(t)?e.attempt(fj,p,g)(t):(e.enter("mathFlowValue"),m(t))}function m(t){return null===t||BM(t)?(e.exit("mathFlowValue"),h(t)):(e.consume(t),m)}function g(n){return e.exit("mathFlow"),t(n)}function f(e,t,n){let i=0;return KM(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function a(t){return 36===t?(i++,e.consume(t),a):i{let e=!1;const i=setTimeout(()=>{(async()=>{const i=await async function(){return void 0===kj&&(kj=Promise.resolve().then(n.bind(n,7084)).then(e=>{let t=e.default;return t.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{darkMode:!1,fontFamily:"var(--font-mono)",fontSize:"14px",background:"#28292f",primaryColor:"#e6e7ea",mainBkg:"#e6e7ea",primaryBorderColor:"#e25822",nodeBorder:"#e25822",primaryTextColor:"#1f1f24",nodeTextColor:"#1f1f24",textColor:"#1f1f24",lineColor:"#a5a6b1",secondaryColor:"#fba292",secondaryBorderColor:"#e25822",secondaryTextColor:"#1f1f24",tertiaryColor:"#c6c7cd",tertiaryBorderColor:"#656775",tertiaryTextColor:"#1f1f24",clusterBkg:"#c6c7cd",clusterBorder:"#656775",titleColor:"#1f1f24",edgeLabelBackground:"#e6e7ea"}}),t})),kj}();if(!e&&!1!==await i.parse(t,{suppressErrors:!0}))try{const n=(await i.render(r,t)).svg;e||o(n)}catch(e){}})()},150);return()=>{e=!0,clearTimeout(i)}},[t,r]),(0,b.jsx)(bI,{title:"Diagram",children:(0,b.jsx)("div",{className:"flex justify-center p-4 [&_svg]:h-auto [&_svg]:max-w-full",children:a?(0,b.jsx)("div",{dangerouslySetInnerHTML:{__html:a}}):(0,b.jsx)("pre",{className:"text-primary-300 text-xs whitespace-pre-wrap",children:t})})})}n(4514);const Cj={pre:e=>{let t=e.children;return(0,b.jsx)(b.Fragment,{children:t})},a:e=>{let t=e.href,n=e.children;return(0,b.jsx)("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-flama-500 underline",children:n})},p:e=>{let t=e.children;return(0,b.jsx)("p",{className:"my-1 w-full first:mt-0 last:mb-0",children:t})},ul:e=>{let t=e.children;return(0,b.jsx)("ul",{className:"my-1 w-full list-outside list-disc ps-5 first:mt-0 last:mb-0",children:t})},ol:e=>{let t=e.children;return(0,b.jsx)("ol",{className:"my-1 w-full list-outside list-decimal ps-5 first:mt-0 last:mb-0",children:t})},h1:e=>{let t=e.children;return(0,b.jsx)("h1",{className:"my-2 w-full text-lg font-bold first:mt-0 last:mb-0",children:t})},h2:e=>{let t=e.children;return(0,b.jsx)("h2",{className:"my-2 w-full text-base font-bold first:mt-0 last:mb-0",children:t})},h3:e=>{let t=e.children;return(0,b.jsx)("h3",{className:"my-2 w-full text-base font-semibold first:mt-0 last:mb-0",children:t})},h4:e=>{let t=e.children;return(0,b.jsx)("h4",{className:"my-2 w-full text-sm font-semibold first:mt-0 last:mb-0",children:t})},h5:e=>{let t=e.children;return(0,b.jsx)("h5",{className:"my-2 w-full text-sm font-medium first:mt-0 last:mb-0",children:t})},h6:e=>{let t=e.children;return(0,b.jsx)("h6",{className:"my-2 w-full text-xs font-medium first:mt-0 last:mb-0",children:t})},blockquote:e=>{let t=e.children;return(0,b.jsx)("blockquote",{className:"border-primary-300 my-1 border-l-2 pl-3 italic",children:t})},hr:()=>(0,b.jsx)("div",{className:"border-primary-300 my-2 w-full border-t"}),code:e=>{var t,n;let r=e.className,i=e.children;const a=null===(t=/language-(\w+)/.exec(null!=r?r:""))||void 0===t||null===(t=t[1])||void 0===t?void 0:t.toLowerCase();if("math"===a)return(0,b.jsx)(b.Fragment,{children:i});const s=String(i).replace(/\n$/,"");return"mermaid"===a?(0,b.jsx)(wj,{chart:s}):s.includes("\n")||null!==(n=null==r?void 0:r.includes("language-"))&&void 0!==n&&n?(0,b.jsx)(bI,{title:null!=a?a:"",children:(0,b.jsx)("div",{className:"p-2",children:(0,b.jsx)(EL,{code:s,language:a,inline:!1,size:"xs"})})}):(0,b.jsx)(EL,{code:s,inline:!0,size:"xs"})}};function Tj(e){let t=e.text;return(0,b.jsx)(_O,{remarkPlugins:[mj,xj],rehypePlugins:[[FN,{throwOnError:!1}]],components:Cj,children:t})}const Aj=p("outline","pencil","Pencil",[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]]),Sj=p("outline","refresh","Refresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]),Ej=p("outline","check","Check",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),$j=p("outline","copy","Copy",[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);var Rj=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Lj=e=>e/20,Ij={vortico:"has-focus:border-vortico-500",bosque:"has-focus:border-bosque-500",bruma:"has-focus:border-bruma-500",ciclon:"has-focus:border-ciclon-500",flama:"has-focus:border-flama-500",primary:"has-focus:border-primary-500","vortico-light":"has-focus:border-vortico-200","bosque-light":"has-focus:border-bosque-200","bruma-light":"has-focus:border-bruma-200","ciclon-light":"has-focus:border-ciclon-200","flama-light":"has-focus:border-flama-200","primary-light":"has-focus:border-primary-200","vortico-dark":"has-focus:border-vortico-800","bosque-dark":"has-focus:border-bosque-800","bruma-dark":"has-focus:border-bruma-800","ciclon-dark":"has-focus:border-ciclon-800","flama-dark":"has-focus:border-flama-800","primary-dark":"has-focus:border-primary-800"};function Nj({color:e}){let t=e.replace(/-(light|dark)$/,"");return(0,b.jsx)("svg",{className:"loading-border loading-border-active","aria-hidden":!0,focusable:"false",children:Array.from({length:21},(e,n)=>(0,b.jsx)("rect",{className:"loading-border-comet",pathLength:100,style:{stroke:`var(--color-${t}-500)`,strokeOpacity:Lj(n),"--loading-border-i":n}},n))})}function Mj({as:e,color:t="primary",focus:n=!1,error:r=!1,loading:i=!1,disabled:a=!1,radius:s="0px",className:o="",style:l,children:c,...u}){let p=e||"div",d=n?r?"border-flama-300 has-focus:border-flama-500 "+(a?"":"hover:not-has-focus:border-flama-500"):`border-primary-300 ${Ij[t]} ${a?"":"hover:not-has-focus:border-primary-500"}`:Lo[t];return(0,b.jsxs)(p,{className:`relative border transition ${d} ${o}`,disabled:a||void 0,style:{"--loading-border-width":"1px","--loading-border-radius":s,..."0px"!==s?{borderRadius:s}:{},...l},...u,children:[c,i&&(0,b.jsx)(Nj,{color:t})]})}var Dj=(0,c.createContext)({}),Pj=(0,c.createContext)(null),Oj=(0,c.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Fj=typeof window<"u",jj=Fj?c.useLayoutEffect:c.useEffect,Bj=e=>e,zj=Bj,qj=["read","resolveKeyframes","update","preRender","render","postRender"];function Uj(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=qj.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function o(t){a.has(t)&&(l.schedule(t),e()),t(s)}let l={schedule:(e,i=!1,s=!1)=>{let o=s&&r?t:n;return i&&a.add(e),o.has(e)||o.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{s=e,r?i=!0:(r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,i&&(i=!1,l.process(e)))}};return l}(a),e),{}),{read:o,resolveKeyframes:l,update:c,preRender:u,render:p,postRender:d}=s,h=()=>{let a=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,40),1),i.timestamp=a,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),u.process(i),p.process(i),d.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:qj.reduce((t,a)=>{let o=s[a];return t[a]=(t,a=!1,s=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(h)),o.schedule(t,a,s)),t},{}),cancel:e=>{for(let t=0;tYj[e].some(e=>!!t[e])};var Xj=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 Qj(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Xj.has(e)}var Jj=e=>!Qj(e);try{!function(e){e&&(Jj=t=>t.startsWith("on")?!Qj(t):e(t))}(Rj("@emotion/is-prop-valid").default)}catch{}var eB=(0,c.createContext)({});function tB(e){return"string"==typeof e||Array.isArray(e)}function nB(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}var rB=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],iB=["initial",...rB];function aB(e){return nB(e.animate)||iB.some(t=>tB(e[t]))}function sB(e){return!(!aB(e)&&!e.variants)}function oB(e){return Array.isArray(e)?e.join(" "):e}var lB=Symbol.for("motionComponentSymbol");function cB(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function uB(e,t,n){return(0,c.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):cB(n)&&(n.current=r))},[t])}var pB=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),dB="data-"+pB("framerAppearId"),{schedule:hB}=Uj(queueMicrotask,!1),mB=(0,c.createContext)({});function gB(e,t,n,r,i){var a,s;let{visualElement:o}=(0,c.useContext)(eB),l=(0,c.useContext)(Zj),u=(0,c.useContext)(Pj),p=(0,c.useContext)(Oj).reducedMotion,d=(0,c.useRef)(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:p}));let h=d.current,m=(0,c.useContext)(mB);h&&!h.projection&&i&&("html"===h.type||"svg"===h.type)&&function(e,t,n,r){let{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:fB(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&cB(o),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(d.current,n,i,m);let g=(0,c.useRef)(!1);(0,c.useInsertionEffect)(()=>{h&&g.current&&h.update(n,u)});let f=n[dB],y=(0,c.useRef)(!!f&&!(null!==(a=window.MotionHandoffIsComplete)&&void 0!==a&&a.call(window,f))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,f)));return jj(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),hB.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),(0,c.useEffect)(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,f)}),y.current=!1))}),h}function fB(e){if(e)return!1!==e.options.allowProjection?e.projection:fB(e.parent)}function yB({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var a,s;function o(e,a){let s,o={...(0,c.useContext)(Oj),...e,layoutId:bB(e)},{isStatic:l}=o,u=function(e){let{initial:t,animate:n}=function(e,t){if(aB(e)){let{initial:t,animate:n}=e;return{initial:!1===t||tB(t)?t:void 0,animate:tB(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,c.useContext)(eB));return(0,c.useMemo)(()=>({initial:t,animate:n}),[oB(t),oB(n)])}(e),p=r(e,l);if(!l&&Fj){(0,c.useContext)(Zj).strict;let e=function(e){let{drag:t,layout:n}=Hj;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(o);s=e.MeasureLayout,u.visualElement=gB(i,p,o,t,e.ProjectionNode)}return(0,b.jsxs)(eB.Provider,{value:u,children:[s&&u.visualElement?(0,b.jsx)(s,{visualElement:u.visualElement,...o}):null,n(i,e,uB(p,u.visualElement,a),p,l,u.visualElement)]})}e&&function(e){for(let t in e)Hj[t]={...Hj[t],...e[t]}}(e),o.displayName=`motion.${"string"==typeof i?i:`create(${null!==(s=null!==(a=i.displayName)&&void 0!==a?a:i.name)&&void 0!==s?s:""})`}`;let l=(0,c.forwardRef)(o);return l[lB]=i,l}function bB({layoutId:e}){let t=(0,c.useContext)(Dj).id;return t&&void 0!==e?t+"-"+e:e}var vB=["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 _B(e){return"string"==typeof e&&!e.includes("-")&&!!(vB.indexOf(e)>-1||/[A-Z]/u.test(e))}function xB(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function kB(e,t,n,r){if("function"==typeof t){let[i,a]=xB(r);t=t(void 0!==n?n:e.custom,i,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[i,a]=xB(r);t=t(void 0!==n?n:e.custom,i,a)}return t}var wB=e=>Array.isArray(e),CB=e=>wB(e)?e[e.length-1]||0:e,TB=e=>!(!e||!e.getVelocity);function AB(e){let t=TB(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}var SB=e=>(t,n)=>{let r=(0,c.useContext)(eB),i=(0,c.useContext)(Pj),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){let s={latestValues:EB(r,i,a,e),renderState:t()};return n&&(s.onMount=e=>n({props:r,current:e,...s}),s.onUpdate=e=>n(e)),s}(e,t,r,i);return n?a():function(e){let t=(0,c.useRef)(null);return null===t.current&&(t.current=e()),t.current}(a)};function EB(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=AB(a[e]);let{initial:s,animate:o}=e,l=aB(e),c=sB(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===o&&(o=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;let p=u?o:s;if(p&&"boolean"!=typeof p&&!nB(p)){let t=Array.isArray(p)?p:[p];for(let n=0;nt=>"string"==typeof t&&t.startsWith(e),IB=LB("--"),NB=LB("var(--"),MB=e=>!!NB(e)&&DB.test(e.split("/*")[0].trim()),DB=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,PB=(e,t)=>t&&"number"==typeof e?t.transform(e):e,OB=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},jB={...FB,transform:e=>OB(0,1,e)},BB={...FB,default:1},zB=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),qB=zB("deg"),UB=zB("%"),WB=zB("px"),VB=zB("vh"),KB=zB("vw"),GB={...UB,parse:e=>UB.parse(e)/100,transform:e=>UB.transform(100*e)},ZB={borderWidth:WB,borderTopWidth:WB,borderRightWidth:WB,borderBottomWidth:WB,borderLeftWidth:WB,borderRadius:WB,radius:WB,borderTopLeftRadius:WB,borderTopRightRadius:WB,borderBottomRightRadius:WB,borderBottomLeftRadius:WB,width:WB,maxWidth:WB,height:WB,maxHeight:WB,top:WB,right:WB,bottom:WB,left:WB,padding:WB,paddingTop:WB,paddingRight:WB,paddingBottom:WB,paddingLeft:WB,margin:WB,marginTop:WB,marginRight:WB,marginBottom:WB,marginLeft:WB,backgroundPositionX:WB,backgroundPositionY:WB},YB={rotate:qB,rotateX:qB,rotateY:qB,rotateZ:qB,scale:BB,scaleX:BB,scaleY:BB,scaleZ:BB,skew:qB,skewX:qB,skewY:qB,distance:WB,translateX:WB,translateY:WB,translateZ:WB,x:WB,y:WB,z:WB,perspective:WB,transformPerspective:WB,opacity:jB,originX:GB,originY:GB,originZ:WB},HB={...FB,transform:Math.round},XB={...ZB,...YB,zIndex:HB,size:WB,fillOpacity:jB,strokeOpacity:jB,numOctaves:HB},QB={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JB=$B.length;function ez(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,s=!1,o=!1;for(let e in t){let n=t[e];if(RB.has(e))s=!0;else if(IB(e))i[e]=n;else{let t=PB(n,XB[e]);e.startsWith("origin")?(o=!0,a[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",i=!0;for(let a=0;a"string"==typeof e&&"svg"===e.toLowerCase();function sz(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(let t in n)e.style.setProperty(t,n[t])}var oz=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 lz(e,t,n,r){sz(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(oz.has(n)?n:pB(n),t.attrs[n])}var cz={};function uz(e,{layout:t,layoutId:n}){return RB.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!cz[e]||"opacity"===e)}function pz(e,t,n){var r;let{style:i}=e,a={};for(let s in i)(TB(i[s])||t.style&&TB(t.style[s])||uz(s,e)||void 0!==(null===(r=n?.getValue(s))||void 0===r?void 0:r.liveStyle))&&(a[s]=i[s]);return a}function dz(e,t,n){let r=pz(e,t,n);for(let n in e)(TB(e[n])||TB(t[n]))&&(r[-1!==$B.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}var hz=["x","y","width","height","cx","cy","r"],mz={useVisualState:SB({scrapeMotionValuesFromProps:dz,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a)for(let e in i)if(RB.has(e)){a=!0;break}if(!a)return;let s=!t;if(t)for(let n=0;n{(function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}})(n,r),Wj.render(()=>{iz(r,i,az(n.tagName),e.transformTemplate),lz(n,r)})})}})},gz={useVisualState:SB({scrapeMotionValuesFromProps:pz,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function fz(e,t,n){for(let r in t)!TB(t[r])&&!uz(r,n)&&(e[r]=t[r])}function yz(e,t){let n={},r=function(e,t){let n={};return fz(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,c.useMemo)(()=>{let n={style:{},transform:{},transformOrigin:{},vars:{}};return ez(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.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=r,n}function bz(e,t,n,r){let i=(0,c.useMemo)(()=>{let n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return iz(n,t,az(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};fz(t,e.style,e),i.style={...t,...i.style}}return i}function vz(e=!1){return(t,n,r,{latestValues:i},a)=>{let s=(_B(t)?bz:yz)(n,i,a,t),o=function(e,t,n){let r={};for(let i in e)"values"===i&&"object"==typeof e.values||(Jj(i)||!0===n&&Qj(i)||!t&&!Qj(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(n,"string"==typeof t,e),l=t!==c.Fragment?{...o,...s,ref:r}:{},{children:u}=n,p=(0,c.useMemo)(()=>TB(u)?u.get():u,[u]);return(0,c.createElement)(t,{...l,children:p})}}function _z(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r(void 0===wz&&Az.set(Kj.isProcessing?Kj.timestamp:performance.now()),wz),set:e=>{wz=e,queueMicrotask(Tz)}};function Sz(e,t){-1===e.indexOf(t)&&e.push(t)}function Ez(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var $z=class{constructor(){this.subscriptions=[]}add(e){return Sz(this.subscriptions,e),()=>Ez(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i{let n=Az.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){this.current=e,this.updatedAt=Az.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}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 $z);let n=this.events[e].add(t);return"change"===e?()=>{n(),Wj.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let 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 this.current}getPrevious(){return this.prev}getVelocity(){let e=Az.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Rz(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 Iz(e,t){return new Lz(e,t)}function Nz(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Iz(n))}function Mz(e,t){let n=e.getValue("willChange");if(function(e){return!(!TB(e)||!e.add)}(n))return n.add(t)}function Dz(e){return e.props[dB]}function Pz(e){let t;return()=>(void 0===t&&(t=e()),t)}var Oz=Pz(()=>void 0!==window.ScrollTimeline),Fz=class{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;nOz()&&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;tt[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}},jz=class extends Fz{then(e,t){return Promise.all(this.animations).then(e).catch(t)}},Bz=e=>1e3*e,zz=e=>e/1e3;function qz(e){return"function"==typeof e}function Uz(e,t){e.timeline=t,e.onfinish=null}var Wz=e=>Array.isArray(e)&&"number"==typeof e[0],Vz={linearEasing:void 0},Kz=function(){let e=Pz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0});return()=>{var t;return null!==(t=Vz.linearEasing)&&void 0!==t?t:e()}}(),Gz=(e,t,n)=>{let r=t-e;return 0===r?1:(n-e)/r},Zz=(e,t,n=10)=>{let r="",i=Math.max(Math.round(t/n),2);for(let t=0;t`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Xz={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hz([0,.65,.55,1]),circOut:Hz([.55,0,1,.45]),backIn:Hz([.31,.01,.66,-.59]),backOut:Hz([.33,1.53,.69,.99])};function Qz(e,t){if(e)return"function"==typeof e&&Kz()?Zz(e,t):Wz(e)?Hz(e):Array.isArray(e)?e.map(e=>Qz(e,t)||Xz.easeOut):Xz[e]}var Jz=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function eq(e,t,n,r){if(e===t&&n===r)return Bj;return i=>0===i||1===i?i:Jz((t=>function(e,t,n,r,i){let a,s,o=0;do{s=t+(n-t)/2,a=Jz(s,r,i)-e,a>0?n=s:t=s}while(Math.abs(a)>1e-7&&++o<12);return s}(t,0,1,e,n))(i),t,r)}var tq=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,nq=e=>t=>1-e(1-t),rq=eq(.33,1.53,.69,.99),iq=nq(rq),aq=tq(iq),sq=e=>(e*=2)<1?.5*iq(e):.5*(2-Math.pow(2,-10*(e-1))),oq=e=>1-Math.sin(Math.acos(e)),lq=nq(oq),cq=tq(oq),uq=e=>/^0[^.\s]+$/u.test(e);function pq(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||uq(e)}var dq=e=>Math.round(1e5*e)/1e5,hq=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,mq=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gq=(e,t)=>n=>!!("string"==typeof n&&mq.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),fq=(e,t,n)=>r=>{if("string"!=typeof r)return r;let[i,a,s,o]=r.match(hq);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(s),alpha:void 0!==o?parseFloat(o):1}},yq={...FB,transform:e=>Math.round((e=>OB(0,255,e))(e))},bq={test:gq("rgb","red"),parse:fq("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+yq.transform(e)+", "+yq.transform(t)+", "+yq.transform(n)+", "+dq(jB.transform(r))+")"},vq={test:gq("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:bq.transform},_q={test:gq("hsl","hue"),parse:fq("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+UB.transform(dq(t))+", "+UB.transform(dq(n))+", "+dq(jB.transform(r))+")"},xq={test:e=>bq.test(e)||vq.test(e)||_q.test(e),parse:e=>bq.test(e)?bq.parse(e):_q.test(e)?_q.parse(e):vq.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?bq.transform(e):_q.transform(e)},kq=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,wq="number",Cq="color",Tq=/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 Aq(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0,s=t.replace(Tq,e=>(xq.test(e)?(r.color.push(a),i.push(Cq),n.push(xq.parse(e))):e.startsWith("var(")?(r.var.push(a),i.push("var"),n.push(e)):(r.number.push(a),i.push(wq),n.push(parseFloat(e))),++a,"${}")).split("${}");return{values:n,split:s,indexes:r,types:i}}function Sq(e){return Aq(e).values}function Eq(e){let{split:t,types:n}=Aq(e),r=t.length;return e=>{let i="";for(let a=0;a"number"==typeof e?0:e,Rq={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(hq))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(kq))||void 0===n?void 0:n.length)||0)>0},parse:Sq,createTransformer:Eq,getAnimatableNone:function(e){let t=Sq(e);return Eq(e)(t.map($q))}},Lq=new Set(["brightness","contrast","saturate","opacity"]);function Iq(e){let[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[r]=n.match(hq)||[];if(!r)return e;let i=n.replace(r,""),a=Lq.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}var Nq=/\b([a-z-]*)\(.*?\)/gu,Mq={...Rq,getAnimatableNone:e=>{let t=e.match(Nq);return t?t.map(Iq).join(" "):e}},Dq={...XB,color:xq,backgroundColor:xq,outlineColor:xq,fill:xq,stroke:xq,borderColor:xq,borderTopColor:xq,borderRightColor:xq,borderBottomColor:xq,borderLeftColor:xq,filter:Mq,WebkitFilter:Mq},Pq=e=>Dq[e];function Oq(e,t){let n=Pq(e);return n!==Mq&&(n=Rq),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Fq=new Set(["auto","none","0"]),jq=e=>e===FB||e===WB,Bq=(e,t)=>parseFloat(e.split(", ")[t]),zq=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;let i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Bq(i[1],t);{let t=r.match(/^matrix\((.+)\)$/u);return t?Bq(t[1],e):0}},qq=new Set(["x","y","z"]),Uq=$B.filter(e=>!qq.has(e)),Wq={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:zq(4,13),y:zq(5,14)};Wq.translateX=Wq.x,Wq.translateY=Wq.y;var Vq=new Set,Kq=!1,Gq=!1;function Zq(){if(Gq){let e=Array.from(Vq).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=function(e){let t=[];return Uq.forEach(n=>{let r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.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();let t=n.get(e);t&&t.forEach(([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Gq=!1,Kq=!1,Vq.forEach(e=>e.complete()),Vq.clear()}function Yq(){Vq.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Gq=!0)})}var Hq=class{constructor(e,t,n,r,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Vq.add(this),Kq||(Kq=!0,Wj.read(Yq),Wj.resolveKeyframes(Zq))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let i=0;i/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Qq=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jq(e,t,n=1){let[r,i]=function(e){let t=Qq.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Xq(e)?parseFloat(e):e}return MB(i)?Jq(i,t,n+1):i}var eU=e=>t=>t.test(e),tU=[FB,WB,UB,qB,KB,VB,{test:e=>"auto"===e,parse:e=>e}],nU=e=>tU.find(eU(e)),rU=class extends Hq{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}},iU=(e,t)=>"zIndex"!==t&&!("number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Rq.test(e)&&"0"!==e||e.startsWith("url("))),aU=e=>null!==e;function sU(e,{repeat:t,repeatType:n="loop"},r){let i=e.filter(aU),a=t&&"loop"!==n&&t%2==1?0:i.length-1;return a&&void 0!==r?r:i[a]}var oU=class{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Az.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&(Yq(),Zq()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Az.now(),this.hasAttemptedResolve=!0;let{name:n,type:r,velocity:i,delay:a,onComplete:s,onUpdate:o,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){let i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;let a=e[e.length-1],s=iU(i,t),o=iU(a,t);return!(!s||!o)&&(function(e){let t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e})}};function lU(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}var cU=(e,t,n)=>e+(t-e)*n;function uU(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 pU(e,t){return n=>n>0?t:e}var dU=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},hU=[vq,bq,_q];function mU(e){let t=(e=>hU.find(t=>t.test(e)))(e);if(!t)return!1;let n=t.parse(e);return t===_q&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,a=0,s=0;if(t/=100){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r;i=uU(o,r,e+1/3),a=uU(o,r,e),s=uU(o,r,e-1/3)}else i=a=s=n;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*s),alpha:r}}(n)),n}var gU=(e,t)=>{let n=mU(e),r=mU(t);if(!n||!r)return pU(e,t);let i={...n};return e=>(i.red=dU(n.red,r.red,e),i.green=dU(n.green,r.green,e),i.blue=dU(n.blue,r.blue,e),i.alpha=cU(n.alpha,r.alpha,e),bq.transform(i))},fU=(e,t)=>n=>t(e(n)),yU=(...e)=>e.reduce(fU),bU=new Set(["none","hidden"]);function vU(e,t){return n=>cU(e,t,n)}function _U(e){return"number"==typeof e?vU:"string"==typeof e?MB(e)?pU:xq.test(e)?gU:wU:Array.isArray(e)?xU:"object"==typeof e?xq.test(e)?gU:kU:pU}function xU(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>_U(e)(e,t[n]));return e=>{for(let t=0;t{for(let t in r)n[t]=r[t](e);return n}}var wU=(e,t)=>{let n=Rq.createTransformer(t),r=Aq(e),i=Aq(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?bU.has(e)&&!i.values.length||bU.has(t)&&!r.values.length?function(e,t){return bU.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):yU(xU(function(e,t){var n;let r=[],i={color:0,var:0,number:0};for(let a=0;avoid 0!==e[t])}function DU(e=.3,t=.3){let n,r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:i,restDelta:a}=r,s=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:p,duration:d,velocity:h,isResolvedFromDuration:m}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!MU(e,NU)&&MU(e,IU))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,a=2*OB(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:1,stiffness:i,damping:a}}else{let n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:r=1}){let i,a,s=1-t;s=OB(.05,1,s),e=OB(.01,10,zz(e)),s<1?(i=t=>{let r=t*s,i=r*e;return.001-(r-n)/LU(t,s)*Math.exp(-i)},a=t=>{let r=t*s*e,a=r*n+n,o=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=LU(Math.pow(t,2),s);return(.001-i(t)>0?-1:1)*((a-o)*l)/c}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(n-t)));let o=function(e,t,n){let r=n;for(let n=1;n{let n=Math.exp(-f*b*t);return o-n*((g+f*b*y)/e*Math.sin(e*t)+y*Math.cos(e*t))}}else if(1===f)n=e=>o-Math.exp(-b*e)*(y+(g+b*y)*e);else{let e=b*Math.sqrt(f*f-1);n=t=>{let n=Math.exp(-f*b*t),r=Math.min(e*t,300);return o-n*((g+f*b*y)*Math.sinh(r)+e*y*Math.cosh(r))/e}}let _={calculatedDuration:m&&d||null,next:e=>{let t=n(e);if(m)l.done=e>=d;else{let r=0;f<1&&(r=0===e?Bz(g):TU(n,e,t));let s=Math.abs(r)<=i,c=Math.abs(o-t)<=a;l.done=s&&c}return l.value=l.done?o:t,l},toString:()=>{let e=Math.min(lU(_),2e4),t=Zz(t=>_.next(e*t).value,e,30);return e+"ms "+t}};return _}function PU({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:l,restDelta:c=.5,restSpeed:u}){let p=e[0],d={done:!1,value:p},h=e=>void 0===o?l:void 0===l||Math.abs(o-e)-m*Math.exp(-e/r),_=e=>f+v(e),x=e=>{let t=v(e),n=_(e);d.done=Math.abs(t)<=c,d.value=d.done?f:n},k=e=>{(e=>void 0!==o&&el)(d.value)&&(y=e,b=DU({keyframes:[d.value,h(d.value)],velocity:TU(_,e,d.value),damping:i,stiffness:a,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return!b&&void 0===y&&(t=!0,x(e),k(e)),void 0!==y&&e>=y?b.next(e-y):(!t&&x(e),d)}}}var OU=eq(.42,0,1,1),FU=eq(0,0,.58,1),jU=eq(.42,0,.58,1),BU={linear:Bj,easeIn:OU,easeInOut:jU,easeOut:FU,circIn:oq,circInOut:cq,circOut:lq,backIn:iq,backInOut:aq,backOut:rq,anticipate:sq},zU=e=>{if(Wz(e)){zj(4===e.length);let[t,n,r,i]=e;return eq(t,n,r,i)}return"string"==typeof e?BU[e]:e};function qU(e,t){return e.map(()=>t||jU).splice(0,e.length-1)}function UU({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){let i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(zU):zU(r),a={done:!1,value:t[0]},s=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){let t=[0];return function(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Gz(0,t,r);e.push(cU(n,1,i))}}(t,e.length-1),t}(t),e),o=function(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(zj(a===t.length),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,n){let r=[],i=n||CU,a=e.length-1;for(let n=0;n{if(s&&n1)for(;rc(OB(e[0],e[a-1],t)):c}(s,t,{ease:Array.isArray(i)?i:qU(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var WU=e=>{let t=({timestamp:t})=>e(t);return{start:()=>Wj.update(t,!0),stop:()=>Vj(t),now:()=>Kj.isProcessing?Kj.timestamp:Az.now()}},VU={decay:PU,inertia:PU,tween:UU,keyframes:UU,spring:DU},KU=e=>e/100,GU=class extends oU{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();let{onStop:e}=this.options;e&&e()};let{name:t,motionValue:n,element:r,keyframes:i}=this.options,a=r?.KeyframeResolver||Hq;this.resolver=new a(i,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){let t,n,{type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s,velocity:o=0}=this.options,l=qz(r)?r:VU[r]||UU;l!==UU&&"number"!=typeof e[0]&&(t=yU(KU,CU(e[0],e[1])),e=[0,100]);let c=l({...this.options,keyframes:e});"mirror"===s&&(n=l({...this.options,keyframes:[...e].reverse(),velocity:-o})),null===c.calculatedDuration&&(c.calculatedDuration=lU(c));let{calculatedDuration:u}=c,p=u+a;return{generator:c,mirroredGenerator:n,mapPercentToKeyframes:t,calculatedDuration:u,resolvedDuration:p,totalDuration:p*(i+1)-a}}onPostResolved(){let{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){let{resolved:n}=this;if(!n){let{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}let{finalKeyframe:r,generator:i,mirroredGenerator:a,mapPercentToKeyframes:s,keyframes:o,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return i.next(0);let{delay:p,repeat:d,repeatType:h,repeatDelay:m,onUpdate:g}=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;let f=this.currentTime-p*(this.speed>=0?1:-1),y=this.speed>=0?f<0:f>c;this.currentTime=Math.max(f,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let b=this.currentTime,v=i;if(d){let e=Math.min(this.currentTime,c)/u,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,d+1),t%2&&("reverse"===h?(n=1-n,m&&(n-=m/u)):"mirror"===h&&(v=a)),b=OB(0,1,n)*u}let _=y?{done:!1,value:o[0]}:v.next(b);s&&(_.value=s(_.value));let{done:x}=_;!y&&null!==l&&(x=this.speed>=0?this.currentTime>=c:this.currentTime<=0);let k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return k&&void 0!==r&&(_.value=sU(o,this.options,r)),g&&g(_.value),k&&this.finish(),_}get duration(){let{resolved:e}=this;return e?zz(e.calculatedDuration):0}get time(){return zz(this.currentTime)}set time(e){e=Bz(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){let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=zz(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;let{driver:e=WU,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();let r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=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";let{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)}},ZU=new Set(["opacity","clipPath","filter","transform"]);function YU(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeInOut",times:l}={}){let c={[t]:n};l&&(c.offset=l);let u=Qz(o,i);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:"reverse"===s?"alternate":"normal"})}var HU=Pz(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),XU={anticipate:sq,backInOut:aq,circInOut:cq},QU=class extends oU{constructor(e){super(e);let{name:t,motionValue:n,element:r,keyframes:i}=this.options;this.resolver=new rU(i,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:i,type:a,motionValue:s,name:o,startTime:l}=this.options;if(!s.owner||!s.owner.current)return!1;if("string"==typeof i&&Kz()&&function(e){return e in XU}(i)&&(i=XU[i]),function(e){return qz(e.type)||"spring"===e.type||!Yz(e.ease)}(this.options)){let{onComplete:t,onUpdate:s,motionValue:o,element:l,...c}=this.options,u=function(e,t){let n=new GU({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},i=[],a=0;for(;!r.done&&a<2e4;)r=n.sample(a),i.push(r.value),a+=10;return{times:void 0,keyframes:i,duration:a-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,r=u.times,i=u.ease,a="keyframes"}let c=YU(s.owner.current,o,e,{...this.options,duration:n,times:r,ease:i});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(Uz(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:n}=this.options;s.set(sU(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:r,type:a,ease:i,keyframes:e}}get duration(){let{resolved:e}=this;if(!e)return 0;let{duration:t}=e;return zz(t)}get time(){let{resolved:e}=this;if(!e)return 0;let{animation:t}=e;return zz(t.currentTime||0)}set time(e){let{resolved:t}=this;if(!t)return;let{animation:n}=t;n.currentTime=Bz(e)}get speed(){let{resolved:e}=this;if(!e)return 1;let{animation:t}=e;return t.playbackRate}set speed(e){let{resolved:t}=this;if(!t)return;let{animation:n}=t;n.playbackRate=e}get state(){let{resolved:e}=this;if(!e)return"idle";let{animation:t}=e;return t.playState}get startTime(){let{resolved:e}=this;if(!e)return null;let{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){let{resolved:t}=this;if(!t)return Bj;let{animation:n}=t;Uz(n,e)}else this.pendingTimeline=e;return Bj}play(){if(this.isStopped)return;let{resolved:e}=this;if(!e)return;let{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){let{resolved:e}=this;if(!e)return;let{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:e}=this;if(!e)return;let{animation:t,keyframes:n,duration:r,type:i,ease:a,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){let{motionValue:e,onUpdate:t,onComplete:o,element:l,...c}=this.options,u=new GU({...c,keyframes:n,duration:r,type:i,ease:a,times:s,isGenerator:!0}),p=Bz(this.time);e.setWithVelocity(u.sample(p-10).value,u.sample(p).value,10)}let{onStop:o}=this.options;o&&o(),this.cancel()}complete(){let{resolved:e}=this;e&&e.animation.finish()}cancel(){let{resolved:e}=this;e&&e.animation.cancel()}static supports(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:s}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;let{onUpdate:o,transformTemplate:l}=t.owner.getProps();return HU()&&n&&ZU.has(n)&&!o&&!l&&!r&&"mirror"!==i&&0!==a&&"inertia"!==s}},JU={type:"spring",stiffness:500,damping:25,restSpeed:10},eW={type:"keyframes",duration:.8},tW={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nW=(e,{keyframes:t})=>t.length>2?eW:RB.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):JU:tW,rW=(e,t,n,r={},i,a)=>s=>{let o=kz(r,e)||{},l=o.delay||r.delay||0,{elapsed:c=0}=r;c-=Bz(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:a?void 0:i};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(o)||(u={...u,...nW(e,u)}),u.duration&&(u.duration=Bz(u.duration)),u.repeatDelay&&(u.repeatDelay=Bz(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let p=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(p=!0)),p&&!a&&void 0!==t.get()){let e=sU(u.keyframes,o);if(void 0!==e)return Wj.update(()=>{u.onUpdate(e),u.onComplete()}),new jz([])}return!a&&QU.supports(u)?new QU(u):new GU(u)};function iW({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function aW(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:s=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(s=r);let c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(let t in l){let r=e.getValue(t,null!==(a=e.latestValues[t])&&void 0!==a?a:null),i=l[t];if(void 0===i||u&&iW(u,t))continue;let o={delay:n,...kz(s||{},t)},p=!1;if(window.MotionHandoffAnimation){let n=Dz(e);if(n){let e=window.MotionHandoffAnimation(n,t,Wj);null!==e&&(o.startTime=e,p=!0)}}Mz(e,t),r.start(rW(t,r,i,e.shouldReduceMotion&&Cz.has(t)?{type:!1}:o,e,p));let d=r.animation;d&&c.push(d)}return o&&Promise.all(c).then(()=>{Wj.update(()=>{o&&function(e,t){let n=xz(e,t),{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(let t in a)Nz(e,t,CB(a[t]))}(e,o)})}),c}function sW(e,t,n={}){var r;let i=xz(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0),{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);let s=i?()=>Promise.all(aW(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:i=0,staggerChildren:s,staggerDirection:o}=a;return function(e,t,n=0,r=0,i=1,a){let s=[],o=(e.variantChildren.size-1)*r,l=1===i?(e=0)=>e*r:(e=0)=>o-e*r;return Array.from(e.variantChildren).sort(oW).forEach((e,r)=>{e.notify("AnimationStart",t),s.push(sW(e,t,{...a,delay:n+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(s)}(e,t,i+r,s,o,n)}:()=>Promise.resolve(),{when:l}=a;if(l){let[e,t]="beforeChildren"===l?[s,o]:[o,s];return e().then(()=>t())}return Promise.all([s(),o(n.delay)])}function oW(e,t){return e.sortNodePosition(t)}var lW=iB.length;function cW(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&cW(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}let t={};for(let n=0;nPromise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){let i=t.map(t=>sW(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=sW(e,t,n);else{let i="function"==typeof t?xz(e,t,n.custom):t;r=Promise.all(aW(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=gW(),r=!0,i=t=>(n,r)=>{var i;let a=xz(e,r,"exit"===t?null===(i=e.presenceContext)||void 0===i?void 0:i.custom:void 0);if(a){let{transition:e,transitionEnd:t,...r}=a;n={...n,...r,...t}}return n};function a(a){let{props:s}=e,o=cW(e.parent)||{},l=[],c=new Set,u={},p=1/0;for(let t=0;tp&&g,_=!1,x=Array.isArray(m)?m:[m],k=x.reduce(i(d),{});!1===f&&(k={});let{prevResolvedValues:w={}}=h,C={...w,...k},T=t=>{v=!0,c.has(t)&&(_=!0,c.delete(t)),h.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in C){let t=k[e],n=w[e];if(u.hasOwnProperty(e))continue;let r=!1;r=wB(t)&&wB(n)?!_z(t,n):t!==n,r?null!=t?T(e):c.add(e):void 0!==t&&c.has(e)?T(e):h.protectedKeys[e]=!0}h.prevProp=m,h.prevResolvedValues=k,h.isActive&&(u={...u,...k}),r&&e.blockInitialAnimation&&(v=!1),v&&(!y||!b||_)&&l.push(...x.map(e=>({animation:e,options:{type:d}})))}if(c.size){let t={};c.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let d=!!l.length;return r&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(d=!1),r=!1,d?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,r){var i;if(n[t].isActive===r)return Promise.resolve();null===(i=e.variantChildren)||void 0===i||i.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)}),n[t].isActive=r;let s=a(t);for(let e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=gW(),r=!0}}}function hW(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!_z(t,e)}function mW(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gW(){return{animate:mW(!0),whileInView:mW(),whileHover:mW(),whileTap:mW(),whileDrag:mW(),whileFocus:mW(),exit:mW()}}var fW=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},yW=0,bW={animation:{Feature:class extends fW{constructor(e){super(e),e.animationState||(e.animationState=dW(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();nB(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{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 fW{constructor(){super(...arguments),this.id=yW++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},vW={x:!1,y:!1};function _W(){return vW.x||vW.y}var xW=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function kW(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function wW(e){return{point:{x:e.pageX,y:e.pageY}}}function CW(e,t,n,r){return kW(e,t,(e=>t=>xW(t)&&e(t,wW(t)))(n),r)}var TW=(e,t)=>Math.abs(e-t),AW=class{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;let e=$W(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){let n=TW(e.x,t.x),r=TW(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Kj;this.history.push({...r,timestamp:i});let{onStart:a,onMove:s}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=SW(t,this.transformPagePoint),Wj.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;let a=$W("pointercancel"===e.type?this.lastMoveEventInfo:SW(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!xW(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;let a=SW(wW(e),this.transformPagePoint),{point:s}=a,{timestamp:o}=Kj;this.history=[{...s,timestamp:o}];let{onSessionStart:l}=t;l&&l(e,$W(a,this.history)),this.removeListeners=yU(CW(this.contextWindow,"pointermove",this.handlePointerMove),CW(this.contextWindow,"pointerup",this.handlePointerUp),CW(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Vj(this.updatePoint)}};function SW(e,t){return t?{point:t(e.point)}:e}function EW(e,t){return{x:e.x-t.x,y:e.y-t.y}}function $W({point:e},t){return{point:e,delta:EW(e,LW(t)),offset:EW(e,RW(t)),velocity:IW(t,.1)}}function RW(e){return e[0]}function LW(e){return e[e.length-1]}function IW(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=LW(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Bz(t)));)n--;if(!r)return{x:0,y:0};let a=zz(i.timestamp-r.timestamp);if(0===a)return{x:0,y:0};let s={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function NW(e){return e.max-e.min}function MW(e,t,n,r=.5){e.origin=r,e.originPoint=cU(t.min,t.max,e.origin),e.scale=NW(n)/NW(t),e.translate=cU(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 DW(e,t,n,r){MW(e.x,t.x,n.x,r?r.originX:void 0),MW(e.y,t.y,n.y,r?r.originY:void 0)}function PW(e,t,n){e.min=n.min+t.min,e.max=e.min+NW(t)}function OW(e,t,n){e.min=t.min-n.min,e.max=e.min+NW(t)}function FW(e,t,n){OW(e.x,t.x,n.x),OW(e.y,t.y,n.y)}function jW(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 BW(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{min:0,max:0},y:{min:0,max:0}});function VW(e){return[e("x"),e("y")]}function KW({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function GW(e){return void 0===e||1===e}function ZW({scale:e,scaleX:t,scaleY:n}){return!GW(e)||!GW(t)||!GW(n)}function YW(e){return ZW(e)||HW(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function HW(e){return XW(e.x)||XW(e.y)}function XW(e){return e&&"0%"!==e}function QW(e,t,n){return n+t*(e-n)}function JW(e,t,n,r,i){return void 0!==i&&(e=QW(e,i,r)),QW(e,n,r)+t}function eV(e,t=0,n=1,r,i){e.min=JW(e.min,t,n,r,i),e.max=JW(e.max,t,n,r,i)}function tV(e,{x:t,y:n}){eV(e.x,t.translate,t.scale,t.originPoint),eV(e.y,n.translate,n.scale,n.originPoint)}var nV=.999999999999,rV=1.0000000000001;function iV(e,t){e.min=e.min+t,e.max=e.max+t}function aV(e,t,n,r,i=.5){eV(e,t,n,cU(e.min,e.max,i),r)}function sV(e,t){aV(e.x,t.x,t.scaleX,t.scale,t.originX),aV(e.y,t.y,t.scaleY,t.scale,t.originY)}function oV(e,t){return KW(function(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}var lV=({current:e})=>e?e.ownerDocument.defaultView:null,cV=new WeakMap,uV=class{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}={}){let{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;let{dragSnapToOrigin:r}=this.getProps();this.panSession=new AW(e,{onSessionStart:e=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(wW(e).point)},onStart:(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){return"x"===e||"y"===e?vW[e]?null:(vW[e]=!0,()=>{vW[e]=!1}):vW.x||vW.y?null:(vW.x=vW.y=!0,()=>{vW.x=vW.y=!1})}(n),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),VW(e=>{let t=this.getAxisMotionValue(e).get()||0;if(UB.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=NW(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Wj.postRender(()=>i(e,t)),Mz(this.visualElement,"transform");let{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(e,t)=>{let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:s}=t;if(r&&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&&i&&i(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),a&&a(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>VW(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:r,contextWindow:lV(this.visualElement)})}stop(e,t){let n=this.isDragging;if(this.cancel(),!n)return;let{velocity:r}=t;this.startAnimation(r);let{onDragEnd:i}=this.getProps();i&&Wj.postRender(()=>i(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!pV(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?cU(n,e,r.max):Math.min(e,n)),e}(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){var e;let{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,i=this.constraints;t&&cB(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:i}){return{x:jW(e.x,n,i),y:jW(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=zW){return!1===e?e=0:!0===e&&(e=zW),{x:qW(e,"left","right"),y:qW(e,"top","bottom")}}(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&VW(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){let n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!cB(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=function(e,t,n){let r=oV(e,n),{scroll:i}=t;return i&&(iV(r.x,i.offset.x),iV(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint()),a=function(e,t){return{x:BW(e.x,t.x),y:BW(e.y,t.y)}}(r.layout.layoutBox,i);if(t){let e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=KW(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),o=this.constraints||{},l=VW(s=>{if(!pV(s,t,this.currentDirection))return;let l=o&&o[s]||{};a&&(l={min:0,max:0});let c=r?200:1e6,u=r?40:1e7,p={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,p)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Mz(this.visualElement,e),n.start(rW(e,n,0,t,this.visualElement,!1))}stopAnimation(){VW(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){VW(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){let 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){VW(t=>{let{drag:n}=this.getProps();if(!pV(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t];i.set(e[t]-cU(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!cB(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};VW(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){let n=t.get();r[e]=function(e,t){let n=.5,r=NW(e),i=NW(t);return i>r?n=Gz(t.min,t.max-r,e.min):r>i&&(n=Gz(e.min,e.max-i,t.min)),OB(0,1,n)}({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),VW(t=>{if(!pV(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(cU(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;cV.set(this.visualElement,this);let e=CW(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();cB(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Wj.read(t);let i=kW(window,"resize",()=>this.scalePositionWithinConstraints()),a=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(VW(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{i(),e(),r(),a&&a()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=zW,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:s}}};function pV(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}var dV=e=>(t,n)=>{e&&Wj.postRender(()=>e(t,n))},hV={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function mV(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var gV={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!WB.test(e))return e;e=parseFloat(e)}return`${mV(e,t.target.x)}% ${mV(e,t.target.y)}%`}},fV={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Rq.parse(e);if(i.length>5)return r;let a=Rq.createTransformer(e),s="number"!=typeof i[0]?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=o,i[1+s]/=l;let c=cU(o,l,.5);return"number"==typeof i[2+s]&&(i[2+s]/=c),"number"==typeof i[3+s]&&(i[3+s]/=c),a(i)}},yV=class extends c.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;(function(e){Object.assign(cz,e)})(vV),i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),hV.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,a=n.projection;return a&&(a.isPresent=i,r||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Wj.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),hB.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function bV(e){let[t,n]=function(e=!0){let t=(0,c.useContext)(Pj);if(null===t)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,c.useId)();(0,c.useEffect)(()=>{e&&i(a)},[e]);let s=(0,c.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,s]:[!0]}(),r=(0,c.useContext)(Dj);return(0,b.jsx)(yV,{...e,layoutGroup:r,switchLayoutGroup:(0,c.useContext)(mB),isPresent:t,safeToRemove:n})}var vV={borderRadius:{...gV,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gV,borderTopRightRadius:gV,borderBottomLeftRadius:gV,borderBottomRightRadius:gV,boxShadow:fV},_V=(e,t)=>e.depth-t.depth,xV=class{constructor(){this.children=[],this.isDirty=!1}add(e){Sz(this.children,e),this.isDirty=!0}remove(e){Ez(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(_V),this.isDirty=!1,this.children.forEach(e)}},kV=["TopLeft","TopRight","BottomLeft","BottomRight"],wV=kV.length,CV=e=>"string"==typeof e?parseFloat(e):e,TV=e=>"number"==typeof e||WB.test(e);function AV(e,t){return void 0!==e[t]?e[t]:e.borderRadius}var SV=$V(0,.5,lq),EV=$V(.5,.95,Bj);function $V(e,t,n){return r=>rt?1:n(Gz(e,t,r))}function RV(e,t){e.min=t.min,e.max=t.max}function LV(e,t){RV(e.x,t.x),RV(e.y,t.y)}function IV(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function NV(e,t,n,r,i){return e=QW(e-=t,1/n,r),void 0!==i&&(e=QW(e,1/i,r)),e}function MV(e,t,[n,r,i],a,s){!function(e,t=0,n=1,r=.5,i,a=e,s=e){if(UB.test(t)&&(t=parseFloat(t),t=cU(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let o=cU(a.min,a.max,r);e===a&&(o-=t),e.min=NV(e.min,t,n,o,i),e.max=NV(e.max,t,n,o,i)}(e,t[n],t[r],t[i],t.scale,a,s)}var DV=["x","scaleX","originX"],PV=["y","scaleY","originY"];function OV(e,t,n,r){MV(e.x,t,DV,n?n.x:void 0,r?r.x:void 0),MV(e.y,t,PV,n?n.y:void 0,r?r.y:void 0)}function FV(e){return 0===e.translate&&1===e.scale}function jV(e){return FV(e.x)&&FV(e.y)}function BV(e,t){return e.min===t.min&&e.max===t.max}function zV(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function qV(e,t){return zV(e.x,t.x)&&zV(e.y,t.y)}function UV(e){return NW(e.x)/NW(e.y)}function WV(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var VV=class{constructor(){this.members=[]}add(e){Sz(this.members,e),e.scheduleRender()}remove(e){if(Ez(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,n=this.members.findIndex(t=>e===t);if(0===n)return!1;for(let e=n;e>=0;e--){let n=this.members[e];if(!1!==n.isPresent){t=n;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let 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);let{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{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)}},KV={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},GV=typeof window<"u"&&void 0!==window.MotionDebug,ZV=["","X","Y","Z"],YV={visibility:"hidden"},HV=0;function XV(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function QV(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Dz(t);if(window.MotionHasOptimisedAnimation(n,"transform")){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Wj,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&QV(r)}function JV({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=HV++,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,GV&&(KV.totalNodes=KV.resolvedTargetDeltas=KV.recalculatedProjection=0),this.nodes.forEach(nK),this.nodes.forEach(cK),this.nodes.forEach(uK),this.nodes.forEach(rK),GV&&window.MotionDebug.record(KV)},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;ethis.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e){let t=Az.now(),n=({timestamp:r})=>{let i=r-t;i>=250&&(Vj(n),e(i-250))};return Wj.read(n,!0),()=>Vj(n)}(r),hV.hasAnimatedSinceResize&&(hV.hasAnimatedSinceResize=!1,this.nodes.forEach(lK))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&a&&(r||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);let i=this.options.transition||a.getDefaultTransition()||fK,{onLayoutAnimationStart:s,onLayoutAnimationComplete:o}=a.getProps(),l=!this.targetLayout||!qV(this.targetLayout,r)||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);let t={...kz(i,"layout"),onPlay:s,onComplete:o};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||lK(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Vj(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(pK),this.animationId++)}getTransformTemplate(){let{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&&QV(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!(this.instance&&(this.updateScroll(),this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty)))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;enV&&(t.x=1),t.ynV&&(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}});let{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(IV(this.prevProjectionDelta.x,this.projectionDelta.x),IV(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),DW(this.projectionDelta,this.layoutCorrected,l,this.latestValues),(this.treeScale.x!==s||this.treeScale.y!==o||!WV(this.projectionDelta.x,this.prevProjectionDelta.x)||!WV(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),GV&&KV.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){let 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){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a={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;let s,o={x:{min:0,max:0},y:{min:0,max:0}},l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,p=!(!l||u||!0!==this.options.crossfade||this.path.some(gK));this.animationProgress=0,this.mixTargetDelta=t=>{let n=t/1e3;hK(a.x,e.x,n),hK(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(FW(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){mK(e.x,t.x,n.x,r),mK(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,o,n),s&&function(e,t){return BV(e.x,t.x)&&BV(e.y,t.y)}(this.relativeTarget,s)&&(this.isProjectionDirty=!1),s||(s={x:{min:0,max:0},y:{min:0,max:0}}),LV(s,this.relativeTarget)),l&&(this.animationValues=i,function(e,t,n,r,i,a){i?(e.opacity=cU(0,void 0!==n.opacity?n.opacity:1,SV(r)),e.opacityExit=cU(void 0!==t.opacity?t.opacity:1,0,EV(r))):a&&(e.opacity=cU(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let i=0;i{hV.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){let r=TB(0)?0:Iz(0);return r.start(rW("",r,1e3,n)),r.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);let 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(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&_K(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};let t=NW(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=NW(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}LV(t,n),sV(t,i),DW(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new VV),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){var e;let{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;let{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&XV("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(aK),this.root.sharedNodes.clear()}}}function eK(e){e.updateLayout()}function tK(e){var t;let n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){let{layoutBox:t,measuredBox:r}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;"size"===i?VW(e=>{let r=a?n.measuredBox[e]:n.layoutBox[e],i=NW(r);r.min=t[e].min,r.max=r.min+i}):_K(i,n.layoutBox,t)&&VW(r=>{let i=a?n.measuredBox[r]:n.layoutBox[r],s=NW(t[r]);i.max=i.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)});let s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};DW(s,t,n.layoutBox);let o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?DW(o,e.applyTransform(r,!0),n.measuredBox):DW(o,t,n.layoutBox);let l=!jV(s),c=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let s={x:{min:0,max:0},y:{min:0,max:0}};FW(s,n.layoutBox,i.layoutBox);let o={x:{min:0,max:0},y:{min:0,max:0}};FW(o,t,a.layoutBox),qV(s,o)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=o,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:o,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function nK(e){GV&&KV.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function rK(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function iK(e){e.clearSnapshot()}function aK(e){e.clearMeasurements()}function sK(e){e.isLayoutDirty=!1}function oK(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function lK(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function cK(e){e.resolveTargetDelta()}function uK(e){e.calcProjection()}function pK(e){e.resetSkewAndRotation()}function dK(e){e.removeLeadSnapshot()}function hK(e,t,n){e.translate=cU(t.translate,0,n),e.scale=cU(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mK(e,t,n,r){e.min=cU(t.min,n.min,r),e.max=cU(t.max,n.max,r)}function gK(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}var fK={duration:.45,ease:[.4,0,.1,1]},yK=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),bK=yK("applewebkit/")&&!yK("chrome/")?Math.round:Bj;function vK(e){e.min=bK(e.min),e.max=bK(e.max)}function _K(e,t,n){return"position"===e||"preserve-aspect"===e&&!function(e,t){return Math.abs(e-t)<=.2}(UV(t),UV(n))}function xK(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}var kK=JV({attachResizeListener:(e,t)=>kW(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),wK={current:void 0},CK=JV({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!wK.current){let e=new kK({});e.mount(window),e.setOptions({layoutScroll:!0}),wK.current=e}return wK.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),TK={pan:{Feature:class extends fW{constructor(){super(...arguments),this.removePointerDownListener=Bj}onPointerDown(e){this.session=new AW(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lV(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:dV(e),onStart:dV(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Wj.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=CW(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 fW{constructor(e){super(e),this.removeGroupControls=Bj,this.removeListeners=Bj,this.controls=new uV(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bj}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:CK,MeasureLayout:bV}};function AK(e,t){let n=function(e){if(e instanceof Element)return[e];if("string"==typeof e){let t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function SK(e){return t=>{"touch"===t.pointerType||_W()||e(t)}}function EK(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);let i=r["onHover"+n];i&&Wj.postRender(()=>i(t,wW(t)))}var $K=(e,t)=>!!t&&(e===t||$K(e,t.parentElement)),RK=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),LK=new WeakSet;function IK(e){return t=>{"Enter"===t.key&&e(t)}}function NK(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function MK(e){return xW(e)&&!_W()}function DK(e,t,n){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);let i=r["onTap"+("End"===n?"":n)];i&&Wj.postRender(()=>i(t,wW(t)))}var PK=new WeakMap,OK=new WeakMap,FK=e=>{let t=PK.get(e.target);t&&t(e)},jK=e=>{e.forEach(FK)};var BK={some:0,all:1},zK={inView:{Feature:class extends fW{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:BK[r]};return function(e,t,n){let r=function({root:e,...t}){let n=e||document;OK.has(n)||OK.set(n,{});let r=OK.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(jK,{root:e,...t})),r[i]}(t);return PK.set(e,n),r.observe(e),()=>{PK.delete(e),r.unobserve(e)}}(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{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 fW{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){let[r,i,a]=AK(e,n),s=e=>{let r=e.currentTarget;if(!MK(e)||LK.has(r))return;LK.add(r);let a=t(e),s=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),MK(e)&&LK.has(r)&&(LK.delete(r),"function"==typeof a&&a(e,{success:t}))},o=e=>{s(e,n.useGlobalTarget||$K(r,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",o,i),window.addEventListener("pointercancel",l,i)};return r.forEach(e=>{!function(e){return RK.has(e.tagName)||-1!==e.tabIndex}(e)&&null===e.getAttribute("tabindex")&&(e.tabIndex=0),(n.useGlobalTarget?window:e).addEventListener("pointerdown",s,i),e.addEventListener("focus",e=>((e,t)=>{let n=e.currentTarget;if(!n)return;let r=IK(()=>{if(LK.has(n))return;NK(n,"down");let e=IK(()=>{NK(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>NK(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i),i)}),a}(e,e=>(DK(this.node,e,"Start"),(e,{success:t})=>DK(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends fW{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{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=yU(kW(this.node.current,"focus",()=>this.onFocus()),kW(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends fW{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){let[r,i,a]=AK(e,n),s=SK(e=>{let{target:n}=e,r=t(e);if("function"!=typeof r||!n)return;let a=SK(e=>{r(e),n.removeEventListener("pointerleave",a)});n.addEventListener("pointerleave",a,i)});return r.forEach(e=>{e.addEventListener("pointerenter",s,i)}),a}(e,e=>(EK(this.node,e,"Start"),e=>EK(this.node,e,"End"))))}unmount(){}}}},qK={layout:{ProjectionNode:CK,MeasureLayout:bV}},UK={current:null},WK={current:!1},VK=[...tU,xq,Rq],KK=new WeakMap,GK=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ZK=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hq,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=()=>{let e=Az.now();this.renderScheduledAtthis.bindToMotionValue(t,e)),WK.current||function(){if(WK.current=!0,Fj)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>UK.current=e.matches;e.addListener(t),t()}else UK.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||UK.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){KK.delete(this.current),this.projection&&this.projection.unmount(),Vj(this.notifyUpdate),Vj(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n,r=RB.has(e),i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Wj.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=t.on("renderRequest",this.scheduleRender);window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),a(),n&&n(),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 Hj){let t=Hj[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let 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;tt.variantChildren.delete(e)}addValue(e,t){let 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);let 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=Iz(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=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];return null!=r&&("string"==typeof r&&(Xq(r)||uq(r))?r=parseFloat(r):!(e=>VK.find(eU(e)))(r)&&Rq.test(t)&&(r=Oq(e,t)),this.setBaseTarget(e,TB(r)?r.get():r)),TB(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;let n,{initial:r}=this.props;if("string"==typeof r||"object"==typeof r){let i=kB(this.props,r,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);i&&(n=i[e])}if(r&&void 0!==n)return n;let i=this.getBaseTargetFromProps(this.props,e);return void 0===i||TB(i)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new $z),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}},YK=class extends ZK{constructor(){super(...arguments),this.KeyframeResolver=rU}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);let{children:e}=this.props;TB(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}},HK=class extends YK{constructor(){super(...arguments),this.type="html",this.renderInstance=sz}readValueFromInstance(e,t){if(RB.has(t)){let e=Pq(t);return e&&e.default||0}{let n=function(e){return window.getComputedStyle(e)}(e),r=(IB(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return oV(e,t)}build(e,t,n){ez(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return pz(e,t,n)}},XK=class extends YK{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=WW}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(RB.has(t)){let e=Pq(t);return e&&e.default||0}return t=oz.has(t)?t:pB(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return dz(e,t,n)}build(e,t,n){iz(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){lz(e,t,0,r)}mount(e){this.isSVGTag=az(e.tagName),super.mount(e)}},QK=function(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return yB({..._B(n)?mz:gz,preloadedFeatures:e,useRender:vz(r),createVisualElement:t,Component:n})}}({...bW,...zK,...TK,...qK},(e,t)=>_B(e)?new XK(t):new HK(t,{allowProjection:e!==c.Fragment})),JK=function(e){if(typeof Proxy>"u")return e;let t=new Map;return new Proxy((...t)=>e(...t),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}(QK);function eG({from:e="pointer",color:t="primary",disabled:n=!1,children:r,className:i,onClick:a=()=>{},...s}){let[o,l]=(0,c.useState)([]),u=(0,c.useCallback)((t,r,i)=>{if(!0!==n){let n,a=2*Math.sqrt(t.width**2+t.height**2);switch(e){case"center":n={x:t.width/2-a/2,y:t.height/2-a/2};break;case"pointer":n={x:r-t.left-a/2,y:i-t.top-a/2}}l([...o,{id:Date.now(),...n,size:a}])}},[e,n,o]);return(0,b.jsxs)("div",{className:`relative overflow-hidden ${i||""}`,onClick:e=>{u(e.currentTarget.getBoundingClientRect(),e.clientX,e.clientY),a(e)},...s,children:[r,o.map(e=>(0,b.jsx)(JK.div,{className:`pointer-events-none absolute rounded-full ${Ro[t]}`,style:{left:e.x,top:e.y,width:e.size,height:e.size},initial:{scale:0,opacity:.5},animate:{scale:1,opacity:0},transition:{duration:.8,ease:"easeOut"},onAnimationComplete:()=>l(t=>t.filter(t=>t.id!==e.id))},e.id))]})}function tG({icon:e,size:t="md",color:n="primary",type:r="button",...i}){return(0,b.jsx)("button",{className:`cursor-pointer rounded-full transition disabled:cursor-not-allowed disabled:opacity-50 hover:disabled:bg-transparent ${zo[n]} ${$o[n]}`,type:r,...i,children:(0,b.jsx)(eG,{from:"center",color:n,className:`flex items-center justify-center rounded-full ${Po[t]}`,children:(0,c.cloneElement)(e,{height:Do[t],width:Do[t]})})})}var nG={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}},rG=(e,t,n,r)=>{let i=(0,c.forwardRef)(({color:n="currentColor",size:i=24,stroke:a=2,title:s,className:o,children:l,...u},p)=>(0,c.createElement)("svg",{ref:p,...nG[e],width:i,height:i,className:["tabler-icon",`tabler-icon-${t}`,o].join(" "),..."filled"===e?{fill:n}:{strokeWidth:a,stroke:n},...u},[s&&(0,c.createElement)("title",{key:"svg-title"},s),...r.map(([e,t])=>(0,c.createElement)(e,t)),...Array.isArray(l)?l:[l]]));return i.displayName=`${n}`,i},iG=(rG("outline","check","Check",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),rG("outline","exclamation-circle","ExclamationCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 9v4",key:"svg-1"}],["path",{d:"M12 16v.01",key:"svg-2"}]]));function aG({errors:e,size:t="md",color:n="primary"}){return(0,b.jsx)("ul",{className:"list-none",children:e.map((e,r)=>(0,b.jsxs)("li",{className:`flex items-center justify-start gap-1 ${zo[n]}`,children:[(0,b.jsx)("span",{className:"inline-block",children:(0,b.jsx)(iG,{size:Do[t]})}),(0,b.jsx)("span",{className:`italic ${Mo[t]}`,children:e})]},r))})}rG("outline","eye-closed","EyeClosed",[["path",{d:"M21 9c-2.4 2.667 -5.4 4 -9 4c-3.6 0 -6.6 -1.333 -9 -4",key:"svg-0"}],["path",{d:"M3 15l2.5 -3.8",key:"svg-1"}],["path",{d:"M21 14.976l-2.492 -3.776",key:"svg-2"}],["path",{d:"M9 17l.5 -4",key:"svg-3"}],["path",{d:"M15 17l-.5 -4",key:"svg-4"}]]),rG("outline","eye","Eye",[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]]),rG("outline","x","X",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]),rG("filled","caret-down-filled","CaretDownFilled",[["path",{d:"M18 9c.852 0 1.297 .986 .783 1.623l-.076 .084l-6 6a1 1 0 0 1 -1.32 .083l-.094 -.083l-6 -6l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057v-.118l.005 -.058l.009 -.06l.01 -.052l.032 -.108l.027 -.067l.07 -.132l.065 -.09l.073 -.081l.094 -.083l.077 -.054l.096 -.054l.036 -.017l.067 -.027l.108 -.032l.053 -.01l.06 -.01l.057 -.004l12.059 -.002z",key:"svg-0"}]]),rG("filled","caret-up-filled","CaretUpFilled",[["path",{d:"M11.293 7.293a1 1 0 0 1 1.32 -.083l.094 .083l6 6l.083 .094l.054 .077l.054 .096l.017 .036l.027 .067l.032 .108l.01 .053l.01 .06l.004 .057l.002 .059l-.002 .059l-.005 .058l-.009 .06l-.01 .052l-.032 .108l-.027 .067l-.07 .132l-.065 .09l-.073 .081l-.094 .083l-.077 .054l-.096 .054l-.036 .017l-.067 .027l-.108 .032l-.053 .01l-.06 .01l-.057 .004l-.059 .002h-12c-.852 0 -1.297 -.986 -.783 -1.623l.076 -.084l6 -6z",key:"svg-0"}]]),rG("filled","circle-filled","CircleFilled",[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]]);var sG={vortico:"group-has-focus/textarea:border-vortico-500",bosque:"group-has-focus/textarea:border-bosque-500",bruma:"group-has-focus/textarea:border-bruma-500",ciclon:"group-has-focus/textarea:border-ciclon-500",flama:"group-has-focus/textarea:border-flama-500",primary:"group-has-focus/textarea:border-primary-500","vortico-light":"group-has-focus/textarea:border-vortico-200","bosque-light":"group-has-focus/textarea:border-bosque-200","bruma-light":"group-has-focus/textarea:border-bruma-200","ciclon-light":"group-has-focus/textarea:border-ciclon-200","flama-light":"group-has-focus/textarea:border-flama-200","primary-light":"group-has-focus/textarea:border-primary-200","vortico-dark":"group-has-focus/textarea:border-vortico-800","bosque-dark":"group-has-focus/textarea:border-bosque-800","bruma-dark":"group-has-focus/textarea:border-bruma-800","ciclon-dark":"group-has-focus/textarea:border-ciclon-800","flama-dark":"group-has-focus/textarea:border-flama-800","primary-dark":"group-has-focus/textarea:border-primary-800"},oG={vortico:"peer-focus:text-vortico-500",bosque:"peer-focus:text-bosque-500",bruma:"peer-focus:text-bruma-500",ciclon:"peer-focus:text-ciclon-500",flama:"peer-focus:text-flama-500",primary:"peer-focus:text-primary-500","vortico-light":"peer-focus:text-vortico-200","bosque-light":"peer-focus:text-bosque-200","bruma-light":"peer-focus:text-bruma-200","ciclon-light":"peer-focus:text-ciclon-200","flama-light":"peer-focus:text-flama-200","primary-light":"peer-focus:text-primary-200","vortico-dark":"peer-focus:text-vortico-800","bosque-dark":"peer-focus:text-bosque-800","bruma-dark":"peer-focus:text-bruma-800","ciclon-dark":"peer-focus:text-ciclon-800","flama-dark":"peer-focus:text-flama-800","primary-dark":"peer-focus:text-primary-800"},lG={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"};function cG({name:e,color:t="primary",size:n="md",label:r,errors:i,required:a,disabled:s,value:o,onChange:l,rows:u=3,ref:p,inline:d=!1,resize:h="none",...m}){let[g,f]=(0,c.useState)(null),y=(0,c.useRef)(void 0),v=(0,c.useCallback)(e=>{f(e.target?.selectionStart),l&&l(e)},[f,l]);return(0,c.useEffect)(()=>{y?.current&&g&&y.current.setSelectionRange(g,g)},[y,g,o]),(0,b.jsxs)("div",{className:"group/textarea",children:[(0,b.jsx)("div",{className:`relative flex min-w-32 items-center justify-start gap-2 transition ${d?"bg-transparent":`-m-px mt-1.75 border ${Ao}`} ${s?"cursor-not-allowed":""} ${sG[t]} ${i?"border-flama-300 "+(s?"":"group-hover/textarea:not-has-focus:border-flama-500"):"border-primary-300 "+(s?"":"group-hover/textarea:not-has-focus:border-primary-500")}`,children:(0,b.jsxs)("label",{className:"group relative z-0 block w-full",children:[(0,b.jsx)("textarea",{ref:e=>{y.current=e,null!==p&&"function"==typeof p?p(e):null!==p&&"object"==typeof p&&(p.current=e)},name:e,rows:u,className:`peer text-primary-500 block w-full appearance-none border-0 p-2 transition focus:ring-0 focus:outline-hidden ${Ao} ${Mo[n]} ${d?"":"placeholder:opacity-0"} ${lG[h]} ${s?"text-primary-200 cursor-not-allowed":"cursor-text"} ${i?"placeholder:text-flama-300":"placeholder:text-primary-300"}`,value:o,placeholder:r,required:a,disabled:s,onChange:v,...m}),r&&!d&&(0,b.jsx)("span",{className:`pointer-events-none absolute top-0 left-2 -translate-y-1/2 cursor-default truncate px-0.5 text-xs/4 font-normal text-nowrap transition select-none peer-focus:font-semibold ${Ao} ${oG[t]} ${a?"after:ml-1 after:content-['*']":""} ${i?"text-flama-300 "+(s?"":"group-hover/select:text-flama-500"):"text-primary-300 "+(s?"":"group-hover/select:text-primary-500")}`,children:r})]})}),i&&!d&&(0,b.jsx)("div",{className:"mt-1",children:(0,b.jsx)(aG,{errors:i,size:"xs",color:"flama"})})]})}function uG(e){let t=e.text,n=e.onEdit,r=e.onRedo,i=e.align,a=e.alwaysVisible,o=void 0!==a&&a;const l=s((0,c.useState)(!1),2),u=l[0],p=l[1],d=(0,c.useCallback)(async()=>{t&&(await navigator.clipboard.writeText(t),p(!0),setTimeout(()=>p(!1),2e3))},[t]);return t||n||r?(0,b.jsxs)("div",{className:"flex items-center gap-1 ".concat("end"===i?"justify-end":"justify-start"," ").concat(o?"":"opacity-0 transition-opacity duration-200 group-hover/msg:opacity-100"),children:[n&&(0,b.jsx)(tG,{icon:(0,b.jsx)(Aj,{}),color:"primary",size:"sm","aria-label":"Edit message",onClick:n}),r&&(0,b.jsx)(tG,{icon:(0,b.jsx)(Sj,{}),color:"primary",size:"sm","aria-label":"Regenerate response",onClick:r}),t&&(0,b.jsx)(tG,{icon:u?(0,b.jsx)(Ej,{}):(0,b.jsx)($j,{}),color:"primary",size:"sm","aria-label":"Copy to clipboard",onClick:()=>{d()}})]}):null}function pG(e){let t=e.text,n=e.onRedo;return(0,b.jsxs)("div",{className:"flex w-full flex-col items-start gap-1",children:[(0,b.jsx)(Tj,{text:t}),(0,b.jsx)(uG,{align:"start",text:t,onRedo:n,alwaysVisible:!0})]})}const dG=p("outline","chevron-down","ChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),hG=p("outline","chevron-right","ChevronRight",[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]]),mG=p("outline","brain","Brain",[["path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8",key:"svg-0"}],["path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8",key:"svg-1"}],["path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5",key:"svg-2"}],["path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0",key:"svg-3"}],["path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5",key:"svg-4"}],["path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10",key:"svg-5"}]]),gG=(0,c.createContext)({});function fG(e){const t=(0,c.useRef)(null);return null===t.current&&(t.current=e()),t.current}const yG="undefined"!=typeof window?c.useLayoutEffect:c.useEffect,bG=(0,c.createContext)(null),vG=e=>"object"==typeof e&&null!==e;function _G(e){return vG(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const xG=(0,c.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function kG(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class wG extends c.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(_G(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=_G(e)&&e.offsetWidth||0,r=_G(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function CG({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){const s=(0,c.useId)(),o=(0,c.useRef)(null),l=(0,c.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:u}=(0,c.useContext)(xG),p=e.props?.ref??e?.ref,d=function(...e){return c.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=kG(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t{const{width:e,height:c,top:p,left:d,right:h,bottom:m,direction:g}=l.current;if(t||!1===a||!o.current||!e||!c)return;const f="rtl"===g,y="left"===n?f?`right: ${h}`:`left: ${d}`:f?`left: ${d}`:`right: ${h}`,b="bottom"===r?`bottom: ${m}`:`top: ${p}`;o.current.dataset.motionPopId=s;const v=document.createElement("style");u&&(v.nonce=u);const _=i??document.head;return _.appendChild(v),v.sheet&&v.sheet.insertRule(`\n [data-motion-pop-id="${s}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${c}px !important;\n ${y}px !important;\n ${b}px !important;\n }\n `),()=>{o.current?.removeAttribute("data-motion-pop-id"),_.contains(v)&&_.removeChild(v)}},[t]),(0,b.jsx)(wG,{isPresent:t,childRef:o,sizeRef:l,pop:a,children:!1===a?e:c.cloneElement(e,{ref:d})})}const TG=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s,anchorX:o,anchorY:l,root:u})=>{const p=fG(AG),d=(0,c.useId)();let h=!0,m=(0,c.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{p.set(e,!0);for(const e of p.values())if(!e)return;r&&r()},register:e=>(p.set(e,!1),()=>p.delete(e))}),[n,p,r]);return a&&h&&(m={...m}),(0,c.useMemo)(()=>{p.forEach((e,t)=>p.set(t,!1))},[n]),c.useEffect(()=>{!n&&!p.size&&r&&r()},[n]),e=(0,b.jsx)(CG,{pop:"popLayout"===s,isPresent:n,anchorX:o,anchorY:l,root:u,children:e}),(0,b.jsx)(bG.Provider,{value:m,children:e})};function AG(){return new Map}function SG(e=!0){const t=(0,c.useContext)(bG);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=(0,c.useId)();(0,c.useEffect)(()=>{if(e)return i(a)},[e]);const s=(0,c.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,s]:[!0]}const EG=e=>e.key||"";function $G(e){const t=[];return c.Children.forEach(e,e=>{(0,c.isValidElement)(e)&&t.push(e)}),t}const RG=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1,anchorX:o="left",anchorY:l="top",root:u})=>{const[p,d]=SG(s),h=(0,c.useMemo)(()=>$G(e),[e]),m=s&&!p?[]:h.map(EG),g=(0,c.useRef)(!0),f=(0,c.useRef)(h),y=fG(()=>new Map),v=(0,c.useRef)(new Set),[_,x]=(0,c.useState)(h),[k,w]=(0,c.useState)(h);yG(()=>{g.current=!1,f.current=h;for(let e=0;e{const c=EG(e),_=!(s&&!p)&&(h===k||m.includes(c));return(0,b.jsx)(TG,{isPresent:_,initial:!(g.current&&!n)&&void 0,custom:t,presenceAffectsLayout:i,mode:a,root:u,onExitComplete:_?void 0:()=>{if(v.current.has(c))return;if(!y.has(c))return;v.current.add(c),y.set(c,!0);let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(T?.(),w(f.current),s&&d?.(),r&&r())},anchorX:o,anchorY:l,children:e},c)})})},LG=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],IG=(()=>new Set([...LG,"pathRotation"]))(),NG=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},DG={...MG,transform:e=>NG(0,1,e)},PG={...MG,default:1},OG=e=>Math.round(1e5*e)/1e5,FG=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,jG=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,BG=(e,t)=>n=>Boolean("string"==typeof n&&jG.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),zG=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,a,s,o]=r.match(FG);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(s),alpha:void 0!==o?parseFloat(o):1}},qG={...MG,transform:e=>Math.round((e=>NG(0,255,e))(e))},UG={test:BG("rgb","red"),parse:zG("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+qG.transform(e)+", "+qG.transform(t)+", "+qG.transform(n)+", "+OG(DG.transform(r))+")"},WG={test:BG("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:UG.transform},VG=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),KG=VG("deg"),GG=VG("%"),ZG=VG("px"),YG=VG("vh"),HG=VG("vw"),XG=(()=>({...GG,parse:e=>GG.parse(e)/100,transform:e=>GG.transform(100*e)}))(),QG={test:BG("hsl","hue"),parse:zG("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+GG.transform(OG(t))+", "+GG.transform(OG(n))+", "+OG(DG.transform(r))+")"},JG={test:e=>UG.test(e)||WG.test(e)||QG.test(e),parse:e=>UG.test(e)?UG.parse(e):QG.test(e)?QG.parse(e):WG.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?UG.transform(e):QG.transform(e),getAnimatableNone:e=>{const t=JG.parse(e);return t.alpha=0,JG.transform(t)}},eZ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,tZ="number",nZ="color",rZ=/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 iZ(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(rZ,e=>(JG.test(e)?(r.color.push(a),i.push(nZ),n.push(JG.parse(e))):e.startsWith("var(")?(r.var.push(a),i.push("var"),n.push(e)):(r.number.push(a),i.push(tZ),n.push(parseFloat(e))),++a,"${}")).split("${}");return{values:n,split:s,indexes:r,types:i}}function aZ({split:e,types:t}){const n=e.length;return r=>{let i="";for(let a=0;a0},parse:function(e){return iZ(e).values},createTransformer:function(e){return aZ(iZ(e))},getAnimatableNone:function(e){const t=iZ(e);return aZ(t)(t.values.map((e,n)=>((e,t)=>{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:JG.test(n)?JG.getAnimatableNone(n):n;var n})(e,t.split[n])))}},oZ=new Set(["brightness","contrast","saturate","opacity"]);function lZ(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(FG)||[];if(!r)return e;const i=n.replace(r,"");let a=oZ.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const cZ=/\b([a-z-]*)\(.*?\)/gu,uZ={...sZ,getAnimatableNone:e=>{const t=e.match(cZ);return t?t.map(lZ).join(" "):e}},pZ={...sZ,getAnimatableNone:e=>{const t=sZ.parse(e);return sZ.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},dZ={...MG,transform:Math.round},hZ={borderWidth:ZG,borderTopWidth:ZG,borderRightWidth:ZG,borderBottomWidth:ZG,borderLeftWidth:ZG,borderRadius:ZG,borderTopLeftRadius:ZG,borderTopRightRadius:ZG,borderBottomRightRadius:ZG,borderBottomLeftRadius:ZG,width:ZG,maxWidth:ZG,height:ZG,maxHeight:ZG,top:ZG,right:ZG,bottom:ZG,left:ZG,inset:ZG,insetBlock:ZG,insetBlockStart:ZG,insetBlockEnd:ZG,insetInline:ZG,insetInlineStart:ZG,insetInlineEnd:ZG,padding:ZG,paddingTop:ZG,paddingRight:ZG,paddingBottom:ZG,paddingLeft:ZG,paddingBlock:ZG,paddingBlockStart:ZG,paddingBlockEnd:ZG,paddingInline:ZG,paddingInlineStart:ZG,paddingInlineEnd:ZG,margin:ZG,marginTop:ZG,marginRight:ZG,marginBottom:ZG,marginLeft:ZG,marginBlock:ZG,marginBlockStart:ZG,marginBlockEnd:ZG,marginInline:ZG,marginInlineStart:ZG,marginInlineEnd:ZG,fontSize:ZG,backgroundPositionX:ZG,backgroundPositionY:ZG,rotate:KG,pathRotation:KG,rotateX:KG,rotateY:KG,rotateZ:KG,scale:PG,scaleX:PG,scaleY:PG,scaleZ:PG,skew:KG,skewX:KG,skewY:KG,distance:ZG,translateX:ZG,translateY:ZG,translateZ:ZG,x:ZG,y:ZG,z:ZG,perspective:ZG,transformPerspective:ZG,opacity:DG,originX:XG,originY:XG,originZ:ZG,zIndex:dZ,fillOpacity:DG,strokeOpacity:DG,numOctaves:dZ},mZ={...hZ,color:JG,backgroundColor:JG,outlineColor:JG,fill:JG,stroke:JG,borderColor:JG,borderTopColor:JG,borderRightColor:JG,borderBottomColor:JG,borderLeftColor:JG,filter:uZ,WebkitFilter:uZ,mask:pZ,WebkitMask:pZ},gZ=e=>mZ[e],fZ=()=>({x:{min:0,max:0},y:{min:0,max:0}}),yZ=e=>Boolean(e&&e.getVelocity),bZ=new Set(["width","height","top","left","right","bottom",...LG]),vZ=e=>t=>t.test(e),_Z=[MG,ZG,GG,KG,HG,YG,{test:e=>"auto"===e,parse:e=>e}],xZ=e=>_Z.find(vZ(e)),kZ=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),wZ=e=>t=>"string"==typeof t&&t.startsWith(e),CZ=wZ("--"),TZ=wZ("var(--"),AZ=e=>!!TZ(e)&&SZ.test(e.split("/*")[0].trim()),SZ=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function EZ(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const $Z=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function RZ(e,t,n=1){const[r,i]=function(e){const t=$Z.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return kZ(e)?parseFloat(e):e}return AZ(i)?RZ(i,t,n+1):i}const LZ=e=>180*e/Math.PI,IZ=e=>{const t=LZ(Math.atan2(e[1],e[0]));return MZ(t)},NZ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:IZ,rotateZ:IZ,skewX:e=>LZ(Math.atan(e[1])),skewY:e=>LZ(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},MZ=e=>((e%=360)<0&&(e+=360),e),DZ=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),PZ=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),OZ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:DZ,scaleY:PZ,scale:e=>(DZ(e)+PZ(e))/2,rotateX:e=>MZ(LZ(Math.atan2(e[6],e[5]))),rotateY:e=>MZ(LZ(Math.atan2(-e[2],e[0]))),rotateZ:IZ,rotate:IZ,skewX:e=>LZ(Math.atan(e[4])),skewY:e=>LZ(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function FZ(e){return e.includes("scale")?1:0}function jZ(e,t){if(!e||"none"===e)return FZ(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=OZ,i=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=NZ,i=t}if(!i)return FZ(t);const a=r[t],s=i[1].split(",").map(BZ);return"function"==typeof a?a(s):s[a]}function BZ(e){return parseFloat(e.trim())}const zZ=e=>e===MG||e===ZG,qZ=new Set(["x","y","z"]),UZ=LG.filter(e=>!qZ.has(e)),WZ={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return"border-box"===r?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return"border-box"===r?i:i-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:(e,{transform:t})=>jZ(t,"x"),y:(e,{transform:t})=>jZ(t,"y")};WZ.translateX=WZ.x,WZ.translateY=WZ.y;const VZ=e=>e,KZ={},GZ=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],ZZ={value:null,addProjectionMetrics:null};function YZ(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=GZ.reduce((e,n)=>(e[n]=function(e,t){let n=new Set,r=new Set,i=!1,a=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){s.has(t)&&(u.schedule(t),e()),l++,t(o)}const u={schedule:(e,t=!1,a=!1)=>{const o=a&&i?n:r;return t&&s.add(e),o.add(e),e},cancel:e=>{r.delete(e),s.delete(e)},process:e=>{if(o=e,i)return void(a=!0);i=!0;const s=n;n=r,r=s,n.forEach(c),t&&ZZ.value&&ZZ.value.frameloop[t].push(l),l=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}(a,t?n:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:u,update:p,preRender:d,render:h,postRender:m}=s,g=()=>{const a=KZ.useManualTiming,s=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(s-i.timestamp,40),1)),i.timestamp=s,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),u.process(i),p.process(i),d.process(i),h.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(g))};return{schedule:GZ.reduce((t,a)=>{const o=s[a];return t[a]=(t,a=!1,s=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(g)),o.schedule(t,a,s)),t},{}),cancel:e=>{for(let t=0;te.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return UZ.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.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])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}nY=!1,tY=!1,eY.forEach(e=>e.complete(rY)),eY.clear()}function aY(){eY.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(nY=!0)})}class sY{constructor(e,t,n,r,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(eY.add(this),tY||(tY=!0,HZ.read(aY),HZ.resolveKeyframes(iY))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const i=r?.get(),a=e[e.length-1];if(void 0!==i)e[0]=i;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===i&&r.set(e[0])}!function(e){for(let t=1;t/^0[^.\s]+$/u.test(e);function lY(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||oY(e)}const cY=new Set([uZ,pZ]);function uY(e,t){let n=gZ(e);return cY.has(n)||(n=sZ),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const pY=new Set(["auto","none","0"]);class dY extends sY{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const hY=e=>1e3*e,mY=e=>e/1e3;function gY(e,t){-1===e.indexOf(t)&&e.push(t)}function fY(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class yY{constructor(){this.subscriptions=[]}add(e){return gY(this.subscriptions,e),()=>fY(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;ie.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}function vY(e){let t;return()=>(void 0===t&&(t=e()),t)}const _Y={};function xY(e,t){const n=vY(e);return()=>_Y[t]??n()}const kY=xY(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),wY=e=>null!==e;function CY(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(wY),s=i<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return s&&void 0!==r?r:a[s]}class TY{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const AY={layout:0,mainThread:0,waapi:0},SY=e=>Array.isArray(e)&&"number"==typeof e[0],EY=xY(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),$Y=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let t=0;t`cubic-bezier(${e}, ${t}, ${n}, ${r})`,LY={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:RY([0,.65,.55,1]),circOut:RY([.55,0,1,.45]),backIn:RY([.31,.01,.66,-.59]),backOut:RY([.33,1.53,.69,.99])};function IY(e,t){return e?"function"==typeof e?EY()?$Y(e,t):"ease-out":SY(e)?RY(e):Array.isArray(e)?e.map(e=>IY(e,t)||LY.easeOut):LY[e]:void 0}function NY(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const p=IY(o,i);Array.isArray(p)&&(u.easing=p),ZZ.value&&AY.waapi++;const d={delay:r,duration:i,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:a+1,direction:"reverse"===s?"alternate":"normal"};c&&(d.pseudoElement=c);const h=e.animate(u,d);return ZZ.value&&h.finished.finally(()=>{AY.waapi--}),h}function MY(e){return"function"==typeof e&&"applyToOptions"in e}class DY extends TY{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:s,onComplete:o}=e;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=e,e.type;const l=function({type:e,...t}){return MY(e)&&EY()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=NY(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=CY(r,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(e),bY(t,n,e),this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return mY(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+mY(e)}get time(){return mY(Number(this.animation.currentTime)||0)}set time(e){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=hY(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&kY()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),VZ):r(this)}}const PY=new Set(["opacity","clipPath","filter","transform"]),{schedule:OY,cancel:FY}=YZ(queueMicrotask,!1);let jY;function BY(){jY=void 0}const zY={now:()=>(void 0===jY&&zY.set(QZ.isProcessing||KZ.useManualTiming?QZ.timestamp:performance.now()),jY),set:e=>{jY=e,queueMicrotask(BY)}},qY=(e,t)=>t?e*(1e3/t):0,UY={current:void 0};class WY{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=zY.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=zY.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 yY);const n=this.events[e].add(t);return"change"===e?()=>{n(),HZ.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){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}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()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return UY.current&&UY.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=zY.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return qY(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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function VY(e,t){return new WY(e,t)}const KY=[..._Z,JG,sZ],GY=new WeakMap;function ZY(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function YY(e){return"string"==typeof e||Array.isArray(e)}const HY=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],XY=["initial",...HY];function QY(e){return ZY(e.animate)||XY.some(t=>YY(e[t]))}function JY(e){return Boolean(QY(e)||e.variants)}const eH={current:null},tH={current:!1},nH="undefined"!=typeof window;function rH(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function iH(e,t,n,r){if("function"==typeof t){const[i,a]=rH(r);t=t(void 0!==n?n:e.custom,i,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[i,a]=rH(r);t=t(void 0!==n?n:e.custom,i,a)}return t}const aH=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let sH={};function oH(e){sH=e}class lH{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=sY,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=zY.now();this.renderScheduledAtthis.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(tH.current||function(){if(tH.current=!0,nH)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>eH.current=e.matches;e.addEventListener("change",t),t()}else eH.current=!1}(),this.shouldReduceMotion=eH.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),XZ(this.notifyUpdate),XZ(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(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}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&PY.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:i,ease:a,duration:s}=t.accelerate,o=new DY({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:hY(s)}),l=n(o);return void this.valueSubscriptions.set(e,()=>{l(),o.cancel()})}const n=IG.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&HZ.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}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 sH){const t=sH[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(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;tt.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=VY(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(kZ(n)||oY(n))?n=parseFloat(n):(r=n,!KY.find(vZ(r))&&sZ.test(t)&&(n=uY(e,t))),this.setBaseTarget(e,yZ(n)?n.get():n)),yZ(n)?n.get():n;var r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let n;if("string"==typeof t||"object"==typeof t){const r=iH(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&void 0!==n)return n;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||yZ(r)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new yY),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){OY.render(this.render)}}class cH extends lH{constructor(){super(...arguments),this.KeyframeResolver=dY}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[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;yZ(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function uH(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const pH=(e,t)=>t&&"number"==typeof e?t.transform(e):e,dH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hH=LG.length;function mH(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let s=!1,o=!1;for(const e in t){const n=t[e];if(IG.has(e))s=!0;else if(CZ(e))i[e]=n;else{const t=pH(n,hZ[e]);e.startsWith("origin")?(o=!0,a[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",i=!0;for(let a=0;a"string"==typeof e&&"svg"===e.toLowerCase();function xH(e,{style:t,vars:n},r,i){const a=e.style;let s;for(s in t)a[s]=t[s];for(s in i?.applyProjectionStyles(a,r),n)a.setProperty(s,n[s])}function kH(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wH={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ZG.test(e))return e;e=parseFloat(e)}return`${kH(e,t.target.x)}% ${kH(e,t.target.y)}%`}},CH=(e,t,n)=>e+(t-e)*n,TH={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=sZ.parse(e);if(i.length>5)return r;const a=sZ.createTransformer(e),s="number"!=typeof i[0]?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=o,i[1+s]/=l;const c=CH(o,l,.5);return"number"==typeof i[2+s]&&(i[2+s]/=c),"number"==typeof i[3+s]&&(i[3+s]/=c),a(i)}},AH={borderRadius:{...wH,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wH,borderTopRightRadius:wH,borderBottomLeftRadius:wH,borderBottomRightRadius:wH,boxShadow:TH};function SH(e,{layout:t,layoutId:n}){return IG.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!AH[e]||"opacity"===e)}function EH(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const t in r)(yZ(r[t])||i&&yZ(i[t])||SH(t,e)||void 0!==n?.getValue(t)?.liveStyle)&&(a[t]=r[t]);return a}function $H(e,t,n){const r=EH(e,t,n);for(const n in e)(yZ(e[n])||yZ(t[n]))&&(r[-1!==LG.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}class RH extends cH{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fZ}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(IG.has(t)){const e=gZ(t);return e&&e.default||0}return t=vH.has(t)?t:uH(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return $H(e,t,n)}build(e,t,n){bH(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){xH(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(vH.has(n)?n:uH(n),t.attrs[n])}(e,t,0,r)}mount(e){this.isSVGTag=_H(e.tagName),super.mount(e)}}function LH({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function IH(e){return void 0===e||1===e}function NH({scale:e,scaleX:t,scaleY:n}){return!IH(e)||!IH(t)||!IH(n)}function MH(e){return NH(e)||DH(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function DH(e){return PH(e.x)||PH(e.y)}function PH(e){return e&&"0%"!==e}function OH(e,t,n){return n+t*(e-n)}function FH(e,t,n,r,i){return void 0!==i&&(e=OH(e,i,r)),OH(e,n,r)+t}function jH(e,t=0,n=1,r,i){e.min=FH(e.min,t,n,r,i),e.max=FH(e.max,t,n,r,i)}function BH(e,{x:t,y:n}){jH(e.x,t.translate,t.scale,t.originPoint),jH(e.y,n.translate,n.scale,n.originPoint)}const zH=.999999999999,qH=1.0000000000001;function UH(e,t){e.min+=t,e.max+=t}function WH(e,t,n,r,i=.5){jH(e,t,n,CH(e.min,e.max,i),r)}function VH(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function KH(e,t,n){const r=n??e;WH(e.x,VH(t.x,r.x),t.scaleX,t.scale,t.originX),WH(e.y,VH(t.y,r.y),t.scaleY,t.scale,t.originY)}function GH(e,t){return LH(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}class ZH extends cH{constructor(){super(...arguments),this.type="html",this.renderInstance=xH}readValueFromInstance(e,t){if(IG.has(t))return this.projection?.isProjecting?FZ(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return jZ(n,t)})(e,t);{const r=(n=e,window.getComputedStyle(n)),i=(CZ(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return GH(e,t)}build(e,t,n){mH(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return EH(e,t,n)}}const YH=["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 HH(e){return"string"==typeof e&&!e.includes("-")&&!!(YH.indexOf(e)>-1||/[A-Z]/u.test(e))}const XH=(e,t)=>t.isSVG??HH(e)?new RH(t):new ZH(t,{allowProjection:e!==c.Fragment}),QH=(0,c.createContext)({strict:!1}),JH=(0,c.createContext)({});function eX(e){return Array.isArray(e)?e.join(" "):e}function tX(e,t,n){for(const r in t)yZ(t[r])||SH(r,n)||(e[r]=t[r])}function nX(e,t){const n={},r=function(e,t){const n={};return tX(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,c.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return mH(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.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=r,n}function rX(e,t,n,r){const i=(0,c.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return bH(n,t,_H(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};tX(t,e.style,e),i.style={...t,...i.style}}return i}const iX=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","propagate","ignoreStrict","viewport"]);function aX(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||iX.has(e)}let sX=e=>!aX(e);try{"function"==typeof(oX=require("@emotion/is-prop-valid").default)&&(sX=e=>e.startsWith("on")?!aX(e):oX(e))}catch{}var oX;function lX(e,t,n,{latestValues:r},i,a=!1,s){const o=(s??HH(e)?rX:nX)(t,r,i,e),l=function(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||yZ(e[i])||(sX(i)||!0===n&&aX(i)||!t&&!aX(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(t,"string"==typeof e,a),u=e!==c.Fragment?{...l,...o,ref:n}:{},{children:p}=t,d=(0,c.useMemo)(()=>yZ(p)?p.get():p,[p]);return(0,c.createElement)(e,{...u,children:d})}function cX(e){return yZ(e)?e.get():e}function uX(e,t,n,r){const i={},a=r(e,{});for(const e in a)i[e]=cX(a[e]);let{initial:s,animate:o}=e;const l=QY(e),c=JY(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===o&&(o=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const p=u?o:s;if(p&&"boolean"!=typeof p&&!ZY(p)){const t=Array.isArray(p)?p:[p];for(let n=0;n(t,n)=>{const r=(0,c.useContext)(JH),i=(0,c.useContext)(bG),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:uX(n,r,i,e),renderState:t()}}(e,t,r,i);return n?a():fG(a)},dX=pX({scrapeMotionValuesFromProps:EH,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})}),hX=pX({scrapeMotionValuesFromProps:$H,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}})}),mX={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"]};let gX=!1;function fX(){return function(){if(gX)return;const e={};for(const t in mX)e[t]={isEnabled:e=>mX[t].some(t=>!!e[t])};oH(e),gX=!0}(),sH}const yX=Symbol.for("motionComponentSymbol");function bX(e,t,n){const r=(0,c.useRef)(n);(0,c.useInsertionEffect)(()=>{r.current=n});const i=(0,c.useRef)(null);return(0,c.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());const a=r.current;if("function"==typeof a)if(n){const e=a(n);"function"==typeof e&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}const vX="data-"+uH("framerAppearId"),_X=(0,c.createContext)({});function xX(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function kX(e,t,n,r,i,a){const{visualElement:s}=(0,c.useContext)(JH),o=(0,c.useContext)(QH),l=(0,c.useContext)(bG),u=(0,c.useContext)(xG),p=u.reducedMotion,d=u.skipAnimations,h=(0,c.useRef)(null),m=(0,c.useRef)(!1);r=r||o.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:p,skipAnimations:d,isSVG:a}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,f=(0,c.useContext)(_X);!g||g.projection||!i||"html"!==g.type&&"svg"!==g.type||function(e,t,n,r){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:wX(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:Boolean(s)||o&&xX(o),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(h.current,n,i,f);const y=(0,c.useRef)(!1);(0,c.useInsertionEffect)(()=>{g&&y.current&&g.update(n,l)});const b=n[vX],v=(0,c.useRef)(Boolean(b)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return yG(()=>{m.current=!0,g&&(y.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),v.current&&g.animationState&&g.animationState.animateChanges())}),(0,c.useEffect)(()=>{g&&(!v.current&&g.animationState&&g.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),v.current=!1),g.enteringChildren=void 0)}),g}function wX(e){if(e)return!1!==e.options.allowProjection?e.projection:wX(e.parent)}function CX(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&function(e){const t=fX();for(const n in e)t[n]={...t[n],...e[n]};oH(t)}(r);const a=n?"svg"===n:HH(e),s=a?hX:dX;function o(n,r){let o;const l={...(0,c.useContext)(xG),...n,layoutId:TX(n)},{isStatic:u}=l,p=function(e){const{initial:t,animate:n}=function(e,t){if(QY(e)){const{initial:t,animate:n}=e;return{initial:!1===t||YY(t)?t:void 0,animate:YY(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,c.useContext)(JH));return(0,c.useMemo)(()=>({initial:t,animate:n}),[eX(t),eX(n)])}(n),d=s(n,u);if(!u&&"undefined"!=typeof window){(0,c.useContext)(QH).strict;const t=function(e){const t=fX(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(l);o=t.MeasureLayout,p.visualElement=kX(e,d,l,i,t.ProjectionNode,a)}return(0,b.jsxs)(JH.Provider,{value:p,children:[o&&p.visualElement?(0,b.jsx)(o,{visualElement:p.visualElement,...l}):null,lX(e,n,bX(d,p.visualElement,r),d,u,t,a)]})}o.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;const l=(0,c.forwardRef)(o);return l[yX]=e,l}function TX({layoutId:e}){const t=(0,c.useContext)(gG).id;return t&&void 0!==e?t+"-"+e:e}function AX(e,t){if("undefined"==typeof Proxy)return CX;const n=new Map,r=(n,r)=>CX(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>"create"===a?r:(n.has(a)||n.set(a,CX(a,void 0,e,t)),n.get(a))})}class SX{constructor(e){this.isMounted=!1,this.node=e}update(){}}function EX(e,t,n){const r=e.getProps();return iH(r,t,void 0!==n?n:r.custom,e)}function $X(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function RX(e,t){const n=e?.[t]??e?.default??e;return n!==e?$X(n,e):n}const LX=e=>Array.isArray(e);function IX(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,VY(n))}function NX(e){return LX(e)?e[e.length-1]||0:e}function MX(e,t){const n=e.getValue("willChange");if(r=n,Boolean(yZ(r)&&r.add))return n.add(t);if(!n&&KZ.WillChange){const n=new KZ.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function DX(e){return e.props[vX]}const PX=(...e)=>e.reduce((e,t)=>n=>t(e(n)));function OX(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 FX(e,t){return n=>n>0?t:e}const jX=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},BX=[WG,UG,QG];function zX(e){const t=(n=e,BX.find(e=>e.test(n)));var n;if(Boolean(t),!Boolean(t))return!1;let r=t.parse(e);return t===QG&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,a=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r;i=OX(o,r,e+1/3),a=OX(o,r,e),s=OX(o,r,e-1/3)}else i=a=s=n;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*s),alpha:r}}(r)),r}const qX=(e,t)=>{const n=zX(e),r=zX(t);if(!n||!r)return FX(e,t);const i={...n};return e=>(i.red=jX(n.red,r.red,e),i.green=jX(n.green,r.green,e),i.blue=jX(n.blue,r.blue,e),i.alpha=CH(n.alpha,r.alpha,e),UG.transform(i))},UX=new Set(["none","hidden"]);function WX(e,t){return n=>CH(e,t,n)}function VX(e){return"number"==typeof e?WX:"string"==typeof e?AZ(e)?FX:JG.test(e)?qX:ZX:Array.isArray(e)?KX:"object"==typeof e?JG.test(e)?qX:GX:FX}function KX(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>VX(e)(e,t[n]));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const ZX=(e,t)=>{const n=sZ.createTransformer(t),r=iZ(e),i=iZ(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?UX.has(e)&&!i.values.length||UX.has(t)&&!r.values.length?function(e,t){return UX.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):PX(KX(function(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>HZ.update(t,e),stop:()=>XZ(t),now:()=>QZ.isProcessing?QZ.timestamp:zY.now()}},XX=2e4;function QX(e){let t=0,n=e.next(t);for(;!n.done&&t