@chatsystem/client 2.0.2 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +57 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6037 -5971
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),S=require("react"),Wn=require("react-dom"),ff=require("lottie-react"),hf=require("@lottiefiles/dotlottie-react");function mf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ke=mf(S);var ha=function(e,t){return ha=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},ha(e,t)};function Tt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ha(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ie=function(){return ie=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ie.apply(this,arguments)};function Zr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Rt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Ga(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _r={exports:{}},Oe={};/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
5
|
*
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/var
|
|
8
|
+
*/var js;function pf(){if(js)return Oe;js=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,I=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function N(v){if(typeof v=="object"&&v!==null){var p=v.$$typeof;switch(p){case t:switch(v=v.type,v){case u:case c:case r:case a:case i:case f:return v;default:switch(v=v&&v.$$typeof,v){case o:case d:case y:case m:case s:return v;default:return p}}case n:return p}}}function M(v){return N(v)===c}return Oe.AsyncMode=u,Oe.ConcurrentMode=c,Oe.ContextConsumer=o,Oe.ContextProvider=s,Oe.Element=t,Oe.ForwardRef=d,Oe.Fragment=r,Oe.Lazy=y,Oe.Memo=m,Oe.Portal=n,Oe.Profiler=a,Oe.StrictMode=i,Oe.Suspense=f,Oe.isAsyncMode=function(v){return M(v)||N(v)===u},Oe.isConcurrentMode=M,Oe.isContextConsumer=function(v){return N(v)===o},Oe.isContextProvider=function(v){return N(v)===s},Oe.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===t},Oe.isForwardRef=function(v){return N(v)===d},Oe.isFragment=function(v){return N(v)===r},Oe.isLazy=function(v){return N(v)===y},Oe.isMemo=function(v){return N(v)===m},Oe.isPortal=function(v){return N(v)===n},Oe.isProfiler=function(v){return N(v)===a},Oe.isStrictMode=function(v){return N(v)===i},Oe.isSuspense=function(v){return N(v)===f},Oe.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===r||v===c||v===a||v===i||v===f||v===h||typeof v=="object"&&v!==null&&(v.$$typeof===y||v.$$typeof===m||v.$$typeof===s||v.$$typeof===o||v.$$typeof===d||v.$$typeof===A||v.$$typeof===I||v.$$typeof===w||v.$$typeof===b)},Oe.typeOf=N,Oe}var Le={};/** @license React v16.13.1
|
|
9
9
|
* react-is.development.js
|
|
10
10
|
*
|
|
11
11
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/var Ps;function cf(){return Ps||(Ps=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,I=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function R(Y){return typeof Y=="string"||typeof Y=="function"||Y===r||Y===c||Y===a||Y===i||Y===f||Y===h||typeof Y=="object"&&Y!==null&&(Y.$$typeof===y||Y.$$typeof===m||Y.$$typeof===s||Y.$$typeof===o||Y.$$typeof===d||Y.$$typeof===w||Y.$$typeof===I||Y.$$typeof===v||Y.$$typeof===g)}function M(Y){if(typeof Y=="object"&&Y!==null){var je=Y.$$typeof;switch(je){case t:var Ue=Y.type;switch(Ue){case u:case c:case r:case a:case i:case f:return Ue;default:var et=Ue&&Ue.$$typeof;switch(et){case o:case d:case y:case m:case s:return et;default:return je}}case n:return je}}}var A=u,p=c,L=o,B=s,G=t,N=d,H=r,V=y,j=m,z=n,Z=a,be=i,he=f,le=!1;function we(Y){return le||(le=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),E(Y)||M(Y)===u}function E(Y){return M(Y)===c}function $(Y){return M(Y)===o}function ne(Y){return M(Y)===s}function x(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===t}function J(Y){return M(Y)===d}function ue(Y){return M(Y)===r}function X(Y){return M(Y)===y}function ae(Y){return M(Y)===m}function re(Y){return M(Y)===n}function oe(Y){return M(Y)===a}function ie(Y){return M(Y)===i}function Oe(Y){return M(Y)===f}Re.AsyncMode=A,Re.ConcurrentMode=p,Re.ContextConsumer=L,Re.ContextProvider=B,Re.Element=G,Re.ForwardRef=N,Re.Fragment=H,Re.Lazy=V,Re.Memo=j,Re.Portal=z,Re.Profiler=Z,Re.StrictMode=be,Re.Suspense=he,Re.isAsyncMode=we,Re.isConcurrentMode=E,Re.isContextConsumer=$,Re.isContextProvider=ne,Re.isElement=x,Re.isForwardRef=J,Re.isFragment=ue,Re.isLazy=X,Re.isMemo=ae,Re.isPortal=re,Re.isProfiler=oe,Re.isStrictMode=ie,Re.isSuspense=Oe,Re.isValidElementType=R,Re.typeOf=M})()),Re}var Ms;function ja(){return Ms||(Ms=1,process.env.NODE_ENV==="production"?Er.exports=uf():Er.exports=cf()),Er.exports}var _i,Bs;function lf(){if(Bs)return _i;Bs=1;var e=ja(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=r,a[e.Memo]=i;function s(y){return e.isMemo(y)?i:a[y.$$typeof]||t}var o=Object.defineProperty,u=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;function m(y,g,w){if(typeof g!="string"){if(h){var I=f(g);I&&I!==h&&m(y,I,w)}var v=u(g);c&&(v=v.concat(c(g)));for(var R=s(y),M=s(g),A=0;A<v.length;++A){var p=v[A];if(!n[p]&&!(w&&w[p])&&!(M&&M[p])&&!(R&&R[p])){var L=d(g,p);try{o(y,p,L)}catch{}}}}return y}return _i=m,_i}lf();function $u(e,t,n){if(n===void 0&&(n=Error),!e)throw new n(t)}var Se;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(Se||(Se={}));var He;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(He||(He={}));var wn;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(wn||(wn={}));function Fs(e){return e.type===He.literal}function df(e){return e.type===He.argument}function Wu(e){return e.type===He.number}function Gu(e){return e.type===He.date}function Yu(e){return e.type===He.time}function qu(e){return e.type===He.select}function Xu(e){return e.type===He.plural}function ff(e){return e.type===He.pound}function Qu(e){return e.type===He.tag}function Ku(e){return!!(e&&typeof e=="object"&&e.type===wn.number)}function ua(e){return!!(e&&typeof e=="object"&&e.type===wn.dateTime)}var Ju=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,hf=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function mf(e){var t={};return e.replace(hf,function(n){var r=n.length;switch(n[0]){case"G":t.era=r===4?"long":r===5?"narrow":"short";break;case"y":t.year=r===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=r===4?"long":r===5?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var pf=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function gf(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(pf).filter(function(h){return h.length>0}),n=[],r=0,i=t;r<i.length;r++){var a=i[r],s=a.split("/");if(s.length===0)throw new Error("Invalid number skeleton");for(var o=s[0],u=s.slice(1),c=0,d=u;c<d.length;c++){var f=d[c];if(f.length===0)throw new Error("Invalid number skeleton")}n.push({stem:o,options:u})}return n}function bf(e){return e.replace(/^(.*?)-/,"")}var Us=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Zu=/^(@+)?(\+|#+)?[rs]?$/g,Ef=/(\*)(0+)|(#+)(0+)|(0+)/g,ec=/^(0+)$/;function Hs(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(Zu,function(n,r,i){return typeof i!="string"?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):i==="+"?t.minimumSignificantDigits=r.length:r[0]==="#"?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+(typeof i=="string"?i.length:0)),""}),t}function tc(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Tf(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!ec.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function js(e){var t={},n=tc(e);return n||t}function yf(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=bf(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=te(te(te({},t),{notation:"scientific"}),i.options.reduce(function(u,c){return te(te({},u),js(c))},{}));continue;case"engineering":t=te(te(te({},t),{notation:"engineering"}),i.options.reduce(function(u,c){return te(te({},u),js(c))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Ef,function(u,c,d,f,h,m){if(c)t.minimumIntegerDigits=d.length;else{if(f&&h)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(ec.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Us.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Us,function(u,c,d,f,h,m){return d==="*"?t.minimumFractionDigits=c.length:f&&f[0]==="#"?t.maximumFractionDigits=f.length:h&&m?(t.minimumFractionDigits=h.length,t.maximumFractionDigits=h.length+m.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""});var a=i.options[0];a==="w"?t=te(te({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=te(te({},t),Hs(a)));continue}if(Zu.test(i.stem)){t=te(te({},t),Hs(i.stem));continue}var s=tc(i.stem);s&&(t=te(te({},t),s));var o=Tf(i.stem);o&&(t=te(te({},t),o))}return t}var Tr={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function _f(e,t){for(var n="",r=0;r<e.length;r++){var i=e.charAt(r);if(i==="j"){for(var a=0;r+1<e.length&&e.charAt(r+1)===i;)a++,r++;var s=1+(a&1),o=a<2?1:3+(a>>1),u="a",c=xf(t);for((c=="H"||c=="k")&&(o=0);o-- >0;)n+=u;for(;s-- >0;)n=c+n}else i==="J"?n+="H":n+=i}return n}function xf(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,r;n!=="root"&&(r=e.maximize().region);var i=Tr[r||""]||Tr[n||""]||Tr["".concat(n,"-001")]||Tr["001"];return i[0]}var xi,Sf=new RegExp("^".concat(Ju.source,"*")),Cf=new RegExp("".concat(Ju.source,"*$"));function Ce(e,t){return{start:e,end:t}}var If=!!String.prototype.startsWith&&"_a".startsWith("a",1),Af=!!String.fromCodePoint,wf=!!Object.fromEntries,vf=!!String.prototype.codePointAt,kf=!!String.prototype.trimStart,Nf=!!String.prototype.trimEnd,Rf=!!Number.isSafeInteger,Of=Rf?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ca=!0;try{var Lf=rc("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ca=((xi=Lf.exec("a"))===null||xi===void 0?void 0:xi[0])==="a"}catch{ca=!1}var Vs=If?function(t,n,r){return t.startsWith(n,r)}:function(t,n,r){return t.slice(r,r+n.length)===n},la=Af?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r="",i=t.length,a=0,s;i>a;){if(s=t[a++],s>1114111)throw RangeError(s+" is not a valid code point");r+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return r},zs=wf?Object.fromEntries:function(t){for(var n={},r=0,i=t;r<i.length;r++){var a=i[r],s=a[0],o=a[1];n[s]=o}return n},nc=vf?function(t,n){return t.codePointAt(n)}:function(t,n){var r=t.length;if(!(n<0||n>=r)){var i=t.charCodeAt(n),a;return i<55296||i>56319||n+1===r||(a=t.charCodeAt(n+1))<56320||a>57343?i:(i-55296<<10)+(a-56320)+65536}},Df=kf?function(t){return t.trimStart()}:function(t){return t.replace(Sf,"")},Pf=Nf?function(t){return t.trimEnd()}:function(t){return t.replace(Cf,"")};function rc(e,t){return new RegExp(e,t)}var da;if(ca){var $s=rc("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");da=function(t,n){var r;$s.lastIndex=n;var i=$s.exec(t);return(r=i[1])!==null&&r!==void 0?r:""}}else da=function(t,n){for(var r=[];;){var i=nc(t,n);if(i===void 0||ic(i)||Uf(i))break;r.push(i),n+=i>=65536?2:1}return la.apply(void 0,r)};var Mf=(function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,r){for(var i=[];!this.isEOF();){var a=this.char();if(a===123){var s=this.parseArgument(t,r);if(s.err)return s;i.push(s.val)}else{if(a===125&&t>0)break;if(a===35&&(n==="plural"||n==="selectordinal")){var o=this.clonePosition();this.bump(),i.push({type:He.pound,location:Ce(o,this.clonePosition())})}else if(a===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(Se.UNMATCHED_CLOSING_TAG,Ce(this.clonePosition(),this.clonePosition()))}else if(a===60&&!this.ignoreTag&&fa(this.peek()||0)){var s=this.parseTag(t,n);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,n);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,n){var r=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:He.literal,value:"<".concat(i,"/>"),location:Ce(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var a=this.parseMessage(t+1,n,!0);if(a.err)return a;var s=a.val,o=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!fa(this.char()))return this.error(Se.INVALID_TAG,Ce(o,this.clonePosition()));var u=this.clonePosition(),c=this.parseTagName();return i!==c?this.error(Se.UNMATCHED_CLOSING_TAG,Ce(u,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:He.tag,value:i,children:s,location:Ce(r,this.clonePosition())},err:null}:this.error(Se.INVALID_TAG,Ce(o,this.clonePosition())))}else return this.error(Se.UNCLOSED_TAG,Ce(r,this.clonePosition()))}else return this.error(Se.INVALID_TAG,Ce(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Ff(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var r=this.clonePosition(),i="";;){var a=this.tryParseQuote(n);if(a){i+=a;continue}var s=this.tryParseUnquoted(t,n);if(s){i+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){i+=o;continue}break}var u=Ce(r,this.clonePosition());return{val:{type:He.literal,value:i,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Bf(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(r);this.bump()}return la.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),la(r))},e.prototype.parseArgument=function(t,n){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Se.EXPECT_ARGUMENT_CLOSING_BRACE,Ce(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(Se.EMPTY_ARGUMENT,Ce(r,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(Se.MALFORMED_ARGUMENT,Ce(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Se.EXPECT_ARGUMENT_CLOSING_BRACE,Ce(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:He.argument,value:i,location:Ce(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Se.EXPECT_ARGUMENT_CLOSING_BRACE,Ce(r,this.clonePosition())):this.parseArgumentOptions(t,n,i,r);default:return this.error(Se.MALFORMED_ARGUMENT,Ce(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),r=da(this.message,n),i=n+r.length;this.bumpTo(i);var a=this.clonePosition(),s=Ce(t,a);return{value:r,location:s}},e.prototype.parseArgumentOptions=function(t,n,r,i){var a,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(o){case"":return this.error(Se.EXPECT_ARGUMENT_TYPE,Ce(s,u));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var d=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;var h=Pf(f.val);if(h.length===0)return this.error(Se.EXPECT_ARGUMENT_STYLE,Ce(this.clonePosition(),this.clonePosition()));var m=Ce(d,this.clonePosition());c={style:h,styleLocation:m}}var y=this.tryParseArgumentClose(i);if(y.err)return y;var g=Ce(i,this.clonePosition());if(c&&Vs(c?.style,"::",0)){var w=Df(c.style.slice(2));if(o==="number"){var f=this.parseNumberSkeletonFromString(w,c.styleLocation);return f.err?f:{val:{type:He.number,value:r,location:g,style:f.val},err:null}}else{if(w.length===0)return this.error(Se.EXPECT_DATE_TIME_SKELETON,g);var I=w;this.locale&&(I=_f(w,this.locale));var h={type:wn.dateTime,pattern:I,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?mf(I):{}},v=o==="date"?He.date:He.time;return{val:{type:v,value:r,location:g,style:h},err:null}}}return{val:{type:o==="number"?He.number:o==="date"?He.date:He.time,value:r,location:g,style:(a=c?.style)!==null&&a!==void 0?a:null},err:null}}case"plural":case"selectordinal":case"select":{var R=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Se.EXPECT_SELECT_ARGUMENT_OPTIONS,Ce(R,te({},R)));this.bumpSpace();var M=this.parseIdentifierIfPossible(),A=0;if(o!=="select"&&M.value==="offset"){if(!this.bumpIf(":"))return this.error(Se.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ce(this.clonePosition(),this.clonePosition()));this.bumpSpace();var f=this.tryParseDecimalInteger(Se.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Se.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(f.err)return f;this.bumpSpace(),M=this.parseIdentifierIfPossible(),A=f.val}var p=this.tryParsePluralOrSelectOptions(t,o,n,M);if(p.err)return p;var y=this.tryParseArgumentClose(i);if(y.err)return y;var L=Ce(i,this.clonePosition());return o==="select"?{val:{type:He.select,value:r,options:zs(p.val),location:L},err:null}:{val:{type:He.plural,value:r,options:zs(p.val),offset:A,pluralType:o==="plural"?"cardinal":"ordinal",location:L},err:null}}default:return this.error(Se.INVALID_ARGUMENT_TYPE,Ce(s,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(Se.EXPECT_ARGUMENT_CLOSING_BRACE,Ce(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Se.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Ce(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var r=[];try{r=gf(t)}catch{return this.error(Se.INVALID_NUMBER_SKELETON,n)}return{val:{type:wn.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?yf(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,r,i){for(var a,s=!1,o=[],u=new Set,c=i.value,d=i.location;;){if(c.length===0){var f=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(Se.EXPECT_PLURAL_ARGUMENT_SELECTOR,Se.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;d=Ce(f,this.clonePosition()),c=this.message.slice(f.offset,this.offset())}else break}if(u.has(c))return this.error(n==="select"?Se.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Se.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,d);c==="other"&&(s=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?Se.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Se.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Ce(this.clonePosition(),this.clonePosition()));var y=this.parseMessage(t+1,n,r);if(y.err)return y;var g=this.tryParseArgumentClose(m);if(g.err)return g;o.push([c,{value:y.val,location:Ce(m,this.clonePosition())}]),u.add(c),this.bumpSpace(),a=this.parseIdentifierIfPossible(),c=a.value,d=a.location}return o.length===0?this.error(n==="select"?Se.EXPECT_SELECT_ARGUMENT_SELECTOR:Se.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ce(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(Se.MISSING_OTHER_CLAUSE,Ce(this.clonePosition(),this.clonePosition())):{val:o,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var a=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)a=!0,s=s*10+(o-48),this.bump();else break}var u=Ce(i,this.clonePosition());return a?(s*=r,Of(s)?{val:s,err:null}:this.error(n,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=nc(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Vs(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var n=this.offset(),r=this.message.indexOf(t,n);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ic(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),r=this.message.charCodeAt(n+(t>=65536?2:1));return r??null},e})();function fa(e){return e>=97&&e<=122||e>=65&&e<=90}function Bf(e){return fa(e)||e===47}function Ff(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function ic(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Uf(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function ha(e){e.forEach(function(t){if(delete t.location,qu(t)||Xu(t))for(var n in t.options)delete t.options[n].location,ha(t.options[n].value);else Wu(t)&&Ku(t.style)||(Gu(t)||Yu(t))&&ua(t.style)?delete t.style.location:Qu(t)&&ha(t.children)})}function Hf(e,t){t===void 0&&(t={}),t=te({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Mf(e,t).parse();if(n.err){var r=SyntaxError(Se[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t?.captureLocation||ha(n.val),n.val}function kt(e,t){var n=t&&t.cache?t.cache:Gf,r=t&&t.serializer?t.serializer:Wf,i=t&&t.strategy?t.strategy:zf;return i(e,{cache:n,serializer:r})}function jf(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Vf(e,t,n,r){var i=jf(r)?r:n(r),a=t.get(i);return typeof a>"u"&&(a=e.call(this,r),t.set(i,a)),a}function ac(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),a=t.get(i);return typeof a>"u"&&(a=e.apply(this,r),t.set(i,a)),a}function sc(e,t,n,r,i){return n.bind(t,e,r,i)}function zf(e,t){var n=e.length===1?Vf:ac;return sc(e,this,n,t.cache.create(),t.serializer)}function $f(e,t){return sc(e,this,ac,t.cache.create(),t.serializer)}var Wf=function(){return JSON.stringify(arguments)};function Va(){this.cache=Object.create(null)}Va.prototype.get=function(e){return this.cache[e]};Va.prototype.set=function(e,t){this.cache[e]=t};var Gf={create:function(){return new Va}},Nt={variadic:$f},Dt;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Dt||(Dt={}));var Qt=(function(e){yt(t,e);function t(n,r,i){var a=e.call(this,n)||this;return a.code=r,a.originalMessage=i,a}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error),Ws=(function(e){yt(t,e);function t(n,r,i,a){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Dt.INVALID_VALUE,a)||this}return t})(Qt),Yf=(function(e){yt(t,e);function t(n,r,i){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),Dt.INVALID_VALUE,i)||this}return t})(Qt),qf=(function(e){yt(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),Dt.MISSING_VALUE,r)||this}return t})(Qt),nt;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(nt||(nt={}));function Xf(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==nt.literal||n.type!==nt.literal?t.push(n):r.value+=n.value,t},[])}function oc(e){return typeof e=="function"}function Or(e,t,n,r,i,a,s){if(e.length===1&&Fs(e[0]))return[{type:nt.literal,value:e[0].value}];for(var o=[],u=0,c=e;u<c.length;u++){var d=c[u];if(Fs(d)){o.push({type:nt.literal,value:d.value});continue}if(ff(d)){typeof a=="number"&&o.push({type:nt.literal,value:n.getNumberFormat(t).format(a)});continue}var f=d.value;if(!(i&&f in i))throw new qf(f,s);var h=i[f];if(df(d)){(!h||typeof h=="string"||typeof h=="number")&&(h=typeof h=="string"||typeof h=="number"?String(h):""),o.push({type:typeof h=="string"?nt.literal:nt.object,value:h});continue}if(Gu(d)){var m=typeof d.style=="string"?r.date[d.style]:ua(d.style)?d.style.parsedOptions:void 0;o.push({type:nt.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(Yu(d)){var m=typeof d.style=="string"?r.time[d.style]:ua(d.style)?d.style.parsedOptions:r.time.medium;o.push({type:nt.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(Wu(d)){var m=typeof d.style=="string"?r.number[d.style]:Ku(d.style)?d.style.parsedOptions:void 0;m&&m.scale&&(h=h*(m.scale||1)),o.push({type:nt.literal,value:n.getNumberFormat(t,m).format(h)});continue}if(Qu(d)){var y=d.children,g=d.value,w=i[g];if(!oc(w))throw new Yf(g,"function",s);var I=Or(y,t,n,r,i,a),v=w(I.map(function(A){return A.value}));Array.isArray(v)||(v=[v]),o.push.apply(o,v.map(function(A){return{type:typeof A=="string"?nt.literal:nt.object,value:A}}))}if(qu(d)){var R=d.options[h]||d.options.other;if(!R)throw new Ws(d.value,h,Object.keys(d.options),s);o.push.apply(o,Or(R.value,t,n,r,i));continue}if(Xu(d)){var R=d.options["=".concat(h)];if(!R){if(!Intl.PluralRules)throw new Qt(`Intl.PluralRules is not available in this environment.
|
|
15
|
+
*/var Vs;function gf(){return Vs||(Vs=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,I=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function N(Q){return typeof Q=="string"||typeof Q=="function"||Q===r||Q===c||Q===a||Q===i||Q===f||Q===h||typeof Q=="object"&&Q!==null&&(Q.$$typeof===y||Q.$$typeof===m||Q.$$typeof===s||Q.$$typeof===o||Q.$$typeof===d||Q.$$typeof===A||Q.$$typeof===I||Q.$$typeof===w||Q.$$typeof===b)}function M(Q){if(typeof Q=="object"&&Q!==null){var ke=Q.$$typeof;switch(ke){case t:var je=Q.type;switch(je){case u:case c:case r:case a:case i:case f:return je;default:var qe=je&&je.$$typeof;switch(qe){case o:case d:case y:case m:case s:return qe;default:return ke}}case n:return ke}}}var v=u,p=c,O=o,B=s,X=t,k=d,U=r,W=y,H=m,G=n,ee=a,pe=i,ge=f,we=!1;function ve(Q){return we||(we=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),E(Q)||M(Q)===u}function E(Q){return M(Q)===c}function z(Q){return M(Q)===o}function K(Q){return M(Q)===s}function x(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===t}function ne(Q){return M(Q)===d}function re(Q){return M(Q)===r}function J(Q){return M(Q)===y}function se(Q){return M(Q)===m}function oe(Q){return M(Q)===n}function fe(Q){return M(Q)===a}function te(Q){return M(Q)===i}function De(Q){return M(Q)===f}Le.AsyncMode=v,Le.ConcurrentMode=p,Le.ContextConsumer=O,Le.ContextProvider=B,Le.Element=X,Le.ForwardRef=k,Le.Fragment=U,Le.Lazy=W,Le.Memo=H,Le.Portal=G,Le.Profiler=ee,Le.StrictMode=pe,Le.Suspense=ge,Le.isAsyncMode=ve,Le.isConcurrentMode=E,Le.isContextConsumer=z,Le.isContextProvider=K,Le.isElement=x,Le.isForwardRef=ne,Le.isFragment=re,Le.isLazy=J,Le.isMemo=se,Le.isPortal=oe,Le.isProfiler=fe,Le.isStrictMode=te,Le.isSuspense=De,Le.isValidElementType=N,Le.typeOf=M})()),Le}var zs;function Ya(){return zs||(zs=1,process.env.NODE_ENV==="production"?_r.exports=pf():_r.exports=gf()),_r.exports}var Ai,$s;function bf(){if($s)return Ai;$s=1;var e=Ya(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=r,a[e.Memo]=i;function s(y){return e.isMemo(y)?i:a[y.$$typeof]||t}var o=Object.defineProperty,u=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;function m(y,b,A){if(typeof b!="string"){if(h){var I=f(b);I&&I!==h&&m(y,I,A)}var w=u(b);c&&(w=w.concat(c(b)));for(var N=s(y),M=s(b),v=0;v<w.length;++v){var p=w[v];if(!n[p]&&!(A&&A[p])&&!(M&&M[p])&&!(N&&N[p])){var O=d(b,p);try{o(y,p,O)}catch{}}}}return y}return Ai=m,Ai}bf();function Ku(e,t,n){if(n===void 0&&(n=Error),!e)throw new n(t)}var xe;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(xe||(xe={}));var He;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(He||(He={}));var An;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(An||(An={}));function Ws(e){return e.type===He.literal}function Ef(e){return e.type===He.argument}function Ju(e){return e.type===He.number}function Zu(e){return e.type===He.date}function ec(e){return e.type===He.time}function tc(e){return e.type===He.select}function nc(e){return e.type===He.plural}function Tf(e){return e.type===He.pound}function rc(e){return e.type===He.tag}function ic(e){return!!(e&&typeof e=="object"&&e.type===An.number)}function ma(e){return!!(e&&typeof e=="object"&&e.type===An.dateTime)}var ac=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,yf=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function _f(e){var t={};return e.replace(yf,function(n){var r=n.length;switch(n[0]){case"G":t.era=r===4?"long":r===5?"narrow":"short";break;case"y":t.year=r===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=r===4?"long":r===5?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var xf=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Sf(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(xf).filter(function(h){return h.length>0}),n=[],r=0,i=t;r<i.length;r++){var a=i[r],s=a.split("/");if(s.length===0)throw new Error("Invalid number skeleton");for(var o=s[0],u=s.slice(1),c=0,d=u;c<d.length;c++){var f=d[c];if(f.length===0)throw new Error("Invalid number skeleton")}n.push({stem:o,options:u})}return n}function Cf(e){return e.replace(/^(.*?)-/,"")}var Gs=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,sc=/^(@+)?(\+|#+)?[rs]?$/g,If=/(\*)(0+)|(#+)(0+)|(0+)/g,oc=/^(0+)$/;function Ys(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(sc,function(n,r,i){return typeof i!="string"?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):i==="+"?t.minimumSignificantDigits=r.length:r[0]==="#"?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+(typeof i=="string"?i.length:0)),""}),t}function uc(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Af(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!oc.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function qs(e){var t={},n=uc(e);return n||t}function wf(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=Cf(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=ie(ie(ie({},t),{notation:"scientific"}),i.options.reduce(function(u,c){return ie(ie({},u),qs(c))},{}));continue;case"engineering":t=ie(ie(ie({},t),{notation:"engineering"}),i.options.reduce(function(u,c){return ie(ie({},u),qs(c))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(If,function(u,c,d,f,h,m){if(c)t.minimumIntegerDigits=d.length;else{if(f&&h)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(oc.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Gs.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Gs,function(u,c,d,f,h,m){return d==="*"?t.minimumFractionDigits=c.length:f&&f[0]==="#"?t.maximumFractionDigits=f.length:h&&m?(t.minimumFractionDigits=h.length,t.maximumFractionDigits=h.length+m.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""});var a=i.options[0];a==="w"?t=ie(ie({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=ie(ie({},t),Ys(a)));continue}if(sc.test(i.stem)){t=ie(ie({},t),Ys(i.stem));continue}var s=uc(i.stem);s&&(t=ie(ie({},t),s));var o=Af(i.stem);o&&(t=ie(ie({},t),o))}return t}var xr={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function vf(e,t){for(var n="",r=0;r<e.length;r++){var i=e.charAt(r);if(i==="j"){for(var a=0;r+1<e.length&&e.charAt(r+1)===i;)a++,r++;var s=1+(a&1),o=a<2?1:3+(a>>1),u="a",c=kf(t);for((c=="H"||c=="k")&&(o=0);o-- >0;)n+=u;for(;s-- >0;)n=c+n}else i==="J"?n+="H":n+=i}return n}function kf(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,r;n!=="root"&&(r=e.maximize().region);var i=xr[r||""]||xr[n||""]||xr["".concat(n,"-001")]||xr["001"];return i[0]}var wi,Nf=new RegExp("^".concat(ac.source,"*")),Rf=new RegExp("".concat(ac.source,"*$"));function Ce(e,t){return{start:e,end:t}}var Of=!!String.prototype.startsWith&&"_a".startsWith("a",1),Lf=!!String.fromCodePoint,Df=!!Object.fromEntries,Pf=!!String.prototype.codePointAt,Mf=!!String.prototype.trimStart,Bf=!!String.prototype.trimEnd,Ff=!!Number.isSafeInteger,Uf=Ff?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},pa=!0;try{var Hf=lc("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");pa=((wi=Hf.exec("a"))===null||wi===void 0?void 0:wi[0])==="a"}catch{pa=!1}var Xs=Of?function(t,n,r){return t.startsWith(n,r)}:function(t,n,r){return t.slice(r,r+n.length)===n},ga=Lf?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r="",i=t.length,a=0,s;i>a;){if(s=t[a++],s>1114111)throw RangeError(s+" is not a valid code point");r+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return r},Qs=Df?Object.fromEntries:function(t){for(var n={},r=0,i=t;r<i.length;r++){var a=i[r],s=a[0],o=a[1];n[s]=o}return n},cc=Pf?function(t,n){return t.codePointAt(n)}:function(t,n){var r=t.length;if(!(n<0||n>=r)){var i=t.charCodeAt(n),a;return i<55296||i>56319||n+1===r||(a=t.charCodeAt(n+1))<56320||a>57343?i:(i-55296<<10)+(a-56320)+65536}},jf=Mf?function(t){return t.trimStart()}:function(t){return t.replace(Nf,"")},Vf=Bf?function(t){return t.trimEnd()}:function(t){return t.replace(Rf,"")};function lc(e,t){return new RegExp(e,t)}var ba;if(pa){var Ks=lc("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ba=function(t,n){var r;Ks.lastIndex=n;var i=Ks.exec(t);return(r=i[1])!==null&&r!==void 0?r:""}}else ba=function(t,n){for(var r=[];;){var i=cc(t,n);if(i===void 0||dc(i)||Gf(i))break;r.push(i),n+=i>=65536?2:1}return ga.apply(void 0,r)};var zf=(function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,r){for(var i=[];!this.isEOF();){var a=this.char();if(a===123){var s=this.parseArgument(t,r);if(s.err)return s;i.push(s.val)}else{if(a===125&&t>0)break;if(a===35&&(n==="plural"||n==="selectordinal")){var o=this.clonePosition();this.bump(),i.push({type:He.pound,location:Ce(o,this.clonePosition())})}else if(a===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(xe.UNMATCHED_CLOSING_TAG,Ce(this.clonePosition(),this.clonePosition()))}else if(a===60&&!this.ignoreTag&&Ea(this.peek()||0)){var s=this.parseTag(t,n);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,n);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,n){var r=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:He.literal,value:"<".concat(i,"/>"),location:Ce(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var a=this.parseMessage(t+1,n,!0);if(a.err)return a;var s=a.val,o=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Ea(this.char()))return this.error(xe.INVALID_TAG,Ce(o,this.clonePosition()));var u=this.clonePosition(),c=this.parseTagName();return i!==c?this.error(xe.UNMATCHED_CLOSING_TAG,Ce(u,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:He.tag,value:i,children:s,location:Ce(r,this.clonePosition())},err:null}:this.error(xe.INVALID_TAG,Ce(o,this.clonePosition())))}else return this.error(xe.UNCLOSED_TAG,Ce(r,this.clonePosition()))}else return this.error(xe.INVALID_TAG,Ce(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Wf(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var r=this.clonePosition(),i="";;){var a=this.tryParseQuote(n);if(a){i+=a;continue}var s=this.tryParseUnquoted(t,n);if(s){i+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){i+=o;continue}break}var u=Ce(r,this.clonePosition());return{val:{type:He.literal,value:i,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!$f(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(r);this.bump()}return ga.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),ga(r))},e.prototype.parseArgument=function(t,n){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(xe.EXPECT_ARGUMENT_CLOSING_BRACE,Ce(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(xe.EMPTY_ARGUMENT,Ce(r,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(xe.MALFORMED_ARGUMENT,Ce(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(xe.EXPECT_ARGUMENT_CLOSING_BRACE,Ce(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:He.argument,value:i,location:Ce(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(xe.EXPECT_ARGUMENT_CLOSING_BRACE,Ce(r,this.clonePosition())):this.parseArgumentOptions(t,n,i,r);default:return this.error(xe.MALFORMED_ARGUMENT,Ce(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),r=ba(this.message,n),i=n+r.length;this.bumpTo(i);var a=this.clonePosition(),s=Ce(t,a);return{value:r,location:s}},e.prototype.parseArgumentOptions=function(t,n,r,i){var a,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(o){case"":return this.error(xe.EXPECT_ARGUMENT_TYPE,Ce(s,u));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var d=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;var h=Vf(f.val);if(h.length===0)return this.error(xe.EXPECT_ARGUMENT_STYLE,Ce(this.clonePosition(),this.clonePosition()));var m=Ce(d,this.clonePosition());c={style:h,styleLocation:m}}var y=this.tryParseArgumentClose(i);if(y.err)return y;var b=Ce(i,this.clonePosition());if(c&&Xs(c?.style,"::",0)){var A=jf(c.style.slice(2));if(o==="number"){var f=this.parseNumberSkeletonFromString(A,c.styleLocation);return f.err?f:{val:{type:He.number,value:r,location:b,style:f.val},err:null}}else{if(A.length===0)return this.error(xe.EXPECT_DATE_TIME_SKELETON,b);var I=A;this.locale&&(I=vf(A,this.locale));var h={type:An.dateTime,pattern:I,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?_f(I):{}},w=o==="date"?He.date:He.time;return{val:{type:w,value:r,location:b,style:h},err:null}}}return{val:{type:o==="number"?He.number:o==="date"?He.date:He.time,value:r,location:b,style:(a=c?.style)!==null&&a!==void 0?a:null},err:null}}case"plural":case"selectordinal":case"select":{var N=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(xe.EXPECT_SELECT_ARGUMENT_OPTIONS,Ce(N,ie({},N)));this.bumpSpace();var M=this.parseIdentifierIfPossible(),v=0;if(o!=="select"&&M.value==="offset"){if(!this.bumpIf(":"))return this.error(xe.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ce(this.clonePosition(),this.clonePosition()));this.bumpSpace();var f=this.tryParseDecimalInteger(xe.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,xe.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(f.err)return f;this.bumpSpace(),M=this.parseIdentifierIfPossible(),v=f.val}var p=this.tryParsePluralOrSelectOptions(t,o,n,M);if(p.err)return p;var y=this.tryParseArgumentClose(i);if(y.err)return y;var O=Ce(i,this.clonePosition());return o==="select"?{val:{type:He.select,value:r,options:Qs(p.val),location:O},err:null}:{val:{type:He.plural,value:r,options:Qs(p.val),offset:v,pluralType:o==="plural"?"cardinal":"ordinal",location:O},err:null}}default:return this.error(xe.INVALID_ARGUMENT_TYPE,Ce(s,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(xe.EXPECT_ARGUMENT_CLOSING_BRACE,Ce(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(xe.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Ce(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var r=[];try{r=Sf(t)}catch{return this.error(xe.INVALID_NUMBER_SKELETON,n)}return{val:{type:An.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?wf(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,r,i){for(var a,s=!1,o=[],u=new Set,c=i.value,d=i.location;;){if(c.length===0){var f=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(xe.EXPECT_PLURAL_ARGUMENT_SELECTOR,xe.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;d=Ce(f,this.clonePosition()),c=this.message.slice(f.offset,this.offset())}else break}if(u.has(c))return this.error(n==="select"?xe.DUPLICATE_SELECT_ARGUMENT_SELECTOR:xe.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,d);c==="other"&&(s=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?xe.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:xe.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Ce(this.clonePosition(),this.clonePosition()));var y=this.parseMessage(t+1,n,r);if(y.err)return y;var b=this.tryParseArgumentClose(m);if(b.err)return b;o.push([c,{value:y.val,location:Ce(m,this.clonePosition())}]),u.add(c),this.bumpSpace(),a=this.parseIdentifierIfPossible(),c=a.value,d=a.location}return o.length===0?this.error(n==="select"?xe.EXPECT_SELECT_ARGUMENT_SELECTOR:xe.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ce(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(xe.MISSING_OTHER_CLAUSE,Ce(this.clonePosition(),this.clonePosition())):{val:o,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var a=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)a=!0,s=s*10+(o-48),this.bump();else break}var u=Ce(i,this.clonePosition());return a?(s*=r,Uf(s)?{val:s,err:null}:this.error(n,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=cc(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Xs(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var n=this.offset(),r=this.message.indexOf(t,n);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&dc(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),r=this.message.charCodeAt(n+(t>=65536?2:1));return r??null},e})();function Ea(e){return e>=97&&e<=122||e>=65&&e<=90}function $f(e){return Ea(e)||e===47}function Wf(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function dc(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Gf(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function Ta(e){e.forEach(function(t){if(delete t.location,tc(t)||nc(t))for(var n in t.options)delete t.options[n].location,Ta(t.options[n].value);else Ju(t)&&ic(t.style)||(Zu(t)||ec(t))&&ma(t.style)?delete t.style.location:rc(t)&&Ta(t.children)})}function Yf(e,t){t===void 0&&(t={}),t=ie({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new zf(e,t).parse();if(n.err){var r=SyntaxError(xe[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t?.captureLocation||Ta(n.val),n.val}function kt(e,t){var n=t&&t.cache?t.cache:Zf,r=t&&t.serializer?t.serializer:Jf,i=t&&t.strategy?t.strategy:Qf;return i(e,{cache:n,serializer:r})}function qf(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Xf(e,t,n,r){var i=qf(r)?r:n(r),a=t.get(i);return typeof a>"u"&&(a=e.call(this,r),t.set(i,a)),a}function fc(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),a=t.get(i);return typeof a>"u"&&(a=e.apply(this,r),t.set(i,a)),a}function hc(e,t,n,r,i){return n.bind(t,e,r,i)}function Qf(e,t){var n=e.length===1?Xf:fc;return hc(e,this,n,t.cache.create(),t.serializer)}function Kf(e,t){return hc(e,this,fc,t.cache.create(),t.serializer)}var Jf=function(){return JSON.stringify(arguments)};function qa(){this.cache=Object.create(null)}qa.prototype.get=function(e){return this.cache[e]};qa.prototype.set=function(e,t){this.cache[e]=t};var Zf={create:function(){return new qa}},Nt={variadic:Kf},Dt;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Dt||(Dt={}));var Qt=(function(e){Tt(t,e);function t(n,r,i){var a=e.call(this,n)||this;return a.code=r,a.originalMessage=i,a}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error),Js=(function(e){Tt(t,e);function t(n,r,i,a){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Dt.INVALID_VALUE,a)||this}return t})(Qt),eh=(function(e){Tt(t,e);function t(n,r,i){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),Dt.INVALID_VALUE,i)||this}return t})(Qt),th=(function(e){Tt(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),Dt.MISSING_VALUE,r)||this}return t})(Qt),at;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(at||(at={}));function nh(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==at.literal||n.type!==at.literal?t.push(n):r.value+=n.value,t},[])}function mc(e){return typeof e=="function"}function Pr(e,t,n,r,i,a,s){if(e.length===1&&Ws(e[0]))return[{type:at.literal,value:e[0].value}];for(var o=[],u=0,c=e;u<c.length;u++){var d=c[u];if(Ws(d)){o.push({type:at.literal,value:d.value});continue}if(Tf(d)){typeof a=="number"&&o.push({type:at.literal,value:n.getNumberFormat(t).format(a)});continue}var f=d.value;if(!(i&&f in i))throw new th(f,s);var h=i[f];if(Ef(d)){(!h||typeof h=="string"||typeof h=="number")&&(h=typeof h=="string"||typeof h=="number"?String(h):""),o.push({type:typeof h=="string"?at.literal:at.object,value:h});continue}if(Zu(d)){var m=typeof d.style=="string"?r.date[d.style]:ma(d.style)?d.style.parsedOptions:void 0;o.push({type:at.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(ec(d)){var m=typeof d.style=="string"?r.time[d.style]:ma(d.style)?d.style.parsedOptions:r.time.medium;o.push({type:at.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(Ju(d)){var m=typeof d.style=="string"?r.number[d.style]:ic(d.style)?d.style.parsedOptions:void 0;m&&m.scale&&(h=h*(m.scale||1)),o.push({type:at.literal,value:n.getNumberFormat(t,m).format(h)});continue}if(rc(d)){var y=d.children,b=d.value,A=i[b];if(!mc(A))throw new eh(b,"function",s);var I=Pr(y,t,n,r,i,a),w=A(I.map(function(v){return v.value}));Array.isArray(w)||(w=[w]),o.push.apply(o,w.map(function(v){return{type:typeof v=="string"?at.literal:at.object,value:v}}))}if(tc(d)){var N=d.options[h]||d.options.other;if(!N)throw new Js(d.value,h,Object.keys(d.options),s);o.push.apply(o,Pr(N.value,t,n,r,i));continue}if(nc(d)){var N=d.options["=".concat(h)];if(!N){if(!Intl.PluralRules)throw new Qt(`Intl.PluralRules is not available in this environment.
|
|
16
16
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
17
|
-
`,Dt.MISSING_INTL_API,s);var M=n.getPluralRules(t,{type:d.pluralType}).select(h-(d.offset||0));
|
|
17
|
+
`,Dt.MISSING_INTL_API,s);var M=n.getPluralRules(t,{type:d.pluralType}).select(h-(d.offset||0));N=d.options[M]||d.options.other}if(!N)throw new Js(d.value,h,Object.keys(d.options),s);o.push.apply(o,Pr(N.value,t,n,r,i,h-(d.offset||0)));continue}}return nh(o)}function rh(e,t){return t?ie(ie(ie({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=ie(ie({},e[r]),t[r]||{}),n},{})):e}function ih(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=rh(e[r],t[r]),n},ie({},e)):e}function vi(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function ah(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:kt(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,Rt([void 0],n,!1)))},{cache:vi(e.number),strategy:Nt.variadic}),getDateTimeFormat:kt(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,Rt([void 0],n,!1)))},{cache:vi(e.dateTime),strategy:Nt.variadic}),getPluralRules:kt(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,Rt([void 0],n,!1)))},{cache:vi(e.pluralRules),strategy:Nt.variadic})}}var pc=(function(){function e(t,n,r,i){var a=this;if(n===void 0&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var c=a.formatToParts(u);if(c.length===1)return c[0].value;var d=c.reduce(function(f,h){return!f.length||h.type!==at.literal||typeof f[f.length-1]!="string"?f.push(h.value):f[f.length-1]+=h.value,f},[]);return d.length<=1?d[0]||"":d},this.formatToParts=function(u){return Pr(a.ast,a.locales,a.formatters,a.formats,u,void 0,a.message)},this.resolvedOptions=function(){var u;return{locale:((u=a.resolvedLocale)===null||u===void 0?void 0:u.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=i||{};s.formatters;var o=Zr(s,["formatters"]);this.ast=e.__parse(t,ie(ie({},o),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=ih(e.formats,r),this.formatters=i&&i.formatters||ah(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(!(typeof Intl.Locale>"u")){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Yf,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e})(),ln;(function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"})(ln||(ln={}));var or=(function(e){Tt(t,e);function t(n,r,i){var a=this,s=i?i instanceof Error?i:new Error(String(i)):void 0;return a=e.call(this,"[@formatjs/intl Error ".concat(n,"] ").concat(r,`
|
|
18
18
|
`).concat(s?`
|
|
19
19
|
`.concat(s.message,`
|
|
20
|
-
`).concat(s.stack):""))||this,a.code=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(a,t),a}return t})(Error),
|
|
20
|
+
`).concat(s.stack):""))||this,a.code=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(a,t),a}return t})(Error),sh=(function(e){Tt(t,e);function t(n,r){return e.call(this,ln.UNSUPPORTED_FORMATTER,n,r)||this}return t})(or),oh=(function(e){Tt(t,e);function t(n,r){return e.call(this,ln.INVALID_CONFIG,n,r)||this}return t})(or),Zs=(function(e){Tt(t,e);function t(n,r){return e.call(this,ln.MISSING_DATA,n,r)||this}return t})(or),yt=(function(e){Tt(t,e);function t(n,r,i){var a=e.call(this,ln.FORMAT_ERROR,"".concat(n,`
|
|
21
21
|
Locale: `).concat(r,`
|
|
22
|
-
`),i)||this;return a.locale=r,a}return t})(
|
|
22
|
+
`),i)||this;return a.locale=r,a}return t})(or),ki=(function(e){Tt(t,e);function t(n,r,i,a){var s=e.call(this,"".concat(n,`
|
|
23
23
|
MessageID: `).concat(i?.id,`
|
|
24
24
|
Default Message: `).concat(i?.defaultMessage,`
|
|
25
25
|
Description: `).concat(i?.description,`
|
|
26
|
-
`),r,a)||this;return s.descriptor=i,s.locale=r,s}return t})(
|
|
26
|
+
`),r,a)||this;return s.descriptor=i,s.locale=r,s}return t})(yt),uh=(function(e){Tt(t,e);function t(n,r){var i=e.call(this,ln.MISSING_TRANSLATION,'Missing message: "'.concat(n.id,'" for locale "').concat(r,'", using ').concat(n.defaultMessage?"default message (".concat(typeof n.defaultMessage=="string"?n.defaultMessage:n.defaultMessage.map(function(a){var s;return(s=a.value)!==null&&s!==void 0?s:JSON.stringify(a)}).join(),")"):"id"," as fallback."))||this;return i.descriptor=n,i}return t})(or);function hn(e,t,n){return n===void 0&&(n={}),t.reduce(function(r,i){return i in e?r[i]=e[i]:i in n&&(r[i]=n[i]),r},{})}var ch=function(e){process.env.NODE_ENV!=="production"&&console.error(e)},lh=function(e){process.env.NODE_ENV!=="production"&&console.warn(e)},gc={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:ch,onWarn:lh};function bc(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function en(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function dh(e){e===void 0&&(e=bc());var t=Intl.RelativeTimeFormat,n=Intl.ListFormat,r=Intl.DisplayNames,i=kt(function(){for(var o,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return new((o=Intl.DateTimeFormat).bind.apply(o,Rt([void 0],u,!1)))},{cache:en(e.dateTime),strategy:Nt.variadic}),a=kt(function(){for(var o,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return new((o=Intl.NumberFormat).bind.apply(o,Rt([void 0],u,!1)))},{cache:en(e.number),strategy:Nt.variadic}),s=kt(function(){for(var o,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return new((o=Intl.PluralRules).bind.apply(o,Rt([void 0],u,!1)))},{cache:en(e.pluralRules),strategy:Nt.variadic});return{getDateTimeFormat:i,getNumberFormat:a,getMessageFormat:kt(function(o,u,c,d){return new pc(o,u,c,ie({formatters:{getNumberFormat:a,getDateTimeFormat:i,getPluralRules:s}},d||{}))},{cache:en(e.message),strategy:Nt.variadic}),getRelativeTimeFormat:kt(function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return new(t.bind.apply(t,Rt([void 0],o,!1)))},{cache:en(e.relativeTime),strategy:Nt.variadic}),getPluralRules:s,getListFormat:kt(function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return new(n.bind.apply(n,Rt([void 0],o,!1)))},{cache:en(e.list),strategy:Nt.variadic}),getDisplayNames:kt(function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return new(r.bind.apply(r,Rt([void 0],o,!1)))},{cache:en(e.displayNames),strategy:Nt.variadic})}}function Xa(e,t,n,r){var i=e&&e[t],a;if(i&&(a=i[n]),a)return a;r(new sh("No ".concat(t," format named: ").concat(n)))}function Sr(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=ie({timeZone:t},e[r]),n},{})}function eo(e,t){var n=Object.keys(ie(ie({},e),t));return n.reduce(function(r,i){return r[i]=ie(ie({},e[i]||{}),t[i]||{}),r},{})}function to(e,t){if(!t)return e;var n=pc.formats;return ie(ie(ie({},n),e),{date:eo(Sr(n.date,t),Sr(e.date||{},t)),time:eo(Sr(n.time,t),Sr(e.time||{},t))})}var ya=function(e,t,n,r,i){var a=e.locale,s=e.formats,o=e.messages,u=e.defaultLocale,c=e.defaultFormats,d=e.fallbackOnEmptyString,f=e.onError,h=e.timeZone,m=e.defaultRichTextElements;n===void 0&&(n={id:""});var y=n.id,b=n.defaultMessage;Ku(!!y,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var A=String(y),I=o&&Object.prototype.hasOwnProperty.call(o,A)&&o[A];if(Array.isArray(I)&&I.length===1&&I[0].type===He.literal)return I[0].value;if(!r&&I&&typeof I=="string"&&!m)return I.replace(/'\{(.*?)\}'/gi,"{$1}");if(r=ie(ie({},m),r||{}),s=to(s,h),c=to(c,h),!I){if(d===!1&&I==="")return I;if((!b||a&&a.toLowerCase()!==u.toLowerCase())&&f(new uh(n,a)),b)try{var w=t.getMessageFormat(b,u,c,i);return w.format(r)}catch(N){return f(new ki('Error formatting default message for: "'.concat(A,'", rendering default message verbatim'),a,n,N)),typeof b=="string"?b:A}return A}try{var w=t.getMessageFormat(I,a,s,ie({formatters:t},i||{}));return w.format(r)}catch(N){f(new ki('Error formatting message: "'.concat(A,'", using ').concat(b?"default message":"id"," as fallback."),a,n,N))}if(b)try{var w=t.getMessageFormat(b,u,c,i);return w.format(r)}catch(N){f(new ki('Error formatting the default message for: "'.concat(A,'", rendering message verbatim'),a,n,N))}return typeof I=="string"?I:typeof b=="string"?b:A},Ec=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function ei(e,t,n,r){var i=e.locale,a=e.formats,s=e.onError,o=e.timeZone;r===void 0&&(r={});var u=r.format,c=ie(ie({},o&&{timeZone:o}),u&&Xa(a,t,u,s)),d=hn(r,Ec,c);return t==="time"&&!d.hour&&!d.minute&&!d.second&&!d.timeStyle&&!d.dateStyle&&(d=ie(ie({},d),{hour:"numeric",minute:"numeric"})),n(i,d)}function fh(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],a=n[1],s=a===void 0?{}:a,o=typeof i=="string"?new Date(i||0):i;try{return ei(e,"date",t,s).format(o)}catch(u){e.onError(new yt("Error formatting date.",e.locale,u))}return String(o)}function hh(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],a=n[1],s=a===void 0?{}:a,o=typeof i=="string"?new Date(i||0):i;try{return ei(e,"time",t,s).format(o)}catch(u){e.onError(new yt("Error formatting time.",e.locale,u))}return String(o)}function mh(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],a=n[1],s=n[2],o=s===void 0?{}:s,u=e.timeZone,c=e.locale,d=e.onError,f=hn(o,Ec,u?{timeZone:u}:{});try{return t(c,f).formatRange(i,a)}catch(h){d(new yt("Error formatting date time range.",e.locale,h))}return String(i)}function ph(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],a=n[1],s=a===void 0?{}:a,o=typeof i=="string"?new Date(i||0):i;try{return ei(e,"date",t,s).formatToParts(o)}catch(u){e.onError(new yt("Error formatting date.",e.locale,u))}return[]}function gh(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],a=n[1],s=a===void 0?{}:a,o=typeof i=="string"?new Date(i||0):i;try{return ei(e,"time",t,s).formatToParts(o)}catch(u){e.onError(new yt("Error formatting time.",e.locale,u))}return[]}var bh=["style","type","fallback","languageDisplay"];function Eh(e,t,n,r){var i=e.locale,a=e.onError,s=Intl.DisplayNames;s||a(new Qt(`Intl.DisplayNames is not available in this environment.
|
|
27
27
|
Try polyfilling it using "@formatjs/intl-displaynames"
|
|
28
|
-
`,Dt.MISSING_INTL_API));var o=
|
|
28
|
+
`,Dt.MISSING_INTL_API));var o=hn(r,bh);try{return t(i,o).of(n)}catch(u){a(new yt("Error formatting display name.",i,u))}}var Th=["type","style"],no=Date.now();function yh(e){return"".concat(no,"_").concat(e,"_").concat(no)}function _h(e,t,n,r){r===void 0&&(r={});var i=Tc(e,t,n,r).reduce(function(a,s){var o=s.value;return typeof o!="string"?a.push(o):typeof a[a.length-1]=="string"?a[a.length-1]+=o:a.push(o),a},[]);return i.length===1?i[0]:i.length===0?"":i}function Tc(e,t,n,r){var i=e.locale,a=e.onError;r===void 0&&(r={});var s=Intl.ListFormat;s||a(new Qt(`Intl.ListFormat is not available in this environment.
|
|
29
29
|
Try polyfilling it using "@formatjs/intl-listformat"
|
|
30
|
-
`,Dt.MISSING_INTL_API));var o=
|
|
30
|
+
`,Dt.MISSING_INTL_API));var o=hn(r,Th);try{var u={},c=n.map(function(d,f){if(typeof d=="object"){var h=yh(f);return u[h]=d,h}return String(d)});return t(i,o).formatToParts(c).map(function(d){return d.type==="literal"?d:ie(ie({},d),{value:u[d.value]||d.value})})}catch(d){a(new yt("Error formatting list.",i,d))}return n}var xh=["type"];function Sh(e,t,n,r){var i=e.locale,a=e.onError;r===void 0&&(r={}),Intl.PluralRules||a(new Qt(`Intl.PluralRules is not available in this environment.
|
|
31
31
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
32
|
-
`,Dt.MISSING_INTL_API));var s=
|
|
32
|
+
`,Dt.MISSING_INTL_API));var s=hn(r,xh);try{return t(i,s).select(n)}catch(o){a(new yt("Error formatting plural.",i,o))}return"other"}var Ch=["numeric","style"];function Ih(e,t,n){var r=e.locale,i=e.formats,a=e.onError;n===void 0&&(n={});var s=n.format,o=!!s&&Xa(i,"relative",s,a)||{},u=hn(n,Ch,o);return t(r,u)}function Ah(e,t,n,r,i){i===void 0&&(i={}),r||(r="second");var a=Intl.RelativeTimeFormat;a||e.onError(new Qt(`Intl.RelativeTimeFormat is not available in this environment.
|
|
33
33
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
34
|
-
`,Dt.MISSING_INTL_API));try{return
|
|
34
|
+
`,Dt.MISSING_INTL_API));try{return Ih(e,t,i).format(n,r)}catch(s){e.onError(new yt("Error formatting relative time.",e.locale,s))}return String(n)}var wh=["style","currency","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem","trailingZeroDisplay","roundingPriority","roundingIncrement","roundingMode"];function yc(e,t,n){var r=e.locale,i=e.formats,a=e.onError;n===void 0&&(n={});var s=n.format,o=s&&Xa(i,"number",s,a)||{},u=hn(n,wh,o);return t(r,u)}function vh(e,t,n,r){r===void 0&&(r={});try{return yc(e,t,r).format(n)}catch(i){e.onError(new yt("Error formatting number.",e.locale,i))}return String(n)}function kh(e,t,n,r){r===void 0&&(r={});try{return yc(e,t,r).formatToParts(n)}catch(i){e.onError(new yt("Error formatting number.",e.locale,i))}return[]}function Nh(e){var t=e?e[Object.keys(e)[0]]:void 0;return typeof t=="string"}function Rh(e){e.onWarn&&e.defaultRichTextElements&&Nh(e.messages||{})&&e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
35
35
|
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
36
|
-
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function Ih(e,t){var n=ih(t),r=te(te({},cc),e),i=r.locale,a=r.defaultLocale,s=r.onError;return i?!Intl.NumberFormat.supportedLocalesOf(i).length&&s?s(new Gs('Missing locale data for locale: "'.concat(i,'" in Intl.NumberFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(i).length&&s&&s(new Gs('Missing locale data for locale: "'.concat(i,'" in Intl.DateTimeFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(s&&s(new eh('"locale" was not configured, using "'.concat(a,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),r.locale=r.defaultLocale||"en"),Ch(r),te(te({},r),{formatters:n,formatNumber:_h.bind(null,r,n.getNumberFormat),formatNumberToParts:xh.bind(null,r,n.getNumberFormat),formatRelativeTime:Th.bind(null,r,n.getRelativeTimeFormat),formatDate:ah.bind(null,r,n.getDateTimeFormat),formatDateToParts:uh.bind(null,r,n.getDateTimeFormat),formatTime:sh.bind(null,r,n.getDateTimeFormat),formatDateTimeRange:oh.bind(null,r,n.getDateTimeFormat),formatTimeToParts:ch.bind(null,r,n.getDateTimeFormat),formatPlural:gh.bind(null,r,n.getPluralRules),formatMessage:ma.bind(null,r,n),$t:ma.bind(null,r,n),formatList:mh.bind(null,r,n.getListFormat),formatListToParts:fc.bind(null,r,n.getListFormat),formatDisplayName:dh.bind(null,r,n.getDisplayNames)})}function mc(e){$u(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var pc=te(te({},cc),{textComponent:qe.Fragment});function Ah(e){return function(t){return e(qe.Children.toArray(t))}}function wh(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var s=n[a];if(e[s]!==t[s]||!Object.prototype.hasOwnProperty.call(t,s))return!1}return!0}var $a=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=qe.createContext(null)):qe.createContext(null);$a.Consumer;var vh=$a.Provider,kh=vh,Nh=$a;function Kt(){var e=qe.useContext(Nh);return mc(e),e}var pa;(function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"})(pa||(pa={}));var ga;(function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"})(ga||(ga={}));function gc(e){var t=function(n){var r=Kt(),i=n.value,a=n.children,s=Qr(n,["value","children"]),o=typeof i=="string"?new Date(i||0):i,u=e==="formatDate"?r.formatDateToParts(o,s):r.formatTimeToParts(o,s);return a(u)};return t.displayName=ga[e],t}function or(e){var t=function(n){var r=Kt(),i=n.value,a=n.children,s=Qr(n,["value","children"]),o=r[e](i,s);if(typeof a=="function")return a(o);var u=r.textComponent||qe.Fragment;return qe.createElement(u,null,o)};return t.displayName=pa[e],t}function bc(e){return e&&Object.keys(e).reduce(function(t,n){var r=e[n];return t[n]=oc(r)?Ah(r):r,t},{})}var Qs=function(e,t,n,r){for(var i=[],a=4;a<arguments.length;a++)i[a-4]=arguments[a];var s=bc(r),o=ma.apply(void 0,Rt([e,t,n,s],i,!1));return Array.isArray(o)?qe.Children.toArray(o):o},Ks=function(e,t){var n=e.defaultRichTextElements,r=Qr(e,["defaultRichTextElements"]),i=bc(n),a=Ih(te(te(te({},pc),r),{defaultRichTextElements:i}),t),s={locale:a.locale,timeZone:a.timeZone,fallbackOnEmptyString:a.fallbackOnEmptyString,formats:a.formats,defaultLocale:a.defaultLocale,defaultFormats:a.defaultFormats,messages:a.messages,onError:a.onError,defaultRichTextElements:i};return te(te({},a),{formatMessage:Qs.bind(null,s,a.formatters),$t:Qs.bind(null,s,a.formatters)})};function Ii(e){return{locale:e.locale,timeZone:e.timeZone,fallbackOnEmptyString:e.fallbackOnEmptyString,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,onWarn:e.onWarn,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}var Rh=(function(e){yt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.cache=lc(),n.state={cache:n.cache,intl:Ks(Ii(n.props),n.cache),prevConfig:Ii(n.props)},n}return t.getDerivedStateFromProps=function(n,r){var i=r.prevConfig,a=r.cache,s=Ii(n);return wh(i,s)?null:{intl:Ks(s,a),prevConfig:s}},t.prototype.render=function(){return mc(this.state.intl),qe.createElement(kh,{value:this.state.intl},this.props.children)},t.displayName="IntlProvider",t.defaultProps=pc,t})(qe.PureComponent);or("formatDate");or("formatTime");or("formatNumber");or("formatList");or("formatDisplayName");gc("formatDate");gc("formatTime");const Oh={"generic.language.english":"English","generic.language.french":"French","chatbot.placeholder.content":"Message...","chatbot.DiscussionLimitReached.title":"Discussion limit reached","chatbot.DiscussionLimitReached.explaination":"You have used the available AI answers for this discussion. Start a new conversation to continue.","chatbot.DiscussionLimitReached.cta":"Restart","chatbot.error.api.409":"Oups ! The discussion if full. Please start a new one.","chatbot.error.api.429":"⏳ The chatbot is a little busy at the time. Please try again later.","chatbot.error.api.500":"Oops ! There has been an error. Please try again later.","chatbot.chatline.label.user":"You","chatbot.chatline.label.assistant":"Assistant","chatbot.chatline.label.customerSupport":"Customer support","chatbot.chatline.loading.function.genericSearchMessage":"Thinking ...","chatbot.chatline.loading.function.search":"Search","chatbot.chatline.loading.function.extractProductName":"Looking into the cavern","chatbot.chatline.loading.function.suggestProductName":"Consulting the shadocks","chatbot.chatline.loading.function.criteriaDefinition":"Looking for ziboublis","chatbot.chatline.loading.function.searchStock":"Searching Stock","chatbot.chatline.loading.function.step":"Step","chatbot.chatline.loading.stepName.search":"Searching ...","chatbot.chatline.loading.stepName.building":"Building Query ...","chatbot.chatline.loading.stepName.analyzing":"Analyzing ...","chatbot.chatline.loading.stepName.redacting":"Writing answer","chatbot.chatline.loading.cancel":"Cancel","chatbot.chatline.seeRecentMessages":"see recent messages","chatbot.widget.menu.open":"Open chat menu","chatbot.widget.menu.startNewDiscussion":"Start a new discussion","chatbot.widget.close":"Close chat","recordingOverlay.recording":"Recording...","recordingOverlay.cancel":"Cancel","recordingOverlay.explaination":"Tap the mic to stop","chatbot.infobanner.title":"You have an archived discussion.","chatbot.infobanner.cta":"See","chatbot.customerSupport.connecting":"Transferring your request to customer support...","chatbot.customerSupport.connected":"Your request has been sent to Customer Support. It usually takes a few minutes to get a reply. Thank you for waiting.","chatbot.customerSupport.connectionError":"Customer support is not available right now. Please try again later.","chatbot.customerSupport.providerUnavailable":"Customer support received your request, but live replies are temporarily unavailable. Please try again shortly.","chatbot.customerSupport.closed":"Your customer support conversation is now complete. Start a new conversation if you need more help!","chatbot.customerSupport.restart":"Restart","chatbot.customerSupport.fallback.title":"Leave your contact details","chatbot.customerSupport.fallback.description":"Customer support has not replied yet. Leave your email and phone number and we will contact you soon.","chatbot.customerSupport.fallback.email":"Email","chatbot.customerSupport.fallback.phone":"Phone","chatbot.customerSupport.fallback.submit":"Send","chatbot.customerSupport.fallback.submitting":"Sending...","chatbot.customerSupport.fallback.success":"Your contact details have been saved. Customer support will contact you soon.","chatbot.customerSupport.closedHours.title":"Customer support is currently closed","chatbot.customerSupport.closedHours.description":"Leave your email, phone number and request. Customer support will contact you during opening hours.","chatbot.customerSupport.closedHours.schedulePrefix":"Today:","chatbot.customerSupport.closedHours.reason":"Reason for your request","chatbot.customerSupport.closedHours.success":"Your request has been saved. Customer support will contact you during opening hours.","chatbot.customerSupport.fallback.error":"We could not save your contact details. Please try again.","chatbot.interactiveWidget.submitting":"Sending…","chatbot.interactiveWidget.submitted":"Sent","chatbot.interactiveWidget.cancelled":"Cancelled","chatbot.interactiveWidget.unavailable":"This interaction is no longer available.","chatbot.interactiveWidget.preview.notice":"Demo mode — this form reproduces the real experience. Submitting it does not create a request or transmit your answers.","chatbot.interactiveWidget.preview.completed":"You have tested this form. No request was sent and your answers were not transmitted.","chatbot.interactiveWidget.preview.cancelled":"You have closed the demo form. No information was transmitted."},Lh={"generic.language.english":"Anglais","generic.language.french":"Français","chatbot.placeholder.content":"Message...","chatbot.DiscussionLimitReached.title":"Cette conversation est terminée.","chatbot.DiscussionLimitReached.explaination":"Vous avez utilisé les réponses IA disponibles pour cette discussion. Commencez une nouvelle conversation pour continuer.","chatbot.DiscussionLimitReached.cta":"Relancer une nouvelle conversation","chatbot.error.api.409":"Oups ! La discussion est à son maximum. Merci d'en commencer une nouvelle.","chatbot.error.api.429":"⏳ Le robot est un peu occupé actuellement. Merci de réessayer plus tard.","chatbot.error.api.500":"Oups ! Une erreur est survenue. Merci de réessayer plus tard !","chatbot.chatline.label.user":"Vous","chatbot.chatline.label.assistant":"Assistant","chatbot.chatline.label.customerSupport":"Support client","chatbot.chatline.loading.function.search":"Recherche","chatbot.chatline.loading.function.genericSearchMessage":"Je réfléchis ...","chatbot.chatline.loading.function.extractProductName":"Recherche dans la caverne","chatbot.chatline.loading.function.suggestProductName":"Consultation des shadocks","chatbot.chatline.loading.function.criteriaDefinition":"Recherche des ziboublis","chatbot.chatline.loading.function.searchStock":"Recherche en stock","chatbot.chatline.loading.function.step":"Etape","chatbot.chatline.loading.stepName.search":"Recherche ...","chatbot.chatline.loading.stepName.building":"Construction ...","chatbot.chatline.loading.stepName.analyzing":"Analyse ...","chatbot.chatline.loading.stepName.redacting":"Rédaction","chatbot.chatline.loading.cancel":"Annuler","chatbot.chatline.seeRecentMessages":"voir les messages plus récents","chatbot.widget.menu.open":"Ouvrir le menu de discussion","chatbot.widget.menu.startNewDiscussion":"Démarrer une nouvelle discussion","chatbot.widget.close":"Fermer la discussion","recordingOverlay.recording":"Micro activé...","recordingOverlay.cancel":"Annuler","recordingOverlay.explaination":"Appuyez sur le micro pour arrêter","chatbot.infobanner.title":"Vous avez une conversation archivée.","chatbot.infobanner.cta":"Voir","chatbot.customerSupport.connecting":"Transfert de votre demande au support client...","chatbot.customerSupport.connected":"Votre demande a été transmise au support client. Il faut généralement quelques minutes pour obtenir une réponse. Merci de patienter.","chatbot.customerSupport.connectionError":"Le support client n'est pas disponible pour le moment. Merci de réessayer plus tard.","chatbot.customerSupport.providerUnavailable":"Le support client a reçu votre demande, mais les réponses en direct sont temporairement indisponibles. Merci de réessayer dans quelques instants.","chatbot.customerSupport.closed":"Votre échange avec le support client est terminé. Relancez une nouvelle conversation quand vous le souhaitez !","chatbot.customerSupport.restart":"Relancer","chatbot.customerSupport.fallback.title":"Laissez vos coordonnées","chatbot.customerSupport.fallback.description":"Le support client n'a pas encore répondu. Laissez votre email et votre téléphone, nous vous recontacterons prochainement.","chatbot.customerSupport.fallback.email":"Email","chatbot.customerSupport.fallback.phone":"Téléphone","chatbot.customerSupport.fallback.submit":"Envoyer","chatbot.customerSupport.fallback.submitting":"Envoi...","chatbot.customerSupport.fallback.success":"Vos coordonnées ont bien été notées. Le support client vous recontactera prochainement.","chatbot.customerSupport.closedHours.title":"Le support client est actuellement fermé","chatbot.customerSupport.closedHours.description":"Laissez votre email, votre téléphone et le motif de votre demande. Le support client vous recontactera pendant ses horaires d’ouverture.","chatbot.customerSupport.closedHours.schedulePrefix":"Aujourd’hui :","chatbot.customerSupport.closedHours.reason":"Motif de votre demande","chatbot.customerSupport.closedHours.success":"Votre demande a bien été enregistrée. Le support client vous recontactera pendant ses horaires d’ouverture.","chatbot.customerSupport.fallback.error":"Impossible d'enregistrer vos coordonnées. Merci de réessayer.","chatbot.interactiveWidget.submitting":"Envoi…","chatbot.interactiveWidget.submitted":"Envoyé","chatbot.interactiveWidget.cancelled":"Annulé","chatbot.interactiveWidget.unavailable":"Cette interaction n’est plus disponible.","chatbot.interactiveWidget.preview.notice":"Mode démo — ce formulaire reproduit l’expérience réelle. Son envoi ne crée aucune demande et ne transmet pas vos réponses.","chatbot.interactiveWidget.preview.completed":"Vous avez testé ce formulaire. Aucune demande n’a été envoyée et vos réponses n’ont pas été transmises.","chatbot.interactiveWidget.preview.cancelled":"Vous avez fermé le formulaire de démonstration. Aucune information n’a été transmise."};var gt=(e=>(e.FRENCH="fr-FR",e.ENGLISH="en-US",e))(gt||{});const Jr={[gt.ENGLISH]:{translatedText:Oh,pictureName:gt.ENGLISH,langID:0,locale:gt.ENGLISH},[gt.FRENCH]:{translatedText:Lh,pictureName:gt.FRENCH,langID:1,locale:gt.FRENCH}},Dh=Object.keys(Jr);Dh.reduce((e,t)=>{const n=Jr[t];return[...e,n]},[]);const Ph="languageSettings";function Wa(e,t=()=>{}){const n=new Map;let r=!1;function i(a){if(!r)try{const s=e();if(s)return a(s)}catch{r=!0,t()}}return{getItem(a){const s=i(o=>o.getItem(a));return s!==void 0?(s===null?n.delete(a):n.set(a,s),s):n.get(a)??null},setItem(a,s){n.set(a,s),i(o=>o.setItem(a,s))},removeItem(a){n.delete(a),i(s=>s.removeItem(a))}}}const ur=Wa(()=>typeof window>"u"?void 0:window.localStorage),Lt=Wa(()=>typeof sessionStorage>"u"?void 0:sessionStorage),Mh=(e,t)=>{let n,r;return typeof window<"u"&&(r=ur.getItem(Ph)),r&&e?.[r]!==void 0?n=e[r]:(n=e[t],n.isDefault=!0),n},Bh=(e,t)=>{const[n,r]=S.useState(e[t]),i=a=>{Object.keys(e).includes(a?.locale)?r(a):r(e[gt.ENGLISH])};return S.useEffect(()=>{const a=Mh(e,t);a.locale!==t&&r(e[a.locale])},[]),{appCurrentLang:n,handleSetContextCurrentLang:i}},Ec=S.createContext({appCurrentLang:Jr[gt.ENGLISH],setAppCurrentLang:()=>{}}),It={ai:"ai",customerSupport:"customer_support"},_r=1,Js=1440*60*1e3,Zs=32,eo=128e3,Fh=32e3;function to(e){return typeof e=="string"?!0:!e||typeof e!="object"||Array.isArray(e)?!1:Object.entries(e).every(([t,n])=>!["__proto__","constructor","prototype"].includes(t)&&(typeof n=="boolean"||typeof n=="string"))}function no(e){return JSON.stringify(e).length<=Fh}function Tc(e,t){return JSON.stringify([e??"new",t])}class yc{entries=new Map;listeners=new Set;owner=null;storage;prefix;now;constructor(t,n,r=Date.now){this.storage=t,this.prefix=`chatsystem:drafts:v${_r}:${encodeURIComponent(n)}:`,this.now=r}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});setOwner(t){if(this.owner===t)return;const n=this.owner===null?new Map(this.entries):new Map;this.entries.clear(),this.owner=t,t&&this.restore(this.prefix+t);for(const[r,i]of n)this.entries.set(r,i);this.persist(),this.emit()}get(t){const n=this.entries.get(t);if(!(!n||n.expiresAt<=this.now()))return n.value}set(t,n,r=!0){if(to(n)){for(this.entries.delete(t),n!==""&&(typeof n=="string"||Object.keys(n).length>0)&&this.entries.set(t,{value:n,expiresAt:this.now()+Js,persistent:r&&no(n)});this.entries.size>Zs;){const i=this.entries.keys().next().value;if(i===void 0)break;this.entries.delete(i)}this.persist(),this.emit()}}remove(t){this.entries.delete(t)&&(this.persist(),this.emit())}clear(){this.entries.clear(),this.owner&&this.storage.removeItem(this.prefix+this.owner),this.emit()}emit(){this.listeners.forEach(t=>t())}restore(t){const n=this.storage.getItem(t);if(n)try{if(n.length>eo)throw new Error("oversized");const r=JSON.parse(n);if(r?.version!==_r||!Array.isArray(r.entries))throw new Error("invalid");for(const i of r.entries.slice(-Zs)){if(!i||typeof i!="object")continue;const a=typeof i.key=="string"&&i.key.length<=8e3,s=Number.isFinite(i.expiresAt)&&i.expiresAt>this.now()&&i.expiresAt<=this.now()+Js,o=to(i.value)&&no(i.value);!a||!s||!o||this.entries.set(i.key,{value:i.value,expiresAt:i.expiresAt,persistent:!0})}this.persist()}catch{this.storage.removeItem(t)}}persist(){if(!this.owner)return;const t=[...this.entries].filter(([,r])=>r.persistent&&r.expiresAt>this.now()).map(([r,i])=>({key:r,value:i.value,expiresAt:i.expiresAt}));let n=JSON.stringify({version:_r,entries:t});for(;n.length>eo&&t.length;)t.shift(),n=JSON.stringify({version:_r,entries:t});t.length?this.storage.setItem(this.prefix+this.owner,n):this.storage.removeItem(this.prefix+this.owner)}}const Zr=S.createContext({draftStore:new yc(Wa(()=>{}),"standalone-preview"),currentConversation:{items:[],discussionId:null},setCurrentConversation:()=>{},archivedConversation:{items:[],discussionId:null},setArchivedConversation:()=>{},chatboxBootState:{mode:It.ai,customerSupportState:null,reason:"context_default"},setChatboxBootState:()=>{},resetConversationRequestId:0,resetConversation:()=>{}});var tn={},Ai={},Un={},ro;function Ga(){if(ro)return Un;ro=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.isUnknownRecord=void 0;const e=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);return Un.isUnknownRecord=e,Un}var io;function Uh(){return io||(io=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isInteractiveWidgetResultWithinSizeLimit=e.isInteractiveWidgetResult=e.isInteractiveWidgetVersionedRequest=e.isInteractiveWidgetV3Request=e.isInteractiveWidgetV2Request=e.isInteractiveWidgetPresentationWithinSizeLimit=e.isInteractiveWidgetPresentation=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS=e.INTERACTIVE_WIDGET_TYPES=e.INTERACTIVE_WIDGET_RESULT_TOKEN_HEADER=e.parseInteractiveWidgetProtocolVersion=e.INTERACTIVE_WIDGET_VERSION_HEADER=e.SUPPORTED_INTERACTIVE_WIDGET_PROTOCOL_VERSIONS=e.INTERACTIVE_WIDGET_PROTOCOL_V3=e.INTERACTIVE_WIDGET_PROTOCOL_V2=e.INTERACTIVE_WIDGET_PROTOCOL_V1=e.INTERACTIVE_WIDGET_EVENTS=void 0;const t=Ga();e.INTERACTIVE_WIDGET_EVENTS={requested:"interactiveWidget.requested"},e.INTERACTIVE_WIDGET_PROTOCOL_V1=1,e.INTERACTIVE_WIDGET_PROTOCOL_V2=2,e.INTERACTIVE_WIDGET_PROTOCOL_V3=3,e.SUPPORTED_INTERACTIVE_WIDGET_PROTOCOL_VERSIONS=Object.freeze([e.INTERACTIVE_WIDGET_PROTOCOL_V2,e.INTERACTIVE_WIDGET_PROTOCOL_V3]),e.INTERACTIVE_WIDGET_VERSION_HEADER="X-ChatSystem-Interactive-Widget-Version";const n=p=>{const L=Array.isArray(p)?p[0]:p;return e.SUPPORTED_INTERACTIVE_WIDGET_PROTOCOL_VERSIONS.find(B=>L===B||L===String(B))};e.parseInteractiveWidgetProtocolVersion=n,e.INTERACTIVE_WIDGET_RESULT_TOKEN_HEADER="X-ChatSystem-Interactive-Widget-Result-Token",e.INTERACTIVE_WIDGET_TYPES={directChatCustomerSupport:"direct_chat_customer_support",callToAction:"call_to_action",structuredForm:"structured_form",cardList:"card_list",statusSummary:"status_summary",explicitConfirmation:"explicit_confirmation"},e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS={maximumPresentationUtf8Bytes:32*1024,maximumResultUtf8Bytes:16*1024,maximumTextCodeUnits:4096,maximumUrlCodeUnits:2048,maximumIdentifierCodeUnits:128,maximumLabelCodeUnits:256,maximumToolCallIdCodeUnits:255,maximumResultTokenCodeUnits:8192,maximumResultStringCodeUnits:16*1024,maximumActionsPerContainer:4,maximumFieldsPerForm:20,maximumCardsPerList:20,maximumItemsPerCollection:50,maximumResultDataEntries:50,maximumResultArrayItems:50};const r=(p,L)=>Object.keys(p).every(B=>L.includes(B)),i=(p,L=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumTextCodeUnits)=>typeof p=="string"&&p.trim().length>0&&p.length<=L,a=(p,L=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumTextCodeUnits)=>p===void 0||i(p,L),s=p=>{if(!i(p,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumUrlCodeUnits))return!1;try{const L=new URL(p);return L.protocol==="http:"||L.protocol==="https:"}catch{return!1}},o=p=>!(0,t.isUnknownRecord)(p)||!i(p.id,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!i(p.label,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)||p.style!==void 0&&!["primary","secondary","danger"].includes(String(p.style))?!1:p.kind==="open_url"?r(p,["id","label","style","kind","url"])&&s(p.url):(p.kind==="submit"||p.kind==="cancel")&&r(p,["id","label","style","kind"]),u=(p,L=!1)=>L&&p===void 0?!0:Array.isArray(p)&&p.length>0&&p.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumActionsPerContainer&&p.every(o)&&new Set(p.map(B=>B.id)).size===p.length,c=p=>p===void 0||Array.isArray(p)&&p.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumItemsPerCollection&&p.every(L=>(0,t.isUnknownRecord)(L)&&r(L,["label","value"])&&i(L.label,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&i(L.value)),d=p=>{const L=p.minLength,B=p.maxLength;return L!==void 0&&(!Number.isSafeInteger(L)||Number(L)<0)||B!==void 0&&(!Number.isSafeInteger(B)||Number(B)<1||Number(B)>e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumTextCodeUnits)?!1:L===void 0||B===void 0||Number(L)<=Number(B)},f=p=>!(0,t.isUnknownRecord)(p)||!i(p.id,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!i(p.label,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)||p.required!==void 0&&typeof p.required!="boolean"||!a(p.description)?!1:p.type==="checkbox"?r(p,["id","label","required","description","type"]):p.type==="select"?r(p,["id","label","required","description","type","placeholder","options"])&&a(p.placeholder,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&Array.isArray(p.options)&&p.options.length>0&&p.options.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumItemsPerCollection&&p.options.every(L=>(0,t.isUnknownRecord)(L)&&r(L,["value","label"])&&i(L.value,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&i(L.label,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits))&&new Set(p.options.map(L=>L.value)).size===p.options.length:["text","email","tel","textarea"].includes(String(p.type))&&r(p,["id","label","required","description","type","placeholder","minLength","maxLength"])&&a(p.placeholder,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&d(p),h=p=>a(p.title,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(p.description),m=p=>{if(!(0,t.isUnknownRecord)(p))return!1;if(p.type===e.INTERACTIVE_WIDGET_TYPES.callToAction)return r(p,["type","title","description","actions"])&&h(p)&&u(p.actions);if(p.type===e.INTERACTIVE_WIDGET_TYPES.structuredForm)return r(p,["type","title","description","fields","submitLabel","cancelLabel"])&&h(p)&&i(p.submitLabel,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(p.cancelLabel,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&Array.isArray(p.fields)&&p.fields.length>0&&p.fields.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumFieldsPerForm&&p.fields.every(f)&&new Set(p.fields.map(L=>L.id)).size===p.fields.length;if(p.type===e.INTERACTIVE_WIDGET_TYPES.cardList){const L=Array.isArray(p.cards)?p.cards.flatMap(B=>(0,t.isUnknownRecord)(B)&&Array.isArray(B.actions)?B.actions.filter(t.isUnknownRecord).map(G=>G.id).filter(G=>typeof G=="string"):[]):[];return r(p,["type","title","description","cards"])&&h(p)&&Array.isArray(p.cards)&&p.cards.length>0&&p.cards.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumCardsPerList&&p.cards.every(B=>(0,t.isUnknownRecord)(B)&&r(B,["id","title","description","imageUrl","eyebrow","metadata","actions"])&&i(B.id,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)&&i(B.title,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(B.description)&&a(B.eyebrow,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&(B.imageUrl===void 0||s(B.imageUrl))&&c(B.metadata)&&u(B.actions,!0))&&new Set(p.cards.map(B=>B.id)).size===p.cards.length&&new Set(L).size===L.length}return p.type===e.INTERACTIVE_WIDGET_TYPES.statusSummary?r(p,["type","title","description","tone","items","actions"])&&i(p.title,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(p.description)&&(p.tone===void 0||["neutral","info","success","warning","danger"].includes(String(p.tone)))&&c(p.items)&&u(p.actions,!0):p.type===e.INTERACTIVE_WIDGET_TYPES.explicitConfirmation?r(p,["type","title","description","confirmLabel","cancelLabel","tone","details"])&&i(p.title,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(p.description)&&i(p.confirmLabel,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&i(p.cancelLabel,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&(p.tone===void 0||["neutral","danger"].includes(String(p.tone)))&&c(p.details):!1};e.isInteractiveWidgetPresentation=m;const y=p=>{try{const L=JSON.stringify(p);return typeof L=="string"?new TextEncoder().encode(L).byteLength:null}catch{return null}},g=p=>{const L=y(p);return L!==null&&L<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumPresentationUtf8Bytes};e.isInteractiveWidgetPresentationWithinSizeLimit=g;const w=(p,L)=>(0,t.isUnknownRecord)(p)?p.mode==="none"?r(p,["mode"]):p.mode==="local_preview"?L&&r(p,["mode"]):p.mode==="resume_turn"&&r(p,["mode","continuation","resultToken"])&&(0,t.isUnknownRecord)(p.continuation)&&r(p.continuation,["continuationId","expiresAt"])&&i(p.continuation.continuationId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)&&i(p.continuation.expiresAt,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)&&!Number.isNaN(Date.parse(p.continuation.expiresAt))&&i(p.resultToken,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultTokenCodeUnits):!1,I=p=>!(!(0,t.isUnknownRecord)(p)||!r(p,["type","event","protocolVersion","instanceId","widgetType","source","companyId","agentId","discussionId","toolcallId","payload","responsePolicy"])||p.type!=="interactive_widget_request"||p.event!==e.INTERACTIVE_WIDGET_EVENTS.requested||p.protocolVersion!==e.INTERACTIVE_WIDGET_PROTOCOL_V2||!i(p.instanceId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!["llm_tool","client_trigger","system"].includes(String(p.source))||!Number.isSafeInteger(p.companyId)||p.agentId!==null&&!Number.isSafeInteger(p.agentId)||p.discussionId!==null&&!Number.isSafeInteger(p.discussionId)||p.toolcallId!==null&&!i(p.toolcallId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumToolCallIdCodeUnits)||!(0,e.isInteractiveWidgetPresentation)(p.payload)||!(0,e.isInteractiveWidgetPresentationWithinSizeLimit)(p.payload)||p.widgetType!==p.payload.type||!w(p.responsePolicy,!1));e.isInteractiveWidgetV2Request=I;const v=p=>!(!(0,t.isUnknownRecord)(p)||!r(p,["type","event","protocolVersion","instanceId","widgetType","source","companyId","agentId","discussionId","toolcallId","payload","responsePolicy"])||p.type!=="interactive_widget_request"||p.event!==e.INTERACTIVE_WIDGET_EVENTS.requested||p.protocolVersion!==e.INTERACTIVE_WIDGET_PROTOCOL_V3||!i(p.instanceId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!["llm_tool","client_trigger","system"].includes(String(p.source))||!Number.isSafeInteger(p.companyId)||p.agentId!==null&&!Number.isSafeInteger(p.agentId)||p.discussionId!==null&&!Number.isSafeInteger(p.discussionId)||p.toolcallId!==null&&!i(p.toolcallId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumToolCallIdCodeUnits)||!(0,e.isInteractiveWidgetPresentation)(p.payload)||!(0,e.isInteractiveWidgetPresentationWithinSizeLimit)(p.payload)||p.widgetType!==p.payload.type||!w(p.responsePolicy,!0));e.isInteractiveWidgetV3Request=v;const R=p=>(0,e.isInteractiveWidgetV2Request)(p)||(0,e.isInteractiveWidgetV3Request)(p);e.isInteractiveWidgetVersionedRequest=R;const M=p=>(0,t.isUnknownRecord)(p)?p.status==="cancelled"?Object.keys(p).length===1:!r(p,["status","actionId","data"])||p.status!=="submitted"||!i(p.actionId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!(0,t.isUnknownRecord)(p.data)||Object.keys(p.data).length>e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultDataEntries?!1:Object.entries(p.data).every(([L,B])=>{if(!i(L,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits))return!1;const G=Array.isArray(B)?B:[B];return G.length>e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultArrayItems?!1:G.every(N=>N===null||typeof N=="string"&&N.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultStringCodeUnits||typeof N=="boolean"||typeof N=="number"&&Number.isFinite(N))}):!1;e.isInteractiveWidgetResult=M;const A=p=>{const L=y(p);return L!==null&&L<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultUtf8Bytes};e.isInteractiveWidgetResultWithinSizeLimit=A})(Ai)),Ai}var wi={},ao;function Hh(){return ao||(ao=1,Object.defineProperty(wi,"__esModule",{value:!0})),wi}var vi={},so;function jh(){return so||(so=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SUPPORTED_DISCUSSION_RESPONSE_LIMIT_PROTOCOL_VERSIONS=e.DISCUSSION_RESPONSE_LIMIT_PROTOCOL_V1=e.AI_RESPONSE_COMPLETED_EVENT=void 0,e.parseDiscussionResponseLimitProtocolVersion=n,e.isAiResponseCompletedPayload=r;const t=Ga();e.AI_RESPONSE_COMPLETED_EVENT="ai.response.completed",e.DISCUSSION_RESPONSE_LIMIT_PROTOCOL_V1=1,e.SUPPORTED_DISCUSSION_RESPONSE_LIMIT_PROTOCOL_VERSIONS=Object.freeze([e.DISCUSSION_RESPONSE_LIMIT_PROTOCOL_V1]);function n(a){return e.SUPPORTED_DISCUSSION_RESPONSE_LIMIT_PROTOCOL_VERSIONS.find(s=>s===a)}function r(a){return!(0,t.isUnknownRecord)(a)||n(a.protocolVersion)===void 0||!i(a.discussionId)||typeof a.messageId!="string"||a.messageId.trim().length===0||!i(a.completedAiResponseCount)||!i(a.maxAiResponsesPerDiscussion)?!1:a.completedAiResponseCount<=a.maxAiResponsesPerDiscussion}function i(a){return typeof a=="number"&&Number.isSafeInteger(a)&&a>0}})(vi)),vi}var oo;function Vh(){return oo||(oo=1,(function(e){var t=tn&&tn.__createBinding||(Object.create?(function(g,w,I,v){v===void 0&&(v=I);var R=Object.getOwnPropertyDescriptor(w,I);(!R||("get"in R?!w.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return w[I]}}),Object.defineProperty(g,v,R)}):(function(g,w,I,v){v===void 0&&(v=I),g[v]=w[I]})),n=tn&&tn.__exportStar||function(g,w){for(var I in g)I!=="default"&&!Object.prototype.hasOwnProperty.call(w,I)&&t(w,g,I)};Object.defineProperty(e,"__esModule",{value:!0}),e.formatCustomerSupportProviderText=e.parseIdentityGateProtocolVersion=e.IDENTITY_GATE_VERSION_HEADER=e.IDENTITY_GATE_REQUIRED_EVENT=e.IDENTITY_GATE_PROTOCOL_VERSION=e.SUPPORTED_IDENTITY_GATE_PROTOCOL_VERSIONS=e.IDENTITY_GATE_PROTOCOL_V2=e.IDENTITY_GATE_PROTOCOL_V1=e.OutputStreamTypesEnum=e.DIRECT_CHAT_CUSTOMER_SUPPORT_BUSINESS_HOURS_DEFAULT_OPEN_WEEK_DAY_NUMBERS=e.DIRECT_CHAT_CUSTOMER_SUPPORT_BUSINESS_HOURS_WEEK_DAYS=e.DIRECT_CHAT_CUSTOMER_SUPPORT_DEFAULT_BUSINESS_HOURS_TIMEZONE=e.DIRECT_CHAT_CUSTOMER_SUPPORT_FALLBACK_CONTACT_CAPTURE_DEFAULT_TIMEOUT_MINUTES=e.readOptionalNullableString=e.readOptionalString=e.readOptionalNullableNumber=e.readOptionalNumber=e.AgentDisplayFacetRoleType=e.AgentDisplayFacetModeType=void 0,n(Uh(),e),n(Hh(),e),n(Ga(),e),n(jh(),e);var r;(function(g){g.SPRITESHEET="spritesheet",g.LOTTIE="lottie",g.IMAGE="image",g.SVG="svg",g.VIDEO="video"})(r||(e.AgentDisplayFacetModeType=r={}));var i;(function(g){g.LAUNCHER="launcher",g.ASSISTANT="assistant",g.SEARCH="search"})(i||(e.AgentDisplayFacetRoleType=i={}));const a=g=>typeof g=="number"&&Number.isFinite(g)?g:void 0;e.readOptionalNumber=a;const s=g=>g===null?null:(0,e.readOptionalNumber)(g);e.readOptionalNullableNumber=s;const o=g=>typeof g=="string"?g:void 0;e.readOptionalString=o;const u=g=>g===null?null:(0,e.readOptionalString)(g);e.readOptionalNullableString=u,e.DIRECT_CHAT_CUSTOMER_SUPPORT_FALLBACK_CONTACT_CAPTURE_DEFAULT_TIMEOUT_MINUTES=5,e.DIRECT_CHAT_CUSTOMER_SUPPORT_DEFAULT_BUSINESS_HOURS_TIMEZONE="Europe/Paris",e.DIRECT_CHAT_CUSTOMER_SUPPORT_BUSINESS_HOURS_WEEK_DAYS=[{dayOfWeek:1,key:"monday",defaultLabel:"Monday"},{dayOfWeek:2,key:"tuesday",defaultLabel:"Tuesday"},{dayOfWeek:3,key:"wednesday",defaultLabel:"Wednesday"},{dayOfWeek:4,key:"thursday",defaultLabel:"Thursday"},{dayOfWeek:5,key:"friday",defaultLabel:"Friday"},{dayOfWeek:6,key:"saturday",defaultLabel:"Saturday"},{dayOfWeek:7,key:"sunday",defaultLabel:"Sunday"}],e.DIRECT_CHAT_CUSTOMER_SUPPORT_BUSINESS_HOURS_DEFAULT_OPEN_WEEK_DAY_NUMBERS=[1,2,3,4,5];var c;(function(g){g.OUTPUT_STREAM_MESSAGE_START="message_start",g.OUTPUT_STREAM_MESSAGE_DELTA="message_delta",g.OUTPUT_STREAM_MESSAGE_END="message_end",g.OUTPUT_STREAM_CLIENT_EVENT="client_event",g.OUTPUT_STREAM_NUMBER_OF_STEPS_TYPE="number_of_steps",g.OUTPUT_STREAM_CURRENT_STEP_NUMBER_TYPE="current_step_number",g.OUTPUT_STREAM_CURRENT_STEP_NAME_TYPE="current_step_name",g.OUTPUT_STREAM_ERROR="error"})(c||(e.OutputStreamTypesEnum=c={})),e.IDENTITY_GATE_PROTOCOL_V1=1,e.IDENTITY_GATE_PROTOCOL_V2=2,e.SUPPORTED_IDENTITY_GATE_PROTOCOL_VERSIONS=Object.freeze([e.IDENTITY_GATE_PROTOCOL_V1,e.IDENTITY_GATE_PROTOCOL_V2]),e.IDENTITY_GATE_PROTOCOL_VERSION=e.IDENTITY_GATE_PROTOCOL_V1,e.IDENTITY_GATE_REQUIRED_EVENT="identity.required",e.IDENTITY_GATE_VERSION_HEADER="X-ChatSystem-Identity-Gate-Version";const d=g=>{const w=Array.isArray(g)?g[0]:g;return e.SUPPORTED_IDENTITY_GATE_PROTOCOL_VERSIONS.find(I=>w===I||w===String(I))};e.parseIdentityGateProtocolVersion=d;const f={"+1":"👍",thumbsup:"👍","-1":"👎",thumbsdown:"👎",clap:"👏",wave:"👋",raised_hands:"🙌",pray:"🙏",muscle:"💪",ok_hand:"👌",point_up:"☝️",point_down:"👇",point_left:"👈",point_right:"👉",eyes:"👀",brain:"🧠",heart:"❤️",orange_heart:"🧡",yellow_heart:"💛",green_heart:"💚",blue_heart:"💙",purple_heart:"💜",broken_heart:"💔",fire:"🔥",tada:"🎉",sparkles:"✨",star:"⭐",white_check_mark:"✅",heavy_check_mark:"✔️",x:"❌",warning:"⚠️",information_source:"ℹ️",question:"❓",exclamation:"❗",bulb:"💡",memo:"📝",pushpin:"📌",paperclip:"📎",link:"🔗",lock:"🔒",unlock:"🔓",bell:"🔔",phone:"☎️",email:"✉️",incoming_envelope:"📨",package:"📦",truck:"🚚",moneybag:"💰",credit_card:"💳",gift:"🎁",shopping_bags:"🛍️",clock3:"🕒",hourglass_flowing_sand:"⏳",rocket:"🚀",smile:"😄",smiley:"😃",grinning:"😀",slightly_smiling_face:"🙂",wink:"😉",blush:"😊",relaxed:"☺️",heart_eyes:"😍",thinking_face:"🤔",neutral_face:"😐",confused:"😕",worried:"😟",cry:"😢",sob:"😭",sweat_smile:"😅",joy:"😂",rofl:"🤣",upside_down_face:"🙃",sunglasses:"😎",tada_face:"🥳",angry:"😠",rage:"😡",face_with_symbols_on_mouth:"🤬",scream:"😱",zipper_mouth_face:"🤐",skin_tone_2:"🏻",skin_tone_3:"🏼",skin_tone_4:"🏽",skin_tone_5:"🏾",skin_tone_6:"🏿"},h=g=>g.replace(/-/g,"_"),m=g=>g.replace(/:([a-zA-Z0-9_+\-]+):/g,(w,I)=>f[h(I)]??w),y=({text:g,provider:w})=>w==="slack"?m(g):g;e.formatCustomerSupportProviderText=y})(tn)),tn}var K=Vh();const ki=e=>({mode:K.AgentDisplayFacetModeType.SVG,role:e}),zh=()=>({branding:{poweredByChatSystemVisible:!0},interactiveWidgets:{available:[{widgetType:K.INTERACTIVE_WIDGET_TYPES.directChatCustomerSupport,enabled:!0}]},agent:{display:{name:"",CSSRules:"",[K.AgentDisplayFacetRoleType.LAUNCHER]:ki(K.AgentDisplayFacetRoleType.LAUNCHER),[K.AgentDisplayFacetRoleType.ASSISTANT]:ki(K.AgentDisplayFacetRoleType.ASSISTANT),[K.AgentDisplayFacetRoleType.SEARCH]:ki(K.AgentDisplayFacetRoleType.SEARCH)},text:{initialText:"",conversationStarters:[]},customNameToDisplay:"",isAudioAllowed:!0},api:{settings:{maxAiResponsesPerDiscussion:0},tracking:{queryParamToAppend:""}}}),Pt=S.createContext({companySettings:zh(),setCompanySettings:()=>{}}),Ya=()=>{const e=typeof document<"u"&&new URL(document.URL)?.host.includes("localhost:3080"),t=typeof document<"u"&&new URL(document.URL)?.host.includes("localhost:5173");return e||t};class _c{enabled;constructor({isLocalDev:t,shouldDisplayLogs:n}){this.enabled=t||n}log(...t){this.enabled&&console.log(...t)}warn(...t){this.enabled&&console.warn(...t)}error(...t){this.enabled&&console.error(...t)}}let $h=new _c({isLocalDev:Ya(),shouldDisplayLogs:!1});const Wh=e=>new _c({isLocalDev:Ya(),shouldDisplayLogs:!!e}),Vt=()=>$h,Gh=e=>Object.values(gt).includes(e),Yh=(e,t)=>{const n=t??Vt();return Gh(e)?e:(n.warn(`Language ${e} not handled for now. Using ${gt.ENGLISH}.`),gt.ENGLISH)},qh=e=>{const t=new URL(e);if(t.username||t.password)throw new Error("CHAT_SYSTEM_API_URL_MUST_NOT_CONTAIN_CREDENTIALS");const n=t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="[::1]";if(t.protocol!=="https:"&&!(t.protocol==="http:"&&n))throw new Error("CHAT_SYSTEM_API_URL_MUST_USE_HTTPS");if(t.search||t.hash)throw new Error("CHAT_SYSTEM_API_URL_MUST_NOT_CONTAIN_QUERY_OR_HASH");const r=t.pathname.replace(/\/+$/,"");return`${t.origin}${r}`};class dn{constructor(){}static getApiUrl=t=>t!==void 0?qh(t):Ya()?"http://localhost:3001":"https://www.api.chatsystem.ai";static getHeaders=({contentType:t="text/plain"})=>({"Content-Type":t});static getFetchConfig=({contentType:t="text/plain",httpVerb:n="GET",body:r,options:i={}})=>{const a={method:n,headers:this.getHeaders({contentType:t}),...i};return r&&(a.body=JSON.stringify(r)),a}}const xc=S.createContext(null);function Xh({apiUrl:e,children:t}){const n=S.useMemo(()=>dn.getApiUrl(e),[e]);return b.jsx(xc.Provider,{value:n,children:t})}function ei(){return S.useContext(xc)??dn.getApiUrl()}const qa="chatsystem-widget",Qh=1440*60*1e3,Sc=e=>K.isInteractiveWidgetVersionedRequest(e)?e:null;function xr(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function Kh(e){return!(typeof e!="object"||e===null||typeof e.enabled!="boolean"||typeof e.timeoutMinutes!="number"||typeof e.requireEmail!="boolean"||typeof e.requirePhone!="boolean")}function Jh(e){return!(typeof e!="object"||e===null||typeof e.enabled!="boolean"||typeof e.requireEmail!="boolean"||typeof e.requirePhone!="boolean"||typeof e.requireReason!="boolean")}function Zh(e){if(typeof e!="object"||e===null||typeof e.discussionId!="number"||typeof e.reconnectToken!="string"||!xr(e.startedAt)||!xr(e.updatedAt)||e.reconnectTokenExpiresAt!==void 0&&!xr(e.reconnectTokenExpiresAt)||e.closedAt!==void 0&&!xr(e.closedAt)||e.closedReason!==void 0&&typeof e.closedReason!="string")return!1;const t=e.mode??"live_chat";return t==="closed_hours_contact_capture"?!(!["active","closed"].includes(e.status)||typeof e.customerSupportSessionId!="number"||!Jh(e.closedHoursContactCapture)||typeof e.businessHours!="object"||e.businessHours===null||typeof e.businessHours.timezone!="string"||e.businessHours.todayScheduleLabel!==void 0&&typeof e.businessHours.todayScheduleLabel!="string"):!(t!=="live_chat"||!["connecting","active","closed"].includes(e.status)||typeof e.socketUrl!="string"||e.customerSupportSessionId!==void 0&&typeof e.customerSupportSessionId!="number"||e.isWaitingForFirstProviderReply!==void 0&&typeof e.isWaitingForFirstProviderReply!="boolean"||e.fallbackContactCapture!==void 0&&!Kh(e.fallbackContactCapture))}function e0(e){if(typeof e!="object"||e===null||e.userType!=="user"&&e.userType!=="assistant"||"content"in e&&e.content!==void 0&&typeof e.content!="string")return!1;if("metaData"in e&&e.metaData!==void 0){if(typeof e.metaData!="object"||e.metaData===null||"isErrorMessage"in e.metaData&&e.metaData.isErrorMessage!==void 0&&typeof e.metaData.isErrorMessage!="boolean"||"messageKind"in e.metaData&&e.metaData.messageKind!==void 0&&!["conversation","system"].includes(e.metaData.messageKind)||"systemEvent"in e.metaData&&e.metaData.systemEvent!==void 0&&!["customer_support_connecting","customer_support_connected","customer_support_closed","customer_support_connection_error"].includes(e.metaData.systemEvent)||"customerSupportAuthorName"in e.metaData&&e.metaData.customerSupportAuthorName!==void 0&&typeof e.metaData.customerSupportAuthorName!="string")return!1;if("interactiveWidget"in e.metaData){const t=e.metaData.interactiveWidget;if(typeof t!="object"||t===null||![2,3].includes(t.protocolVersion)||typeof t.instanceId!="string"||!["none","resume_turn","local_preview"].includes(t.responseMode)||!["active","submitting","submitted","cancelled","unavailable"].includes(t.state)||!Sc({type:"interactive_widget_request",event:"interactiveWidget.requested",protocolVersion:t.protocolVersion,instanceId:t.instanceId,widgetType:t.widgetType,source:"system",companyId:1,agentId:null,discussionId:null,toolcallId:null,payload:t.presentation,responsePolicy:t.responseMode==="local_preview"?{mode:"local_preview"}:{mode:"none"}}))return!1}}return!0}function t0(e){return!(typeof e!="object"||e===null||e.completedAiResponseCount!==void 0&&(!Number.isSafeInteger(e.completedAiResponseCount)||e.completedAiResponseCount<0||e.discussionId===null)||!Array.isArray(e.items)||!e.items.every(e0)||e.discussionId!==null&&typeof e.discussionId!="number"||typeof e.updatedAt!="string"||Number.isNaN(Date.parse(e.updatedAt))||e.customerSupport!==void 0&&e.customerSupport!==null&&!Zh(e.customerSupport))}function n0(e){const t=Vt();if(typeof window>"u")return;const n=e.key??qa,r={items:e.conversation.items,discussionId:e.conversation.discussionId,completedAiResponseCount:e.conversation.completedAiResponseCount,updatedAt:new Date().toISOString(),customerSupport:e.customerSupport??null};try{const i=JSON.stringify(r);ur.setItem(n,i)}catch{t.error("Failed to serialize chat state")}}function Cc(e){const t=Vt();if(typeof window>"u")return null;const n=e?.key??qa,r=ur.getItem(n);if(!r)return null;try{const i=JSON.parse(r);return t0(i)?i:(t.warn("Chat state in localStorage has unexpected shape, ignoring."),null)}catch{return t.error("Failed to parse chat state from localStorage"),null}}function r0(e){if(typeof window>"u")return null;const t=e??qa;ur.removeItem(t)}function i0(e,t=Date.now()){return t-e}function a0(e,t=Date.now()){return i0(new Date(e).getTime(),t)<=Qh}function s0({settings:e,setCurrentConversation:t,setArchivedConversation:n,restoreStoredConversation:r=!0,storageKey:i}){const a=r?Cc({key:i}):null;if(!a){t({discussionId:null,items:[{userType:"assistant",content:e.agent.text.initialText,temporaryId:crypto.randomUUID()}]});return}a0(a.updatedAt)?t({discussionId:a.discussionId,completedAiResponseCount:a.completedAiResponseCount,items:a.items,updatedAt:a.updatedAt}):(t({discussionId:null,items:[{userType:"assistant",content:e.agent.text.initialText,temporaryId:crypto.randomUUID()}]}),n({discussionId:a.discussionId,completedAiResponseCount:a.completedAiResponseCount,items:a.items,updatedAt:a.updatedAt}))}const Ic=S.createContext(Vt()),cr=()=>S.useContext(Ic),Ac=(e,t)=>{if(t===null)return"discussion_not_loaded";if(t!==e.discussionId)return"discussion_mismatch";if(e.status==="closed")return"session_closed";if(!e.reconnectToken)return"missing_reconnect_token";if(e.mode==="closed_hours_contact_capture")return null;if(!e.socketUrl)return"missing_socket_url";if(e.reconnectTokenExpiresAt){const n=Date.parse(e.reconnectTokenExpiresAt);if(Number.isNaN(n))return"invalid_reconnect_expiration";if(n<=Date.now())return"expired_reconnect_token"}return null},o0=e=>{const t=Cc({key:e}),n=t?.customerSupport??null;if(!n)return{mode:It.ai,customerSupportState:null,reason:"no_customer_support_state"};const r=Ac(n,t?.discussionId??null);return r==="session_closed"?{mode:It.customerSupport,customerSupportState:n,reason:r}:r?{mode:It.ai,customerSupportState:null,reason:r}:{mode:It.customerSupport,customerSupportState:n,reason:"valid_reconnect_state"}},u0=async e=>{const t={apiUrl:e.apiUrl,appToken:e.appToken,agentId:e.agentId};return e.runtimeAdapter?e.runtimeAdapter.loadCompanySettings(t):e.loadStandardSettings(t)},c0=async e=>{const t=dn.getFetchConfig({httpVerb:"GET",contentType:"application/json"}),n=`${e.apiUrl}/company/settings/${e.appToken}/${e.agentId}`;return await(await fetch(n,{...t,credentials:"omit"})).json()},l0="chatsystem-widget",Xa=e=>{const t=e.agentId??"default";return`${encodeURIComponent(e.appToken)}:${t}`},wc=e=>`${l0}:${Xa(e)}`,d0=({agentId:e,appToken:t,onFetched:n,runtimeAdapter:r})=>{const i=cr(),a=ei(),s=S.useMemo(()=>wc({appToken:t,agentId:e}),[t,e]),[o,u]=S.useState({}),c=S.useMemo(()=>new yc(ur,`${a}:${s}`),[a,s]),d={companySettings:o,setCompanySettings:u},[f,h]=S.useState({discussionId:null,items:[],updatedAt:null}),[m,y]=S.useState({discussionId:null,items:[],updatedAt:null}),[g,w]=S.useState(()=>r?{mode:It.ai,customerSupportState:null,reason:"runtime_adapter_uses_fresh_conversation"}:o0(s)),[I,v]=S.useState(0),M={draftStore:c,currentConversation:f,setCurrentConversation:h,archivedConversation:m,setArchivedConversation:y,chatboxBootState:g,setChatboxBootState:w,resetConversationRequestId:I,resetConversation:()=>{c.clear(),r||r0(s),w({mode:It.ai,customerSupportState:null,reason:"manual_start_new_conversation"}),h({discussionId:null,items:[{userType:"assistant",content:o?.agent?.text?.initialText,temporaryId:crypto.randomUUID()}],updatedAt:null}),v(A=>A+1)}};return S.useEffect(()=>{u0({apiUrl:a,appToken:t,agentId:e,runtimeAdapter:r,loadStandardSettings:c0}).then(A=>{u(A),s0({settings:A,setCurrentConversation:h,setArchivedConversation:y,restoreStoredConversation:!r,storageKey:s}),n?.()}).catch(A=>{i.warn("error in settings fetch",A)})},[t,e,a,s,i,n,r]),{contextCompanySettings:d,contextInitialConversationState:M}};async function f0(e,t=URL.createObjectURL){if(!e.ok)throw new Error(`IMAGE_PRELOAD_FAILED_HTTP_${e.status}`);const n=await e.blob();return t(n)}const vn=globalThis;vn.__WIDGET_ASSET_CACHE__||(vn.__WIDGET_ASSET_CACHE__={svg:new Map,img:new Map,lot:new Map,spr:new Map});vn.__WIDGET_PRELOAD_KEYS__||(vn.__WIDGET_PRELOAD_KEYS__=new Set);const Ni=vn.__WIDGET_PRELOAD_KEYS__,qt=vn.__WIDGET_ASSET_CACHE__,h0="widget-assets-v1";async function ti(e,t){const n=Vt();try{const r=await caches.open(h0),i=await r.match(e,{ignoreSearch:!1});if(i)return i.clone();const a=await fetch(e,{cache:"force-cache",mode:"cors",keepalive:!0,...t});if(!a.ok)throw new Error(`HTTP ${a.status} for ${e}`);return r.put(e,a.clone()),a}catch(r){return n.warn("error while fetching",r),new Response(null,{status:520,statusText:"Error in client - Fetch failed"})}}async function vc(e){const t=qt.svg.get(e);if(t)return t.promise;const n=(async()=>{const i=await(await ti(e)).text();if(typeof globalThis.DOMPurify<"u"&&typeof globalThis.DOMPurify.sanitize=="function")try{const s=new DOMParser().parseFromString(i,"image/svg+xml"),o=new XMLSerializer().serializeToString(s.documentElement);return{sanitized:globalThis.DOMPurify.sanitize(o,{USE_PROFILES:{svg:!0,svgFilters:!0}})}}catch{return{sanitized:globalThis.DOMPurify.sanitize(i,{USE_PROFILES:{svg:!0,svgFilters:!0}})}}else return{sanitized:i}})();return qt.svg.set(e,{promise:n,ts:Date.now()}),n}function kc(e){const t=qt.img.get(e);if(t)return t.promise;const n=(async()=>{const r=await ti(e);return{blobUrl:await f0(r)}})();return qt.img.set(e,{promise:n,ts:Date.now()}),n}function Nc(e){const t=qt.lot.get(e);if(t)return t.promise;const n=(async()=>{const i=await(await ti(e)).arrayBuffer(),a=new Uint8Array(i);if(a.length>=4&&a[0]===80&&a[1]===75&&a[2]===3&&a[3]===4||e.endsWith(".lottie"))return{kind:"zip",blobUrl:URL.createObjectURL(new Blob([i],{type:"application/zip"}))};const o=new TextDecoder().decode(a);return{kind:"json",data:JSON.parse(o)}})();return qt.lot.set(e,{promise:n,ts:Date.now()}),n}function Rc(e){const t=qt.spr.get(e);if(t)return t.promise;const n=(async()=>{const i=await(await ti(e)).blob();let a=null;try{a=await createImageBitmap(i)}catch{a=null}const{imgEl:s,width:o,height:u}=await new Promise((c,d)=>{const f=URL.createObjectURL(i),h=new Image;h.crossOrigin="anonymous",h.onload=()=>{const m=h.naturalWidth,y=h.naturalHeight;c({imgEl:h,width:m,height:y})},h.onerror=()=>{URL.revokeObjectURL(f),d(new Error("Spritesheet image decode failed"))},h.src=f,h.decode?.().catch(()=>{})});return{imgEl:s,bitmap:a,width:o,height:u}})();return qt.spr.set(e,{promise:n,ts:Date.now()}),n}function m0(e){e.images?.forEach(t=>void kc(t)),e.svgs?.forEach(t=>void vc(t)),e.lotties?.forEach(t=>void Nc(t)),e.sprites?.forEach(t=>void Rc(t))}function p0(e){const t=Vt();try{const n=document.createElement("link");n.rel="preconnect",n.href=e,n.crossOrigin="anonymous",document.head.appendChild(n);const r=document.createElement("link");r.rel="dns-prefetch",r.href=e,document.head.appendChild(r)}catch(n){t.warn("error in injectPreconnect",n)}}function Oc(e){return new URL(e,document.baseURI).toString()}function g0(e,t){const n=document.head.querySelectorAll('link[rel="preload"]');for(const r of n)if((e?r.as===e||r.getAttribute("as")===e:!0)&&r.href===t)return!0;return!1}function Sr(e,t,n,r){const i=Oc(n),a=`${e}|${t??""}|${i}`;if(Ni.has(a))return;if(g0(t,i)){Ni.add(a);return}const s=document.createElement("link");s.rel=e,t&&(s.as=t),s.href=i,s.crossOrigin="anonymous",r&&(s.type=r),s.setAttribute("data-chatsystem-preload","1"),document.head.appendChild(s),Ni.add(a)}function b0(e){const t=s=>Array.from(new Set((s??[]).map(Oc))),n=t(e.images),r=t(e.svgs),i=t(e.lotties),a=t(e.sprites);n.forEach(s=>Sr("preload","image",s)),r.forEach(s=>Sr("preload","fetch",s,"image/svg+xml")),i.forEach(s=>Sr("preload","fetch",s,"application/zip")),a.forEach(s=>Sr("preload","fetch",s))}function E0(e,t){const{manifest:n,origins:r}=T0(e,t);r.forEach(p0),b0(n),m0(n)}function T0(e,t){const n=t??Vt(),r=y0(e),i=new Set,a=new Set,s=new Set,o=new Set;for(const{url:d,mode:f}of r)switch(_0(f,d,n)){case"svg":a.add(d);break;case"lottie":s.add(d);break;case"spritesheet":o.add(d);break;case"image":i.add(d);break}const u={images:Array.from(i),svgs:Array.from(a),lotties:Array.from(s),sprites:Array.from(o)},c=x0(u,n);return{manifest:u,origins:c}}function y0(e){if(!e?.agent?.display)return[];const t=e.agent.display,n=[t.launcher,t.assistant,t.search].filter(Boolean),r=[];for(const i of n)i?.assetUrl&&r.push({url:i.assetUrl,mode:i.mode});return r}function _0(e,t,n){if(e)switch(e){case"svg":return"svg";case"lottie":return"lottie";case"spritesheet":return"spritesheet";case"image":return"image";case"video":return"video"}try{const i=new URL(t,document.baseURI).pathname.toLowerCase();if(i.endsWith(".svg"))return"svg";if(i.endsWith(".lottie")||i.endsWith(".zip")||i.endsWith(".json"))return i.endsWith(".json"),"lottie";if(/\.(png|webp|jpg|jpeg|gif|avi,ef)$/.test(i))return"image";if(/\.(mp4|webm|mov|m4v|ogg)$/.test(i))return"video"}catch(r){n.warn("error in normalizeKind:",r)}return"unknown"}function x0(e,t){const n=new Set,r=i=>{if(i)try{const a=new URL(i,document.baseURI);n.add(`${a.protocol}//${a.host}`)}catch(a){t.warn("error in uniqueOriginsFromManifest",a)}};return(e.images??[]).forEach(r),(e.svgs??[]).forEach(r),(e.lotties??[]).forEach(r),(e.sprites??[]).forEach(r),Array.from(n)}const Lc=S.createContext(void 0),Dc=S.createContext(void 0),S0=()=>S.useContext(Dc);async function C0(e){if(!e)return"anonymous";try{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=JSON.parse(atob(t));if(typeof n.sub!="string"||typeof n.iss!="string"||typeof n.aud!="string")return null;const r=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify([n.iss,n.aud,n.sub])));return Array.from(new Uint8Array(r),i=>i.toString(16).padStart(2,"0")).join("")}catch{return null}}const ni=()=>{const e=S.useContext(Zr);if(!e)throw new Error("useChatbotConversation must be used within ChatbotInitialtextContext.Provider");const{currentConversation:t,setCurrentConversation:n,archivedConversation:r,setArchivedConversation:i,chatboxBootState:a,setChatboxBootState:s,resetConversationRequestId:o,resetConversation:u}=e,c=A=>{n(p=>({...p,discussionId:A}))},d=A=>{n(p=>({...p,items:A}))},f=A=>{n(p=>({...p,items:[...p.items,A]}))},h=({messageStreamId:A,role:p})=>{n(L=>L.items.some(B=>B.metaData?.messageStreamId===A)?L:{...L,items:[...L.items,{userType:p,content:"",metaData:{messageStreamId:A},temporaryId:crypto.randomUUID()}]})},m=(A,p)=>{n(L=>({...L,items:L.items.map(B=>{const G=B.metaData?.interactiveWidget;return!G||G.instanceId!==A?B:{...B,metaData:{...B.metaData,interactiveWidget:p(G)}}})}))},y=()=>{n(A=>({...A,items:A.items.filter(p=>!(p.content?.length===0&&p.userType==="assistant"))}))},g=()=>{n(A=>{const p=[...A.items];return p.pop(),{...A,items:p}})},w=A=>{n(p=>({...p,updatedAt:A.updatedAt}))},I=()=>{i({discussionId:null,items:[],updatedAt:null})};return{currentConversation:t,setCurrentConversation:n,setCurrentConversationId:c,setCurrentConversationMetadata:w,resetConversation:u,setCurrentConversationItems:d,addMessageToCurrentConversation:f,removeEmptyAssistantMessageFromCurrentConversation:y,removeLastMessageFromCurrentConversation:g,updateCurrentConversationLastMessage:({newContent:A})=>{n(p=>{const L=[...p.items],B=L.length-1,G=L[B];return L[B]={...G,content:G.content=A},{...p,items:L}})},archivedConversation:r,chatboxBootState:a,setChatboxBootState:s,resetConversationRequestId:o,setArchivedConversationAsMain:()=>{n(r),I()},addEmptyMessageToCurrentConversation:h,updateCurrentConversationMessageById:({newContent:A,id:p})=>{n(L=>{const B=[...L.items],G=B.findIndex(H=>H.metaData?.messageStreamId===p),N=B[G];return B[G]={...N,content:N.content=A},{...L,items:B}})},updateInteractiveWidget:m}},I0=30,A0=e=>{try{const t=e.split(".")[1];if(!t)return null;const n=t.replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return typeof i.exp=="number"?i.exp:null}catch{return null}};class w0{token=null;expiresAt=null;pendingRequest=null;pendingRequestIsInteractive=!1;generation=0;provider;constructor(t){this.provider=t}clear(){this.generation+=1,this.token=null,this.expiresAt=null,this.pendingRequest=null,this.pendingRequestIsInteractive=!1}handleIdentityChanged(){this.token=null,this.expiresAt=null,!(this.pendingRequest&&this.pendingRequestIsInteractive)&&(this.generation+=1,this.pendingRequest=null,this.pendingRequestIsInteractive=!1)}async getToken(t){if(!this.provider)return null;const n=Math.floor(Date.now()/1e3);if(this.token&&this.expiresAt!=null&&this.expiresAt-I0>n)return this.token;if(this.pendingRequest){const a=this.pendingRequestIsInteractive,s=await this.pendingRequest;if(s||!t.interactive||a)return s}const r=this.generation;this.pendingRequestIsInteractive=t.interactive;let i;return i=this.provider.getToken(t).then(a=>{if(r!==this.generation)return null;if(!a)return this.clear(),null;const s=A0(a);return s==null||s<=Math.floor(Date.now()/1e3)?(this.clear(),null):(this.token=a,this.expiresAt=s,a)}).finally(()=>{this.pendingRequest===i&&(this.pendingRequest=null,this.pendingRequestIsInteractive=!1)}),this.pendingRequest=i,i}}const v0=async({apiUrl:e,appToken:t,payload:n,identitySession:r,fetchImplementation:i=fetch})=>{let a=null,s;try{a=await r.getToken({interactive:!0,reason:n.reason,requiredCapabilities:n.requiredCapabilities}),a||(a=await r.getToken({interactive:!1,reason:n.reason,requiredCapabilities:n.requiredCapabilities})),s=a?{status:"success"}:{status:"cancelled"}}catch{r.clear(),s={status:"failed",code:"HOST_IDENTITY_FAILED"}}const o=await i(`${e}/ai/identity-gates/${encodeURIComponent(t)}/${encodeURIComponent(n.gateId)}/result`,{method:"POST",headers:{"Content-Type":"application/json","X-ChatSystem-Identity-Gate-Token":n.resultToken,...a?{Authorization:`Bearer ${a}`}:{}},body:JSON.stringify(s)});if(!o.ok)throw o.status===401&&a&&r.clear(),new Error(`IDENTITY_GATE_RESOLUTION_FAILED:${o.status}`)},k0="chatsystem:pending-turn:",N0=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,Qa=e=>`${k0}${encodeURIComponent(e)}`,Pc=(e,t=Date.now())=>{if(!e||typeof e!="object"||Array.isArray(e))return null;const n=e;if(typeof n.continuationId!="string"||!N0.test(n.continuationId)||typeof n.expiresAt!="string"||typeof n.discussionId!="number"||!Number.isSafeInteger(n.discussionId)||n.discussionId<=0)return null;const r=Date.parse(n.expiresAt);return!Number.isFinite(r)||r<=t?null:{continuationId:n.continuationId,expiresAt:n.expiresAt,discussionId:n.discussionId}},R0=(e,t,n,r=Lt)=>{const i=Pc({...t,discussionId:n});i&&r.setItem(Qa(e),JSON.stringify(i))},O0=(e,t=Lt,n=Date.now())=>{const r=Qa(e),i=t.getItem(r);if(!i)return null;try{const a=Pc(JSON.parse(i),n);if(a)return a}catch{}return t.removeItem(r),null},uo=(e,t=Lt)=>{t.removeItem(Qa(e))},L0=async({apiUrl:e,appToken:t,discussionId:n,continuation:r,identitySession:i,fetchImplementation:a=fetch})=>{if(!Number.isSafeInteger(n)||n<=0)return null;const s=await i.getToken({interactive:!1});if(!s)return null;const o={discussionId:n};return a(`${e}/ai/pending-turns/${encodeURIComponent(t)}/${encodeURIComponent(r.continuationId)}/resume`,{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(o)})},D0=e=>e>=200&&e<300||e>=400&&e<500&&e!==429||e===503,P0=e=>{if(!K.isUnknownRecord(e))return;const t=K.readOptionalNumber(e.timeoutMinutes)??K.DIRECT_CHAT_CUSTOMER_SUPPORT_FALLBACK_CONTACT_CAPTURE_DEFAULT_TIMEOUT_MINUTES;return{enabled:e.enabled===!0,timeoutMinutes:Math.max(1,Math.min(120,Math.round(t))),requireEmail:e.requireEmail!==!1,requirePhone:e.requirePhone!==!1}},M0=e=>{if(K.isUnknownRecord(e))return{enabled:e.enabled!==!1,requireEmail:e.requireEmail!==!1,requirePhone:e.requirePhone!==!1,requireReason:e.requireReason!==!1}},B0=e=>{if(!K.isUnknownRecord(e))return null;const t=e;if(t.type!=="interactive_widget_request"||t.event!=="interactiveWidget.requested"||t.widgetType!==K.INTERACTIVE_WIDGET_TYPES.directChatCustomerSupport||!K.isUnknownRecord(t.payload))return null;const n=t.payload;if((K.readOptionalString(n.mode)??"live_chat")==="closed_hours_contact_capture"){const s=K.readOptionalString(n.reconnectToken),o=K.readOptionalNumber(n.customerSupportSessionId),u=M0(n.closedHoursContactCapture);if(n.transport!=="none"||!s||!o||!u||!u.enabled)return null;const c=K.isUnknownRecord(n.businessHours)?n.businessHours:{};return{mode:"closed_hours_contact_capture",transport:"none",reconnectToken:s,reconnectTokenExpiresAt:K.readOptionalString(n.reconnectTokenExpiresAt),customerSupportSessionId:o,companyId:K.readOptionalNumber(t.companyId),agentId:K.readOptionalNullableNumber(t.agentId),discussionId:K.readOptionalNullableNumber(t.discussionId)??null,toolcallId:K.readOptionalNullableString(t.toolcallId),closedHoursContactCapture:u,businessHours:{timezone:K.readOptionalString(c.timezone)??K.DIRECT_CHAT_CUSTOMER_SUPPORT_DEFAULT_BUSINESS_HOURS_TIMEZONE,todayScheduleLabel:K.readOptionalString(c.todayScheduleLabel)}}}if(n.transport!=="socket"||typeof n.socketUrl!="string")return null;const i=K.readOptionalString(n.handoffToken),a=K.readOptionalString(n.reconnectToken);return!i&&!a?null:{mode:"live_chat",transport:"socket",socketUrl:n.socketUrl,handoffToken:i,reconnectToken:a,reconnectTokenExpiresAt:K.readOptionalString(n.reconnectTokenExpiresAt),customerSupportSessionId:K.readOptionalNumber(n.customerSupportSessionId),companyId:K.readOptionalNumber(t.companyId),agentId:K.readOptionalNullableNumber(t.agentId),discussionId:K.readOptionalNullableNumber(t.discussionId)??null,toolcallId:K.readOptionalNullableString(t.toolcallId),fallbackContactCapture:P0(n.fallbackContactCapture)}},F0=e=>B0(e),U0=/^[a-zA-Z0-9][a-zA-Z0-9:._-]*$/,H0=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,j0=e=>{if(!K.isUnknownRecord(e)||e.protocolVersion!==K.IDENTITY_GATE_PROTOCOL_V1&&e.protocolVersion!==K.IDENTITY_GATE_PROTOCOL_V2||typeof e.gateId!="string"||e.gateId.length<1||e.gateId.length>100||typeof e.toolCallId!="string"||e.toolCallId.length<1||e.toolCallId.length>255||typeof e.resultToken!="string"||e.resultToken.length<32||e.resultToken.length>512||typeof e.expiresAt!="string"||!Number.isFinite(Date.parse(e.expiresAt))||e.reason!=="identity_required"&&e.reason!=="identity_expired"||!Array.isArray(e.requiredCapabilities)||e.requiredCapabilities.length<1||e.requiredCapabilities.length>50||!e.requiredCapabilities.every(n=>typeof n=="string"&&n.length<=100&&U0.test(n)))return null;const t={gateId:e.gateId,toolCallId:e.toolCallId,requiredCapabilities:[...new Set(e.requiredCapabilities)].sort(),reason:e.reason,expiresAt:e.expiresAt,resultToken:e.resultToken};return e.protocolVersion===K.IDENTITY_GATE_PROTOCOL_V1?{protocolVersion:K.IDENTITY_GATE_PROTOCOL_V1,...t}:!K.isUnknownRecord(e.continuation)||typeof e.continuation.continuationId!="string"||!H0.test(e.continuation.continuationId)||typeof e.continuation.expiresAt!="string"||!Number.isFinite(Date.parse(e.continuation.expiresAt))?null:{protocolVersion:K.IDENTITY_GATE_PROTOCOL_V2,...t,continuation:{continuationId:e.continuation.continuationId,expiresAt:e.continuation.expiresAt}}},V0=e=>{if(e.event===K.AI_RESPONSE_COMPLETED_EVENT&&K.isAiResponseCompletedPayload(e.payload))return{type:"ai_response_completed",payload:e.payload};if(e.event===K.IDENTITY_GATE_REQUIRED_EVENT){const r=j0(e.payload);if(r)return{type:"identity_gate_required",payload:r}}const t=Sc(e.payload);if(t)return{type:"interactive_widget_requested",payload:t};const n=F0(e.payload);return n?{type:"customer_support_handoff_requested",payload:n}:{type:"unhandled_client_event",event:e}};class Ht{pending="";logger;constructor(t=console){this.logger=t}transformNDJSONChunkIntoObjects(t){this.pending+=t;const n=this.pending.split(/\r?\n/);this.pending=n.pop()??"";const r=[];for(const i of n){const a=i.trim();if(a)try{r.push(JSON.parse(a))}catch{this.logger.warn("[NDJSON] Could not parse line:",a)}}return r}flushPending(){const t=this.pending.trim();if(this.pending="",!t)return[];try{return[JSON.parse(t)]}catch{return[]}}static isObjectOutputstreamMessageDeltaDTO=t=>t.type===K.OutputStreamTypesEnum.OUTPUT_STREAM_MESSAGE_DELTA;static isObjectOutputstreamMessageStartDTO=t=>t.type===K.OutputStreamTypesEnum.OUTPUT_STREAM_MESSAGE_START;static isObjectOutputstreamMessageEndDTO=t=>t.type===K.OutputStreamTypesEnum.OUTPUT_STREAM_MESSAGE_END;static isObjectOutputstreamErrorDTO=t=>t.type===K.OutputStreamTypesEnum.OUTPUT_STREAM_ERROR;static isObjectOutputstreamClientEventDTO=t=>t.type===K.OutputStreamTypesEnum.OUTPUT_STREAM_CLIENT_EVENT;static isObjectOutputstreamLoadingNumberOfStepsDTO=t=>t.type===K.OutputStreamTypesEnum.OUTPUT_STREAM_NUMBER_OF_STEPS_TYPE;static isObjectOutputstreamLoadingCurrentStepNumberDTO=t=>t.type===K.OutputStreamTypesEnum.OUTPUT_STREAM_CURRENT_STEP_NUMBER_TYPE;static isObjectOutputstreamLoadingCurrentStepNameDTO=t=>t.type===K.OutputStreamTypesEnum.OUTPUT_STREAM_CURRENT_STEP_NAME_TYPE;static containsObjectWithLastAnswerToTrue=t=>{for(const n of t)if(this.isObjectOutputstreamMessageEndDTO(n)&&n.isLastAnswer)return!0;return!1}}function z0(e,t,n){return!K.isAiResponseCompletedPayload(t)||t.discussionId!==n||t.discussionId!==e.discussionId||t.completedAiResponseCount<=(e.completedAiResponseCount??0)?e:{...e,completedAiResponseCount:t.completedAiResponseCount}}function $0(e,t){return typeof t=="number"&&Number.isSafeInteger(t)&&t>0&&(e.completedAiResponseCount??0)>=t}function W0(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="DISCUSSION_AI_RESPONSE_LIMIT_REACHED"}var ba=(e=>(e.GET_DISCUSSION_ID="/id",e.RESET_DISCUSSION="/delete",e))(ba||{});const G0=e=>!!e.startsWith("/"),Y0=(e,t,n)=>e===ba.GET_DISCUSSION_ID?t?`Votre ID de discussion est ${t}`:"Votre ID de discussion n'est pas encore défini. Envoyez un premier message pour que ce soit le cas.":e===ba.RESET_DISCUSSION?(n(),null):`La commande ${e} n'est pas prise en compte.`,Ka=()=>{const e=Kt(),t=e.formatMessage({defaultMessage:"Message the assistant...",id:"chatbot.placeholder.content"}),n=e.formatMessage({defaultMessage:"You",id:"chatbot.chatline.label.user"}),r=e.formatMessage({defaultMessage:"Assistant",id:"chatbot.chatline.label.assistant"}),i=e.formatMessage({defaultMessage:"Customer support",id:"chatbot.chatline.label.customerSupport"}),a=e.formatMessage({defaultMessage:"⏳ The chatbot is a little busy at the time. Please try again later.",id:"chatbot.error.api.429"}),s=e.formatMessage({defaultMessage:"Oops ! There has been an error. Please try again later.",id:"chatbot.error.api.500"}),o=e.formatMessage({defaultMessage:"Oups ! The discussion is full. Please start a new one.",id:"chatbot.error.api.409"}),u=e.formatMessage({defaultMessage:"See",id:"chatbot.infobanner.title"}),c=e.formatMessage({defaultMessage:"You have an archived discussion.",id:"chatbot.infobanner.cta"}),d=e.formatMessage({defaultMessage:"Transferring your request to customer support...",id:"chatbot.customerSupport.connecting"}),f=e.formatMessage({defaultMessage:"Your request has been sent to Customer Support. It usually takes a few minutes to get a reply. Thank you for waiting.",id:"chatbot.customerSupport.connected"}),h=e.formatMessage({defaultMessage:"Customer support is not available right now. Please try again later.",id:"chatbot.customerSupport.connectionError"}),m=e.formatMessage({defaultMessage:"Customer support received your request, but live replies are temporarily unavailable. Please try again shortly.",id:"chatbot.customerSupport.providerUnavailable"}),y=e.formatMessage({defaultMessage:"Your customer support conversation is now complete. Start a new conversation whenever you need more help.",id:"chatbot.customerSupport.closed"}),g=e.formatMessage({defaultMessage:"Restart",id:"chatbot.customerSupport.restart"}),w=e.formatMessage({defaultMessage:"Leave your contact details",id:"chatbot.customerSupport.fallback.title"}),I=e.formatMessage({defaultMessage:"Customer support has not replied yet. Leave your email and phone number and we will contact you soon.",id:"chatbot.customerSupport.fallback.description"}),v=e.formatMessage({defaultMessage:"Email",id:"chatbot.customerSupport.fallback.email"}),R=e.formatMessage({defaultMessage:"Phone",id:"chatbot.customerSupport.fallback.phone"}),M=e.formatMessage({defaultMessage:"Send",id:"chatbot.customerSupport.fallback.submit"}),A=e.formatMessage({defaultMessage:"Sending...",id:"chatbot.customerSupport.fallback.submitting"}),p=e.formatMessage({defaultMessage:"Your contact details have been saved. Customer support will contact you soon.",id:"chatbot.customerSupport.fallback.success"}),L=e.formatMessage({defaultMessage:"We could not save your contact details. Please try again.",id:"chatbot.customerSupport.fallback.error"}),B=e.formatMessage({defaultMessage:"Customer support is currently closed",id:"chatbot.customerSupport.closedHours.title"}),G=e.formatMessage({defaultMessage:"Leave your email, phone number and request. Customer support will contact you during opening hours.",id:"chatbot.customerSupport.closedHours.description"}),N=e.formatMessage({defaultMessage:"Today:",id:"chatbot.customerSupport.closedHours.schedulePrefix"}),H=e.formatMessage({defaultMessage:"Reason for your request",id:"chatbot.customerSupport.closedHours.reason"}),V=e.formatMessage({defaultMessage:"Your request has been saved. Customer support will contact you during opening hours.",id:"chatbot.customerSupport.closedHours.success"});return{placeholderTranslation:t,chatlineLabelUserTranslation:n,chatlineLabelAssistantTranslation:r,chatlineLabelCustomerSupportTranslation:i,tooManyRequestsTranslation:a,genericErrorTranslation:s,discussionFullErrorTranslation:o,infoBannerTitleTranslation:u,infoBannerExplainationTranslation:c,customerSupportConnectingTranslation:d,customerSupportConnectedTranslation:f,customerSupportConnectionErrorTranslation:h,customerSupportProviderUnavailableTranslation:m,customerSupportClosedTranslation:y,customerSupportRestartTranslation:g,customerSupportFallbackTitleTranslation:w,customerSupportFallbackDescriptionTranslation:I,customerSupportFallbackEmailTranslation:v,customerSupportFallbackPhoneTranslation:R,customerSupportFallbackSubmitTranslation:M,customerSupportFallbackSubmittingTranslation:A,customerSupportFallbackSuccessTranslation:p,customerSupportFallbackErrorTranslation:L,customerSupportClosedHoursTitleTranslation:B,customerSupportClosedHoursDescriptionTranslation:G,customerSupportClosedHoursSchedulePrefixTranslation:N,customerSupportClosedHoursReasonTranslation:H,customerSupportClosedHoursSuccessTranslation:V}},Ja=()=>{const e=Kt(),t=e.formatMessage({defaultMessage:"Search",id:"chatbot.chatline.loading.function.search"}),n=e.formatMessage({defaultMessage:"Looking into the cavern",id:"chatbot.chatline.loading.function.extractProductName"}),r=e.formatMessage({defaultMessage:"Consulting the shadocks",id:"chatbot.chatline.loading.function.suggestProductName"}),i=e.formatMessage({defaultMessage:"Looking for ziboublis",id:"chatbot.chatline.loading.function.criteriaDefinition"}),a=e.formatMessage({defaultMessage:"Searching Stock",id:"chatbot.chatline.loading.function.searchStock"}),s=e.formatMessage({defaultMessage:"Step",id:"chatbot.chatline.loading.function.step"}),o=e.formatMessage({defaultMessage:"I'm looking for products",id:"chatbot.chatline.loading.function.genericSearchMessage"}),u=e.formatMessage({defaultMessage:"Searching ...",id:"chatbot.chatline.loading.stepName.search"}),c=e.formatMessage({defaultMessage:"Building Query ...",id:"chatbot.chatline.loading.stepName.building"}),d=e.formatMessage({defaultMessage:"Analyzing ...",id:"chatbot.chatline.loading.stepName.analyzing"}),f=e.formatMessage({defaultMessage:"Writing answer",id:"chatbot.chatline.loading.stepName.redacting"}),h=e.formatMessage({defaultMessage:"Cancel",id:"chatbot.chatline.loading.cancel"}),m=e.formatMessage({defaultMessage:"see recent messages",id:"chatbot.chatline.seeRecentMessages"}),y=w=>w?w.includes("ExtractProductNames")?n:w.includes("SuggestProductNames")?r:w==="Recherche ..."?u:w==="Construction ..."?c:w==="Analyse ..."?d:w==="Rédaction"?f:w.includes("CreateCriteriasFromProductNames")||w.includes("CreateCriteriasOrProductNamesFromDiscussion")?i:w.includes("SearchStock")?a:"":t,g=y();return{searchTranslation:t,extractProductNameTranslation:n,criteriaDefinitionTranslation:i,searchStockTranslation:a,stepTranslation:s,getCurrentStepTranslated:y,defaultStartingStep:g,lookingForProductTranslation:o,cancelTranslation:h,recentMessagesTranslation:m}},q0=e=>/(\[.*|!\[.*)$/.test(e),X0=e=>/\)/.test(e),co=()=>({rendered:"",markdownTag:"",isWritingTag:!1,lastStreamSourceUuid:null});class Q0{buffers=new Map;callbacks;constructor(t){this.callbacks=t}handleStart(t){this.buffers.set(t.messageId,co()),t.role==="assistant"&&this.callbacks.onAssistantMessageStart?.(),this.callbacks.addEmptyMessage({messageStreamId:t.messageId,role:t.role})}handleDelta(t){this.ensureBufferExists(t.messageId);const n=this.buffers.get(t.messageId);this.appendSourceSeparatorIfNeeded(n,t.streamSourceUuid),this.appendDelta(n,t.delta),this.callbacks.updateMessage({id:t.messageId,newContent:n.rendered})}handleEnd(t){this.buffers.delete(t.messageId)}hasBuffer(t){return this.buffers.has(t)}ensureBufferExists(t){this.buffers.has(t)||(this.buffers.set(t,co()),this.callbacks.addEmptyMessage({messageStreamId:t,role:"assistant"}))}appendSourceSeparatorIfNeeded(t,n){t.lastStreamSourceUuid&&t.lastStreamSourceUuid!==n&&(t.rendered+='<span style="display:block;height:1rem;"></span>'),t.lastStreamSourceUuid=n??null}appendDelta(t,n){if(X0(n)){t.markdownTag+=n,t.rendered+=t.markdownTag,t.markdownTag="",t.isWritingTag=!1;return}if(t.isWritingTag||q0(n)){t.markdownTag+=n,t.isWritingTag=!0;return}t.rendered+=n}}const K0=1e4,J0=3e3,Z0=e=>{const t=new URL(e);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t},em=({apiUrl:e,handoff:t})=>(t.socketUrl.startsWith("ws://")||t.socketUrl.startsWith("wss://")?new URL(t.socketUrl):new URL(t.socketUrl,Z0(e))).toString(),tm=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return["connected","customer_message_ack","provider_message","closed","error"].includes(t.type)};class nm{socket;callbacks;url;appToken;handoffToken;isIntentionalClose=!1;handshakeTimeout;closeAcknowledgementTimeout=null;constructor(t){this.callbacks=t.callbacks,this.url=em(t),this.appToken=t.appToken;const n=t.handoff.reconnectToken??t.handoff.handoffToken;if(!n)throw new Error("Customer support socket requires a reconnect token");this.handoffToken=n,this.socket=new WebSocket(this.url),this.handshakeTimeout=setTimeout(()=>{this.socket.readyState!==WebSocket.CONNECTING&&this.socket.readyState!==WebSocket.OPEN||(this.callbacks.onTransportError?.({readyState:this.socket.readyState,url:this.safeUrlForLogs()}),this.socket.close())},K0),this.socket.addEventListener("open",this.sendAuthMessage),this.socket.addEventListener("message",this.handleMessage),this.socket.addEventListener("close",this.handleClose),this.socket.addEventListener("error",this.handleTransportError)}sendAuthMessage=()=>{this.socket.send(JSON.stringify({type:"auth",appToken:this.appToken,handoffToken:this.handoffToken}))};sendCustomerMessage(t){if(this.socket.readyState!==WebSocket.OPEN){this.callbacks.onError?.({type:"error",message:"Customer support connection is not ready.",code:"CUSTOMER_SUPPORT_SOCKET_NOT_READY"});return}const n={type:"customer_message",text:t,clientMessageId:crypto.randomUUID()};this.socket.send(JSON.stringify(n))}close(t,n){if(this.isIntentionalClose=!0,clearTimeout(this.handshakeTimeout),this.socket.readyState===WebSocket.OPEN&&n?.notifyServer){const r={type:"close",reason:t};this.socket.send(JSON.stringify(r)),this.closeAcknowledgementTimeout=setTimeout(()=>{this.closeTransport(t)},J0);return}this.closeTransport(t)}handleMessage=t=>{clearTimeout(this.handshakeTimeout);let n;try{n=JSON.parse(t.data)}catch{this.callbacks.onError?.({type:"error",message:"Customer support sent an invalid message.",code:"CUSTOMER_SUPPORT_SOCKET_INVALID_MESSAGE"});return}if(tm(n)){if(n.type==="connected"){this.callbacks.onConnected?.(n);return}if(n.type==="provider_message"){this.callbacks.onProviderMessage?.(n);return}if(n.type==="closed"){if(this.closeAcknowledgementTimeout!==null){clearTimeout(this.closeAcknowledgementTimeout),this.closeAcknowledgementTimeout=null,this.closeTransport("Customer support session closed");return}this.callbacks.onClosed?.(n);return}n.type==="error"&&this.callbacks.onError?.(n)}};handleClose=t=>{clearTimeout(this.handshakeTimeout),this.closeAcknowledgementTimeout!==null&&(clearTimeout(this.closeAcknowledgementTimeout),this.closeAcknowledgementTimeout=null),!this.isIntentionalClose&&this.callbacks.onClose?.(t)};handleTransportError=()=>{this.isIntentionalClose||this.callbacks.onTransportError?.({readyState:this.socket.readyState,url:this.safeUrlForLogs()})};closeTransport(t){this.closeAcknowledgementTimeout!==null&&(clearTimeout(this.closeAcknowledgementTimeout),this.closeAcknowledgementTimeout=null),this.socket.close(1e3,t??"Customer support socket detached")}safeUrlForLogs(){const t=new URL(this.url);return t.searchParams.has("handoffToken")&&t.searchParams.set("handoffToken","<redacted>"),t.toString()}}const rm=new Set(["SLACK_INBOUND_EVENT_NOT_OBSERVED"]),im=e=>e&&rm.has(e)?"provider_unavailable":"connection_error",am=e=>e.isClosed?e.labels.closed:!e.isCustomerSupportMode||!e.hasTransportFailed?null:e.failureKind==="provider_unavailable"?e.labels.providerUnavailable:e.labels.connectionError,sm=[500,1500,3e3],om=e=>{const t=sm[e];return t===void 0?{shouldRetry:!1}:{shouldRetry:!0,delayMs:t}},Mc=e=>e.mode!==It.customerSupport?!1:e.customerSupportState.status!=="closed",Za=e=>e.mode!==It.customerSupport?!1:e.customerSupportState.status==="closed",es=e=>e.mode!==It.customerSupport||e.customerSupportState.status==="closed"?!1:e.customerSupportState.mode==="closed_hours_contact_capture",um=e=>es(e)?"customer_support":Mc(e)?"customer_support_connecting":Za(e)?"customer_support":"ai",cm=e=>es(e)?"idle":Mc(e)?"connecting":Za(e)?"closed":"idle",lm=e=>e.customerSupportState?.closedReason==="closed_hours_contact_submitted"?"submitted":es(e)?"visible":"idle",dm=e=>e?.trim()||void 0,fm=e=>e.mode!==It.customerSupport||e.customerSupportState.status==="closed"||e.customerSupportState.mode==="closed_hours_contact_capture"?null:e.customerSupportState,Bc=e=>!!(e&&e.mode!=="closed_hours_contact_capture"),ts=e=>e?.mode==="closed_hours_contact_capture",hm=e=>{if(e.isCustomerSupportMode&&e.isCurrentDiscussion&&Bc(e.state))return e.state.fallbackContactCapture},mm=e=>{if(e.isCustomerSupportMode&&e.isCurrentDiscussion&&ts(e.state))return e.state.closedHoursContactCapture},pm=e=>{if(e.isCustomerSupportMode&&e.isCurrentDiscussion&&ts(e.state))return e.state.businessHours},gm=e=>e.isCustomerSupportMode?e.chatTransportMode==="customer_support_connecting"?"customer_support_connecting":e.isCurrentDiscussion?ts(e.state)?"customer_support_closed_hours_form":e.socketStatus!=="connected"?`socket_${e.socketStatus}`:e.isWaitingForFirstProviderReply?"waiting_first_provider_reply":e.isCustomerSupportClosed?"customer_support_closed":null:e.currentDiscussionId===null?"discussion_not_loaded":"discussion_mismatch":null;function bm({appToken:e,conversationStorageKey:t,currentConversation:n,loadingStatus:r,labels:i,logger:a,setCurrentConversationId:s,setLoadingStatus:o,addMessageToCurrentConversation:u,chatboxBootState:c,resetConversationRequestId:d}){const f=ei(),h=c,[m,y]=S.useState(()=>um(h)),[g,w]=S.useState(h.customerSupportState),[I,v]=S.useState(()=>cm(h)),[R,M]=S.useState(null),[A,p]=S.useState(()=>h.customerSupportState?.closedReason==="fallback_contact_submitted"?"submitted":"idle"),[L,B]=S.useState(()=>lm(h)),G=S.useRef(null),N=S.useRef(d),H=S.useRef(!1),V=S.useRef(null),j=S.useRef(fm(h)),z=S.useRef(Za(h)),Z=S.useRef(!1),be=S.useRef(0),he=S.useRef(null),le=m!=="ai",we=g?.discussionId===n.discussionId,E=le&&g?.status==="closed",$=am({isCustomerSupportMode:le,isClosed:E,hasTransportFailed:I==="failed",failureKind:R,labels:i}),ne=!!(le&&we&&g?.mode!=="closed_hours_contact_capture"&&g?.isWaitingForFirstProviderReply),x={isCustomerSupportMode:le,isCurrentDiscussion:we,state:g},J=hm(x),ue=mm(x),X=pm(x),ae=!!J?.enabled&&["visible","submitting","submitted","failed"].includes(A),re=!!ue?.enabled&&["visible","submitting","submitted","failed"].includes(L),oe=gm({chatTransportMode:m,currentDiscussionId:n.discussionId,isCustomerSupportClosed:E,isCustomerSupportMode:le,isCurrentDiscussion:we,isWaitingForFirstProviderReply:ne,socketStatus:I,state:g}),ie=oe!==null,Oe=S.useRef("");S.useEffect(()=>{const k=JSON.stringify(n.items.flatMap(q=>{const ee=q.metaData?.interactiveWidget;return ee?[[ee.instanceId,ee.state,ee.selectedActionId]]:[]}));if(r!=="notLoading"&&k===Oe.current||n.items.length===0)return;const P=we?g:null;!n.discussionId&&!P||(n0({conversation:n,customerSupport:P,key:t}),Oe.current=k)},[r,n,g,t,we]),S.useEffect(()=>(Z.current=!1,()=>{Z.current=!0,he.current!==null&&(window.clearTimeout(he.current),he.current=null),G.current?.close("Widget unmounted"),G.current=null}),[]);const Y=(k,P,q)=>{u({userType:"assistant",content:k,metaData:{messageKind:"system",systemEvent:P,...q},temporaryId:crypto.randomUUID()})},je=(k,P)=>{u({userType:"assistant",content:k,metaData:{messageKind:"conversation",authorType:"customer_support_operator",...P},temporaryId:crypto.randomUUID()})},Ue=(k,P)=>{G.current?.close(k,P),G.current=null},et=()=>{he.current!==null&&(window.clearTimeout(he.current),he.current=null),be.current=0,V.current=null,j.current=null,z.current=!1,M(null),w(null),v("idle"),y("ai")},it=(k,P)=>{Ue(k,P),et()};S.useEffect(()=>{N.current!==d&&(N.current=d,H.current=!0,it("Starting new conversation",{notifyServer:!0}))},[d]),S.useEffect(()=>{n.discussionId===null&&H.current&&g===null&&m==="ai"&&(H.current=!1)},[m,n.discussionId,g]);const at=k=>{z.current||(z.current=!0,V.current=null,G.current=null,k?.discussionId&&s(k.discussionId),o("notLoading"),M(null),v("closed"),y("customer_support"),w(P=>{if(!P)return P;const q=new Date().toISOString();return{...P,status:"closed",discussionId:k?.discussionId??P.discussionId,updatedAt:q,closedAt:k?.closedAt??q,closedReason:k?.reason,isWaitingForFirstProviderReply:!1}}))},Me=(k,P)=>{G.current&&Ue("Replacing customer support socket"),v("connecting");let q=!1,ee=!1;const ye=Ee=>{M(Ee),v("failed"),o("notLoading")},Qe=Ee=>{G.current=null;const ke=om(be.current);if(!ke.shouldRetry){a.error("Customer support socket reconnect exhausted code="+Ee.code+" reason="+(Ee.reason||"none")),ye("connection_error");return}be.current+=1,v("connecting"),y("customer_support_connecting"),a.log("Customer support socket reconnect scheduled attempt="+be.current+" delayMs="+ke.delayMs+" code="+Ee.code),he.current=window.setTimeout(()=>{he.current=null,!(Z.current||z.current)&&Me(k,{...P,addConnectedMessage:q?!1:P?.addConnectedMessage})},ke.delayMs)};G.current=new nm({apiUrl:f,appToken:e,handoff:k,callbacks:{onConnected:Ee=>{const ke=k.reconnectToken??k.handoffToken;if(!ke){at({reason:"Missing reconnect token"});return}q=!0,be.current=0,P?.isStoredReconnect&&(j.current=null);const mt=new Date().toISOString();s(Ee.discussionId),M(null),v("connected"),y("customer_support"),o("notLoading"),w(pt=>{const ze=Bc(pt)?pt:null;return{mode:"live_chat",status:"active",discussionId:Ee.discussionId,socketUrl:k.socketUrl,reconnectToken:ke,reconnectTokenExpiresAt:Ee.reconnectTokenExpiresAt??k.reconnectTokenExpiresAt,customerSupportSessionId:Ee.customerSupportSessionId??k.customerSupportSessionId,provider:ze?.provider,isWaitingForFirstProviderReply:ze?.isWaitingForFirstProviderReply??!0,fallbackContactCapture:ze?.fallbackContactCapture,startedAt:ze?.startedAt??mt,updatedAt:mt}}),P?.addConnectedMessage!==!1&&Y(i.connected,"customer_support_connected")},onProviderMessage:Ee=>{M(null),v("connected"),p(ke=>ke==="submitted"?ke:"idle"),w(ke=>!ke||ke.mode==="closed_hours_contact_capture"?ke:{...ke,status:"active",provider:Ee.provider??ke.provider,reconnectTokenExpiresAt:Ee.reconnectTokenExpiresAt??ke.reconnectTokenExpiresAt,isWaitingForFirstProviderReply:!1,updatedAt:new Date().toISOString()}),je(Ee.text,{customerSupportAuthorName:dm(Ee.authorName),customerSupportProvider:Ee.provider})},onClosed:Ee=>{ee=!0,at({reason:Ee.reason,closedAt:Ee.closedAt,discussionId:Ee.discussionId})},onError:Ee=>{ee=!0,a.error("Customer support socket server error code="+Ee.code+" message="+Ee.message),ye(im(Ee.code))},onClose:Ee=>{Z.current||z.current||ee||Qe(Ee)},onTransportError:Ee=>{a.error(`Customer support socket transport error readyState=${Ee.readyState} url=${Ee.url}`)}}})};S.useEffect(()=>{const k=j.current;if(!k)return;const P=Ac(k,n.discussionId);if(P!=="discussion_not_loaded"){if(P==="session_closed"){j.current=null,v("closed"),y("customer_support");return}if(P){j.current=null,w(q=>q?.discussionId===n.discussionId?q:null),v("idle"),y("ai");return}G.current||(v("connecting"),y("customer_support_connecting"),Me({mode:"live_chat",transport:"socket",socketUrl:k.socketUrl,reconnectToken:k.reconnectToken,reconnectTokenExpiresAt:k.reconnectTokenExpiresAt,customerSupportSessionId:k.customerSupportSessionId,discussionId:k.discussionId,fallbackContactCapture:k.fallbackContactCapture},{addConnectedMessage:!1,isStoredReconnect:!0}))}},[n.discussionId]);const ut=k=>{if(k.mode==="closed_hours_contact_capture"){ve(k);return}const P=k.reconnectToken??k.handoffToken;if(!k.discussionId||!P){Y(i.connectionError,"customer_support_connection_error",{isErrorMessage:!0});return}const q=new Date().toISOString();V.current=k,z.current=!1,p("idle"),w({mode:"live_chat",status:"connecting",discussionId:k.discussionId,socketUrl:k.socketUrl,reconnectToken:P,reconnectTokenExpiresAt:k.reconnectTokenExpiresAt,customerSupportSessionId:k.customerSupportSessionId,isWaitingForFirstProviderReply:!0,fallbackContactCapture:k.fallbackContactCapture,startedAt:q,updatedAt:q}),v("connecting"),y("customer_support_connecting"),Y(i.connecting,"customer_support_connecting")},St=()=>{const k=V.current;!k||k.mode!=="live_chat"||(V.current=null,Me(k))},ge=k=>m!=="customer_support"||I!=="connected"||!we||!G.current?(Y(i.connectionError,"customer_support_connection_error",{isErrorMessage:!0}),!1):(G.current.sendCustomerMessage(k),!0);S.useEffect(()=>{if(!J?.enabled||!ne||!we||I!=="connected"||A!=="idle")return;const k=Math.max(1,J.timeoutMinutes)*60*1e3,P=window.setTimeout(()=>{p("visible")},k);return()=>window.clearTimeout(P)},[J,A,we,ne,I]);const Le=async({email:k,phone:P})=>{if(!g?.customerSupportSessionId||!g.reconnectToken)return!1;p("submitting");const q=`${f}/customer-support/sessions/${g.customerSupportSessionId}/fallback-contact`;return(await fetch(q,dn.getFetchConfig({httpVerb:"POST",contentType:"application/json",body:{reconnectToken:g.reconnectToken,reasonType:"fallback_no_reply",email:k,phone:P}}))).ok?(p("submitted"),Ue("Fallback contact submitted"),at({reason:"fallback_contact_submitted",discussionId:g.discussionId}),!0):(p("failed"),!1)},ve=k=>{if(!k.discussionId){Y(i.connectionError,"customer_support_connection_error",{isErrorMessage:!0});return}const P=new Date().toISOString();V.current=null,z.current=!1,Ue("Closed-hours contact capture"),w({mode:"closed_hours_contact_capture",status:"active",discussionId:k.discussionId,reconnectToken:k.reconnectToken,reconnectTokenExpiresAt:k.reconnectTokenExpiresAt,customerSupportSessionId:k.customerSupportSessionId,closedHoursContactCapture:k.closedHoursContactCapture,businessHours:k.businessHours,startedAt:P,updatedAt:P}),v("idle"),y("customer_support"),o("notLoading"),B("visible")},Ae=async({email:k,phone:P,reason:q})=>{if(g?.mode!=="closed_hours_contact_capture")return!1;B("submitting");const ee=f+"/customer-support/sessions/"+g.customerSupportSessionId+"/fallback-contact";return(await fetch(ee,dn.getFetchConfig({httpVerb:"POST",contentType:"application/json",body:{reconnectToken:g.reconnectToken,reasonType:"closed_hours",email:k,phone:P,reason:q}}))).ok?(B("submitted"),at({reason:"closed_hours_contact_submitted",discussionId:g.discussionId}),!0):(B("failed"),!1)};return S.useEffect(()=>{if(le&&g&&g.status!=="closed"&&n.discussionId!==g.discussionId&&n.discussionId===null){if(H.current)return;s(g.discussionId);return}},[n.discussionId,g,le,I,s]),{chatTransportMode:m,contactCaptureInstanceId:String(g?.customerSupportSessionId??g?.startedAt??"unavailable"),socketStatus:I,isCustomerSupportMode:le,isCustomerSupportClosed:E,customerSupportStatusMessage:$,isCustomerSupportInputDisabled:ie,customerSupportInputDisabledReason:oe,enterCustomerSupportMode:ut,flushPendingCustomerSupportHandoff:St,sendToCustomerSupport:ge,fallbackContactCaptureConfig:J,fallbackContactCaptureStatus:A,shouldDisplayFallbackContactCapture:ae,submitFallbackContactCapture:Le,closedHoursContactCaptureConfig:ue,closedHoursBusinessHours:X,closedHoursContactCaptureStatus:L,shouldDisplayClosedHoursContactCapture:re,submitClosedHoursContactCapture:Ae}}const lo=e=>e?!!(e.submitInteractionResult&&e.resumeInteraction)||e.interactiveWidgetCapabilities?.localPreview?K.INTERACTIVE_WIDGET_PROTOCOL_V3:void 0:K.INTERACTIVE_WIDGET_PROTOCOL_V3,Em=e=>e.runtimeAdapter?e.prompt.mode!=="text"?Promise.reject(new Error("WIDGET_RUNTIME_ADAPTER_TEXT_PROMPTS_ONLY")):e.runtimeAdapter.sendTextPrompt(e.prompt.request):e.sendStandardPrompt();class Tm{active=null;logger;constructor(t=console){this.logger=t}start(){return this.active?null:(this.active={id:crypto.randomUUID(),controller:new AbortController,decoder:new Ht(this.logger)},this.active)}hasActiveStream(){return this.active!==null}isCurrent(t){return this.active?.id===t.id}finish(t){return this.isCurrent(t)?(this.active=null,!0):!1}cancel(t){const n=this.active;return n?(this.active=null,n.controller.abort(t),n):null}}const lr=(e,t)=>`chatsystem:interaction:v2:${e}:${t}`,ym=(e,t,n)=>{t.responsePolicy.mode==="resume_turn"&&Lt.setItem(lr(e,t.instanceId),JSON.stringify({continuationId:t.responsePolicy.continuation.continuationId,expiresAt:t.responsePolicy.continuation.expiresAt,resultToken:t.responsePolicy.resultToken,discussionId:n}))},Yn=(e,t)=>{const n=lr(e,t),r=Lt.getItem(n);if(!r)return null;try{const i=JSON.parse(r);return typeof i.continuationId!="string"||typeof i.expiresAt!="string"||typeof i.resultToken!="string"||typeof i.discussionId!="number"||!Number.isSafeInteger(i.discussionId)||i.discussionId<=0||!Number.isFinite(Date.parse(i.expiresAt))||Date.parse(i.expiresAt)<=Date.now()||i.submissionId!==void 0&&typeof i.submissionId!="string"||i.resultAccepted!==void 0&&typeof i.resultAccepted!="boolean"||i.resultStatus!==void 0&&i.resultStatus!=="submitted"&&i.resultStatus!=="cancelled"?(Lt.removeItem(n),null):i}catch{return Lt.removeItem(n),null}},_m=(e,t,n)=>{const r=Yn(e,t);r&&Lt.setItem(lr(e,t),JSON.stringify({...r,submissionId:n,resultAccepted:!0}))},xm=(e,t,n,r="submitted")=>{const i=Yn(e,t);i&&Lt.setItem(lr(e,t),JSON.stringify({...i,submissionId:n,resultAccepted:!1,resultStatus:r}))},fo=(e,t)=>Lt.removeItem(lr(e,t)),Fc=(e,t)=>({"Content-Type":"application/json",[K.INTERACTIVE_WIDGET_RESULT_TOKEN_HEADER]:e,...t?{Authorization:`Bearer ${t}`}:{}}),Sm=(e,t)=>e?.submitInteractionResult?e.submitInteractionResult(t):fetch(`${t.apiUrl}/ai/client-interactions/${encodeURIComponent(t.appToken)}/${encodeURIComponent(t.continuationId)}/result`,{method:"POST",headers:Fc(t.resultToken,t.authorizationToken),body:JSON.stringify({discussionId:t.discussionId,submissionId:t.submissionId,result:t.result}),signal:t.signal}),Cm=(e,t)=>e?.resumeInteraction?e.resumeInteraction(t):fetch(`${t.apiUrl}/ai/client-interactions/${encodeURIComponent(t.appToken)}/${encodeURIComponent(t.continuationId)}/resume`,{method:"POST",headers:Fc(t.resultToken,t.authorizationToken),body:JSON.stringify({discussionId:t.discussionId}),signal:t.signal}),Im=e=>({status:"submitted",actionId:e.actionId,data:e.data??{}}),Am=e=>{const{appToken:t,agentId:n}=e,r=cr(),i=ei(),a=S0(),s=S.useContext(Lc),{appCurrentLang:o}=S.useContext(Ec),{companySettings:u}=S.useContext(Pt),c=Xa({appToken:t,agentId:n}),d=wc({appToken:t,agentId:n}),f=S.useRef(null),h=S.useRef(s),m=S.useRef(new Set),y=S.useRef(null),g=S.useRef(null),w=S.useRef(new Set),I=S.useRef(new Set),v=S.useRef(null),R=S.useRef(null),M=S.useRef(null);M.current||(M.current=new Tm(r));const A=M.current,[p,L]=S.useState(0),{draftStore:B}=S.useContext(Zr);(!f.current||h.current!==s)&&(h.current=s,f.current=new w0(s)),S.useEffect(()=>{const Q=f.current;let de=0,fe=!1;if(!s){B.setOwner(a?null:"anonymous");return}if(!Q)return;const me=async()=>{const Be=++de;try{const dt=await Q.getToken({interactive:!1}),Ut=a?null:await C0(dt);!fe&&Be===de&&B.setOwner(Ut)}catch{Q.clear()}};me();const se=s.subscribe?.(()=>{B.clear(),B.setOwner(null),Q.handleIdentityChanged(),L(Be=>Be+1),me()});return()=>{fe=!0,se?.()}},[s,B,a]);const{genericErrorTranslation:G,tooManyRequestsTranslation:N,discussionFullErrorTranslation:H,customerSupportConnectingTranslation:V,customerSupportConnectedTranslation:j,customerSupportConnectionErrorTranslation:z,customerSupportProviderUnavailableTranslation:Z,customerSupportClosedTranslation:be}=Ka(),{defaultStartingStep:he}=Ja(),{currentConversation:le,setCurrentConversation:we,addEmptyMessageToCurrentConversation:E,addMessageToCurrentConversation:$,removeEmptyAssistantMessageFromCurrentConversation:ne,resetConversation:x,setCurrentConversationId:J,updateCurrentConversationMessageById:ue,updateInteractiveWidget:X,chatboxBootState:ae,resetConversationRequestId:re}=ni(),[oe,ie]=S.useState("notLoading");S.useEffect(()=>{for(const Q of le.items){const de=Q.metaData?.interactiveWidget;de&&["submitted","cancelled","unavailable"].includes(de.state)&&B.remove(Tc(le.discussionId,`interactive:${de.instanceId}`))}},[le,B]);const[Oe,Y]=S.useState(null),[je,Ue]=S.useState(he),[et,it]=S.useState(null),[at,Me]=S.useState(!1),{chatTransportMode:ut,contactCaptureInstanceId:St,isCustomerSupportMode:ge,customerSupportStatusMessage:Le,isCustomerSupportInputDisabled:ve,enterCustomerSupportMode:Ae,flushPendingCustomerSupportHandoff:k,sendToCustomerSupport:P,fallbackContactCaptureConfig:q,fallbackContactCaptureStatus:ee,shouldDisplayFallbackContactCapture:ye,submitFallbackContactCapture:Qe,closedHoursContactCaptureConfig:Ee,closedHoursBusinessHours:ke,closedHoursContactCaptureStatus:mt,shouldDisplayClosedHoursContactCapture:pt,submitClosedHoursContactCapture:ze}=bm({appToken:t,conversationStorageKey:d,currentConversation:le,loadingStatus:oe,labels:{connecting:V,connected:j,connectionError:z,providerUnavailable:Z,closed:be},logger:r,setCurrentConversationId:J,setLoadingStatus:ie,addMessageToCurrentConversation:$,chatboxBootState:ae,resetConversationRequestId:re}),ct=S.useRef(null);ct.current||(ct.current=new Q0({addEmptyMessage:E,updateMessage:ue,onAssistantMessageStart:()=>ie("loadingDisplayedAnswer")}));const tt=ct.current,De=Q=>{A.finish(Q)&&(ie("notLoading"),Ue(he),it(null))},lt=()=>{const Q=A.start();return Q?(ie("loadingIntermediaryStates"),Q):null},Ct=()=>{A.cancel("Cancelling stream on purpose.")&&(r.log("Stream request aborted"),ie("notLoading"),Ue(he),it(null),ne())};S.useEffect(()=>{if(ge){Me(!1);return}const Q=u?.api?.settings?.maxAiResponsesPerDiscussion;Me($0(le,Q))},[u?.api?.settings?.maxAiResponsesPerDiscussion,le.completedAiResponseCount,le.discussionId,ge]);const Os=S.useRef(re);S.useEffect(()=>{Os.current!==re&&(Os.current=re,A.cancel("Conversation reset."),ie("notLoading"),Ue(he),it(null),Me(!1))},[he,re]),S.useEffect(()=>(R.current&&(clearTimeout(R.current),R.current=null),()=>{R.current=setTimeout(()=>{A.cancel("Widget runtime unmounted."),R.current=null},0)}),[A]);const bi=(Q,de)=>{for(const fe of Q)if(Ht.isObjectOutputstreamMessageStartDTO(fe))tt.handleStart(fe);else if(Ht.isObjectOutputstreamMessageDeltaDTO(fe))tt.handleDelta(fe);else if(Ht.isObjectOutputstreamMessageEndDTO(fe))tt.handleEnd(fe);else if(Ht.isObjectOutputstreamLoadingCurrentStepNumberDTO(fe))it(fe.content);else if(Ht.isObjectOutputstreamLoadingCurrentStepNameDTO(fe))Ue(fe.content);else if(Ht.isObjectOutputstreamLoadingNumberOfStepsDTO(fe))Y(fe.content);else if(Ht.isObjectOutputstreamClientEventDTO(fe)){const me=V0(fe);if(me.type==="ai_response_completed")we(se=>z0(se,me.payload,de));else if(me.type==="customer_support_handoff_requested")Ae(me.payload);else if(me.type==="identity_gate_required"){if(m.current.has(me.payload.gateId))continue;m.current.add(me.payload.gateId);const se=f.current;if(!se)continue;me.payload.protocolVersion===K.IDENTITY_GATE_PROTOCOL_V2&&(Number.isSafeInteger(de)&&de>0?R0(c,me.payload.continuation,de):r.warn("Identity continuation ignored without a valid discussion id"),y.current=me.payload.continuation.continuationId),v0({apiUrl:i,appToken:t,payload:me.payload,identitySession:se}).then(()=>{me.payload.protocolVersion===K.IDENTITY_GATE_PROTOCOL_V2&&uo(c)}).catch(Be=>r.error(Be)).finally(()=>{me.payload.protocolVersion===K.IDENTITY_GATE_PROTOCOL_V2&&y.current===me.payload.continuation.continuationId&&(y.current=null)})}else if(me.type==="interactive_widget_requested"){if(le.items.some(se=>se.metaData?.interactiveWidget?.instanceId===me.payload.instanceId))continue;me.payload.responsePolicy.mode==="resume_turn"&&Number.isSafeInteger(de)&&de>0&&ym(c,me.payload,de),$({userType:"assistant",temporaryId:`interactive-widget:${me.payload.instanceId}`,metaData:{interactiveWidget:{protocolVersion:me.payload.protocolVersion,instanceId:me.payload.instanceId,widgetType:me.payload.widgetType,presentation:me.payload.payload,responseMode:me.payload.responsePolicy.mode,state:"active"}}})}else r.warn(`Client event not handled - ${fe.event}`)}else Ht.isObjectOutputstreamErrorDTO(fe)?$({userType:"assistant",metaData:{isErrorMessage:!0},content:fe.message,temporaryId:crypto.randomUUID()}):r.warn(`Packet shape not handled - ${fe}`)},Ei=async(Q,de)=>{const fe=Number.parseInt(Q.headers.get("discussionId")??"",10);if(Number.isNaN(fe)||J(fe),!Q.ok){if(!A.isCurrent(de))return;let Be=G;const dt=await Q.json().catch(()=>null);Q.status===409&&W0(dt)?(Be=H,Me(!0)):Q.status===429&&(Be=N),$({userType:"assistant",content:Be,metaData:{isErrorMessage:!0},temporaryId:crypto.randomUUID()}),De(de);return}const me=Q.body?.getReader();if(!me){De(de);return}const se=new TextDecoder;for(;A.isCurrent(de);){const{done:Be,value:dt}=await me.read();if(!A.isCurrent(de))break;if(dt&&bi(de.decoder.transformNDJSONChunkIntoObjects(se.decode(dt,{stream:!0})),fe),Be){bi(de.decoder.transformNDJSONChunkIntoObjects(se.decode()),fe),bi(de.decoder.flushPending(),fe),k(),De(de);return}}await me.cancel().catch(()=>{})};v.current=Ei,S.useEffect(()=>{if(!s||A.hasActiveStream())return;const Q=O0(c);if(!Q){g.current=null;return}if(g.current===Q.continuationId||y.current===Q.continuationId)return;const de=f.current;if(!de)return;const fe=lt();fe&&(g.current=Q.continuationId,L0({apiUrl:i,appToken:t,discussionId:Q.discussionId,continuation:Q,identitySession:de}).then(async me=>{if(!me){g.current=null,De(fe);return}me.status===401&&de.clear(),D0(me.status)&&uo(c),await v.current?.(me,fe)}).catch(me=>{r.error(me),De(fe)}))},[i,t,s,p,r,c]),S.useEffect(()=>{if(A.hasActiveStream())return;le.items.map(se=>se.metaData?.interactiveWidget).filter(se=>se?.responseMode==="resume_turn"&&(se.state==="active"||se.state==="submitting")).forEach(se=>{!se||I.current.has(se.instanceId)||(I.current.add(se.instanceId),Yn(c,se.instanceId)||X(se.instanceId,Be=>({...Be,state:"unavailable"})))});const Q=le.items.map(se=>se.metaData?.interactiveWidget).find(se=>se?.responseMode==="resume_turn"&&(se.state==="submitting"||se.state==="submitted"||se.state==="cancelled")&&!w.current.has(se.instanceId));if(!Q)return;const de=Yn(c,Q.instanceId);if(!de?.submissionId)return;const fe=lt();if(!fe)return;w.current.add(Q.instanceId),(async()=>{const se=a?void 0:await f.current?.getToken({interactive:!1}).catch(()=>null);return Cm(a,{apiUrl:i,appToken:t,continuationId:de.continuationId,discussionId:de.discussionId,resultToken:de.resultToken,authorizationToken:se??void 0,signal:fe.controller.signal})})().then(async se=>{se.ok?X(Q.instanceId,Be=>({...Be,state:de.resultStatus??"submitted"})):[401,403,404,410].includes(se.status)&&X(Q.instanceId,Be=>({...Be,state:"unavailable"})),await v.current?.(se,fe),se.ok&&fo(c,Q.instanceId)}).catch(se=>{r.error(se),w.current.delete(Q.instanceId),De(fe)})},[i,t,le.items,r,a,A,X,c]);const rf=(Q,de,fe)=>{const me=n?`?agentId=${encodeURIComponent(String(n))}`:"",se=`${i}/ai/prompt/${t}${me}`,Be=lo(a),dt={...s?{[K.IDENTITY_GATE_VERSION_HEADER]:String(K.IDENTITY_GATE_PROTOCOL_V2)}:{},...Be?{[K.INTERACTIVE_WIDGET_VERSION_HEADER]:String(Be)}:{},...de?{Authorization:`Bearer ${de}`}:{}};if(Q.mode==="text"){const yi={query:Q.text,language:o.locale};return le.discussionId&&(yi.discussionId=le.discussionId),{url:se,fetchConfig:dn.getFetchConfig({httpVerb:"POST",body:yi,contentType:"application/json",options:{signal:fe,headers:{...dn.getHeaders({contentType:"application/json"}),...dt}}})}}const Ut=new FormData;return Ut.append("language",o.locale),le.discussionId&&Ut.append("discussionId",String(le.discussionId)),Ut.append("audioInput",Q.audioFile,Q.audioFile.name),{url:se,fetchConfig:{method:"POST",body:Ut,signal:fe,headers:dt}}},Ls=Q=>{const de=lt();return de?((async()=>{let fe=null;if(!a)try{fe=await f.current?.getToken({interactive:!1})??null}catch{f.current?.clear()}const me=Q.mode==="audio"?{mode:"audio"}:{mode:"text",request:{apiUrl:i,appToken:t,agentId:n,query:Q.text,language:o.locale,discussionId:le.discussionId,interactiveWidgetProtocolVersion:lo(a),signal:de.controller.signal}};try{const se=await Em({runtimeAdapter:a,prompt:me,sendStandardPrompt:()=>{const{url:Be,fetchConfig:dt}=rf(Q,fe,de.controller.signal);return fetch(Be,dt)}});se.status===401&&fe&&f.current?.clear(),await Ei(se,de),se.ok&&!de.controller.signal.aborted&&await a?.onAssistantResponseCompleted?.(se)}catch(se){de.controller.signal.aborted||r.error(se),De(de)}})(),!0):!1},Ti=!ge&&(oe!=="notLoading"||at||le.items.some(Q=>Q.metaData?.interactiveWidget?.state==="active"||Q.metaData?.interactiveWidget?.state==="submitting"))||ge&&(oe!=="notLoading"||ve);return{appToken:t,contactCaptureInstanceId:St,agentId:n,loadingStatus:oe,numberOfSteps:Oe,currentStepName:je,currentStepNumber:et,isAtMaxMessages:at,isCustomerSupportMode:ge,customerSupportStatusMessage:Le,fallbackContactCaptureConfig:q,fallbackContactCaptureStatus:ee,shouldDisplayFallbackContactCapture:ye,submitFallbackContactCapture:Qe,closedHoursContactCaptureConfig:Ee,closedHoursBusinessHours:ke,closedHoursContactCaptureStatus:mt,shouldDisplayClosedHoursContactCapture:pt,submitClosedHoursContactCapture:ze,isTextareaDisabled:Ti,cancelRequest:Ct,submitTextMessage:Q=>{if(!Q.trim()||Ti)return!1;if(G0(Q)){const de=Y0(Q,le.discussionId,x);return de?($({userType:"user",content:de,temporaryId:crypto.randomUUID()}),!0):!1}return ut!=="customer_support"&&A.hasActiveStream()?!1:($({userType:"user",content:Q,temporaryId:crypto.randomUUID()}),ut==="customer_support"?(P(Q),!0):Ls({mode:"text",text:Q}))},submitAudio:Q=>Ti||A.hasActiveStream()?!1:Ls({mode:"audio",audioFile:Q}),submitInteractiveWidget:Q=>{const fe=le.items.find(Ge=>Ge.metaData?.interactiveWidget?.instanceId===Q.instanceId)?.metaData?.interactiveWidget;if(!fe||fe.state!=="active"||A.hasActiveStream())return!1;if(fe.responseMode==="none"||fe.responseMode==="local_preview")return X(Q.instanceId,Ge=>({...Ge,state:Q.cancel?"cancelled":"submitted",selectedActionId:Q.actionId})),!0;const me=Yn(c,Q.instanceId);if(!me)return X(Q.instanceId,Ge=>({...Ge,state:"unavailable"})),!1;const se=lt();if(!se)return!1;const Be=crypto.randomUUID();xm(c,Q.instanceId,Be,Q.cancel?"cancelled":"submitted"),X(Q.instanceId,Ge=>({...Ge,state:"submitting",selectedActionId:Q.actionId}));const dt=Q.cancel?{status:"cancelled"}:Im(Q),Ut=async()=>{const Ge=a?void 0:await f.current?.getToken({interactive:!1}).catch(()=>null);return Sm(a,{apiUrl:i,appToken:t,continuationId:me.continuationId,discussionId:me.discussionId,submissionId:Be,result:dt,resultToken:me.resultToken,authorizationToken:Ge??void 0,signal:se.controller.signal})};return(async()=>{try{return await Ut()}catch(Ge){if(se.controller.signal.aborted)throw Ge;return Ut()}})().then(async Ge=>{Ge.ok?(_m(c,Q.instanceId,Be),X(Q.instanceId,Fn=>({...Fn,state:Q.cancel?"cancelled":"submitted"}))):[401,403,404,410].includes(Ge.status)&&X(Q.instanceId,Fn=>({...Fn,state:"unavailable"})),await Ei(Ge,se),Ge.ok&&fo(c,Q.instanceId)}).catch(Ge=>{r.error(Ge),X(Q.instanceId,Fn=>({...Fn,state:"submitting"})),De(se)}),!0}}},Uc=S.createContext(null),wm=({appToken:e,agentId:t,children:n})=>{const r=Am({appToken:e,agentId:t});return b.jsx(Uc.Provider,{value:r,children:n})},Hc=()=>{const e=S.useContext(Uc);if(!e)throw new Error("useChatRuntime must be used within ChatRuntimeProvider");return e},jc=S.createContext(null),vm=jc.Provider,km=()=>{const e=S.useContext(jc);if(!e)throw new Error("useWidgetRuntimeStatus must be used within WidgetRuntime");return e},Nm=({children:e,appToken:t,agentId:n,logger:r,identityProvider:i,runtimeAdapter:a})=>{const s=navigator.language;r.log("Brower language",s);const o=Yh(s,r),{appCurrentLang:u,handleSetContextCurrentLang:c}=Bh(Jr,o),d={appCurrentLang:u,setAppCurrentLang:c},[f,h]=S.useState(!1),m=S.useCallback(()=>h(!0),[]),{contextCompanySettings:y,contextInitialConversationState:g}=d0({agentId:n,appToken:t,onFetched:m,runtimeAdapter:a});return S.useEffect(()=>{E0(y.companySettings,r)},[y.companySettings,r]),b.jsx(Dc.Provider,{value:a,children:b.jsx(Lc.Provider,{value:i,children:b.jsx(Rh,{locale:u?.locale,messages:u?.translatedText,children:b.jsx(Ec.Provider,{value:d,children:b.jsx(Pt.Provider,{value:y,children:b.jsx(Zr.Provider,{value:g,children:b.jsx(vm,{value:{hasFetchedSettings:f},children:b.jsx(wm,{appToken:t,agentId:n,children:e})})})})})})})})};function Vc({appToken:e,agentId:t,shouldDisplayLogs:n,apiUrl:r,identityProvider:i,runtimeAdapter:a,children:s}){const o=S.useMemo(()=>Wh(n),[n]),u=Xa({appToken:e,agentId:t});return S.useEffect(()=>{e.trim()||o.error("App Token missing")},[e,o]),b.jsx(Xh,{apiUrl:r,children:b.jsx(Ic.Provider,{value:o,children:b.jsx(Nm,{appToken:e,agentId:t,logger:o,identityProvider:i,runtimeAdapter:a,children:s},u)})})}const zc=e=>qe.createElement("svg",{fill:"#000000",height:"800px",width:"800px",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 330 330",xmlSpace:"preserve",...e},qe.createElement("path",{id:"XMLID_102_",d:"M325.607,79.393c-5.857-5.857-15.355-5.858-21.213,0.001l-139.39,139.393L25.607,79.393 c-5.857-5.857-15.355-5.858-21.213,0.001c-5.858,5.858-5.858,15.355,0,21.213l150.004,150c2.813,2.813,6.628,4.393,10.606,4.393 s7.794-1.581,10.606-4.394l149.996-150C331.465,94.749,331.465,85.251,325.607,79.393z"})),Rm=({src:e})=>{const[t,n]=S.useState(null);return S.useEffect(()=>{let r=!1;return kc(e).then(({blobUrl:i})=>{n(i)}).catch(()=>n(null)),()=>{t&&!r&&(URL.revokeObjectURL(t),r=!0)}},[e]),b.jsx("img",{src:t??e,decoding:"async",loading:"eager"})};function Om(e){return!!e&&typeof e=="object"&&"blob"in e&&e.blob instanceof Blob}function Lm({src:e,autoplay:t=!0,loop:n=!0,className:r,style:i,placeholder:a,fallback:s,onLoaded:o,onError:u}){const[c,d]=S.useState({kind:"loading"});return S.useEffect(()=>{let f=null,h=!1;return d({kind:"loading"}),Nc(e).then(async m=>{if(!h)if(m.kind==="zip"){const y=Om(m)?m.blob:await(await fetch(m.blobUrl)).blob();f=URL.createObjectURL(y),d({kind:"lottieZip",blobUrl:f}),o?.(f)}else d({kind:"json",data:m.data}),o?.(m.data)}).catch(m=>!h&&(d({kind:"error",err:m}),u?.(m))),()=>{h=!0,f&&URL.revokeObjectURL(f)}},[e]),c.kind==="loading"?b.jsx("div",{className:"flex items-center justify-center rounded-xl border border-dashed p-6 text-sm opacity-70 "+(r??""),style:{minHeight:96,...i},children:a??"Loading animation…"}):c.kind==="error"?b.jsx("div",{className:"flex items-center justify-center rounded-xl border p-6 text-sm text-red-600 "+(r??""),style:{minHeight:96,...i},children:s??"Failed to load animation"}):c.kind==="json"?b.jsx(af,{animationData:c.data,loop:n,autoplay:t,className:r,style:i,rendererSettings:{preserveAspectRatio:"xMidYMid meet"}}):b.jsx(sf.DotLottieReact,{src:c.blobUrl,loop:n,autoplay:t,className:r,style:i})}async function Dm(e,t={}){const{minPeriod:n=8,maxPeriod:r=Math.floor(Math.min(e.width,e.height)/2),gutterSearchRadius:i=3,debug:a=!1}=t,s=Vt();if(e.width<n*2||e.height<n*2)return a&&s.warn("detectGrid: image too small"),null;const o=document.createElement("canvas");o.width=e.naturalWidth,o.height=e.naturalHeight;const u=o.getContext("2d");if(!u)return null;u.drawImage(e,0,0);const{data:c}=u.getImageData(0,0,o.width,o.height),d=o.width,f=o.height,h=new Uint8ClampedArray(d*f);for(let H=0;H<f;H++){const V=H*d;for(let j=0;j<d;j++){const z=(V+j)*4;h[V+j]=.299*c[z]+.587*c[z+1]+.114*c[z+2]|0}}const m=new Float32Array(d),y=new Float32Array(f);for(let H=1;H<d-1;H++){let V=0;for(let j=0;j<f;j++){const z=j*d+H,Z=h[z+1]-h[z-1];V+=Math.abs(Z)}m[H]=V}for(let H=1;H<f-1;H++){let V=0;for(let j=0;j<d;j++){const z=H*d+j,Z=h[z+d]-h[z-d];V+=Math.abs(Z)}y[H]=V}const g=ho(m,n,Math.min(r,d/2)),w=ho(y,n,Math.min(r,f/2));if(!g||!w)return a&&s.warn("detectGrid: could not find periods"),null;const I=Math.max(1,Math.round(d/g)),v=Math.max(1,Math.round(f/w)),R=mo(m,g,I,i),M=mo(y,w,v,i),A=Math.max(1,g-R),p=Math.max(1,w-M);if(A*I>d+2||p*v>f+2)return a&&s.warn("detectGrid: sanity check failed"),null;const L=Ea(m,60),B=Ea(y,60),G=Math.max(0,po(m,L)),N=Math.max(0,po(y,B));return a&&s.log({periodX:g,periodY:w,columns:I,rows:v,gutterX:R,gutterY:M,frameWidth:A,frameHeight:p,originX:G,originY:N}),{columns:I,rows:v,frameWidth:A,frameHeight:p,gutterX:R,gutterY:M,originX:G,originY:N}}function ho(e,t,n){const r=$c(e);let i=0;for(let m=0;m<e.length;m++){const y=e[m]-r;i+=y*y}if(i===0)return null;const a=new Float32Array(n+1);let s=0,o=-1/0;for(let m=t;m<=n;m++){let y=0;for(let w=0;w+m<e.length;w++)y+=(e[w]-r)*(e[w+m]-r);const g=y/i;a[m]=g,g>o&&(o=g,s=m)}if(s<=t||s>=n)return s||null;const u=a[s-1],c=a[s],d=a[s+1],f=u-2*c+d,h=f===0?0:.5*(u-d)/f;return s+h}function mo(e,t,n,r){const i=[];for(let o=1;o<n;o++){const u=o*t;let c=1/0,d=u;for(let f=-r;f<=r;f++){const h=u+f;if(h<=0||h>=e.length)continue;const m=e[h];m<c&&(c=m,d=h)}i.push(d)}if(i.length<1)return 0;const a=[];for(const o of i){const u=e[o]*1.5+Ea(e,10)*.5;let c=o,d=o;for(;c>1&&e[c-1]<=u;)c--;for(;d<e.length-2&&e[d+1]<=u;)d++;a.push(Math.max(0,d-c+1))}const s=Math.round($c(a));return Math.max(0,Math.min(s,Math.floor(t/4)))}function $c(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}function Ea(e,t){const n=Array.from(e);n.sort((i,a)=>i-a);const r=Math.max(0,Math.min(n.length-1,Math.floor(t/100*n.length)));return n[r]}function po(e,t){for(let n=0;n<e.length;n++)if(e[n]>t)return n;return 0}function Pm(e,t,n,r,i){const{data:a}=e.getImageData(t,n,r,i);let s=0;for(let o=3;o<a.length;o+=4)s+=a[o];return s/(255*(a.length/4))<.03}const Mm=S.forwardRef(function({src:t,frameWidth:n,frameHeight:r,columns:i,rows:a,gutterX:s=0,gutterY:o=0,frameCount:u,atlasFrames:c,fps:d=12,autoplay:f=!0,loop:h=!0,startFrame:m=0,direction:y="forward",scale:g=1,backgroundColor:w,className:I,style:v,pauseWhenHidden:R=!1,originX:M,originY:A,onLoad:p,onEnd:L,onFrame:B},G){const N=cr(),H=S.useRef(null),V=S.useRef(null),[j,z]=S.useState(null),[Z,be]=S.useState(null),[he,le]=S.useState(null),[we,E]=S.useState(!1),[$,ne]=S.useState(!!f),[x,J]=S.useState(m),ue=S.useRef(1),[X,ae]=S.useState(null),re=Math.max(1,Math.floor(typeof window<"u"&&window.devicePixelRatio||1));S.useEffect(()=>{let ge=!1;return E(!1),Rc(t).then(({imgEl:Le,bitmap:ve})=>{ge||(z(Le),be(ve),le({w:Le.naturalWidth,h:Le.naturalHeight}),E(!0),p?.())}).catch(()=>{}),()=>{ge=!0}},[t,p]),S.useEffect(()=>{let ge=!1;return(async()=>{if(!j)return;if(c&&c.length){ae(null);return}if(!(!n||!r||!i||!a)){ae(null);return}const ve=await Dm(j,{debug:!0});ge||(ve?ae({frameWidth:ve.frameWidth,frameHeight:ve.frameHeight,columns:ve.columns,rows:ve.rows,gutterX:ve.gutterX,gutterY:ve.gutterY}):(ae(null),N.warn("RemoteSpritesheet: auto-detect failed; please provide grid props.")))})(),()=>{ge=!0}},[j,c,n,r,i,a,N]);const oe=X?.frameWidth??n,ie=X?.frameHeight??r,Oe=X?.columns??i,Y=X?.rows??a,je=X?.gutterX??s,Ue=X?.gutterY??o,et=X?.originX??M??0,it=X?.originY??A??0,at=S.useMemo(()=>{if(c&&c.length>0)return{cols:0,rows:0};if(!he||!oe||!ie)return{cols:0,rows:0};const ge=Oe??Math.floor((he.w+je)/(oe+je)),Le=Y??Math.floor((he.h+Ue)/(ie+Ue));return{cols:Math.max(0,ge),rows:Math.max(0,Le)}},[c,he,oe,ie,Oe,Y,je,Ue]),Me=S.useMemo(()=>{if(c?.length)return c;if(!oe||!ie)return[];const{cols:ge,rows:Le}=at;if(!ge||!Le)return[];const ve=Math.min(u??ge*Le,ge*Le),Ae=[];for(let k=0;k<ve;k++){const P=k%ge,q=Math.floor(k/ge),ee=et+P*(oe+je),ye=it+q*(ie+Ue);Ae.push({x:ee,y:ye,w:oe,h:ie})}if(j&&Ae.length){const k=document.createElement("canvas");k.width=j.naturalWidth,k.height=j.naturalHeight;const P=k.getContext("2d");if(P){P.drawImage(j,0,0);let q=Ae.length;for(;q>0&&Pm(P,Ae[q-1].x,Ae[q-1].y,Ae[q-1].w,Ae[q-1].h);)q--;return Ae.slice(0,q)}}return Ae},[c,at,u,oe,ie,je,Ue,j,et,it]),ut=()=>{const ge=H.current;if(!ge||Me.length===0)return;const Le=Me[Math.max(0,Math.min(x,Me.length-1))],ve=Math.max(1,Math.round(Le.w*g)),Ae=Math.max(1,Math.round(Le.h*g));ge.style.width=ve+"px",ge.style.height=Ae+"px",ge.width=ve*re,ge.height=Ae*re};S.useEffect(()=>{ut()},[we,g,Me.length,re,x]);const St=ge=>{const Le=Z??j??null,ve=H.current;if(!ve||!Le||Me.length===0)return;const Ae=ve.getContext("2d");if(!Ae)return;Ae.save(),Ae.setTransform(1,0,0,1,0,0),Ae.clearRect(0,0,ve.width,ve.height),w&&(Ae.fillStyle=w,Ae.fillRect(0,0,ve.width,ve.height));const k=Me[ge];Ae.scale(re,re),Ae.drawImage(Le,k.x,k.y,k.w,k.h,0,0,Math.round(k.w*g),Math.round(k.h*g)),Ae.restore()};return S.useEffect(()=>{if(!we||Me.length===0)return;let ge=performance.now();const Le=1e3/Math.max(1,Math.min(120,d)),ve=Ae=>{if(V.current=requestAnimationFrame(ve),!$){St(x);return}const k=Ae-ge;if(k<Le){St(x);return}ge=Ae-k%Le,J(P=>{const q=Me.length-1;let ee=P;return y==="forward"?ee=P+1:y==="backward"?ee=P-1:((P>=q&&ue.current===1||P<=0&&ue.current===-1)&&(ue.current*=-1),ee=P+ue.current),(ee>q||ee<0)&&(h?ee=y==="backward"?q:0:(ee=Math.max(0,Math.min(ee,q)),ne(!1),L?.())),ee})};return V.current=requestAnimationFrame(ve),()=>{V.current&&cancelAnimationFrame(V.current)}},[we,d,$,h,y,Me.length,x]),S.useEffect(()=>{St(x),B?.(x)},[x,we,g,re]),S.useEffect(()=>{if(!R)return;const ge=()=>{document.hidden&&ne(!1)};return document.addEventListener("visibilitychange",ge),()=>document.removeEventListener("visibilitychange",ge)},[R]),S.useImperativeHandle(G,()=>({play:()=>ne(!0),pause:()=>ne(!1),toggle:()=>ne(ge=>!ge),gotoFrame:ge=>J(()=>Math.max(0,Math.min(ge,Math.max(0,Me.length-1)))),isPlaying:()=>$,currentFrame:()=>x}),[$,x,Me.length]),b.jsx("div",{className:I,style:v,children:b.jsx("canvas",{ref:H,"aria-label":"spritesheet animation"})})});function Bm({url:e,className:t}){const[n,r]=S.useState(""),[i,a]=S.useState(null);return S.useEffect(()=>{let s=!1;return vc(e).then(({sanitized:o})=>{s||(r(o),a(null))}).catch(o=>!s&&a(o.message??"Failed to load")),()=>{s=!0}},[e]),i?b.jsxs("div",{className:t,role:"alert",children:["Couldn’t load SVG: ",i]}):n?b.jsx("div",{className:t,dangerouslySetInnerHTML:{__html:n}}):b.jsx("div",{className:t})}function Fm({mobile:e=.6,tablet:t=.8,desktop:n=1}){const[r,i]=S.useState(n);return S.useEffect(()=>{if(typeof window>"u")return;const a=[{mq:window.matchMedia("(max-width: 639px)"),value:e},{mq:window.matchMedia("(min-width: 640px) and (max-width: 1023px)"),value:t},{mq:window.matchMedia("(min-width: 1024px)"),value:n}],s=()=>{for(const{mq:o,value:u}of a)if(o.matches){i(u);break}};return a.forEach(({mq:o})=>o.addEventListener("change",s)),s(),()=>{a.forEach(({mq:o})=>o.removeEventListener("change",s))}},[e,t,n]),r}const ns=({facet:e})=>{const t=cr(),{mode:n,assetUrl:r,spr_columns:i,spr_fps:a,spr_frameCount:s,spr_frameHeight:o,spr_frameWidth:u,spr_gutterX:c,spr_gutterY:d,spr_rows:f,spr_originX:h,spr_originY:m,spr_scaleDesktop:y,spr_scaleMobile:g,spr_scaleTablet:w}=e,I=Fm({mobile:g??.6,tablet:w??.8,desktop:y??1});return b.jsxs("div",{className:"assetContainer",children:[n===K.AgentDisplayFacetModeType.LOTTIE&&b.jsx(Lm,{src:r,autoplay:!0,onError:v=>t.error(v)}),n===K.AgentDisplayFacetModeType.SVG&&b.jsx("div",{children:b.jsx(Bm,{url:r})}),n===K.AgentDisplayFacetModeType.IMAGE&&b.jsx(Rm,{src:r}),n===K.AgentDisplayFacetModeType.SPRITESHEET&&b.jsx(Mm,{src:r,frameCount:s,columns:i,rows:f,fps:a,frameHeight:o,frameWidth:u,gutterX:c,gutterY:d,originX:h,originY:m,scale:I,autoplay:!0})]})},Um=({launcherRef:e,isWidgetOpen:t,setIsWidgetOpen:n})=>{const{companySettings:r}=S.useContext(Pt);return b.jsxs("div",{ref:e,className:`launcher
|
|
36
|
+
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function Oh(e,t){var n=dh(t),r=ie(ie({},gc),e),i=r.locale,a=r.defaultLocale,s=r.onError;return i?!Intl.NumberFormat.supportedLocalesOf(i).length&&s?s(new Zs('Missing locale data for locale: "'.concat(i,'" in Intl.NumberFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(i).length&&s&&s(new Zs('Missing locale data for locale: "'.concat(i,'" in Intl.DateTimeFormat. Using default locale: "').concat(a,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(s&&s(new oh('"locale" was not configured, using "'.concat(a,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),r.locale=r.defaultLocale||"en"),Rh(r),ie(ie({},r),{formatters:n,formatNumber:vh.bind(null,r,n.getNumberFormat),formatNumberToParts:kh.bind(null,r,n.getNumberFormat),formatRelativeTime:Ah.bind(null,r,n.getRelativeTimeFormat),formatDate:fh.bind(null,r,n.getDateTimeFormat),formatDateToParts:ph.bind(null,r,n.getDateTimeFormat),formatTime:hh.bind(null,r,n.getDateTimeFormat),formatDateTimeRange:mh.bind(null,r,n.getDateTimeFormat),formatTimeToParts:gh.bind(null,r,n.getDateTimeFormat),formatPlural:Sh.bind(null,r,n.getPluralRules),formatMessage:ya.bind(null,r,n),$t:ya.bind(null,r,n),formatList:_h.bind(null,r,n.getListFormat),formatListToParts:Tc.bind(null,r,n.getListFormat),formatDisplayName:Eh.bind(null,r,n.getDisplayNames)})}function _c(e){Ku(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var xc=ie(ie({},gc),{textComponent:Ke.Fragment});function Lh(e){return function(t){return e(Ke.Children.toArray(t))}}function Dh(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var s=n[a];if(e[s]!==t[s]||!Object.prototype.hasOwnProperty.call(t,s))return!1}return!0}var Qa=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=Ke.createContext(null)):Ke.createContext(null);Qa.Consumer;var Ph=Qa.Provider,Mh=Ph,Bh=Qa;function Kt(){var e=Ke.useContext(Bh);return _c(e),e}var _a;(function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"})(_a||(_a={}));var xa;(function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"})(xa||(xa={}));function Sc(e){var t=function(n){var r=Kt(),i=n.value,a=n.children,s=Zr(n,["value","children"]),o=typeof i=="string"?new Date(i||0):i,u=e==="formatDate"?r.formatDateToParts(o,s):r.formatTimeToParts(o,s);return a(u)};return t.displayName=xa[e],t}function ur(e){var t=function(n){var r=Kt(),i=n.value,a=n.children,s=Zr(n,["value","children"]),o=r[e](i,s);if(typeof a=="function")return a(o);var u=r.textComponent||Ke.Fragment;return Ke.createElement(u,null,o)};return t.displayName=_a[e],t}function Cc(e){return e&&Object.keys(e).reduce(function(t,n){var r=e[n];return t[n]=mc(r)?Lh(r):r,t},{})}var ro=function(e,t,n,r){for(var i=[],a=4;a<arguments.length;a++)i[a-4]=arguments[a];var s=Cc(r),o=ya.apply(void 0,Rt([e,t,n,s],i,!1));return Array.isArray(o)?Ke.Children.toArray(o):o},io=function(e,t){var n=e.defaultRichTextElements,r=Zr(e,["defaultRichTextElements"]),i=Cc(n),a=Oh(ie(ie(ie({},xc),r),{defaultRichTextElements:i}),t),s={locale:a.locale,timeZone:a.timeZone,fallbackOnEmptyString:a.fallbackOnEmptyString,formats:a.formats,defaultLocale:a.defaultLocale,defaultFormats:a.defaultFormats,messages:a.messages,onError:a.onError,defaultRichTextElements:i};return ie(ie({},a),{formatMessage:ro.bind(null,s,a.formatters),$t:ro.bind(null,s,a.formatters)})};function Ni(e){return{locale:e.locale,timeZone:e.timeZone,fallbackOnEmptyString:e.fallbackOnEmptyString,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,onWarn:e.onWarn,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}var Fh=(function(e){Tt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.cache=bc(),n.state={cache:n.cache,intl:io(Ni(n.props),n.cache),prevConfig:Ni(n.props)},n}return t.getDerivedStateFromProps=function(n,r){var i=r.prevConfig,a=r.cache,s=Ni(n);return Dh(i,s)?null:{intl:io(s,a),prevConfig:s}},t.prototype.render=function(){return _c(this.state.intl),Ke.createElement(Mh,{value:this.state.intl},this.props.children)},t.displayName="IntlProvider",t.defaultProps=xc,t})(Ke.PureComponent);ur("formatDate");ur("formatTime");ur("formatNumber");ur("formatList");ur("formatDisplayName");Sc("formatDate");Sc("formatTime");const Uh={"generic.language.english":"English","generic.language.french":"French","chatbot.placeholder.content":"Message...","chatbot.DiscussionLimitReached.title":"Discussion limit reached","chatbot.DiscussionLimitReached.explaination":"You have used the available AI answers for this discussion. Start a new conversation to continue.","chatbot.DiscussionLimitReached.cta":"Restart","chatbot.error.api.409":"Oups ! The discussion if full. Please start a new one.","chatbot.error.api.429":"⏳ The chatbot is a little busy at the time. Please try again later.","chatbot.error.api.500":"Oops ! There has been an error. Please try again later.","chatbot.chatline.label.user":"You","chatbot.chatline.label.assistant":"Assistant","chatbot.chatline.label.customerSupport":"Customer support","chatbot.chatline.loading.function.genericSearchMessage":"Thinking ...","chatbot.chatline.loading.function.search":"Search","chatbot.chatline.loading.function.extractProductName":"Looking into the cavern","chatbot.chatline.loading.function.suggestProductName":"Consulting the shadocks","chatbot.chatline.loading.function.criteriaDefinition":"Looking for ziboublis","chatbot.chatline.loading.function.searchStock":"Searching Stock","chatbot.chatline.loading.function.step":"Step","chatbot.chatline.loading.stepName.search":"Searching ...","chatbot.chatline.loading.stepName.building":"Building Query ...","chatbot.chatline.loading.stepName.analyzing":"Analyzing ...","chatbot.chatline.loading.stepName.redacting":"Writing answer","chatbot.chatline.loading.cancel":"Cancel","chatbot.chatline.seeRecentMessages":"see recent messages","chatbot.widget.menu.open":"Open chat menu","chatbot.widget.menu.startNewDiscussion":"Start a new discussion","chatbot.widget.close":"Close chat","chatbot.widget.open":"Open chat","chatbot.error.connectionInterrupted":"The connection was interrupted. The reply may be incomplete. Your messages remain in the conversation.","recordingOverlay.recording":"Recording...","recordingOverlay.cancel":"Cancel","recordingOverlay.explaination":"Tap the mic to stop","chatbot.infobanner.title":"You have an archived discussion.","chatbot.infobanner.cta":"See","chatbot.customerSupport.connecting":"Transferring your request to customer support...","chatbot.customerSupport.connected":"Your request has been sent to Customer Support. It usually takes a few minutes to get a reply. Thank you for waiting.","chatbot.customerSupport.connectionError":"Customer support is not available right now. Please try again later.","chatbot.customerSupport.providerUnavailable":"Customer support received your request, but live replies are temporarily unavailable. Please try again shortly.","chatbot.customerSupport.closed":"Your customer support conversation is now complete. Start a new conversation if you need more help!","chatbot.customerSupport.restart":"Restart","chatbot.customerSupport.fallback.title":"Leave your contact details","chatbot.customerSupport.fallback.description":"Customer support has not replied yet. Leave your email and phone number and we will contact you soon.","chatbot.customerSupport.fallback.email":"Email","chatbot.customerSupport.fallback.phone":"Phone","chatbot.customerSupport.fallback.submit":"Send","chatbot.customerSupport.fallback.submitting":"Sending...","chatbot.customerSupport.fallback.success":"Your contact details have been saved. Customer support will contact you soon.","chatbot.customerSupport.closedHours.title":"Customer support is currently closed","chatbot.customerSupport.closedHours.description":"Leave your email, phone number and request. Customer support will contact you during opening hours.","chatbot.customerSupport.closedHours.schedulePrefix":"Today:","chatbot.customerSupport.closedHours.reason":"Reason for your request","chatbot.customerSupport.closedHours.success":"Your request has been saved. Customer support will contact you during opening hours.","chatbot.customerSupport.fallback.error":"We could not save your contact details. Please try again.","chatbot.interactiveWidget.submitting":"Sending…","chatbot.interactiveWidget.submitted":"Sent","chatbot.interactiveWidget.cancelled":"Cancelled","chatbot.interactiveWidget.unavailable":"This interaction is no longer available.","chatbot.interactiveWidget.preview.notice":"Demo mode — this form reproduces the real experience. Submitting it does not create a request or transmit your answers.","chatbot.interactiveWidget.preview.completed":"You have tested this form. No request was sent and your answers were not transmitted.","chatbot.interactiveWidget.preview.cancelled":"You have closed the demo form. No information was transmitted."},Hh={"generic.language.english":"Anglais","generic.language.french":"Français","chatbot.placeholder.content":"Message...","chatbot.DiscussionLimitReached.title":"Cette conversation est terminée.","chatbot.DiscussionLimitReached.explaination":"Vous avez utilisé les réponses IA disponibles pour cette discussion. Commencez une nouvelle conversation pour continuer.","chatbot.DiscussionLimitReached.cta":"Relancer une nouvelle conversation","chatbot.error.api.409":"Oups ! La discussion est à son maximum. Merci d'en commencer une nouvelle.","chatbot.error.api.429":"⏳ Le robot est un peu occupé actuellement. Merci de réessayer plus tard.","chatbot.error.api.500":"Oups ! Une erreur est survenue. Merci de réessayer plus tard !","chatbot.chatline.label.user":"Vous","chatbot.chatline.label.assistant":"Assistant","chatbot.chatline.label.customerSupport":"Support client","chatbot.chatline.loading.function.search":"Recherche","chatbot.chatline.loading.function.genericSearchMessage":"Je réfléchis ...","chatbot.chatline.loading.function.extractProductName":"Recherche dans la caverne","chatbot.chatline.loading.function.suggestProductName":"Consultation des shadocks","chatbot.chatline.loading.function.criteriaDefinition":"Recherche des ziboublis","chatbot.chatline.loading.function.searchStock":"Recherche en stock","chatbot.chatline.loading.function.step":"Etape","chatbot.chatline.loading.stepName.search":"Recherche ...","chatbot.chatline.loading.stepName.building":"Construction ...","chatbot.chatline.loading.stepName.analyzing":"Analyse ...","chatbot.chatline.loading.stepName.redacting":"Rédaction","chatbot.chatline.loading.cancel":"Annuler","chatbot.chatline.seeRecentMessages":"voir les messages plus récents","chatbot.widget.menu.open":"Ouvrir le menu de discussion","chatbot.widget.menu.startNewDiscussion":"Démarrer une nouvelle discussion","chatbot.widget.close":"Fermer la discussion","chatbot.widget.open":"Ouvrir la discussion","chatbot.error.connectionInterrupted":"La connexion a été interrompue. La réponse peut être incomplète. Vos messages restent dans la discussion.","recordingOverlay.recording":"Micro activé...","recordingOverlay.cancel":"Annuler","recordingOverlay.explaination":"Appuyez sur le micro pour arrêter","chatbot.infobanner.title":"Vous avez une conversation archivée.","chatbot.infobanner.cta":"Voir","chatbot.customerSupport.connecting":"Transfert de votre demande au support client...","chatbot.customerSupport.connected":"Votre demande a été transmise au support client. Il faut généralement quelques minutes pour obtenir une réponse. Merci de patienter.","chatbot.customerSupport.connectionError":"Le support client n'est pas disponible pour le moment. Merci de réessayer plus tard.","chatbot.customerSupport.providerUnavailable":"Le support client a reçu votre demande, mais les réponses en direct sont temporairement indisponibles. Merci de réessayer dans quelques instants.","chatbot.customerSupport.closed":"Votre échange avec le support client est terminé. Relancez une nouvelle conversation quand vous le souhaitez !","chatbot.customerSupport.restart":"Relancer","chatbot.customerSupport.fallback.title":"Laissez vos coordonnées","chatbot.customerSupport.fallback.description":"Le support client n'a pas encore répondu. Laissez votre email et votre téléphone, nous vous recontacterons prochainement.","chatbot.customerSupport.fallback.email":"Email","chatbot.customerSupport.fallback.phone":"Téléphone","chatbot.customerSupport.fallback.submit":"Envoyer","chatbot.customerSupport.fallback.submitting":"Envoi...","chatbot.customerSupport.fallback.success":"Vos coordonnées ont bien été notées. Le support client vous recontactera prochainement.","chatbot.customerSupport.closedHours.title":"Le support client est actuellement fermé","chatbot.customerSupport.closedHours.description":"Laissez votre email, votre téléphone et le motif de votre demande. Le support client vous recontactera pendant ses horaires d’ouverture.","chatbot.customerSupport.closedHours.schedulePrefix":"Aujourd’hui :","chatbot.customerSupport.closedHours.reason":"Motif de votre demande","chatbot.customerSupport.closedHours.success":"Votre demande a bien été enregistrée. Le support client vous recontactera pendant ses horaires d’ouverture.","chatbot.customerSupport.fallback.error":"Impossible d'enregistrer vos coordonnées. Merci de réessayer.","chatbot.interactiveWidget.submitting":"Envoi…","chatbot.interactiveWidget.submitted":"Envoyé","chatbot.interactiveWidget.cancelled":"Annulé","chatbot.interactiveWidget.unavailable":"Cette interaction n’est plus disponible.","chatbot.interactiveWidget.preview.notice":"Mode démo — ce formulaire reproduit l’expérience réelle. Son envoi ne crée aucune demande et ne transmet pas vos réponses.","chatbot.interactiveWidget.preview.completed":"Vous avez testé ce formulaire. Aucune demande n’a été envoyée et vos réponses n’ont pas été transmises.","chatbot.interactiveWidget.preview.cancelled":"Vous avez fermé le formulaire de démonstration. Aucune information n’a été transmise."};var pt=(e=>(e.FRENCH="fr-FR",e.ENGLISH="en-US",e))(pt||{});const ti={[pt.ENGLISH]:{translatedText:Uh,pictureName:pt.ENGLISH,langID:0,locale:pt.ENGLISH},[pt.FRENCH]:{translatedText:Hh,pictureName:pt.FRENCH,langID:1,locale:pt.FRENCH}},jh=Object.keys(ti);jh.reduce((e,t)=>{const n=ti[t];return[...e,n]},[]);const Vh="languageSettings";function Ka(e,t=()=>{}){const n=new Map;let r=!1;function i(a){if(!r)try{const s=e();if(s)return a(s)}catch{r=!0,t()}}return{getItem(a){const s=i(o=>o.getItem(a));return s!==void 0?(s===null?n.delete(a):n.set(a,s),s):n.get(a)??null},setItem(a,s){n.set(a,s),i(o=>o.setItem(a,s))},removeItem(a){n.delete(a),i(s=>s.removeItem(a))}}}const cr=Ka(()=>typeof window>"u"?void 0:window.localStorage),Lt=Ka(()=>typeof sessionStorage>"u"?void 0:sessionStorage),zh=(e,t)=>{let n,r;return typeof window<"u"&&(r=cr.getItem(Vh)),r&&e?.[r]!==void 0?n=e[r]:(n=e[t],n.isDefault=!0),n},$h=(e,t)=>{const[n,r]=S.useState(e[t]),i=a=>{Object.keys(e).includes(a?.locale)?r(a):r(e[pt.ENGLISH])};return S.useEffect(()=>{const a=zh(e,t);a.locale!==t&&r(e[a.locale])},[]),{appCurrentLang:n,handleSetContextCurrentLang:i}},Ic=S.createContext({appCurrentLang:ti[pt.ENGLISH],setAppCurrentLang:()=>{}}),St={ai:"ai",customerSupport:"customer_support"},Cr=1,ao=1440*60*1e3,so=32,oo=128e3,Wh=32e3;function uo(e){return typeof e=="string"?!0:!e||typeof e!="object"||Array.isArray(e)?!1:Object.entries(e).every(([t,n])=>!["__proto__","constructor","prototype"].includes(t)&&(typeof n=="boolean"||typeof n=="string"))}function co(e){return JSON.stringify(e).length<=Wh}function Ac(e,t){return JSON.stringify([e??"new",t])}class wc{entries=new Map;listeners=new Set;owner=null;storage;prefix;now;constructor(t,n,r=Date.now){this.storage=t,this.prefix=`chatsystem:drafts:v${Cr}:${encodeURIComponent(n)}:`,this.now=r}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});setOwner(t){if(this.owner===t)return;const n=this.owner===null?new Map(this.entries):new Map;this.entries.clear(),this.owner=t,t&&this.restore(this.prefix+t);for(const[r,i]of n)this.entries.set(r,i);this.persist(),this.emit()}get(t){const n=this.entries.get(t);if(!(!n||n.expiresAt<=this.now()))return n.value}set(t,n,r=!0){if(uo(n)){for(this.entries.delete(t),n!==""&&(typeof n=="string"||Object.keys(n).length>0)&&this.entries.set(t,{value:n,expiresAt:this.now()+ao,persistent:r&&co(n)});this.entries.size>so;){const i=this.entries.keys().next().value;if(i===void 0)break;this.entries.delete(i)}this.persist(),this.emit()}}remove(t){this.entries.delete(t)&&(this.persist(),this.emit())}clear(){this.entries.clear(),this.owner&&this.storage.removeItem(this.prefix+this.owner),this.emit()}emit(){this.listeners.forEach(t=>t())}restore(t){const n=this.storage.getItem(t);if(n)try{if(n.length>oo)throw new Error("oversized");const r=JSON.parse(n);if(r?.version!==Cr||!Array.isArray(r.entries))throw new Error("invalid");for(const i of r.entries.slice(-so)){if(!i||typeof i!="object")continue;const a=typeof i.key=="string"&&i.key.length<=8e3,s=Number.isFinite(i.expiresAt)&&i.expiresAt>this.now()&&i.expiresAt<=this.now()+ao,o=uo(i.value)&&co(i.value);!a||!s||!o||this.entries.set(i.key,{value:i.value,expiresAt:i.expiresAt,persistent:!0})}this.persist()}catch{this.storage.removeItem(t)}}persist(){if(!this.owner)return;const t=[...this.entries].filter(([,r])=>r.persistent&&r.expiresAt>this.now()).map(([r,i])=>({key:r,value:i.value,expiresAt:i.expiresAt}));let n=JSON.stringify({version:Cr,entries:t});for(;n.length>oo&&t.length;)t.shift(),n=JSON.stringify({version:Cr,entries:t});t.length?this.storage.setItem(this.prefix+this.owner,n):this.storage.removeItem(this.prefix+this.owner)}}const ni=S.createContext({draftStore:new wc(Ka(()=>{}),"standalone-preview"),currentConversation:{items:[],discussionId:null},setCurrentConversation:()=>{},archivedConversation:{items:[],discussionId:null},setArchivedConversation:()=>{},chatboxBootState:{mode:St.ai,customerSupportState:null,reason:"context_default"},setChatboxBootState:()=>{},resetConversationRequestId:0,resetConversation:()=>{}});var tn={},Ri={},Hn={},lo;function Ja(){if(lo)return Hn;lo=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.isUnknownRecord=void 0;const e=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);return Hn.isUnknownRecord=e,Hn}var fo;function Gh(){return fo||(fo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isInteractiveWidgetResultWithinSizeLimit=e.isInteractiveWidgetResult=e.isInteractiveWidgetVersionedRequest=e.isInteractiveWidgetV3Request=e.isInteractiveWidgetV2Request=e.isInteractiveWidgetPresentationWithinSizeLimit=e.isInteractiveWidgetPresentation=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS=e.INTERACTIVE_WIDGET_TYPES=e.INTERACTIVE_WIDGET_RESULT_TOKEN_HEADER=e.parseInteractiveWidgetProtocolVersion=e.INTERACTIVE_WIDGET_VERSION_HEADER=e.SUPPORTED_INTERACTIVE_WIDGET_PROTOCOL_VERSIONS=e.INTERACTIVE_WIDGET_PROTOCOL_V3=e.INTERACTIVE_WIDGET_PROTOCOL_V2=e.INTERACTIVE_WIDGET_PROTOCOL_V1=e.INTERACTIVE_WIDGET_EVENTS=void 0;const t=Ja();e.INTERACTIVE_WIDGET_EVENTS={requested:"interactiveWidget.requested"},e.INTERACTIVE_WIDGET_PROTOCOL_V1=1,e.INTERACTIVE_WIDGET_PROTOCOL_V2=2,e.INTERACTIVE_WIDGET_PROTOCOL_V3=3,e.SUPPORTED_INTERACTIVE_WIDGET_PROTOCOL_VERSIONS=Object.freeze([e.INTERACTIVE_WIDGET_PROTOCOL_V2,e.INTERACTIVE_WIDGET_PROTOCOL_V3]),e.INTERACTIVE_WIDGET_VERSION_HEADER="X-ChatSystem-Interactive-Widget-Version";const n=p=>{const O=Array.isArray(p)?p[0]:p;return e.SUPPORTED_INTERACTIVE_WIDGET_PROTOCOL_VERSIONS.find(B=>O===B||O===String(B))};e.parseInteractiveWidgetProtocolVersion=n,e.INTERACTIVE_WIDGET_RESULT_TOKEN_HEADER="X-ChatSystem-Interactive-Widget-Result-Token",e.INTERACTIVE_WIDGET_TYPES={directChatCustomerSupport:"direct_chat_customer_support",callToAction:"call_to_action",structuredForm:"structured_form",cardList:"card_list",statusSummary:"status_summary",explicitConfirmation:"explicit_confirmation"},e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS={maximumPresentationUtf8Bytes:32*1024,maximumResultUtf8Bytes:16*1024,maximumTextCodeUnits:4096,maximumUrlCodeUnits:2048,maximumIdentifierCodeUnits:128,maximumLabelCodeUnits:256,maximumToolCallIdCodeUnits:255,maximumResultTokenCodeUnits:8192,maximumResultStringCodeUnits:16*1024,maximumActionsPerContainer:4,maximumFieldsPerForm:20,maximumCardsPerList:20,maximumItemsPerCollection:50,maximumResultDataEntries:50,maximumResultArrayItems:50};const r=(p,O)=>Object.keys(p).every(B=>O.includes(B)),i=(p,O=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumTextCodeUnits)=>typeof p=="string"&&p.trim().length>0&&p.length<=O,a=(p,O=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumTextCodeUnits)=>p===void 0||i(p,O),s=p=>{if(!i(p,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumUrlCodeUnits))return!1;try{const O=new URL(p);return O.protocol==="http:"||O.protocol==="https:"}catch{return!1}},o=p=>!(0,t.isUnknownRecord)(p)||!i(p.id,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!i(p.label,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)||p.style!==void 0&&!["primary","secondary","danger"].includes(String(p.style))?!1:p.kind==="open_url"?r(p,["id","label","style","kind","url"])&&s(p.url):(p.kind==="submit"||p.kind==="cancel")&&r(p,["id","label","style","kind"]),u=(p,O=!1)=>O&&p===void 0?!0:Array.isArray(p)&&p.length>0&&p.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumActionsPerContainer&&p.every(o)&&new Set(p.map(B=>B.id)).size===p.length,c=p=>p===void 0||Array.isArray(p)&&p.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumItemsPerCollection&&p.every(O=>(0,t.isUnknownRecord)(O)&&r(O,["label","value"])&&i(O.label,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&i(O.value)),d=p=>{const O=p.minLength,B=p.maxLength;return O!==void 0&&(!Number.isSafeInteger(O)||Number(O)<0)||B!==void 0&&(!Number.isSafeInteger(B)||Number(B)<1||Number(B)>e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumTextCodeUnits)?!1:O===void 0||B===void 0||Number(O)<=Number(B)},f=p=>!(0,t.isUnknownRecord)(p)||!i(p.id,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!i(p.label,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)||p.required!==void 0&&typeof p.required!="boolean"||!a(p.description)?!1:p.type==="checkbox"?r(p,["id","label","required","description","type"]):p.type==="select"?r(p,["id","label","required","description","type","placeholder","options"])&&a(p.placeholder,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&Array.isArray(p.options)&&p.options.length>0&&p.options.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumItemsPerCollection&&p.options.every(O=>(0,t.isUnknownRecord)(O)&&r(O,["value","label"])&&i(O.value,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&i(O.label,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits))&&new Set(p.options.map(O=>O.value)).size===p.options.length:["text","email","tel","textarea"].includes(String(p.type))&&r(p,["id","label","required","description","type","placeholder","minLength","maxLength"])&&a(p.placeholder,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&d(p),h=p=>a(p.title,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(p.description),m=p=>{if(!(0,t.isUnknownRecord)(p))return!1;if(p.type===e.INTERACTIVE_WIDGET_TYPES.callToAction)return r(p,["type","title","description","actions"])&&h(p)&&u(p.actions);if(p.type===e.INTERACTIVE_WIDGET_TYPES.structuredForm)return r(p,["type","title","description","fields","submitLabel","cancelLabel"])&&h(p)&&i(p.submitLabel,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(p.cancelLabel,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&Array.isArray(p.fields)&&p.fields.length>0&&p.fields.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumFieldsPerForm&&p.fields.every(f)&&new Set(p.fields.map(O=>O.id)).size===p.fields.length;if(p.type===e.INTERACTIVE_WIDGET_TYPES.cardList){const O=Array.isArray(p.cards)?p.cards.flatMap(B=>(0,t.isUnknownRecord)(B)&&Array.isArray(B.actions)?B.actions.filter(t.isUnknownRecord).map(X=>X.id).filter(X=>typeof X=="string"):[]):[];return r(p,["type","title","description","cards"])&&h(p)&&Array.isArray(p.cards)&&p.cards.length>0&&p.cards.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumCardsPerList&&p.cards.every(B=>(0,t.isUnknownRecord)(B)&&r(B,["id","title","description","imageUrl","eyebrow","metadata","actions"])&&i(B.id,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)&&i(B.title,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(B.description)&&a(B.eyebrow,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&(B.imageUrl===void 0||s(B.imageUrl))&&c(B.metadata)&&u(B.actions,!0))&&new Set(p.cards.map(B=>B.id)).size===p.cards.length&&new Set(O).size===O.length}return p.type===e.INTERACTIVE_WIDGET_TYPES.statusSummary?r(p,["type","title","description","tone","items","actions"])&&i(p.title,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(p.description)&&(p.tone===void 0||["neutral","info","success","warning","danger"].includes(String(p.tone)))&&c(p.items)&&u(p.actions,!0):p.type===e.INTERACTIVE_WIDGET_TYPES.explicitConfirmation?r(p,["type","title","description","confirmLabel","cancelLabel","tone","details"])&&i(p.title,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&a(p.description)&&i(p.confirmLabel,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&i(p.cancelLabel,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumLabelCodeUnits)&&(p.tone===void 0||["neutral","danger"].includes(String(p.tone)))&&c(p.details):!1};e.isInteractiveWidgetPresentation=m;const y=p=>{try{const O=JSON.stringify(p);return typeof O=="string"?new TextEncoder().encode(O).byteLength:null}catch{return null}},b=p=>{const O=y(p);return O!==null&&O<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumPresentationUtf8Bytes};e.isInteractiveWidgetPresentationWithinSizeLimit=b;const A=(p,O)=>(0,t.isUnknownRecord)(p)?p.mode==="none"?r(p,["mode"]):p.mode==="local_preview"?O&&r(p,["mode"]):p.mode==="resume_turn"&&r(p,["mode","continuation","resultToken"])&&(0,t.isUnknownRecord)(p.continuation)&&r(p.continuation,["continuationId","expiresAt"])&&i(p.continuation.continuationId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)&&i(p.continuation.expiresAt,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)&&!Number.isNaN(Date.parse(p.continuation.expiresAt))&&i(p.resultToken,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultTokenCodeUnits):!1,I=p=>!(!(0,t.isUnknownRecord)(p)||!r(p,["type","event","protocolVersion","instanceId","widgetType","source","companyId","agentId","discussionId","toolcallId","payload","responsePolicy"])||p.type!=="interactive_widget_request"||p.event!==e.INTERACTIVE_WIDGET_EVENTS.requested||p.protocolVersion!==e.INTERACTIVE_WIDGET_PROTOCOL_V2||!i(p.instanceId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!["llm_tool","client_trigger","system"].includes(String(p.source))||!Number.isSafeInteger(p.companyId)||p.agentId!==null&&!Number.isSafeInteger(p.agentId)||p.discussionId!==null&&!Number.isSafeInteger(p.discussionId)||p.toolcallId!==null&&!i(p.toolcallId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumToolCallIdCodeUnits)||!(0,e.isInteractiveWidgetPresentation)(p.payload)||!(0,e.isInteractiveWidgetPresentationWithinSizeLimit)(p.payload)||p.widgetType!==p.payload.type||!A(p.responsePolicy,!1));e.isInteractiveWidgetV2Request=I;const w=p=>!(!(0,t.isUnknownRecord)(p)||!r(p,["type","event","protocolVersion","instanceId","widgetType","source","companyId","agentId","discussionId","toolcallId","payload","responsePolicy"])||p.type!=="interactive_widget_request"||p.event!==e.INTERACTIVE_WIDGET_EVENTS.requested||p.protocolVersion!==e.INTERACTIVE_WIDGET_PROTOCOL_V3||!i(p.instanceId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!["llm_tool","client_trigger","system"].includes(String(p.source))||!Number.isSafeInteger(p.companyId)||p.agentId!==null&&!Number.isSafeInteger(p.agentId)||p.discussionId!==null&&!Number.isSafeInteger(p.discussionId)||p.toolcallId!==null&&!i(p.toolcallId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumToolCallIdCodeUnits)||!(0,e.isInteractiveWidgetPresentation)(p.payload)||!(0,e.isInteractiveWidgetPresentationWithinSizeLimit)(p.payload)||p.widgetType!==p.payload.type||!A(p.responsePolicy,!0));e.isInteractiveWidgetV3Request=w;const N=p=>(0,e.isInteractiveWidgetV2Request)(p)||(0,e.isInteractiveWidgetV3Request)(p);e.isInteractiveWidgetVersionedRequest=N;const M=p=>(0,t.isUnknownRecord)(p)?p.status==="cancelled"?Object.keys(p).length===1:!r(p,["status","actionId","data"])||p.status!=="submitted"||!i(p.actionId,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits)||!(0,t.isUnknownRecord)(p.data)||Object.keys(p.data).length>e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultDataEntries?!1:Object.entries(p.data).every(([O,B])=>{if(!i(O,e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumIdentifierCodeUnits))return!1;const X=Array.isArray(B)?B:[B];return X.length>e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultArrayItems?!1:X.every(k=>k===null||typeof k=="string"&&k.length<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultStringCodeUnits||typeof k=="boolean"||typeof k=="number"&&Number.isFinite(k))}):!1;e.isInteractiveWidgetResult=M;const v=p=>{const O=y(p);return O!==null&&O<=e.INTERACTIVE_WIDGET_PROTOCOL_V2_LIMITS.maximumResultUtf8Bytes};e.isInteractiveWidgetResultWithinSizeLimit=v})(Ri)),Ri}var Oi={},ho;function Yh(){return ho||(ho=1,Object.defineProperty(Oi,"__esModule",{value:!0})),Oi}var Li={},mo;function qh(){return mo||(mo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SUPPORTED_DISCUSSION_RESPONSE_LIMIT_PROTOCOL_VERSIONS=e.DISCUSSION_RESPONSE_LIMIT_PROTOCOL_V1=e.AI_RESPONSE_COMPLETED_EVENT=void 0,e.parseDiscussionResponseLimitProtocolVersion=n,e.isAiResponseCompletedPayload=r;const t=Ja();e.AI_RESPONSE_COMPLETED_EVENT="ai.response.completed",e.DISCUSSION_RESPONSE_LIMIT_PROTOCOL_V1=1,e.SUPPORTED_DISCUSSION_RESPONSE_LIMIT_PROTOCOL_VERSIONS=Object.freeze([e.DISCUSSION_RESPONSE_LIMIT_PROTOCOL_V1]);function n(a){return e.SUPPORTED_DISCUSSION_RESPONSE_LIMIT_PROTOCOL_VERSIONS.find(s=>s===a)}function r(a){return!(0,t.isUnknownRecord)(a)||n(a.protocolVersion)===void 0||!i(a.discussionId)||typeof a.messageId!="string"||a.messageId.trim().length===0||!i(a.completedAiResponseCount)||!i(a.maxAiResponsesPerDiscussion)?!1:a.completedAiResponseCount<=a.maxAiResponsesPerDiscussion}function i(a){return typeof a=="number"&&Number.isSafeInteger(a)&&a>0}})(Li)),Li}var po;function Xh(){return po||(po=1,(function(e){var t=tn&&tn.__createBinding||(Object.create?(function(b,A,I,w){w===void 0&&(w=I);var N=Object.getOwnPropertyDescriptor(A,I);(!N||("get"in N?!A.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return A[I]}}),Object.defineProperty(b,w,N)}):(function(b,A,I,w){w===void 0&&(w=I),b[w]=A[I]})),n=tn&&tn.__exportStar||function(b,A){for(var I in b)I!=="default"&&!Object.prototype.hasOwnProperty.call(A,I)&&t(A,b,I)};Object.defineProperty(e,"__esModule",{value:!0}),e.formatCustomerSupportProviderText=e.parseIdentityGateProtocolVersion=e.IDENTITY_GATE_VERSION_HEADER=e.IDENTITY_GATE_REQUIRED_EVENT=e.IDENTITY_GATE_PROTOCOL_VERSION=e.SUPPORTED_IDENTITY_GATE_PROTOCOL_VERSIONS=e.IDENTITY_GATE_PROTOCOL_V2=e.IDENTITY_GATE_PROTOCOL_V1=e.OutputStreamTypesEnum=e.DIRECT_CHAT_CUSTOMER_SUPPORT_BUSINESS_HOURS_DEFAULT_OPEN_WEEK_DAY_NUMBERS=e.DIRECT_CHAT_CUSTOMER_SUPPORT_BUSINESS_HOURS_WEEK_DAYS=e.DIRECT_CHAT_CUSTOMER_SUPPORT_DEFAULT_BUSINESS_HOURS_TIMEZONE=e.DIRECT_CHAT_CUSTOMER_SUPPORT_FALLBACK_CONTACT_CAPTURE_DEFAULT_TIMEOUT_MINUTES=e.readOptionalNullableString=e.readOptionalString=e.readOptionalNullableNumber=e.readOptionalNumber=e.AgentDisplayFacetRoleType=e.AgentDisplayFacetModeType=void 0,n(Gh(),e),n(Yh(),e),n(Ja(),e),n(qh(),e);var r;(function(b){b.SPRITESHEET="spritesheet",b.LOTTIE="lottie",b.IMAGE="image",b.SVG="svg",b.VIDEO="video"})(r||(e.AgentDisplayFacetModeType=r={}));var i;(function(b){b.LAUNCHER="launcher",b.ASSISTANT="assistant",b.SEARCH="search"})(i||(e.AgentDisplayFacetRoleType=i={}));const a=b=>typeof b=="number"&&Number.isFinite(b)?b:void 0;e.readOptionalNumber=a;const s=b=>b===null?null:(0,e.readOptionalNumber)(b);e.readOptionalNullableNumber=s;const o=b=>typeof b=="string"?b:void 0;e.readOptionalString=o;const u=b=>b===null?null:(0,e.readOptionalString)(b);e.readOptionalNullableString=u,e.DIRECT_CHAT_CUSTOMER_SUPPORT_FALLBACK_CONTACT_CAPTURE_DEFAULT_TIMEOUT_MINUTES=5,e.DIRECT_CHAT_CUSTOMER_SUPPORT_DEFAULT_BUSINESS_HOURS_TIMEZONE="Europe/Paris",e.DIRECT_CHAT_CUSTOMER_SUPPORT_BUSINESS_HOURS_WEEK_DAYS=[{dayOfWeek:1,key:"monday",defaultLabel:"Monday"},{dayOfWeek:2,key:"tuesday",defaultLabel:"Tuesday"},{dayOfWeek:3,key:"wednesday",defaultLabel:"Wednesday"},{dayOfWeek:4,key:"thursday",defaultLabel:"Thursday"},{dayOfWeek:5,key:"friday",defaultLabel:"Friday"},{dayOfWeek:6,key:"saturday",defaultLabel:"Saturday"},{dayOfWeek:7,key:"sunday",defaultLabel:"Sunday"}],e.DIRECT_CHAT_CUSTOMER_SUPPORT_BUSINESS_HOURS_DEFAULT_OPEN_WEEK_DAY_NUMBERS=[1,2,3,4,5];var c;(function(b){b.OUTPUT_STREAM_MESSAGE_START="message_start",b.OUTPUT_STREAM_MESSAGE_DELTA="message_delta",b.OUTPUT_STREAM_MESSAGE_END="message_end",b.OUTPUT_STREAM_CLIENT_EVENT="client_event",b.OUTPUT_STREAM_NUMBER_OF_STEPS_TYPE="number_of_steps",b.OUTPUT_STREAM_CURRENT_STEP_NUMBER_TYPE="current_step_number",b.OUTPUT_STREAM_CURRENT_STEP_NAME_TYPE="current_step_name",b.OUTPUT_STREAM_ERROR="error"})(c||(e.OutputStreamTypesEnum=c={})),e.IDENTITY_GATE_PROTOCOL_V1=1,e.IDENTITY_GATE_PROTOCOL_V2=2,e.SUPPORTED_IDENTITY_GATE_PROTOCOL_VERSIONS=Object.freeze([e.IDENTITY_GATE_PROTOCOL_V1,e.IDENTITY_GATE_PROTOCOL_V2]),e.IDENTITY_GATE_PROTOCOL_VERSION=e.IDENTITY_GATE_PROTOCOL_V1,e.IDENTITY_GATE_REQUIRED_EVENT="identity.required",e.IDENTITY_GATE_VERSION_HEADER="X-ChatSystem-Identity-Gate-Version";const d=b=>{const A=Array.isArray(b)?b[0]:b;return e.SUPPORTED_IDENTITY_GATE_PROTOCOL_VERSIONS.find(I=>A===I||A===String(I))};e.parseIdentityGateProtocolVersion=d;const f={"+1":"👍",thumbsup:"👍","-1":"👎",thumbsdown:"👎",clap:"👏",wave:"👋",raised_hands:"🙌",pray:"🙏",muscle:"💪",ok_hand:"👌",point_up:"☝️",point_down:"👇",point_left:"👈",point_right:"👉",eyes:"👀",brain:"🧠",heart:"❤️",orange_heart:"🧡",yellow_heart:"💛",green_heart:"💚",blue_heart:"💙",purple_heart:"💜",broken_heart:"💔",fire:"🔥",tada:"🎉",sparkles:"✨",star:"⭐",white_check_mark:"✅",heavy_check_mark:"✔️",x:"❌",warning:"⚠️",information_source:"ℹ️",question:"❓",exclamation:"❗",bulb:"💡",memo:"📝",pushpin:"📌",paperclip:"📎",link:"🔗",lock:"🔒",unlock:"🔓",bell:"🔔",phone:"☎️",email:"✉️",incoming_envelope:"📨",package:"📦",truck:"🚚",moneybag:"💰",credit_card:"💳",gift:"🎁",shopping_bags:"🛍️",clock3:"🕒",hourglass_flowing_sand:"⏳",rocket:"🚀",smile:"😄",smiley:"😃",grinning:"😀",slightly_smiling_face:"🙂",wink:"😉",blush:"😊",relaxed:"☺️",heart_eyes:"😍",thinking_face:"🤔",neutral_face:"😐",confused:"😕",worried:"😟",cry:"😢",sob:"😭",sweat_smile:"😅",joy:"😂",rofl:"🤣",upside_down_face:"🙃",sunglasses:"😎",tada_face:"🥳",angry:"😠",rage:"😡",face_with_symbols_on_mouth:"🤬",scream:"😱",zipper_mouth_face:"🤐",skin_tone_2:"🏻",skin_tone_3:"🏼",skin_tone_4:"🏽",skin_tone_5:"🏾",skin_tone_6:"🏿"},h=b=>b.replace(/-/g,"_"),m=b=>b.replace(/:([a-zA-Z0-9_+\-]+):/g,(A,I)=>f[h(I)]??A),y=({text:b,provider:A})=>A==="slack"?m(b):b;e.formatCustomerSupportProviderText=y})(tn)),tn}var Z=Xh();const Di=e=>({mode:Z.AgentDisplayFacetModeType.SVG,role:e}),Qh=()=>({branding:{poweredByChatSystemVisible:!0},interactiveWidgets:{available:[{widgetType:Z.INTERACTIVE_WIDGET_TYPES.directChatCustomerSupport,enabled:!0}]},agent:{display:{name:"",CSSRules:"",[Z.AgentDisplayFacetRoleType.LAUNCHER]:Di(Z.AgentDisplayFacetRoleType.LAUNCHER),[Z.AgentDisplayFacetRoleType.ASSISTANT]:Di(Z.AgentDisplayFacetRoleType.ASSISTANT),[Z.AgentDisplayFacetRoleType.SEARCH]:Di(Z.AgentDisplayFacetRoleType.SEARCH)},text:{initialText:"",conversationStarters:[]},customNameToDisplay:"",isAudioAllowed:!0},api:{settings:{maxAiResponsesPerDiscussion:0},tracking:{queryParamToAppend:""}}}),Pt=S.createContext({companySettings:Qh(),setCompanySettings:()=>{}}),Za=()=>{const e=typeof document<"u"&&new URL(document.URL)?.host.includes("localhost:3080"),t=typeof document<"u"&&new URL(document.URL)?.host.includes("localhost:5173");return e||t};class vc{enabled;constructor({isLocalDev:t,shouldDisplayLogs:n}){this.enabled=t||n}log(...t){this.enabled&&console.log(...t)}warn(...t){this.enabled&&console.warn(...t)}error(...t){this.enabled&&console.error(...t)}}let Kh=new vc({isLocalDev:Za(),shouldDisplayLogs:!1});const Jh=e=>new vc({isLocalDev:Za(),shouldDisplayLogs:!!e}),Vt=()=>Kh,Zh=e=>Object.values(pt).includes(e),e0=(e,t)=>{const n=t??Vt();return Zh(e)?e:(n.warn(`Language ${e} not handled for now. Using ${pt.ENGLISH}.`),pt.ENGLISH)},t0=e=>{const t=new URL(e);if(t.username||t.password)throw new Error("CHAT_SYSTEM_API_URL_MUST_NOT_CONTAIN_CREDENTIALS");const n=t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="[::1]";if(t.protocol!=="https:"&&!(t.protocol==="http:"&&n))throw new Error("CHAT_SYSTEM_API_URL_MUST_USE_HTTPS");if(t.search||t.hash)throw new Error("CHAT_SYSTEM_API_URL_MUST_NOT_CONTAIN_QUERY_OR_HASH");const r=t.pathname.replace(/\/+$/,"");return`${t.origin}${r}`};class wn{constructor(){}static getApiUrl=t=>t!==void 0?t0(t):Za()?"http://localhost:3001":"https://www.api.chatsystem.ai";static getHeaders=({contentType:t="text/plain"})=>({"Content-Type":t});static getFetchConfig=({contentType:t="text/plain",httpVerb:n="GET",body:r,options:i={}})=>{const a={method:n,headers:this.getHeaders({contentType:t}),...i};return r&&(a.body=JSON.stringify(r)),a}}const kc=S.createContext(null);function n0({apiUrl:e,children:t}){const n=S.useMemo(()=>wn.getApiUrl(e),[e]);return g.jsx(kc.Provider,{value:n,children:t})}function ri(){return S.useContext(kc)??wn.getApiUrl()}const es="chatsystem-widget",r0=1440*60*1e3,Nc=e=>Z.isInteractiveWidgetVersionedRequest(e)?e:null;function Ir(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function i0(e){return!(typeof e!="object"||e===null||typeof e.enabled!="boolean"||typeof e.timeoutMinutes!="number"||typeof e.requireEmail!="boolean"||typeof e.requirePhone!="boolean")}function a0(e){return!(typeof e!="object"||e===null||typeof e.enabled!="boolean"||typeof e.requireEmail!="boolean"||typeof e.requirePhone!="boolean"||typeof e.requireReason!="boolean")}function s0(e){if(typeof e!="object"||e===null||typeof e.discussionId!="number"||typeof e.reconnectToken!="string"||!Ir(e.startedAt)||!Ir(e.updatedAt)||e.reconnectTokenExpiresAt!==void 0&&!Ir(e.reconnectTokenExpiresAt)||e.closedAt!==void 0&&!Ir(e.closedAt)||e.closedReason!==void 0&&typeof e.closedReason!="string")return!1;const t=e.mode??"live_chat";return t==="closed_hours_contact_capture"?!(!["active","closed"].includes(e.status)||typeof e.customerSupportSessionId!="number"||!a0(e.closedHoursContactCapture)||typeof e.businessHours!="object"||e.businessHours===null||typeof e.businessHours.timezone!="string"||e.businessHours.todayScheduleLabel!==void 0&&typeof e.businessHours.todayScheduleLabel!="string"):!(t!=="live_chat"||!["connecting","active","closed"].includes(e.status)||typeof e.socketUrl!="string"||e.customerSupportSessionId!==void 0&&typeof e.customerSupportSessionId!="number"||e.isWaitingForFirstProviderReply!==void 0&&typeof e.isWaitingForFirstProviderReply!="boolean"||e.fallbackContactCapture!==void 0&&!i0(e.fallbackContactCapture))}function o0(e){if(typeof e!="object"||e===null||e.userType!=="user"&&e.userType!=="assistant"||"content"in e&&e.content!==void 0&&typeof e.content!="string")return!1;if("metaData"in e&&e.metaData!==void 0){if(typeof e.metaData!="object"||e.metaData===null||"isErrorMessage"in e.metaData&&e.metaData.isErrorMessage!==void 0&&typeof e.metaData.isErrorMessage!="boolean"||"messageKind"in e.metaData&&e.metaData.messageKind!==void 0&&!["conversation","system"].includes(e.metaData.messageKind)||"systemEvent"in e.metaData&&e.metaData.systemEvent!==void 0&&!["customer_support_connecting","customer_support_connected","customer_support_closed","customer_support_connection_error"].includes(e.metaData.systemEvent)||"customerSupportAuthorName"in e.metaData&&e.metaData.customerSupportAuthorName!==void 0&&typeof e.metaData.customerSupportAuthorName!="string")return!1;if("interactiveWidget"in e.metaData){const t=e.metaData.interactiveWidget;if(typeof t!="object"||t===null||![2,3].includes(t.protocolVersion)||typeof t.instanceId!="string"||!["none","resume_turn","local_preview"].includes(t.responseMode)||!["active","submitting","submitted","cancelled","unavailable"].includes(t.state)||!Nc({type:"interactive_widget_request",event:"interactiveWidget.requested",protocolVersion:t.protocolVersion,instanceId:t.instanceId,widgetType:t.widgetType,source:"system",companyId:1,agentId:null,discussionId:null,toolcallId:null,payload:t.presentation,responsePolicy:t.responseMode==="local_preview"?{mode:"local_preview"}:{mode:"none"}}))return!1}}return!0}function u0(e){return!(typeof e!="object"||e===null||e.completedAiResponseCount!==void 0&&(!Number.isSafeInteger(e.completedAiResponseCount)||e.completedAiResponseCount<0||e.discussionId===null)||!Array.isArray(e.items)||!e.items.every(o0)||e.discussionId!==null&&typeof e.discussionId!="number"||typeof e.updatedAt!="string"||Number.isNaN(Date.parse(e.updatedAt))||e.customerSupport!==void 0&&e.customerSupport!==null&&!s0(e.customerSupport))}function c0(e){const t=Vt();if(typeof window>"u")return;const n=e.key??es,r={items:e.conversation.items,discussionId:e.conversation.discussionId,completedAiResponseCount:e.conversation.completedAiResponseCount,updatedAt:new Date().toISOString(),customerSupport:e.customerSupport??null};try{const i=JSON.stringify(r);cr.setItem(n,i)}catch{t.error("Failed to serialize chat state")}}function Rc(e){const t=Vt();if(typeof window>"u")return null;const n=e?.key??es,r=cr.getItem(n);if(!r)return null;try{const i=JSON.parse(r);return u0(i)?i:(t.warn("Chat state in localStorage has unexpected shape, ignoring."),null)}catch{return t.error("Failed to parse chat state from localStorage"),null}}function l0(e){if(typeof window>"u")return null;const t=e??es;cr.removeItem(t)}function d0(e,t=Date.now()){return t-e}function f0(e,t=Date.now()){return d0(new Date(e).getTime(),t)<=r0}function h0({settings:e,setCurrentConversation:t,setArchivedConversation:n,restoreStoredConversation:r=!0,storageKey:i}){const a=r?Rc({key:i}):null;if(!a){t({discussionId:null,items:[{userType:"assistant",content:e.agent.text.initialText,temporaryId:crypto.randomUUID()}]});return}f0(a.updatedAt)?t({discussionId:a.discussionId,completedAiResponseCount:a.completedAiResponseCount,items:a.items,updatedAt:a.updatedAt}):(t({discussionId:null,items:[{userType:"assistant",content:e.agent.text.initialText,temporaryId:crypto.randomUUID()}]}),n({discussionId:a.discussionId,completedAiResponseCount:a.completedAiResponseCount,items:a.items,updatedAt:a.updatedAt}))}const Oc=S.createContext(Vt()),lr=()=>S.useContext(Oc),Lc=(e,t)=>{if(t===null)return"discussion_not_loaded";if(t!==e.discussionId)return"discussion_mismatch";if(e.status==="closed")return"session_closed";if(!e.reconnectToken)return"missing_reconnect_token";if(e.mode==="closed_hours_contact_capture")return null;if(!e.socketUrl)return"missing_socket_url";if(e.reconnectTokenExpiresAt){const n=Date.parse(e.reconnectTokenExpiresAt);if(Number.isNaN(n))return"invalid_reconnect_expiration";if(n<=Date.now())return"expired_reconnect_token"}return null},m0=e=>{const t=Rc({key:e}),n=t?.customerSupport??null;if(!n)return{mode:St.ai,customerSupportState:null,reason:"no_customer_support_state"};const r=Lc(n,t?.discussionId??null);return r==="session_closed"?{mode:St.customerSupport,customerSupportState:n,reason:r}:r?{mode:St.ai,customerSupportState:null,reason:r}:{mode:St.customerSupport,customerSupportState:n,reason:"valid_reconnect_state"}},p0=async e=>{const t={apiUrl:e.apiUrl,appToken:e.appToken,agentId:e.agentId};return e.runtimeAdapter?e.runtimeAdapter.loadCompanySettings(t):e.loadStandardSettings(t)},g0=async e=>{const t=wn.getFetchConfig({httpVerb:"GET",contentType:"application/json"}),n=`${e.apiUrl}/company/settings/${e.appToken}/${e.agentId}`;return await(await fetch(n,{...t,credentials:"omit"})).json()},b0="chatsystem-widget",ts=e=>{const t=e.agentId??"default";return`${encodeURIComponent(e.appToken)}:${t}`},Dc=e=>`${b0}:${ts(e)}`,E0=({agentId:e,appToken:t,onFetched:n,runtimeAdapter:r})=>{const i=lr(),a=ri(),s=S.useMemo(()=>Dc({appToken:t,agentId:e}),[t,e]),[o,u]=S.useState({}),c=S.useMemo(()=>new wc(cr,`${a}:${s}`),[a,s]),d={companySettings:o,setCompanySettings:u},[f,h]=S.useState({discussionId:null,items:[],updatedAt:null}),[m,y]=S.useState({discussionId:null,items:[],updatedAt:null}),[b,A]=S.useState(()=>r?{mode:St.ai,customerSupportState:null,reason:"runtime_adapter_uses_fresh_conversation"}:m0(s)),[I,w]=S.useState(0),M={draftStore:c,currentConversation:f,setCurrentConversation:h,archivedConversation:m,setArchivedConversation:y,chatboxBootState:b,setChatboxBootState:A,resetConversationRequestId:I,resetConversation:()=>{c.clear(),r||l0(s),A({mode:St.ai,customerSupportState:null,reason:"manual_start_new_conversation"}),h({discussionId:null,items:[{userType:"assistant",content:o?.agent?.text?.initialText,temporaryId:crypto.randomUUID()}],updatedAt:null}),w(v=>v+1)}};return S.useEffect(()=>{p0({apiUrl:a,appToken:t,agentId:e,runtimeAdapter:r,loadStandardSettings:g0}).then(v=>{u(v),h0({settings:v,setCurrentConversation:h,setArchivedConversation:y,restoreStoredConversation:!r,storageKey:s}),n?.()}).catch(v=>{i.warn("error in settings fetch",v)})},[t,e,a,s,i,n,r]),{contextCompanySettings:d,contextInitialConversationState:M}};async function T0(e,t=URL.createObjectURL){if(!e.ok)throw new Error(`IMAGE_PRELOAD_FAILED_HTTP_${e.status}`);const n=await e.blob();return t(n)}const vn=globalThis;vn.__WIDGET_ASSET_CACHE__||(vn.__WIDGET_ASSET_CACHE__={svg:new Map,img:new Map,lot:new Map,spr:new Map});vn.__WIDGET_PRELOAD_KEYS__||(vn.__WIDGET_PRELOAD_KEYS__=new Set);const Pi=vn.__WIDGET_PRELOAD_KEYS__,qt=vn.__WIDGET_ASSET_CACHE__,y0="widget-assets-v1";async function ii(e,t){const n=Vt();try{const r=await caches.open(y0),i=await r.match(e,{ignoreSearch:!1});if(i)return i.clone();const a=await fetch(e,{cache:"force-cache",mode:"cors",keepalive:!0,...t});if(!a.ok)throw new Error(`HTTP ${a.status} for ${e}`);return r.put(e,a.clone()),a}catch(r){return n.warn("error while fetching",r),new Response(null,{status:520,statusText:"Error in client - Fetch failed"})}}async function Pc(e){const t=qt.svg.get(e);if(t)return t.promise;const n=(async()=>{const i=await(await ii(e)).text();if(typeof globalThis.DOMPurify<"u"&&typeof globalThis.DOMPurify.sanitize=="function")try{const s=new DOMParser().parseFromString(i,"image/svg+xml"),o=new XMLSerializer().serializeToString(s.documentElement);return{sanitized:globalThis.DOMPurify.sanitize(o,{USE_PROFILES:{svg:!0,svgFilters:!0}})}}catch{return{sanitized:globalThis.DOMPurify.sanitize(i,{USE_PROFILES:{svg:!0,svgFilters:!0}})}}else return{sanitized:i}})();return qt.svg.set(e,{promise:n,ts:Date.now()}),n}function Mc(e){const t=qt.img.get(e);if(t)return t.promise;const n=(async()=>{const r=await ii(e);return{blobUrl:await T0(r)}})();return qt.img.set(e,{promise:n,ts:Date.now()}),n}function Bc(e){const t=qt.lot.get(e);if(t)return t.promise;const n=(async()=>{const i=await(await ii(e)).arrayBuffer(),a=new Uint8Array(i);if(a.length>=4&&a[0]===80&&a[1]===75&&a[2]===3&&a[3]===4||e.endsWith(".lottie"))return{kind:"zip",blobUrl:URL.createObjectURL(new Blob([i],{type:"application/zip"}))};const o=new TextDecoder().decode(a);return{kind:"json",data:JSON.parse(o)}})();return qt.lot.set(e,{promise:n,ts:Date.now()}),n}function Fc(e){const t=qt.spr.get(e);if(t)return t.promise;const n=(async()=>{const i=await(await ii(e)).blob();let a=null;try{a=await createImageBitmap(i)}catch{a=null}const{imgEl:s,width:o,height:u}=await new Promise((c,d)=>{const f=URL.createObjectURL(i),h=new Image;h.crossOrigin="anonymous",h.onload=()=>{const m=h.naturalWidth,y=h.naturalHeight;c({imgEl:h,width:m,height:y})},h.onerror=()=>{URL.revokeObjectURL(f),d(new Error("Spritesheet image decode failed"))},h.src=f,h.decode?.().catch(()=>{})});return{imgEl:s,bitmap:a,width:o,height:u}})();return qt.spr.set(e,{promise:n,ts:Date.now()}),n}function _0(e){e.images?.forEach(t=>void Mc(t)),e.svgs?.forEach(t=>void Pc(t)),e.lotties?.forEach(t=>void Bc(t)),e.sprites?.forEach(t=>void Fc(t))}function x0(e){const t=Vt();try{const n=document.createElement("link");n.rel="preconnect",n.href=e,n.crossOrigin="anonymous",document.head.appendChild(n);const r=document.createElement("link");r.rel="dns-prefetch",r.href=e,document.head.appendChild(r)}catch(n){t.warn("error in injectPreconnect",n)}}function Uc(e){return new URL(e,document.baseURI).toString()}function S0(e,t){const n=document.head.querySelectorAll('link[rel="preload"]');for(const r of n)if((e?r.as===e||r.getAttribute("as")===e:!0)&&r.href===t)return!0;return!1}function Ar(e,t,n,r){const i=Uc(n),a=`${e}|${t??""}|${i}`;if(Pi.has(a))return;if(S0(t,i)){Pi.add(a);return}const s=document.createElement("link");s.rel=e,t&&(s.as=t),s.href=i,s.crossOrigin="anonymous",r&&(s.type=r),s.setAttribute("data-chatsystem-preload","1"),document.head.appendChild(s),Pi.add(a)}function C0(e){const t=s=>Array.from(new Set((s??[]).map(Uc))),n=t(e.images),r=t(e.svgs),i=t(e.lotties),a=t(e.sprites);n.forEach(s=>Ar("preload","image",s)),r.forEach(s=>Ar("preload","fetch",s,"image/svg+xml")),i.forEach(s=>Ar("preload","fetch",s,"application/zip")),a.forEach(s=>Ar("preload","fetch",s))}function I0(e,t){const{manifest:n,origins:r}=A0(e,t);r.forEach(x0),C0(n),_0(n)}function A0(e,t){const n=t??Vt(),r=w0(e),i=new Set,a=new Set,s=new Set,o=new Set;for(const{url:d,mode:f}of r)switch(v0(f,d,n)){case"svg":a.add(d);break;case"lottie":s.add(d);break;case"spritesheet":o.add(d);break;case"image":i.add(d);break}const u={images:Array.from(i),svgs:Array.from(a),lotties:Array.from(s),sprites:Array.from(o)},c=k0(u,n);return{manifest:u,origins:c}}function w0(e){if(!e?.agent?.display)return[];const t=e.agent.display,n=[t.launcher,t.assistant,t.search].filter(Boolean),r=[];for(const i of n)i?.assetUrl&&r.push({url:i.assetUrl,mode:i.mode});return r}function v0(e,t,n){if(e)switch(e){case"svg":return"svg";case"lottie":return"lottie";case"spritesheet":return"spritesheet";case"image":return"image";case"video":return"video"}try{const i=new URL(t,document.baseURI).pathname.toLowerCase();if(i.endsWith(".svg"))return"svg";if(i.endsWith(".lottie")||i.endsWith(".zip")||i.endsWith(".json"))return i.endsWith(".json"),"lottie";if(/\.(png|webp|jpg|jpeg|gif|avi,ef)$/.test(i))return"image";if(/\.(mp4|webm|mov|m4v|ogg)$/.test(i))return"video"}catch(r){n.warn("error in normalizeKind:",r)}return"unknown"}function k0(e,t){const n=new Set,r=i=>{if(i)try{const a=new URL(i,document.baseURI);n.add(`${a.protocol}//${a.host}`)}catch(a){t.warn("error in uniqueOriginsFromManifest",a)}};return(e.images??[]).forEach(r),(e.svgs??[]).forEach(r),(e.lotties??[]).forEach(r),(e.sprites??[]).forEach(r),Array.from(n)}const Hc=S.createContext(void 0),jc=S.createContext(void 0),N0=()=>S.useContext(jc);async function R0(e){if(!e)return"anonymous";try{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=JSON.parse(atob(t));if(typeof n.sub!="string"||typeof n.iss!="string"||typeof n.aud!="string")return null;const r=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify([n.iss,n.aud,n.sub])));return Array.from(new Uint8Array(r),i=>i.toString(16).padStart(2,"0")).join("")}catch{return null}}const ai=()=>{const e=S.useContext(ni);if(!e)throw new Error("useChatbotConversation must be used within ChatbotInitialtextContext.Provider");const{currentConversation:t,setCurrentConversation:n,archivedConversation:r,setArchivedConversation:i,chatboxBootState:a,setChatboxBootState:s,resetConversationRequestId:o,resetConversation:u}=e,c=v=>{n(p=>({...p,discussionId:v}))},d=v=>{n(p=>({...p,items:v}))},f=v=>{n(p=>({...p,items:[...p.items,v]}))},h=({messageStreamId:v,role:p})=>{n(O=>O.items.some(B=>B.metaData?.messageStreamId===v)?O:{...O,items:[...O.items,{userType:p,content:"",metaData:{messageStreamId:v},temporaryId:crypto.randomUUID()}]})},m=(v,p)=>{n(O=>({...O,items:O.items.map(B=>{const X=B.metaData?.interactiveWidget;return!X||X.instanceId!==v?B:{...B,metaData:{...B.metaData,interactiveWidget:p(X)}}})}))},y=()=>{n(v=>({...v,items:v.items.filter(p=>!(p.content?.length===0&&p.userType==="assistant"))}))},b=()=>{n(v=>{const p=[...v.items];return p.pop(),{...v,items:p}})},A=v=>{n(p=>({...p,updatedAt:v.updatedAt}))},I=()=>{i({discussionId:null,items:[],updatedAt:null})};return{currentConversation:t,setCurrentConversation:n,setCurrentConversationId:c,setCurrentConversationMetadata:A,resetConversation:u,setCurrentConversationItems:d,addMessageToCurrentConversation:f,removeEmptyAssistantMessageFromCurrentConversation:y,removeLastMessageFromCurrentConversation:b,updateCurrentConversationLastMessage:({newContent:v})=>{n(p=>{const O=[...p.items],B=O.length-1,X=O[B];return O[B]={...X,content:X.content=v},{...p,items:O}})},archivedConversation:r,chatboxBootState:a,setChatboxBootState:s,resetConversationRequestId:o,setArchivedConversationAsMain:()=>{n(r),I()},addEmptyMessageToCurrentConversation:h,updateCurrentConversationMessageById:({newContent:v,id:p})=>{n(O=>{const B=[...O.items],X=B.findIndex(U=>U.metaData?.messageStreamId===p),k=B[X];return B[X]={...k,content:k.content=v},{...O,items:B}})},updateInteractiveWidget:m}},O0=30,L0=e=>{try{const t=e.split(".")[1];if(!t)return null;const n=t.replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return typeof i.exp=="number"?i.exp:null}catch{return null}};class D0{token=null;expiresAt=null;pendingRequest=null;pendingRequestIsInteractive=!1;generation=0;provider;constructor(t){this.provider=t}clear(){this.generation+=1,this.token=null,this.expiresAt=null,this.pendingRequest=null,this.pendingRequestIsInteractive=!1}handleIdentityChanged(){this.token=null,this.expiresAt=null,!(this.pendingRequest&&this.pendingRequestIsInteractive)&&(this.generation+=1,this.pendingRequest=null,this.pendingRequestIsInteractive=!1)}async getToken(t){if(!this.provider)return null;const n=Math.floor(Date.now()/1e3);if(this.token&&this.expiresAt!=null&&this.expiresAt-O0>n)return this.token;if(this.pendingRequest){const a=this.pendingRequestIsInteractive,s=await this.pendingRequest;if(s||!t.interactive||a)return s}const r=this.generation;this.pendingRequestIsInteractive=t.interactive;let i;return i=this.provider.getToken(t).then(a=>{if(r!==this.generation)return null;if(!a)return this.clear(),null;const s=L0(a);return s==null||s<=Math.floor(Date.now()/1e3)?(this.clear(),null):(this.token=a,this.expiresAt=s,a)}).finally(()=>{this.pendingRequest===i&&(this.pendingRequest=null,this.pendingRequestIsInteractive=!1)}),this.pendingRequest=i,i}}const P0=async({apiUrl:e,appToken:t,payload:n,identitySession:r,signal:i,fetchImplementation:a=fetch})=>{if(i?.aborted)return;let s=null,o;try{s=await r.getToken({interactive:!0,reason:n.reason,requiredCapabilities:n.requiredCapabilities}),!s&&!i?.aborted&&(s=await r.getToken({interactive:!1,reason:n.reason,requiredCapabilities:n.requiredCapabilities})),o=s?{status:"success"}:{status:"cancelled"}}catch{if(i?.aborted)return;r.clear(),o={status:"failed",code:"HOST_IDENTITY_FAILED"}}if(i?.aborted)return;const u=await a(`${e}/ai/identity-gates/${encodeURIComponent(t)}/${encodeURIComponent(n.gateId)}/result`,{method:"POST",signal:i,headers:{"Content-Type":"application/json","X-ChatSystem-Identity-Gate-Token":n.resultToken,...s?{Authorization:`Bearer ${s}`}:{}},body:JSON.stringify(o)});if(!u.ok)throw u.status===401&&s&&r.clear(),new Error(`IDENTITY_GATE_RESOLUTION_FAILED:${u.status}`)},M0="chatsystem:pending-turn:",B0=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,ns=e=>`${M0}${encodeURIComponent(e)}`,Vc=(e,t=Date.now())=>{if(!e||typeof e!="object"||Array.isArray(e))return null;const n=e;if(typeof n.continuationId!="string"||!B0.test(n.continuationId)||typeof n.expiresAt!="string"||typeof n.discussionId!="number"||!Number.isSafeInteger(n.discussionId)||n.discussionId<=0)return null;const r=Date.parse(n.expiresAt);return!Number.isFinite(r)||r<=t?null:{continuationId:n.continuationId,expiresAt:n.expiresAt,discussionId:n.discussionId}},F0=(e,t,n,r=Lt)=>{const i=Vc({...t,discussionId:n});i&&r.setItem(ns(e),JSON.stringify(i))},go=(e,t=Lt,n=Date.now())=>{const r=ns(e),i=t.getItem(r);if(!i)return null;try{const a=Vc(JSON.parse(i),n);if(a)return a}catch{}return t.removeItem(r),null},Mi=(e,t=Lt)=>{t.removeItem(ns(e))},U0=async({apiUrl:e,appToken:t,discussionId:n,continuation:r,identitySession:i,signal:a,fetchImplementation:s=fetch})=>{if(a?.aborted||!Number.isSafeInteger(n)||n<=0)return null;const o=await i.getToken({interactive:!1});if(!o||a?.aborted)return null;const u={discussionId:n};return s(`${e}/ai/pending-turns/${encodeURIComponent(t)}/${encodeURIComponent(r.continuationId)}/resume`,{method:"POST",signal:a,headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/json"},body:JSON.stringify(u)})},H0=e=>e>=200&&e<300||e>=400&&e<500&&e!==429||e===503,j0=e=>{if(!Z.isUnknownRecord(e))return;const t=Z.readOptionalNumber(e.timeoutMinutes)??Z.DIRECT_CHAT_CUSTOMER_SUPPORT_FALLBACK_CONTACT_CAPTURE_DEFAULT_TIMEOUT_MINUTES;return{enabled:e.enabled===!0,timeoutMinutes:Math.max(1,Math.min(120,Math.round(t))),requireEmail:e.requireEmail!==!1,requirePhone:e.requirePhone!==!1}},V0=e=>{if(Z.isUnknownRecord(e))return{enabled:e.enabled!==!1,requireEmail:e.requireEmail!==!1,requirePhone:e.requirePhone!==!1,requireReason:e.requireReason!==!1}},z0=e=>{if(!Z.isUnknownRecord(e))return null;const t=e;if(t.type!=="interactive_widget_request"||t.event!=="interactiveWidget.requested"||t.widgetType!==Z.INTERACTIVE_WIDGET_TYPES.directChatCustomerSupport||!Z.isUnknownRecord(t.payload))return null;const n=t.payload;if((Z.readOptionalString(n.mode)??"live_chat")==="closed_hours_contact_capture"){const s=Z.readOptionalString(n.reconnectToken),o=Z.readOptionalNumber(n.customerSupportSessionId),u=V0(n.closedHoursContactCapture);if(n.transport!=="none"||!s||!o||!u||!u.enabled)return null;const c=Z.isUnknownRecord(n.businessHours)?n.businessHours:{};return{mode:"closed_hours_contact_capture",transport:"none",reconnectToken:s,reconnectTokenExpiresAt:Z.readOptionalString(n.reconnectTokenExpiresAt),customerSupportSessionId:o,companyId:Z.readOptionalNumber(t.companyId),agentId:Z.readOptionalNullableNumber(t.agentId),discussionId:Z.readOptionalNullableNumber(t.discussionId)??null,toolcallId:Z.readOptionalNullableString(t.toolcallId),closedHoursContactCapture:u,businessHours:{timezone:Z.readOptionalString(c.timezone)??Z.DIRECT_CHAT_CUSTOMER_SUPPORT_DEFAULT_BUSINESS_HOURS_TIMEZONE,todayScheduleLabel:Z.readOptionalString(c.todayScheduleLabel)}}}if(n.transport!=="socket"||typeof n.socketUrl!="string")return null;const i=Z.readOptionalString(n.handoffToken),a=Z.readOptionalString(n.reconnectToken);return!i&&!a?null:{mode:"live_chat",transport:"socket",socketUrl:n.socketUrl,handoffToken:i,reconnectToken:a,reconnectTokenExpiresAt:Z.readOptionalString(n.reconnectTokenExpiresAt),customerSupportSessionId:Z.readOptionalNumber(n.customerSupportSessionId),companyId:Z.readOptionalNumber(t.companyId),agentId:Z.readOptionalNullableNumber(t.agentId),discussionId:Z.readOptionalNullableNumber(t.discussionId)??null,toolcallId:Z.readOptionalNullableString(t.toolcallId),fallbackContactCapture:j0(n.fallbackContactCapture)}},$0=e=>z0(e),W0=/^[a-zA-Z0-9][a-zA-Z0-9:._-]*$/,G0=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,Y0=e=>{if(!Z.isUnknownRecord(e)||e.protocolVersion!==Z.IDENTITY_GATE_PROTOCOL_V1&&e.protocolVersion!==Z.IDENTITY_GATE_PROTOCOL_V2||typeof e.gateId!="string"||e.gateId.length<1||e.gateId.length>100||typeof e.toolCallId!="string"||e.toolCallId.length<1||e.toolCallId.length>255||typeof e.resultToken!="string"||e.resultToken.length<32||e.resultToken.length>512||typeof e.expiresAt!="string"||!Number.isFinite(Date.parse(e.expiresAt))||e.reason!=="identity_required"&&e.reason!=="identity_expired"||!Array.isArray(e.requiredCapabilities)||e.requiredCapabilities.length<1||e.requiredCapabilities.length>50||!e.requiredCapabilities.every(n=>typeof n=="string"&&n.length<=100&&W0.test(n)))return null;const t={gateId:e.gateId,toolCallId:e.toolCallId,requiredCapabilities:[...new Set(e.requiredCapabilities)].sort(),reason:e.reason,expiresAt:e.expiresAt,resultToken:e.resultToken};return e.protocolVersion===Z.IDENTITY_GATE_PROTOCOL_V1?{protocolVersion:Z.IDENTITY_GATE_PROTOCOL_V1,...t}:!Z.isUnknownRecord(e.continuation)||typeof e.continuation.continuationId!="string"||!G0.test(e.continuation.continuationId)||typeof e.continuation.expiresAt!="string"||!Number.isFinite(Date.parse(e.continuation.expiresAt))?null:{protocolVersion:Z.IDENTITY_GATE_PROTOCOL_V2,...t,continuation:{continuationId:e.continuation.continuationId,expiresAt:e.continuation.expiresAt}}},q0=e=>{if(e.event===Z.AI_RESPONSE_COMPLETED_EVENT&&Z.isAiResponseCompletedPayload(e.payload))return{type:"ai_response_completed",payload:e.payload};if(e.event===Z.IDENTITY_GATE_REQUIRED_EVENT){const r=Y0(e.payload);if(r)return{type:"identity_gate_required",payload:r}}const t=Nc(e.payload);if(t)return{type:"interactive_widget_requested",payload:t};const n=$0(e.payload);return n?{type:"customer_support_handoff_requested",payload:n}:{type:"unhandled_client_event",event:e}};class Ht{pending="";warnedMalformedPacket=!1;logger;constructor(t=console){this.logger=t}transformNDJSONChunkIntoObjects(t){this.pending+=t;const n=this.pending.split(/\r?\n/);this.pending=n.pop()??"";const r=[];for(const i of n){const a=i.trim();if(a)try{r.push(JSON.parse(a))}catch{this.warnMalformedPacket()}}return r}flushPending(){const t=this.pending.trim();if(this.pending="",!t)return[];try{return[JSON.parse(t)]}catch{return this.warnMalformedPacket(),[]}}warnMalformedPacket(){this.warnedMalformedPacket||(this.warnedMalformedPacket=!0,this.logger.warn("[NDJSON] Invalid packet ignored."))}static isObjectOutputstreamMessageDeltaDTO=t=>t.type===Z.OutputStreamTypesEnum.OUTPUT_STREAM_MESSAGE_DELTA;static isObjectOutputstreamMessageStartDTO=t=>t.type===Z.OutputStreamTypesEnum.OUTPUT_STREAM_MESSAGE_START;static isObjectOutputstreamMessageEndDTO=t=>t.type===Z.OutputStreamTypesEnum.OUTPUT_STREAM_MESSAGE_END;static isObjectOutputstreamErrorDTO=t=>t.type===Z.OutputStreamTypesEnum.OUTPUT_STREAM_ERROR;static isObjectOutputstreamClientEventDTO=t=>t.type===Z.OutputStreamTypesEnum.OUTPUT_STREAM_CLIENT_EVENT;static isObjectOutputstreamLoadingNumberOfStepsDTO=t=>t.type===Z.OutputStreamTypesEnum.OUTPUT_STREAM_NUMBER_OF_STEPS_TYPE;static isObjectOutputstreamLoadingCurrentStepNumberDTO=t=>t.type===Z.OutputStreamTypesEnum.OUTPUT_STREAM_CURRENT_STEP_NUMBER_TYPE;static isObjectOutputstreamLoadingCurrentStepNameDTO=t=>t.type===Z.OutputStreamTypesEnum.OUTPUT_STREAM_CURRENT_STEP_NAME_TYPE;static containsObjectWithLastAnswerToTrue=t=>{for(const n of t)if(this.isObjectOutputstreamMessageEndDTO(n)&&n.isLastAnswer)return!0;return!1}}function X0(e,t,n){return!Z.isAiResponseCompletedPayload(t)||t.discussionId!==n||t.discussionId!==e.discussionId||t.completedAiResponseCount<=(e.completedAiResponseCount??0)?e:{...e,completedAiResponseCount:t.completedAiResponseCount}}function Q0(e,t){return typeof t=="number"&&Number.isSafeInteger(t)&&t>0&&(e.completedAiResponseCount??0)>=t}function K0(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="DISCUSSION_AI_RESPONSE_LIMIT_REACHED"}var Sa=(e=>(e.GET_DISCUSSION_ID="/id",e.RESET_DISCUSSION="/delete",e))(Sa||{});const J0=e=>!!e.startsWith("/"),Z0=(e,t,n)=>e===Sa.GET_DISCUSSION_ID?t?`Votre ID de discussion est ${t}`:"Votre ID de discussion n'est pas encore défini. Envoyez un premier message pour que ce soit le cas.":e===Sa.RESET_DISCUSSION?(n(),null):`La commande ${e} n'est pas prise en compte.`,rs=()=>{const e=Kt(),t=e.formatMessage({defaultMessage:"Message the assistant...",id:"chatbot.placeholder.content"}),n=e.formatMessage({defaultMessage:"You",id:"chatbot.chatline.label.user"}),r=e.formatMessage({defaultMessage:"Assistant",id:"chatbot.chatline.label.assistant"}),i=e.formatMessage({defaultMessage:"Customer support",id:"chatbot.chatline.label.customerSupport"}),a=e.formatMessage({defaultMessage:"⏳ The chatbot is a little busy at the time. Please try again later.",id:"chatbot.error.api.429"}),s=e.formatMessage({defaultMessage:"Oops ! There has been an error. Please try again later.",id:"chatbot.error.api.500"}),o=e.formatMessage({id:"chatbot.error.connectionInterrupted",defaultMessage:"The connection was interrupted. The reply may be incomplete. Your messages remain in the conversation."}),u=e.formatMessage({defaultMessage:"Oups ! The discussion is full. Please start a new one.",id:"chatbot.error.api.409"}),c=e.formatMessage({defaultMessage:"See",id:"chatbot.infobanner.title"}),d=e.formatMessage({defaultMessage:"You have an archived discussion.",id:"chatbot.infobanner.cta"}),f=e.formatMessage({defaultMessage:"Transferring your request to customer support...",id:"chatbot.customerSupport.connecting"}),h=e.formatMessage({defaultMessage:"Your request has been sent to Customer Support. It usually takes a few minutes to get a reply. Thank you for waiting.",id:"chatbot.customerSupport.connected"}),m=e.formatMessage({defaultMessage:"Customer support is not available right now. Please try again later.",id:"chatbot.customerSupport.connectionError"}),y=e.formatMessage({defaultMessage:"Customer support received your request, but live replies are temporarily unavailable. Please try again shortly.",id:"chatbot.customerSupport.providerUnavailable"}),b=e.formatMessage({defaultMessage:"Your customer support conversation is now complete. Start a new conversation whenever you need more help.",id:"chatbot.customerSupport.closed"}),A=e.formatMessage({defaultMessage:"Restart",id:"chatbot.customerSupport.restart"}),I=e.formatMessage({defaultMessage:"Leave your contact details",id:"chatbot.customerSupport.fallback.title"}),w=e.formatMessage({defaultMessage:"Customer support has not replied yet. Leave your email and phone number and we will contact you soon.",id:"chatbot.customerSupport.fallback.description"}),N=e.formatMessage({defaultMessage:"Email",id:"chatbot.customerSupport.fallback.email"}),M=e.formatMessage({defaultMessage:"Phone",id:"chatbot.customerSupport.fallback.phone"}),v=e.formatMessage({defaultMessage:"Send",id:"chatbot.customerSupport.fallback.submit"}),p=e.formatMessage({defaultMessage:"Sending...",id:"chatbot.customerSupport.fallback.submitting"}),O=e.formatMessage({defaultMessage:"Your contact details have been saved. Customer support will contact you soon.",id:"chatbot.customerSupport.fallback.success"}),B=e.formatMessage({defaultMessage:"We could not save your contact details. Please try again.",id:"chatbot.customerSupport.fallback.error"}),X=e.formatMessage({defaultMessage:"Customer support is currently closed",id:"chatbot.customerSupport.closedHours.title"}),k=e.formatMessage({defaultMessage:"Leave your email, phone number and request. Customer support will contact you during opening hours.",id:"chatbot.customerSupport.closedHours.description"}),U=e.formatMessage({defaultMessage:"Today:",id:"chatbot.customerSupport.closedHours.schedulePrefix"}),W=e.formatMessage({defaultMessage:"Reason for your request",id:"chatbot.customerSupport.closedHours.reason"}),H=e.formatMessage({defaultMessage:"Your request has been saved. Customer support will contact you during opening hours.",id:"chatbot.customerSupport.closedHours.success"});return{placeholderTranslation:t,chatlineLabelUserTranslation:n,chatlineLabelAssistantTranslation:r,chatlineLabelCustomerSupportTranslation:i,tooManyRequestsTranslation:a,genericErrorTranslation:s,connectionInterruptedTranslation:o,discussionFullErrorTranslation:u,infoBannerTitleTranslation:c,infoBannerExplainationTranslation:d,customerSupportConnectingTranslation:f,customerSupportConnectedTranslation:h,customerSupportConnectionErrorTranslation:m,customerSupportProviderUnavailableTranslation:y,customerSupportClosedTranslation:b,customerSupportRestartTranslation:A,customerSupportFallbackTitleTranslation:I,customerSupportFallbackDescriptionTranslation:w,customerSupportFallbackEmailTranslation:N,customerSupportFallbackPhoneTranslation:M,customerSupportFallbackSubmitTranslation:v,customerSupportFallbackSubmittingTranslation:p,customerSupportFallbackSuccessTranslation:O,customerSupportFallbackErrorTranslation:B,customerSupportClosedHoursTitleTranslation:X,customerSupportClosedHoursDescriptionTranslation:k,customerSupportClosedHoursSchedulePrefixTranslation:U,customerSupportClosedHoursReasonTranslation:W,customerSupportClosedHoursSuccessTranslation:H}},is=()=>{const e=Kt(),t=e.formatMessage({defaultMessage:"Search",id:"chatbot.chatline.loading.function.search"}),n=e.formatMessage({defaultMessage:"Looking into the cavern",id:"chatbot.chatline.loading.function.extractProductName"}),r=e.formatMessage({defaultMessage:"Consulting the shadocks",id:"chatbot.chatline.loading.function.suggestProductName"}),i=e.formatMessage({defaultMessage:"Looking for ziboublis",id:"chatbot.chatline.loading.function.criteriaDefinition"}),a=e.formatMessage({defaultMessage:"Searching Stock",id:"chatbot.chatline.loading.function.searchStock"}),s=e.formatMessage({defaultMessage:"Step",id:"chatbot.chatline.loading.function.step"}),o=e.formatMessage({defaultMessage:"I'm looking for products",id:"chatbot.chatline.loading.function.genericSearchMessage"}),u=e.formatMessage({defaultMessage:"Searching ...",id:"chatbot.chatline.loading.stepName.search"}),c=e.formatMessage({defaultMessage:"Building Query ...",id:"chatbot.chatline.loading.stepName.building"}),d=e.formatMessage({defaultMessage:"Analyzing ...",id:"chatbot.chatline.loading.stepName.analyzing"}),f=e.formatMessage({defaultMessage:"Writing answer",id:"chatbot.chatline.loading.stepName.redacting"}),h=e.formatMessage({defaultMessage:"Cancel",id:"chatbot.chatline.loading.cancel"}),m=e.formatMessage({defaultMessage:"see recent messages",id:"chatbot.chatline.seeRecentMessages"}),y=A=>A?A.includes("ExtractProductNames")?n:A.includes("SuggestProductNames")?r:A==="Recherche ..."?u:A==="Construction ..."?c:A==="Analyse ..."?d:A==="Rédaction"?f:A.includes("CreateCriteriasFromProductNames")||A.includes("CreateCriteriasOrProductNamesFromDiscussion")?i:A.includes("SearchStock")?a:"":t,b=y();return{searchTranslation:t,extractProductNameTranslation:n,criteriaDefinitionTranslation:i,searchStockTranslation:a,stepTranslation:s,getCurrentStepTranslated:y,defaultStartingStep:b,lookingForProductTranslation:o,cancelTranslation:h,recentMessagesTranslation:m}},em=e=>/(\[.*|!\[.*)$/.test(e),tm=e=>/\)/.test(e),bo=()=>({rendered:"",markdownTag:"",isWritingTag:!1,lastStreamSourceUuid:null});class nm{buffers=new Map;callbacks;constructor(t){this.callbacks=t}handleStart(t){this.buffers.set(t.messageId,bo()),t.role==="assistant"&&this.callbacks.onAssistantMessageStart?.(),this.callbacks.addEmptyMessage({messageStreamId:t.messageId,role:t.role})}handleDelta(t){this.ensureBufferExists(t.messageId);const n=this.buffers.get(t.messageId);this.appendSourceSeparatorIfNeeded(n,t.streamSourceUuid),this.appendDelta(n,t.delta),this.callbacks.updateMessage({id:t.messageId,newContent:n.rendered})}handleEnd(t){this.buffers.delete(t.messageId)}hasBuffer(t){return this.buffers.has(t)}ensureBufferExists(t){this.buffers.has(t)||(this.buffers.set(t,bo()),this.callbacks.addEmptyMessage({messageStreamId:t,role:"assistant"}))}appendSourceSeparatorIfNeeded(t,n){t.lastStreamSourceUuid&&t.lastStreamSourceUuid!==n&&(t.rendered+='<span style="display:block;height:1rem;"></span>'),t.lastStreamSourceUuid=n??null}appendDelta(t,n){if(tm(n)){t.markdownTag+=n,t.rendered+=t.markdownTag,t.markdownTag="",t.isWritingTag=!1;return}if(t.isWritingTag||em(n)){t.markdownTag+=n,t.isWritingTag=!0;return}t.rendered+=n}}const rm=1e4,im=3e3,am=e=>{const t=new URL(e);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t},sm=({apiUrl:e,handoff:t})=>(t.socketUrl.startsWith("ws://")||t.socketUrl.startsWith("wss://")?new URL(t.socketUrl):new URL(t.socketUrl,am(e))).toString(),om=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return["connected","customer_message_ack","provider_message","closed","error"].includes(t.type)};class um{socket;callbacks;url;appToken;handoffToken;isIntentionalClose=!1;handshakeTimeout;closeAcknowledgementTimeout=null;constructor(t){this.callbacks=t.callbacks,this.url=sm(t),this.appToken=t.appToken;const n=t.handoff.reconnectToken??t.handoff.handoffToken;if(!n)throw new Error("Customer support socket requires a reconnect token");this.handoffToken=n,this.socket=new WebSocket(this.url),this.handshakeTimeout=setTimeout(()=>{this.socket.readyState!==WebSocket.CONNECTING&&this.socket.readyState!==WebSocket.OPEN||(this.callbacks.onTransportError?.({readyState:this.socket.readyState,url:this.safeUrlForLogs()}),this.socket.close())},rm),this.socket.addEventListener("open",this.sendAuthMessage),this.socket.addEventListener("message",this.handleMessage),this.socket.addEventListener("close",this.handleClose),this.socket.addEventListener("error",this.handleTransportError)}sendAuthMessage=()=>{this.isIntentionalClose||this.socket.send(JSON.stringify({type:"auth",appToken:this.appToken,handoffToken:this.handoffToken}))};sendCustomerMessage(t){if(this.socket.readyState!==WebSocket.OPEN){this.callbacks.onError?.({type:"error",message:"Customer support connection is not ready.",code:"CUSTOMER_SUPPORT_SOCKET_NOT_READY"});return}const n={type:"customer_message",text:t,clientMessageId:crypto.randomUUID()};this.socket.send(JSON.stringify(n))}close(t,n){if(this.isIntentionalClose=!0,clearTimeout(this.handshakeTimeout),this.socket.readyState===WebSocket.OPEN&&n?.notifyServer){const r={type:"close",reason:t};this.socket.send(JSON.stringify(r)),this.closeAcknowledgementTimeout=setTimeout(()=>{this.closeTransport(t)},im);return}this.closeTransport(t)}handleMessage=t=>{clearTimeout(this.handshakeTimeout);let n;try{n=JSON.parse(t.data)}catch{if(this.isIntentionalClose)return;this.callbacks.onError?.({type:"error",message:"Customer support sent an invalid message.",code:"CUSTOMER_SUPPORT_SOCKET_INVALID_MESSAGE"});return}if(om(n)){if(this.isIntentionalClose){n.type==="closed"&&this.closeTransport("Customer support session closed");return}if(n.type==="connected"){this.callbacks.onConnected?.(n);return}if(n.type==="provider_message"){this.callbacks.onProviderMessage?.(n);return}if(n.type==="closed"){this.callbacks.onClosed?.(n);return}n.type==="error"&&this.callbacks.onError?.(n)}};handleClose=t=>{clearTimeout(this.handshakeTimeout),this.closeAcknowledgementTimeout!==null&&(clearTimeout(this.closeAcknowledgementTimeout),this.closeAcknowledgementTimeout=null),!this.isIntentionalClose&&this.callbacks.onClose?.(t)};handleTransportError=()=>{this.isIntentionalClose||this.callbacks.onTransportError?.({readyState:this.socket.readyState,url:this.safeUrlForLogs()})};closeTransport(t){this.closeAcknowledgementTimeout!==null&&(clearTimeout(this.closeAcknowledgementTimeout),this.closeAcknowledgementTimeout=null),this.socket.close(1e3,t??"Customer support socket detached")}safeUrlForLogs(){const t=new URL(this.url);return t.searchParams.has("handoffToken")&&t.searchParams.set("handoffToken","<redacted>"),t.toString()}}const cm=new Set(["SLACK_INBOUND_EVENT_NOT_OBSERVED"]),lm=e=>e&&cm.has(e)?"provider_unavailable":"connection_error",dm=e=>e.isClosed?e.labels.closed:!e.isCustomerSupportMode||!e.hasTransportFailed?null:e.failureKind==="provider_unavailable"?e.labels.providerUnavailable:e.labels.connectionError,fm=[500,1500,3e3],hm=e=>{const t=fm[e];return t===void 0?{shouldRetry:!1}:{shouldRetry:!0,delayMs:t}};class mm{active=null;isPending(){return this.active!==null}invalidate(){this.active=null}async submit(t,n){if(this.active)return!1;const r={};this.active=r;try{const i=await t().catch(()=>!1);return this.active!==r?!1:(n(i),i)}finally{this.active===r&&(this.active=null)}}}const zc=e=>e.mode!==St.customerSupport?!1:e.customerSupportState.status!=="closed",as=e=>e.mode!==St.customerSupport?!1:e.customerSupportState.status==="closed",ss=e=>e.mode!==St.customerSupport||e.customerSupportState.status==="closed"?!1:e.customerSupportState.mode==="closed_hours_contact_capture",pm=e=>ss(e)?"customer_support":zc(e)?"customer_support_connecting":as(e)?"customer_support":"ai",gm=e=>ss(e)?"idle":zc(e)?"connecting":as(e)?"closed":"idle",bm=e=>e.customerSupportState?.closedReason==="closed_hours_contact_submitted"?"submitted":ss(e)?"visible":"idle",Em=e=>e?.trim()||void 0,Tm=e=>e.mode!==St.customerSupport||e.customerSupportState.status==="closed"||e.customerSupportState.mode==="closed_hours_contact_capture"?null:e.customerSupportState,$c=e=>!!(e&&e.mode!=="closed_hours_contact_capture"),os=e=>e?.mode==="closed_hours_contact_capture",ym=e=>{if(e.isCustomerSupportMode&&e.isCurrentDiscussion&&$c(e.state))return e.state.fallbackContactCapture},_m=e=>{if(e.isCustomerSupportMode&&e.isCurrentDiscussion&&os(e.state))return e.state.closedHoursContactCapture},xm=e=>{if(e.isCustomerSupportMode&&e.isCurrentDiscussion&&os(e.state))return e.state.businessHours},Sm=e=>e.isCustomerSupportMode?e.chatTransportMode==="customer_support_connecting"?"customer_support_connecting":e.isCurrentDiscussion?os(e.state)?"customer_support_closed_hours_form":e.socketStatus!=="connected"?`socket_${e.socketStatus}`:e.isWaitingForFirstProviderReply?"waiting_first_provider_reply":e.isCustomerSupportClosed?"customer_support_closed":null:e.currentDiscussionId===null?"discussion_not_loaded":"discussion_mismatch":null;function Cm({appToken:e,conversationStorageKey:t,currentConversation:n,loadingStatus:r,labels:i,logger:a,setCurrentConversationId:s,setLoadingStatus:o,addMessageToCurrentConversation:u,chatboxBootState:c,resetConversationRequestId:d}){const f=ri(),h=c,[m,y]=S.useState(()=>pm(h)),[b,A]=S.useState(h.customerSupportState),[I,w]=S.useState(()=>gm(h)),[N,M]=S.useState(null),[v,p]=S.useState(()=>h.customerSupportState?.closedReason==="fallback_contact_submitted"?"submitted":"idle"),[O,B]=S.useState(()=>bm(h)),X=S.useRef(null),[k]=S.useState(()=>new mm),U=S.useRef(d),W=S.useRef(!1),H=S.useRef(null),G=S.useRef(Tm(h)),ee=S.useRef(as(h)),pe=S.useRef(!1),ge=S.useRef(0),we=S.useRef(null),ve=m!=="ai",E=b?.discussionId===n.discussionId,z=ve&&b?.status==="closed",K=dm({isCustomerSupportMode:ve,isClosed:z,hasTransportFailed:I==="failed",failureKind:N,labels:i}),x=!!(ve&&E&&b?.mode!=="closed_hours_contact_capture"&&b?.isWaitingForFirstProviderReply),ne={isCustomerSupportMode:ve,isCurrentDiscussion:E,state:b},re=ym(ne),J=_m(ne),se=xm(ne),oe=!!re?.enabled&&["visible","submitting","submitted","failed"].includes(v),fe=!!J?.enabled&&["visible","submitting","submitted","failed"].includes(O),te=Sm({chatTransportMode:m,currentDiscussionId:n.discussionId,isCustomerSupportClosed:z,isCustomerSupportMode:ve,isCurrentDiscussion:E,isWaitingForFirstProviderReply:x,socketStatus:I,state:b}),De=te!==null,Q=S.useRef("");S.useLayoutEffect(()=>{const P=JSON.stringify(n.items.flatMap(ue=>{const Re=ue.metaData?.interactiveWidget;return Re?[[Re.instanceId,Re.state,Re.selectedActionId]]:[]}));if(r!=="notLoading"&&P===Q.current||n.items.length===0)return;const q=E?b:null;!n.discussionId&&!q||(c0({conversation:n,customerSupport:q,key:t}),Q.current=P)},[r,n,b,t,E]),S.useLayoutEffect(()=>(pe.current=!1,()=>{pe.current=!0,k.invalidate(),we.current!==null&&(window.clearTimeout(we.current),we.current=null),X.current?.close("Widget unmounted"),X.current=null}),[]);const ke=(P,q,ue)=>{u({userType:"assistant",content:P,metaData:{messageKind:"system",systemEvent:q,...ue},temporaryId:crypto.randomUUID()})},je=(P,q)=>{u({userType:"assistant",content:P,metaData:{messageKind:"conversation",authorType:"customer_support_operator",...q},temporaryId:crypto.randomUUID()})},qe=(P,q)=>{X.current?.close(P,q),X.current=null},xt=()=>{k.invalidate(),p("idle"),B("idle"),we.current!==null&&(window.clearTimeout(we.current),we.current=null),ge.current=0,H.current=null,G.current=null,ee.current=!1,M(null),A(null),w("idle"),y("ai")},At=(P,q)=>{qe(P,q),xt()};S.useLayoutEffect(()=>{U.current!==d&&(U.current=d,W.current=!0,At("Starting new conversation",{notifyServer:!0}))},[d]),S.useEffect(()=>{n.discussionId===null&&W.current&&b===null&&m==="ai"&&(W.current=!1)},[m,n.discussionId,b]);const Be=P=>{ee.current||(ee.current=!0,H.current=null,X.current=null,P?.discussionId&&s(P.discussionId),o("notLoading"),M(null),w("closed"),y("customer_support"),A(q=>{if(!q)return q;const ue=new Date().toISOString();return{...q,status:"closed",discussionId:P?.discussionId??q.discussionId,updatedAt:ue,closedAt:P?.closedAt??ue,closedReason:P?.reason,isWaitingForFirstProviderReply:!1}}))},ot=(P,q)=>{X.current&&qe("Replacing customer support socket"),w("connecting");let ue=!1,Re=!1;const Ze=Te=>{M(Te),w("failed"),o("notLoading")},et=Te=>{X.current=null;const Fe=hm(ge.current);if(!Fe.shouldRetry){a.error("Customer support socket reconnect exhausted code="+Te.code+" reason="+(Te.reason||"none")),Ze("connection_error");return}ge.current+=1,w("connecting"),y("customer_support_connecting"),a.log("Customer support socket reconnect scheduled attempt="+ge.current+" delayMs="+Fe.delayMs+" code="+Te.code),we.current=window.setTimeout(()=>{we.current=null,!(pe.current||ee.current)&&ot(P,{...q,addConnectedMessage:ue?!1:q?.addConnectedMessage})},Fe.delayMs)};X.current=new um({apiUrl:f,appToken:e,handoff:P,callbacks:{onConnected:Te=>{const Fe=P.reconnectToken??P.handoffToken;if(!Fe){Be({reason:"Missing reconnect token"});return}ue=!0,ge.current=0,q?.isStoredReconnect&&(G.current=null);const We=new Date().toISOString();s(Te.discussionId),M(null),w("connected"),y("customer_support"),o("notLoading"),A(ct=>{const Xe=$c(ct)?ct:null;return{mode:"live_chat",status:"active",discussionId:Te.discussionId,socketUrl:P.socketUrl,reconnectToken:Fe,reconnectTokenExpiresAt:Te.reconnectTokenExpiresAt??P.reconnectTokenExpiresAt,customerSupportSessionId:Te.customerSupportSessionId??P.customerSupportSessionId,provider:Xe?.provider,isWaitingForFirstProviderReply:Xe?.isWaitingForFirstProviderReply??!0,fallbackContactCapture:Xe?.fallbackContactCapture,startedAt:Xe?.startedAt??We,updatedAt:We}}),q?.addConnectedMessage!==!1&&ke(i.connected,"customer_support_connected")},onProviderMessage:Te=>{M(null),w("connected"),p(Fe=>Fe==="submitted"?Fe:"idle"),A(Fe=>!Fe||Fe.mode==="closed_hours_contact_capture"?Fe:{...Fe,status:"active",provider:Te.provider??Fe.provider,reconnectTokenExpiresAt:Te.reconnectTokenExpiresAt??Fe.reconnectTokenExpiresAt,isWaitingForFirstProviderReply:!1,updatedAt:new Date().toISOString()}),je(Te.text,{customerSupportAuthorName:Em(Te.authorName),customerSupportProvider:Te.provider})},onClosed:Te=>{Re=!0,Be({reason:Te.reason,closedAt:Te.closedAt,discussionId:Te.discussionId})},onError:Te=>{Re=!0,a.error("Customer support socket server error code="+Te.code+" message="+Te.message),Ze(lm(Te.code))},onClose:Te=>{pe.current||ee.current||Re||et(Te)},onTransportError:Te=>{a.error(`Customer support socket transport error readyState=${Te.readyState} url=${Te.url}`)}}})};S.useEffect(()=>{const P=G.current;if(!P)return;const q=Lc(P,n.discussionId);if(q!=="discussion_not_loaded"){if(q==="session_closed"){G.current=null,w("closed"),y("customer_support");return}if(q){G.current=null,A(ue=>ue?.discussionId===n.discussionId?ue:null),w("idle"),y("ai");return}X.current||(w("connecting"),y("customer_support_connecting"),ot({mode:"live_chat",transport:"socket",socketUrl:P.socketUrl,reconnectToken:P.reconnectToken,reconnectTokenExpiresAt:P.reconnectTokenExpiresAt,customerSupportSessionId:P.customerSupportSessionId,discussionId:P.discussionId,fallbackContactCapture:P.fallbackContactCapture},{addConnectedMessage:!1,isStoredReconnect:!0}))}},[n.discussionId]);const ut=P=>{if(k.invalidate(),P.mode==="closed_hours_contact_capture"){L(P);return}const q=P.reconnectToken??P.handoffToken;if(!P.discussionId||!q){ke(i.connectionError,"customer_support_connection_error",{isErrorMessage:!0});return}const ue=new Date().toISOString();H.current=P,ee.current=!1,p("idle"),A({mode:"live_chat",status:"connecting",discussionId:P.discussionId,socketUrl:P.socketUrl,reconnectToken:q,reconnectTokenExpiresAt:P.reconnectTokenExpiresAt,customerSupportSessionId:P.customerSupportSessionId,isWaitingForFirstProviderReply:!0,fallbackContactCapture:P.fallbackContactCapture,startedAt:ue,updatedAt:ue}),w("connecting"),y("customer_support_connecting"),ke(i.connecting,"customer_support_connecting")},Ee=()=>{const P=H.current;!P||P.mode!=="live_chat"||(H.current=null,ot(P))},Ne=P=>m!=="customer_support"||I!=="connected"||!E||!X.current?(ke(i.connectionError,"customer_support_connection_error",{isErrorMessage:!0}),!1):(X.current.sendCustomerMessage(P),!0);S.useEffect(()=>{if(!re?.enabled||!x||!E||I!=="connected"||v!=="idle")return;const P=Math.max(1,re.timeoutMinutes)*60*1e3,q=window.setTimeout(()=>{p("visible")},P);return()=>window.clearTimeout(q)},[re,v,E,x,I]);const Se=async(P,q,ue)=>{const Re=b;return!Re?.customerSupportSessionId||!Re.reconnectToken||!E||k.isPending()||pe.current||Re.status==="closed"?!1:(ue("submitting"),k.submit(async()=>(await fetch(`${f}/customer-support/sessions/${Re.customerSupportSessionId}/fallback-contact`,wn.getFetchConfig({httpVerb:"POST",contentType:"application/json",body:{reconnectToken:Re.reconnectToken,reasonType:q,...P}}))).ok,Ze=>{if(!Ze){ue("failed");return}ue("submitted"),qe("Contact submitted"),Be({reason:q==="closed_hours"?"closed_hours_contact_submitted":"fallback_contact_submitted",discussionId:Re.discussionId})}))},Ae=P=>Se(P,"fallback_no_reply",p),L=P=>{if(!P.discussionId){ke(i.connectionError,"customer_support_connection_error",{isErrorMessage:!0});return}const q=new Date().toISOString();H.current=null,ee.current=!1,qe("Closed-hours contact capture"),A({mode:"closed_hours_contact_capture",status:"active",discussionId:P.discussionId,reconnectToken:P.reconnectToken,reconnectTokenExpiresAt:P.reconnectTokenExpiresAt,customerSupportSessionId:P.customerSupportSessionId,closedHoursContactCapture:P.closedHoursContactCapture,businessHours:P.businessHours,startedAt:q,updatedAt:q}),w("idle"),y("customer_support"),o("notLoading"),B("visible")},j=P=>b?.mode!=="closed_hours_contact_capture"?Promise.resolve(!1):Se(P,"closed_hours",B);return S.useEffect(()=>{if(ve&&b&&b.status!=="closed"&&n.discussionId!==b.discussionId&&n.discussionId===null){if(W.current)return;s(b.discussionId);return}},[n.discussionId,b,ve,I,s]),{chatTransportMode:m,contactCaptureInstanceId:String(b?.customerSupportSessionId??b?.startedAt??"unavailable"),socketStatus:I,isCustomerSupportMode:ve,isCustomerSupportClosed:z,customerSupportStatusMessage:K,isCustomerSupportInputDisabled:De,customerSupportInputDisabledReason:te,enterCustomerSupportMode:ut,flushPendingCustomerSupportHandoff:Ee,sendToCustomerSupport:Ne,fallbackContactCaptureConfig:re,fallbackContactCaptureStatus:v,shouldDisplayFallbackContactCapture:oe,submitFallbackContactCapture:Ae,closedHoursContactCaptureConfig:J,closedHoursBusinessHours:se,closedHoursContactCaptureStatus:O,shouldDisplayClosedHoursContactCapture:fe,submitClosedHoursContactCapture:j}}const Eo=e=>e?!!(e.submitInteractionResult&&e.resumeInteraction)||e.interactiveWidgetCapabilities?.localPreview?Z.INTERACTIVE_WIDGET_PROTOCOL_V3:void 0:Z.INTERACTIVE_WIDGET_PROTOCOL_V3,Im=e=>e.runtimeAdapter?e.prompt.mode!=="text"?Promise.reject(new Error("WIDGET_RUNTIME_ADAPTER_TEXT_PROMPTS_ONLY")):e.runtimeAdapter.sendTextPrompt(e.prompt.request):e.sendStandardPrompt();class Am{active=null;logger;constructor(t=console){this.logger=t}start(){return this.active?null:(this.active={id:crypto.randomUUID(),controller:new AbortController,decoder:new Ht(this.logger)},this.active)}hasActiveStream(){return this.active!==null}isCurrent(t){return this.active?.id===t.id}finish(t){return this.isCurrent(t)?(this.active=null,!0):!1}cancel(t){const n=this.active;return n?(this.active=null,n.controller.abort(t),n):null}}const dr=(e,t)=>`chatsystem:interaction:v2:${e}:${t}`,wm=(e,t,n)=>{t.responsePolicy.mode==="resume_turn"&&Lt.setItem(dr(e,t.instanceId),JSON.stringify({continuationId:t.responsePolicy.continuation.continuationId,expiresAt:t.responsePolicy.continuation.expiresAt,resultToken:t.responsePolicy.resultToken,discussionId:n}))},qn=(e,t)=>{const n=dr(e,t),r=Lt.getItem(n);if(!r)return null;try{const i=JSON.parse(r);return typeof i.continuationId!="string"||typeof i.expiresAt!="string"||typeof i.resultToken!="string"||typeof i.discussionId!="number"||!Number.isSafeInteger(i.discussionId)||i.discussionId<=0||!Number.isFinite(Date.parse(i.expiresAt))||Date.parse(i.expiresAt)<=Date.now()||i.submissionId!==void 0&&typeof i.submissionId!="string"||i.resultAccepted!==void 0&&typeof i.resultAccepted!="boolean"||i.resultStatus!==void 0&&i.resultStatus!=="submitted"&&i.resultStatus!=="cancelled"?(Lt.removeItem(n),null):i}catch{return Lt.removeItem(n),null}},vm=(e,t,n)=>{const r=qn(e,t);r&&Lt.setItem(dr(e,t),JSON.stringify({...r,submissionId:n,resultAccepted:!0}))},km=(e,t,n,r="submitted")=>{const i=qn(e,t);i&&Lt.setItem(dr(e,t),JSON.stringify({...i,submissionId:n,resultAccepted:!1,resultStatus:r}))},To=(e,t)=>Lt.removeItem(dr(e,t)),Wc=(e,t)=>({"Content-Type":"application/json",[Z.INTERACTIVE_WIDGET_RESULT_TOKEN_HEADER]:e,...t?{Authorization:`Bearer ${t}`}:{}}),Nm=(e,t)=>e?.submitInteractionResult?e.submitInteractionResult(t):fetch(`${t.apiUrl}/ai/client-interactions/${encodeURIComponent(t.appToken)}/${encodeURIComponent(t.continuationId)}/result`,{method:"POST",headers:Wc(t.resultToken,t.authorizationToken),body:JSON.stringify({discussionId:t.discussionId,submissionId:t.submissionId,result:t.result}),signal:t.signal}),Rm=(e,t)=>e?.resumeInteraction?e.resumeInteraction(t):fetch(`${t.apiUrl}/ai/client-interactions/${encodeURIComponent(t.appToken)}/${encodeURIComponent(t.continuationId)}/resume`,{method:"POST",headers:Wc(t.resultToken,t.authorizationToken),body:JSON.stringify({discussionId:t.discussionId}),signal:t.signal}),Om=e=>({status:"submitted",actionId:e.actionId,data:e.data??{}}),Lm=e=>{const{appToken:t,agentId:n}=e,r=lr(),i=ri(),a=N0(),s=S.useContext(Hc),{appCurrentLang:o}=S.useContext(Ic),{companySettings:u}=S.useContext(Pt),c=ts({appToken:t,agentId:n}),d=Dc({appToken:t,agentId:n}),f=S.useRef(null),h=S.useRef(s),m=S.useRef(new Set),y=S.useRef(new AbortController),b=S.useRef(null),A=S.useRef(null),I=S.useRef(new Set),w=S.useRef(new Set),N=S.useRef(null),M=S.useRef(null),v=S.useRef(null);v.current||(v.current=new Am(r));const p=v.current,O=S.useRef(!0),B=Y=>O.current&&p.isCurrent(Y),[X,k]=S.useState(0),{draftStore:U}=S.useContext(ni);(!f.current||h.current!==s)&&(h.current=s,f.current=new D0(s)),S.useEffect(()=>{const Y=f.current;let ce=0,le=!1;if(!s){U.setOwner(a?null:"anonymous");return}if(!Y)return;const he=async()=>{const Pe=++ce;try{const it=await Y.getToken({interactive:!1}),Ut=a?null:await R0(it);!le&&Pe===ce&&U.setOwner(Ut)}catch{Y.clear()}};he();const ae=s.subscribe?.(()=>{U.clear(),U.setOwner(null),Y.handleIdentityChanged(),k(Pe=>Pe+1),he()});return()=>{le=!0,ae?.()}},[s,U,a]);const{genericErrorTranslation:W,connectionInterruptedTranslation:H,tooManyRequestsTranslation:G,discussionFullErrorTranslation:ee,customerSupportConnectingTranslation:pe,customerSupportConnectedTranslation:ge,customerSupportConnectionErrorTranslation:we,customerSupportProviderUnavailableTranslation:ve,customerSupportClosedTranslation:E}=rs(),{defaultStartingStep:z}=is(),{currentConversation:K,setCurrentConversation:x,addEmptyMessageToCurrentConversation:ne,addMessageToCurrentConversation:re,removeEmptyAssistantMessageFromCurrentConversation:J,resetConversation:se,setCurrentConversationId:oe,updateCurrentConversationMessageById:fe,updateInteractiveWidget:te,chatboxBootState:De,resetConversationRequestId:Q}=ai(),[ke,je]=S.useState("notLoading");S.useLayoutEffect(()=>{for(const Y of K.items){const ce=Y.metaData?.interactiveWidget;ce&&["submitted","cancelled","unavailable"].includes(ce.state)&&U.remove(Ac(K.discussionId,`interactive:${ce.instanceId}`))}},[K,U]);const[qe,xt]=S.useState(null),[At,Be]=S.useState(z),[ot,ut]=S.useState(null),[Ee,Ne]=S.useState(!1),{chatTransportMode:Se,contactCaptureInstanceId:Ae,isCustomerSupportMode:L,customerSupportStatusMessage:j,isCustomerSupportInputDisabled:P,enterCustomerSupportMode:q,flushPendingCustomerSupportHandoff:ue,sendToCustomerSupport:Re,fallbackContactCaptureConfig:Ze,fallbackContactCaptureStatus:et,shouldDisplayFallbackContactCapture:Te,submitFallbackContactCapture:Fe,closedHoursContactCaptureConfig:We,closedHoursBusinessHours:ct,closedHoursContactCaptureStatus:Xe,shouldDisplayClosedHoursContactCapture:ze,submitClosedHoursContactCapture:wt}=Cm({appToken:t,conversationStorageKey:d,currentConversation:K,loadingStatus:ke,labels:{connecting:pe,connected:ge,connectionError:we,providerUnavailable:ve,closed:E},logger:r,setCurrentConversationId:oe,setLoadingStatus:je,addMessageToCurrentConversation:re,chatboxBootState:De,resetConversationRequestId:Q}),ft=S.useRef(null);ft.current||(ft.current=new nm({addEmptyMessage:ne,updateMessage:fe,onAssistantMessageStart:()=>je("loadingDisplayedAnswer")}));const yi=ft.current,Fn=Y=>{B(Y)&&p.finish(Y)&&(je("notLoading"),Be(z),ut(null))},Tr=()=>{const Y=p.start();return Y?(je("loadingIntermediaryStates"),Y):null},yr=Y=>{!B(Y)||Y.controller.signal.aborted||(r.warn("[ChatSystem] Response transport interrupted."),J(),re({userType:"assistant",content:H,metaData:{isErrorMessage:!0},temporaryId:crypto.randomUUID()}),Fn(Y))},lf=()=>{p.cancel("Cancelling stream on purpose.")&&(r.log("Stream request aborted"),je("notLoading"),Be(z),ut(null),J())};S.useEffect(()=>{if(L){Ne(!1);return}const Y=u?.api?.settings?.maxAiResponsesPerDiscussion;Ne(Q0(K,Y))},[u?.api?.settings?.maxAiResponsesPerDiscussion,K.completedAiResponseCount,K.discussionId,L]);const Us=S.useRef(Q);S.useLayoutEffect(()=>{Us.current!==Q&&(Us.current=Q,p.cancel("Conversation reset."),y.current.abort(),y.current=new AbortController,Mi(c),b.current=null,A.current=null,je("notLoading"),Be(z),ut(null),Ne(!1))},[z,Q]),S.useLayoutEffect(()=>(O.current=!0,y.current.signal.aborted&&(y.current=new AbortController),M.current&&(clearTimeout(M.current),M.current=null),()=>{O.current=!1,y.current.abort(),M.current=setTimeout(()=>{p.cancel("Widget runtime unmounted."),M.current=null},0)}),[p]);const _i=(Y,ce)=>{for(const le of Y)if(Ht.isObjectOutputstreamMessageStartDTO(le))yi.handleStart(le);else if(Ht.isObjectOutputstreamMessageDeltaDTO(le))yi.handleDelta(le);else if(Ht.isObjectOutputstreamMessageEndDTO(le))yi.handleEnd(le);else if(Ht.isObjectOutputstreamLoadingCurrentStepNumberDTO(le))ut(le.content);else if(Ht.isObjectOutputstreamLoadingCurrentStepNameDTO(le))Be(le.content);else if(Ht.isObjectOutputstreamLoadingNumberOfStepsDTO(le))xt(le.content);else if(Ht.isObjectOutputstreamClientEventDTO(le)){const he=q0(le);if(he.type==="ai_response_completed")x(ae=>X0(ae,he.payload,ce));else if(he.type==="customer_support_handoff_requested")q(he.payload);else if(he.type==="identity_gate_required"){if(m.current.has(he.payload.gateId))continue;m.current.add(he.payload.gateId);const ae=f.current;if(!ae)continue;he.payload.protocolVersion===Z.IDENTITY_GATE_PROTOCOL_V2&&(Number.isSafeInteger(ce)&&ce>0?F0(c,he.payload.continuation,ce):r.warn("Identity continuation ignored without a valid discussion id"),b.current=he.payload.continuation.continuationId);const Pe=y.current.signal;P0({apiUrl:i,appToken:t,payload:he.payload,identitySession:ae,signal:Pe}).then(()=>{!Pe.aborted&&O.current&&he.payload.protocolVersion===Z.IDENTITY_GATE_PROTOCOL_V2&&go(c)?.continuationId===he.payload.continuation.continuationId&&Mi(c)}).catch(it=>r.error(it)).finally(()=>{he.payload.protocolVersion===Z.IDENTITY_GATE_PROTOCOL_V2&&b.current===he.payload.continuation.continuationId&&(b.current=null)})}else if(he.type==="interactive_widget_requested"){if(K.items.some(ae=>ae.metaData?.interactiveWidget?.instanceId===he.payload.instanceId))continue;he.payload.responsePolicy.mode==="resume_turn"&&Number.isSafeInteger(ce)&&ce>0&&wm(c,he.payload,ce),re({userType:"assistant",temporaryId:`interactive-widget:${he.payload.instanceId}`,metaData:{interactiveWidget:{protocolVersion:he.payload.protocolVersion,instanceId:he.payload.instanceId,widgetType:he.payload.widgetType,presentation:he.payload.payload,responseMode:he.payload.responsePolicy.mode,state:"active"}}})}else r.warn(`Client event not handled - ${le.event}`)}else Ht.isObjectOutputstreamErrorDTO(le)?re({userType:"assistant",metaData:{isErrorMessage:!0},content:le.message,temporaryId:crypto.randomUUID()}):r.warn(`Packet shape not handled - ${le}`)},Un=(Y,ce)=>B(ce)?!1:(Y.body?.cancel().catch(()=>{}),!0),xi=async(Y,ce)=>{if(Un(Y,ce))return;const le=Number.parseInt(Y.headers.get("discussionId")??"",10);if(Number.isNaN(le)||oe(le),!Y.ok){if(!B(ce))return;let Pe=W;const it=await Y.json().catch(()=>null);if(!B(ce))return;Y.status===409&&K0(it)?(Pe=ee,Ne(!0)):Y.status===429&&(Pe=G),re({userType:"assistant",content:Pe,metaData:{isErrorMessage:!0},temporaryId:crypto.randomUUID()}),Fn(ce);return}const he=Y.body?.getReader();if(!he){Fn(ce);return}const ae=new TextDecoder;for(;B(ce);){const{done:Pe,value:it}=await he.read();if(!B(ce))break;if(it&&_i(ce.decoder.transformNDJSONChunkIntoObjects(ae.decode(it,{stream:!0})),le),Pe){_i(ce.decoder.transformNDJSONChunkIntoObjects(ae.decode()),le),_i(ce.decoder.flushPending(),le),ue(),Fn(ce);return}}await he.cancel().catch(()=>{})};N.current=xi,S.useEffect(()=>{if(!s||p.hasActiveStream())return;const Y=go(c);if(!Y){A.current=null;return}if(A.current===Y.continuationId||b.current===Y.continuationId)return;const ce=f.current;if(!ce)return;const le=Tr();le&&(A.current=Y.continuationId,U0({apiUrl:i,appToken:t,discussionId:Y.discussionId,continuation:Y,identitySession:ce,signal:le.controller.signal}).then(async he=>{if(!he){A.current=null,Fn(le);return}Un(he,le)||(he.status===401&&ce.clear(),H0(he.status)&&Mi(c),await N.current?.(he,le))}).catch(()=>{yr(le)}))},[i,t,s,X,r,c]),S.useEffect(()=>{if(p.hasActiveStream())return;K.items.map(ae=>ae.metaData?.interactiveWidget).filter(ae=>ae?.responseMode==="resume_turn"&&(ae.state==="active"||ae.state==="submitting")).forEach(ae=>{!ae||w.current.has(ae.instanceId)||(w.current.add(ae.instanceId),qn(c,ae.instanceId)||te(ae.instanceId,Pe=>({...Pe,state:"unavailable"})))});const Y=K.items.map(ae=>ae.metaData?.interactiveWidget).find(ae=>ae?.responseMode==="resume_turn"&&(ae.state==="submitting"||ae.state==="submitted"||ae.state==="cancelled")&&!I.current.has(ae.instanceId));if(!Y)return;const ce=qn(c,Y.instanceId);if(!ce?.submissionId)return;const le=Tr();if(!le)return;I.current.add(Y.instanceId),(async()=>{const ae=a?void 0:await f.current?.getToken({interactive:!1}).catch(()=>null);return B(le)?Rm(a,{apiUrl:i,appToken:t,continuationId:ce.continuationId,discussionId:ce.discussionId,resultToken:ce.resultToken,authorizationToken:ae??void 0,signal:le.controller.signal}):null})().then(async ae=>{!ae||Un(ae,le)||(ae.ok?te(Y.instanceId,Pe=>({...Pe,state:ce.resultStatus??"submitted"})):[401,403,404,410].includes(ae.status)&&te(Y.instanceId,Pe=>({...Pe,state:"unavailable"})),await N.current?.(ae,le),ae.ok&&!le.controller.signal.aborted&&O.current&&To(c,Y.instanceId))}).catch(()=>{yr(le)})},[i,t,K.items,r,a,p,te,c]);const df=(Y,ce,le)=>{const he=n?`?agentId=${encodeURIComponent(String(n))}`:"",ae=`${i}/ai/prompt/${t}${he}`,Pe=Eo(a),it={...s?{[Z.IDENTITY_GATE_VERSION_HEADER]:String(Z.IDENTITY_GATE_PROTOCOL_V2)}:{},...Pe?{[Z.INTERACTIVE_WIDGET_VERSION_HEADER]:String(Pe)}:{},...ce?{Authorization:`Bearer ${ce}`}:{}};if(Y.mode==="text"){const Ci={query:Y.text,language:o.locale};return K.discussionId&&(Ci.discussionId=K.discussionId),{url:ae,fetchConfig:wn.getFetchConfig({httpVerb:"POST",body:Ci,contentType:"application/json",options:{signal:le,headers:{...wn.getHeaders({contentType:"application/json"}),...it}}})}}const Ut=new FormData;return Ut.append("language",o.locale),K.discussionId&&Ut.append("discussionId",String(K.discussionId)),Ut.append("audioInput",Y.audioFile,Y.audioFile.name),{url:ae,fetchConfig:{method:"POST",body:Ut,signal:le,headers:it}}},Hs=Y=>{const ce=Tr();return ce?((async()=>{let le=null;if(!a)try{le=await f.current?.getToken({interactive:!1})??null}catch{f.current?.clear()}if(!B(ce))return;const he=Y.mode==="audio"?{mode:"audio"}:{mode:"text",request:{apiUrl:i,appToken:t,agentId:n,query:Y.text,language:o.locale,discussionId:K.discussionId,interactiveWidgetProtocolVersion:Eo(a),signal:ce.controller.signal}};try{const ae=await Im({runtimeAdapter:a,prompt:he,sendStandardPrompt:()=>{const{url:Pe,fetchConfig:it}=df(Y,le,ce.controller.signal);return fetch(Pe,it)}});if(Un(ae,ce))return;if(ae.status===401&&le&&f.current?.clear(),await xi(ae,ce),ae.ok&&!ce.controller.signal.aborted&&O.current)try{await a?.onAssistantResponseCompleted?.(ae)}catch{r.warn("[ChatSystem] Host completion callback failed.")}}catch{yr(ce)}})(),!0):!1},Si=!L&&(ke!=="notLoading"||Ee||K.items.some(Y=>Y.metaData?.interactiveWidget?.state==="active"||Y.metaData?.interactiveWidget?.state==="submitting"))||L&&(ke!=="notLoading"||P);return{appToken:t,contactCaptureInstanceId:Ae,agentId:n,loadingStatus:ke,numberOfSteps:qe,currentStepName:At,currentStepNumber:ot,isAtMaxMessages:Ee,isCustomerSupportMode:L,customerSupportStatusMessage:j,fallbackContactCaptureConfig:Ze,fallbackContactCaptureStatus:et,shouldDisplayFallbackContactCapture:Te,submitFallbackContactCapture:Fe,closedHoursContactCaptureConfig:We,closedHoursBusinessHours:ct,closedHoursContactCaptureStatus:Xe,shouldDisplayClosedHoursContactCapture:ze,submitClosedHoursContactCapture:wt,isTextareaDisabled:Si,cancelRequest:lf,submitTextMessage:Y=>{if(!Y.trim()||Si)return!1;if(J0(Y)){const ce=Z0(Y,K.discussionId,se);return ce?(re({userType:"user",content:ce,temporaryId:crypto.randomUUID()}),!0):!1}return Se!=="customer_support"&&p.hasActiveStream()?!1:(re({userType:"user",content:Y,temporaryId:crypto.randomUUID()}),Se==="customer_support"?(Re(Y),!0):Hs({mode:"text",text:Y}))},submitAudio:Y=>Si||p.hasActiveStream()?!1:Hs({mode:"audio",audioFile:Y}),submitInteractiveWidget:Y=>{const le=K.items.find(Ge=>Ge.metaData?.interactiveWidget?.instanceId===Y.instanceId)?.metaData?.interactiveWidget;if(!le||le.state!=="active"||p.hasActiveStream())return!1;if(le.responseMode==="none"||le.responseMode==="local_preview")return te(Y.instanceId,Ge=>({...Ge,state:Y.cancel?"cancelled":"submitted",selectedActionId:Y.actionId})),!0;const he=qn(c,Y.instanceId);if(!he)return te(Y.instanceId,Ge=>({...Ge,state:"unavailable"})),!1;const ae=Tr();if(!ae)return!1;const Pe=crypto.randomUUID();km(c,Y.instanceId,Pe,Y.cancel?"cancelled":"submitted"),te(Y.instanceId,Ge=>({...Ge,state:"submitting",selectedActionId:Y.actionId}));const it=Y.cancel?{status:"cancelled"}:Om(Y),Ut=async()=>{const Ge=a?void 0:await f.current?.getToken({interactive:!1}).catch(()=>null);return B(ae)?Nm(a,{apiUrl:i,appToken:t,continuationId:he.continuationId,discussionId:he.discussionId,submissionId:Pe,result:it,resultToken:he.resultToken,authorizationToken:Ge??void 0,signal:ae.controller.signal}):null};return(async()=>{try{return await Ut()}catch(Ge){if(ae.controller.signal.aborted)throw Ge;return Ut()}})().then(async Ge=>{!Ge||Un(Ge,ae)||(Ge.ok?(vm(c,Y.instanceId,Pe),te(Y.instanceId,Ii=>({...Ii,state:Y.cancel?"cancelled":"submitted"}))):[401,403,404,410].includes(Ge.status)&&te(Y.instanceId,Ii=>({...Ii,state:"unavailable"})),await xi(Ge,ae),Ge.ok&&!ae.controller.signal.aborted&&O.current&&To(c,Y.instanceId))}).catch(()=>{B(ae)&&(te(Y.instanceId,Ge=>({...Ge,state:"submitting"})),yr(ae))}),!0}}},Gc=S.createContext(null),Dm=({appToken:e,agentId:t,children:n})=>{const r=Lm({appToken:e,agentId:t});return g.jsx(Gc.Provider,{value:r,children:n})},Yc=()=>{const e=S.useContext(Gc);if(!e)throw new Error("useChatRuntime must be used within ChatRuntimeProvider");return e},qc=S.createContext(null),Pm=qc.Provider,Mm=()=>{const e=S.useContext(qc);if(!e)throw new Error("useWidgetRuntimeStatus must be used within WidgetRuntime");return e},Bm=({children:e,appToken:t,agentId:n,logger:r,identityProvider:i,runtimeAdapter:a})=>{const s=navigator.language;r.log("Brower language",s);const o=e0(s,r),{appCurrentLang:u,handleSetContextCurrentLang:c}=$h(ti,o),d={appCurrentLang:u,setAppCurrentLang:c},[f,h]=S.useState(!1),m=S.useCallback(()=>h(!0),[]),{contextCompanySettings:y,contextInitialConversationState:b}=E0({agentId:n,appToken:t,onFetched:m,runtimeAdapter:a});return S.useEffect(()=>{I0(y.companySettings,r)},[y.companySettings,r]),g.jsx(jc.Provider,{value:a,children:g.jsx(Hc.Provider,{value:i,children:g.jsx(Fh,{locale:u?.locale,messages:u?.translatedText,children:g.jsx(Ic.Provider,{value:d,children:g.jsx(Pt.Provider,{value:y,children:g.jsx(ni.Provider,{value:b,children:g.jsx(Pm,{value:{hasFetchedSettings:f},children:g.jsx(Dm,{appToken:t,agentId:n,children:e})})})})})})})})};function Xc({appToken:e,agentId:t,shouldDisplayLogs:n,apiUrl:r,identityProvider:i,runtimeAdapter:a,children:s}){const o=S.useMemo(()=>Jh(n),[n]),u=ts({appToken:e,agentId:t});return S.useEffect(()=>{e.trim()||o.error("App Token missing")},[e,o]),g.jsx(n0,{apiUrl:r,children:g.jsx(Oc.Provider,{value:o,children:g.jsx(Bm,{appToken:e,agentId:t,logger:o,identityProvider:i,runtimeAdapter:a,children:s},u)})})}const Qc=e=>Ke.createElement("svg",{fill:"#000000",height:"800px",width:"800px",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 330 330",xmlSpace:"preserve",...e},Ke.createElement("path",{id:"XMLID_102_",d:"M325.607,79.393c-5.857-5.857-15.355-5.858-21.213,0.001l-139.39,139.393L25.607,79.393 c-5.857-5.857-15.355-5.858-21.213,0.001c-5.858,5.858-5.858,15.355,0,21.213l150.004,150c2.813,2.813,6.628,4.393,10.606,4.393 s7.794-1.581,10.606-4.394l149.996-150C331.465,94.749,331.465,85.251,325.607,79.393z"})),Fm=({src:e})=>{const[t,n]=S.useState(null);return S.useEffect(()=>{let r=!1;return Mc(e).then(({blobUrl:i})=>{n(i)}).catch(()=>n(null)),()=>{t&&!r&&(URL.revokeObjectURL(t),r=!0)}},[e]),g.jsx("img",{src:t??e,decoding:"async",loading:"eager"})};function Um(e){return!!e&&typeof e=="object"&&"blob"in e&&e.blob instanceof Blob}function Hm({src:e,autoplay:t=!0,loop:n=!0,className:r,style:i,placeholder:a,fallback:s,onLoaded:o,onError:u}){const[c,d]=S.useState({kind:"loading"});return S.useEffect(()=>{let f=null,h=!1;return d({kind:"loading"}),Bc(e).then(async m=>{if(!h)if(m.kind==="zip"){const y=Um(m)?m.blob:await(await fetch(m.blobUrl)).blob();f=URL.createObjectURL(y),d({kind:"lottieZip",blobUrl:f}),o?.(f)}else d({kind:"json",data:m.data}),o?.(m.data)}).catch(m=>!h&&(d({kind:"error",err:m}),u?.(m))),()=>{h=!0,f&&URL.revokeObjectURL(f)}},[e]),c.kind==="loading"?g.jsx("div",{className:"flex items-center justify-center rounded-xl border border-dashed p-6 text-sm opacity-70 "+(r??""),style:{minHeight:96,...i},children:a??"Loading animation…"}):c.kind==="error"?g.jsx("div",{className:"flex items-center justify-center rounded-xl border p-6 text-sm text-red-600 "+(r??""),style:{minHeight:96,...i},children:s??"Failed to load animation"}):c.kind==="json"?g.jsx(ff,{animationData:c.data,loop:n,autoplay:t,className:r,style:i,rendererSettings:{preserveAspectRatio:"xMidYMid meet"}}):g.jsx(hf.DotLottieReact,{src:c.blobUrl,loop:n,autoplay:t,className:r,style:i})}async function jm(e,t={}){const{minPeriod:n=8,maxPeriod:r=Math.floor(Math.min(e.width,e.height)/2),gutterSearchRadius:i=3,debug:a=!1}=t,s=Vt();if(e.width<n*2||e.height<n*2)return a&&s.warn("detectGrid: image too small"),null;const o=document.createElement("canvas");o.width=e.naturalWidth,o.height=e.naturalHeight;const u=o.getContext("2d");if(!u)return null;u.drawImage(e,0,0);const{data:c}=u.getImageData(0,0,o.width,o.height),d=o.width,f=o.height,h=new Uint8ClampedArray(d*f);for(let U=0;U<f;U++){const W=U*d;for(let H=0;H<d;H++){const G=(W+H)*4;h[W+H]=.299*c[G]+.587*c[G+1]+.114*c[G+2]|0}}const m=new Float32Array(d),y=new Float32Array(f);for(let U=1;U<d-1;U++){let W=0;for(let H=0;H<f;H++){const G=H*d+U,ee=h[G+1]-h[G-1];W+=Math.abs(ee)}m[U]=W}for(let U=1;U<f-1;U++){let W=0;for(let H=0;H<d;H++){const G=U*d+H,ee=h[G+d]-h[G-d];W+=Math.abs(ee)}y[U]=W}const b=yo(m,n,Math.min(r,d/2)),A=yo(y,n,Math.min(r,f/2));if(!b||!A)return a&&s.warn("detectGrid: could not find periods"),null;const I=Math.max(1,Math.round(d/b)),w=Math.max(1,Math.round(f/A)),N=_o(m,b,I,i),M=_o(y,A,w,i),v=Math.max(1,b-N),p=Math.max(1,A-M);if(v*I>d+2||p*w>f+2)return a&&s.warn("detectGrid: sanity check failed"),null;const O=Ca(m,60),B=Ca(y,60),X=Math.max(0,xo(m,O)),k=Math.max(0,xo(y,B));return a&&s.log({periodX:b,periodY:A,columns:I,rows:w,gutterX:N,gutterY:M,frameWidth:v,frameHeight:p,originX:X,originY:k}),{columns:I,rows:w,frameWidth:v,frameHeight:p,gutterX:N,gutterY:M,originX:X,originY:k}}function yo(e,t,n){const r=Kc(e);let i=0;for(let m=0;m<e.length;m++){const y=e[m]-r;i+=y*y}if(i===0)return null;const a=new Float32Array(n+1);let s=0,o=-1/0;for(let m=t;m<=n;m++){let y=0;for(let A=0;A+m<e.length;A++)y+=(e[A]-r)*(e[A+m]-r);const b=y/i;a[m]=b,b>o&&(o=b,s=m)}if(s<=t||s>=n)return s||null;const u=a[s-1],c=a[s],d=a[s+1],f=u-2*c+d,h=f===0?0:.5*(u-d)/f;return s+h}function _o(e,t,n,r){const i=[];for(let o=1;o<n;o++){const u=o*t;let c=1/0,d=u;for(let f=-r;f<=r;f++){const h=u+f;if(h<=0||h>=e.length)continue;const m=e[h];m<c&&(c=m,d=h)}i.push(d)}if(i.length<1)return 0;const a=[];for(const o of i){const u=e[o]*1.5+Ca(e,10)*.5;let c=o,d=o;for(;c>1&&e[c-1]<=u;)c--;for(;d<e.length-2&&e[d+1]<=u;)d++;a.push(Math.max(0,d-c+1))}const s=Math.round(Kc(a));return Math.max(0,Math.min(s,Math.floor(t/4)))}function Kc(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}function Ca(e,t){const n=Array.from(e);n.sort((i,a)=>i-a);const r=Math.max(0,Math.min(n.length-1,Math.floor(t/100*n.length)));return n[r]}function xo(e,t){for(let n=0;n<e.length;n++)if(e[n]>t)return n;return 0}function Vm(e,t,n,r,i){const{data:a}=e.getImageData(t,n,r,i);let s=0;for(let o=3;o<a.length;o+=4)s+=a[o];return s/(255*(a.length/4))<.03}const zm=S.forwardRef(function({src:t,frameWidth:n,frameHeight:r,columns:i,rows:a,gutterX:s=0,gutterY:o=0,frameCount:u,atlasFrames:c,fps:d=12,autoplay:f=!0,loop:h=!0,startFrame:m=0,direction:y="forward",scale:b=1,backgroundColor:A,className:I,style:w,pauseWhenHidden:N=!1,originX:M,originY:v,onLoad:p,onEnd:O,onFrame:B},X){const k=lr(),U=S.useRef(null),W=S.useRef(null),[H,G]=S.useState(null),[ee,pe]=S.useState(null),[ge,we]=S.useState(null),[ve,E]=S.useState(!1),[z,K]=S.useState(!!f),[x,ne]=S.useState(m),re=S.useRef(1),[J,se]=S.useState(null),oe=Math.max(1,Math.floor(typeof window<"u"&&window.devicePixelRatio||1));S.useEffect(()=>{let Ee=!1;return E(!1),Fc(t).then(({imgEl:Ne,bitmap:Se})=>{Ee||(G(Ne),pe(Se),we({w:Ne.naturalWidth,h:Ne.naturalHeight}),E(!0),p?.())}).catch(()=>{}),()=>{Ee=!0}},[t,p]),S.useEffect(()=>{let Ee=!1;return(async()=>{if(!H)return;if(c&&c.length){se(null);return}if(!(!n||!r||!i||!a)){se(null);return}const Se=await jm(H,{debug:!0});Ee||(Se?se({frameWidth:Se.frameWidth,frameHeight:Se.frameHeight,columns:Se.columns,rows:Se.rows,gutterX:Se.gutterX,gutterY:Se.gutterY}):(se(null),k.warn("RemoteSpritesheet: auto-detect failed; please provide grid props.")))})(),()=>{Ee=!0}},[H,c,n,r,i,a,k]);const fe=J?.frameWidth??n,te=J?.frameHeight??r,De=J?.columns??i,Q=J?.rows??a,ke=J?.gutterX??s,je=J?.gutterY??o,qe=J?.originX??M??0,xt=J?.originY??v??0,At=S.useMemo(()=>{if(c&&c.length>0)return{cols:0,rows:0};if(!ge||!fe||!te)return{cols:0,rows:0};const Ee=De??Math.floor((ge.w+ke)/(fe+ke)),Ne=Q??Math.floor((ge.h+je)/(te+je));return{cols:Math.max(0,Ee),rows:Math.max(0,Ne)}},[c,ge,fe,te,De,Q,ke,je]),Be=S.useMemo(()=>{if(c?.length)return c;if(!fe||!te)return[];const{cols:Ee,rows:Ne}=At;if(!Ee||!Ne)return[];const Se=Math.min(u??Ee*Ne,Ee*Ne),Ae=[];for(let L=0;L<Se;L++){const j=L%Ee,P=Math.floor(L/Ee),q=qe+j*(fe+ke),ue=xt+P*(te+je);Ae.push({x:q,y:ue,w:fe,h:te})}if(H&&Ae.length){const L=document.createElement("canvas");L.width=H.naturalWidth,L.height=H.naturalHeight;const j=L.getContext("2d");if(j){j.drawImage(H,0,0);let P=Ae.length;for(;P>0&&Vm(j,Ae[P-1].x,Ae[P-1].y,Ae[P-1].w,Ae[P-1].h);)P--;return Ae.slice(0,P)}}return Ae},[c,At,u,fe,te,ke,je,H,qe,xt]),ot=()=>{const Ee=U.current;if(!Ee||Be.length===0)return;const Ne=Be[Math.max(0,Math.min(x,Be.length-1))],Se=Math.max(1,Math.round(Ne.w*b)),Ae=Math.max(1,Math.round(Ne.h*b));Ee.style.width=Se+"px",Ee.style.height=Ae+"px",Ee.width=Se*oe,Ee.height=Ae*oe};S.useEffect(()=>{ot()},[ve,b,Be.length,oe,x]);const ut=Ee=>{const Ne=ee??H??null,Se=U.current;if(!Se||!Ne||Be.length===0)return;const Ae=Se.getContext("2d");if(!Ae)return;Ae.save(),Ae.setTransform(1,0,0,1,0,0),Ae.clearRect(0,0,Se.width,Se.height),A&&(Ae.fillStyle=A,Ae.fillRect(0,0,Se.width,Se.height));const L=Be[Ee];Ae.scale(oe,oe),Ae.drawImage(Ne,L.x,L.y,L.w,L.h,0,0,Math.round(L.w*b),Math.round(L.h*b)),Ae.restore()};return S.useEffect(()=>{if(!ve||Be.length===0)return;let Ee=performance.now();const Ne=1e3/Math.max(1,Math.min(120,d)),Se=Ae=>{if(W.current=requestAnimationFrame(Se),!z){ut(x);return}const L=Ae-Ee;if(L<Ne){ut(x);return}Ee=Ae-L%Ne,ne(j=>{const P=Be.length-1;let q=j;return y==="forward"?q=j+1:y==="backward"?q=j-1:((j>=P&&re.current===1||j<=0&&re.current===-1)&&(re.current*=-1),q=j+re.current),(q>P||q<0)&&(h?q=y==="backward"?P:0:(q=Math.max(0,Math.min(q,P)),K(!1),O?.())),q})};return W.current=requestAnimationFrame(Se),()=>{W.current&&cancelAnimationFrame(W.current)}},[ve,d,z,h,y,Be.length,x]),S.useEffect(()=>{ut(x),B?.(x)},[x,ve,b,oe]),S.useEffect(()=>{if(!N)return;const Ee=()=>{document.hidden&&K(!1)};return document.addEventListener("visibilitychange",Ee),()=>document.removeEventListener("visibilitychange",Ee)},[N]),S.useImperativeHandle(X,()=>({play:()=>K(!0),pause:()=>K(!1),toggle:()=>K(Ee=>!Ee),gotoFrame:Ee=>ne(()=>Math.max(0,Math.min(Ee,Math.max(0,Be.length-1)))),isPlaying:()=>z,currentFrame:()=>x}),[z,x,Be.length]),g.jsx("div",{className:I,style:w,children:g.jsx("canvas",{ref:U,"aria-label":"spritesheet animation"})})});function $m({url:e,className:t}){const[n,r]=S.useState(""),[i,a]=S.useState(null);return S.useEffect(()=>{let s=!1;return Pc(e).then(({sanitized:o})=>{s||(r(o),a(null))}).catch(o=>!s&&a(o.message??"Failed to load")),()=>{s=!0}},[e]),i?g.jsxs("div",{className:t,role:"alert",children:["Couldn’t load SVG: ",i]}):n?g.jsx("div",{className:t,dangerouslySetInnerHTML:{__html:n}}):g.jsx("div",{className:t})}function Wm({mobile:e=.6,tablet:t=.8,desktop:n=1}){const[r,i]=S.useState(n);return S.useEffect(()=>{if(typeof window>"u")return;const a=[{mq:window.matchMedia("(max-width: 639px)"),value:e},{mq:window.matchMedia("(min-width: 640px) and (max-width: 1023px)"),value:t},{mq:window.matchMedia("(min-width: 1024px)"),value:n}],s=()=>{for(const{mq:o,value:u}of a)if(o.matches){i(u);break}};return a.forEach(({mq:o})=>o.addEventListener("change",s)),s(),()=>{a.forEach(({mq:o})=>o.removeEventListener("change",s))}},[e,t,n]),r}const us=({facet:e})=>{const t=lr(),{mode:n,assetUrl:r,spr_columns:i,spr_fps:a,spr_frameCount:s,spr_frameHeight:o,spr_frameWidth:u,spr_gutterX:c,spr_gutterY:d,spr_rows:f,spr_originX:h,spr_originY:m,spr_scaleDesktop:y,spr_scaleMobile:b,spr_scaleTablet:A}=e,I=Wm({mobile:b??.6,tablet:A??.8,desktop:y??1});return g.jsxs("div",{className:"assetContainer",children:[n===Z.AgentDisplayFacetModeType.LOTTIE&&g.jsx(Hm,{src:r,autoplay:!0,onError:w=>t.error(w)}),n===Z.AgentDisplayFacetModeType.SVG&&g.jsx("div",{children:g.jsx($m,{url:r})}),n===Z.AgentDisplayFacetModeType.IMAGE&&g.jsx(Fm,{src:r}),n===Z.AgentDisplayFacetModeType.SPRITESHEET&&g.jsx(zm,{src:r,frameCount:s,columns:i,rows:f,fps:a,frameHeight:o,frameWidth:u,gutterX:c,gutterY:d,originX:h,originY:m,scale:I,autoplay:!0})]})},cs=()=>{const e=Kt(),t=e.formatMessage({id:"chatbot.widget.open",defaultMessage:"Open chat"}),n=e.formatMessage({defaultMessage:"Open chat menu",id:"chatbot.widget.menu.open"}),r=e.formatMessage({defaultMessage:"Start a new discussion",id:"chatbot.widget.menu.startNewDiscussion"}),i=e.formatMessage({defaultMessage:"Close chat",id:"chatbot.widget.close"});return{openChatTranslation:t,openMenuTranslation:n,startNewDiscussionTranslation:r,closeChatTranslation:i}},Gm=({launcherRef:e,isWidgetOpen:t,setIsWidgetOpen:n})=>{const{companySettings:r}=S.useContext(Pt),{openChatTranslation:i,closeChatTranslation:a}=cs();return g.jsxs("div",{ref:e,role:"button",tabIndex:0,"aria-label":t?a:i,"aria-expanded":t,className:`launcher
|
|
37
37
|
fixed
|
|
38
38
|
z-[999999999]
|
|
39
39
|
transition
|
|
@@ -44,36 +44,36 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
44
44
|
flex
|
|
45
45
|
justify-center
|
|
46
46
|
items-center
|
|
47
|
-
`,onClick:()=>n(!t),children:[!t&&b.jsx(ns,{facet:r.agent.display[K.AgentDisplayFacetRoleType.LAUNCHER]}),t&&b.jsx(zc,{className:"w-6 h-6",fill:"white"})]})};function go(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function Wc(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Hm=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jm=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vm={};function bo(e,t){return(Vm.jsx?jm:Hm).test(e)}const zm=/[ \t\n\f\r]/g;function $m(e){return typeof e=="object"?e.type==="text"?Eo(e.value):!1:Eo(e)}function Eo(e){return e.replace(zm,"")===""}class dr{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}dr.prototype.property={};dr.prototype.normal={};dr.prototype.space=null;function Gc(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new dr(n,r,t)}function nr(e){return e.toLowerCase()}class xt{constructor(t,n){this.property=t,this.attribute=n}}xt.prototype.space=null;xt.prototype.boolean=!1;xt.prototype.booleanish=!1;xt.prototype.overloadedBoolean=!1;xt.prototype.number=!1;xt.prototype.commaSeparated=!1;xt.prototype.spaceSeparated=!1;xt.prototype.commaOrSpaceSeparated=!1;xt.prototype.mustUseProperty=!1;xt.prototype.defined=!1;let Wm=0;const Te=pn(),We=pn(),Yc=pn(),W=pn(),Fe=pn(),In=pn(),ft=pn();function pn(){return 2**++Wm}const Ta=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:We,commaOrSpaceSeparated:ft,commaSeparated:In,number:W,overloadedBoolean:Yc,spaceSeparated:Fe},Symbol.toStringTag,{value:"Module"})),Ri=Object.keys(Ta);class rs extends xt{constructor(t,n,r,i){let a=-1;if(super(t,n),To(this,"space",i),typeof r=="number")for(;++a<Ri.length;){const s=Ri[a];To(this,Ri[a],(r&Ta[s])===Ta[s])}}}rs.prototype.defined=!0;function To(e,t,n){n&&(e[t]=n)}const Gm={}.hasOwnProperty;function On(e){const t={},n={};let r;for(r in e.properties)if(Gm.call(e.properties,r)){const i=e.properties[r],a=new rs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[nr(r)]=r,n[nr(a.attribute)]=r}return new dr(t,n,e.space)}const qc=On({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Xc=On({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Qc(e,t){return t in e?e[t]:t}function Kc(e,t){return Qc(e,t.toLowerCase())}const Jc=On({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Kc,properties:{xmlns:null,xmlnsXLink:null}}),Zc=On({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:Fe,ariaCurrent:null,ariaDescribedBy:Fe,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Fe,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Fe,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Fe,ariaLevel:W,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Fe,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Fe,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:We,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null}}),Ym=On({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Kc,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:In,acceptCharset:Fe,accessKey:Fe,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:Fe,autoFocus:Te,autoPlay:Te,blocking:Fe,capture:null,charSet:null,checked:Te,cite:null,className:Fe,cols:W,colSpan:null,content:null,contentEditable:We,controls:Te,controlsList:Fe,coords:W|In,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:Yc,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:Fe,height:W,hidden:Te,high:W,href:null,hrefLang:null,htmlFor:Fe,httpEquiv:Fe,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:Fe,itemRef:Fe,itemScope:Te,itemType:Fe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,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:Te,optimum:W,pattern:null,ping:Fe,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:Fe,required:Te,reversed:Te,rows:W,rowSpan:W,sandbox:Fe,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:We,width:W,wrap:null,align:null,aLink:null,archive:Fe,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Te,disableRemotePlayback:Te,prefix:null,property:null,results:W,security:null,unselectable:null}}),qm=On({space:"svg",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"},transform:Qc,properties:{about:ft,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:Fe,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:In,g2:In,glyphName:In,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,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:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Fe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ft,rev:ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ft,requiredFeatures:ft,requiredFonts:ft,requiredFormats:ft,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ft,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Xm=/^data[-\w.:]+$/i,yo=/-[a-z]/g,Qm=/[A-Z]/g;function ri(e,t){const n=nr(t);let r=t,i=xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Xm.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(yo,Jm);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!yo.test(a)){let s=a.replace(Qm,Km);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=rs}return new i(r,t)}function Km(e){return"-"+e.toLowerCase()}function Jm(e){return e.charAt(1).toUpperCase()}const Zm={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"},fr=Gc([Xc,qc,Jc,Zc,Ym],"html"),Jt=Gc([Xc,qc,Jc,Zc,qm],"svg");function _o(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function el(e){return e.join(" ").trim()}var En={},Oi,xo;function ep(){if(xo)return Oi;xo=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
|
|
48
|
-
`,c="/",d="*",f="",h="comment",m="declaration";Oi=function(g,w){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];w=w||{};var I=1,v=1;function R(j){var z=j.match(t);z&&(I+=z.length);var Z=j.lastIndexOf(u);v=~Z?j.length-Z:v+j.length}function M(){var j={line:I,column:v};return function(z){return z.position=new A(j),B(),z}}function A(j){this.start=j,this.end={line:I,column:v},this.source=w.source}A.prototype.content=g;function p(j){var z=new Error(w.source+":"+I+":"+v+": "+j);if(z.reason=j,z.filename=w.source,z.line=I,z.column=v,z.source=g,!w.silent)throw z}function L(j){var z=j.exec(g);if(z){var Z=z[0];return R(Z),g=g.slice(Z.length),z}}function B(){L(n)}function G(j){var z;for(j=j||[];z=N();)z!==!1&&j.push(z);return j}function N(){var j=M();if(!(c!=g.charAt(0)||d!=g.charAt(1))){for(var z=2;f!=g.charAt(z)&&(d!=g.charAt(z)||c!=g.charAt(z+1));)++z;if(z+=2,f===g.charAt(z-1))return p("End of comment missing");var Z=g.slice(2,z-2);return v+=2,R(Z),g=g.slice(z),v+=2,j({type:h,comment:Z})}}function H(){var j=M(),z=L(r);if(z){if(N(),!L(i))return p("property missing ':'");var Z=L(a),be=j({type:m,property:y(z[0].replace(e,f)),value:Z?y(Z[0].replace(e,f)):f});return L(s),be}}function V(){var j=[];G(j);for(var z;z=H();)z!==!1&&(j.push(z),G(j));return j}return B(),V()};function y(g){return g?g.replace(o,f):f}return Oi}var So;function tp(){if(So)return En;So=1;var e=En&&En.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(En,"__esModule",{value:!0});var t=e(ep());function n(r,i){var a=null;if(!r||typeof r!="string")return a;var s=(0,t.default)(r),o=typeof i=="function";return s.forEach(function(u){if(u.type==="declaration"){var c=u.property,d=u.value;o?i(c,d,u):d&&(a=a||{},a[c]=d)}}),a}return En.default=n,En}var np=tp();const Co=Ha(np),rp=Co.default||Co,ii=tl("end"),Mt=tl("start");function tl(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ip(e){const t=Mt(e),n=ii(e);if(t&&n)return{start:t,end:n}}function qn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Io(e.position):"start"in e||"end"in e?Io(e):"line"in e||"column"in e?ya(e):""}function ya(e){return Ao(e&&e.line)+":"+Ao(e&&e.column)}function Io(e){return ya(e&&e.start)+"-"+ya(e&&e.end)}function Ao(e){return e&&typeof e=="number"?e:1}class Je extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=o?o.line:void 0,this.name=qn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}Je.prototype.file="";Je.prototype.name="";Je.prototype.reason="";Je.prototype.message="";Je.prototype.stack="";Je.prototype.column=void 0;Je.prototype.line=void 0;Je.prototype.ancestors=void 0;Je.prototype.cause=void 0;Je.prototype.fatal=void 0;Je.prototype.place=void 0;Je.prototype.ruleId=void 0;Je.prototype.source=void 0;const is={}.hasOwnProperty,ap=new Map,sp=/[A-Z]/g,op=/-([a-z])/g,up=new Set(["table","tbody","thead","tfoot","tr"]),cp=new Set(["td","th"]),nl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lp(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Ep(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=bp(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Jt:fr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=rl(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function rl(e,t,n){if(t.type==="element")return dp(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fp(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return mp(e,t,n);if(t.type==="mdxjsEsm")return hp(e,t);if(t.type==="root")return pp(e,t,n);if(t.type==="text")return gp(e,t)}function dp(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Jt,e.schema=i),e.ancestors.push(t);const a=al(e,t.tagName,!1),s=Tp(e,t);let o=ss(e,t);return up.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!$m(u):!0})),il(e,s,a,t),as(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function fp(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}rr(e,t.position)}function hp(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);rr(e,t.position)}function mp(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Jt,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:al(e,t.name,!0),s=yp(e,t),o=ss(e,t);return il(e,s,a,t),as(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function pp(e,t,n){const r={};return as(r,ss(e,t)),e.create(t,e.Fragment,r,n)}function gp(e,t){return t.value}function il(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function as(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function bp(e,t,n){return r;function r(i,a,s,o){const c=Array.isArray(s.children)?n:t;return o?c(a,s,o):c(a,s)}}function Ep(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),u=Mt(r);return t(i,a,s,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Tp(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&is.call(t.properties,i)){const a=_p(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&cp.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function yp(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else rr(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else rr(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function ss(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ap;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const c=i.get(u)||0;s=u+"-"+c,i.set(u,c+1)}}const o=rl(e,a,s);o!==void 0&&n.push(o)}return n}function _p(e,t,n){const r=ri(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Wc(n):el(n)),r.property==="style"){let i=typeof n=="object"?n:xp(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Sp(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Zm[r.property]||r.property:r.attribute,n]}}function xp(e,t){const n={};try{rp(t,r)}catch(i){if(!e.ignoreInvalidStyle){const a=i,s=new Je("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=nl+"#cannot-parse-style-attribute",s}}return n;function r(i,a){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(op,Ip)),n[s]=a}}function al(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=bo(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=bo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return is.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);rr(e)}function rr(e,t){const n=new Je("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=nl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Sp(e){const t={};let n;for(n in e)is.call(e,n)&&(t[Cp(n)]=e[n]);return t}function Cp(e){let t=e.replace(sp,Ap);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ip(e,t){return t.toUpperCase()}function Ap(e){return"-"+e.toLowerCase()}const Li={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},wp={};function os(e,t){const n=wp,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return sl(e,r,i)}function sl(e,t,n){if(vp(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return wo(e.children,t,n)}return Array.isArray(e)?wo(e,t,n):""}function wo(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=sl(e[i],t,n);return r.join("")}function vp(e){return!!(e&&typeof e=="object")}const vo=document.createElement("i");function us(e){const t="&"+e+";";vo.innerHTML=t;const n=vo.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ht(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function bt(e,t){return e.length>0?(ht(e,e.length,0,t),e):t}const ko={}.hasOwnProperty;function ol(e){const t={};let n=-1;for(;++n<e.length;)kp(t,e[n]);return t}function kp(e,t){let n;for(n in t){const i=(ko.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){ko.call(i,s)||(i[s]=[]);const o=a[s];Np(i[s],Array.isArray(o)?o:o?[o]:[])}}}function Np(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ht(e,0,0,r)}function ul(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function At(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const rt=Zt(/[A-Za-z]/),Ke=Zt(/[\dA-Za-z]/),Rp=Zt(/[#-'*+\--9=?A-Z^-~]/);function Mr(e){return e!==null&&(e<32||e===127)}const _a=Zt(/\d/),Op=Zt(/[\dA-Fa-f]/),Lp=Zt(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function Pe(e){return e!==null&&(e<0||e===32)}function xe(e){return e===-2||e===-1||e===32}const ai=Zt(new RegExp("\\p{P}|\\p{S}","u")),fn=Zt(/\s/);function Zt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ln(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&Ke(e.charCodeAt(n+1))&&Ke(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),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 Ie(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(u){return xe(u)?(e.enter(n),o(u)):t(u)}function o(u){return xe(u)&&a++<i?(e.consume(u),o):(e.exit(n),t(u))}}const Dp={tokenize:Pp};function Pp(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ie(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return ce(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const Mp={tokenize:Bp},No={tokenize:Fp};function Bp(e){const t=this,n=[];let r=0,i,a,s;return o;function o(R){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,u,c)(R)}return c(R)}function u(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const M=t.events.length;let A=M,p;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){p=t.events[A][1].end;break}I(r);let L=M;for(;L<t.events.length;)t.events[L][1].end=Object.assign({},p),L++;return ht(t.events,A+1,0,t.events.slice(M)),t.events.length=L,c(R)}return o(R)}function c(R){if(r===n.length){if(!i)return h(R);if(i.currentConstruct&&i.currentConstruct.concrete)return y(R);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(No,d,f)(R)}function d(R){return i&&v(),I(r),h(R)}function f(R){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(R)}function h(R){return t.containerState={},e.attempt(No,m,y)(R)}function m(R){return r++,n.push([t.currentConstruct,t.containerState]),h(R)}function y(R){if(R===null){i&&v(),I(0),e.consume(R);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:a,_tokenizer:i}),g(R)}function g(R){if(R===null){w(e.exit("chunkFlow"),!0),I(0),e.consume(R);return}return ce(R)?(e.consume(R),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(R),g)}function w(R,M){const A=t.sliceStream(R);if(M&&A.push(null),R.previous=a,a&&(a.next=R),a=R,i.defineSkip(R.start),i.write(A),t.parser.lazy[R.start.line]){let p=i.events.length;for(;p--;)if(i.events[p][1].start.offset<s&&(!i.events[p][1].end||i.events[p][1].end.offset>s))return;const L=t.events.length;let B=L,G,N;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(G){N=t.events[B][1].end;break}G=!0}for(I(r),p=L;p<t.events.length;)t.events[p][1].end=Object.assign({},N),p++;ht(t.events,B+1,0,t.events.slice(L)),t.events.length=p}}function I(R){let M=n.length;for(;M-- >R;){const A=n[M];t.containerState=A[1],A[0].exit.call(t,e)}n.length=R}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Fp(e,t,n){return Ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Br(e){if(e===null||Pe(e)||fn(e))return 1;if(ai(e))return 2}function si(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const xa={name:"attention",tokenize:Hp,resolveAll:Up};function Up(e,t){let n=-1,r,i,a,s,o,u,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);Ro(f,-u),Ro(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},o={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},a={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},o.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},o.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=bt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=bt(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),c=bt(c,si(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=bt(c,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=bt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ht(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Hp(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Br(r);let a;return s;function s(u){return a=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===a)return e.consume(u),o;const c=e.exit("attentionSequence"),d=Br(u),f=!d||d===2&&i||n.includes(u),h=!i||i===2&&d||n.includes(r);return c._open=!!(a===42?f:f&&(i||!h)),c._close=!!(a===42?h:h&&(d||!f)),t(u)}}function Ro(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jp={name:"autolink",tokenize:Vp};function Vp(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return rt(m)?(e.consume(m),s):c(m)}function s(m){return m===43||m===45||m===46||Ke(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||Ke(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Mr(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),d):Rp(m)?(e.consume(m),c):n(m)}function d(m){return Ke(m)?f(m):n(m)}function f(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||Ke(m))&&r++<63){const y=m===45?h:f;return e.consume(m),y}return n(m)}}const hr={tokenize:zp,partial:!0};function zp(e,t,n){return r;function r(a){return xe(a)?Ie(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||ce(a)?t(a):n(a)}}const cl={name:"blockQuote",tokenize:$p,continuation:{tokenize:Wp},exit:Gp};function $p(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return xe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Wp(e,t,n){const r=this;return i;function i(s){return xe(s)?Ie(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(cl,t,n)(s)}}function Gp(e){e.exit("blockQuote")}const ll={name:"characterEscape",tokenize:Yp};function Yp(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Lp(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const dl={name:"characterReference",tokenize:qp};function qp(e,t,n){const r=this;let i=0,a,s;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,s=Ke,d(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=Op,d):(e.enter("characterReferenceValue"),a=7,s=_a,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===Ke&&!us(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<a?(e.consume(f),d):n(f)}}const Oo={tokenize:Qp,partial:!0},Lo={name:"codeFenced",tokenize:Xp,concrete:!0};function Xp(e,t,n){const r=this,i={tokenize:A,partial:!0};let a=0,s=0,o;return u;function u(p){return c(p)}function c(p){const L=r.events[r.events.length-1];return a=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,o=p,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(p)}function d(p){return p===o?(s++,e.consume(p),d):s<3?n(p):(e.exit("codeFencedFenceSequence"),xe(p)?Ie(e,f,"whitespace")(p):f(p))}function f(p){return p===null||ce(p)?(e.exit("codeFencedFence"),r.interrupt?t(p):e.check(Oo,g,M)(p)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||ce(p)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(p)):xe(p)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ie(e,m,"whitespace")(p)):p===96&&p===o?n(p):(e.consume(p),h)}function m(p){return p===null||ce(p)?f(p):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(p))}function y(p){return p===null||ce(p)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(p)):p===96&&p===o?n(p):(e.consume(p),y)}function g(p){return e.attempt(i,M,w)(p)}function w(p){return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),I}function I(p){return a>0&&xe(p)?Ie(e,v,"linePrefix",a+1)(p):v(p)}function v(p){return p===null||ce(p)?e.check(Oo,g,M)(p):(e.enter("codeFlowValue"),R(p))}function R(p){return p===null||ce(p)?(e.exit("codeFlowValue"),v(p)):(e.consume(p),R)}function M(p){return e.exit("codeFenced"),t(p)}function A(p,L,B){let G=0;return N;function N(Z){return p.enter("lineEnding"),p.consume(Z),p.exit("lineEnding"),H}function H(Z){return p.enter("codeFencedFence"),xe(Z)?Ie(p,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):V(Z)}function V(Z){return Z===o?(p.enter("codeFencedFenceSequence"),j(Z)):B(Z)}function j(Z){return Z===o?(G++,p.consume(Z),j):G>=s?(p.exit("codeFencedFenceSequence"),xe(Z)?Ie(p,z,"whitespace")(Z):z(Z)):B(Z)}function z(Z){return Z===null||ce(Z)?(p.exit("codeFencedFence"),L(Z)):B(Z)}}}function Qp(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Di={name:"codeIndented",tokenize:Jp},Kp={tokenize:Zp,partial:!0};function Jp(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ie(e,a,"linePrefix",5)(c)}function a(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):ce(c)?e.attempt(Kp,s,u)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||ce(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),o)}function u(c){return e.exit("codeIndented"),t(c)}}function Zp(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Ie(e,a,"linePrefix",5)(s)}function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):ce(s)?i(s):n(s)}}const eg={name:"codeText",tokenize:rg,resolve:tg,previous:ng};function tg(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ng(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function rg(e,t,n){let r=0,i,a;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(a=e.enter("codeTextSequence"),i=0,d(f)):ce(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||ce(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",c(f))}}function fl(e){const t={};let n=-1,r,i,a,s,o,u,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ig(e,n)),n=t[n],c=!0);else if(r[1]._container){for(a=n,i=void 0;a--&&(s=e[a],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);i&&(r[1].end=Object.assign({},e[i][1].start),o=e.slice(i,n),o.unshift(r),ht(e,i,n-i+1,o))}}return!c}function ig(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const a=[],s=n._tokenizer||r.parser[n.contentType](n.start),o=s.events,u=[],c={};let d,f,h=-1,m=n,y=0,g=0;const w=[g];for(;m;){for(;e[++i][1]!==m;);a.push(i),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),f&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=m,m=m.next}for(m=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(g=h+1,w.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),h=w.length;h--;){const I=o.slice(w[h],w[h+1]),v=a.pop();u.unshift([v,v+I.length-1]),ht(e,v,2,I)}for(h=-1;++h<u.length;)c[y+u[h][0]]=y+u[h][1],y+=u[h][1]-u[h][0]-1;return c}const ag={tokenize:ug,resolve:og},sg={tokenize:cg,partial:!0};function og(e){return fl(e),e}function ug(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):ce(o)?e.check(sg,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function cg(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ie(e,a,"linePrefix")}function a(s){if(s===null||ce(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function hl(e,t,n,r,i,a,s,o,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return f;function f(I){return I===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(I),e.exit(a),h):I===null||I===32||I===41||Mr(I)?n(I):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(I))}function h(I){return I===62?(e.enter(a),e.consume(I),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(I))}function m(I){return I===62?(e.exit("chunkString"),e.exit(o),h(I)):I===null||I===60||ce(I)?n(I):(e.consume(I),I===92?y:m)}function y(I){return I===60||I===62||I===92?(e.consume(I),m):m(I)}function g(I){return!d&&(I===null||I===41||Pe(I))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(I)):d<c&&I===40?(e.consume(I),d++,g):I===41?(e.consume(I),d--,g):I===null||I===32||I===40||Mr(I)?n(I):(e.consume(I),I===92?w:g)}function w(I){return I===40||I===41||I===92?(e.consume(I),g):g(I)}}function ml(e,t,n,r,i,a){const s=this;let o=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(a),d}function d(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(a),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):ce(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||ce(m)||o++>999?(e.exit("chunkString"),d(m)):(e.consume(m),u||(u=!xe(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,f):f(m)}}function pl(e,t,n,r,i,a){let s;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),c(h))}function c(h){return h===s?(e.exit(a),u(s)):h===null?n(h):ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ie(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||ce(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:d)}function f(h){return h===s||h===92?(e.consume(h),d):d(h)}}function Xn(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):xe(i)?Ie(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const lg={name:"definition",tokenize:fg},dg={tokenize:hg,partial:!0};function fg(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),s(m)}function s(m){return ml.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=At(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Pe(m)?Xn(e,c)(m):c(m)}function c(m){return hl(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(dg,f,f)(m)}function f(m){return xe(m)?Ie(e,h,"whitespace")(m):h(m)}function h(m){return m===null||ce(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function hg(e,t,n){return r;function r(o){return Pe(o)?Xn(e,i)(o):n(o)}function i(o){return pl(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return xe(o)?Ie(e,s,"whitespace")(o):s(o)}function s(o){return o===null||ce(o)?t(o):n(o)}}const mg={name:"hardBreakEscape",tokenize:pg};function pg(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return ce(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const gg={name:"headingAtx",tokenize:Eg,resolve:bg};function bg(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ht(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Eg(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||Pe(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||ce(d)?(e.exit("atxHeading"),t(d)):xe(d)?Ie(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Pe(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const Tg=["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"],Do=["pre","script","style","textarea"],yg={name:"htmlFlow",tokenize:Cg,resolveTo:Sg,concrete:!0},_g={tokenize:Ag,partial:!0},xg={tokenize:Ig,partial:!0};function Sg(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Cg(e,t,n){const r=this;let i,a,s,o,u;return c;function c(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),f}function f(x){return x===33?(e.consume(x),h):x===47?(e.consume(x),a=!0,g):x===63?(e.consume(x),i=3,r.interrupt?t:E):rt(x)?(e.consume(x),s=String.fromCharCode(x),w):n(x)}function h(x){return x===45?(e.consume(x),i=2,m):x===91?(e.consume(x),i=5,o=0,y):rt(x)?(e.consume(x),i=4,r.interrupt?t:E):n(x)}function m(x){return x===45?(e.consume(x),r.interrupt?t:E):n(x)}function y(x){const J="CDATA[";return x===J.charCodeAt(o++)?(e.consume(x),o===J.length?r.interrupt?t:V:y):n(x)}function g(x){return rt(x)?(e.consume(x),s=String.fromCharCode(x),w):n(x)}function w(x){if(x===null||x===47||x===62||Pe(x)){const J=x===47,ue=s.toLowerCase();return!J&&!a&&Do.includes(ue)?(i=1,r.interrupt?t(x):V(x)):Tg.includes(s.toLowerCase())?(i=6,J?(e.consume(x),I):r.interrupt?t(x):V(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?v(x):R(x))}return x===45||Ke(x)?(e.consume(x),s+=String.fromCharCode(x),w):n(x)}function I(x){return x===62?(e.consume(x),r.interrupt?t:V):n(x)}function v(x){return xe(x)?(e.consume(x),v):N(x)}function R(x){return x===47?(e.consume(x),N):x===58||x===95||rt(x)?(e.consume(x),M):xe(x)?(e.consume(x),R):N(x)}function M(x){return x===45||x===46||x===58||x===95||Ke(x)?(e.consume(x),M):A(x)}function A(x){return x===61?(e.consume(x),p):xe(x)?(e.consume(x),A):R(x)}function p(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,L):xe(x)?(e.consume(x),p):B(x)}function L(x){return x===u?(e.consume(x),u=null,G):x===null||ce(x)?n(x):(e.consume(x),L)}function B(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Pe(x)?A(x):(e.consume(x),B)}function G(x){return x===47||x===62||xe(x)?R(x):n(x)}function N(x){return x===62?(e.consume(x),H):n(x)}function H(x){return x===null||ce(x)?V(x):xe(x)?(e.consume(x),H):n(x)}function V(x){return x===45&&i===2?(e.consume(x),be):x===60&&i===1?(e.consume(x),he):x===62&&i===4?(e.consume(x),$):x===63&&i===3?(e.consume(x),E):x===93&&i===5?(e.consume(x),we):ce(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_g,ne,j)(x)):x===null||ce(x)?(e.exit("htmlFlowData"),j(x)):(e.consume(x),V)}function j(x){return e.check(xg,z,ne)(x)}function z(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Z}function Z(x){return x===null||ce(x)?j(x):(e.enter("htmlFlowData"),V(x))}function be(x){return x===45?(e.consume(x),E):V(x)}function he(x){return x===47?(e.consume(x),s="",le):V(x)}function le(x){if(x===62){const J=s.toLowerCase();return Do.includes(J)?(e.consume(x),$):V(x)}return rt(x)&&s.length<8?(e.consume(x),s+=String.fromCharCode(x),le):V(x)}function we(x){return x===93?(e.consume(x),E):V(x)}function E(x){return x===62?(e.consume(x),$):x===45&&i===2?(e.consume(x),E):V(x)}function $(x){return x===null||ce(x)?(e.exit("htmlFlowData"),ne(x)):(e.consume(x),$)}function ne(x){return e.exit("htmlFlow"),t(x)}}function Ig(e,t,n){const r=this;return i;function i(s){return ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Ag(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(hr,t,n)}}const wg={name:"htmlText",tokenize:vg};function vg(e,t,n){const r=this;let i,a,s;return o;function o(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),u}function u(E){return E===33?(e.consume(E),c):E===47?(e.consume(E),A):E===63?(e.consume(E),R):rt(E)?(e.consume(E),B):n(E)}function c(E){return E===45?(e.consume(E),d):E===91?(e.consume(E),a=0,y):rt(E)?(e.consume(E),v):n(E)}function d(E){return E===45?(e.consume(E),m):n(E)}function f(E){return E===null?n(E):E===45?(e.consume(E),h):ce(E)?(s=f,he(E)):(e.consume(E),f)}function h(E){return E===45?(e.consume(E),m):f(E)}function m(E){return E===62?be(E):E===45?h(E):f(E)}function y(E){const $="CDATA[";return E===$.charCodeAt(a++)?(e.consume(E),a===$.length?g:y):n(E)}function g(E){return E===null?n(E):E===93?(e.consume(E),w):ce(E)?(s=g,he(E)):(e.consume(E),g)}function w(E){return E===93?(e.consume(E),I):g(E)}function I(E){return E===62?be(E):E===93?(e.consume(E),I):g(E)}function v(E){return E===null||E===62?be(E):ce(E)?(s=v,he(E)):(e.consume(E),v)}function R(E){return E===null?n(E):E===63?(e.consume(E),M):ce(E)?(s=R,he(E)):(e.consume(E),R)}function M(E){return E===62?be(E):R(E)}function A(E){return rt(E)?(e.consume(E),p):n(E)}function p(E){return E===45||Ke(E)?(e.consume(E),p):L(E)}function L(E){return ce(E)?(s=L,he(E)):xe(E)?(e.consume(E),L):be(E)}function B(E){return E===45||Ke(E)?(e.consume(E),B):E===47||E===62||Pe(E)?G(E):n(E)}function G(E){return E===47?(e.consume(E),be):E===58||E===95||rt(E)?(e.consume(E),N):ce(E)?(s=G,he(E)):xe(E)?(e.consume(E),G):be(E)}function N(E){return E===45||E===46||E===58||E===95||Ke(E)?(e.consume(E),N):H(E)}function H(E){return E===61?(e.consume(E),V):ce(E)?(s=H,he(E)):xe(E)?(e.consume(E),H):G(E)}function V(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),i=E,j):ce(E)?(s=V,he(E)):xe(E)?(e.consume(E),V):(e.consume(E),z)}function j(E){return E===i?(e.consume(E),i=void 0,Z):E===null?n(E):ce(E)?(s=j,he(E)):(e.consume(E),j)}function z(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||Pe(E)?G(E):(e.consume(E),z)}function Z(E){return E===47||E===62||Pe(E)?G(E):n(E)}function be(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function he(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),le}function le(E){return xe(E)?Ie(e,we,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):we(E)}function we(E){return e.enter("htmlTextData"),s(E)}}const cs={name:"labelEnd",tokenize:Dg,resolveTo:Lg,resolveAll:Og},kg={tokenize:Pg},Ng={tokenize:Mg},Rg={tokenize:Bg};function Og(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Lg(e,t){let n=e.length,r=0,i,a,s,o;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[a][1].type==="labelLink"?"link":"image",start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[a][1].start),end:Object.assign({},e[s][1].end)},d={type:"labelText",start:Object.assign({},e[a+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return o=[["enter",u,t],["enter",c,t]],o=bt(o,e.slice(a+1,a+r+3)),o=bt(o,[["enter",d,t]]),o=bt(o,si(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),o=bt(o,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),o=bt(o,e.slice(s+1)),o=bt(o,[["exit",u,t]]),ht(e,a,e.length,o),e}function Dg(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return o;function o(h){return a?a._inactive?f(h):(s=r.parser.defined.includes(At(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(kg,d,s?d:f)(h):h===91?e.attempt(Ng,d,s?c:f)(h):s?d(h):f(h)}function c(h){return e.attempt(Rg,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function Pg(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Pe(f)?Xn(e,a)(f):a(f)}function a(f){return f===41?d(f):hl(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Pe(f)?Xn(e,u)(f):d(f)}function o(f){return n(f)}function u(f){return f===34||f===39||f===40?pl(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function c(f){return Pe(f)?Xn(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Mg(e,t,n){const r=this;return i;function i(o){return ml.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(At(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function Bg(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Fg={name:"labelStartImage",tokenize:Ug,resolveAll:cs.resolveAll};function Ug(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Hg={name:"labelStartLink",tokenize:jg,resolveAll:cs.resolveAll};function jg(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Pi={name:"lineEnding",tokenize:Vg};function Vg(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ie(e,t,"linePrefix")}}const Lr={name:"thematicBreak",tokenize:zg};function zg(e,t,n){let r=0,i;return a;function a(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||ce(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),xe(c)?Ie(e,o,"whitespace")(c):o(c))}}const ot={name:"list",tokenize:Gg,continuation:{tokenize:Yg},exit:Xg},$g={tokenize:Qg,partial:!0},Wg={tokenize:qg,partial:!0};function Gg(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(m){const y=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:_a(m)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Lr,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return _a(m)&&++s<10?(e.consume(m),u):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(hr,r.interrupt?n:d,e.attempt($g,h,f))}function d(m){return r.containerState.initialBlankLine=!0,a++,h(m)}function f(m){return xe(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Yg(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(hr,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ie(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!xe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Wg,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ie(e,e.attempt(ot,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function qg(e,t,n){const r=this;return Ie(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function Xg(e){e.exit(this.containerState.type)}function Qg(e,t,n){const r=this;return Ie(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!xe(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Po={name:"setextUnderline",tokenize:Jg,resolveTo:Kg};function Kg(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Jg(e,t,n){const r=this;let i;return a;function a(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),xe(c)?Ie(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||ce(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Zg={tokenize:eb};function eb(e){const t=this,n=e.attempt(hr,r,e.attempt(this.parser.constructs.flowInitial,i,Ie(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ag,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tb={resolveAll:bl()},nb=gl("string"),rb=gl("text");function gl(e){return{tokenize:t,resolveAll:bl(e==="text"?ib:void 0)};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,o);return s;function s(d){return c(d)?a(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),a(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h<f.length;){const m=f[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function bl(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function ib(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,o=0,u;for(;a--;){const c=i[a];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(c===-2)u=!0,o++;else if(c!==-1){a++;break}}if(o){const c={type:n===e.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-o,offset:r.end.offset-o,_index:r.start._index+a,_bufferIndex:a?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function ab(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},a=[];let s=[],o=[];const u={consume:v,enter:R,exit:M,attempt:L(A),check:L(p),interrupt:L(p,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:h,now:y,defineSkip:g,write:f};let d=t.tokenize.call(c,u);return t.resolveAll&&a.push(t),c;function f(H){return s=bt(s,H),w(),s[s.length-1]!==null?[]:(B(t,0),c.events=si(a,c.events,c),c.events)}function h(H,V){return ob(m(H),V)}function m(H){return sb(s,H)}function y(){const{line:H,column:V,offset:j,_index:z,_bufferIndex:Z}=r;return{line:H,column:V,offset:j,_index:z,_bufferIndex:Z}}function g(H){i[H.line]=H.column,N()}function w(){let H;for(;r._index<s.length;){const V=s[r._index];if(typeof V=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<V.length;)I(V.charCodeAt(r._bufferIndex));else I(V)}}function I(H){d=d(H)}function v(H){ce(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,N()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=H}function R(H,V){const j=V||{};return j.type=H,j.start=y(),c.events.push(["enter",j,c]),o.push(j),j}function M(H){const V=o.pop();return V.end=y(),c.events.push(["exit",V,c]),V}function A(H,V){B(H,V.from)}function p(H,V){V.restore()}function L(H,V){return j;function j(z,Z,be){let he,le,we,E;return Array.isArray(z)?ne(z):"tokenize"in z?ne([z]):$(z);function $(X){return ae;function ae(re){const oe=re!==null&&X[re],ie=re!==null&&X.null,Oe=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return ne(Oe)(re)}}function ne(X){return he=X,le=0,X.length===0?be:x(X[le])}function x(X){return ae;function ae(re){return E=G(),we=X,X.partial||(c.currentConstruct=X),X.name&&c.parser.constructs.disable.null.includes(X.name)?ue():X.tokenize.call(V?Object.assign(Object.create(c),V):c,u,J,ue)(re)}}function J(X){return H(we,E),Z}function ue(X){return E.restore(),++le<he.length?x(he[le]):be}}}function B(H,V){H.resolveAll&&!a.includes(H)&&a.push(H),H.resolve&&ht(c.events,V,c.events.length-V,H.resolve(c.events.slice(V),c)),H.resolveTo&&(c.events=H.resolveTo(c.events,c))}function G(){const H=y(),V=c.previous,j=c.currentConstruct,z=c.events.length,Z=Array.from(o);return{restore:be,from:z};function be(){r=H,c.previous=V,c.currentConstruct=j,c.events.length=z,o=Z,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function sb(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function ob(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
|
|
47
|
+
`,onClick:()=>n(!t),onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),s.stopPropagation(),s.repeat||n(o=>!o))},children:[!t&&g.jsx(us,{facet:r.agent.display[Z.AgentDisplayFacetRoleType.LAUNCHER]}),t&&g.jsx(Qc,{className:"w-6 h-6",fill:"white"})]})};function So(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function Jc(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ym=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qm=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xm={};function Co(e,t){return(Xm.jsx?qm:Ym).test(e)}const Qm=/[ \t\n\f\r]/g;function Km(e){return typeof e=="object"?e.type==="text"?Io(e.value):!1:Io(e)}function Io(e){return e.replace(Qm,"")===""}class fr{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}fr.prototype.property={};fr.prototype.normal={};fr.prototype.space=null;function Zc(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new fr(n,r,t)}function rr(e){return e.toLowerCase()}class _t{constructor(t,n){this.property=t,this.attribute=n}}_t.prototype.space=null;_t.prototype.boolean=!1;_t.prototype.booleanish=!1;_t.prototype.overloadedBoolean=!1;_t.prototype.number=!1;_t.prototype.commaSeparated=!1;_t.prototype.spaceSeparated=!1;_t.prototype.commaOrSpaceSeparated=!1;_t.prototype.mustUseProperty=!1;_t.prototype.defined=!1;let Jm=0;const be=mn(),Ye=mn(),el=mn(),$=mn(),Ue=mn(),Cn=mn(),ht=mn();function mn(){return 2**++Jm}const Ia=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:Ye,commaOrSpaceSeparated:ht,commaSeparated:Cn,number:$,overloadedBoolean:el,spaceSeparated:Ue},Symbol.toStringTag,{value:"Module"})),Bi=Object.keys(Ia);class ls extends _t{constructor(t,n,r,i){let a=-1;if(super(t,n),Ao(this,"space",i),typeof r=="number")for(;++a<Bi.length;){const s=Bi[a];Ao(this,Bi[a],(r&Ia[s])===Ia[s])}}}ls.prototype.defined=!0;function Ao(e,t,n){n&&(e[t]=n)}const Zm={}.hasOwnProperty;function On(e){const t={},n={};let r;for(r in e.properties)if(Zm.call(e.properties,r)){const i=e.properties[r],a=new ls(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[rr(r)]=r,n[rr(a.attribute)]=r}return new fr(t,n,e.space)}const tl=On({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),nl=On({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function rl(e,t){return t in e?e[t]:t}function il(e,t){return rl(e,t.toLowerCase())}const al=On({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:il,properties:{xmlns:null,xmlnsXLink:null}}),sl=On({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Ye,ariaAutoComplete:null,ariaBusy:Ye,ariaChecked:Ye,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:Ue,ariaCurrent:null,ariaDescribedBy:Ue,ariaDetails:null,ariaDisabled:Ye,ariaDropEffect:Ue,ariaErrorMessage:null,ariaExpanded:Ye,ariaFlowTo:Ue,ariaGrabbed:Ye,ariaHasPopup:null,ariaHidden:Ye,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ue,ariaLevel:$,ariaLive:null,ariaModal:Ye,ariaMultiLine:Ye,ariaMultiSelectable:Ye,ariaOrientation:null,ariaOwns:Ue,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:Ye,ariaReadOnly:Ye,ariaRelevant:null,ariaRequired:Ye,ariaRoleDescription:Ue,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:Ye,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null}}),ep=On({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:il,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cn,acceptCharset:Ue,accessKey:Ue,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Ue,autoFocus:be,autoPlay:be,blocking:Ue,capture:null,charSet:null,checked:be,cite:null,className:Ue,cols:$,colSpan:null,content:null,contentEditable:Ye,controls:be,controlsList:Ue,coords:$|Cn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:el,draggable:Ye,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Ue,height:$,hidden:be,high:$,href:null,hrefLang:null,htmlFor:Ue,httpEquiv:Ue,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Ue,itemRef:Ue,itemScope:be,itemType:Ue,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,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:be,optimum:$,pattern:null,ping:Ue,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Ue,required:be,reversed:be,rows:$,rowSpan:$,sandbox:Ue,scope:null,scoped:be,seamless:be,selected:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:Ye,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:Ye,width:$,wrap:null,align:null,aLink:null,archive:Ue,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:Ye,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:$,security:null,unselectable:null}}),tp=On({space:"svg",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"},transform:rl,properties:{about:ht,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:Ue,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:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,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:Cn,g2:Cn,glyphName:Cn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:ht,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,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:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ue,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ht,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ht,rev:ht,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ht,requiredFeatures:ht,requiredFonts:ht,requiredFormats:ht,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:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:ht,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ht,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ht,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),np=/^data[-\w.:]+$/i,wo=/-[a-z]/g,rp=/[A-Z]/g;function si(e,t){const n=rr(t);let r=t,i=_t;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&np.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(wo,ap);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!wo.test(a)){let s=a.replace(rp,ip);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=ls}return new i(r,t)}function ip(e){return"-"+e.toLowerCase()}function ap(e){return e.charAt(1).toUpperCase()}const sp={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"},hr=Zc([nl,tl,al,sl,ep],"html"),Jt=Zc([nl,tl,al,sl,tp],"svg");function vo(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ol(e){return e.join(" ").trim()}var bn={},Fi,ko;function op(){if(ko)return Fi;ko=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
|
|
48
|
+
`,c="/",d="*",f="",h="comment",m="declaration";Fi=function(b,A){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];A=A||{};var I=1,w=1;function N(H){var G=H.match(t);G&&(I+=G.length);var ee=H.lastIndexOf(u);w=~ee?H.length-ee:w+H.length}function M(){var H={line:I,column:w};return function(G){return G.position=new v(H),B(),G}}function v(H){this.start=H,this.end={line:I,column:w},this.source=A.source}v.prototype.content=b;function p(H){var G=new Error(A.source+":"+I+":"+w+": "+H);if(G.reason=H,G.filename=A.source,G.line=I,G.column=w,G.source=b,!A.silent)throw G}function O(H){var G=H.exec(b);if(G){var ee=G[0];return N(ee),b=b.slice(ee.length),G}}function B(){O(n)}function X(H){var G;for(H=H||[];G=k();)G!==!1&&H.push(G);return H}function k(){var H=M();if(!(c!=b.charAt(0)||d!=b.charAt(1))){for(var G=2;f!=b.charAt(G)&&(d!=b.charAt(G)||c!=b.charAt(G+1));)++G;if(G+=2,f===b.charAt(G-1))return p("End of comment missing");var ee=b.slice(2,G-2);return w+=2,N(ee),b=b.slice(G),w+=2,H({type:h,comment:ee})}}function U(){var H=M(),G=O(r);if(G){if(k(),!O(i))return p("property missing ':'");var ee=O(a),pe=H({type:m,property:y(G[0].replace(e,f)),value:ee?y(ee[0].replace(e,f)):f});return O(s),pe}}function W(){var H=[];X(H);for(var G;G=U();)G!==!1&&(H.push(G),X(H));return H}return B(),W()};function y(b){return b?b.replace(o,f):f}return Fi}var No;function up(){if(No)return bn;No=1;var e=bn&&bn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bn,"__esModule",{value:!0});var t=e(op());function n(r,i){var a=null;if(!r||typeof r!="string")return a;var s=(0,t.default)(r),o=typeof i=="function";return s.forEach(function(u){if(u.type==="declaration"){var c=u.property,d=u.value;o?i(c,d,u):d&&(a=a||{},a[c]=d)}}),a}return bn.default=n,bn}var cp=up();const Ro=Ga(cp),lp=Ro.default||Ro,oi=ul("end"),Mt=ul("start");function ul(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function dp(e){const t=Mt(e),n=oi(e);if(t&&n)return{start:t,end:n}}function Xn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Oo(e.position):"start"in e||"end"in e?Oo(e):"line"in e||"column"in e?Aa(e):""}function Aa(e){return Lo(e&&e.line)+":"+Lo(e&&e.column)}function Oo(e){return Aa(e&&e.start)+"-"+Aa(e&&e.end)}function Lo(e){return e&&typeof e=="number"?e:1}class nt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=o?o.line:void 0,this.name=Xn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}nt.prototype.file="";nt.prototype.name="";nt.prototype.reason="";nt.prototype.message="";nt.prototype.stack="";nt.prototype.column=void 0;nt.prototype.line=void 0;nt.prototype.ancestors=void 0;nt.prototype.cause=void 0;nt.prototype.fatal=void 0;nt.prototype.place=void 0;nt.prototype.ruleId=void 0;nt.prototype.source=void 0;const ds={}.hasOwnProperty,fp=new Map,hp=/[A-Z]/g,mp=/-([a-z])/g,pp=new Set(["table","tbody","thead","tfoot","tr"]),gp=new Set(["td","th"]),cl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bp(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Ip(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Cp(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Jt:hr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ll(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ll(e,t,n){if(t.type==="element")return Ep(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Tp(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return _p(e,t,n);if(t.type==="mdxjsEsm")return yp(e,t);if(t.type==="root")return xp(e,t,n);if(t.type==="text")return Sp(e,t)}function Ep(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Jt,e.schema=i),e.ancestors.push(t);const a=fl(e,t.tagName,!1),s=Ap(e,t);let o=hs(e,t);return pp.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!Km(u):!0})),dl(e,s,a,t),fs(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function Tp(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ir(e,t.position)}function yp(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ir(e,t.position)}function _p(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Jt,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:fl(e,t.name,!0),s=wp(e,t),o=hs(e,t);return dl(e,s,a,t),fs(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function xp(e,t,n){const r={};return fs(r,hs(e,t)),e.create(t,e.Fragment,r,n)}function Sp(e,t){return t.value}function dl(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Cp(e,t,n){return r;function r(i,a,s,o){const c=Array.isArray(s.children)?n:t;return o?c(a,s,o):c(a,s)}}function Ip(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),u=Mt(r);return t(i,a,s,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Ap(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ds.call(t.properties,i)){const a=vp(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&gp.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function wp(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ir(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else ir(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function hs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:fp;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const c=i.get(u)||0;s=u+"-"+c,i.set(u,c+1)}}const o=ll(e,a,s);o!==void 0&&n.push(o)}return n}function vp(e,t,n){const r=si(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Jc(n):ol(n)),r.property==="style"){let i=typeof n=="object"?n:kp(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Np(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?sp[r.property]||r.property:r.attribute,n]}}function kp(e,t){const n={};try{lp(t,r)}catch(i){if(!e.ignoreInvalidStyle){const a=i,s=new nt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=cl+"#cannot-parse-style-attribute",s}}return n;function r(i,a){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(mp,Op)),n[s]=a}}function fl(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=Co(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=Co(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ds.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ir(e)}function ir(e,t){const n=new nt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=cl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Np(e){const t={};let n;for(n in e)ds.call(e,n)&&(t[Rp(n)]=e[n]);return t}function Rp(e){let t=e.replace(hp,Lp);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Op(e,t){return t.toUpperCase()}function Lp(e){return"-"+e.toLowerCase()}const Ui={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Dp={};function ms(e,t){const n=Dp,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hl(e,r,i)}function hl(e,t,n){if(Pp(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Do(e.children,t,n)}return Array.isArray(e)?Do(e,t,n):""}function Do(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=hl(e[i],t,n);return r.join("")}function Pp(e){return!!(e&&typeof e=="object")}const Po=document.createElement("i");function ps(e){const t="&"+e+";";Po.innerHTML=t;const n=Po.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mt(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function gt(e,t){return e.length>0?(mt(e,e.length,0,t),e):t}const Mo={}.hasOwnProperty;function ml(e){const t={};let n=-1;for(;++n<e.length;)Mp(t,e[n]);return t}function Mp(e,t){let n;for(n in t){const i=(Mo.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){Mo.call(i,s)||(i[s]=[]);const o=a[s];Bp(i[s],Array.isArray(o)?o:o?[o]:[])}}}function Bp(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mt(e,0,0,r)}function pl(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ct(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const st=Zt(/[A-Za-z]/),tt=Zt(/[\dA-Za-z]/),Fp=Zt(/[#-'*+\--9=?A-Z^-~]/);function Ur(e){return e!==null&&(e<32||e===127)}const wa=Zt(/\d/),Up=Zt(/[\dA-Fa-f]/),Hp=Zt(/[!-/:-@[-`{-~]/);function de(e){return e!==null&&e<-2}function Me(e){return e!==null&&(e<0||e===32)}function _e(e){return e===-2||e===-1||e===32}const ui=Zt(new RegExp("\\p{P}|\\p{S}","u")),dn=Zt(/\s/);function Zt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ln(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&tt(e.charCodeAt(n+1))&&tt(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),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 Ie(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(u){return _e(u)?(e.enter(n),o(u)):t(u)}function o(u){return _e(u)&&a++<i?(e.consume(u),o):(e.exit(n),t(u))}}const jp={tokenize:Vp};function Vp(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ie(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return de(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const zp={tokenize:$p},Bo={tokenize:Wp};function $p(e){const t=this,n=[];let r=0,i,a,s;return o;function o(N){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,u,c)(N)}return c(N)}function u(N){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&w();const M=t.events.length;let v=M,p;for(;v--;)if(t.events[v][0]==="exit"&&t.events[v][1].type==="chunkFlow"){p=t.events[v][1].end;break}I(r);let O=M;for(;O<t.events.length;)t.events[O][1].end=Object.assign({},p),O++;return mt(t.events,v+1,0,t.events.slice(M)),t.events.length=O,c(N)}return o(N)}function c(N){if(r===n.length){if(!i)return h(N);if(i.currentConstruct&&i.currentConstruct.concrete)return y(N);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Bo,d,f)(N)}function d(N){return i&&w(),I(r),h(N)}function f(N){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(N)}function h(N){return t.containerState={},e.attempt(Bo,m,y)(N)}function m(N){return r++,n.push([t.currentConstruct,t.containerState]),h(N)}function y(N){if(N===null){i&&w(),I(0),e.consume(N);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:a,_tokenizer:i}),b(N)}function b(N){if(N===null){A(e.exit("chunkFlow"),!0),I(0),e.consume(N);return}return de(N)?(e.consume(N),A(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(N),b)}function A(N,M){const v=t.sliceStream(N);if(M&&v.push(null),N.previous=a,a&&(a.next=N),a=N,i.defineSkip(N.start),i.write(v),t.parser.lazy[N.start.line]){let p=i.events.length;for(;p--;)if(i.events[p][1].start.offset<s&&(!i.events[p][1].end||i.events[p][1].end.offset>s))return;const O=t.events.length;let B=O,X,k;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(X){k=t.events[B][1].end;break}X=!0}for(I(r),p=O;p<t.events.length;)t.events[p][1].end=Object.assign({},k),p++;mt(t.events,B+1,0,t.events.slice(O)),t.events.length=p}}function I(N){let M=n.length;for(;M-- >N;){const v=n[M];t.containerState=v[1],v[0].exit.call(t,e)}n.length=N}function w(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Wp(e,t,n){return Ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Hr(e){if(e===null||Me(e)||dn(e))return 1;if(ui(e))return 2}function ci(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const va={name:"attention",tokenize:Yp,resolveAll:Gp};function Gp(e,t){let n=-1,r,i,a,s,o,u,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);Fo(f,-u),Fo(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},o={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},a={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},o.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},o.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=gt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=gt(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),c=gt(c,ci(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=gt(c,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=gt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,mt(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Yp(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Hr(r);let a;return s;function s(u){return a=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===a)return e.consume(u),o;const c=e.exit("attentionSequence"),d=Hr(u),f=!d||d===2&&i||n.includes(u),h=!i||i===2&&d||n.includes(r);return c._open=!!(a===42?f:f&&(i||!h)),c._close=!!(a===42?h:h&&(d||!f)),t(u)}}function Fo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const qp={name:"autolink",tokenize:Xp};function Xp(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return st(m)?(e.consume(m),s):c(m)}function s(m){return m===43||m===45||m===46||tt(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||tt(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Ur(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),d):Fp(m)?(e.consume(m),c):n(m)}function d(m){return tt(m)?f(m):n(m)}function f(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||tt(m))&&r++<63){const y=m===45?h:f;return e.consume(m),y}return n(m)}}const mr={tokenize:Qp,partial:!0};function Qp(e,t,n){return r;function r(a){return _e(a)?Ie(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||de(a)?t(a):n(a)}}const gl={name:"blockQuote",tokenize:Kp,continuation:{tokenize:Jp},exit:Zp};function Kp(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return _e(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Jp(e,t,n){const r=this;return i;function i(s){return _e(s)?Ie(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(gl,t,n)(s)}}function Zp(e){e.exit("blockQuote")}const bl={name:"characterEscape",tokenize:eg};function eg(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Hp(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const El={name:"characterReference",tokenize:tg};function tg(e,t,n){const r=this;let i=0,a,s;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,s=tt,d(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=Up,d):(e.enter("characterReferenceValue"),a=7,s=wa,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===tt&&!ps(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<a?(e.consume(f),d):n(f)}}const Uo={tokenize:rg,partial:!0},Ho={name:"codeFenced",tokenize:ng,concrete:!0};function ng(e,t,n){const r=this,i={tokenize:v,partial:!0};let a=0,s=0,o;return u;function u(p){return c(p)}function c(p){const O=r.events[r.events.length-1];return a=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,o=p,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(p)}function d(p){return p===o?(s++,e.consume(p),d):s<3?n(p):(e.exit("codeFencedFenceSequence"),_e(p)?Ie(e,f,"whitespace")(p):f(p))}function f(p){return p===null||de(p)?(e.exit("codeFencedFence"),r.interrupt?t(p):e.check(Uo,b,M)(p)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||de(p)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(p)):_e(p)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ie(e,m,"whitespace")(p)):p===96&&p===o?n(p):(e.consume(p),h)}function m(p){return p===null||de(p)?f(p):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(p))}function y(p){return p===null||de(p)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(p)):p===96&&p===o?n(p):(e.consume(p),y)}function b(p){return e.attempt(i,M,A)(p)}function A(p){return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),I}function I(p){return a>0&&_e(p)?Ie(e,w,"linePrefix",a+1)(p):w(p)}function w(p){return p===null||de(p)?e.check(Uo,b,M)(p):(e.enter("codeFlowValue"),N(p))}function N(p){return p===null||de(p)?(e.exit("codeFlowValue"),w(p)):(e.consume(p),N)}function M(p){return e.exit("codeFenced"),t(p)}function v(p,O,B){let X=0;return k;function k(ee){return p.enter("lineEnding"),p.consume(ee),p.exit("lineEnding"),U}function U(ee){return p.enter("codeFencedFence"),_e(ee)?Ie(p,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):W(ee)}function W(ee){return ee===o?(p.enter("codeFencedFenceSequence"),H(ee)):B(ee)}function H(ee){return ee===o?(X++,p.consume(ee),H):X>=s?(p.exit("codeFencedFenceSequence"),_e(ee)?Ie(p,G,"whitespace")(ee):G(ee)):B(ee)}function G(ee){return ee===null||de(ee)?(p.exit("codeFencedFence"),O(ee)):B(ee)}}}function rg(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Hi={name:"codeIndented",tokenize:ag},ig={tokenize:sg,partial:!0};function ag(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ie(e,a,"linePrefix",5)(c)}function a(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):de(c)?e.attempt(ig,s,u)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||de(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),o)}function u(c){return e.exit("codeIndented"),t(c)}}function sg(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):de(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Ie(e,a,"linePrefix",5)(s)}function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):de(s)?i(s):n(s)}}const og={name:"codeText",tokenize:lg,resolve:ug,previous:cg};function ug(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function cg(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function lg(e,t,n){let r=0,i,a;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(a=e.enter("codeTextSequence"),i=0,d(f)):de(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||de(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",c(f))}}function Tl(e){const t={};let n=-1,r,i,a,s,o,u,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,dg(e,n)),n=t[n],c=!0);else if(r[1]._container){for(a=n,i=void 0;a--&&(s=e[a],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);i&&(r[1].end=Object.assign({},e[i][1].start),o=e.slice(i,n),o.unshift(r),mt(e,i,n-i+1,o))}}return!c}function dg(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const a=[],s=n._tokenizer||r.parser[n.contentType](n.start),o=s.events,u=[],c={};let d,f,h=-1,m=n,y=0,b=0;const A=[b];for(;m;){for(;e[++i][1]!==m;);a.push(i),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),f&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=m,m=m.next}for(m=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(b=h+1,A.push(b),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):A.pop(),h=A.length;h--;){const I=o.slice(A[h],A[h+1]),w=a.pop();u.unshift([w,w+I.length-1]),mt(e,w,2,I)}for(h=-1;++h<u.length;)c[y+u[h][0]]=y+u[h][1],y+=u[h][1]-u[h][0]-1;return c}const fg={tokenize:pg,resolve:mg},hg={tokenize:gg,partial:!0};function mg(e){return Tl(e),e}function pg(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):de(o)?e.check(hg,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function gg(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ie(e,a,"linePrefix")}function a(s){if(s===null||de(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function yl(e,t,n,r,i,a,s,o,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return f;function f(I){return I===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(I),e.exit(a),h):I===null||I===32||I===41||Ur(I)?n(I):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(I))}function h(I){return I===62?(e.enter(a),e.consume(I),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(I))}function m(I){return I===62?(e.exit("chunkString"),e.exit(o),h(I)):I===null||I===60||de(I)?n(I):(e.consume(I),I===92?y:m)}function y(I){return I===60||I===62||I===92?(e.consume(I),m):m(I)}function b(I){return!d&&(I===null||I===41||Me(I))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(I)):d<c&&I===40?(e.consume(I),d++,b):I===41?(e.consume(I),d--,b):I===null||I===32||I===40||Ur(I)?n(I):(e.consume(I),I===92?A:b)}function A(I){return I===40||I===41||I===92?(e.consume(I),b):b(I)}}function _l(e,t,n,r,i,a){const s=this;let o=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(a),d}function d(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(a),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):de(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||de(m)||o++>999?(e.exit("chunkString"),d(m)):(e.consume(m),u||(u=!_e(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,f):f(m)}}function xl(e,t,n,r,i,a){let s;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),c(h))}function c(h){return h===s?(e.exit(a),u(s)):h===null?n(h):de(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ie(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||de(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:d)}function f(h){return h===s||h===92?(e.consume(h),d):d(h)}}function Qn(e,t){let n;return r;function r(i){return de(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_e(i)?Ie(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bg={name:"definition",tokenize:Tg},Eg={tokenize:yg,partial:!0};function Tg(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),s(m)}function s(m){return _l.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=Ct(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Me(m)?Qn(e,c)(m):c(m)}function c(m){return yl(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Eg,f,f)(m)}function f(m){return _e(m)?Ie(e,h,"whitespace")(m):h(m)}function h(m){return m===null||de(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function yg(e,t,n){return r;function r(o){return Me(o)?Qn(e,i)(o):n(o)}function i(o){return xl(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return _e(o)?Ie(e,s,"whitespace")(o):s(o)}function s(o){return o===null||de(o)?t(o):n(o)}}const _g={name:"hardBreakEscape",tokenize:xg};function xg(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return de(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Sg={name:"headingAtx",tokenize:Ig,resolve:Cg};function Cg(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mt(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Ig(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||Me(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||de(d)?(e.exit("atxHeading"),t(d)):_e(d)?Ie(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Me(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const Ag=["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"],jo=["pre","script","style","textarea"],wg={name:"htmlFlow",tokenize:Rg,resolveTo:Ng,concrete:!0},vg={tokenize:Lg,partial:!0},kg={tokenize:Og,partial:!0};function Ng(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Rg(e,t,n){const r=this;let i,a,s,o,u;return c;function c(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),f}function f(x){return x===33?(e.consume(x),h):x===47?(e.consume(x),a=!0,b):x===63?(e.consume(x),i=3,r.interrupt?t:E):st(x)?(e.consume(x),s=String.fromCharCode(x),A):n(x)}function h(x){return x===45?(e.consume(x),i=2,m):x===91?(e.consume(x),i=5,o=0,y):st(x)?(e.consume(x),i=4,r.interrupt?t:E):n(x)}function m(x){return x===45?(e.consume(x),r.interrupt?t:E):n(x)}function y(x){const ne="CDATA[";return x===ne.charCodeAt(o++)?(e.consume(x),o===ne.length?r.interrupt?t:W:y):n(x)}function b(x){return st(x)?(e.consume(x),s=String.fromCharCode(x),A):n(x)}function A(x){if(x===null||x===47||x===62||Me(x)){const ne=x===47,re=s.toLowerCase();return!ne&&!a&&jo.includes(re)?(i=1,r.interrupt?t(x):W(x)):Ag.includes(s.toLowerCase())?(i=6,ne?(e.consume(x),I):r.interrupt?t(x):W(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?w(x):N(x))}return x===45||tt(x)?(e.consume(x),s+=String.fromCharCode(x),A):n(x)}function I(x){return x===62?(e.consume(x),r.interrupt?t:W):n(x)}function w(x){return _e(x)?(e.consume(x),w):k(x)}function N(x){return x===47?(e.consume(x),k):x===58||x===95||st(x)?(e.consume(x),M):_e(x)?(e.consume(x),N):k(x)}function M(x){return x===45||x===46||x===58||x===95||tt(x)?(e.consume(x),M):v(x)}function v(x){return x===61?(e.consume(x),p):_e(x)?(e.consume(x),v):N(x)}function p(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,O):_e(x)?(e.consume(x),p):B(x)}function O(x){return x===u?(e.consume(x),u=null,X):x===null||de(x)?n(x):(e.consume(x),O)}function B(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Me(x)?v(x):(e.consume(x),B)}function X(x){return x===47||x===62||_e(x)?N(x):n(x)}function k(x){return x===62?(e.consume(x),U):n(x)}function U(x){return x===null||de(x)?W(x):_e(x)?(e.consume(x),U):n(x)}function W(x){return x===45&&i===2?(e.consume(x),pe):x===60&&i===1?(e.consume(x),ge):x===62&&i===4?(e.consume(x),z):x===63&&i===3?(e.consume(x),E):x===93&&i===5?(e.consume(x),ve):de(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vg,K,H)(x)):x===null||de(x)?(e.exit("htmlFlowData"),H(x)):(e.consume(x),W)}function H(x){return e.check(kg,G,K)(x)}function G(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),ee}function ee(x){return x===null||de(x)?H(x):(e.enter("htmlFlowData"),W(x))}function pe(x){return x===45?(e.consume(x),E):W(x)}function ge(x){return x===47?(e.consume(x),s="",we):W(x)}function we(x){if(x===62){const ne=s.toLowerCase();return jo.includes(ne)?(e.consume(x),z):W(x)}return st(x)&&s.length<8?(e.consume(x),s+=String.fromCharCode(x),we):W(x)}function ve(x){return x===93?(e.consume(x),E):W(x)}function E(x){return x===62?(e.consume(x),z):x===45&&i===2?(e.consume(x),E):W(x)}function z(x){return x===null||de(x)?(e.exit("htmlFlowData"),K(x)):(e.consume(x),z)}function K(x){return e.exit("htmlFlow"),t(x)}}function Og(e,t,n){const r=this;return i;function i(s){return de(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Lg(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(mr,t,n)}}const Dg={name:"htmlText",tokenize:Pg};function Pg(e,t,n){const r=this;let i,a,s;return o;function o(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),u}function u(E){return E===33?(e.consume(E),c):E===47?(e.consume(E),v):E===63?(e.consume(E),N):st(E)?(e.consume(E),B):n(E)}function c(E){return E===45?(e.consume(E),d):E===91?(e.consume(E),a=0,y):st(E)?(e.consume(E),w):n(E)}function d(E){return E===45?(e.consume(E),m):n(E)}function f(E){return E===null?n(E):E===45?(e.consume(E),h):de(E)?(s=f,ge(E)):(e.consume(E),f)}function h(E){return E===45?(e.consume(E),m):f(E)}function m(E){return E===62?pe(E):E===45?h(E):f(E)}function y(E){const z="CDATA[";return E===z.charCodeAt(a++)?(e.consume(E),a===z.length?b:y):n(E)}function b(E){return E===null?n(E):E===93?(e.consume(E),A):de(E)?(s=b,ge(E)):(e.consume(E),b)}function A(E){return E===93?(e.consume(E),I):b(E)}function I(E){return E===62?pe(E):E===93?(e.consume(E),I):b(E)}function w(E){return E===null||E===62?pe(E):de(E)?(s=w,ge(E)):(e.consume(E),w)}function N(E){return E===null?n(E):E===63?(e.consume(E),M):de(E)?(s=N,ge(E)):(e.consume(E),N)}function M(E){return E===62?pe(E):N(E)}function v(E){return st(E)?(e.consume(E),p):n(E)}function p(E){return E===45||tt(E)?(e.consume(E),p):O(E)}function O(E){return de(E)?(s=O,ge(E)):_e(E)?(e.consume(E),O):pe(E)}function B(E){return E===45||tt(E)?(e.consume(E),B):E===47||E===62||Me(E)?X(E):n(E)}function X(E){return E===47?(e.consume(E),pe):E===58||E===95||st(E)?(e.consume(E),k):de(E)?(s=X,ge(E)):_e(E)?(e.consume(E),X):pe(E)}function k(E){return E===45||E===46||E===58||E===95||tt(E)?(e.consume(E),k):U(E)}function U(E){return E===61?(e.consume(E),W):de(E)?(s=U,ge(E)):_e(E)?(e.consume(E),U):X(E)}function W(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),i=E,H):de(E)?(s=W,ge(E)):_e(E)?(e.consume(E),W):(e.consume(E),G)}function H(E){return E===i?(e.consume(E),i=void 0,ee):E===null?n(E):de(E)?(s=H,ge(E)):(e.consume(E),H)}function G(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||Me(E)?X(E):(e.consume(E),G)}function ee(E){return E===47||E===62||Me(E)?X(E):n(E)}function pe(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function ge(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),we}function we(E){return _e(E)?Ie(e,ve,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):ve(E)}function ve(E){return e.enter("htmlTextData"),s(E)}}const gs={name:"labelEnd",tokenize:jg,resolveTo:Hg,resolveAll:Ug},Mg={tokenize:Vg},Bg={tokenize:zg},Fg={tokenize:$g};function Ug(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Hg(e,t){let n=e.length,r=0,i,a,s,o;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[a][1].type==="labelLink"?"link":"image",start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[a][1].start),end:Object.assign({},e[s][1].end)},d={type:"labelText",start:Object.assign({},e[a+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return o=[["enter",u,t],["enter",c,t]],o=gt(o,e.slice(a+1,a+r+3)),o=gt(o,[["enter",d,t]]),o=gt(o,ci(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),o=gt(o,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),o=gt(o,e.slice(s+1)),o=gt(o,[["exit",u,t]]),mt(e,a,e.length,o),e}function jg(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return o;function o(h){return a?a._inactive?f(h):(s=r.parser.defined.includes(Ct(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(Mg,d,s?d:f)(h):h===91?e.attempt(Bg,d,s?c:f)(h):s?d(h):f(h)}function c(h){return e.attempt(Fg,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function Vg(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Me(f)?Qn(e,a)(f):a(f)}function a(f){return f===41?d(f):yl(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Me(f)?Qn(e,u)(f):d(f)}function o(f){return n(f)}function u(f){return f===34||f===39||f===40?xl(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function c(f){return Me(f)?Qn(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function zg(e,t,n){const r=this;return i;function i(o){return _l.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(Ct(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function $g(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Wg={name:"labelStartImage",tokenize:Gg,resolveAll:gs.resolveAll};function Gg(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Yg={name:"labelStartLink",tokenize:qg,resolveAll:gs.resolveAll};function qg(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ji={name:"lineEnding",tokenize:Xg};function Xg(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ie(e,t,"linePrefix")}}const Mr={name:"thematicBreak",tokenize:Qg};function Qg(e,t,n){let r=0,i;return a;function a(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||de(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),_e(c)?Ie(e,o,"whitespace")(c):o(c))}}const dt={name:"list",tokenize:Zg,continuation:{tokenize:eb},exit:nb},Kg={tokenize:rb,partial:!0},Jg={tokenize:tb,partial:!0};function Zg(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(m){const y=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:wa(m)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Mr,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return wa(m)&&++s<10?(e.consume(m),u):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(mr,r.interrupt?n:d,e.attempt(Kg,h,f))}function d(m){return r.containerState.initialBlankLine=!0,a++,h(m)}function f(m){return _e(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function eb(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(mr,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ie(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!_e(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jg,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ie(e,e.attempt(dt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function tb(e,t,n){const r=this;return Ie(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function nb(e){e.exit(this.containerState.type)}function rb(e,t,n){const r=this;return Ie(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!_e(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Vo={name:"setextUnderline",tokenize:ab,resolveTo:ib};function ib(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function ab(e,t,n){const r=this;let i;return a;function a(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),_e(c)?Ie(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||de(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const sb={tokenize:ob};function ob(e){const t=this,n=e.attempt(mr,r,e.attempt(this.parser.constructs.flowInitial,i,Ie(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fg,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ub={resolveAll:Cl()},cb=Sl("string"),lb=Sl("text");function Sl(e){return{tokenize:t,resolveAll:Cl(e==="text"?db:void 0)};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,o);return s;function s(d){return c(d)?a(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),a(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h<f.length;){const m=f[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Cl(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function db(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,o=0,u;for(;a--;){const c=i[a];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(c===-2)u=!0,o++;else if(c!==-1){a++;break}}if(o){const c={type:n===e.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-o,offset:r.end.offset-o,_index:r.start._index+a,_bufferIndex:a?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function fb(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},a=[];let s=[],o=[];const u={consume:w,enter:N,exit:M,attempt:O(v),check:O(p),interrupt:O(p,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:h,now:y,defineSkip:b,write:f};let d=t.tokenize.call(c,u);return t.resolveAll&&a.push(t),c;function f(U){return s=gt(s,U),A(),s[s.length-1]!==null?[]:(B(t,0),c.events=ci(a,c.events,c),c.events)}function h(U,W){return mb(m(U),W)}function m(U){return hb(s,U)}function y(){const{line:U,column:W,offset:H,_index:G,_bufferIndex:ee}=r;return{line:U,column:W,offset:H,_index:G,_bufferIndex:ee}}function b(U){i[U.line]=U.column,k()}function A(){let U;for(;r._index<s.length;){const W=s[r._index];if(typeof W=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<W.length;)I(W.charCodeAt(r._bufferIndex));else I(W)}}function I(U){d=d(U)}function w(U){de(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,k()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=U}function N(U,W){const H=W||{};return H.type=U,H.start=y(),c.events.push(["enter",H,c]),o.push(H),H}function M(U){const W=o.pop();return W.end=y(),c.events.push(["exit",W,c]),W}function v(U,W){B(U,W.from)}function p(U,W){W.restore()}function O(U,W){return H;function H(G,ee,pe){let ge,we,ve,E;return Array.isArray(G)?K(G):"tokenize"in G?K([G]):z(G);function z(J){return se;function se(oe){const fe=oe!==null&&J[oe],te=oe!==null&&J.null,De=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(te)?te:te?[te]:[]];return K(De)(oe)}}function K(J){return ge=J,we=0,J.length===0?pe:x(J[we])}function x(J){return se;function se(oe){return E=X(),ve=J,J.partial||(c.currentConstruct=J),J.name&&c.parser.constructs.disable.null.includes(J.name)?re():J.tokenize.call(W?Object.assign(Object.create(c),W):c,u,ne,re)(oe)}}function ne(J){return U(ve,E),ee}function re(J){return E.restore(),++we<ge.length?x(ge[we]):pe}}}function B(U,W){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&mt(c.events,W,c.events.length-W,U.resolve(c.events.slice(W),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function X(){const U=y(),W=c.previous,H=c.currentConstruct,G=c.events.length,ee=Array.from(o);return{restore:pe,from:G};function pe(){r=U,c.previous=W,c.currentConstruct=H,c.events.length=G,o=ee,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hb(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function mb(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
|
|
49
49
|
`;break}case-3:{s=`\r
|
|
50
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}const ub={42:ot,43:ot,45:ot,48:ot,49:ot,50:ot,51:ot,52:ot,53:ot,54:ot,55:ot,56:ot,57:ot,62:cl},cb={91:lg},lb={[-2]:Di,[-1]:Di,32:Di},db={35:gg,42:Lr,45:[Po,Lr],60:yg,61:Po,95:Lr,96:Lo,126:Lo},fb={38:dl,92:ll},hb={[-5]:Pi,[-4]:Pi,[-3]:Pi,33:Fg,38:dl,42:xa,60:[jp,wg],91:Hg,92:[mg,ll],93:cs,95:xa,96:eg},mb={null:[xa,tb]},pb={null:[42,95]},gb={null:[]},bb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pb,contentInitial:cb,disable:gb,document:ub,flow:db,flowInitial:lb,insideSpan:mb,string:fb,text:hb},Symbol.toStringTag,{value:"Module"}));function Eb(e){const n=ol([bb,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(Dp),document:i(Mp),flow:i(Zg),string:i(nb),text:i(rb)};return r;function i(a){return s;function s(o){return ab(r,a,o)}}}function Tb(e){for(;!fl(e););return e}const Mo=/[\0\t\n\r]/g;function yb(){let e=1,t="",n=!0,r;return i;function i(a,s,o){const u=[];let c,d,f,h,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(Mo.lastIndex=f,c=Mo.exec(a),h=c&&c.index!==void 0?c.index:a.length,m=a.charCodeAt(h),!c){t=a.slice(f);break}if(m===10&&f===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<h&&(u.push(a.slice(f,h)),e+=h-f),m){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const _b=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xb(e){return e.replace(_b,Sb)}function Sb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return ul(n.slice(a?2:1),a?16:10)}return us(n)||e}const El={}.hasOwnProperty;function Cb(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Ib(n)(Tb(Eb(n).document().write(yb()(e,t,!0))))}function Ib(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Me),autolinkProtocol:G,autolinkEmail:G,atxHeading:a(Ue),blockQuote:a(oe),characterEscape:G,characterReference:G,codeFenced:a(ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(ie,s),codeText:a(Oe,s),codeTextData:G,data:G,codeFlowValue:G,definition:a(Y),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(je),hardBreakEscape:a(et),hardBreakTrailing:a(et),htmlFlow:a(it,s),htmlFlowData:G,htmlText:a(it,s),htmlTextData:G,image:a(at),label:s,link:a(Me),listItem:a(St),listItemValue:h,listOrdered:a(ut,f),listUnordered:a(ut),paragraph:a(ge),reference:x,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Ue),strong:a(Le),thematicBreak:a(Ae)},exit:{atxHeading:u(),atxHeadingSequence:A,autolink:u(),autolinkEmail:re,autolinkProtocol:ae,blockQuote:u(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:X,codeFenced:u(w),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:N,codeIndented:u(I),codeText:u(Z),codeTextData:N,data:N,definition:u(),definitionDestinationString:M,definitionLabelString:v,definitionTitleString:R,emphasis:u(),hardBreakEscape:u(V),hardBreakTrailing:u(V),htmlFlow:u(j),htmlFlowData:N,htmlText:u(z),htmlTextData:N,image:u(he),label:we,labelText:le,lineEnding:H,link:u(be),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:J,resourceDestinationString:E,resourceTitleString:$,resource:ne,setextHeading:u(B),setextHeadingLineSequence:L,setextHeadingText:p,strong:u(),thematicBreak:u()}};Tl(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(k){let P={type:"root",children:[]};const q={stack:[P],tokenStack:[],config:t,enter:o,exit:c,buffer:s,resume:d,data:n},ee=[];let ye=-1;for(;++ye<k.length;)if(k[ye][1].type==="listOrdered"||k[ye][1].type==="listUnordered")if(k[ye][0]==="enter")ee.push(ye);else{const Qe=ee.pop();ye=i(k,Qe,ye)}for(ye=-1;++ye<k.length;){const Qe=t[k[ye][0]];El.call(Qe,k[ye][1].type)&&Qe[k[ye][1].type].call(Object.assign({sliceSerialize:k[ye][2].sliceSerialize},q),k[ye][1])}if(q.tokenStack.length>0){const Qe=q.tokenStack[q.tokenStack.length-1];(Qe[1]||Bo).call(q,void 0,Qe[0])}for(P.position={start:$t(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:$t(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},ye=-1;++ye<t.transforms.length;)P=t.transforms[ye](P)||P;return P}function i(k,P,q){let ee=P-1,ye=-1,Qe=!1,Ee,ke,mt,pt;for(;++ee<=q;){const ze=k[ee];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?ye++:ye--,pt=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(Ee&&!pt&&!ye&&!mt&&(mt=ee),pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pt=void 0}if(!ye&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||ye===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(Ee){let ct=ee;for(ke=void 0;ct--;){const tt=k[ct];if(tt[1].type==="lineEnding"||tt[1].type==="lineEndingBlank"){if(tt[0]==="exit")continue;ke&&(k[ke][1].type="lineEndingBlank",Qe=!0),tt[1].type="lineEnding",ke=ct}else if(!(tt[1].type==="linePrefix"||tt[1].type==="blockQuotePrefix"||tt[1].type==="blockQuotePrefixWhitespace"||tt[1].type==="blockQuoteMarker"||tt[1].type==="listItemIndent"))break}mt&&(!ke||mt<ke)&&(Ee._spread=!0),Ee.end=Object.assign({},ke?k[ke][1].start:ze[1].end),k.splice(ke||ee,0,["exit",Ee,ze[2]]),ee++,q++}if(ze[1].type==="listItemPrefix"){const ct={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};Ee=ct,k.splice(ee,0,["enter",ct,ze[2]]),ee++,q++,mt=void 0,pt=!0}}}return k[P][1]._spread=Qe,q}function a(k,P){return q;function q(ee){o.call(this,k(ee),ee),P&&P.call(this,ee)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(k,P,q){this.stack[this.stack.length-1].children.push(k),this.stack.push(k),this.tokenStack.push([P,q]),k.position={start:$t(P.start),end:void 0}}function u(k){return P;function P(q){k&&k.call(this,q),c.call(this,q)}}function c(k,P){const q=this.stack.pop(),ee=this.tokenStack.pop();if(ee)ee[0].type!==k.type&&(P?P.call(this,k,ee[0]):(ee[1]||Bo).call(this,k,ee[0]));else throw new Error("Cannot close `"+k.type+"` ("+qn({start:k.start,end:k.end})+"): it’s not open");q.position.end=$t(k.end)}function d(){return os(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(k){if(this.data.expectingFirstListItemValue){const P=this.stack[this.stack.length-2];P.start=Number.parseInt(this.sliceSerialize(k),10),this.data.expectingFirstListItemValue=void 0}}function m(){const k=this.resume(),P=this.stack[this.stack.length-1];P.lang=k}function y(){const k=this.resume(),P=this.stack[this.stack.length-1];P.meta=k}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const k=this.resume(),P=this.stack[this.stack.length-1];P.value=k.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function I(){const k=this.resume(),P=this.stack[this.stack.length-1];P.value=k.replace(/(\r?\n|\r)$/g,"")}function v(k){const P=this.resume(),q=this.stack[this.stack.length-1];q.label=P,q.identifier=At(this.sliceSerialize(k)).toLowerCase()}function R(){const k=this.resume(),P=this.stack[this.stack.length-1];P.title=k}function M(){const k=this.resume(),P=this.stack[this.stack.length-1];P.url=k}function A(k){const P=this.stack[this.stack.length-1];if(!P.depth){const q=this.sliceSerialize(k).length;P.depth=q}}function p(){this.data.setextHeadingSlurpLineEnding=!0}function L(k){const P=this.stack[this.stack.length-1];P.depth=this.sliceSerialize(k).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function G(k){const q=this.stack[this.stack.length-1].children;let ee=q[q.length-1];(!ee||ee.type!=="text")&&(ee=ve(),ee.position={start:$t(k.start),end:void 0},q.push(ee)),this.stack.push(ee)}function N(k){const P=this.stack.pop();P.value+=this.sliceSerialize(k),P.position.end=$t(k.end)}function H(k){const P=this.stack[this.stack.length-1];if(this.data.atHardBreak){const q=P.children[P.children.length-1];q.position.end=$t(k.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(P.type)&&(G.call(this,k),N.call(this,k))}function V(){this.data.atHardBreak=!0}function j(){const k=this.resume(),P=this.stack[this.stack.length-1];P.value=k}function z(){const k=this.resume(),P=this.stack[this.stack.length-1];P.value=k}function Z(){const k=this.resume(),P=this.stack[this.stack.length-1];P.value=k}function be(){const k=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=P,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function he(){const k=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=P,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function le(k){const P=this.sliceSerialize(k),q=this.stack[this.stack.length-2];q.label=xb(P),q.identifier=At(P).toLowerCase()}function we(){const k=this.stack[this.stack.length-1],P=this.resume(),q=this.stack[this.stack.length-1];if(this.data.inReference=!0,q.type==="link"){const ee=k.children;q.children=ee}else q.alt=P}function E(){const k=this.resume(),P=this.stack[this.stack.length-1];P.url=k}function $(){const k=this.resume(),P=this.stack[this.stack.length-1];P.title=k}function ne(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function J(k){const P=this.resume(),q=this.stack[this.stack.length-1];q.label=P,q.identifier=At(this.sliceSerialize(k)).toLowerCase(),this.data.referenceType="full"}function ue(k){this.data.characterReferenceType=k.type}function X(k){const P=this.sliceSerialize(k),q=this.data.characterReferenceType;let ee;q?(ee=ul(P,q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ee=us(P);const ye=this.stack.pop();ye.value+=ee,ye.position.end=$t(k.end)}function ae(k){N.call(this,k);const P=this.stack[this.stack.length-1];P.url=this.sliceSerialize(k)}function re(k){N.call(this,k);const P=this.stack[this.stack.length-1];P.url="mailto:"+this.sliceSerialize(k)}function oe(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function Y(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function Ue(){return{type:"heading",depth:0,children:[]}}function et(){return{type:"break"}}function it(){return{type:"html",value:""}}function at(){return{type:"image",title:null,url:"",alt:null}}function Me(){return{type:"link",title:null,url:"",children:[]}}function ut(k){return{type:"list",ordered:k.type==="listOrdered",start:null,spread:k._spread,children:[]}}function St(k){return{type:"listItem",spread:k._spread,checked:null,children:[]}}function ge(){return{type:"paragraph",children:[]}}function Le(){return{type:"strong",children:[]}}function ve(){return{type:"text",value:""}}function Ae(){return{type:"thematicBreak"}}}function $t(e){return{line:e.line,column:e.column,offset:e.offset}}function Tl(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Tl(e,r):Ab(e,r)}}function Ab(e,t){let n;for(n in t)if(El.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Bo(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+qn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+qn({start:t.start,end:t.end})+") is still open")}function wb(e){const t=this;t.parser=n;function n(r){return Cb(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function vb(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)}function kb(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
51
|
-
`}]}function
|
|
52
|
-
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function
|
|
50
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}const pb={42:dt,43:dt,45:dt,48:dt,49:dt,50:dt,51:dt,52:dt,53:dt,54:dt,55:dt,56:dt,57:dt,62:gl},gb={91:bg},bb={[-2]:Hi,[-1]:Hi,32:Hi},Eb={35:Sg,42:Mr,45:[Vo,Mr],60:wg,61:Vo,95:Mr,96:Ho,126:Ho},Tb={38:El,92:bl},yb={[-5]:ji,[-4]:ji,[-3]:ji,33:Wg,38:El,42:va,60:[qp,Dg],91:Yg,92:[_g,bl],93:gs,95:va,96:og},_b={null:[va,ub]},xb={null:[42,95]},Sb={null:[]},Cb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:xb,contentInitial:gb,disable:Sb,document:pb,flow:Eb,flowInitial:bb,insideSpan:_b,string:Tb,text:yb},Symbol.toStringTag,{value:"Module"}));function Ib(e){const n=ml([Cb,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(jp),document:i(zp),flow:i(sb),string:i(cb),text:i(lb)};return r;function i(a){return s;function s(o){return fb(r,a,o)}}}function Ab(e){for(;!Tl(e););return e}const zo=/[\0\t\n\r]/g;function wb(){let e=1,t="",n=!0,r;return i;function i(a,s,o){const u=[];let c,d,f,h,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(zo.lastIndex=f,c=zo.exec(a),h=c&&c.index!==void 0?c.index:a.length,m=a.charCodeAt(h),!c){t=a.slice(f);break}if(m===10&&f===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<h&&(u.push(a.slice(f,h)),e+=h-f),m){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const vb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kb(e){return e.replace(vb,Nb)}function Nb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return pl(n.slice(a?2:1),a?16:10)}return ps(n)||e}const Il={}.hasOwnProperty;function Rb(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Ob(n)(Ab(Ib(n).document().write(wb()(e,t,!0))))}function Ob(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Be),autolinkProtocol:X,autolinkEmail:X,atxHeading:a(je),blockQuote:a(fe),characterEscape:X,characterReference:X,codeFenced:a(te),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(te,s),codeText:a(De,s),codeTextData:X,data:X,codeFlowValue:X,definition:a(Q),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(ke),hardBreakEscape:a(qe),hardBreakTrailing:a(qe),htmlFlow:a(xt,s),htmlFlowData:X,htmlText:a(xt,s),htmlTextData:X,image:a(At),label:s,link:a(Be),listItem:a(ut),listItemValue:h,listOrdered:a(ot,f),listUnordered:a(ot),paragraph:a(Ee),reference:x,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(je),strong:a(Ne),thematicBreak:a(Ae)},exit:{atxHeading:u(),atxHeadingSequence:v,autolink:u(),autolinkEmail:oe,autolinkProtocol:se,blockQuote:u(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:J,codeFenced:u(A),codeFencedFence:b,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:k,codeIndented:u(I),codeText:u(ee),codeTextData:k,data:k,definition:u(),definitionDestinationString:M,definitionLabelString:w,definitionTitleString:N,emphasis:u(),hardBreakEscape:u(W),hardBreakTrailing:u(W),htmlFlow:u(H),htmlFlowData:k,htmlText:u(G),htmlTextData:k,image:u(ge),label:ve,labelText:we,lineEnding:U,link:u(pe),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ne,resourceDestinationString:E,resourceTitleString:z,resource:K,setextHeading:u(B),setextHeadingLineSequence:O,setextHeadingText:p,strong:u(),thematicBreak:u()}};Al(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(L){let j={type:"root",children:[]};const P={stack:[j],tokenStack:[],config:t,enter:o,exit:c,buffer:s,resume:d,data:n},q=[];let ue=-1;for(;++ue<L.length;)if(L[ue][1].type==="listOrdered"||L[ue][1].type==="listUnordered")if(L[ue][0]==="enter")q.push(ue);else{const Re=q.pop();ue=i(L,Re,ue)}for(ue=-1;++ue<L.length;){const Re=t[L[ue][0]];Il.call(Re,L[ue][1].type)&&Re[L[ue][1].type].call(Object.assign({sliceSerialize:L[ue][2].sliceSerialize},P),L[ue][1])}if(P.tokenStack.length>0){const Re=P.tokenStack[P.tokenStack.length-1];(Re[1]||$o).call(P,void 0,Re[0])}for(j.position={start:$t(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:$t(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},ue=-1;++ue<t.transforms.length;)j=t.transforms[ue](j)||j;return j}function i(L,j,P){let q=j-1,ue=-1,Re=!1,Ze,et,Te,Fe;for(;++q<=P;){const We=L[q];switch(We[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{We[0]==="enter"?ue++:ue--,Fe=void 0;break}case"lineEndingBlank":{We[0]==="enter"&&(Ze&&!Fe&&!ue&&!Te&&(Te=q),Fe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Fe=void 0}if(!ue&&We[0]==="enter"&&We[1].type==="listItemPrefix"||ue===-1&&We[0]==="exit"&&(We[1].type==="listUnordered"||We[1].type==="listOrdered")){if(Ze){let ct=q;for(et=void 0;ct--;){const Xe=L[ct];if(Xe[1].type==="lineEnding"||Xe[1].type==="lineEndingBlank"){if(Xe[0]==="exit")continue;et&&(L[et][1].type="lineEndingBlank",Re=!0),Xe[1].type="lineEnding",et=ct}else if(!(Xe[1].type==="linePrefix"||Xe[1].type==="blockQuotePrefix"||Xe[1].type==="blockQuotePrefixWhitespace"||Xe[1].type==="blockQuoteMarker"||Xe[1].type==="listItemIndent"))break}Te&&(!et||Te<et)&&(Ze._spread=!0),Ze.end=Object.assign({},et?L[et][1].start:We[1].end),L.splice(et||q,0,["exit",Ze,We[2]]),q++,P++}if(We[1].type==="listItemPrefix"){const ct={type:"listItem",_spread:!1,start:Object.assign({},We[1].start),end:void 0};Ze=ct,L.splice(q,0,["enter",ct,We[2]]),q++,P++,Te=void 0,Fe=!0}}}return L[j][1]._spread=Re,P}function a(L,j){return P;function P(q){o.call(this,L(q),q),j&&j.call(this,q)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(L,j,P){this.stack[this.stack.length-1].children.push(L),this.stack.push(L),this.tokenStack.push([j,P]),L.position={start:$t(j.start),end:void 0}}function u(L){return j;function j(P){L&&L.call(this,P),c.call(this,P)}}function c(L,j){const P=this.stack.pop(),q=this.tokenStack.pop();if(q)q[0].type!==L.type&&(j?j.call(this,L,q[0]):(q[1]||$o).call(this,L,q[0]));else throw new Error("Cannot close `"+L.type+"` ("+Xn({start:L.start,end:L.end})+"): it’s not open");P.position.end=$t(L.end)}function d(){return ms(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(L){if(this.data.expectingFirstListItemValue){const j=this.stack[this.stack.length-2];j.start=Number.parseInt(this.sliceSerialize(L),10),this.data.expectingFirstListItemValue=void 0}}function m(){const L=this.resume(),j=this.stack[this.stack.length-1];j.lang=L}function y(){const L=this.resume(),j=this.stack[this.stack.length-1];j.meta=L}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const L=this.resume(),j=this.stack[this.stack.length-1];j.value=L.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function I(){const L=this.resume(),j=this.stack[this.stack.length-1];j.value=L.replace(/(\r?\n|\r)$/g,"")}function w(L){const j=this.resume(),P=this.stack[this.stack.length-1];P.label=j,P.identifier=Ct(this.sliceSerialize(L)).toLowerCase()}function N(){const L=this.resume(),j=this.stack[this.stack.length-1];j.title=L}function M(){const L=this.resume(),j=this.stack[this.stack.length-1];j.url=L}function v(L){const j=this.stack[this.stack.length-1];if(!j.depth){const P=this.sliceSerialize(L).length;j.depth=P}}function p(){this.data.setextHeadingSlurpLineEnding=!0}function O(L){const j=this.stack[this.stack.length-1];j.depth=this.sliceSerialize(L).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function X(L){const P=this.stack[this.stack.length-1].children;let q=P[P.length-1];(!q||q.type!=="text")&&(q=Se(),q.position={start:$t(L.start),end:void 0},P.push(q)),this.stack.push(q)}function k(L){const j=this.stack.pop();j.value+=this.sliceSerialize(L),j.position.end=$t(L.end)}function U(L){const j=this.stack[this.stack.length-1];if(this.data.atHardBreak){const P=j.children[j.children.length-1];P.position.end=$t(L.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(j.type)&&(X.call(this,L),k.call(this,L))}function W(){this.data.atHardBreak=!0}function H(){const L=this.resume(),j=this.stack[this.stack.length-1];j.value=L}function G(){const L=this.resume(),j=this.stack[this.stack.length-1];j.value=L}function ee(){const L=this.resume(),j=this.stack[this.stack.length-1];j.value=L}function pe(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=j,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function ge(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=j,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function we(L){const j=this.sliceSerialize(L),P=this.stack[this.stack.length-2];P.label=kb(j),P.identifier=Ct(j).toLowerCase()}function ve(){const L=this.stack[this.stack.length-1],j=this.resume(),P=this.stack[this.stack.length-1];if(this.data.inReference=!0,P.type==="link"){const q=L.children;P.children=q}else P.alt=j}function E(){const L=this.resume(),j=this.stack[this.stack.length-1];j.url=L}function z(){const L=this.resume(),j=this.stack[this.stack.length-1];j.title=L}function K(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function ne(L){const j=this.resume(),P=this.stack[this.stack.length-1];P.label=j,P.identifier=Ct(this.sliceSerialize(L)).toLowerCase(),this.data.referenceType="full"}function re(L){this.data.characterReferenceType=L.type}function J(L){const j=this.sliceSerialize(L),P=this.data.characterReferenceType;let q;P?(q=pl(j,P==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):q=ps(j);const ue=this.stack.pop();ue.value+=q,ue.position.end=$t(L.end)}function se(L){k.call(this,L);const j=this.stack[this.stack.length-1];j.url=this.sliceSerialize(L)}function oe(L){k.call(this,L);const j=this.stack[this.stack.length-1];j.url="mailto:"+this.sliceSerialize(L)}function fe(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function Q(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function xt(){return{type:"html",value:""}}function At(){return{type:"image",title:null,url:"",alt:null}}function Be(){return{type:"link",title:null,url:"",children:[]}}function ot(L){return{type:"list",ordered:L.type==="listOrdered",start:null,spread:L._spread,children:[]}}function ut(L){return{type:"listItem",spread:L._spread,checked:null,children:[]}}function Ee(){return{type:"paragraph",children:[]}}function Ne(){return{type:"strong",children:[]}}function Se(){return{type:"text",value:""}}function Ae(){return{type:"thematicBreak"}}}function $t(e){return{line:e.line,column:e.column,offset:e.offset}}function Al(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Al(e,r):Lb(e,r)}}function Lb(e,t){let n;for(n in t)if(Il.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function $o(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Xn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Xn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Xn({start:t.start,end:t.end})+") is still open")}function Db(e){const t=this;t.parser=n;function n(r){return Rb(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Pb(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)}function Mb(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
51
|
+
`}]}function Bb(e,t){const n=t.value?t.value+`
|
|
52
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Fb(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ub(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hb(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ln(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,o+=1,e.footnoteCounts.set(r,o);const u={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,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function jb(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function wl(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function zb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wl(e,t);const i={src:Ln(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function $b(e,t){const n={src:Ln(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Wb(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)}function Gb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wl(e,t);const i={href:Ln(r.url||"")};r.title!==null&&r.title!==void 0&&(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)}function Yb(e,t){const n={href:Ln(t.url)};t.title!==null&&t.title!==void 0&&(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)}function qb(e,t,n){const r=e.all(t),i=n?Xb(n):vl(t),a={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
53
53
|
`}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
54
|
-
`});const c={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,c),e.applyData(t,c)}function
|
|
54
|
+
`});const c={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,c),e.applyData(t,c)}function Xb(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=vl(n[r])}return t}function vl(e){const t=e.spread;return t??e.children.length>1}function Qb(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Kb(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jb(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Zb(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eE(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Mt(t.children[1]),u=oi(t.children[t.children.length-1]);o&&u&&(s.position={start:o,end:u}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function tE(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:t.children.length;let u=-1;const c=[];for(;++u<o;){const f=t.children[u],h={},m=s?s[u]:void 0;m&&(h.align=m);let y={type:"element",tagName:a,properties:h,children:[]};f&&(y.children=e.all(f),e.patch(f,y),y=e.applyData(f,y)),c.push(y)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function nE(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Wo=9,Go=32;function rE(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(Yo(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Yo(t.slice(i),i>0,!1)),a.join("")}function Yo(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Wo||a===Go;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Wo||a===Go;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function iE(e,t){const n={type:"text",value:rE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function aE(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const sE={blockquote:Pb,break:Mb,code:Bb,delete:Fb,emphasis:Ub,footnoteReference:Hb,heading:jb,html:Vb,imageReference:zb,image:$b,inlineCode:Wb,linkReference:Gb,link:Yb,listItem:qb,list:Qb,paragraph:Kb,root:Jb,strong:Zb,table:eE,tableCell:nE,tableRow:tE,text:iE,thematicBreak:aE,toml:wr,yaml:wr,definition:wr,footnoteDefinition:wr};function wr(){}const kl=-1,li=0,jr=1,Vr=2,bs=3,Es=4,Ts=5,ys=6,Nl=7,Rl=8,qo=typeof self=="object"?self:globalThis,oE=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case li:case kl:return n(s,i);case jr:{const o=n([],i);for(const u of s)o.push(r(u));return o}case Vr:{const o=n({},i);for(const[u,c]of s)o[r(u)]=r(c);return o}case bs:return n(new Date(s),i);case Es:{const{source:o,flags:u}=s;return n(new RegExp(o,u),i)}case Ts:{const o=n(new Map,i);for(const[u,c]of s)o.set(r(u),r(c));return o}case ys:{const o=n(new Set,i);for(const u of s)o.add(r(u));return o}case Nl:{const{name:o,message:u}=s;return n(new qo[o](u),i)}case Rl:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new qo[a](s),i)};return r},Xo=e=>oE(new Map,e)(0),En="",{toString:uE}={},{keys:cE}=Object,jn=e=>{const t=typeof e;if(t!=="object"||!e)return[li,t];const n=uE.call(e).slice(8,-1);switch(n){case"Array":return[jr,En];case"Object":return[Vr,En];case"Date":return[bs,En];case"RegExp":return[Es,En];case"Map":return[Ts,En];case"Set":return[ys,En]}return n.includes("Array")?[jr,n]:n.includes("Error")?[Nl,n]:[Vr,n]},vr=([e,t])=>e===li&&(t==="function"||t==="symbol"),lE=(e,t,n,r)=>{const i=(s,o)=>{const u=r.push(s)-1;return n.set(o,u),u},a=s=>{if(n.has(s))return n.get(s);let[o,u]=jn(s);switch(o){case li:{let d=s;switch(u){case"bigint":o=Rl,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([kl],s)}return i([o,d],s)}case jr:{if(u)return i([u,[...s]],s);const d=[],f=i([o,d],s);for(const h of s)d.push(a(h));return f}case Vr:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const d=[],f=i([o,d],s);for(const h of cE(s))(e||!vr(jn(s[h])))&&d.push([a(h),a(s[h])]);return f}case bs:return i([o,s.toISOString()],s);case Es:{const{source:d,flags:f}=s;return i([o,{source:d,flags:f}],s)}case Ts:{const d=[],f=i([o,d],s);for(const[h,m]of s)(e||!(vr(jn(h))||vr(jn(m))))&&d.push([a(h),a(m)]);return f}case ys:{const d=[],f=i([o,d],s);for(const h of s)(e||!vr(jn(h)))&&d.push(a(h));return f}}const{message:c}=s;return i([o,{name:u,message:c}],s)};return a},Qo=(e,{json:t,lossy:n}={})=>{const r=[];return lE(!(t||n),!!t,new Map,r)(e),r},kn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Xo(Qo(e,t)):structuredClone(e):(e,t)=>Xo(Qo(e,t));function dE(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 fE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function hE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||dE,r=e.options.footnoteBackLabel||fE,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const d=e.all(c),f=String(c.identifier).toUpperCase(),h=Ln(f.toLowerCase());let m=0;const y=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++m<=b;){y.length>0&&y.push({type:"text",value:" "});let w=typeof n=="string"?n:n(u,m);typeof w=="string"&&(w={type:"text",value:w}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const A=d[d.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const w=A.children[A.children.length-1];w&&w.type==="text"?w.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...y)}else d.push(...y);const I={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(c,I),o.push(I)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...kn(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
55
55
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
56
|
-
`}]}}const
|
|
56
|
+
`}]}}const di=(function(e){if(e==null)return bE;if(typeof e=="function")return fi(e);if(typeof e=="object")return Array.isArray(e)?mE(e):pE(e);if(typeof e=="string")return gE(e);throw new Error("Expected function, string, or object as test")});function mE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=di(e[n]);return fi(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function pE(e){const t=e;return fi(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function gE(e){return fi(t);function t(n){return n&&n.type===e}}function fi(e){return t;function t(n,r,i){return!!(EE(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function bE(){return!0}function EE(e){return e!==null&&typeof e=="object"&&"type"in e}const Ol=[],TE=!0,ka=!1,yE="skip";function Ll(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=di(i),s=r?-1:1;o(e,void 0,[])();function o(u,c,d){const f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){const m=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=Ol,y,b,A;if((!t||a(u,c,d[d.length-1]||void 0))&&(m=_E(n(u,d)),m[0]===ka))return m;if("children"in u&&u.children){const I=u;if(I.children&&m[0]!==yE)for(b=(r?I.children.length:-1)+s,A=d.concat(I);b>-1&&b<I.children.length;){const w=I.children[b];if(y=o(w,b,A)(),y[0]===ka)return y;b=typeof y[1]=="number"?y[1]:b+s}}return m}}}function _E(e){return Array.isArray(e)?e:typeof e=="number"?[TE,e]:e==null?Ol:[e]}function hi(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),Ll(e,a,o,i);function o(u,c){const d=c[c.length-1],f=d?d.children.indexOf(u):void 0;return s(u,f,d)}}const Na={}.hasOwnProperty,xE={};function SE(e,t){const n=t||xE,r=new Map,i=new Map,a=new Map,s={...sE,...n.handlers},o={all:c,applyData:IE,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:u,options:n,patch:CE,wrap:wE};return hi(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),o;function u(d,f){const h=d.type,m=o.handlers[h];if(Na.call(o.handlers,h)&&m)return m(o,d,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:b,...A}=d,I=kn(A);return I.children=o.all(d),I}return kn(d)}return(o.options.unknownHandler||AE)(o,d,f)}function c(d){const f=[];if("children"in d){const h=d.children;let m=-1;for(;++m<h.length;){const y=o.one(h[m],d);if(y){if(m&&h[m-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=Ko(y.value)),!Array.isArray(y)&&y.type==="element")){const b=y.children[0];b&&b.type==="text"&&(b.value=Ko(b.value))}Array.isArray(y)?f.push(...y):f.push(y)}}}return f}}function CE(e,t){e.position&&(t.position=dp(e))}function IE(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,kn(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function AE(e,t){const n=t.data||{},r="value"in t&&!(Na.call(n,"hProperties")||Na.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function wE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
57
57
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
58
58
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
59
|
-
`}),n}function
|
|
60
|
-
`},i),a}function _E(e,t){return e&&"run"in e?async function(n,r){const i=Wo(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Wo(n,{file:r,...t||e})}}function Go(e){if(e)throw e}var Mi,Yo;function xE(){if(Yo)return Mi;Yo=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},a=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!f)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},s=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},o=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Mi=function u(){var c,d,f,h,m,y,g=arguments[0],w=1,I=arguments.length,v=!1;for(typeof g=="boolean"&&(v=g,g=arguments[1]||{},w=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});w<I;++w)if(c=arguments[w],c!=null)for(d in c)f=o(g,d),h=o(c,d),g!==h&&(v&&h&&(a(h)||(m=i(h)))?(m?(m=!1,y=f&&i(f)?f:[]):y=f&&a(f)?f:{},s(g,{name:d,newValue:u(v,y,h)})):typeof h<"u"&&s(g,{name:d,newValue:h}));return g},Mi}var SE=xE();const Bi=Ha(SE);function Ia(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function CE(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(u,...c){const d=e[++a];let f=-1;if(u){s(u);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,d?IE(d,o)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function IE(e,t){let n;return r;function r(...s){const o=e.length>s.length;let u;o&&s.push(i);try{u=e.apply(this,s)}catch(c){const d=c;if(o&&n)throw d;return i(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(s,...o){n||(n=!0,t(s,...o))}function a(s){i(null,s)}}const vt={basename:AE,dirname:wE,extname:vE,join:kE,sep:"/"};function AE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');mr(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function wE(e){if(mr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function vE(e){mr(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function kE(...e){let t=-1,n;for(;++t<e.length;)mr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":NE(n)}function NE(e){mr(e);const t=e.codePointAt(0)===47;let n=RE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function RE(e,t){let n="",r=0,i=-1,a=0,s=-1,o,u;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function mr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const OE={cwd:LE};function LE(){return"/"}function Aa(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function DE(e){if(typeof e=="string")e=new URL(e);else if(!Aa(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return PE(e)}function PE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Fi=["history","path","basename","stem","extname","dirname"];class wl{constructor(t){let n;t?Aa(t)?n={path:t}:typeof t=="string"||ME(t)?n={value:t}:n=t:n={},this.cwd=OE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Fi.length;){const a=Fi[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Fi.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?vt.basename(this.path):void 0}set basename(t){Hi(t,"basename"),Ui(t,"basename"),this.path=vt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?vt.dirname(this.path):void 0}set dirname(t){qo(this.basename,"dirname"),this.path=vt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?vt.extname(this.path):void 0}set extname(t){if(Ui(t,"extname"),qo(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=vt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Aa(t)&&(t=DE(t)),Hi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?vt.basename(this.path,this.extname):void 0}set stem(t){Hi(t,"stem"),Ui(t,"stem"),this.path=vt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Je(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ui(e,t){if(e&&e.includes(vt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+vt.sep+"`")}function Hi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qo(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ME(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BE=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};Object.setPrototypeOf(a,r);const s=Object.getOwnPropertyNames(i);for(const o of s){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(a,o,u)}return a}),FE={}.hasOwnProperty;class ms extends BE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=CE()}copy(){const t=new ms;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Bi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(zi("data",this.frozen),this.namespace[t]=n,this):FE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zi("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ar(t),r=this.parser||this.Parser;return ji("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ji("process",this.parser||this.Parser),Vi("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const o=Ar(t),u=r.parse(o);r.run(u,o,function(d,f,h){if(d||!f||!h)return c(d);const m=f,y=r.stringify(m,h);jE(y)?h.value=y:h.result=y,c(d,h)});function c(d,f){d||!f?s(d):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),ji("processSync",this.parser||this.Parser),Vi("processSync",this.compiler||this.Compiler),this.process(t,i),Qo("processSync","process",n),r;function i(a,s){n=!0,Go(a),r=s}}run(t,n,r){Xo(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,o){const u=Ar(n);i.run(t,u,c);function c(d,f,h){const m=f||t;d?o(d):s?s(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Qo("runSync","run",r),i;function a(s,o){Go(s),i=o,r=!0}}stringify(t,n){this.freeze();const r=Ar(n),i=this.compiler||this.Compiler;return Vi("stringify",i),Xo(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(zi("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...f]=c;u(d,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=Bi(!0,i.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const f=c[d];a(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...d]);else if(d.length>0){let[m,...y]=d;const g=r[h][1];Ia(g)&&Ia(m)&&(m=Bi(!0,g,m)),r[h]=[c,m,...y]}}}}const UE=new ms().freeze();function ji(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Vi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zi(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 Xo(e){if(!Ia(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Qo(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ar(e){return HE(e)?e:new wl(e)}function HE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jE(e){return typeof e=="string"||VE(e)}function VE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ko=[],Jo={allowDangerousHtml:!0},$E=/^(https?|ircs?|mailto|xmpp)$/i,WE=[{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:"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 ps(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,a=e.components,s=e.disallowedElements,o=e.rehypePlugins||Ko,u=e.remarkPlugins||Ko,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jo}:Jo,d=e.skipHtml,f=e.unwrapDisallowed,h=e.urlTransform||GE,m=UE().use(wb).use(u).use(_E,c).use(o),y=new wl;typeof r=="string"&&(y.value=r);for(const v of WE)Object.hasOwn(e,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+zE+v.id,void 0);const g=m.parse(y);let w=m.runSync(g,y);return i&&(w={type:"element",tagName:"div",properties:{className:i},children:w.type==="root"?w.children:[w]}),li(w,I),lp(w,{Fragment:b.Fragment,components:a,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function I(v,R,M){if(v.type==="raw"&&M&&typeof R=="number")return d?M.children.splice(R,1):M.children[R]={type:"text",value:v.value},R;if(v.type==="element"){let A;for(A in Li)if(Object.hasOwn(Li,A)&&Object.hasOwn(v.properties,A)){const p=v.properties[A],L=Li[A];(L===null||L.includes(v.tagName))&&(v.properties[A]=h(String(p||""),A,v))}}if(v.type==="element"){let A=t?!t.includes(v.tagName):s?s.includes(v.tagName):!1;if(!A&&n&&typeof R=="number"&&(A=!n(v,R,M)),A&&M&&typeof R=="number")return f&&v.children?M.children.splice(R,1,...v.children):M.children.splice(R,1),R}}}function GE(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||$E.test(e.slice(0,t))?e:""}const Zo=/[#.]/g;function YE(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){Zo.lastIndex=i;const o=Zo.exec(n),u=n.slice(i,o?o.index:n.length);u&&(a?a==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:s=u,i+=u.length),o&&(a=o[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}const qE=new Set(["button","menu","reset","submit"]),wa={}.hasOwnProperty;function vl(e,t,n){const r=n&&JE(n);function i(a,s,...o){let u=-1,c;if(a==null){c={type:"root",children:[]};const d=s;o.unshift(d)}else if(c=YE(a,t),c.tagName=c.tagName.toLowerCase(),r&&wa.call(r,c.tagName)&&(c.tagName=r[c.tagName]),XE(s,c.tagName)){let d;for(d in s)wa.call(s,d)&&QE(e,c.properties,d,s[d])}else o.unshift(s);for(;++u<o.length;)va(c.children,o[u]);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return i}function XE(e,t){return e==null||typeof e!="object"||Array.isArray(e)?!1:t==="input"||!e.type||typeof e.type!="string"?!0:"children"in e&&Array.isArray(e.children)?!1:t==="button"?qE.has(e.type.toLowerCase()):!("value"in e)}function QE(e,t,n,r){const i=ri(e,n);let a=-1,s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=_o(r):i.commaSeparated?s=go(r):i.commaOrSpaceSeparated?s=_o(go(r).join(" ")):s=eu(i,i.property,r):Array.isArray(r)?s=r.concat():s=i.property==="style"?KE(r):String(r);if(Array.isArray(s)){const o=[];for(;++a<s.length;){const u=eu(i,i.property,s[a]);o[a]=u}s=o}if(i.property==="className"&&Array.isArray(t.className)){const o=s;s=t.className.concat(o)}t[i.property]=s}}function va(e,t){let n=-1;if(t!=null)if(typeof t=="string"||typeof t=="number")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(;++n<t.length;)va(e,t[n]);else if(typeof t=="object"&&"type"in t)t.type==="root"?va(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function eu(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||nr(n)===nr(t)))return!0}return n}function KE(e){const t=[];let n;for(n in e)wa.call(e,n)&&t.push([n,e[n]].join(": "));return t.join("; ")}function JE(e){const t={};let n=-1;for(;++n<e.length;)t[e[n].toLowerCase()]=e[n];return t}const ZE=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],e1=vl(fr,"div"),t1=vl(Jt,"g",ZE);function n1(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let o=n[s];if(o===void 0){const u=tu(t,n[s-1]);o=u===-1?t.length+1:u+1,n[s]=o}if(o>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const o=n[n.length-1],u=tu(t,o),c=u===-1?t.length+1:u+1;if(o===c)break;n.push(c)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function tu(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
61
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const sn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kl={}.hasOwnProperty,r1=Object.prototype;function i1(e,t){const n=t||{};return gs({file:n.file||void 0,location:!1,schema:n.space==="svg"?Jt:fr,verbose:n.verbose||!1},e)}function gs(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Dr(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Nl(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),s=n1(a),o=s.toPoint(0),u=s.toPoint(a.length);n.position={start:o,end:u}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Dr(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Dr(e,r,n),n}default:return n=a1(e,t),n}}function Nl(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=gs(e,t[n]);r.push(i)}return r}function a1(e,t){const n=e.schema;e.schema=t.namespaceURI===sn.svg?Jt:fr;let r=-1;const i={};for(;++r<t.attrs.length;){const o=t.attrs[r],u=(o.prefix?o.prefix+":":"")+o.name;kl.call(r1,u)||(i[u]=o.value)}const s=(e.schema.space==="svg"?t1:e1)(t.tagName,i,Nl(e,t.childNodes));if(Dr(e,t,s),s.tagName==="template"){const o=t,u=o.sourceCodeLocation,c=u&&u.startTag&&Cn(u.startTag),d=u&&u.endTag&&Cn(u.endTag),f=gs(e,o.content);c&&d&&e.file&&(f.position={start:c.end,end:d.start}),s.content=f}return e.schema=n,s}function Dr(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=s1(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function s1(e,t,n){const r=Cn(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)kl.call(n.attrs,s)&&(a[ri(e.schema,s).property]=Cn(n.attrs[s]));n.startTag;const o=Cn(n.startTag),u=n.endTag?Cn(n.endTag):void 0,c={opening:o};u&&(c.closing=u),c.properties=a,t.data={position:c}}}return r}function Cn(e){const t=nu({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=nu({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function nu(e){return e.line&&e.column?e:void 0}const ru={}.hasOwnProperty;function Rl(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const o=r.handlers;if(i&&ru.call(i,e)){const u=String(i[e]);s=ru.call(o,u)?o[u]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const o1={},u1={}.hasOwnProperty,Ol=Rl("type",{handlers:{root:l1,element:p1,text:h1,comment:m1,doctype:f1}});function c1(e,t){const r=(t||o1).space;return Ol(e,r==="svg"?Jt:fr)}function l1(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=bs(e.children,n,t),Dn(e,n),n}function d1(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=bs(e.children,n,t),Dn(e,n),n}function f1(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Dn(e,t),t}function h1(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Dn(e,t),t}function m1(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Dn(e,t),t}function p1(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Jt);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&u1.call(e.properties,a)){const u=g1(r,a,e.properties[a]);u&&i.push(u)}}const s=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:sn[s],childNodes:[],parentNode:null};return o.childNodes=bs(e.children,o,r),Dn(e,o),e.tagName==="template"&&e.content&&(o.content=d1(e.content,r)),o}function g1(e,t,n){const r=ri(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Wc(n):el(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=sn[r.space]}return i}function bs(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=Ol(e[r],n);a.parentNode=t,i.push(a)}return i}function Dn(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const b1=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],E1=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ve="�";var T;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(T||(T={}));const st={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Ll(e){return e>=55296&&e<=57343}function T1(e){return e>=56320&&e<=57343}function y1(e,t){return(e-55296)*1024+9216+t}function Dl(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Pl(e){return e>=64976&&e<=65007||E1.has(e)}var D;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(D||(D={}));const _1=65536;class x1{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=_1,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:a}=this,s=i+n,o=a+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(T1(n))return this.pos++,this._addGap(),y1(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(D.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;const r=this.html.charCodeAt(n);return r===T.CARRIAGE_RETURN?T.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;let t=this.html.charCodeAt(this.pos);return t===T.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,T.LINE_FEED):t===T.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Ll(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===T.LINE_FEED||t===T.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Dl(t)?this._err(D.controlCharacterInInputStream):Pl(t)&&this._err(D.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var _e;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(_e||(_e={}));function Ml(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const Bl=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),S1=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var $i;const C1=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),I1=($i=String.fromCodePoint)!==null&&$i!==void 0?$i:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function A1(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=C1.get(e))!==null&&t!==void 0?t:e}var Xe;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Xe||(Xe={}));const w1=32;var Yt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Yt||(Yt={}));function ka(e){return e>=Xe.ZERO&&e<=Xe.NINE}function v1(e){return e>=Xe.UPPER_A&&e<=Xe.UPPER_F||e>=Xe.LOWER_A&&e<=Xe.LOWER_F}function k1(e){return e>=Xe.UPPER_A&&e<=Xe.UPPER_Z||e>=Xe.LOWER_A&&e<=Xe.LOWER_Z||ka(e)}function N1(e){return e===Xe.EQUALS||k1(e)}var Ye;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ye||(Ye={}));var jt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(jt||(jt={}));class Fl{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Ye.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=jt.Strict}startEntity(t){this.decodeMode=t,this.state=Ye.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ye.EntityStart:return t.charCodeAt(n)===Xe.NUM?(this.state=Ye.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ye.NamedEntity,this.stateNamedEntity(t,n));case Ye.NumericStart:return this.stateNumericStart(t,n);case Ye.NumericDecimal:return this.stateNumericDecimal(t,n);case Ye.NumericHex:return this.stateNumericHex(t,n);case Ye.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|w1)===Xe.LOWER_X?(this.state=Ye.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ye.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+parseInt(t.substr(n,a),i),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(ka(i)||v1(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(ka(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Xe.SEMI)this.consumed+=1;else if(this.decodeMode===jt.Strict)return 0;return this.emitCodePoint(A1(this.result),this.consumed),this.errors&&(t!==Xe.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&Yt.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=R1(r,i,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===jt.Attribute&&(a===0||N1(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&Yt.VALUE_LENGTH)>>14,a!==0){if(s===Xe.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==jt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Yt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Yt.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Ye.NamedEntity:return this.result!==0&&(this.decodeMode!==jt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ye.NumericDecimal:return this.emitNumericEntity(0,2);case Ye.NumericHex:return this.emitNumericEntity(0,3);case Ye.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ye.EntityStart:return 0}}}function Ul(e){let t="";const n=new Fl(e,r=>t+=I1(r));return function(i,a){let s=0,o=0;for(;(o=i.indexOf("&",o))>=0;){t+=i.slice(s,o),n.startEntity(a);const c=n.write(i,o+1);if(c<0){s=o+n.end();break}s=o+c,o=c===0?s+1:s}const u=t+i.slice(s);return t="",u}}function R1(e,t,n,r){const i=(t&Yt.BRANCH_LENGTH)>>7,a=t&Yt.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const u=r-a;return u<0||u>=i?-1:e[n+u]-1}let s=n,o=s+i-1;for(;s<=o;){const u=s+o>>>1,c=e[u];if(c<r)s=u+1;else if(c>r)o=u-1;else return e[u+i]}return-1}Ul(Bl);Ul(S1);var F;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(F||(F={}));var un;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(un||(un={}));var Et;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Et||(Et={}));var O;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(O||(O={}));var l;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(l||(l={}));const O1=new Map([[O.A,l.A],[O.ADDRESS,l.ADDRESS],[O.ANNOTATION_XML,l.ANNOTATION_XML],[O.APPLET,l.APPLET],[O.AREA,l.AREA],[O.ARTICLE,l.ARTICLE],[O.ASIDE,l.ASIDE],[O.B,l.B],[O.BASE,l.BASE],[O.BASEFONT,l.BASEFONT],[O.BGSOUND,l.BGSOUND],[O.BIG,l.BIG],[O.BLOCKQUOTE,l.BLOCKQUOTE],[O.BODY,l.BODY],[O.BR,l.BR],[O.BUTTON,l.BUTTON],[O.CAPTION,l.CAPTION],[O.CENTER,l.CENTER],[O.CODE,l.CODE],[O.COL,l.COL],[O.COLGROUP,l.COLGROUP],[O.DD,l.DD],[O.DESC,l.DESC],[O.DETAILS,l.DETAILS],[O.DIALOG,l.DIALOG],[O.DIR,l.DIR],[O.DIV,l.DIV],[O.DL,l.DL],[O.DT,l.DT],[O.EM,l.EM],[O.EMBED,l.EMBED],[O.FIELDSET,l.FIELDSET],[O.FIGCAPTION,l.FIGCAPTION],[O.FIGURE,l.FIGURE],[O.FONT,l.FONT],[O.FOOTER,l.FOOTER],[O.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[O.FORM,l.FORM],[O.FRAME,l.FRAME],[O.FRAMESET,l.FRAMESET],[O.H1,l.H1],[O.H2,l.H2],[O.H3,l.H3],[O.H4,l.H4],[O.H5,l.H5],[O.H6,l.H6],[O.HEAD,l.HEAD],[O.HEADER,l.HEADER],[O.HGROUP,l.HGROUP],[O.HR,l.HR],[O.HTML,l.HTML],[O.I,l.I],[O.IMG,l.IMG],[O.IMAGE,l.IMAGE],[O.INPUT,l.INPUT],[O.IFRAME,l.IFRAME],[O.KEYGEN,l.KEYGEN],[O.LABEL,l.LABEL],[O.LI,l.LI],[O.LINK,l.LINK],[O.LISTING,l.LISTING],[O.MAIN,l.MAIN],[O.MALIGNMARK,l.MALIGNMARK],[O.MARQUEE,l.MARQUEE],[O.MATH,l.MATH],[O.MENU,l.MENU],[O.META,l.META],[O.MGLYPH,l.MGLYPH],[O.MI,l.MI],[O.MO,l.MO],[O.MN,l.MN],[O.MS,l.MS],[O.MTEXT,l.MTEXT],[O.NAV,l.NAV],[O.NOBR,l.NOBR],[O.NOFRAMES,l.NOFRAMES],[O.NOEMBED,l.NOEMBED],[O.NOSCRIPT,l.NOSCRIPT],[O.OBJECT,l.OBJECT],[O.OL,l.OL],[O.OPTGROUP,l.OPTGROUP],[O.OPTION,l.OPTION],[O.P,l.P],[O.PARAM,l.PARAM],[O.PLAINTEXT,l.PLAINTEXT],[O.PRE,l.PRE],[O.RB,l.RB],[O.RP,l.RP],[O.RT,l.RT],[O.RTC,l.RTC],[O.RUBY,l.RUBY],[O.S,l.S],[O.SCRIPT,l.SCRIPT],[O.SEARCH,l.SEARCH],[O.SECTION,l.SECTION],[O.SELECT,l.SELECT],[O.SOURCE,l.SOURCE],[O.SMALL,l.SMALL],[O.SPAN,l.SPAN],[O.STRIKE,l.STRIKE],[O.STRONG,l.STRONG],[O.STYLE,l.STYLE],[O.SUB,l.SUB],[O.SUMMARY,l.SUMMARY],[O.SUP,l.SUP],[O.TABLE,l.TABLE],[O.TBODY,l.TBODY],[O.TEMPLATE,l.TEMPLATE],[O.TEXTAREA,l.TEXTAREA],[O.TFOOT,l.TFOOT],[O.TD,l.TD],[O.TH,l.TH],[O.THEAD,l.THEAD],[O.TITLE,l.TITLE],[O.TR,l.TR],[O.TRACK,l.TRACK],[O.TT,l.TT],[O.U,l.U],[O.UL,l.UL],[O.SVG,l.SVG],[O.VAR,l.VAR],[O.WBR,l.WBR],[O.XMP,l.XMP]]);function Pn(e){var t;return(t=O1.get(e))!==null&&t!==void 0?t:l.UNKNOWN}const U=l,L1={[F.HTML]:new Set([U.ADDRESS,U.APPLET,U.AREA,U.ARTICLE,U.ASIDE,U.BASE,U.BASEFONT,U.BGSOUND,U.BLOCKQUOTE,U.BODY,U.BR,U.BUTTON,U.CAPTION,U.CENTER,U.COL,U.COLGROUP,U.DD,U.DETAILS,U.DIR,U.DIV,U.DL,U.DT,U.EMBED,U.FIELDSET,U.FIGCAPTION,U.FIGURE,U.FOOTER,U.FORM,U.FRAME,U.FRAMESET,U.H1,U.H2,U.H3,U.H4,U.H5,U.H6,U.HEAD,U.HEADER,U.HGROUP,U.HR,U.HTML,U.IFRAME,U.IMG,U.INPUT,U.LI,U.LINK,U.LISTING,U.MAIN,U.MARQUEE,U.MENU,U.META,U.NAV,U.NOEMBED,U.NOFRAMES,U.NOSCRIPT,U.OBJECT,U.OL,U.P,U.PARAM,U.PLAINTEXT,U.PRE,U.SCRIPT,U.SECTION,U.SELECT,U.SOURCE,U.STYLE,U.SUMMARY,U.TABLE,U.TBODY,U.TD,U.TEMPLATE,U.TEXTAREA,U.TFOOT,U.TH,U.THEAD,U.TITLE,U.TR,U.TRACK,U.UL,U.WBR,U.XMP]),[F.MATHML]:new Set([U.MI,U.MO,U.MN,U.MS,U.MTEXT,U.ANNOTATION_XML]),[F.SVG]:new Set([U.TITLE,U.FOREIGN_OBJECT,U.DESC]),[F.XLINK]:new Set,[F.XML]:new Set,[F.XMLNS]:new Set},Na=new Set([U.H1,U.H2,U.H3,U.H4,U.H5,U.H6]);O.STYLE,O.SCRIPT,O.XMP,O.IFRAME,O.NOEMBED,O.NOFRAMES,O.PLAINTEXT;var _;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(_||(_={}));const $e={DATA:_.DATA,RCDATA:_.RCDATA,RAWTEXT:_.RAWTEXT,SCRIPT_DATA:_.SCRIPT_DATA,PLAINTEXT:_.PLAINTEXT,CDATA_SECTION:_.CDATA_SECTION};function D1(e){return e>=T.DIGIT_0&&e<=T.DIGIT_9}function Wn(e){return e>=T.LATIN_CAPITAL_A&&e<=T.LATIN_CAPITAL_Z}function P1(e){return e>=T.LATIN_SMALL_A&&e<=T.LATIN_SMALL_Z}function Wt(e){return P1(e)||Wn(e)}function iu(e){return Wt(e)||D1(e)}function wr(e){return e+32}function Hl(e){return e===T.SPACE||e===T.LINE_FEED||e===T.TABULATION||e===T.FORM_FEED}function au(e){return Hl(e)||e===T.SOLIDUS||e===T.GREATER_THAN_SIGN}function M1(e){return e===T.NULL?D.nullCharacterReference:e>1114111?D.characterReferenceOutsideUnicodeRange:Ll(e)?D.surrogateCharacterReference:Pl(e)?D.noncharacterCharacterReference:Dl(e)||e===T.CARRIAGE_RETURN?D.controlCharacterReference:null}class B1{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=_.DATA,this.returnState=_.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new x1(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Fl(Bl,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(D.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(D.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=M1(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:_e.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:_e.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:_e.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:_e.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Ml(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(D.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Pn(t.tagName),t.type===_e.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(D.endTagWithAttributes),t.selfClosing&&this._err(D.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case _e.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case _e.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case _e.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:_e.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Hl(t)?_e.WHITESPACE_CHARACTER:t===T.NULL?_e.NULL_CHARACTER:_e.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(_e.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=_.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?jt.Attribute:jt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===_.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===_.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===_.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case _.DATA:{this._stateData(t);break}case _.RCDATA:{this._stateRcdata(t);break}case _.RAWTEXT:{this._stateRawtext(t);break}case _.SCRIPT_DATA:{this._stateScriptData(t);break}case _.PLAINTEXT:{this._statePlaintext(t);break}case _.TAG_OPEN:{this._stateTagOpen(t);break}case _.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case _.TAG_NAME:{this._stateTagName(t);break}case _.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case _.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case _.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case _.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case _.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case _.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case _.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case _.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case _.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case _.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case _.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case _.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case _.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case _.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case _.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case _.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case _.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case _.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case _.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case _.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case _.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case _.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case _.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case _.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case _.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case _.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case _.BOGUS_COMMENT:{this._stateBogusComment(t);break}case _.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case _.COMMENT_START:{this._stateCommentStart(t);break}case _.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case _.COMMENT:{this._stateComment(t);break}case _.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case _.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case _.COMMENT_END:{this._stateCommentEnd(t);break}case _.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case _.DOCTYPE:{this._stateDoctype(t);break}case _.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case _.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case _.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case _.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case _.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case _.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case _.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case _.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case _.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case _.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case _.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case _.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case _.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case _.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case _.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case _.CDATA_SECTION:{this._stateCdataSection(t);break}case _.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case _.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case _.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case _.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=_.TAG_OPEN;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitCodePoint(t);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case T.AMPERSAND:{this._startCharacterReference();break}case T.LESS_THAN_SIGN:{this.state=_.RCDATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case T.LESS_THAN_SIGN:{this.state=_.RAWTEXT_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Wt(t))this._createStartTagToken(),this.state=_.TAG_NAME,this._stateTagName(t);else switch(t){case T.EXCLAMATION_MARK:{this.state=_.MARKUP_DECLARATION_OPEN;break}case T.SOLIDUS:{this.state=_.END_TAG_OPEN;break}case T.QUESTION_MARK:{this._err(D.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t);break}case T.EOF:{this._err(D.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=_.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Wt(t))this._createEndTagToken(),this.state=_.TAG_NAME,this._stateTagName(t);else switch(t){case T.GREATER_THAN_SIGN:{this._err(D.missingEndTagName),this.state=_.DATA;break}case T.EOF:{this._err(D.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this.state=_.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.tagName+=Ve;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Wn(t)?wr(t):t)}}_stateRcdataLessThanSign(t){t===T.SOLIDUS?this.state=_.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=_.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Wt(t)?(this.state=_.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=_.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=_.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=_.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=_.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===T.SOLIDUS?this.state=_.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Wt(t)?(this.state=_.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case T.SOLIDUS:{this.state=_.SCRIPT_DATA_END_TAG_OPEN;break}case T.EXCLAMATION_MARK:{this.state=_.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=_.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Wt(t)?(this.state=_.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===T.HYPHEN_MINUS?(this.state=_.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===T.HYPHEN_MINUS?(this.state=_.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_ESCAPED,this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.GREATER_THAN_SIGN:{this.state=_.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_ESCAPED,this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===T.SOLIDUS?this.state=_.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Wt(t)?(this._emitChars("<"),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Wt(t)?(this.state=_.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(st.SCRIPT,!1)&&au(this.preprocessor.peek(st.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<st.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.GREATER_THAN_SIGN:{this.state=_.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===T.SOLIDUS?(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(st.SCRIPT,!1)&&au(this.preprocessor.peek(st.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<st.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=_.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this.state=_.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._err(D.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=_.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=_.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this._leaveAttrName(),this.state=_.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._leaveAttrName(),this.state=_.BEFORE_ATTRIBUTE_VALUE;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:{this._err(D.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.name+=Ve;break}default:this.currentAttr.name+=String.fromCodePoint(Wn(t)?wr(t):t)}}_stateAfterAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:{this.state=_.SELF_CLOSING_START_TAG;break}case T.EQUALS_SIGN:{this.state=_.BEFORE_ATTRIBUTE_VALUE;break}case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=_.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{this.state=_.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this.state=_.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingAttributeValue),this.state=_.DATA,this.emitCurrentTagToken();break}default:this.state=_.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case T.QUOTATION_MARK:{this.state=_.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Ve;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case T.APOSTROPHE:{this.state=_.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Ve;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=_.BEFORE_ATTRIBUTE_NAME;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=_.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Ve;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:{this._err(D.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=_.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this._leaveAttrValue(),this.state=_.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=_.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBetweenAttributes),this.state=_.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case T.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=_.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.unexpectedSolidusInTag),this.state=_.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentComment(n);break}case T.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.data+=Ve;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(st.DASH_DASH,!0)?(this._createCommentToken(st.DASH_DASH.length+1),this.state=_.COMMENT_START):this._consumeSequenceIfMatch(st.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(st.DOCTYPE.length+1),this.state=_.DOCTYPE):this._consumeSequenceIfMatch(st.CDATA_START,!0)?this.inForeignNode?this.state=_.CDATA_SECTION:(this._err(D.cdataInHtmlContent),this._createCommentToken(st.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=_.BOGUS_COMMENT):this._ensureHibernation()||(this._err(D.incorrectlyOpenedComment),this._createCommentToken(2),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.COMMENT_START_DASH;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=_.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=_.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=_.COMMENT_END;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=_.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=_.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=_.COMMENT_END_DASH;break}case T.LESS_THAN_SIGN:{n.data+="<",this.state=_.COMMENT_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.data+=Ve;break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case T.EXCLAMATION_MARK:{n.data+="!",this.state=_.COMMENT_LESS_THAN_SIGN_BANG;break}case T.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=_.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===T.HYPHEN_MINUS?this.state=_.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=_.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===T.HYPHEN_MINUS?this.state=_.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=_.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==T.GREATER_THAN_SIGN&&t!==T.EOF&&this._err(D.nestedComment),this.state=_.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=_.COMMENT_END;break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=_.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentComment(n);break}case T.EXCLAMATION_MARK:{this.state=_.COMMENT_END_BANG;break}case T.HYPHEN_MINUS:{n.data+="-";break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=_.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{n.data+="--!",this.state=_.COMMENT_END_DASH;break}case T.GREATER_THAN_SIGN:{this._err(D.incorrectlyClosedComment),this.state=_.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=_.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=_.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case T.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBeforeDoctypeName),this.state=_.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Wn(t))this._createDoctypeToken(String.fromCharCode(wr(t))),this.state=_.DOCTYPE_NAME;else switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.NULL:{this._err(D.unexpectedNullCharacter),this._createDoctypeToken(Ve),this.state=_.DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=_.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.AFTER_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.name+=Ve;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Wn(t)?wr(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(st.PUBLIC,!1)?this.state=_.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(st.SYSTEM,!1)?this.state=_.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(D.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=_.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.publicId+=Ve;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case T.APOSTROPHE:{this.state=_.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.publicId+=Ve;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.QUOTATION_MARK:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=_.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.systemId+=Ve;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case T.APOSTROPHE:{this.state=_.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.systemId+=Ve;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.NULL:{this._err(D.unexpectedNullCharacter);break}case T.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case T.RIGHT_SQUARE_BRACKET:{this.state=_.CDATA_SECTION_BRACKET;break}case T.EOF:{this._err(D.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===T.RIGHT_SQUARE_BRACKET?this.state=_.CDATA_SECTION_END:(this._emitChars("]"),this.state=_.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case T.GREATER_THAN_SIGN:{this.state=_.DATA;break}case T.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=_.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(T.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&iu(this.preprocessor.peek(1))?_.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){iu(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===T.SEMICOLON&&this._err(D.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const jl=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),su=new Set([...jl,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),Hr=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),F1=new Set([...Hr,l.OL,l.UL]),U1=new Set([...Hr,l.BUTTON]),ou=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),uu=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),H1=new Set([l.TR,l.TEMPLATE,l.HTML]),j1=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),V1=new Set([l.TABLE,l.TEMPLATE,l.HTML]),z1=new Set([l.TD,l.TH]);class $1{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=l.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===F.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==F.HTML);this.shortenToLength(n<0?0:n)}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(n<0?0:n)}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r<0?0:r)}popUntilNumberedHeaderPopped(){this.popUntilPopped(Na,F.HTML)}popUntilTableCellPopped(){this.popUntilPopped(z1,F.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(V1,F.HTML)}clearBackToTableBodyContext(){this.clearBackTo(j1,F.HTML)}clearBackToTableRowContext(){this.clearBackTo(H1,F.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===l.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===l.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case F.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case F.SVG:{if(uu.has(i))return!1;break}case F.MATHML:{if(ou.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Hr)}hasInListItemScope(t){return this.hasInDynamicScope(t,F1)}hasInButtonScope(t){return this.hasInDynamicScope(t,U1)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case F.HTML:{if(Na.has(n))return!0;if(Hr.has(n))return!1;break}case F.SVG:{if(uu.has(n))return!1;break}case F.MATHML:{if(ou.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===F.HTML)switch(this.tagIDs[n]){case t:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===F.HTML)switch(this.tagIDs[t]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===F.HTML)switch(this.tagIDs[n]){case t:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;jl.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;su.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==t&&su.has(this.currentTagId);)this.pop()}}const Wi=3;var Ot;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ot||(Ot={}));const cu={type:Ot.Marker};class W1{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===Ot.Marker)break;const{element:c}=u;if(this.treeAdapter.getTagName(c)===a&&this.treeAdapter.getNamespaceURI(c)===s){const d=this.treeAdapter.getAttrList(c);d.length===i&&r.push({idx:o,attrs:d})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Wi)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Wi)return;const i=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const o=r[s];o.attrs.every(u=>i.get(u.name)===u.value)&&(a+=1,a>=Wi&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(cu)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ot.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ot.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n>=0&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(cu);t>=0?this.entries.splice(0,t+1):this.entries.length=0}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ot.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ot.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ot.Element&&n.element===t)}}const Gt={createDocument(){return{nodeName:"#document",mode:Et.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Gt.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Gt.isTextNode(n)){n.value+=t;return}}Gt.appendChild(e,Gt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Gt.isTextNode(r)?r.value+=t:Gt.insertBefore(e,Gt.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Vl="html",G1="about:legacy-compat",Y1="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",zl=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],q1=[...zl,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],X1=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),$l=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Q1=[...$l,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function lu(e,t){return t.some(n=>e.startsWith(n))}function K1(e){return e.name===Vl&&e.publicId===null&&(e.systemId===null||e.systemId===G1)}function J1(e){if(e.name!==Vl)return Et.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Y1)return Et.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),X1.has(n))return Et.QUIRKS;let r=t===null?q1:zl;if(lu(n,r))return Et.QUIRKS;if(r=t===null?$l:Q1,lu(n,r))return Et.LIMITED_QUIRKS}return Et.NO_QUIRKS}const du={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Z1="definitionurl",eT="definitionURL",tT=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),nT=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:F.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:F.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:F.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:F.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:F.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:F.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:F.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:F.XML}],["xml:space",{prefix:"xml",name:"space",namespace:F.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:F.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:F.XMLNS}]]),rT=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),iT=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function aT(e){const t=e.tagID;return t===l.FONT&&e.attrs.some(({name:r})=>r===un.COLOR||r===un.SIZE||r===un.FACE)||iT.has(t)}function Wl(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Z1){e.attrs[t].name=eT;break}}function Gl(e){for(let t=0;t<e.attrs.length;t++){const n=tT.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Es(e){for(let t=0;t<e.attrs.length;t++){const n=nT.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function sT(e){const t=rT.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Pn(e.tagName))}function oT(e,t){return t===F.MATHML&&(e===l.MI||e===l.MO||e===l.MN||e===l.MS||e===l.MTEXT)}function uT(e,t,n){if(t===F.MATHML&&e===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===un.ENCODING){const i=n[r].value.toLowerCase();return i===du.TEXT_HTML||i===du.APPLICATION_XML}}return t===F.SVG&&(e===l.FOREIGN_OBJECT||e===l.DESC||e===l.TITLE)}function cT(e,t,n,r){return(!r||r===F.HTML)&&uT(e,t,n)||(!r||r===F.MATHML)&&oT(e,t)}const lT="hidden",dT=8,fT=3;var C;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(C||(C={}));const hT={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Yl=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),fu={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Gt,onParseError:null};class hu{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=C.INITIAL,this.originalInsertionMode=C.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...fu,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new B1(this.options,this),this.activeFormattingElements=new W1(this.treeAdapter),this.fragmentContextID=r?Pn(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new $1(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...fu,...n};t??(t=r.treeAdapter.createElement(O.TEMPLATE,F.HTML,[]));const i=r.treeAdapter.createElement("documentmock",F.HTML,[]),a=new this(r,i,t);return a.fragmentContextID===l.TEMPLATE&&a.tmplInsertionModeStack.unshift(C.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const a=(i=t.location)!==null&&i!==void 0?i:hT,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(t,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(t,n){const r=t===this.document||this.treeAdapter.getNamespaceURI(t)===F.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,F.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=C.TEXT}switchToPlaintextParsing(){this.insertionMode=C.TEXT,this.originalInsertionMode=C.IN_BODY,this.tokenizer.state=$e.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===O.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==F.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=$e.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=$e.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=$e.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=$e.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,F.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,F.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(O.HTML,F.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,l.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:u,endCol:c,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:u,endCol:c,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),a=n.type===_e.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===l.SVG&&this.treeAdapter.getTagName(n)===O.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===F.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===l.MGLYPH||t.tagID===l.MALIGNMARK)&&!this._isIntegrationPoint(r,n,F.HTML)}_processToken(t){switch(t.type){case _e.CHARACTER:{this.onCharacter(t);break}case _e.NULL_CHARACTER:{this.onNullCharacter(t);break}case _e.COMMENT:{this.onComment(t);break}case _e.DOCTYPE:{this.onDoctype(t);break}case _e.START_TAG:{this._processStartTag(t);break}case _e.END_TAG:{this.onEndTag(t);break}case _e.EOF:{this.onEof(t);break}case _e.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return cT(t,i,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Ot.Marker||this.openElements.contains(i.element)),r=n<0?t-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=C.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case l.TR:{this.insertionMode=C.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=C.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=C.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=C.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=C.IN_TABLE;return}case l.BODY:{this.insertionMode=C.IN_BODY;return}case l.FRAMESET:{this.insertionMode=C.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(t);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?C.AFTER_HEAD:C.BEFORE_HEAD;return}case l.TD:case l.TH:{if(t>0){this.insertionMode=C.IN_CELL;return}break}case l.HEAD:{if(t>0){this.insertionMode=C.IN_HEAD;return}break}}this.insertionMode=C.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=C.IN_SELECT_IN_TABLE;return}}this.insertionMode=C.IN_SELECT}_isElementCausesFosterParenting(t){return Yl.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===F.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return L1[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){zy(this,t);return}switch(this.insertionMode){case C.INITIAL:{jn(this,t);break}case C.BEFORE_HTML:{Qn(this,t);break}case C.BEFORE_HEAD:{Kn(this,t);break}case C.IN_HEAD:{Jn(this,t);break}case C.IN_HEAD_NO_SCRIPT:{Zn(this,t);break}case C.AFTER_HEAD:{er(this,t);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:{Xl(this,t);break}case C.TEXT:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Gi(this,t);break}case C.IN_TABLE_TEXT:{td(this,t);break}case C.IN_COLUMN_GROUP:{jr(this,t);break}case C.AFTER_BODY:{Vr(this,t);break}case C.AFTER_AFTER_BODY:{Pr(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Vy(this,t);return}switch(this.insertionMode){case C.INITIAL:{jn(this,t);break}case C.BEFORE_HTML:{Qn(this,t);break}case C.BEFORE_HEAD:{Kn(this,t);break}case C.IN_HEAD:{Jn(this,t);break}case C.IN_HEAD_NO_SCRIPT:{Zn(this,t);break}case C.AFTER_HEAD:{er(this,t);break}case C.TEXT:{this._insertCharacters(t);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Gi(this,t);break}case C.IN_COLUMN_GROUP:{jr(this,t);break}case C.AFTER_BODY:{Vr(this,t);break}case C.AFTER_AFTER_BODY:{Pr(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Ra(this,t);return}switch(this.insertionMode){case C.INITIAL:case C.BEFORE_HTML:case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_TEMPLATE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{Ra(this,t);break}case C.IN_TABLE_TEXT:{Vn(this,t);break}case C.AFTER_BODY:{yT(this,t);break}case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{_T(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case C.INITIAL:{xT(this,t);break}case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:{this._err(t,D.misplacedDoctype);break}case C.IN_TABLE_TEXT:{Vn(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,D.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?$y(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case C.INITIAL:{jn(this,t);break}case C.BEFORE_HTML:{ST(this,t);break}case C.BEFORE_HEAD:{IT(this,t);break}case C.IN_HEAD:{wt(this,t);break}case C.IN_HEAD_NO_SCRIPT:{vT(this,t);break}case C.AFTER_HEAD:{NT(this,t);break}case C.IN_BODY:{Ze(this,t);break}case C.IN_TABLE:{Nn(this,t);break}case C.IN_TABLE_TEXT:{Vn(this,t);break}case C.IN_CAPTION:{Ay(this,t);break}case C.IN_COLUMN_GROUP:{_s(this,t);break}case C.IN_TABLE_BODY:{hi(this,t);break}case C.IN_ROW:{mi(this,t);break}case C.IN_CELL:{ky(this,t);break}case C.IN_SELECT:{id(this,t);break}case C.IN_SELECT_IN_TABLE:{Ry(this,t);break}case C.IN_TEMPLATE:{Ly(this,t);break}case C.AFTER_BODY:{Py(this,t);break}case C.IN_FRAMESET:{My(this,t);break}case C.AFTER_FRAMESET:{Fy(this,t);break}case C.AFTER_AFTER_BODY:{Hy(this,t);break}case C.AFTER_AFTER_FRAMESET:{jy(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Wy(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case C.INITIAL:{jn(this,t);break}case C.BEFORE_HTML:{CT(this,t);break}case C.BEFORE_HEAD:{AT(this,t);break}case C.IN_HEAD:{wT(this,t);break}case C.IN_HEAD_NO_SCRIPT:{kT(this,t);break}case C.AFTER_HEAD:{RT(this,t);break}case C.IN_BODY:{fi(this,t);break}case C.TEXT:{gy(this,t);break}case C.IN_TABLE:{ir(this,t);break}case C.IN_TABLE_TEXT:{Vn(this,t);break}case C.IN_CAPTION:{wy(this,t);break}case C.IN_COLUMN_GROUP:{vy(this,t);break}case C.IN_TABLE_BODY:{Oa(this,t);break}case C.IN_ROW:{rd(this,t);break}case C.IN_CELL:{Ny(this,t);break}case C.IN_SELECT:{ad(this,t);break}case C.IN_SELECT_IN_TABLE:{Oy(this,t);break}case C.IN_TEMPLATE:{Dy(this,t);break}case C.AFTER_BODY:{od(this,t);break}case C.IN_FRAMESET:{By(this,t);break}case C.AFTER_FRAMESET:{Uy(this,t);break}case C.AFTER_AFTER_BODY:{Pr(this,t);break}}}onEof(t){switch(this.insertionMode){case C.INITIAL:{jn(this,t);break}case C.BEFORE_HTML:{Qn(this,t);break}case C.BEFORE_HEAD:{Kn(this,t);break}case C.IN_HEAD:{Jn(this,t);break}case C.IN_HEAD_NO_SCRIPT:{Zn(this,t);break}case C.AFTER_HEAD:{er(this,t);break}case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{Zl(this,t);break}case C.TEXT:{by(this,t);break}case C.IN_TABLE_TEXT:{Vn(this,t);break}case C.IN_TEMPLATE:{sd(this,t);break}case C.AFTER_BODY:case C.IN_FRAMESET:case C.AFTER_FRAMESET:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{ys(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===T.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.TEXT:case C.IN_COLUMN_GROUP:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{this._insertCharacters(t);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:case C.AFTER_BODY:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{ql(this,t);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Gi(this,t);break}case C.IN_TABLE_TEXT:{ed(this,t);break}}}}function mT(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Jl(e,t),n}function pT(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(r<0?0:r),e.activeFormattingElements.removeEntry(t)),n}function gT(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,s=i;s!==n;a++,s=i){i=e.openElements.getCommonAncestor(s);const o=e.activeFormattingElements.getElementEntry(s),u=o&&a>=fT;!o||u?(u&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(s)):(s=bT(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function bT(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function ET(e,t,n){const r=e.treeAdapter.getTagName(t),i=Pn(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);i===l.TEMPLATE&&a===F.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function TT(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Ts(e,t){for(let n=0;n<dT;n++){const r=mT(e,t);if(!r)break;const i=pT(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=gT(e,i,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),s&&ET(e,s,a),TT(e,i,r)}}function Ra(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function yT(e,t){e._appendCommentNode(t,e.openElements.items[0])}function _T(e,t){e._appendCommentNode(t,e.document)}function ys(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&e._setEndLocation(a,t)}}}}function xT(e,t){e._setDocumentType(t);const n=t.forceQuirks?Et.QUIRKS:J1(t);K1(t)||e._err(t,D.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=C.BEFORE_HTML}function jn(e,t){e._err(t,D.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Et.QUIRKS),e.insertionMode=C.BEFORE_HTML,e._processToken(t)}function ST(e,t){t.tagID===l.HTML?(e._insertElement(t,F.HTML),e.insertionMode=C.BEFORE_HEAD):Qn(e,t)}function CT(e,t){const n=t.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&Qn(e,t)}function Qn(e,t){e._insertFakeRootElement(),e.insertionMode=C.BEFORE_HEAD,e._processToken(t)}function IT(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.HEAD:{e._insertElement(t,F.HTML),e.headElement=e.openElements.current,e.insertionMode=C.IN_HEAD;break}default:Kn(e,t)}}function AT(e,t){const n=t.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?Kn(e,t):e._err(t,D.endTagWithoutMatchingOpenElement)}function Kn(e,t){e._insertFakeElement(O.HEAD,l.HEAD),e.headElement=e.openElements.current,e.insertionMode=C.IN_HEAD,e._processToken(t)}function wt(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{e._appendElement(t,F.HTML),t.ackSelfClosing=!0;break}case l.TITLE:{e._switchToTextParsing(t,$e.RCDATA);break}case l.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$e.RAWTEXT):(e._insertElement(t,F.HTML),e.insertionMode=C.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{e._switchToTextParsing(t,$e.RAWTEXT);break}case l.SCRIPT:{e._switchToTextParsing(t,$e.SCRIPT_DATA);break}case l.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=C.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(C.IN_TEMPLATE);break}case l.HEAD:{e._err(t,D.misplacedStartTagForHeadElement);break}default:Jn(e,t)}}function wT(e,t){switch(t.tagID){case l.HEAD:{e.openElements.pop(),e.insertionMode=C.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{Jn(e,t);break}case l.TEMPLATE:{gn(e,t);break}default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function gn(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==l.TEMPLATE&&e._err(t,D.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,D.endTagWithoutMatchingOpenElement)}function Jn(e,t){e.openElements.pop(),e.insertionMode=C.AFTER_HEAD,e._processToken(t)}function vT(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{wt(e,t);break}case l.NOSCRIPT:{e._err(t,D.nestedNoscriptInHead);break}default:Zn(e,t)}}function kT(e,t){switch(t.tagID){case l.NOSCRIPT:{e.openElements.pop(),e.insertionMode=C.IN_HEAD;break}case l.BR:{Zn(e,t);break}default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function Zn(e,t){const n=t.type===_e.EOF?D.openElementsLeftAfterEof:D.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=C.IN_HEAD,e._processToken(t)}function NT(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.BODY:{e._insertElement(t,F.HTML),e.framesetOk=!1,e.insertionMode=C.IN_BODY;break}case l.FRAMESET:{e._insertElement(t,F.HTML),e.insertionMode=C.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{e._err(t,D.abandonedHeadElementChild),e.openElements.push(e.headElement,l.HEAD),wt(e,t),e.openElements.remove(e.headElement);break}case l.HEAD:{e._err(t,D.misplacedStartTagForHeadElement);break}default:er(e,t)}}function RT(e,t){switch(t.tagID){case l.BODY:case l.HTML:case l.BR:{er(e,t);break}case l.TEMPLATE:{gn(e,t);break}default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function er(e,t){e._insertFakeElement(O.BODY,l.BODY),e.insertionMode=C.IN_BODY,di(e,t)}function di(e,t){switch(t.type){case _e.CHARACTER:{Xl(e,t);break}case _e.WHITESPACE_CHARACTER:{ql(e,t);break}case _e.COMMENT:{Ra(e,t);break}case _e.START_TAG:{Ze(e,t);break}case _e.END_TAG:{fi(e,t);break}case _e.EOF:{Zl(e,t);break}}}function ql(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Xl(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function OT(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function LT(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function DT(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_FRAMESET)}function PT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML)}function MT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),Na.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,F.HTML)}function BT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function FT(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML),n||(e.formElement=e.openElements.current))}function UT(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===l.LI&&i===l.LI||(n===l.DD||n===l.DT)&&(i===l.DD||i===l.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==l.ADDRESS&&i!==l.DIV&&i!==l.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML)}function HT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML),e.tokenizer.state=$e.PLAINTEXT}function jT(e,t){e.openElements.hasInScope(l.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.framesetOk=!1}function VT(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(O.A);n&&(Ts(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function $T(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(l.NOBR)&&(Ts(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,F.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function WT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function GT(e,t){e.treeAdapter.getDocumentMode(e.document)!==Et.QUIRKS&&e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML),e.framesetOk=!1,e.insertionMode=C.IN_TABLE}function Ql(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,F.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Kl(e){const t=Ml(e,un.TYPE);return t!=null&&t.toLowerCase()===lT}function YT(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,F.HTML),Kl(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function qT(e,t){e._appendElement(t,F.HTML),t.ackSelfClosing=!0}function XT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._appendElement(t,F.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function QT(e,t){t.tagName=O.IMG,t.tagID=l.IMG,Ql(e,t)}function KT(e,t){e._insertElement(t,F.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$e.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=C.TEXT}function JT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$e.RAWTEXT)}function ZT(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$e.RAWTEXT)}function mu(e,t){e._switchToTextParsing(t,$e.RAWTEXT)}function ey(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===C.IN_TABLE||e.insertionMode===C.IN_CAPTION||e.insertionMode===C.IN_TABLE_BODY||e.insertionMode===C.IN_ROW||e.insertionMode===C.IN_CELL?C.IN_SELECT_IN_TABLE:C.IN_SELECT}function ty(e,t){e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML)}function ny(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,F.HTML)}function ry(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(l.RTC),e._insertElement(t,F.HTML)}function iy(e,t){e._reconstructActiveFormattingElements(),Wl(t),Es(t),t.selfClosing?e._appendElement(t,F.MATHML):e._insertElement(t,F.MATHML),t.ackSelfClosing=!0}function ay(e,t){e._reconstructActiveFormattingElements(),Gl(t),Es(t),t.selfClosing?e._appendElement(t,F.SVG):e._insertElement(t,F.SVG),t.ackSelfClosing=!0}function pu(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML)}function Ze(e,t){switch(t.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{zT(e,t);break}case l.A:{VT(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{MT(e,t);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{PT(e,t);break}case l.LI:case l.DD:case l.DT:{UT(e,t);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{Ql(e,t);break}case l.HR:{XT(e,t);break}case l.RB:case l.RTC:{ny(e,t);break}case l.RT:case l.RP:{ry(e,t);break}case l.PRE:case l.LISTING:{BT(e,t);break}case l.XMP:{JT(e,t);break}case l.SVG:{ay(e,t);break}case l.HTML:{OT(e,t);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{wt(e,t);break}case l.BODY:{LT(e,t);break}case l.FORM:{FT(e,t);break}case l.NOBR:{$T(e,t);break}case l.MATH:{iy(e,t);break}case l.TABLE:{GT(e,t);break}case l.INPUT:{YT(e,t);break}case l.PARAM:case l.TRACK:case l.SOURCE:{qT(e,t);break}case l.IMAGE:{QT(e,t);break}case l.BUTTON:{jT(e,t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{WT(e,t);break}case l.IFRAME:{ZT(e,t);break}case l.SELECT:{ey(e,t);break}case l.OPTION:case l.OPTGROUP:{ty(e,t);break}case l.NOEMBED:case l.NOFRAMES:{mu(e,t);break}case l.FRAMESET:{DT(e,t);break}case l.TEXTAREA:{KT(e,t);break}case l.NOSCRIPT:{e.options.scriptingEnabled?mu(e,t):pu(e,t);break}case l.PLAINTEXT:{HT(e,t);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:pu(e,t)}}function sy(e,t){if(e.openElements.hasInScope(l.BODY)&&(e.insertionMode=C.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function oy(e,t){e.openElements.hasInScope(l.BODY)&&(e.insertionMode=C.AFTER_BODY,od(e,t))}function uy(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function cy(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(l.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(l.FORM):n&&e.openElements.remove(n))}function ly(e){e.openElements.hasInButtonScope(l.P)||e._insertFakeElement(O.P,l.P),e._closePElement()}function dy(e){e.openElements.hasInListItemScope(l.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(l.LI),e.openElements.popUntilTagNamePopped(l.LI))}function fy(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function hy(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function my(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function py(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(O.BR,l.BR),e.openElements.pop(),e.framesetOk=!1}function Jl(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],s=e.openElements.tagIDs[i];if(r===s&&(r!==l.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(a,s))break}}function fi(e,t){switch(t.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{Ts(e,t);break}case l.P:{ly(e);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{uy(e,t);break}case l.LI:{dy(e);break}case l.DD:case l.DT:{fy(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{hy(e);break}case l.BR:{py(e);break}case l.BODY:{sy(e,t);break}case l.HTML:{oy(e,t);break}case l.FORM:{cy(e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{my(e,t);break}case l.TEMPLATE:{gn(e,t);break}default:Jl(e,t)}}function Zl(e,t){e.tmplInsertionModeStack.length>0?sd(e,t):ys(e,t)}function gy(e,t){var n;t.tagID===l.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function by(e,t){e._err(t,D.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Gi(e,t){if(Yl.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=C.IN_TABLE_TEXT,t.type){case _e.CHARACTER:{td(e,t);break}case _e.WHITESPACE_CHARACTER:{ed(e,t);break}}else pr(e,t)}function Ey(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_CAPTION}function Ty(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_COLUMN_GROUP}function yy(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(O.COLGROUP,l.COLGROUP),e.insertionMode=C.IN_COLUMN_GROUP,_s(e,t)}function _y(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_TABLE_BODY}function xy(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(O.TBODY,l.TBODY),e.insertionMode=C.IN_TABLE_BODY,hi(e,t)}function Sy(e,t){e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Cy(e,t){Kl(t)?e._appendElement(t,F.HTML):pr(e,t),t.ackSelfClosing=!0}function Iy(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,F.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Nn(e,t){switch(t.tagID){case l.TD:case l.TH:case l.TR:{xy(e,t);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{wt(e,t);break}case l.COL:{yy(e,t);break}case l.FORM:{Iy(e,t);break}case l.TABLE:{Sy(e,t);break}case l.TBODY:case l.TFOOT:case l.THEAD:{_y(e,t);break}case l.INPUT:{Cy(e,t);break}case l.CAPTION:{Ey(e,t);break}case l.COLGROUP:{Ty(e,t);break}default:pr(e,t)}}function ir(e,t){switch(t.tagID){case l.TABLE:{e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode());break}case l.TEMPLATE:{gn(e,t);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:pr(e,t)}}function pr(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,di(e,t),e.fosterParentingEnabled=n}function ed(e,t){e.pendingCharacterTokens.push(t)}function td(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Vn(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)pr(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const nd=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function Ay(e,t){const n=t.tagID;nd.has(n)?e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=C.IN_TABLE,Nn(e,t)):Ze(e,t)}function wy(e,t){const n=t.tagID;switch(n){case l.CAPTION:case l.TABLE:{e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=C.IN_TABLE,n===l.TABLE&&ir(e,t));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:fi(e,t)}}function _s(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.COL:{e._appendElement(t,F.HTML),t.ackSelfClosing=!0;break}case l.TEMPLATE:{wt(e,t);break}default:jr(e,t)}}function vy(e,t){switch(t.tagID){case l.COLGROUP:{e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=C.IN_TABLE);break}case l.TEMPLATE:{gn(e,t);break}case l.COL:break;default:jr(e,t)}}function jr(e,t){e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=C.IN_TABLE,e._processToken(t))}function hi(e,t){switch(t.tagID){case l.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_ROW;break}case l.TH:case l.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(O.TR,l.TR),e.insertionMode=C.IN_ROW,mi(e,t);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE,Nn(e,t));break}default:Nn(e,t)}}function Oa(e,t){const n=t.tagID;switch(t.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE);break}case l.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE,ir(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:ir(e,t)}}function mi(e,t){switch(t.tagID){case l.TH:case l.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_CELL,e.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE_BODY,hi(e,t));break}default:Nn(e,t)}}function rd(e,t){switch(t.tagID){case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE_BODY);break}case l.TABLE:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE_BODY,Oa(e,t));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(l.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE_BODY,Oa(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:ir(e,t)}}function ky(e,t){const n=t.tagID;nd.has(n)?(e.openElements.hasInTableScope(l.TD)||e.openElements.hasInTableScope(l.TH))&&(e._closeTableCell(),mi(e,t)):Ze(e,t)}function Ny(e,t){const n=t.tagID;switch(n){case l.TD:case l.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=C.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),rd(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:fi(e,t)}}function id(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._insertElement(t,F.HTML);break}case l.OPTGROUP:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._insertElement(t,F.HTML);break}case l.HR:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._appendElement(t,F.HTML),t.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),t.tagID!==l.SELECT&&e._processStartTag(t));break}case l.SCRIPT:case l.TEMPLATE:{wt(e,t);break}}}function ad(e,t){switch(t.tagID){case l.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===l.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===l.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop();break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop();break}case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode());break}case l.TEMPLATE:{gn(e,t);break}}}function Ry(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e._processStartTag(t)):id(e,t)}function Oy(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e.onEndTag(t)):ad(e,t)}function Ly(e,t){switch(t.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{wt(e,t);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.tmplInsertionModeStack[0]=C.IN_TABLE,e.insertionMode=C.IN_TABLE,Nn(e,t);break}case l.COL:{e.tmplInsertionModeStack[0]=C.IN_COLUMN_GROUP,e.insertionMode=C.IN_COLUMN_GROUP,_s(e,t);break}case l.TR:{e.tmplInsertionModeStack[0]=C.IN_TABLE_BODY,e.insertionMode=C.IN_TABLE_BODY,hi(e,t);break}case l.TD:case l.TH:{e.tmplInsertionModeStack[0]=C.IN_ROW,e.insertionMode=C.IN_ROW,mi(e,t);break}default:e.tmplInsertionModeStack[0]=C.IN_BODY,e.insertionMode=C.IN_BODY,Ze(e,t)}}function Dy(e,t){t.tagID===l.TEMPLATE&&gn(e,t)}function sd(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ys(e,t)}function Py(e,t){t.tagID===l.HTML?Ze(e,t):Vr(e,t)}function od(e,t){var n;if(t.tagID===l.HTML){if(e.fragmentContext||(e.insertionMode=C.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===l.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Vr(e,t)}function Vr(e,t){e.insertionMode=C.IN_BODY,di(e,t)}function My(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.FRAMESET:{e._insertElement(t,F.HTML);break}case l.FRAME:{e._appendElement(t,F.HTML),t.ackSelfClosing=!0;break}case l.NOFRAMES:{wt(e,t);break}}}function By(e,t){t.tagID===l.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==l.FRAMESET&&(e.insertionMode=C.AFTER_FRAMESET))}function Fy(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.NOFRAMES:{wt(e,t);break}}}function Uy(e,t){t.tagID===l.HTML&&(e.insertionMode=C.AFTER_AFTER_FRAMESET)}function Hy(e,t){t.tagID===l.HTML?Ze(e,t):Pr(e,t)}function Pr(e,t){e.insertionMode=C.IN_BODY,di(e,t)}function jy(e,t){switch(t.tagID){case l.HTML:{Ze(e,t);break}case l.NOFRAMES:{wt(e,t);break}}}function Vy(e,t){t.chars=Ve,e._insertCharacters(t)}function zy(e,t){e._insertCharacters(t),e.framesetOk=!1}function ud(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==F.HTML&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function $y(e,t){if(aT(t))ud(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===F.MATHML?Wl(t):r===F.SVG&&(sT(t),Gl(t)),Es(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Wy(e,t){if(t.tagID===l.P||t.tagID===l.BR){ud(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===F.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}O.AREA,O.BASE,O.BASEFONT,O.BGSOUND,O.BR,O.COL,O.EMBED,O.FRAME,O.HR,O.IMG,O.INPUT,O.KEYGEN,O.LINK,O.META,O.PARAM,O.SOURCE,O.TRACK,O.WBR;const Gy=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),gu={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function cd(e,t){const n=n2(e),r=Rl("type",{handlers:{root:Yy,element:qy,text:Xy,comment:dd,doctype:Qy,raw:Jy},unknown:Zy}),i={parser:n?new hu(gu):hu.getFragmentParser(void 0,gu),handle(o){r(o,i)},stitches:!1,options:t||{}};r(e,i),Mn(i,Mt());const a=n?i.parser.document:i.parser.getFragment(),s=i1(a,{file:i.options.file});return i.stitches&&li(s,"comment",function(o,u,c){const d=o;if(d.value.stitch&&c&&u!==void 0){const f=c.children;return f[u]=d.value.stitch,u}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function ld(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Yy(e,t){ld(e.children,t)}function qy(e,t){e2(e,t),ld(e.children,t),t2(e,t)}function Xy(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:_e.CHARACTER,chars:e.value,location:gr(e)};Mn(t,Mt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Qy(e,t){const n={type:_e.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:gr(e)};Mn(t,Mt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ky(e,t){t.stitches=!0;const n=r2(e);if("children"in e&&"children"in n){const r=cd({type:"root",children:e.children},t.options);n.children=r.children}dd({type:"comment",value:{stitch:n}},t)}function dd(e,t){const n=e.value,r={type:_e.COMMENT,data:n,location:gr(e)};Mn(t,Mt(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Jy(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,fd(t,Mt(e)),t.parser.tokenizer.write(e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function Zy(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Ky(n,t);else{let r="";throw Gy.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Mn(e,t){fd(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=$e.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function fd(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function e2(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$e.PLAINTEXT)return;Mn(t,Mt(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:sn.html;i===sn.html&&n==="svg"&&(i=sn.svg);const a=c1({...e,children:[]},{space:i===sn.svg?"svg":"html"}),s={type:_e.START_TAG,tagName:n,tagID:Pn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:gr(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function t2(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&b1.includes(n)||t.parser.tokenizer.state===$e.PLAINTEXT)return;Mn(t,ii(e));const r={type:_e.END_TAG,tagName:n,tagID:Pn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:gr(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$e.RCDATA||t.parser.tokenizer.state===$e.RAWTEXT||t.parser.tokenizer.state===$e.SCRIPT_DATA)&&(t.parser.tokenizer.state=$e.DATA)}function n2(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function gr(e){const t=Mt(e)||{line:void 0,column:void 0,offset:void 0},n=ii(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function r2(e){return"children"in e?kn({...e,children:[]}):kn(e)}function xs(e){return function(t,n){return cd(t,{...e,file:n})}}const Ss=({children:e})=>b.jsx("div",{className:"p-3",children:e}),i2=({content:e,metaData:t})=>b.jsx(Ss,{children:b.jsx("div",{className:"flex justify-end",children:b.jsx("div",{className:`ml-auto w-fit max-w-full px-4 py-3 rounded-2xl rounded-br-md transition-all duration-300 text-left ${t?.isErrorMessage?"bg-red-100 border-l-4 border-red-400 text-red-800 shadow-md animate-fade-in":"chatsystem-user-message chatsystem-primary-background text-white shadow-sm"}`,children:b.jsx("div",{children:b.jsx(ps,{rehypePlugins:[xs],children:e&&e})})})})});function bu(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function a2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function s2(e,t,n){const i=ui((n||{}).ignore||[]),a=o2(t);let s=-1;for(;++s<a.length;)Al(e,"text",o);function o(c,d){let f=-1,h;for(;++f<d.length;){const m=d[f],y=h?h.children:void 0;if(i(m,y?y.indexOf(m):void 0,h))return;h=m}if(h)return u(c,d)}function u(c,d){const f=d[d.length-1],h=a[s][0],m=a[s][1];let y=0;const w=f.children.indexOf(c);let I=!1,v=[];h.lastIndex=0;let R=h.exec(c.value);for(;R;){const M=R.index,A={index:R.index,input:R.input,stack:[...d,c]};let p=m(...R,A);if(typeof p=="string"&&(p=p.length>0?{type:"text",value:p}:void 0),p===!1?h.lastIndex=M+1:(y!==M&&v.push({type:"text",value:c.value.slice(y,M)}),Array.isArray(p)?v.push(...p):p&&v.push(p),y=M+R[0].length,I=!0),!h.global)break;R=h.exec(c.value)}return I?(y<c.value.length&&v.push({type:"text",value:c.value.slice(y)}),f.children.splice(w,1,...v)):v=[c],w+v.length}}function o2(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(;++r<n.length;){const i=n[r];t.push([u2(i[0]),c2(i[1])])}return t}function u2(e){return typeof e=="string"?new RegExp(a2(e),"g"):e}function c2(e){return typeof e=="function"?e:function(){return e}}const Yi="phrasing",qi=["autolink","link","image","label"];function l2(){return{transforms:[b2],enter:{literalAutolink:f2,literalAutolinkEmail:Xi,literalAutolinkHttp:Xi,literalAutolinkWww:Xi},exit:{literalAutolink:g2,literalAutolinkEmail:p2,literalAutolinkHttp:h2,literalAutolinkWww:m2}}}function d2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Yi,notInConstruct:qi},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Yi,notInConstruct:qi},{character:":",before:"[ps]",after:"\\/",inConstruct:Yi,notInConstruct:qi}]}}function f2(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xi(e){this.config.enter.autolinkProtocol.call(this,e)}function h2(e){this.config.exit.autolinkProtocol.call(this,e)}function m2(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 p2(e){this.config.exit.autolinkEmail.call(this,e)}function g2(e){this.exit(e)}function b2(e){s2(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,E2],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),T2]],{ignore:["link","linkReference"]})}function E2(e,t,n,r,i){let a="";if(!hd(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!y2(n)))return!1;const s=_2(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 T2(e,t,n,r){return!hd(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function y2(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _2(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=bu(e,"(");let a=bu(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function hd(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fn(n)||ai(n))&&(!t||n!==47)}md.peek=N2;function x2(){this.buffer()}function S2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function C2(){this.buffer()}function I2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function A2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=At(this.sliceSerialize(e)).toLowerCase(),n.label=t}function w2(e){this.exit(e)}function v2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=At(this.sliceSerialize(e)).toLowerCase(),n.label=t}function k2(e){this.exit(e)}function N2(){return"["}function md(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 R2(){return{enter:{gfmFootnoteCallString:x2,gfmFootnoteCall:S2,gfmFootnoteDefinitionLabelString:C2,gfmFootnoteDefinition:I2},exit:{gfmFootnoteCallString:A2,gfmFootnoteCall:w2,gfmFootnoteDefinitionLabelString:v2,gfmFootnoteDefinition:k2}}}function O2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:md},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const o=a.createTracker(s);let u=o.move("[^");const c=a.enter("footnoteDefinition"),d=a.enter("label");return u+=o.move(a.safe(a.associationId(r),{before:u,after:"]"})),d(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
|
|
62
|
-
`:" ")+a.indentLines(a.containerFlow(r,o.current()),t?
|
|
63
|
-
`)}function
|
|
64
|
-
`&&
|
|
65
|
-
`}function
|
|
59
|
+
`}),n}function Ko(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Jo(e,t){const n=SE(e,t),r=n.one(e,void 0),i=hE(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
60
|
+
`},i),a}function vE(e,t){return e&&"run"in e?async function(n,r){const i=Jo(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Jo(n,{file:r,...t||e})}}function Zo(e){if(e)throw e}var Vi,eu;function kE(){if(eu)return Vi;eu=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},a=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!f)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},s=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},o=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Vi=function u(){var c,d,f,h,m,y,b=arguments[0],A=1,I=arguments.length,w=!1;for(typeof b=="boolean"&&(w=b,b=arguments[1]||{},A=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});A<I;++A)if(c=arguments[A],c!=null)for(d in c)f=o(b,d),h=o(c,d),b!==h&&(w&&h&&(a(h)||(m=i(h)))?(m?(m=!1,y=f&&i(f)?f:[]):y=f&&a(f)?f:{},s(b,{name:d,newValue:u(w,y,h)})):typeof h<"u"&&s(b,{name:d,newValue:h}));return b},Vi}var NE=kE();const zi=Ga(NE);function Ra(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function RE(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(u,...c){const d=e[++a];let f=-1;if(u){s(u);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,d?OE(d,o)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function OE(e,t){let n;return r;function r(...s){const o=e.length>s.length;let u;o&&s.push(i);try{u=e.apply(this,s)}catch(c){const d=c;if(o&&n)throw d;return i(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(s,...o){n||(n=!0,t(s,...o))}function a(s){i(null,s)}}const vt={basename:LE,dirname:DE,extname:PE,join:ME,sep:"/"};function LE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pr(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function DE(e){if(pr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function PE(e){pr(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function ME(...e){let t=-1,n;for(;++t<e.length;)pr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":BE(n)}function BE(e){pr(e);const t=e.codePointAt(0)===47;let n=FE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function FE(e,t){let n="",r=0,i=-1,a=0,s=-1,o,u;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function pr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const UE={cwd:HE};function HE(){return"/"}function Oa(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jE(e){if(typeof e=="string")e=new URL(e);else if(!Oa(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return VE(e)}function VE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const $i=["history","path","basename","stem","extname","dirname"];class Dl{constructor(t){let n;t?Oa(t)?n={path:t}:typeof t=="string"||zE(t)?n={value:t}:n=t:n={},this.cwd=UE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<$i.length;){const a=$i[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)$i.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?vt.basename(this.path):void 0}set basename(t){Gi(t,"basename"),Wi(t,"basename"),this.path=vt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?vt.dirname(this.path):void 0}set dirname(t){tu(this.basename,"dirname"),this.path=vt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?vt.extname(this.path):void 0}set extname(t){if(Wi(t,"extname"),tu(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=vt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Oa(t)&&(t=jE(t)),Gi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?vt.basename(this.path,this.extname):void 0}set stem(t){Gi(t,"stem"),Wi(t,"stem"),this.path=vt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new nt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Wi(e,t){if(e&&e.includes(vt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+vt.sep+"`")}function Gi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function tu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function zE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $E=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};Object.setPrototypeOf(a,r);const s=Object.getOwnPropertyNames(i);for(const o of s){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(a,o,u)}return a}),WE={}.hasOwnProperty;class _s extends $E{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=RE()}copy(){const t=new _s;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(zi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Xi("data",this.frozen),this.namespace[t]=n,this):WE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Xi("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=kr(t),r=this.parser||this.Parser;return Yi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Yi("process",this.parser||this.Parser),qi("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const o=kr(t),u=r.parse(o);r.run(u,o,function(d,f,h){if(d||!f||!h)return c(d);const m=f,y=r.stringify(m,h);qE(y)?h.value=y:h.result=y,c(d,h)});function c(d,f){d||!f?s(d):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Yi("processSync",this.parser||this.Parser),qi("processSync",this.compiler||this.Compiler),this.process(t,i),ru("processSync","process",n),r;function i(a,s){n=!0,Zo(a),r=s}}run(t,n,r){nu(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,o){const u=kr(n);i.run(t,u,c);function c(d,f,h){const m=f||t;d?o(d):s?s(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),ru("runSync","run",r),i;function a(s,o){Zo(s),i=o,r=!0}}stringify(t,n){this.freeze();const r=kr(n),i=this.compiler||this.Compiler;return qi("stringify",i),nu(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Xi("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...f]=c;u(d,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=zi(!0,i.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const f=c[d];a(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...d]);else if(d.length>0){let[m,...y]=d;const b=r[h][1];Ra(b)&&Ra(m)&&(m=zi(!0,b,m)),r[h]=[c,m,...y]}}}}const GE=new _s().freeze();function Yi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xi(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 nu(e){if(!Ra(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ru(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function kr(e){return YE(e)?e:new Dl(e)}function YE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function qE(e){return typeof e=="string"||XE(e)}function XE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",iu=[],au={allowDangerousHtml:!0},KE=/^(https?|ircs?|mailto|xmpp)$/i,JE=[{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:"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 xs(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,a=e.components,s=e.disallowedElements,o=e.rehypePlugins||iu,u=e.remarkPlugins||iu,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...au}:au,d=e.skipHtml,f=e.unwrapDisallowed,h=e.urlTransform||ZE,m=GE().use(Db).use(u).use(vE,c).use(o),y=new Dl;typeof r=="string"&&(y.value=r);for(const w of JE)Object.hasOwn(e,w.from)&&(""+w.from+(w.to?"use `"+w.to+"` instead":"remove it")+QE+w.id,void 0);const b=m.parse(y);let A=m.runSync(b,y);return i&&(A={type:"element",tagName:"div",properties:{className:i},children:A.type==="root"?A.children:[A]}),hi(A,I),bp(A,{Fragment:g.Fragment,components:a,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function I(w,N,M){if(w.type==="raw"&&M&&typeof N=="number")return d?M.children.splice(N,1):M.children[N]={type:"text",value:w.value},N;if(w.type==="element"){let v;for(v in Ui)if(Object.hasOwn(Ui,v)&&Object.hasOwn(w.properties,v)){const p=w.properties[v],O=Ui[v];(O===null||O.includes(w.tagName))&&(w.properties[v]=h(String(p||""),v,w))}}if(w.type==="element"){let v=t?!t.includes(w.tagName):s?s.includes(w.tagName):!1;if(!v&&n&&typeof N=="number"&&(v=!n(w,N,M)),v&&M&&typeof N=="number")return f&&w.children?M.children.splice(N,1,...w.children):M.children.splice(N,1),N}}}function ZE(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||KE.test(e.slice(0,t))?e:""}const su=/[#.]/g;function e1(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){su.lastIndex=i;const o=su.exec(n),u=n.slice(i,o?o.index:n.length);u&&(a?a==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:s=u,i+=u.length),o&&(a=o[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}const t1=new Set(["button","menu","reset","submit"]),La={}.hasOwnProperty;function Pl(e,t,n){const r=n&&a1(n);function i(a,s,...o){let u=-1,c;if(a==null){c={type:"root",children:[]};const d=s;o.unshift(d)}else if(c=e1(a,t),c.tagName=c.tagName.toLowerCase(),r&&La.call(r,c.tagName)&&(c.tagName=r[c.tagName]),n1(s,c.tagName)){let d;for(d in s)La.call(s,d)&&r1(e,c.properties,d,s[d])}else o.unshift(s);for(;++u<o.length;)Da(c.children,o[u]);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return i}function n1(e,t){return e==null||typeof e!="object"||Array.isArray(e)?!1:t==="input"||!e.type||typeof e.type!="string"?!0:"children"in e&&Array.isArray(e.children)?!1:t==="button"?t1.has(e.type.toLowerCase()):!("value"in e)}function r1(e,t,n,r){const i=si(e,n);let a=-1,s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=vo(r):i.commaSeparated?s=So(r):i.commaOrSpaceSeparated?s=vo(So(r).join(" ")):s=ou(i,i.property,r):Array.isArray(r)?s=r.concat():s=i.property==="style"?i1(r):String(r);if(Array.isArray(s)){const o=[];for(;++a<s.length;){const u=ou(i,i.property,s[a]);o[a]=u}s=o}if(i.property==="className"&&Array.isArray(t.className)){const o=s;s=t.className.concat(o)}t[i.property]=s}}function Da(e,t){let n=-1;if(t!=null)if(typeof t=="string"||typeof t=="number")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(;++n<t.length;)Da(e,t[n]);else if(typeof t=="object"&&"type"in t)t.type==="root"?Da(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function ou(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||rr(n)===rr(t)))return!0}return n}function i1(e){const t=[];let n;for(n in e)La.call(e,n)&&t.push([n,e[n]].join(": "));return t.join("; ")}function a1(e){const t={};let n=-1;for(;++n<e.length;)t[e[n].toLowerCase()]=e[n];return t}const s1=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],o1=Pl(hr,"div"),u1=Pl(Jt,"g",s1);function c1(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let o=n[s];if(o===void 0){const u=uu(t,n[s-1]);o=u===-1?t.length+1:u+1,n[s]=o}if(o>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const o=n[n.length-1],u=uu(t,o),c=u===-1?t.length+1:u+1;if(o===c)break;n.push(c)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function uu(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
61
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const sn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Ml={}.hasOwnProperty,l1=Object.prototype;function d1(e,t){const n=t||{};return Ss({file:n.file||void 0,location:!1,schema:n.space==="svg"?Jt:hr,verbose:n.verbose||!1},e)}function Ss(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Br(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Bl(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),s=c1(a),o=s.toPoint(0),u=s.toPoint(a.length);n.position={start:o,end:u}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Br(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Br(e,r,n),n}default:return n=f1(e,t),n}}function Bl(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=Ss(e,t[n]);r.push(i)}return r}function f1(e,t){const n=e.schema;e.schema=t.namespaceURI===sn.svg?Jt:hr;let r=-1;const i={};for(;++r<t.attrs.length;){const o=t.attrs[r],u=(o.prefix?o.prefix+":":"")+o.name;Ml.call(l1,u)||(i[u]=o.value)}const s=(e.schema.space==="svg"?u1:o1)(t.tagName,i,Bl(e,t.childNodes));if(Br(e,t,s),s.tagName==="template"){const o=t,u=o.sourceCodeLocation,c=u&&u.startTag&&Sn(u.startTag),d=u&&u.endTag&&Sn(u.endTag),f=Ss(e,o.content);c&&d&&e.file&&(f.position={start:c.end,end:d.start}),s.content=f}return e.schema=n,s}function Br(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=h1(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function h1(e,t,n){const r=Sn(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)Ml.call(n.attrs,s)&&(a[si(e.schema,s).property]=Sn(n.attrs[s]));n.startTag;const o=Sn(n.startTag),u=n.endTag?Sn(n.endTag):void 0,c={opening:o};u&&(c.closing=u),c.properties=a,t.data={position:c}}}return r}function Sn(e){const t=cu({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=cu({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function cu(e){return e.line&&e.column?e:void 0}const lu={}.hasOwnProperty;function Fl(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const o=r.handlers;if(i&&lu.call(i,e)){const u=String(i[e]);s=lu.call(o,u)?o[u]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const m1={},p1={}.hasOwnProperty,Ul=Fl("type",{handlers:{root:b1,element:x1,text:y1,comment:_1,doctype:T1}});function g1(e,t){const r=(t||m1).space;return Ul(e,r==="svg"?Jt:hr)}function b1(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Cs(e.children,n,t),Dn(e,n),n}function E1(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Cs(e.children,n,t),Dn(e,n),n}function T1(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Dn(e,t),t}function y1(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Dn(e,t),t}function _1(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Dn(e,t),t}function x1(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Jt);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&p1.call(e.properties,a)){const u=S1(r,a,e.properties[a]);u&&i.push(u)}}const s=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:sn[s],childNodes:[],parentNode:null};return o.childNodes=Cs(e.children,o,r),Dn(e,o),e.tagName==="template"&&e.content&&(o.content=E1(e.content,r)),o}function S1(e,t,n){const r=si(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Jc(n):ol(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=sn[r.space]}return i}function Cs(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=Ul(e[r],n);a.parentNode=t,i.push(a)}return i}function Dn(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const C1=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],I1=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ve="�";var T;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(T||(T={}));const lt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Hl(e){return e>=55296&&e<=57343}function A1(e){return e>=56320&&e<=57343}function w1(e,t){return(e-55296)*1024+9216+t}function jl(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Vl(e){return e>=64976&&e<=65007||I1.has(e)}var D;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(D||(D={}));const v1=65536;class k1{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=v1,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:a}=this,s=i+n,o=a+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(A1(n))return this.pos++,this._addGap(),w1(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(D.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;const r=this.html.charCodeAt(n);return r===T.CARRIAGE_RETURN?T.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;let t=this.html.charCodeAt(this.pos);return t===T.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,T.LINE_FEED):t===T.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Hl(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===T.LINE_FEED||t===T.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){jl(t)?this._err(D.controlCharacterInInputStream):Vl(t)&&this._err(D.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ye;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(ye||(ye={}));function zl(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const $l=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),N1=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Qi;const R1=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),O1=(Qi=String.fromCodePoint)!==null&&Qi!==void 0?Qi:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function L1(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=R1.get(e))!==null&&t!==void 0?t:e}var Je;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Je||(Je={}));const D1=32;var Yt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Yt||(Yt={}));function Pa(e){return e>=Je.ZERO&&e<=Je.NINE}function P1(e){return e>=Je.UPPER_A&&e<=Je.UPPER_F||e>=Je.LOWER_A&&e<=Je.LOWER_F}function M1(e){return e>=Je.UPPER_A&&e<=Je.UPPER_Z||e>=Je.LOWER_A&&e<=Je.LOWER_Z||Pa(e)}function B1(e){return e===Je.EQUALS||M1(e)}var Qe;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Qe||(Qe={}));var jt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(jt||(jt={}));class Wl{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Qe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=jt.Strict}startEntity(t){this.decodeMode=t,this.state=Qe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Qe.EntityStart:return t.charCodeAt(n)===Je.NUM?(this.state=Qe.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Qe.NamedEntity,this.stateNamedEntity(t,n));case Qe.NumericStart:return this.stateNumericStart(t,n);case Qe.NumericDecimal:return this.stateNumericDecimal(t,n);case Qe.NumericHex:return this.stateNumericHex(t,n);case Qe.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|D1)===Je.LOWER_X?(this.state=Qe.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Qe.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+parseInt(t.substr(n,a),i),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Pa(i)||P1(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Pa(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Je.SEMI)this.consumed+=1;else if(this.decodeMode===jt.Strict)return 0;return this.emitCodePoint(L1(this.result),this.consumed),this.errors&&(t!==Je.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&Yt.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=F1(r,i,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===jt.Attribute&&(a===0||B1(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&Yt.VALUE_LENGTH)>>14,a!==0){if(s===Je.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==jt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Yt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Yt.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Qe.NamedEntity:return this.result!==0&&(this.decodeMode!==jt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Qe.NumericDecimal:return this.emitNumericEntity(0,2);case Qe.NumericHex:return this.emitNumericEntity(0,3);case Qe.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Qe.EntityStart:return 0}}}function Gl(e){let t="";const n=new Wl(e,r=>t+=O1(r));return function(i,a){let s=0,o=0;for(;(o=i.indexOf("&",o))>=0;){t+=i.slice(s,o),n.startEntity(a);const c=n.write(i,o+1);if(c<0){s=o+n.end();break}s=o+c,o=c===0?s+1:s}const u=t+i.slice(s);return t="",u}}function F1(e,t,n,r){const i=(t&Yt.BRANCH_LENGTH)>>7,a=t&Yt.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const u=r-a;return u<0||u>=i?-1:e[n+u]-1}let s=n,o=s+i-1;for(;s<=o;){const u=s+o>>>1,c=e[u];if(c<r)s=u+1;else if(c>r)o=u-1;else return e[u+i]}return-1}Gl($l);Gl(N1);var F;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(F||(F={}));var un;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(un||(un={}));var bt;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(bt||(bt={}));var R;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(R||(R={}));var l;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(l||(l={}));const U1=new Map([[R.A,l.A],[R.ADDRESS,l.ADDRESS],[R.ANNOTATION_XML,l.ANNOTATION_XML],[R.APPLET,l.APPLET],[R.AREA,l.AREA],[R.ARTICLE,l.ARTICLE],[R.ASIDE,l.ASIDE],[R.B,l.B],[R.BASE,l.BASE],[R.BASEFONT,l.BASEFONT],[R.BGSOUND,l.BGSOUND],[R.BIG,l.BIG],[R.BLOCKQUOTE,l.BLOCKQUOTE],[R.BODY,l.BODY],[R.BR,l.BR],[R.BUTTON,l.BUTTON],[R.CAPTION,l.CAPTION],[R.CENTER,l.CENTER],[R.CODE,l.CODE],[R.COL,l.COL],[R.COLGROUP,l.COLGROUP],[R.DD,l.DD],[R.DESC,l.DESC],[R.DETAILS,l.DETAILS],[R.DIALOG,l.DIALOG],[R.DIR,l.DIR],[R.DIV,l.DIV],[R.DL,l.DL],[R.DT,l.DT],[R.EM,l.EM],[R.EMBED,l.EMBED],[R.FIELDSET,l.FIELDSET],[R.FIGCAPTION,l.FIGCAPTION],[R.FIGURE,l.FIGURE],[R.FONT,l.FONT],[R.FOOTER,l.FOOTER],[R.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[R.FORM,l.FORM],[R.FRAME,l.FRAME],[R.FRAMESET,l.FRAMESET],[R.H1,l.H1],[R.H2,l.H2],[R.H3,l.H3],[R.H4,l.H4],[R.H5,l.H5],[R.H6,l.H6],[R.HEAD,l.HEAD],[R.HEADER,l.HEADER],[R.HGROUP,l.HGROUP],[R.HR,l.HR],[R.HTML,l.HTML],[R.I,l.I],[R.IMG,l.IMG],[R.IMAGE,l.IMAGE],[R.INPUT,l.INPUT],[R.IFRAME,l.IFRAME],[R.KEYGEN,l.KEYGEN],[R.LABEL,l.LABEL],[R.LI,l.LI],[R.LINK,l.LINK],[R.LISTING,l.LISTING],[R.MAIN,l.MAIN],[R.MALIGNMARK,l.MALIGNMARK],[R.MARQUEE,l.MARQUEE],[R.MATH,l.MATH],[R.MENU,l.MENU],[R.META,l.META],[R.MGLYPH,l.MGLYPH],[R.MI,l.MI],[R.MO,l.MO],[R.MN,l.MN],[R.MS,l.MS],[R.MTEXT,l.MTEXT],[R.NAV,l.NAV],[R.NOBR,l.NOBR],[R.NOFRAMES,l.NOFRAMES],[R.NOEMBED,l.NOEMBED],[R.NOSCRIPT,l.NOSCRIPT],[R.OBJECT,l.OBJECT],[R.OL,l.OL],[R.OPTGROUP,l.OPTGROUP],[R.OPTION,l.OPTION],[R.P,l.P],[R.PARAM,l.PARAM],[R.PLAINTEXT,l.PLAINTEXT],[R.PRE,l.PRE],[R.RB,l.RB],[R.RP,l.RP],[R.RT,l.RT],[R.RTC,l.RTC],[R.RUBY,l.RUBY],[R.S,l.S],[R.SCRIPT,l.SCRIPT],[R.SEARCH,l.SEARCH],[R.SECTION,l.SECTION],[R.SELECT,l.SELECT],[R.SOURCE,l.SOURCE],[R.SMALL,l.SMALL],[R.SPAN,l.SPAN],[R.STRIKE,l.STRIKE],[R.STRONG,l.STRONG],[R.STYLE,l.STYLE],[R.SUB,l.SUB],[R.SUMMARY,l.SUMMARY],[R.SUP,l.SUP],[R.TABLE,l.TABLE],[R.TBODY,l.TBODY],[R.TEMPLATE,l.TEMPLATE],[R.TEXTAREA,l.TEXTAREA],[R.TFOOT,l.TFOOT],[R.TD,l.TD],[R.TH,l.TH],[R.THEAD,l.THEAD],[R.TITLE,l.TITLE],[R.TR,l.TR],[R.TRACK,l.TRACK],[R.TT,l.TT],[R.U,l.U],[R.UL,l.UL],[R.SVG,l.SVG],[R.VAR,l.VAR],[R.WBR,l.WBR],[R.XMP,l.XMP]]);function Pn(e){var t;return(t=U1.get(e))!==null&&t!==void 0?t:l.UNKNOWN}const V=l,H1={[F.HTML]:new Set([V.ADDRESS,V.APPLET,V.AREA,V.ARTICLE,V.ASIDE,V.BASE,V.BASEFONT,V.BGSOUND,V.BLOCKQUOTE,V.BODY,V.BR,V.BUTTON,V.CAPTION,V.CENTER,V.COL,V.COLGROUP,V.DD,V.DETAILS,V.DIR,V.DIV,V.DL,V.DT,V.EMBED,V.FIELDSET,V.FIGCAPTION,V.FIGURE,V.FOOTER,V.FORM,V.FRAME,V.FRAMESET,V.H1,V.H2,V.H3,V.H4,V.H5,V.H6,V.HEAD,V.HEADER,V.HGROUP,V.HR,V.HTML,V.IFRAME,V.IMG,V.INPUT,V.LI,V.LINK,V.LISTING,V.MAIN,V.MARQUEE,V.MENU,V.META,V.NAV,V.NOEMBED,V.NOFRAMES,V.NOSCRIPT,V.OBJECT,V.OL,V.P,V.PARAM,V.PLAINTEXT,V.PRE,V.SCRIPT,V.SECTION,V.SELECT,V.SOURCE,V.STYLE,V.SUMMARY,V.TABLE,V.TBODY,V.TD,V.TEMPLATE,V.TEXTAREA,V.TFOOT,V.TH,V.THEAD,V.TITLE,V.TR,V.TRACK,V.UL,V.WBR,V.XMP]),[F.MATHML]:new Set([V.MI,V.MO,V.MN,V.MS,V.MTEXT,V.ANNOTATION_XML]),[F.SVG]:new Set([V.TITLE,V.FOREIGN_OBJECT,V.DESC]),[F.XLINK]:new Set,[F.XML]:new Set,[F.XMLNS]:new Set},Ma=new Set([V.H1,V.H2,V.H3,V.H4,V.H5,V.H6]);R.STYLE,R.SCRIPT,R.XMP,R.IFRAME,R.NOEMBED,R.NOFRAMES,R.PLAINTEXT;var _;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(_||(_={}));const $e={DATA:_.DATA,RCDATA:_.RCDATA,RAWTEXT:_.RAWTEXT,SCRIPT_DATA:_.SCRIPT_DATA,PLAINTEXT:_.PLAINTEXT,CDATA_SECTION:_.CDATA_SECTION};function j1(e){return e>=T.DIGIT_0&&e<=T.DIGIT_9}function Gn(e){return e>=T.LATIN_CAPITAL_A&&e<=T.LATIN_CAPITAL_Z}function V1(e){return e>=T.LATIN_SMALL_A&&e<=T.LATIN_SMALL_Z}function Wt(e){return V1(e)||Gn(e)}function du(e){return Wt(e)||j1(e)}function Nr(e){return e+32}function Yl(e){return e===T.SPACE||e===T.LINE_FEED||e===T.TABULATION||e===T.FORM_FEED}function fu(e){return Yl(e)||e===T.SOLIDUS||e===T.GREATER_THAN_SIGN}function z1(e){return e===T.NULL?D.nullCharacterReference:e>1114111?D.characterReferenceOutsideUnicodeRange:Hl(e)?D.surrogateCharacterReference:Vl(e)?D.noncharacterCharacterReference:jl(e)||e===T.CARRIAGE_RETURN?D.controlCharacterReference:null}class $1{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=_.DATA,this.returnState=_.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new k1(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Wl($l,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(D.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(D.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=z1(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ye.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ye.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:ye.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:ye.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(zl(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(D.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Pn(t.tagName),t.type===ye.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(D.endTagWithAttributes),t.selfClosing&&this._err(D.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case ye.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ye.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ye.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:ye.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Yl(t)?ye.WHITESPACE_CHARACTER:t===T.NULL?ye.NULL_CHARACTER:ye.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(ye.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=_.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?jt.Attribute:jt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===_.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===_.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===_.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case _.DATA:{this._stateData(t);break}case _.RCDATA:{this._stateRcdata(t);break}case _.RAWTEXT:{this._stateRawtext(t);break}case _.SCRIPT_DATA:{this._stateScriptData(t);break}case _.PLAINTEXT:{this._statePlaintext(t);break}case _.TAG_OPEN:{this._stateTagOpen(t);break}case _.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case _.TAG_NAME:{this._stateTagName(t);break}case _.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case _.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case _.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case _.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case _.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case _.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case _.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case _.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case _.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case _.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case _.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case _.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case _.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case _.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case _.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case _.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case _.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case _.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case _.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case _.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case _.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case _.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case _.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case _.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case _.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case _.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case _.BOGUS_COMMENT:{this._stateBogusComment(t);break}case _.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case _.COMMENT_START:{this._stateCommentStart(t);break}case _.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case _.COMMENT:{this._stateComment(t);break}case _.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case _.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case _.COMMENT_END:{this._stateCommentEnd(t);break}case _.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case _.DOCTYPE:{this._stateDoctype(t);break}case _.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case _.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case _.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case _.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case _.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case _.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case _.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case _.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case _.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case _.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case _.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case _.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case _.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case _.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case _.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case _.CDATA_SECTION:{this._stateCdataSection(t);break}case _.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case _.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case _.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case _.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=_.TAG_OPEN;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitCodePoint(t);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case T.AMPERSAND:{this._startCharacterReference();break}case T.LESS_THAN_SIGN:{this.state=_.RCDATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case T.LESS_THAN_SIGN:{this.state=_.RAWTEXT_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Wt(t))this._createStartTagToken(),this.state=_.TAG_NAME,this._stateTagName(t);else switch(t){case T.EXCLAMATION_MARK:{this.state=_.MARKUP_DECLARATION_OPEN;break}case T.SOLIDUS:{this.state=_.END_TAG_OPEN;break}case T.QUESTION_MARK:{this._err(D.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t);break}case T.EOF:{this._err(D.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=_.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Wt(t))this._createEndTagToken(),this.state=_.TAG_NAME,this._stateTagName(t);else switch(t){case T.GREATER_THAN_SIGN:{this._err(D.missingEndTagName),this.state=_.DATA;break}case T.EOF:{this._err(D.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this.state=_.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.tagName+=Ve;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Gn(t)?Nr(t):t)}}_stateRcdataLessThanSign(t){t===T.SOLIDUS?this.state=_.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=_.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Wt(t)?(this.state=_.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=_.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=_.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=_.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=_.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===T.SOLIDUS?this.state=_.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Wt(t)?(this.state=_.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case T.SOLIDUS:{this.state=_.SCRIPT_DATA_END_TAG_OPEN;break}case T.EXCLAMATION_MARK:{this.state=_.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=_.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Wt(t)?(this.state=_.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===T.HYPHEN_MINUS?(this.state=_.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===T.HYPHEN_MINUS?(this.state=_.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_ESCAPED,this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.GREATER_THAN_SIGN:{this.state=_.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_ESCAPED,this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===T.SOLIDUS?this.state=_.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Wt(t)?(this._emitChars("<"),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Wt(t)?(this.state=_.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(lt.SCRIPT,!1)&&fu(this.preprocessor.peek(lt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<lt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.GREATER_THAN_SIGN:{this.state=_.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ve);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===T.SOLIDUS?(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(lt.SCRIPT,!1)&&fu(this.preprocessor.peek(lt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<lt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=_.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this.state=_.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._err(D.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=_.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=_.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this._leaveAttrName(),this.state=_.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._leaveAttrName(),this.state=_.BEFORE_ATTRIBUTE_VALUE;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:{this._err(D.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.name+=Ve;break}default:this.currentAttr.name+=String.fromCodePoint(Gn(t)?Nr(t):t)}}_stateAfterAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:{this.state=_.SELF_CLOSING_START_TAG;break}case T.EQUALS_SIGN:{this.state=_.BEFORE_ATTRIBUTE_VALUE;break}case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=_.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{this.state=_.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this.state=_.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingAttributeValue),this.state=_.DATA,this.emitCurrentTagToken();break}default:this.state=_.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case T.QUOTATION_MARK:{this.state=_.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Ve;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case T.APOSTROPHE:{this.state=_.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Ve;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=_.BEFORE_ATTRIBUTE_NAME;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=_.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Ve;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:{this._err(D.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=_.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this._leaveAttrValue(),this.state=_.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=_.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBetweenAttributes),this.state=_.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case T.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=_.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.unexpectedSolidusInTag),this.state=_.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentComment(n);break}case T.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.data+=Ve;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(lt.DASH_DASH,!0)?(this._createCommentToken(lt.DASH_DASH.length+1),this.state=_.COMMENT_START):this._consumeSequenceIfMatch(lt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(lt.DOCTYPE.length+1),this.state=_.DOCTYPE):this._consumeSequenceIfMatch(lt.CDATA_START,!0)?this.inForeignNode?this.state=_.CDATA_SECTION:(this._err(D.cdataInHtmlContent),this._createCommentToken(lt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=_.BOGUS_COMMENT):this._ensureHibernation()||(this._err(D.incorrectlyOpenedComment),this._createCommentToken(2),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case T.HYPHEN_MINUS:{this.state=_.COMMENT_START_DASH;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=_.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=_.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=_.COMMENT_END;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=_.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=_.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=_.COMMENT_END_DASH;break}case T.LESS_THAN_SIGN:{n.data+="<",this.state=_.COMMENT_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.data+=Ve;break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case T.EXCLAMATION_MARK:{n.data+="!",this.state=_.COMMENT_LESS_THAN_SIGN_BANG;break}case T.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=_.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===T.HYPHEN_MINUS?this.state=_.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=_.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===T.HYPHEN_MINUS?this.state=_.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=_.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==T.GREATER_THAN_SIGN&&t!==T.EOF&&this._err(D.nestedComment),this.state=_.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=_.COMMENT_END;break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=_.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentComment(n);break}case T.EXCLAMATION_MARK:{this.state=_.COMMENT_END_BANG;break}case T.HYPHEN_MINUS:{n.data+="-";break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=_.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{n.data+="--!",this.state=_.COMMENT_END_DASH;break}case T.GREATER_THAN_SIGN:{this._err(D.incorrectlyClosedComment),this.state=_.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=_.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=_.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case T.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBeforeDoctypeName),this.state=_.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Gn(t))this._createDoctypeToken(String.fromCharCode(Nr(t))),this.state=_.DOCTYPE_NAME;else switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.NULL:{this._err(D.unexpectedNullCharacter),this._createDoctypeToken(Ve),this.state=_.DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=_.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.AFTER_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.name+=Ve;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Gn(t)?Nr(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(lt.PUBLIC,!1)?this.state=_.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(lt.SYSTEM,!1)?this.state=_.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(D.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=_.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.publicId+=Ve;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case T.APOSTROPHE:{this.state=_.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.publicId+=Ve;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case T.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.QUOTATION_MARK:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=_.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.systemId+=Ve;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case T.APOSTROPHE:{this.state=_.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.systemId+=Ve;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case T.NULL:{this._err(D.unexpectedNullCharacter);break}case T.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case T.RIGHT_SQUARE_BRACKET:{this.state=_.CDATA_SECTION_BRACKET;break}case T.EOF:{this._err(D.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===T.RIGHT_SQUARE_BRACKET?this.state=_.CDATA_SECTION_END:(this._emitChars("]"),this.state=_.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case T.GREATER_THAN_SIGN:{this.state=_.DATA;break}case T.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=_.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(T.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&du(this.preprocessor.peek(1))?_.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){du(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===T.SEMICOLON&&this._err(D.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const ql=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),hu=new Set([...ql,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),zr=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),W1=new Set([...zr,l.OL,l.UL]),G1=new Set([...zr,l.BUTTON]),mu=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),pu=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),Y1=new Set([l.TR,l.TEMPLATE,l.HTML]),q1=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),X1=new Set([l.TABLE,l.TEMPLATE,l.HTML]),Q1=new Set([l.TD,l.TH]);class K1{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=l.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===F.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==F.HTML);this.shortenToLength(n<0?0:n)}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(n<0?0:n)}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r<0?0:r)}popUntilNumberedHeaderPopped(){this.popUntilPopped(Ma,F.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Q1,F.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(X1,F.HTML)}clearBackToTableBodyContext(){this.clearBackTo(q1,F.HTML)}clearBackToTableRowContext(){this.clearBackTo(Y1,F.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===l.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===l.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case F.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case F.SVG:{if(pu.has(i))return!1;break}case F.MATHML:{if(mu.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,zr)}hasInListItemScope(t){return this.hasInDynamicScope(t,W1)}hasInButtonScope(t){return this.hasInDynamicScope(t,G1)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case F.HTML:{if(Ma.has(n))return!0;if(zr.has(n))return!1;break}case F.SVG:{if(pu.has(n))return!1;break}case F.MATHML:{if(mu.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===F.HTML)switch(this.tagIDs[n]){case t:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===F.HTML)switch(this.tagIDs[t]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===F.HTML)switch(this.tagIDs[n]){case t:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;ql.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;hu.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==t&&hu.has(this.currentTagId);)this.pop()}}const Ki=3;var Ot;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ot||(Ot={}));const gu={type:Ot.Marker};class J1{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===Ot.Marker)break;const{element:c}=u;if(this.treeAdapter.getTagName(c)===a&&this.treeAdapter.getNamespaceURI(c)===s){const d=this.treeAdapter.getAttrList(c);d.length===i&&r.push({idx:o,attrs:d})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Ki)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Ki)return;const i=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const o=r[s];o.attrs.every(u=>i.get(u.name)===u.value)&&(a+=1,a>=Ki&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(gu)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ot.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ot.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n>=0&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(gu);t>=0?this.entries.splice(0,t+1):this.entries.length=0}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ot.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ot.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ot.Element&&n.element===t)}}const Gt={createDocument(){return{nodeName:"#document",mode:bt.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Gt.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Gt.isTextNode(n)){n.value+=t;return}}Gt.appendChild(e,Gt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Gt.isTextNode(r)?r.value+=t:Gt.insertBefore(e,Gt.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Xl="html",Z1="about:legacy-compat",eT="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Ql=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],tT=[...Ql,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],nT=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Kl=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],rT=[...Kl,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function bu(e,t){return t.some(n=>e.startsWith(n))}function iT(e){return e.name===Xl&&e.publicId===null&&(e.systemId===null||e.systemId===Z1)}function aT(e){if(e.name!==Xl)return bt.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===eT)return bt.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),nT.has(n))return bt.QUIRKS;let r=t===null?tT:Ql;if(bu(n,r))return bt.QUIRKS;if(r=t===null?Kl:rT,bu(n,r))return bt.LIMITED_QUIRKS}return bt.NO_QUIRKS}const Eu={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},sT="definitionurl",oT="definitionURL",uT=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),cT=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:F.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:F.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:F.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:F.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:F.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:F.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:F.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:F.XML}],["xml:space",{prefix:"xml",name:"space",namespace:F.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:F.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:F.XMLNS}]]),lT=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),dT=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function fT(e){const t=e.tagID;return t===l.FONT&&e.attrs.some(({name:r})=>r===un.COLOR||r===un.SIZE||r===un.FACE)||dT.has(t)}function Jl(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===sT){e.attrs[t].name=oT;break}}function Zl(e){for(let t=0;t<e.attrs.length;t++){const n=uT.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Is(e){for(let t=0;t<e.attrs.length;t++){const n=cT.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function hT(e){const t=lT.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Pn(e.tagName))}function mT(e,t){return t===F.MATHML&&(e===l.MI||e===l.MO||e===l.MN||e===l.MS||e===l.MTEXT)}function pT(e,t,n){if(t===F.MATHML&&e===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===un.ENCODING){const i=n[r].value.toLowerCase();return i===Eu.TEXT_HTML||i===Eu.APPLICATION_XML}}return t===F.SVG&&(e===l.FOREIGN_OBJECT||e===l.DESC||e===l.TITLE)}function gT(e,t,n,r){return(!r||r===F.HTML)&&pT(e,t,n)||(!r||r===F.MATHML)&&mT(e,t)}const bT="hidden",ET=8,TT=3;var C;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(C||(C={}));const yT={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ed=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),Tu={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Gt,onParseError:null};class yu{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=C.INITIAL,this.originalInsertionMode=C.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Tu,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new $1(this.options,this),this.activeFormattingElements=new J1(this.treeAdapter),this.fragmentContextID=r?Pn(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new K1(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Tu,...n};t??(t=r.treeAdapter.createElement(R.TEMPLATE,F.HTML,[]));const i=r.treeAdapter.createElement("documentmock",F.HTML,[]),a=new this(r,i,t);return a.fragmentContextID===l.TEMPLATE&&a.tmplInsertionModeStack.unshift(C.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const a=(i=t.location)!==null&&i!==void 0?i:yT,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(t,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(t,n){const r=t===this.document||this.treeAdapter.getNamespaceURI(t)===F.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,F.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=C.TEXT}switchToPlaintextParsing(){this.insertionMode=C.TEXT,this.originalInsertionMode=C.IN_BODY,this.tokenizer.state=$e.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===R.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==F.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=$e.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=$e.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=$e.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=$e.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,F.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,F.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(R.HTML,F.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,l.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:u,endCol:c,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:u,endCol:c,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),a=n.type===ye.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===l.SVG&&this.treeAdapter.getTagName(n)===R.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===F.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===l.MGLYPH||t.tagID===l.MALIGNMARK)&&!this._isIntegrationPoint(r,n,F.HTML)}_processToken(t){switch(t.type){case ye.CHARACTER:{this.onCharacter(t);break}case ye.NULL_CHARACTER:{this.onNullCharacter(t);break}case ye.COMMENT:{this.onComment(t);break}case ye.DOCTYPE:{this.onDoctype(t);break}case ye.START_TAG:{this._processStartTag(t);break}case ye.END_TAG:{this.onEndTag(t);break}case ye.EOF:{this.onEof(t);break}case ye.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return gT(t,i,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Ot.Marker||this.openElements.contains(i.element)),r=n<0?t-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=C.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case l.TR:{this.insertionMode=C.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=C.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=C.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=C.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=C.IN_TABLE;return}case l.BODY:{this.insertionMode=C.IN_BODY;return}case l.FRAMESET:{this.insertionMode=C.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(t);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?C.AFTER_HEAD:C.BEFORE_HEAD;return}case l.TD:case l.TH:{if(t>0){this.insertionMode=C.IN_CELL;return}break}case l.HEAD:{if(t>0){this.insertionMode=C.IN_HEAD;return}break}}this.insertionMode=C.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=C.IN_SELECT_IN_TABLE;return}}this.insertionMode=C.IN_SELECT}_isElementCausesFosterParenting(t){return ed.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===F.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return H1[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Qy(this,t);return}switch(this.insertionMode){case C.INITIAL:{Vn(this,t);break}case C.BEFORE_HTML:{Kn(this,t);break}case C.BEFORE_HEAD:{Jn(this,t);break}case C.IN_HEAD:{Zn(this,t);break}case C.IN_HEAD_NO_SCRIPT:{er(this,t);break}case C.AFTER_HEAD:{tr(this,t);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:{nd(this,t);break}case C.TEXT:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ji(this,t);break}case C.IN_TABLE_TEXT:{ud(this,t);break}case C.IN_COLUMN_GROUP:{$r(this,t);break}case C.AFTER_BODY:{Wr(this,t);break}case C.AFTER_AFTER_BODY:{Fr(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Xy(this,t);return}switch(this.insertionMode){case C.INITIAL:{Vn(this,t);break}case C.BEFORE_HTML:{Kn(this,t);break}case C.BEFORE_HEAD:{Jn(this,t);break}case C.IN_HEAD:{Zn(this,t);break}case C.IN_HEAD_NO_SCRIPT:{er(this,t);break}case C.AFTER_HEAD:{tr(this,t);break}case C.TEXT:{this._insertCharacters(t);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ji(this,t);break}case C.IN_COLUMN_GROUP:{$r(this,t);break}case C.AFTER_BODY:{Wr(this,t);break}case C.AFTER_AFTER_BODY:{Fr(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Ba(this,t);return}switch(this.insertionMode){case C.INITIAL:case C.BEFORE_HTML:case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_TEMPLATE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{Ba(this,t);break}case C.IN_TABLE_TEXT:{zn(this,t);break}case C.AFTER_BODY:{wT(this,t);break}case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{vT(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case C.INITIAL:{kT(this,t);break}case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:{this._err(t,D.misplacedDoctype);break}case C.IN_TABLE_TEXT:{zn(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,D.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Ky(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case C.INITIAL:{Vn(this,t);break}case C.BEFORE_HTML:{NT(this,t);break}case C.BEFORE_HEAD:{OT(this,t);break}case C.IN_HEAD:{It(this,t);break}case C.IN_HEAD_NO_SCRIPT:{PT(this,t);break}case C.AFTER_HEAD:{BT(this,t);break}case C.IN_BODY:{rt(this,t);break}case C.IN_TABLE:{Nn(this,t);break}case C.IN_TABLE_TEXT:{zn(this,t);break}case C.IN_CAPTION:{Ly(this,t);break}case C.IN_COLUMN_GROUP:{vs(this,t);break}case C.IN_TABLE_BODY:{gi(this,t);break}case C.IN_ROW:{bi(this,t);break}case C.IN_CELL:{My(this,t);break}case C.IN_SELECT:{dd(this,t);break}case C.IN_SELECT_IN_TABLE:{Fy(this,t);break}case C.IN_TEMPLATE:{Hy(this,t);break}case C.AFTER_BODY:{Vy(this,t);break}case C.IN_FRAMESET:{zy(this,t);break}case C.AFTER_FRAMESET:{Wy(this,t);break}case C.AFTER_AFTER_BODY:{Yy(this,t);break}case C.AFTER_AFTER_FRAMESET:{qy(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Jy(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case C.INITIAL:{Vn(this,t);break}case C.BEFORE_HTML:{RT(this,t);break}case C.BEFORE_HEAD:{LT(this,t);break}case C.IN_HEAD:{DT(this,t);break}case C.IN_HEAD_NO_SCRIPT:{MT(this,t);break}case C.AFTER_HEAD:{FT(this,t);break}case C.IN_BODY:{pi(this,t);break}case C.TEXT:{Sy(this,t);break}case C.IN_TABLE:{ar(this,t);break}case C.IN_TABLE_TEXT:{zn(this,t);break}case C.IN_CAPTION:{Dy(this,t);break}case C.IN_COLUMN_GROUP:{Py(this,t);break}case C.IN_TABLE_BODY:{Fa(this,t);break}case C.IN_ROW:{ld(this,t);break}case C.IN_CELL:{By(this,t);break}case C.IN_SELECT:{fd(this,t);break}case C.IN_SELECT_IN_TABLE:{Uy(this,t);break}case C.IN_TEMPLATE:{jy(this,t);break}case C.AFTER_BODY:{md(this,t);break}case C.IN_FRAMESET:{$y(this,t);break}case C.AFTER_FRAMESET:{Gy(this,t);break}case C.AFTER_AFTER_BODY:{Fr(this,t);break}}}onEof(t){switch(this.insertionMode){case C.INITIAL:{Vn(this,t);break}case C.BEFORE_HTML:{Kn(this,t);break}case C.BEFORE_HEAD:{Jn(this,t);break}case C.IN_HEAD:{Zn(this,t);break}case C.IN_HEAD_NO_SCRIPT:{er(this,t);break}case C.AFTER_HEAD:{tr(this,t);break}case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{sd(this,t);break}case C.TEXT:{Cy(this,t);break}case C.IN_TABLE_TEXT:{zn(this,t);break}case C.IN_TEMPLATE:{hd(this,t);break}case C.AFTER_BODY:case C.IN_FRAMESET:case C.AFTER_FRAMESET:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{ws(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===T.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.TEXT:case C.IN_COLUMN_GROUP:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{this._insertCharacters(t);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:case C.AFTER_BODY:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{td(this,t);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ji(this,t);break}case C.IN_TABLE_TEXT:{od(this,t);break}}}}function _T(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):ad(e,t),n}function xT(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(r<0?0:r),e.activeFormattingElements.removeEntry(t)),n}function ST(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,s=i;s!==n;a++,s=i){i=e.openElements.getCommonAncestor(s);const o=e.activeFormattingElements.getElementEntry(s),u=o&&a>=TT;!o||u?(u&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(s)):(s=CT(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function CT(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function IT(e,t,n){const r=e.treeAdapter.getTagName(t),i=Pn(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);i===l.TEMPLATE&&a===F.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function AT(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function As(e,t){for(let n=0;n<ET;n++){const r=_T(e,t);if(!r)break;const i=xT(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=ST(e,i,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),s&&IT(e,s,a),AT(e,i,r)}}function Ba(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function wT(e,t){e._appendCommentNode(t,e.openElements.items[0])}function vT(e,t){e._appendCommentNode(t,e.document)}function ws(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&e._setEndLocation(a,t)}}}}function kT(e,t){e._setDocumentType(t);const n=t.forceQuirks?bt.QUIRKS:aT(t);iT(t)||e._err(t,D.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=C.BEFORE_HTML}function Vn(e,t){e._err(t,D.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,bt.QUIRKS),e.insertionMode=C.BEFORE_HTML,e._processToken(t)}function NT(e,t){t.tagID===l.HTML?(e._insertElement(t,F.HTML),e.insertionMode=C.BEFORE_HEAD):Kn(e,t)}function RT(e,t){const n=t.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&Kn(e,t)}function Kn(e,t){e._insertFakeRootElement(),e.insertionMode=C.BEFORE_HEAD,e._processToken(t)}function OT(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.HEAD:{e._insertElement(t,F.HTML),e.headElement=e.openElements.current,e.insertionMode=C.IN_HEAD;break}default:Jn(e,t)}}function LT(e,t){const n=t.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?Jn(e,t):e._err(t,D.endTagWithoutMatchingOpenElement)}function Jn(e,t){e._insertFakeElement(R.HEAD,l.HEAD),e.headElement=e.openElements.current,e.insertionMode=C.IN_HEAD,e._processToken(t)}function It(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{e._appendElement(t,F.HTML),t.ackSelfClosing=!0;break}case l.TITLE:{e._switchToTextParsing(t,$e.RCDATA);break}case l.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$e.RAWTEXT):(e._insertElement(t,F.HTML),e.insertionMode=C.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{e._switchToTextParsing(t,$e.RAWTEXT);break}case l.SCRIPT:{e._switchToTextParsing(t,$e.SCRIPT_DATA);break}case l.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=C.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(C.IN_TEMPLATE);break}case l.HEAD:{e._err(t,D.misplacedStartTagForHeadElement);break}default:Zn(e,t)}}function DT(e,t){switch(t.tagID){case l.HEAD:{e.openElements.pop(),e.insertionMode=C.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{Zn(e,t);break}case l.TEMPLATE:{pn(e,t);break}default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function pn(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==l.TEMPLATE&&e._err(t,D.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,D.endTagWithoutMatchingOpenElement)}function Zn(e,t){e.openElements.pop(),e.insertionMode=C.AFTER_HEAD,e._processToken(t)}function PT(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{It(e,t);break}case l.NOSCRIPT:{e._err(t,D.nestedNoscriptInHead);break}default:er(e,t)}}function MT(e,t){switch(t.tagID){case l.NOSCRIPT:{e.openElements.pop(),e.insertionMode=C.IN_HEAD;break}case l.BR:{er(e,t);break}default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function er(e,t){const n=t.type===ye.EOF?D.openElementsLeftAfterEof:D.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=C.IN_HEAD,e._processToken(t)}function BT(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.BODY:{e._insertElement(t,F.HTML),e.framesetOk=!1,e.insertionMode=C.IN_BODY;break}case l.FRAMESET:{e._insertElement(t,F.HTML),e.insertionMode=C.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{e._err(t,D.abandonedHeadElementChild),e.openElements.push(e.headElement,l.HEAD),It(e,t),e.openElements.remove(e.headElement);break}case l.HEAD:{e._err(t,D.misplacedStartTagForHeadElement);break}default:tr(e,t)}}function FT(e,t){switch(t.tagID){case l.BODY:case l.HTML:case l.BR:{tr(e,t);break}case l.TEMPLATE:{pn(e,t);break}default:e._err(t,D.endTagWithoutMatchingOpenElement)}}function tr(e,t){e._insertFakeElement(R.BODY,l.BODY),e.insertionMode=C.IN_BODY,mi(e,t)}function mi(e,t){switch(t.type){case ye.CHARACTER:{nd(e,t);break}case ye.WHITESPACE_CHARACTER:{td(e,t);break}case ye.COMMENT:{Ba(e,t);break}case ye.START_TAG:{rt(e,t);break}case ye.END_TAG:{pi(e,t);break}case ye.EOF:{sd(e,t);break}}}function td(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function nd(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function UT(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function HT(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function jT(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_FRAMESET)}function VT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML)}function zT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),Ma.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,F.HTML)}function $T(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function WT(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML),n||(e.formElement=e.openElements.current))}function GT(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===l.LI&&i===l.LI||(n===l.DD||n===l.DT)&&(i===l.DD||i===l.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==l.ADDRESS&&i!==l.DIV&&i!==l.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML)}function YT(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML),e.tokenizer.state=$e.PLAINTEXT}function qT(e,t){e.openElements.hasInScope(l.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.framesetOk=!1}function XT(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(R.A);n&&(As(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function QT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function KT(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(l.NOBR)&&(As(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,F.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function JT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function ZT(e,t){e.treeAdapter.getDocumentMode(e.document)!==bt.QUIRKS&&e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,F.HTML),e.framesetOk=!1,e.insertionMode=C.IN_TABLE}function rd(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,F.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function id(e){const t=zl(e,un.TYPE);return t!=null&&t.toLowerCase()===bT}function ey(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,F.HTML),id(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function ty(e,t){e._appendElement(t,F.HTML),t.ackSelfClosing=!0}function ny(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._appendElement(t,F.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function ry(e,t){t.tagName=R.IMG,t.tagID=l.IMG,rd(e,t)}function iy(e,t){e._insertElement(t,F.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$e.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=C.TEXT}function ay(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$e.RAWTEXT)}function sy(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$e.RAWTEXT)}function _u(e,t){e._switchToTextParsing(t,$e.RAWTEXT)}function oy(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===C.IN_TABLE||e.insertionMode===C.IN_CAPTION||e.insertionMode===C.IN_TABLE_BODY||e.insertionMode===C.IN_ROW||e.insertionMode===C.IN_CELL?C.IN_SELECT_IN_TABLE:C.IN_SELECT}function uy(e,t){e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML)}function cy(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,F.HTML)}function ly(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(l.RTC),e._insertElement(t,F.HTML)}function dy(e,t){e._reconstructActiveFormattingElements(),Jl(t),Is(t),t.selfClosing?e._appendElement(t,F.MATHML):e._insertElement(t,F.MATHML),t.ackSelfClosing=!0}function fy(e,t){e._reconstructActiveFormattingElements(),Zl(t),Is(t),t.selfClosing?e._appendElement(t,F.SVG):e._insertElement(t,F.SVG),t.ackSelfClosing=!0}function xu(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,F.HTML)}function rt(e,t){switch(t.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{QT(e,t);break}case l.A:{XT(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{zT(e,t);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{VT(e,t);break}case l.LI:case l.DD:case l.DT:{GT(e,t);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{rd(e,t);break}case l.HR:{ny(e,t);break}case l.RB:case l.RTC:{cy(e,t);break}case l.RT:case l.RP:{ly(e,t);break}case l.PRE:case l.LISTING:{$T(e,t);break}case l.XMP:{ay(e,t);break}case l.SVG:{fy(e,t);break}case l.HTML:{UT(e,t);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{It(e,t);break}case l.BODY:{HT(e,t);break}case l.FORM:{WT(e,t);break}case l.NOBR:{KT(e,t);break}case l.MATH:{dy(e,t);break}case l.TABLE:{ZT(e,t);break}case l.INPUT:{ey(e,t);break}case l.PARAM:case l.TRACK:case l.SOURCE:{ty(e,t);break}case l.IMAGE:{ry(e,t);break}case l.BUTTON:{qT(e,t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{JT(e,t);break}case l.IFRAME:{sy(e,t);break}case l.SELECT:{oy(e,t);break}case l.OPTION:case l.OPTGROUP:{uy(e,t);break}case l.NOEMBED:case l.NOFRAMES:{_u(e,t);break}case l.FRAMESET:{jT(e,t);break}case l.TEXTAREA:{iy(e,t);break}case l.NOSCRIPT:{e.options.scriptingEnabled?_u(e,t):xu(e,t);break}case l.PLAINTEXT:{YT(e,t);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:xu(e,t)}}function hy(e,t){if(e.openElements.hasInScope(l.BODY)&&(e.insertionMode=C.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function my(e,t){e.openElements.hasInScope(l.BODY)&&(e.insertionMode=C.AFTER_BODY,md(e,t))}function py(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function gy(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(l.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(l.FORM):n&&e.openElements.remove(n))}function by(e){e.openElements.hasInButtonScope(l.P)||e._insertFakeElement(R.P,l.P),e._closePElement()}function Ey(e){e.openElements.hasInListItemScope(l.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(l.LI),e.openElements.popUntilTagNamePopped(l.LI))}function Ty(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function yy(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function _y(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function xy(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(R.BR,l.BR),e.openElements.pop(),e.framesetOk=!1}function ad(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],s=e.openElements.tagIDs[i];if(r===s&&(r!==l.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(a,s))break}}function pi(e,t){switch(t.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{As(e,t);break}case l.P:{by(e);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{py(e,t);break}case l.LI:{Ey(e);break}case l.DD:case l.DT:{Ty(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{yy(e);break}case l.BR:{xy(e);break}case l.BODY:{hy(e,t);break}case l.HTML:{my(e,t);break}case l.FORM:{gy(e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{_y(e,t);break}case l.TEMPLATE:{pn(e,t);break}default:ad(e,t)}}function sd(e,t){e.tmplInsertionModeStack.length>0?hd(e,t):ws(e,t)}function Sy(e,t){var n;t.tagID===l.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Cy(e,t){e._err(t,D.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Ji(e,t){if(ed.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=C.IN_TABLE_TEXT,t.type){case ye.CHARACTER:{ud(e,t);break}case ye.WHITESPACE_CHARACTER:{od(e,t);break}}else gr(e,t)}function Iy(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_CAPTION}function Ay(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_COLUMN_GROUP}function wy(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(R.COLGROUP,l.COLGROUP),e.insertionMode=C.IN_COLUMN_GROUP,vs(e,t)}function vy(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_TABLE_BODY}function ky(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(R.TBODY,l.TBODY),e.insertionMode=C.IN_TABLE_BODY,gi(e,t)}function Ny(e,t){e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Ry(e,t){id(t)?e._appendElement(t,F.HTML):gr(e,t),t.ackSelfClosing=!0}function Oy(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,F.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Nn(e,t){switch(t.tagID){case l.TD:case l.TH:case l.TR:{ky(e,t);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{It(e,t);break}case l.COL:{wy(e,t);break}case l.FORM:{Oy(e,t);break}case l.TABLE:{Ny(e,t);break}case l.TBODY:case l.TFOOT:case l.THEAD:{vy(e,t);break}case l.INPUT:{Ry(e,t);break}case l.CAPTION:{Iy(e,t);break}case l.COLGROUP:{Ay(e,t);break}default:gr(e,t)}}function ar(e,t){switch(t.tagID){case l.TABLE:{e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode());break}case l.TEMPLATE:{pn(e,t);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:gr(e,t)}}function gr(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,mi(e,t),e.fosterParentingEnabled=n}function od(e,t){e.pendingCharacterTokens.push(t)}function ud(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function zn(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)gr(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const cd=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function Ly(e,t){const n=t.tagID;cd.has(n)?e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=C.IN_TABLE,Nn(e,t)):rt(e,t)}function Dy(e,t){const n=t.tagID;switch(n){case l.CAPTION:case l.TABLE:{e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=C.IN_TABLE,n===l.TABLE&&ar(e,t));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:pi(e,t)}}function vs(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.COL:{e._appendElement(t,F.HTML),t.ackSelfClosing=!0;break}case l.TEMPLATE:{It(e,t);break}default:$r(e,t)}}function Py(e,t){switch(t.tagID){case l.COLGROUP:{e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=C.IN_TABLE);break}case l.TEMPLATE:{pn(e,t);break}case l.COL:break;default:$r(e,t)}}function $r(e,t){e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=C.IN_TABLE,e._processToken(t))}function gi(e,t){switch(t.tagID){case l.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_ROW;break}case l.TH:case l.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(R.TR,l.TR),e.insertionMode=C.IN_ROW,bi(e,t);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE,Nn(e,t));break}default:Nn(e,t)}}function Fa(e,t){const n=t.tagID;switch(t.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE);break}case l.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE,ar(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:ar(e,t)}}function bi(e,t){switch(t.tagID){case l.TH:case l.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,F.HTML),e.insertionMode=C.IN_CELL,e.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE_BODY,gi(e,t));break}default:Nn(e,t)}}function ld(e,t){switch(t.tagID){case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE_BODY);break}case l.TABLE:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE_BODY,Fa(e,t));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(l.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=C.IN_TABLE_BODY,Fa(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:ar(e,t)}}function My(e,t){const n=t.tagID;cd.has(n)?(e.openElements.hasInTableScope(l.TD)||e.openElements.hasInTableScope(l.TH))&&(e._closeTableCell(),bi(e,t)):rt(e,t)}function By(e,t){const n=t.tagID;switch(n){case l.TD:case l.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=C.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),ld(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:pi(e,t)}}function dd(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._insertElement(t,F.HTML);break}case l.OPTGROUP:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._insertElement(t,F.HTML);break}case l.HR:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._appendElement(t,F.HTML),t.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),t.tagID!==l.SELECT&&e._processStartTag(t));break}case l.SCRIPT:case l.TEMPLATE:{It(e,t);break}}}function fd(e,t){switch(t.tagID){case l.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===l.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===l.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop();break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop();break}case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode());break}case l.TEMPLATE:{pn(e,t);break}}}function Fy(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e._processStartTag(t)):dd(e,t)}function Uy(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e.onEndTag(t)):fd(e,t)}function Hy(e,t){switch(t.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{It(e,t);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.tmplInsertionModeStack[0]=C.IN_TABLE,e.insertionMode=C.IN_TABLE,Nn(e,t);break}case l.COL:{e.tmplInsertionModeStack[0]=C.IN_COLUMN_GROUP,e.insertionMode=C.IN_COLUMN_GROUP,vs(e,t);break}case l.TR:{e.tmplInsertionModeStack[0]=C.IN_TABLE_BODY,e.insertionMode=C.IN_TABLE_BODY,gi(e,t);break}case l.TD:case l.TH:{e.tmplInsertionModeStack[0]=C.IN_ROW,e.insertionMode=C.IN_ROW,bi(e,t);break}default:e.tmplInsertionModeStack[0]=C.IN_BODY,e.insertionMode=C.IN_BODY,rt(e,t)}}function jy(e,t){t.tagID===l.TEMPLATE&&pn(e,t)}function hd(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ws(e,t)}function Vy(e,t){t.tagID===l.HTML?rt(e,t):Wr(e,t)}function md(e,t){var n;if(t.tagID===l.HTML){if(e.fragmentContext||(e.insertionMode=C.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===l.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Wr(e,t)}function Wr(e,t){e.insertionMode=C.IN_BODY,mi(e,t)}function zy(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.FRAMESET:{e._insertElement(t,F.HTML);break}case l.FRAME:{e._appendElement(t,F.HTML),t.ackSelfClosing=!0;break}case l.NOFRAMES:{It(e,t);break}}}function $y(e,t){t.tagID===l.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==l.FRAMESET&&(e.insertionMode=C.AFTER_FRAMESET))}function Wy(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.NOFRAMES:{It(e,t);break}}}function Gy(e,t){t.tagID===l.HTML&&(e.insertionMode=C.AFTER_AFTER_FRAMESET)}function Yy(e,t){t.tagID===l.HTML?rt(e,t):Fr(e,t)}function Fr(e,t){e.insertionMode=C.IN_BODY,mi(e,t)}function qy(e,t){switch(t.tagID){case l.HTML:{rt(e,t);break}case l.NOFRAMES:{It(e,t);break}}}function Xy(e,t){t.chars=Ve,e._insertCharacters(t)}function Qy(e,t){e._insertCharacters(t),e.framesetOk=!1}function pd(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==F.HTML&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Ky(e,t){if(fT(t))pd(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===F.MATHML?Jl(t):r===F.SVG&&(hT(t),Zl(t)),Is(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Jy(e,t){if(t.tagID===l.P||t.tagID===l.BR){pd(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===F.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}R.AREA,R.BASE,R.BASEFONT,R.BGSOUND,R.BR,R.COL,R.EMBED,R.FRAME,R.HR,R.IMG,R.INPUT,R.KEYGEN,R.LINK,R.META,R.PARAM,R.SOURCE,R.TRACK,R.WBR;const Zy=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Su={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function gd(e,t){const n=c2(e),r=Fl("type",{handlers:{root:e2,element:t2,text:n2,comment:Ed,doctype:r2,raw:a2},unknown:s2}),i={parser:n?new yu(Su):yu.getFragmentParser(void 0,Su),handle(o){r(o,i)},stitches:!1,options:t||{}};r(e,i),Mn(i,Mt());const a=n?i.parser.document:i.parser.getFragment(),s=d1(a,{file:i.options.file});return i.stitches&&hi(s,"comment",function(o,u,c){const d=o;if(d.value.stitch&&c&&u!==void 0){const f=c.children;return f[u]=d.value.stitch,u}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function bd(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function e2(e,t){bd(e.children,t)}function t2(e,t){o2(e,t),bd(e.children,t),u2(e,t)}function n2(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:ye.CHARACTER,chars:e.value,location:br(e)};Mn(t,Mt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function r2(e,t){const n={type:ye.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:br(e)};Mn(t,Mt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function i2(e,t){t.stitches=!0;const n=l2(e);if("children"in e&&"children"in n){const r=gd({type:"root",children:e.children},t.options);n.children=r.children}Ed({type:"comment",value:{stitch:n}},t)}function Ed(e,t){const n=e.value,r={type:ye.COMMENT,data:n,location:br(e)};Mn(t,Mt(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function a2(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Td(t,Mt(e)),t.parser.tokenizer.write(e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function s2(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))i2(n,t);else{let r="";throw Zy.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Mn(e,t){Td(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=$e.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Td(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function o2(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$e.PLAINTEXT)return;Mn(t,Mt(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:sn.html;i===sn.html&&n==="svg"&&(i=sn.svg);const a=g1({...e,children:[]},{space:i===sn.svg?"svg":"html"}),s={type:ye.START_TAG,tagName:n,tagID:Pn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:br(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function u2(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&C1.includes(n)||t.parser.tokenizer.state===$e.PLAINTEXT)return;Mn(t,oi(e));const r={type:ye.END_TAG,tagName:n,tagID:Pn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:br(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$e.RCDATA||t.parser.tokenizer.state===$e.RAWTEXT||t.parser.tokenizer.state===$e.SCRIPT_DATA)&&(t.parser.tokenizer.state=$e.DATA)}function c2(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function br(e){const t=Mt(e)||{line:void 0,column:void 0,offset:void 0},n=oi(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function l2(e){return"children"in e?kn({...e,children:[]}):kn(e)}function ks(e){return function(t,n){return gd(t,{...e,file:n})}}const Ns=({children:e})=>g.jsx("div",{className:"p-3",children:e}),d2=({content:e,metaData:t})=>g.jsx(Ns,{children:g.jsx("div",{className:"flex justify-end",children:g.jsx("div",{className:`ml-auto w-fit max-w-full px-4 py-3 rounded-2xl rounded-br-md transition-all duration-300 text-left ${t?.isErrorMessage?"bg-red-100 border-l-4 border-red-400 text-red-800 shadow-md animate-fade-in":"chatsystem-user-message chatsystem-primary-background text-white shadow-sm"}`,children:g.jsx("div",{children:g.jsx(xs,{rehypePlugins:[ks],children:e&&e})})})})});function Cu(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function f2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function h2(e,t,n){const i=di((n||{}).ignore||[]),a=m2(t);let s=-1;for(;++s<a.length;)Ll(e,"text",o);function o(c,d){let f=-1,h;for(;++f<d.length;){const m=d[f],y=h?h.children:void 0;if(i(m,y?y.indexOf(m):void 0,h))return;h=m}if(h)return u(c,d)}function u(c,d){const f=d[d.length-1],h=a[s][0],m=a[s][1];let y=0;const A=f.children.indexOf(c);let I=!1,w=[];h.lastIndex=0;let N=h.exec(c.value);for(;N;){const M=N.index,v={index:N.index,input:N.input,stack:[...d,c]};let p=m(...N,v);if(typeof p=="string"&&(p=p.length>0?{type:"text",value:p}:void 0),p===!1?h.lastIndex=M+1:(y!==M&&w.push({type:"text",value:c.value.slice(y,M)}),Array.isArray(p)?w.push(...p):p&&w.push(p),y=M+N[0].length,I=!0),!h.global)break;N=h.exec(c.value)}return I?(y<c.value.length&&w.push({type:"text",value:c.value.slice(y)}),f.children.splice(A,1,...w)):w=[c],A+w.length}}function m2(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(;++r<n.length;){const i=n[r];t.push([p2(i[0]),g2(i[1])])}return t}function p2(e){return typeof e=="string"?new RegExp(f2(e),"g"):e}function g2(e){return typeof e=="function"?e:function(){return e}}const Zi="phrasing",ea=["autolink","link","image","label"];function b2(){return{transforms:[C2],enter:{literalAutolink:T2,literalAutolinkEmail:ta,literalAutolinkHttp:ta,literalAutolinkWww:ta},exit:{literalAutolink:S2,literalAutolinkEmail:x2,literalAutolinkHttp:y2,literalAutolinkWww:_2}}}function E2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Zi,notInConstruct:ea},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Zi,notInConstruct:ea},{character:":",before:"[ps]",after:"\\/",inConstruct:Zi,notInConstruct:ea}]}}function T2(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ta(e){this.config.enter.autolinkProtocol.call(this,e)}function y2(e){this.config.exit.autolinkProtocol.call(this,e)}function _2(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 x2(e){this.config.exit.autolinkEmail.call(this,e)}function S2(e){this.exit(e)}function C2(e){h2(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,I2],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),A2]],{ignore:["link","linkReference"]})}function I2(e,t,n,r,i){let a="";if(!yd(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!w2(n)))return!1;const s=v2(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 A2(e,t,n,r){return!yd(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function w2(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function v2(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Cu(e,"(");let a=Cu(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function yd(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||dn(n)||ui(n))&&(!t||n!==47)}_d.peek=B2;function k2(){this.buffer()}function N2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function R2(){this.buffer()}function O2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function L2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ct(this.sliceSerialize(e)).toLowerCase(),n.label=t}function D2(e){this.exit(e)}function P2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ct(this.sliceSerialize(e)).toLowerCase(),n.label=t}function M2(e){this.exit(e)}function B2(){return"["}function _d(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 F2(){return{enter:{gfmFootnoteCallString:k2,gfmFootnoteCall:N2,gfmFootnoteDefinitionLabelString:R2,gfmFootnoteDefinition:O2},exit:{gfmFootnoteCallString:L2,gfmFootnoteCall:D2,gfmFootnoteDefinitionLabelString:P2,gfmFootnoteDefinition:M2}}}function U2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_d},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const o=a.createTracker(s);let u=o.move("[^");const c=a.enter("footnoteDefinition"),d=a.enter("label");return u+=o.move(a.safe(a.associationId(r),{before:u,after:"]"})),d(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
|
|
62
|
+
`:" ")+a.indentLines(a.containerFlow(r,o.current()),t?xd:H2))),c(),u}}function H2(e,t,n){return t===0?e:xd(e,t,n)}function xd(e,t,n){return(n?"":" ")+e}const j2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Sd.peek=G2;function V2(){return{canContainEols:["delete"],enter:{strikethrough:$2},exit:{strikethrough:W2}}}function z2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:j2}],handlers:{delete:Sd}}}function $2(e){this.enter({type:"delete",children:[]},e)}function W2(e){this.exit(e)}function Sd(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 G2(){return"~"}function Y2(e){return e.length}function q2(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Y2,a=[],s=[],o=[],u=[];let c=0,d=-1;for(;++d<e.length;){const b=[],A=[];let I=-1;for(e[d].length>c&&(c=e[d].length);++I<e[d].length;){const w=X2(e[d][I]);if(n.alignDelimiters!==!1){const N=i(w);A[I]=N,(u[I]===void 0||N>u[I])&&(u[I]=N)}b.push(w)}s[d]=b,o[d]=A}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)a[f]=Iu(r[f]);else{const b=Iu(r);for(;++f<c;)a[f]=b}f=-1;const h=[],m=[];for(;++f<c;){const b=a[f];let A="",I="";b===99?(A=":",I=":"):b===108?A=":":b===114&&(I=":");let w=n.alignDelimiters===!1?1:Math.max(1,u[f]-A.length-I.length);const N=A+"-".repeat(w)+I;n.alignDelimiters!==!1&&(w=A.length+w+I.length,w>u[f]&&(u[f]=w),m[f]=w),h[f]=N}s.splice(1,0,h),o.splice(1,0,m),d=-1;const y=[];for(;++d<s.length;){const b=s[d],A=o[d];f=-1;const I=[];for(;++f<c;){const w=b[f]||"";let N="",M="";if(n.alignDelimiters!==!1){const v=u[f]-(A[f]||0),p=a[f];p===114?N=" ".repeat(v):p===99?v%2?(N=" ".repeat(v/2+.5),M=" ".repeat(v/2-.5)):(N=" ".repeat(v/2),M=N):M=" ".repeat(v)}n.delimiterStart!==!1&&!f&&I.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||f)&&I.push(" "),n.alignDelimiters!==!1&&I.push(N),I.push(w),n.alignDelimiters!==!1&&I.push(M),n.padding!==!1&&I.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&I.push("|")}y.push(n.delimiterEnd===!1?I.join("").replace(/ +$/,""):I.join(""))}return y.join(`
|
|
63
|
+
`)}function X2(e){return e==null?"":String(e)}function Iu(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Q2(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()),K2);return i(),s}function K2(e,t,n){return">"+(n?"":" ")+e}function J2(e,t){return Au(e,t.inConstruct,!0)&&!Au(e,t.notInConstruct,!1)}function Au(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function wu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
64
|
+
`&&J2(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
65
|
+
`}function Z2(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>s&&(s=a):a=1,i=r+t.length,r=n.indexOf(t,i);return s}function e_(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function t_(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function n_(e,t,n,r){const i=t_(n),a=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(e_(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,r_);return f(),h}const o=n.createTracker(r),u=i.repeat(Math.max(Z2(a,i)+1,3)),c=n.enter("codeFenced");let d=o.move(u);if(e.lang){const f=n.enter(`codeFencedLang${s}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
|
|
66
66
|
`,encode:["`"],...o.current()})),f()}return d+=o.move(`
|
|
67
67
|
`),a&&(d+=o.move(a+`
|
|
68
|
-
`)),d+=o.move(u),c(),d}function
|
|
69
|
-
`,...u.current()}))),o(),e.title&&(o=n.enter(`title${a}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),s(),c}function
|
|
68
|
+
`)),d+=o.move(u),c(),d}function r_(e,t,n){return(n?"":" ")+e}function Rs(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 i_(e,t,n,r){const i=Rs(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
69
|
+
`,...u.current()}))),o(),e.title&&(o=n.enter(`title${a}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),s(),c}function a_(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Cd.peek=s_;function Cd(e,t,n,r){const i=a_(n),a=n.enter("emphasis"),s=n.createTracker(r);let o=s.move(i);return o+=s.move(n.containerPhrasing(e,{before:o,after:i,...s.current()})),o+=s.move(i),a(),o}function s_(e,t,n){return n.options.emphasis||"*"}function o_(e,t){let n=!1;return hi(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ka}),!!((!e.depth||e.depth<3)&&ms(e)&&(t.options.setext||n))}function u_(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(o_(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...a.current(),before:`
|
|
70
70
|
`,after:`
|
|
71
71
|
`});return f(),d(),h+`
|
|
72
72
|
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
73
73
|
`))+1))}const s="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");a.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
74
|
-
`,...a.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),u(),o(),c}
|
|
75
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:u,tableRow:o}};function s(m,y,
|
|
76
|
-
`))}function u(m,y,g,w){const I=g.enter("tableCell"),v=g.enter("phrasing"),R=g.containerPhrasing(m,{...w,before:a,after:a});return v(),I(),R}function c(m,y){return j2(m,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function d(m,y,g){const w=m.children;let I=-1;const v=[],R=y.enter("table");for(;++I<w.length;)v[I]=f(w[I],y,g);return R(),v}function f(m,y,g){const w=m.children;let I=-1;const v=[],R=y.enter("tableRow");for(;++I<w.length;)v[I]=u(w[I],m,y,g);return R(),v}function h(m,y,g){let w=wd.inlineCode(m,y,g);return g.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function v_(){return{exit:{taskListCheckValueChecked:xu,taskListCheckValueUnchecked:xu,paragraph:N_}}}function k_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:R_}}}function xu(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function N_(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function R_(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let u=wd.listItem(e,t,n,{...r,...o.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(d){return d+s}}function O_(){return[l2(),R2(),P2(),__(),v_()]}function L_(e){return{extensions:[d2(),O2(e),M2(),w_(e),k_()]}}const D_={tokenize:H_,partial:!0},vd={tokenize:j_,partial:!0},kd={tokenize:V_,partial:!0},Nd={tokenize:z_,partial:!0},P_={tokenize:$_,partial:!0},Rd={name:"wwwAutolink",tokenize:F_,previous:Ld},Od={name:"protocolAutolink",tokenize:U_,previous:Dd},zt={name:"emailAutolink",tokenize:B_,previous:Pd},Bt={};function M_(){return{text:Bt}}let nn=48;for(;nn<123;)Bt[nn]=zt,nn++,nn===58?nn=65:nn===91&&(nn=97);Bt[43]=zt;Bt[45]=zt;Bt[46]=zt;Bt[95]=zt;Bt[72]=[zt,Od];Bt[104]=[zt,Od];Bt[87]=[zt,Rd];Bt[119]=[zt,Rd];function B_(e,t,n){const r=this;let i,a;return s;function s(f){return!La(f)||!Pd.call(r,r.previous)||As(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return La(f)?(e.consume(f),o):f===64?(e.consume(f),u):n(f)}function u(f){return f===46?e.check(P_,d,c)(f):f===45||f===95||Ke(f)?(a=!0,e.consume(f),u):d(f)}function c(f){return e.consume(f),i=!0,u}function d(f){return a&&i&&rt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function F_(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Ld.call(r,r.previous)||As(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(D_,e.attempt(vd,e.attempt(kd,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function U_(e,t,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&Dd.call(r,r.previous)&&!As(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(rt(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),u}return n(f)}function u(f){return f===47?(e.consume(f),a?c:(a=!0,u)):n(f)}function c(f){return f===null||Mr(f)||Pe(f)||fn(f)||ai(f)?n(f):e.attempt(vd,e.attempt(kd,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function H_(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function j_(e,t,n){let r,i,a;return s;function s(c){return c===46||c===95?e.check(Nd,u,o)(c):c===null||Pe(c)||fn(c)||c!==45&&ai(c)?u(c):(a=!0,e.consume(c),s)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function u(c){return i||r||!a?n(c):t(c)}}function V_(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Nd,t,a)(s):s===null||Pe(s)||fn(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function z_(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Pe(o)||fn(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Pe(o)||fn(o)?t(o):r(o)}function a(o){return rt(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):rt(o)?(e.consume(o),s):n(o)}}function $_(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ke(a)?n(a):t(a)}}function Ld(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Pe(e)}function Dd(e){return!rt(e)}function Pd(e){return!(e===47||La(e))}function La(e){return e===43||e===45||e===46||e===95||Ke(e)}function As(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const W_={tokenize:Z_,partial:!0};function G_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Q_,continuation:{tokenize:K_},exit:J_}},text:{91:{name:"gfmFootnoteCall",tokenize:X_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Y_,resolveTo:q_}}}}function Y_(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!s||!s._balanced)return n(u);const c=At(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function q_(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function X_(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(a>999||f===93&&!s||f===null||f===91||Pe(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(At(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Pe(f)||(s=!0),a++,e.consume(f),f===92?d:c}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Q_(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return u;function u(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(y)}function d(y){if(s>999||y===93&&!o||y===null||y===91||Pe(y))return n(y);if(y===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return a=At(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Pe(y)||(o=!0),s++,e.consume(y),y===92?f:d}function f(y){return y===91||y===92||y===93?(e.consume(y),s++,d):d(y)}function h(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),i.includes(a)||i.push(a),Ie(e,m,"gfmFootnoteDefinitionWhitespace")):n(y)}function m(y){return t(y)}}function K_(e,t,n){return e.check(hr,t,e.attempt(W_,t,n))}function J_(e){e.exit("gfmFootnoteDefinition")}function Z_(e,t,n){const r=this;return Ie(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function ex(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let c=u;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[u][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[u][1].start)},h=[["enter",d,o],["enter",s[c][1],o],["exit",s[c][1],o],["enter",f,o]],m=o.parser.constructs.insideSpan.null;m&&ht(h,h.length,0,si(m,s.slice(c+1,u),o)),ht(h,h.length,0,[["exit",f,o],["enter",s[u][1],o],["exit",s[u][1],o],["exit",d,o]]),ht(s,c-1,u-c+3,h),u=c+h.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function a(s,o,u){const c=this.previous,d=this.events;let f=0;return h;function h(y){return c===126&&d[d.length-1][1].type!=="characterEscape"?u(y):(s.enter("strikethroughSequenceTemporary"),m(y))}function m(y){const g=Br(c);if(y===126)return f>1?u(y):(s.consume(y),f++,m);if(f<2&&!n)return u(y);const w=s.exit("strikethroughSequenceTemporary"),I=Br(y);return w._open=!I||I===2&&!!g,w._close=!g||g===2&&!!I,o(y)}}}class tx{constructor(){this.map=[]}add(t,n,r){nx(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function nx(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function rx(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function ix(){return{flow:{null:{name:"table",tokenize:ax,resolveAll:sx}}}}function ax(e,t,n){const r=this;let i=0,a=0,s;return o;function o(N){let H=r.events.length-1;for(;H>-1;){const z=r.events[H][1].type;if(z==="lineEnding"||z==="linePrefix")H--;else break}const V=H>-1?r.events[H][1].type:null,j=V==="tableHead"||V==="tableRow"?p:u;return j===p&&r.parser.lazy[r.now().line]?n(N):j(N)}function u(N){return e.enter("tableHead"),e.enter("tableRow"),c(N)}function c(N){return N===124||(s=!0,a+=1),d(N)}function d(N){return N===null?n(N):ce(N)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),m):n(N):xe(N)?Ie(e,d,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),f(N)))}function f(N){return N===null||N===124||Pe(N)?(e.exit("data"),d(N)):(e.consume(N),N===92?h:f)}function h(N){return N===92||N===124?(e.consume(N),f):f(N)}function m(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),s=!1,xe(N)?Ie(e,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):y(N))}function y(N){return N===45||N===58?w(N):N===124?(s=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),g):A(N)}function g(N){return xe(N)?Ie(e,w,"whitespace")(N):w(N)}function w(N){return N===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),I):N===45?(a+=1,I(N)):N===null||ce(N)?M(N):A(N)}function I(N){return N===45?(e.enter("tableDelimiterFiller"),v(N)):A(N)}function v(N){return N===45?(e.consume(N),v):N===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(N))}function R(N){return xe(N)?Ie(e,M,"whitespace")(N):M(N)}function M(N){return N===124?y(N):N===null||ce(N)?!s||i!==a?A(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):A(N)}function A(N){return n(N)}function p(N){return e.enter("tableRow"),L(N)}function L(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),L):N===null||ce(N)?(e.exit("tableRow"),t(N)):xe(N)?Ie(e,L,"whitespace")(N):(e.enter("data"),B(N))}function B(N){return N===null||N===124||Pe(N)?(e.exit("data"),L(N)):(e.consume(N),N===92?G:B)}function G(N){return N===92||N===124?(e.consume(N),B):B(N)}}function sx(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,u=0,c,d,f;const h=new tx;for(;++n<e.length;){const m=e[n],y=m[1];m[0]==="enter"?y.type==="tableHead"?(o=!1,u!==0&&(Su(h,t,u,c,d),d=void 0,u=0),c={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},h.add(n,0,[["enter",c,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},h.add(n,0,[["enter",d,t]])),i=y.type==="tableDelimiterRow"?2:d?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=vr(h,t,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=vr(h,t,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):y.type==="tableHead"?(o=!0,u=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(u=n,a[1]!==0?(s[0]=s[1],f=vr(h,t,a,i,n,f)):s[1]!==0&&(f=vr(h,t,s,i,n,f)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&Su(h,t,u,c,d),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=rx(t.events,n))}return e}function vr(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},_n(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const u=_n(t.events,n[1]);if(a={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const c=_n(t.events,n[2]),d=_n(t.events,n[3]),f={type:o,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,g=n[3]-n[2]-1;e.add(y,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},_n(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function Su(e,t,n,r,i){const a=[],s=_n(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 _n(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ox={name:"tasklistCheck",tokenize:cx};function ux(){return{text:{91:ox}}}function cx(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return Pe(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return ce(u)?t(u):xe(u)?e.check({tokenize:lx},t,n)(u):n(u)}}function lx(e,t,n){return Ie(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function dx(e){return ol([M_(),G_(),ex(e),ix(),ux()])}const fx={};function hx(e){const t=this,n=e||fx,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(dx(n)),a.push(O_()),s.push(L_(n))}const Cu=new Set;function mx(e){return Cu.has(e)?!1:(Cu.add(e),!0)}function px(e,{root:t,rootSelector:n,rootMargin:r="0px",threshold:i=0,dedupeKey:a}={}){const s=S.useRef(!1),o=S.useRef();return S.useCallback(c=>{if(o.current?.(),o.current=void 0,!c||s.current)return;const d=t??(n?document.querySelector(n):null),f=()=>{a&&!mx(a)||(s.current=!0,e())};if(typeof window>"u"||!("IntersectionObserver"in window)){f();return}const h=new IntersectionObserver((m,y)=>{m[0]?.isIntersecting&&(y.disconnect(),f())},{root:d,rootMargin:r,threshold:i});h.observe(c),o.current=()=>h.disconnect()},[t,n,r,i,a,e])}function gx(e,t){if(!t||!e)return e;const n=t.replace(/^[?&]+/,""),[r,i]=e.split("#"),a=r.includes("?")?"&":"?",s=`${r}${a}${n}`;return i?`${s}#${i}`:s}function bx({href:e="",queryParamToAppend:t="",children:n,context:r,onClick:i,seenRootEl:a,...s}){const{companySettings:o}=S.useContext(Pt),u=ei(),c=e.startsWith("/")||typeof window<"u"&&e.startsWith(window.location.origin),d=u,f=gx(e,t||o.api.tracking?.queryParamToAppend||""),h=()=>{const v=`${d}/tracking/clicked/${r.appToken}`,R={discussionId:r.discussionId,urlClicked:e};try{fetch(v,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(R),keepalive:!0,cache:"no-store",credentials:"omit",mode:"cors"}).catch(()=>{})}catch{}},m=()=>{const v=`${d}/tracking/displayed/${r.appToken}`,R={discussionId:r.discussionId,urlSeen:e};try{fetch(v,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(R),keepalive:!0,cache:"no-store",credentials:"omit",mode:"cors"}).catch(()=>{})}catch{}},y=S.useMemo(()=>`${r.appToken}::${r.discussionId}::${e}`,[r.appToken,r.discussionId,e]),g=px(m,{root:a,threshold:0,rootMargin:"0px 0px -10% 0px",dedupeKey:y}),w=v=>{h(),i?.(v)},I=c?{}:{target:"_blank",rel:"noopener noreferrer"};return c?b.jsx("a",{ref:g,href:f,...s,onClick:w,className:"customLinkInternal",children:n}):b.jsx("a",{ref:g,href:f,...I,...s,onClick:w,className:"customLinkExternal",children:n})}const Md=({logo:e,label:t,className:n})=>b.jsxs("div",{className:`flex items-center gap-2 logoWrapper${n?` ${n}`:""}`,children:[e,b.jsx("p",{className:"font-bold",children:t})]}),Bd=()=>{const{companySettings:e}=S.useContext(Pt);return b.jsx("div",{className:`assistant
|
|
74
|
+
`,...a.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),u(),o(),c}Id.peek=c_;function Id(e){return e.value||""}function c_(){return"<"}Ad.peek=l_;function Ad(e,t,n,r){const i=Rs(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${a}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),c+=u.move(")"),s(),c}function l_(){return"!"}wd.peek=d_;function wd(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const c=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return s(),n.stack=d,a(),i==="full"||!c||c!==f?u+=o.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function d_(){return"!"}vd.peek=f_;function vd(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<n.unsafe.length;){const s=n.unsafe[a],o=n.compilePattern(s);let u;if(s.atBreak)for(;u=o.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function f_(){return"`"}function kd(e,t){const n=ms(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Nd.peek=h_;function Nd(e,t,n,r){const i=Rs(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,u;if(kd(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),o(),n.stack=d,f}o=n.enter("link"),u=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(u=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=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),u()),c+=s.move(")"),o(),c}function h_(e,t,n){return kd(e,n)?"<":"["}Rd.peek=m_;function Rd(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return s(),n.stack=d,a(),i==="full"||!c||c!==f?u+=o.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function m_(){return"["}function Os(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 p_(e){const t=Os(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}function g_(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Od(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}function b_(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=e.ordered?g_(n):Os(n);const o=e.ordered?s==="."?")":".":p_(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Od(n)===s&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=o),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),c}function E_(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function T_(e,t,n,r){const i=E_(n);let a=n.bulletCurrent||Os(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),d);return u(),c;function d(f,h,m){return h?(m?"":" ".repeat(s))+f:(m?a:a+" ".repeat(s-a.length))+f}}function y_(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),i(),s}const __=di(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function x_(e,t,n,r){return(e.children.some(function(s){return __(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function S_(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ld.peek=C_;function Ld(e,t,n,r){const i=S_(n),a=n.enter("strong"),s=n.createTracker(r);let o=s.move(i+i);return o+=s.move(n.containerPhrasing(e,{before:o,after:i,...s.current()})),o+=s.move(i+i),a(),o}function C_(e,t,n){return n.options.strong||"*"}function I_(e,t,n,r){return n.safe(e.value,r)}function A_(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}function w_(e,t,n){const r=(Od(n)+(n.options.ruleSpaces?" ":"")).repeat(A_(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Dd={blockquote:Q2,break:wu,code:n_,definition:i_,emphasis:Cd,hardBreak:wu,heading:u_,html:Id,image:Ad,imageReference:wd,inlineCode:vd,link:Nd,linkReference:Rd,list:b_,listItem:T_,paragraph:y_,root:x_,strong:Ld,text:I_,thematicBreak:w_};function v_(){return{enter:{table:k_,tableData:vu,tableHeader:vu,tableRow:R_},exit:{codeText:O_,table:N_,tableData:na,tableHeader:na,tableRow:na}}}function k_(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function N_(e){this.exit(e),this.data.inTable=void 0}function R_(e){this.enter({type:"tableRow",children:[]},e)}function na(e){this.exit(e)}function vu(e){this.enter({type:"tableCell",children:[]},e)}function O_(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,L_));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function L_(e,t){return t==="|"?t:e}function D_(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
75
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:u,tableRow:o}};function s(m,y,b,A){return c(d(m,b,A),m.align)}function o(m,y,b,A){const I=f(m,b,A),w=c([I]);return w.slice(0,w.indexOf(`
|
|
76
|
+
`))}function u(m,y,b,A){const I=b.enter("tableCell"),w=b.enter("phrasing"),N=b.containerPhrasing(m,{...A,before:a,after:a});return w(),I(),N}function c(m,y){return q2(m,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function d(m,y,b){const A=m.children;let I=-1;const w=[],N=y.enter("table");for(;++I<A.length;)w[I]=f(A[I],y,b);return N(),w}function f(m,y,b){const A=m.children;let I=-1;const w=[],N=y.enter("tableRow");for(;++I<A.length;)w[I]=u(A[I],m,y,b);return N(),w}function h(m,y,b){let A=Dd.inlineCode(m,y,b);return b.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function P_(){return{exit:{taskListCheckValueChecked:ku,taskListCheckValueUnchecked:ku,paragraph:B_}}}function M_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:F_}}}function ku(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function B_(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function F_(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let u=Dd.listItem(e,t,n,{...r,...o.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(d){return d+s}}function U_(){return[b2(),F2(),V2(),v_(),P_()]}function H_(e){return{extensions:[E2(),U2(e),z2(),D_(e),M_()]}}const j_={tokenize:Y_,partial:!0},Pd={tokenize:q_,partial:!0},Md={tokenize:X_,partial:!0},Bd={tokenize:Q_,partial:!0},V_={tokenize:K_,partial:!0},Fd={name:"wwwAutolink",tokenize:W_,previous:Hd},Ud={name:"protocolAutolink",tokenize:G_,previous:jd},zt={name:"emailAutolink",tokenize:$_,previous:Vd},Bt={};function z_(){return{text:Bt}}let nn=48;for(;nn<123;)Bt[nn]=zt,nn++,nn===58?nn=65:nn===91&&(nn=97);Bt[43]=zt;Bt[45]=zt;Bt[46]=zt;Bt[95]=zt;Bt[72]=[zt,Ud];Bt[104]=[zt,Ud];Bt[87]=[zt,Fd];Bt[119]=[zt,Fd];function $_(e,t,n){const r=this;let i,a;return s;function s(f){return!Ua(f)||!Vd.call(r,r.previous)||Ls(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Ua(f)?(e.consume(f),o):f===64?(e.consume(f),u):n(f)}function u(f){return f===46?e.check(V_,d,c)(f):f===45||f===95||tt(f)?(a=!0,e.consume(f),u):d(f)}function c(f){return e.consume(f),i=!0,u}function d(f){return a&&i&&st(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function W_(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Hd.call(r,r.previous)||Ls(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(j_,e.attempt(Pd,e.attempt(Md,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function G_(e,t,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&jd.call(r,r.previous)&&!Ls(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(st(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),u}return n(f)}function u(f){return f===47?(e.consume(f),a?c:(a=!0,u)):n(f)}function c(f){return f===null||Ur(f)||Me(f)||dn(f)||ui(f)?n(f):e.attempt(Pd,e.attempt(Md,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Y_(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function q_(e,t,n){let r,i,a;return s;function s(c){return c===46||c===95?e.check(Bd,u,o)(c):c===null||Me(c)||dn(c)||c!==45&&ui(c)?u(c):(a=!0,e.consume(c),s)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function u(c){return i||r||!a?n(c):t(c)}}function X_(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Bd,t,a)(s):s===null||Me(s)||dn(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function Q_(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Me(o)||dn(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Me(o)||dn(o)?t(o):r(o)}function a(o){return st(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):st(o)?(e.consume(o),s):n(o)}}function K_(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return tt(a)?n(a):t(a)}}function Hd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Me(e)}function jd(e){return!st(e)}function Vd(e){return!(e===47||Ua(e))}function Ua(e){return e===43||e===45||e===46||e===95||tt(e)}function Ls(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const J_={tokenize:sx,partial:!0};function Z_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rx,continuation:{tokenize:ix},exit:ax}},text:{91:{name:"gfmFootnoteCall",tokenize:nx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ex,resolveTo:tx}}}}function ex(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!s||!s._balanced)return n(u);const c=Ct(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function tx(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function nx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(a>999||f===93&&!s||f===null||f===91||Me(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Ct(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Me(f)||(s=!0),a++,e.consume(f),f===92?d:c}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function rx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return u;function u(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(y)}function d(y){if(s>999||y===93&&!o||y===null||y===91||Me(y))return n(y);if(y===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return a=Ct(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Me(y)||(o=!0),s++,e.consume(y),y===92?f:d}function f(y){return y===91||y===92||y===93?(e.consume(y),s++,d):d(y)}function h(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),i.includes(a)||i.push(a),Ie(e,m,"gfmFootnoteDefinitionWhitespace")):n(y)}function m(y){return t(y)}}function ix(e,t,n){return e.check(mr,t,e.attempt(J_,t,n))}function ax(e){e.exit("gfmFootnoteDefinition")}function sx(e,t,n){const r=this;return Ie(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function ox(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let c=u;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[u][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[u][1].start)},h=[["enter",d,o],["enter",s[c][1],o],["exit",s[c][1],o],["enter",f,o]],m=o.parser.constructs.insideSpan.null;m&&mt(h,h.length,0,ci(m,s.slice(c+1,u),o)),mt(h,h.length,0,[["exit",f,o],["enter",s[u][1],o],["exit",s[u][1],o],["exit",d,o]]),mt(s,c-1,u-c+3,h),u=c+h.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function a(s,o,u){const c=this.previous,d=this.events;let f=0;return h;function h(y){return c===126&&d[d.length-1][1].type!=="characterEscape"?u(y):(s.enter("strikethroughSequenceTemporary"),m(y))}function m(y){const b=Hr(c);if(y===126)return f>1?u(y):(s.consume(y),f++,m);if(f<2&&!n)return u(y);const A=s.exit("strikethroughSequenceTemporary"),I=Hr(y);return A._open=!I||I===2&&!!b,A._close=!b||b===2&&!!I,o(y)}}}class ux{constructor(){this.map=[]}add(t,n,r){cx(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function cx(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function lx(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function dx(){return{flow:{null:{name:"table",tokenize:fx,resolveAll:hx}}}}function fx(e,t,n){const r=this;let i=0,a=0,s;return o;function o(k){let U=r.events.length-1;for(;U>-1;){const G=r.events[U][1].type;if(G==="lineEnding"||G==="linePrefix")U--;else break}const W=U>-1?r.events[U][1].type:null,H=W==="tableHead"||W==="tableRow"?p:u;return H===p&&r.parser.lazy[r.now().line]?n(k):H(k)}function u(k){return e.enter("tableHead"),e.enter("tableRow"),c(k)}function c(k){return k===124||(s=!0,a+=1),d(k)}function d(k){return k===null?n(k):de(k)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),m):n(k):_e(k)?Ie(e,d,"whitespace")(k):(a+=1,s&&(s=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),f(k)))}function f(k){return k===null||k===124||Me(k)?(e.exit("data"),d(k)):(e.consume(k),k===92?h:f)}function h(k){return k===92||k===124?(e.consume(k),f):f(k)}function m(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(k):(e.enter("tableDelimiterRow"),s=!1,_e(k)?Ie(e,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):y(k))}function y(k){return k===45||k===58?A(k):k===124?(s=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),b):v(k)}function b(k){return _e(k)?Ie(e,A,"whitespace")(k):A(k)}function A(k){return k===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),I):k===45?(a+=1,I(k)):k===null||de(k)?M(k):v(k)}function I(k){return k===45?(e.enter("tableDelimiterFiller"),w(k)):v(k)}function w(k){return k===45?(e.consume(k),w):k===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(k))}function N(k){return _e(k)?Ie(e,M,"whitespace")(k):M(k)}function M(k){return k===124?y(k):k===null||de(k)?!s||i!==a?v(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):v(k)}function v(k){return n(k)}function p(k){return e.enter("tableRow"),O(k)}function O(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),O):k===null||de(k)?(e.exit("tableRow"),t(k)):_e(k)?Ie(e,O,"whitespace")(k):(e.enter("data"),B(k))}function B(k){return k===null||k===124||Me(k)?(e.exit("data"),O(k)):(e.consume(k),k===92?X:B)}function X(k){return k===92||k===124?(e.consume(k),B):B(k)}}function hx(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,u=0,c,d,f;const h=new ux;for(;++n<e.length;){const m=e[n],y=m[1];m[0]==="enter"?y.type==="tableHead"?(o=!1,u!==0&&(Nu(h,t,u,c,d),d=void 0,u=0),c={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},h.add(n,0,[["enter",c,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},h.add(n,0,[["enter",d,t]])),i=y.type==="tableDelimiterRow"?2:d?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=Rr(h,t,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=Rr(h,t,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):y.type==="tableHead"?(o=!0,u=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(u=n,a[1]!==0?(s[0]=s[1],f=Rr(h,t,a,i,n,f)):s[1]!==0&&(f=Rr(h,t,s,i,n,f)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&Nu(h,t,u,c,d),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=lx(t.events,n))}return e}function Rr(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},yn(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const u=yn(t.events,n[1]);if(a={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const c=yn(t.events,n[2]),d=yn(t.events,n[3]),f={type:o,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,b=n[3]-n[2]-1;e.add(y,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},yn(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function Nu(e,t,n,r,i){const a=[],s=yn(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 yn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const mx={name:"tasklistCheck",tokenize:gx};function px(){return{text:{91:mx}}}function gx(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return Me(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return de(u)?t(u):_e(u)?e.check({tokenize:bx},t,n)(u):n(u)}}function bx(e,t,n){return Ie(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Ex(e){return ml([z_(),Z_(),ox(e),dx(),px()])}const Tx={};function yx(e){const t=this,n=e||Tx,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ex(n)),a.push(U_()),s.push(H_(n))}const Ru=new Set;function _x(e){return Ru.has(e)?!1:(Ru.add(e),!0)}function xx(e,{root:t,rootSelector:n,rootMargin:r="0px",threshold:i=0,dedupeKey:a}={}){const s=S.useRef(!1),o=S.useRef();return S.useCallback(c=>{if(o.current?.(),o.current=void 0,!c||s.current)return;const d=t??(n?document.querySelector(n):null),f=()=>{a&&!_x(a)||(s.current=!0,e())};if(typeof window>"u"||!("IntersectionObserver"in window)){f();return}const h=new IntersectionObserver((m,y)=>{m[0]?.isIntersecting&&(y.disconnect(),f())},{root:d,rootMargin:r,threshold:i});h.observe(c),o.current=()=>h.disconnect()},[t,n,r,i,a,e])}function Sx(e,t){if(!t||!e)return e;const n=t.replace(/^[?&]+/,""),[r,i]=e.split("#"),a=r.includes("?")?"&":"?",s=`${r}${a}${n}`;return i?`${s}#${i}`:s}function Cx({href:e="",queryParamToAppend:t="",children:n,context:r,onClick:i,seenRootEl:a,...s}){const{companySettings:o}=S.useContext(Pt),u=ri(),c=e.startsWith("/")||typeof window<"u"&&e.startsWith(window.location.origin),d=u,f=Sx(e,t||o.api.tracking?.queryParamToAppend||""),h=()=>{const w=`${d}/tracking/clicked/${r.appToken}`,N={discussionId:r.discussionId,urlClicked:e};try{fetch(w,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(N),keepalive:!0,cache:"no-store",credentials:"omit",mode:"cors"}).catch(()=>{})}catch{}},m=()=>{const w=`${d}/tracking/displayed/${r.appToken}`,N={discussionId:r.discussionId,urlSeen:e};try{fetch(w,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(N),keepalive:!0,cache:"no-store",credentials:"omit",mode:"cors"}).catch(()=>{})}catch{}},y=S.useMemo(()=>`${r.appToken}::${r.discussionId}::${e}`,[r.appToken,r.discussionId,e]),b=xx(m,{root:a,threshold:0,rootMargin:"0px 0px -10% 0px",dedupeKey:y}),A=w=>{h(),i?.(w)},I=c?{}:{target:"_blank",rel:"noopener noreferrer"};return c?g.jsx("a",{ref:b,href:f,...s,onClick:A,className:"customLinkInternal",children:n}):g.jsx("a",{ref:b,href:f,...I,...s,onClick:A,className:"customLinkExternal",children:n})}const zd=({logo:e,label:t,className:n})=>g.jsxs("div",{className:`flex items-center gap-2 logoWrapper${n?` ${n}`:""}`,children:[e,g.jsx("p",{className:"font-bold",children:t})]}),$d=()=>{const{companySettings:e}=S.useContext(Pt);return g.jsx("div",{className:`assistant
|
|
77
77
|
transition
|
|
78
78
|
ease-in-out
|
|
79
79
|
delay-50
|
|
@@ -81,8 +81,7 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
81
81
|
flex
|
|
82
82
|
justify-center
|
|
83
83
|
items-center
|
|
84
|
-
`,children:b.jsx(ns,{facet:e.agent.display[K.AgentDisplayFacetRoleType.ASSISTANT]})})},Ex=({content:e,metaData:t,context:n,seenRootEl:r})=>{const{chatlineLabelAssistantTranslation:i,chatlineLabelCustomerSupportTranslation:a}=Ka(),s=t?.authorType==="customer_support_operator"?t.customerSupportAuthorName??a:i,o=K.formatCustomerSupportProviderText({text:e??"",provider:t?.customerSupportProvider});return b.jsx(Ss,{children:b.jsx("div",{className:"chatLineAssistant flex justify-start",children:b.jsxs("div",{className:`mr-auto w-full rounded-2xl rounded-bl-md px-4 py-3 transition-all duration-300 text-left ${t?.isErrorMessage?"bg-red-100 text-red-800 shadow-md animate-fade-in":"bg-slate-100 text-gray-800 shadow-sm"}`,children:[b.jsx(Md,{className:"logoWrapper--assistant w-full justify-start text-left mb-2 text-xs",logo:b.jsx(Bd,{}),label:s}),b.jsx("div",{className:"chatsystem-markdown",children:b.jsx(ps,{remarkPlugins:[hx],remarkRehypeOptions:{passThrough:["link"]},rehypePlugins:[xs],components:{a:({node:u,href:c,children:d,...f})=>b.jsx(bx,{href:c??"",...f,context:n,seenRootEl:r,children:d})},children:o})})]})})})},Tx=({content:e,metaData:t})=>{const n=t?.isErrorMessage;return b.jsx(Ss,{children:b.jsx("div",{className:"chatLineSystemMessage flex justify-center px-2","data-system-event":t?.systemEvent,children:b.jsx("div",{className:`max-w-[90%] rounded-lg border px-3 py-2 text-center text-xs leading-relaxed shadow-sm ${n?"border-red-200 bg-red-50 text-red-800":"border-slate-200 bg-slate-50 text-slate-600"}`,children:b.jsx(ps,{rehypePlugins:[xs],children:e??""})})})})};function Fd(e){const{draftStore:t,currentConversation:n}=S.useContext(Zr),r=Tc(n.discussionId,e.componentId),i=S.useSyncExternalStore(t.subscribe,()=>t.get(r),()=>{});return{value:i!==void 0&&e.isValid(i)?i:e.initialValue,setValue:o=>{const u=t.get(r),c=u!==void 0&&e.isValid(u)?u:e.initialValue,d=typeof o=="function"?o(c):o;t.set(r,d,e.persistent)},clear:()=>t.remove(r)}}const yx={};function ws(e,t,n=!0){return Fd({componentId:e,initialValue:yx,persistent:n,isValid:r=>typeof r=="string"?!1:Object.entries(r).every(([i,a])=>{const s=t.find(o=>o.id===i);return s?s.type==="checkbox"?typeof a=="boolean":typeof a=="string":!1})})}const vs=({children:e,modifier:t,state:n,className:r})=>b.jsx("section",{className:`chatsystem-interactive-widget chatsystem-interactive-widget--${t} chatsystem-interactive-widget--state-${n??"active"} ${r??""} my-2 rounded-xl border border-slate-200 bg-white p-4 text-slate-800 shadow-sm`,children:e}),on=({title:e,description:t})=>e||t?b.jsxs("header",{className:"chatsystem-interactive-widget__copy mb-3 space-y-1",children:[e?b.jsx("h3",{className:"chatsystem-interactive-widget__title text-sm font-semibold text-slate-900",children:e}):null,t?b.jsx("p",{className:"chatsystem-interactive-widget__description text-sm leading-5 text-slate-600",children:t}):null]}):null,pi=({children:e})=>b.jsx("div",{className:"chatsystem-interactive-widget__actions mt-3 flex flex-wrap gap-2",children:e}),ar=({children:e,style:t="primary",disabled:n,type:r="button",onClick:i})=>b.jsx("button",{type:r,disabled:n,onClick:i,className:`chatsystem-interactive-widget__button chatsystem-interactive-widget__button--${t} inline-flex min-h-9 items-center justify-center rounded-lg border px-3 py-2 text-sm font-semibold transition disabled:cursor-not-allowed disabled:opacity-60`,children:e}),An=({id:e,label:t,description:n,required:r,children:i})=>b.jsxs("div",{className:"chatsystem-interactive-widget__field grid gap-1.5",children:[b.jsxs("label",{className:"chatsystem-interactive-widget__label text-sm font-medium text-slate-800",htmlFor:e,children:[t,r?b.jsx("span",{"aria-hidden":"true",children:" *"}):null]}),n?b.jsx("p",{className:"chatsystem-interactive-widget__field-description text-xs text-slate-500",children:n}):null,i]}),Rn=({children:e,tone:t="neutral"})=>b.jsx("div",{className:`chatsystem-interactive-widget__status chatsystem-interactive-widget__status--${t} rounded-lg px-3 py-2 text-sm`,role:t==="danger"?"alert":"status",children:e}),Ki="chatsystem-interactive-widget__control w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm text-slate-900 outline-none transition focus:border-[var(--chatsystem-primary-color)] focus:ring-2 focus:ring-[color-mix(in_srgb,var(--chatsystem-primary-color)_20%,transparent)] disabled:bg-slate-50 disabled:text-slate-500",_x=({widget:e})=>{const t=Hc(),n=Kt(),r=e.state!=="active",i=n.formatMessage({id:"chatbot.interactiveWidget.submitted",defaultMessage:"Sent"}),a=n.formatMessage({id:"chatbot.interactiveWidget.cancelled",defaultMessage:"Cancelled"}),s=n.formatMessage({id:"chatbot.interactiveWidget.submitting",defaultMessage:"Sending…"}),o=n.formatMessage({id:"chatbot.interactiveWidget.unavailable",defaultMessage:"This interaction is no longer available."}),u=e.responseMode==="local_preview",c=n.formatMessage({id:"chatbot.interactiveWidget.preview.notice",defaultMessage:"Demo mode — this form reproduces the real experience. Submitting it does not create a request or transmit your answers."}),d=n.formatMessage({id:"chatbot.interactiveWidget.preview.completed",defaultMessage:"You have tested this form. No request was sent and your answers were not transmitted."}),f=n.formatMessage({id:"chatbot.interactiveWidget.preview.cancelled",defaultMessage:"You have closed the demo form. No information was transmitted."}),h=(y,g)=>{y.kind==="open_url"&&window.open(y.url,"_blank","noopener,noreferrer"),t.submitInteractiveWidget({instanceId:e.instanceId,actionId:y.id,data:g,cancel:y.kind==="cancel"})};let m=null;return e.state==="submitting"&&(m=s),e.state==="submitted"&&(m=u?d:i),e.state==="cancelled"&&(m=u?f:a),e.state==="unavailable"&&(m=o),b.jsxs(vs,{modifier:e.widgetType.replace(/_/g,"-"),state:e.state,className:u?"chatsystem-interactive-widget--local-preview":void 0,children:[u?b.jsx("div",{className:"chatsystem-interactive-widget__preview-notice mb-3 rounded-lg border border-sky-200 bg-sky-50 px-3 py-2 text-xs leading-5 text-sky-900",children:c}):null,b.jsx(xx,{widget:e,disabled:r,onAction:h}),m?b.jsx("div",{className:`mt-3 ${u?"chatsystem-interactive-widget__preview-result":""}`,children:b.jsx(Rn,{tone:e.state==="unavailable"?"warning":"success",children:m})}):null]})},xx=({widget:e,disabled:t,onAction:n})=>{const r=e.presentation;return r.type==="structured_form"?b.jsx(Sx,{instanceId:e.instanceId,persistDraft:e.responseMode==="resume_turn",presentation:r,disabled:t,onSubmit:i=>n({id:"submit",label:r.submitLabel,kind:"submit"},i),onCancel:r.cancelLabel?()=>n({id:"cancel",label:r.cancelLabel,kind:"cancel"}):void 0}):r.type==="card_list"?b.jsxs(b.Fragment,{children:[b.jsx(on,{title:r.title,description:r.description}),b.jsx("div",{className:"chatsystem-interactive-widget__cards grid gap-3",children:r.cards.map(i=>b.jsxs("article",{className:"chatsystem-interactive-widget__card overflow-hidden rounded-lg border border-slate-200",children:[i.imageUrl?b.jsx("img",{className:"chatsystem-interactive-widget__card-image h-32 w-full object-cover",src:i.imageUrl,alt:"",loading:"lazy"}):null,b.jsxs("div",{className:"chatsystem-interactive-widget__card-body p-3",children:[i.eyebrow?b.jsx("p",{className:"text-xs font-semibold uppercase text-slate-500",children:i.eyebrow}):null,b.jsx("h4",{className:"text-sm font-semibold text-slate-900",children:i.title}),i.description?b.jsx("p",{className:"mt-1 text-sm text-slate-600",children:i.description}):null,i.metadata?.map(a=>b.jsxs("div",{className:"chatsystem-interactive-widget__detail mt-2 flex justify-between gap-3 text-xs",children:[b.jsx("span",{className:"text-slate-500",children:a.label}),b.jsx("span",{className:"font-medium text-slate-800",children:a.value})]},a.label)),i.actions?.length?b.jsx(kr,{actions:i.actions,disabled:t,onAction:n}):null]})]},i.id))})]}):r.type==="status_summary"?b.jsxs(b.Fragment,{children:[b.jsx(on,{title:r.title,description:r.description}),b.jsx(Rn,{tone:r.tone,children:r.items?.map(i=>b.jsxs("div",{className:"chatsystem-interactive-widget__detail flex justify-between gap-3 py-1",children:[b.jsx("span",{children:i.label}),b.jsx("strong",{children:i.value})]},i.label))}),r.actions?.length?b.jsx(kr,{actions:r.actions,disabled:t,onAction:n}):null]}):r.type==="explicit_confirmation"?b.jsxs(b.Fragment,{children:[b.jsx(on,{title:r.title,description:r.description}),r.details?.map(i=>b.jsxs("div",{className:"chatsystem-interactive-widget__detail flex justify-between gap-3 border-b border-slate-100 py-2 text-sm",children:[b.jsx("span",{className:"text-slate-500",children:i.label}),b.jsx("strong",{children:i.value})]},i.label)),b.jsx(kr,{disabled:t,onAction:n,actions:[{id:"confirm",label:r.confirmLabel,kind:"submit",style:r.tone==="danger"?"danger":"primary"},{id:"cancel",label:r.cancelLabel,kind:"cancel",style:"secondary"}]})]}):b.jsxs(b.Fragment,{children:[b.jsx(on,{title:r.title,description:r.description}),b.jsx(kr,{actions:r.actions,disabled:t,onAction:n})]})},kr=({actions:e,disabled:t,onAction:n})=>b.jsx(pi,{children:e.map(r=>b.jsx(ar,{style:r.style,disabled:t,onClick:()=>n(r),children:r.label},r.id))}),Sx=({instanceId:e,persistDraft:t,presentation:n,disabled:r,onSubmit:i,onCancel:a})=>{const{value:s,setValue:o}=ws(`interactive:${e}`,n.fields,t),u=d=>{d.preventDefault(),i(s)},c=(d,f)=>o(h=>({...h,[d.id]:f}));return b.jsxs("form",{className:"chatsystem-interactive-widget__form grid gap-3",onSubmit:u,children:[b.jsx(on,{title:n.title,description:n.description}),n.fields.map(d=>b.jsx(An,{id:`${e}-${d.id}`,label:d.label,description:d.description,required:d.required,children:b.jsx(Cx,{id:`${e}-${d.id}`,field:d,value:s[d.id],disabled:r,onChange:f=>c(d,f)})},d.id)),b.jsxs(pi,{children:[b.jsx(ar,{type:"submit",disabled:r,children:n.submitLabel}),n.cancelLabel?b.jsx(ar,{style:"secondary",disabled:r,onClick:a,children:n.cancelLabel}):null]})]})},Cx=({id:e,field:t,value:n,disabled:r,onChange:i})=>t.type==="checkbox"?b.jsx("input",{id:e,className:"chatsystem-interactive-widget__checkbox h-4 w-4",type:"checkbox",checked:n===!0,required:t.required,disabled:r,onChange:a=>i(a.currentTarget.checked)}):t.type==="select"?b.jsxs("select",{id:e,className:Ki,value:typeof n=="string"?n:"",required:t.required,disabled:r,onChange:a=>i(a.currentTarget.value),children:[b.jsx("option",{value:"",children:t.placeholder??""}),t.options.map(a=>b.jsx("option",{value:a.value,children:a.label},a.value))]}):t.type==="textarea"?b.jsx("textarea",{id:e,className:`${Ki} min-h-24 resize-y`,value:typeof n=="string"?n:"",required:t.required,disabled:r,placeholder:t.placeholder,minLength:t.minLength,maxLength:t.maxLength,onChange:a=>i(a.currentTarget.value)}):b.jsx("input",{id:e,className:Ki,type:t.type,value:typeof n=="string"?n:"",required:t.required,disabled:r,placeholder:t.placeholder,minLength:t.minLength,maxLength:t.maxLength,onChange:a=>i(a.currentTarget.value)}),Ix=({userType:e,content:t,metaData:n,context:r,seenRootEl:i})=>{if(n?.interactiveWidget)return b.jsx(_x,{widget:n.interactiveWidget});if(n?.messageKind==="system")return b.jsx(Tx,{content:t,metaData:n});const a=e==="user",s=e==="assistant";return b.jsxs(b.Fragment,{children:[a&&b.jsx(i2,{content:t,metaData:n}),s&&b.jsx(Ex,{content:t,metaData:n,context:r,seenRootEl:i})]})};function Ax(e,t,n){let[r,i]=S.useState(e||t),a=S.useRef(e!==void 0),s=e!==void 0;S.useEffect(()=>{let c=a.current;c!==s&&console.warn(`WARN: A component changed from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),a.current=s},[s]);let o=s?e:r,u=S.useCallback((c,...d)=>{let f=(h,...m)=>{n&&(Object.is(o,h)||n(h,...m)),s||(o=h)};typeof c=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),i((m,...y)=>{let g=c(s?o:m,...y);return f(g,...d),s?m:g})):(s||i(c),f(c,...d))},[s,o,n]);return[o,u]}const zr={prefix:String(Math.round(Math.random()*1e10)),current:0},Ud=S.createContext(zr),wx=S.createContext(!1);let vx=!!(typeof window<"u"&&window.document&&window.document.createElement),Ji=new WeakMap;function kx(e=!1){let t=S.useContext(Ud),n=S.useRef(null);if(n.current===null&&!e){var r,i;let a=(i=S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(a){let s=Ji.get(a);s==null?Ji.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==s.state&&(t.current=s.id,Ji.delete(a))}n.current=++t.current}return n.current}function Nx(e){let t=S.useContext(Ud);t===zr&&!vx&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=kx(!!e),r=t===zr&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${r}-${n}`}function Rx(e){let t=S.useId(),[n]=S.useState(Mx()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${zr.prefix}`;return e||`${r}-${t}`}const Ox=typeof S.useId=="function"?Rx:Nx;function Lx(){return!1}function Dx(){return!0}function Px(e){return()=>{}}function Mx(){return typeof S.useSyncExternalStore=="function"?S.useSyncExternalStore(Px,Lx,Dx):S.useContext(wx)}function Hd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Hd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Bx(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Hd(e))&&(r&&(r+=" "),r+=t);return r}const bn=typeof document<"u"?S.useLayoutEffect:()=>{};function cn(e){const t=S.useRef(null);return bn(()=>{t.current=e},[e]),S.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}function Fx(e){let[t,n]=S.useState(e),r=S.useRef(null),i=cn(()=>{if(!r.current)return;let s=r.current.next();if(s.done){r.current=null;return}t===s.value?i():n(s.value)});bn(()=>{r.current&&i()});let a=cn(s=>{r.current=s(t),i()});return[t,a]}let Ux=!!(typeof window<"u"&&window.document&&window.document.createElement),$r=new Map;function Wr(e){let[t,n]=S.useState(e),r=S.useRef(null),i=Ox(t),a=S.useCallback(s=>{r.current=s},[]);return Ux&&$r.set(i,a),bn(()=>{let s=i;return()=>{$r.delete(s)}},[i]),S.useEffect(()=>{let s=r.current;s&&(r.current=null,n(s))}),i}function Hx(e,t){if(e===t)return e;let n=$r.get(e);if(n)return n(t),t;let r=$r.get(t);return r?(r(e),e):t}function Iu(e=[]){let t=Wr(),[n,r]=Fx(t),i=S.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return bn(i,[t,i,...e]),n}function jx(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const br=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Gr=e=>e&&"window"in e&&e.window===e?e:br(e).defaultView||window;function Yr(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let i in r){let a=t[i],s=r[i];typeof a=="function"&&typeof s=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?t[i]=jx(a,s):(i==="className"||i==="UNSAFE_className")&&typeof a=="string"&&typeof s=="string"?t[i]=Bx(a,s):i==="id"&&a&&s?t.id=Hx(a,s):t[i]=s!==void 0?s:a}}return t}const Vx=new Set(["id"]),zx=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),$x=new Set(["href","target","rel","download","ping","referrerPolicy"]),Wx=/^(data-.*)$/;function Gx(e,t={}){let{labelable:n,isLink:r,propNames:i}=t,a={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(Vx.has(s)||n&&zx.has(s)||r&&$x.has(s)||i?.has(s)||Wx.test(s))&&(a[s]=e[s]);return a}function Au(e){if(Yx())e.focus({preventScroll:!0});else{let t=qx(e);e.focus(),Xx(t)}}let Nr=null;function Yx(){if(Nr==null){Nr=!1;try{document.createElement("div").focus({get preventScroll(){return Nr=!0,!0}})}catch{}}return Nr}function qx(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Xx(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function Qx(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Kx(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Jx(){return Kx(/^Mac/i)}function Zx(){return Qx(/Android/i)}let xn=new Map,Da=new Set;function wu(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let i=xn.get(r.target);i||(i=new Set,xn.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let i=xn.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),xn.delete(r.target)),xn.size===0)){for(let a of Da)a();Da.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?wu():document.addEventListener("DOMContentLoaded",wu));function eS(e){requestAnimationFrame(()=>{xn.size===0?e():Da.add(e)})}function tS(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=Wr(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function nS(e,t){bn(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function rS(e){return e.mozInputSource===0&&e.isTrusted?!0:Zx()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function iS(e,t,n){let r=S.useRef(t),i=cn(()=>{n&&n(r.current)});S.useEffect(()=>{var a;let s=e==null||(a=e.current)===null||a===void 0?void 0:a.form;return s?.addEventListener("reset",i),()=>{s?.removeEventListener("reset",i)}},[e,i])}const aS=S.createContext({register:()=>{}});aS.displayName="PressResponderContext";class sS{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function oS(e){let t=S.useRef({isFocused:!1,observer:null});bn(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=cn(r=>{e?.(r)});return S.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,a=s=>{t.current.isFocused=!1,i.disabled&&n(new sS("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",a,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let o=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:o})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:o}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function uS(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const a=S.useCallback(u=>{if(u.target===u.currentTarget)return r&&r(u),i&&i(!1),!0},[r,i]),s=oS(a),o=S.useCallback(u=>{u.target===u.currentTarget&&document.activeElement===u.target&&(n&&n(u),i&&i(!0),s(u))},[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?o:void 0,onBlur:!t&&(r||i)?a:void 0}}}let Bn=null,cS=new Set,tr=new Map,hn=!1,Pa=!1;function gi(e,t){for(let n of cS)n(e,t)}function lS(e){return!(e.metaKey||!Jx()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function qr(e){hn=!0,lS(e)&&(Bn="keyboard",gi("keyboard",e))}function Tt(e){Bn="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(hn=!0,gi("pointer",e))}function jd(e){rS(e)&&(hn=!0,Bn="virtual")}function Vd(e){e.target===window||e.target===document||(!hn&&!Pa&&(Bn="virtual",gi("virtual",e)),hn=!1,Pa=!1)}function zd(){hn=!1,Pa=!0}function vu(e){if(typeof window>"u"||tr.get(Gr(e)))return;const t=Gr(e),n=br(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){hn=!0,r.apply(this,arguments)},n.addEventListener("keydown",qr,!0),n.addEventListener("keyup",qr,!0),n.addEventListener("click",jd,!0),t.addEventListener("focus",Vd,!0),t.addEventListener("blur",zd,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Tt,!0),n.addEventListener("pointermove",Tt,!0),n.addEventListener("pointerup",Tt,!0)):(n.addEventListener("mousedown",Tt,!0),n.addEventListener("mousemove",Tt,!0),n.addEventListener("mouseup",Tt,!0)),t.addEventListener("beforeunload",()=>{$d(e)},{once:!0}),tr.set(t,{focus:r})}const $d=(e,t)=>{const n=Gr(e),r=br(e);t&&r.removeEventListener("DOMContentLoaded",t),tr.has(n)&&(n.HTMLElement.prototype.focus=tr.get(n).focus,r.removeEventListener("keydown",qr,!0),r.removeEventListener("keyup",qr,!0),r.removeEventListener("click",jd,!0),n.removeEventListener("focus",Vd,!0),n.removeEventListener("blur",zd,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Tt,!0),r.removeEventListener("pointermove",Tt,!0),r.removeEventListener("pointerup",Tt,!0)):(r.removeEventListener("mousedown",Tt,!0),r.removeEventListener("mousemove",Tt,!0),r.removeEventListener("mouseup",Tt,!0)),tr.delete(n))};function dS(e){const t=br(e);let n;return t.readyState!=="loading"?vu(e):(n=()=>{vu(e)},t.addEventListener("DOMContentLoaded",n)),()=>$d(e,n)}typeof document<"u"&&dS();function fS(){return Bn}function hS(e){Bn=e,gi(e,null)}function ku(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){t=!1}};e(r),t&&n.stopPropagation()}}function mS(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:ku(e.onKeyDown),onKeyUp:ku(e.onKeyUp)}}}function pS(e){const t=br(e);if(fS()==="virtual"){let n=t.activeElement;eS(()=>{t.activeElement===n&&e.isConnected&&Au(e)})}else Au(e)}function gS(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}class ks{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let i=this.fastMap.get(n??null);if(!i)return;let a=new Nu({scopeRef:t});i.addChild(a),a.parent=i,this.fastMap.set(t,a),r&&(a.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let a of this.traverse())a!==n&&n.nodeToRestore&&a.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&gS(a.nodeToRestore,n.scopeRef.current)&&(a.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(a=>r&&r.addChild(a))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new ks;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(t=i.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new Nu({scopeRef:null}),this.fastMap.set(null,this.root)}}class Nu{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}new ks;let bS=S.createContext(null);function ES(e){let t=S.useContext(bS)||{};nS(t,e);let{ref:n,...r}=t;return r}function TS(e,t){let{focusProps:n}=uS(e),{keyboardProps:r}=mS(e),i=Yr(n,r),a=ES(t),s=e.isDisabled?{}:a,o=S.useRef(e.autoFocus);return S.useEffect(()=>{o.current&&t.current&&pS(t.current),o.current=!1},[t]),{focusableProps:Yr({...i,tabIndex:e.excludeFromTabOrder&&!e.isDisabled?-1:void 0},s)}}function yS(e,t,n){let{validationBehavior:r,focus:i}=e;bn(()=>{if(r==="native"&&n?.current){let u=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(u),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation(xS(n.current))}});let a=cn(()=>{t.resetValidation()}),s=cn(u=>{var c;t.displayValidation.isInvalid||t.commitValidation();let d=n==null||(c=n.current)===null||c===void 0?void 0:c.form;if(!u.defaultPrevented&&n&&d&&SS(d)===n.current){var f;i?i():(f=n.current)===null||f===void 0||f.focus(),hS("keyboard")}u.preventDefault()}),o=cn(()=>{t.commitValidation()});S.useEffect(()=>{let u=n?.current;if(!u)return;let c=u.form;return u.addEventListener("invalid",s),u.addEventListener("change",o),c?.addEventListener("reset",a),()=>{u.removeEventListener("invalid",s),u.removeEventListener("change",o),c?.removeEventListener("reset",a)}},[n,s,o,a,r])}function _S(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function xS(e){return{isInvalid:!e.validity.valid,validationDetails:_S(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function SS(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(!n.validity.valid)return n}return null}const Wd={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Gd={...Wd,customError:!0,valid:!1},zn={isInvalid:!1,validationDetails:Wd,validationErrors:[]},CS=S.createContext({}),Ru="__formValidationState"+Date.now();function IS(e){if(e[Ru]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[Ru];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return AS(e)}function AS(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:s,validationBehavior:o="aria"}=e;n&&(t||(t=n==="invalid"));let u=t?{isInvalid:!0,validationErrors:[],validationDetails:Gd}:null,c=S.useMemo(()=>Ou(wS(s,i)),[s,i]);a?.validationDetails.valid&&(a=null);let d=S.useContext(CS),f=S.useMemo(()=>r?Array.isArray(r)?r.flatMap(N=>Ma(d[N])):Ma(d[r]):[],[d,r]),[h,m]=S.useState(d),[y,g]=S.useState(!1);d!==h&&(m(d),g(!1));let w=S.useMemo(()=>Ou(y?[]:f),[y,f]),I=S.useRef(zn),[v,R]=S.useState(zn),M=S.useRef(zn),A=()=>{if(!p)return;L(!1);let N=c||a||I.current;Zi(N,M.current)||(M.current=N,R(N))},[p,L]=S.useState(!1);return S.useEffect(A),{realtimeValidation:u||w||c||a||zn,displayValidation:o==="native"?u||w||v:u||w||c||a||v,updateValidation(N){o==="aria"&&!Zi(v,N)?R(N):I.current=N},resetValidation(){let N=zn;Zi(N,M.current)||(M.current=N,R(N)),o==="native"&&L(!1),g(!0)},commitValidation(){o==="native"&&L(!0),g(!0)}}}function Ma(e){return e?Array.isArray(e)?e:[e]:[]}function wS(e,t){if(typeof e=="function"){let n=e(t);if(n&&typeof n!="boolean")return Ma(n)}return[]}function Ou(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:Gd}:null}function Zi(e,t){return e===t?!0:e&&t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((n,r)=>n===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([n,r])=>t.validationDetails[n]===r)}function vS(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a="label"}=e;t=Wr(t);let s=Wr(),o={};n?(r=r?`${s} ${r}`:s,o={id:s,htmlFor:a==="label"?t:void 0}):!r&&!i&&console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");let u=tS({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:o,fieldProps:u}}function kS(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:s}=vS(e),o=Iu([!!t,!!n,r,i]),u=Iu([!!t,!!n,r,i]);return s=Yr(s,{"aria-describedby":[o,u,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:a,fieldProps:s,descriptionProps:{id:o},errorMessageProps:{id:u}}}function NS(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:i=!1,isReadOnly:a=!1,type:s="text",validationBehavior:o="aria"}=e,[u,c]=Ax(e.value,e.defaultValue||"",e.onChange),{focusableProps:d}=TS(e,t),f=IS({...e,value:u}),{isInvalid:h,validationErrors:m,validationDetails:y}=f.displayValidation,{labelProps:g,fieldProps:w,descriptionProps:I,errorMessageProps:v}=kS({...e,isInvalid:h,errorMessage:e.errorMessage||m}),R=Gx(e,{labelable:!0});const M={type:s,pattern:e.pattern};return iS(t,u,c),yS(e,f,t),S.useEffect(()=>{if(t.current instanceof Gr(t.current).HTMLTextAreaElement){let A=t.current;Object.defineProperty(A,"defaultValue",{get:()=>A.value,set:()=>{},configurable:!0})}},[t]),{labelProps:g,inputProps:Yr(R,n==="input"&&M,{disabled:r,readOnly:a,required:i&&o==="native","aria-required":i&&o==="aria"||void 0,"aria-invalid":h||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],value:u,onChange:A=>c(A.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,placeholder:e.placeholder,inputMode:e.inputMode,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...d,...w}),descriptionProps:I,errorMessageProps:v,isInvalid:h,validationErrors:m,validationDetails:y}}const RS=e=>e.charCodeAt(e.length-1)===10,OS=e=>{const[t,n]=S.useState(""),r=e.value??t,i=()=>{w.current&&(w.current.style.height="auto",w.current.style.height=w.current.scrollHeight+"px")},a=()=>{w.current&&(w.current.style.height="auto")},s=N=>{e.value===void 0&&n(N),e.onChange?.(N)};S.useEffect(i,[r]);const{label:o,SubmitComponent:u,onSubmit:c,isLoadingStream:d,audioEnabled:f=!1,MicComponent:h,onPressMicButton:m,LoadingComponent:y,onPressLoadingButton:g}=e,w=S.useRef(null),{labelProps:I,inputProps:v}=NS({...e,inputElementType:"textarea"},w),R=N=>{RS(N.target.value)||s(N.target.value)},M=N=>{if(N.key==="Enter"||N.code==="Enter"||N.keyCode===13||N.code==="NumpadEnter"){if(N.shiftKey)s(r+`
|
|
85
|
-
`);else if(!N.shiftKey){N.preventDefault(),N.stopPropagation(),d||B();return}}},A=N=>{(N.key==="Enter"||N.code==="Enter"||N.keyCode===13||N.code==="NumpadEnter")&&(N.preventDefault(),N.stopPropagation())},p=r.trim().length>0,L=!!(e.isDisabled||e.shouldDisableIfInputIsEmpty&&!p),B=()=>{L||c?.(r)!==!1&&(a(),s(""))},G=()=>d&&y?b.jsx(y,{onPressLoadingButton:g}):u?!f||!h||p?b.jsx(u,{onSubmitButton:B,isDisabled:L}):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"block md:hidden",children:b.jsx(h,{onPressMicButton:m})}),b.jsxs("div",{className:"chatsystem-composer__desktop-actions",children:[b.jsx(h,{onPressMicButton:m}),b.jsx(u,{onSubmitButton:B,isDisabled:L})]})]}):null;return b.jsxs("div",{className:`chatsystem-composer ${e.classNameContainer??""} w-full`,children:[b.jsxs("div",{className:"chatsystem-composer__field",children:[b.jsx("label",{...I,className:e.classNameLabel,children:o}),b.jsx("textarea",{...v,ref:w,className:`chatsystem-composer__input ${e.classNameTextarea??""}`,onChange:R,value:r,rows:1,onKeyDown:M,onKeyUp:A})]}),b.jsx("div",{className:"chatsystem-composer__actions",children:G()})]})},LS=({onSubmitButton:e,isDisabled:t,className:n})=>b.jsx("div",{children:b.jsx("button",{className:`inline-flex
|
|
84
|
+
`,children:g.jsx(us,{facet:e.agent.display[Z.AgentDisplayFacetRoleType.ASSISTANT]})})},Ix=({content:e,metaData:t,context:n,seenRootEl:r})=>{const{chatlineLabelAssistantTranslation:i,chatlineLabelCustomerSupportTranslation:a}=rs(),s=t?.authorType==="customer_support_operator"?t.customerSupportAuthorName??a:i,o=Z.formatCustomerSupportProviderText({text:e??"",provider:t?.customerSupportProvider});return g.jsx(Ns,{children:g.jsx("div",{className:"chatLineAssistant flex justify-start",children:g.jsxs("div",{className:`mr-auto w-full rounded-2xl rounded-bl-md px-4 py-3 transition-all duration-300 text-left ${t?.isErrorMessage?"bg-red-100 text-red-800 shadow-md animate-fade-in":"bg-slate-100 text-gray-800 shadow-sm"}`,children:[g.jsx(zd,{className:"logoWrapper--assistant w-full justify-start text-left mb-2 text-xs",logo:g.jsx($d,{}),label:s}),g.jsx("div",{className:"chatsystem-markdown",children:g.jsx(xs,{remarkPlugins:[yx],remarkRehypeOptions:{passThrough:["link"]},rehypePlugins:[ks],components:{a:({node:u,href:c,children:d,...f})=>g.jsx(Cx,{href:c??"",...f,context:n,seenRootEl:r,children:d})},children:o})})]})})})},Ax=({content:e,metaData:t})=>{const n=t?.isErrorMessage;return g.jsx(Ns,{children:g.jsx("div",{className:"chatLineSystemMessage flex justify-center px-2","data-system-event":t?.systemEvent,children:g.jsx("div",{className:`max-w-[90%] rounded-lg border px-3 py-2 text-center text-xs leading-relaxed shadow-sm ${n?"border-red-200 bg-red-50 text-red-800":"border-slate-200 bg-slate-50 text-slate-600"}`,children:g.jsx(xs,{rehypePlugins:[ks],children:e??""})})})})};function Wd(e){const{draftStore:t,currentConversation:n}=S.useContext(ni),r=Ac(n.discussionId,e.componentId),i=S.useSyncExternalStore(t.subscribe,()=>t.get(r),()=>{});return{value:i!==void 0&&e.isValid(i)?i:e.initialValue,setValue:o=>{const u=t.get(r),c=u!==void 0&&e.isValid(u)?u:e.initialValue,d=typeof o=="function"?o(c):o;t.set(r,d,e.persistent)},clear:()=>t.remove(r)}}const wx={};function Ds(e,t,n=!0){return Wd({componentId:e,initialValue:wx,persistent:n,isValid:r=>typeof r=="string"?!1:Object.entries(r).every(([i,a])=>{const s=t.find(o=>o.id===i);return s?s.type==="checkbox"?typeof a=="boolean":typeof a=="string":!1})})}const Ps=({children:e,modifier:t,state:n,className:r})=>g.jsx("section",{className:`chatsystem-interactive-widget chatsystem-interactive-widget--${t} chatsystem-interactive-widget--state-${n??"active"} ${r??""} my-2 rounded-xl border border-slate-200 bg-white p-4 text-slate-800 shadow-sm`,children:e}),on=({title:e,description:t})=>e||t?g.jsxs("header",{className:"chatsystem-interactive-widget__copy mb-3 space-y-1",children:[e?g.jsx("h3",{className:"chatsystem-interactive-widget__title text-sm font-semibold text-slate-900",children:e}):null,t?g.jsx("p",{className:"chatsystem-interactive-widget__description text-sm leading-5 text-slate-600",children:t}):null]}):null,Ei=({children:e})=>g.jsx("div",{className:"chatsystem-interactive-widget__actions mt-3 flex flex-wrap gap-2",children:e}),sr=({children:e,style:t="primary",disabled:n,type:r="button",onClick:i})=>g.jsx("button",{type:r,disabled:n,onClick:i,className:`chatsystem-interactive-widget__button chatsystem-interactive-widget__button--${t} inline-flex min-h-9 items-center justify-center rounded-lg border px-3 py-2 text-sm font-semibold transition disabled:cursor-not-allowed disabled:opacity-60`,children:e}),In=({id:e,label:t,description:n,required:r,children:i})=>g.jsxs("div",{className:"chatsystem-interactive-widget__field grid gap-1.5",children:[g.jsxs("label",{className:"chatsystem-interactive-widget__label text-sm font-medium text-slate-800",htmlFor:e,children:[t,r?g.jsx("span",{"aria-hidden":"true",children:" *"}):null]}),n?g.jsx("p",{className:"chatsystem-interactive-widget__field-description text-xs text-slate-500",children:n}):null,i]}),Rn=({children:e,tone:t="neutral"})=>g.jsx("div",{className:`chatsystem-interactive-widget__status chatsystem-interactive-widget__status--${t} rounded-lg px-3 py-2 text-sm`,role:t==="danger"?"alert":"status",children:e}),ra="chatsystem-interactive-widget__control w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm text-slate-900 outline-none transition focus:border-[var(--chatsystem-primary-color)] focus:ring-2 focus:ring-[color-mix(in_srgb,var(--chatsystem-primary-color)_20%,transparent)] disabled:bg-slate-50 disabled:text-slate-500",vx=({widget:e})=>{const t=Yc(),n=Kt(),r=e.state!=="active",i=n.formatMessage({id:"chatbot.interactiveWidget.submitted",defaultMessage:"Sent"}),a=n.formatMessage({id:"chatbot.interactiveWidget.cancelled",defaultMessage:"Cancelled"}),s=n.formatMessage({id:"chatbot.interactiveWidget.submitting",defaultMessage:"Sending…"}),o=n.formatMessage({id:"chatbot.interactiveWidget.unavailable",defaultMessage:"This interaction is no longer available."}),u=e.responseMode==="local_preview",c=n.formatMessage({id:"chatbot.interactiveWidget.preview.notice",defaultMessage:"Demo mode — this form reproduces the real experience. Submitting it does not create a request or transmit your answers."}),d=n.formatMessage({id:"chatbot.interactiveWidget.preview.completed",defaultMessage:"You have tested this form. No request was sent and your answers were not transmitted."}),f=n.formatMessage({id:"chatbot.interactiveWidget.preview.cancelled",defaultMessage:"You have closed the demo form. No information was transmitted."}),h=(y,b)=>{y.kind==="open_url"&&window.open(y.url,"_blank","noopener,noreferrer"),t.submitInteractiveWidget({instanceId:e.instanceId,actionId:y.id,data:b,cancel:y.kind==="cancel"})};let m=null;return e.state==="submitting"&&(m=s),e.state==="submitted"&&(m=u?d:i),e.state==="cancelled"&&(m=u?f:a),e.state==="unavailable"&&(m=o),g.jsxs(Ps,{modifier:e.widgetType.replace(/_/g,"-"),state:e.state,className:u?"chatsystem-interactive-widget--local-preview":void 0,children:[u?g.jsx("div",{className:"chatsystem-interactive-widget__preview-notice mb-3 rounded-lg border border-sky-200 bg-sky-50 px-3 py-2 text-xs leading-5 text-sky-900",children:c}):null,g.jsx(kx,{widget:e,disabled:r,onAction:h}),m?g.jsx("div",{className:`mt-3 ${u?"chatsystem-interactive-widget__preview-result":""}`,children:g.jsx(Rn,{tone:e.state==="unavailable"?"warning":"success",children:m})}):null]})},kx=({widget:e,disabled:t,onAction:n})=>{const r=e.presentation;return r.type==="structured_form"?g.jsx(Nx,{instanceId:e.instanceId,persistDraft:e.responseMode==="resume_turn",presentation:r,disabled:t,onSubmit:i=>n({id:"submit",label:r.submitLabel,kind:"submit"},i),onCancel:r.cancelLabel?()=>n({id:"cancel",label:r.cancelLabel,kind:"cancel"}):void 0}):r.type==="card_list"?g.jsxs(g.Fragment,{children:[g.jsx(on,{title:r.title,description:r.description}),g.jsx("div",{className:"chatsystem-interactive-widget__cards grid gap-3",children:r.cards.map(i=>g.jsxs("article",{className:"chatsystem-interactive-widget__card overflow-hidden rounded-lg border border-slate-200",children:[i.imageUrl?g.jsx("img",{className:"chatsystem-interactive-widget__card-image h-32 w-full object-cover",src:i.imageUrl,alt:"",loading:"lazy"}):null,g.jsxs("div",{className:"chatsystem-interactive-widget__card-body p-3",children:[i.eyebrow?g.jsx("p",{className:"text-xs font-semibold uppercase text-slate-500",children:i.eyebrow}):null,g.jsx("h4",{className:"text-sm font-semibold text-slate-900",children:i.title}),i.description?g.jsx("p",{className:"mt-1 text-sm text-slate-600",children:i.description}):null,i.metadata?.map(a=>g.jsxs("div",{className:"chatsystem-interactive-widget__detail mt-2 flex justify-between gap-3 text-xs",children:[g.jsx("span",{className:"text-slate-500",children:a.label}),g.jsx("span",{className:"font-medium text-slate-800",children:a.value})]},a.label)),i.actions?.length?g.jsx(Or,{actions:i.actions,disabled:t,onAction:n}):null]})]},i.id))})]}):r.type==="status_summary"?g.jsxs(g.Fragment,{children:[g.jsx(on,{title:r.title,description:r.description}),g.jsx(Rn,{tone:r.tone,children:r.items?.map(i=>g.jsxs("div",{className:"chatsystem-interactive-widget__detail flex justify-between gap-3 py-1",children:[g.jsx("span",{children:i.label}),g.jsx("strong",{children:i.value})]},i.label))}),r.actions?.length?g.jsx(Or,{actions:r.actions,disabled:t,onAction:n}):null]}):r.type==="explicit_confirmation"?g.jsxs(g.Fragment,{children:[g.jsx(on,{title:r.title,description:r.description}),r.details?.map(i=>g.jsxs("div",{className:"chatsystem-interactive-widget__detail flex justify-between gap-3 border-b border-slate-100 py-2 text-sm",children:[g.jsx("span",{className:"text-slate-500",children:i.label}),g.jsx("strong",{children:i.value})]},i.label)),g.jsx(Or,{disabled:t,onAction:n,actions:[{id:"confirm",label:r.confirmLabel,kind:"submit",style:r.tone==="danger"?"danger":"primary"},{id:"cancel",label:r.cancelLabel,kind:"cancel",style:"secondary"}]})]}):g.jsxs(g.Fragment,{children:[g.jsx(on,{title:r.title,description:r.description}),g.jsx(Or,{actions:r.actions,disabled:t,onAction:n})]})},Or=({actions:e,disabled:t,onAction:n})=>g.jsx(Ei,{children:e.map(r=>g.jsx(sr,{style:r.style,disabled:t,onClick:()=>n(r),children:r.label},r.id))}),Nx=({instanceId:e,persistDraft:t,presentation:n,disabled:r,onSubmit:i,onCancel:a})=>{const{value:s,setValue:o}=Ds(`interactive:${e}`,n.fields,t),u=d=>{d.preventDefault(),i(s)},c=(d,f)=>o(h=>({...h,[d.id]:f}));return g.jsxs("form",{className:"chatsystem-interactive-widget__form grid gap-3",onSubmit:u,children:[g.jsx(on,{title:n.title,description:n.description}),n.fields.map(d=>g.jsx(In,{id:`${e}-${d.id}`,label:d.label,description:d.description,required:d.required,children:g.jsx(Rx,{id:`${e}-${d.id}`,field:d,value:s[d.id],disabled:r,onChange:f=>c(d,f)})},d.id)),g.jsxs(Ei,{children:[g.jsx(sr,{type:"submit",disabled:r,children:n.submitLabel}),n.cancelLabel?g.jsx(sr,{style:"secondary",disabled:r,onClick:a,children:n.cancelLabel}):null]})]})},Rx=({id:e,field:t,value:n,disabled:r,onChange:i})=>t.type==="checkbox"?g.jsx("input",{id:e,className:"chatsystem-interactive-widget__checkbox h-4 w-4",type:"checkbox",checked:n===!0,required:t.required,disabled:r,onChange:a=>i(a.currentTarget.checked)}):t.type==="select"?g.jsxs("select",{id:e,className:ra,value:typeof n=="string"?n:"",required:t.required,disabled:r,onChange:a=>i(a.currentTarget.value),children:[g.jsx("option",{value:"",children:t.placeholder??""}),t.options.map(a=>g.jsx("option",{value:a.value,children:a.label},a.value))]}):t.type==="textarea"?g.jsx("textarea",{id:e,className:`${ra} min-h-24 resize-y`,value:typeof n=="string"?n:"",required:t.required,disabled:r,placeholder:t.placeholder,minLength:t.minLength,maxLength:t.maxLength,onChange:a=>i(a.currentTarget.value)}):g.jsx("input",{id:e,className:ra,type:t.type,value:typeof n=="string"?n:"",required:t.required,disabled:r,placeholder:t.placeholder,minLength:t.minLength,maxLength:t.maxLength,onChange:a=>i(a.currentTarget.value)}),Ox=({userType:e,content:t,metaData:n,context:r,seenRootEl:i})=>{if(n?.interactiveWidget)return g.jsx(vx,{widget:n.interactiveWidget});if(n?.messageKind==="system")return g.jsx(Ax,{content:t,metaData:n});const a=e==="user",s=e==="assistant";return g.jsxs(g.Fragment,{children:[a&&g.jsx(d2,{content:t,metaData:n}),s&&g.jsx(Ix,{content:t,metaData:n,context:r,seenRootEl:i})]})};function Lx(e,t,n){let[r,i]=S.useState(e||t),a=S.useRef(e!==void 0),s=e!==void 0;S.useEffect(()=>{let c=a.current;c!==s&&console.warn(`WARN: A component changed from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),a.current=s},[s]);let o=s?e:r,u=S.useCallback((c,...d)=>{let f=(h,...m)=>{n&&(Object.is(o,h)||n(h,...m)),s||(o=h)};typeof c=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),i((m,...y)=>{let b=c(s?o:m,...y);return f(b,...d),s?m:b})):(s||i(c),f(c,...d))},[s,o,n]);return[o,u]}const Gr={prefix:String(Math.round(Math.random()*1e10)),current:0},Gd=S.createContext(Gr),Dx=S.createContext(!1);let Px=!!(typeof window<"u"&&window.document&&window.document.createElement),ia=new WeakMap;function Mx(e=!1){let t=S.useContext(Gd),n=S.useRef(null);if(n.current===null&&!e){var r,i;let a=(i=S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(a){let s=ia.get(a);s==null?ia.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==s.state&&(t.current=s.id,ia.delete(a))}n.current=++t.current}return n.current}function Bx(e){let t=S.useContext(Gd);t===Gr&&!Px&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=Mx(!!e),r=t===Gr&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${r}-${n}`}function Fx(e){let t=S.useId(),[n]=S.useState(zx()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Gr.prefix}`;return e||`${r}-${t}`}const Ux=typeof S.useId=="function"?Fx:Bx;function Hx(){return!1}function jx(){return!0}function Vx(e){return()=>{}}function zx(){return typeof S.useSyncExternalStore=="function"?S.useSyncExternalStore(Vx,Hx,jx):S.useContext(Dx)}function Yd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Yd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $x(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Yd(e))&&(r&&(r+=" "),r+=t);return r}const gn=typeof document<"u"?S.useLayoutEffect:()=>{};function cn(e){const t=S.useRef(null);return gn(()=>{t.current=e},[e]),S.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}function Wx(e){let[t,n]=S.useState(e),r=S.useRef(null),i=cn(()=>{if(!r.current)return;let s=r.current.next();if(s.done){r.current=null;return}t===s.value?i():n(s.value)});gn(()=>{r.current&&i()});let a=cn(s=>{r.current=s(t),i()});return[t,a]}let Gx=!!(typeof window<"u"&&window.document&&window.document.createElement),Yr=new Map;function qr(e){let[t,n]=S.useState(e),r=S.useRef(null),i=Ux(t),a=S.useCallback(s=>{r.current=s},[]);return Gx&&Yr.set(i,a),gn(()=>{let s=i;return()=>{Yr.delete(s)}},[i]),S.useEffect(()=>{let s=r.current;s&&(r.current=null,n(s))}),i}function Yx(e,t){if(e===t)return e;let n=Yr.get(e);if(n)return n(t),t;let r=Yr.get(t);return r?(r(e),e):t}function Ou(e=[]){let t=qr(),[n,r]=Wx(t),i=S.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return gn(i,[t,i,...e]),n}function qx(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Er=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Xr=e=>e&&"window"in e&&e.window===e?e:Er(e).defaultView||window;function Qr(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let i in r){let a=t[i],s=r[i];typeof a=="function"&&typeof s=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?t[i]=qx(a,s):(i==="className"||i==="UNSAFE_className")&&typeof a=="string"&&typeof s=="string"?t[i]=$x(a,s):i==="id"&&a&&s?t.id=Yx(a,s):t[i]=s!==void 0?s:a}}return t}const Xx=new Set(["id"]),Qx=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Kx=new Set(["href","target","rel","download","ping","referrerPolicy"]),Jx=/^(data-.*)$/;function Zx(e,t={}){let{labelable:n,isLink:r,propNames:i}=t,a={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(Xx.has(s)||n&&Qx.has(s)||r&&Kx.has(s)||i?.has(s)||Jx.test(s))&&(a[s]=e[s]);return a}function Lu(e){if(eS())e.focus({preventScroll:!0});else{let t=tS(e);e.focus(),nS(t)}}let Lr=null;function eS(){if(Lr==null){Lr=!1;try{document.createElement("div").focus({get preventScroll(){return Lr=!0,!0}})}catch{}}return Lr}function tS(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function nS(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function rS(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function iS(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function aS(){return iS(/^Mac/i)}function sS(){return rS(/Android/i)}let _n=new Map,Ha=new Set;function Du(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let i=_n.get(r.target);i||(i=new Set,_n.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let i=_n.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),_n.delete(r.target)),_n.size===0)){for(let a of Ha)a();Ha.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?Du():document.addEventListener("DOMContentLoaded",Du));function oS(e){requestAnimationFrame(()=>{_n.size===0?e():Ha.add(e)})}function uS(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=qr(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function cS(e,t){gn(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function lS(e){return e.mozInputSource===0&&e.isTrusted?!0:sS()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function dS(e,t,n){let r=S.useRef(t),i=cn(()=>{n&&n(r.current)});S.useEffect(()=>{var a;let s=e==null||(a=e.current)===null||a===void 0?void 0:a.form;return s?.addEventListener("reset",i),()=>{s?.removeEventListener("reset",i)}},[e,i])}const fS=S.createContext({register:()=>{}});fS.displayName="PressResponderContext";class hS{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function mS(e){let t=S.useRef({isFocused:!1,observer:null});gn(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=cn(r=>{e?.(r)});return S.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,a=s=>{t.current.isFocused=!1,i.disabled&&n(new hS("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",a,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let o=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:o})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:o}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function pS(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const a=S.useCallback(u=>{if(u.target===u.currentTarget)return r&&r(u),i&&i(!1),!0},[r,i]),s=mS(a),o=S.useCallback(u=>{u.target===u.currentTarget&&document.activeElement===u.target&&(n&&n(u),i&&i(!0),s(u))},[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?o:void 0,onBlur:!t&&(r||i)?a:void 0}}}let Bn=null,gS=new Set,nr=new Map,fn=!1,ja=!1;function Ti(e,t){for(let n of gS)n(e,t)}function bS(e){return!(e.metaKey||!aS()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Kr(e){fn=!0,bS(e)&&(Bn="keyboard",Ti("keyboard",e))}function Et(e){Bn="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(fn=!0,Ti("pointer",e))}function qd(e){lS(e)&&(fn=!0,Bn="virtual")}function Xd(e){e.target===window||e.target===document||(!fn&&!ja&&(Bn="virtual",Ti("virtual",e)),fn=!1,ja=!1)}function Qd(){fn=!1,ja=!0}function Pu(e){if(typeof window>"u"||nr.get(Xr(e)))return;const t=Xr(e),n=Er(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){fn=!0,r.apply(this,arguments)},n.addEventListener("keydown",Kr,!0),n.addEventListener("keyup",Kr,!0),n.addEventListener("click",qd,!0),t.addEventListener("focus",Xd,!0),t.addEventListener("blur",Qd,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Et,!0),n.addEventListener("pointermove",Et,!0),n.addEventListener("pointerup",Et,!0)):(n.addEventListener("mousedown",Et,!0),n.addEventListener("mousemove",Et,!0),n.addEventListener("mouseup",Et,!0)),t.addEventListener("beforeunload",()=>{Kd(e)},{once:!0}),nr.set(t,{focus:r})}const Kd=(e,t)=>{const n=Xr(e),r=Er(e);t&&r.removeEventListener("DOMContentLoaded",t),nr.has(n)&&(n.HTMLElement.prototype.focus=nr.get(n).focus,r.removeEventListener("keydown",Kr,!0),r.removeEventListener("keyup",Kr,!0),r.removeEventListener("click",qd,!0),n.removeEventListener("focus",Xd,!0),n.removeEventListener("blur",Qd,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Et,!0),r.removeEventListener("pointermove",Et,!0),r.removeEventListener("pointerup",Et,!0)):(r.removeEventListener("mousedown",Et,!0),r.removeEventListener("mousemove",Et,!0),r.removeEventListener("mouseup",Et,!0)),nr.delete(n))};function ES(e){const t=Er(e);let n;return t.readyState!=="loading"?Pu(e):(n=()=>{Pu(e)},t.addEventListener("DOMContentLoaded",n)),()=>Kd(e,n)}typeof document<"u"&&ES();function TS(){return Bn}function yS(e){Bn=e,Ti(e,null)}function Mu(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){t=!1}};e(r),t&&n.stopPropagation()}}function _S(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:Mu(e.onKeyDown),onKeyUp:Mu(e.onKeyUp)}}}function xS(e){const t=Er(e);if(TS()==="virtual"){let n=t.activeElement;oS(()=>{t.activeElement===n&&e.isConnected&&Lu(e)})}else Lu(e)}function SS(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}class Ms{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let i=this.fastMap.get(n??null);if(!i)return;let a=new Bu({scopeRef:t});i.addChild(a),a.parent=i,this.fastMap.set(t,a),r&&(a.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let a of this.traverse())a!==n&&n.nodeToRestore&&a.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&SS(a.nodeToRestore,n.scopeRef.current)&&(a.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(a=>r&&r.addChild(a))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new Ms;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(t=i.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new Bu({scopeRef:null}),this.fastMap.set(null,this.root)}}class Bu{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}new Ms;let CS=S.createContext(null);function IS(e){let t=S.useContext(CS)||{};cS(t,e);let{ref:n,...r}=t;return r}function AS(e,t){let{focusProps:n}=pS(e),{keyboardProps:r}=_S(e),i=Qr(n,r),a=IS(t),s=e.isDisabled?{}:a,o=S.useRef(e.autoFocus);return S.useEffect(()=>{o.current&&t.current&&xS(t.current),o.current=!1},[t]),{focusableProps:Qr({...i,tabIndex:e.excludeFromTabOrder&&!e.isDisabled?-1:void 0},s)}}function wS(e,t,n){let{validationBehavior:r,focus:i}=e;gn(()=>{if(r==="native"&&n?.current){let u=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(u),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation(kS(n.current))}});let a=cn(()=>{t.resetValidation()}),s=cn(u=>{var c;t.displayValidation.isInvalid||t.commitValidation();let d=n==null||(c=n.current)===null||c===void 0?void 0:c.form;if(!u.defaultPrevented&&n&&d&&NS(d)===n.current){var f;i?i():(f=n.current)===null||f===void 0||f.focus(),yS("keyboard")}u.preventDefault()}),o=cn(()=>{t.commitValidation()});S.useEffect(()=>{let u=n?.current;if(!u)return;let c=u.form;return u.addEventListener("invalid",s),u.addEventListener("change",o),c?.addEventListener("reset",a),()=>{u.removeEventListener("invalid",s),u.removeEventListener("change",o),c?.removeEventListener("reset",a)}},[n,s,o,a,r])}function vS(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function kS(e){return{isInvalid:!e.validity.valid,validationDetails:vS(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function NS(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(!n.validity.valid)return n}return null}const Jd={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Zd={...Jd,customError:!0,valid:!1},$n={isInvalid:!1,validationDetails:Jd,validationErrors:[]},RS=S.createContext({}),Fu="__formValidationState"+Date.now();function OS(e){if(e[Fu]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[Fu];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return LS(e)}function LS(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:s,validationBehavior:o="aria"}=e;n&&(t||(t=n==="invalid"));let u=t?{isInvalid:!0,validationErrors:[],validationDetails:Zd}:null,c=S.useMemo(()=>Uu(DS(s,i)),[s,i]);a?.validationDetails.valid&&(a=null);let d=S.useContext(RS),f=S.useMemo(()=>r?Array.isArray(r)?r.flatMap(k=>Va(d[k])):Va(d[r]):[],[d,r]),[h,m]=S.useState(d),[y,b]=S.useState(!1);d!==h&&(m(d),b(!1));let A=S.useMemo(()=>Uu(y?[]:f),[y,f]),I=S.useRef($n),[w,N]=S.useState($n),M=S.useRef($n),v=()=>{if(!p)return;O(!1);let k=c||a||I.current;aa(k,M.current)||(M.current=k,N(k))},[p,O]=S.useState(!1);return S.useEffect(v),{realtimeValidation:u||A||c||a||$n,displayValidation:o==="native"?u||A||w:u||A||c||a||w,updateValidation(k){o==="aria"&&!aa(w,k)?N(k):I.current=k},resetValidation(){let k=$n;aa(k,M.current)||(M.current=k,N(k)),o==="native"&&O(!1),b(!0)},commitValidation(){o==="native"&&O(!0),b(!0)}}}function Va(e){return e?Array.isArray(e)?e:[e]:[]}function DS(e,t){if(typeof e=="function"){let n=e(t);if(n&&typeof n!="boolean")return Va(n)}return[]}function Uu(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:Zd}:null}function aa(e,t){return e===t?!0:e&&t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((n,r)=>n===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([n,r])=>t.validationDetails[n]===r)}function PS(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a="label"}=e;t=qr(t);let s=qr(),o={};n?(r=r?`${s} ${r}`:s,o={id:s,htmlFor:a==="label"?t:void 0}):!r&&!i&&console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");let u=uS({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:o,fieldProps:u}}function MS(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:s}=PS(e),o=Ou([!!t,!!n,r,i]),u=Ou([!!t,!!n,r,i]);return s=Qr(s,{"aria-describedby":[o,u,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:a,fieldProps:s,descriptionProps:{id:o},errorMessageProps:{id:u}}}function BS(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:i=!1,isReadOnly:a=!1,type:s="text",validationBehavior:o="aria"}=e,[u,c]=Lx(e.value,e.defaultValue||"",e.onChange),{focusableProps:d}=AS(e,t),f=OS({...e,value:u}),{isInvalid:h,validationErrors:m,validationDetails:y}=f.displayValidation,{labelProps:b,fieldProps:A,descriptionProps:I,errorMessageProps:w}=MS({...e,isInvalid:h,errorMessage:e.errorMessage||m}),N=Zx(e,{labelable:!0});const M={type:s,pattern:e.pattern};return dS(t,u,c),wS(e,f,t),S.useEffect(()=>{if(t.current instanceof Xr(t.current).HTMLTextAreaElement){let v=t.current;Object.defineProperty(v,"defaultValue",{get:()=>v.value,set:()=>{},configurable:!0})}},[t]),{labelProps:b,inputProps:Qr(N,n==="input"&&M,{disabled:r,readOnly:a,required:i&&o==="native","aria-required":i&&o==="aria"||void 0,"aria-invalid":h||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],value:u,onChange:v=>c(v.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,placeholder:e.placeholder,inputMode:e.inputMode,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...d,...A}),descriptionProps:I,errorMessageProps:w,isInvalid:h,validationErrors:m,validationDetails:y}}const FS=e=>{const[t,n]=S.useState(""),r=e.value??t,i=()=>{A.current&&(A.current.style.height="auto",A.current.style.height=A.current.scrollHeight+"px")},a=()=>{A.current&&(A.current.style.height="auto")},s=k=>{e.value===void 0&&n(k),e.onChange?.(k)};S.useEffect(i,[r]);const{label:o,SubmitComponent:u,onSubmit:c,isLoadingStream:d,audioEnabled:f=!1,MicComponent:h,onPressMicButton:m,LoadingComponent:y,onPressLoadingButton:b}=e,A=S.useRef(null),{labelProps:I,inputProps:w}=BS({...e,inputElementType:"textarea"},A),N=k=>{s(k.target.value)},M=k=>{if(!(k.nativeEvent.isComposing||k.keyCode===229)&&(k.key==="Enter"||k.code==="Enter"||k.keyCode===13||k.code==="NumpadEnter")){if(k.shiftKey)return;if(!k.shiftKey){k.preventDefault(),k.stopPropagation(),d||B();return}}},v=k=>{(k.key==="Enter"||k.code==="Enter"||k.keyCode===13||k.code==="NumpadEnter")&&(k.preventDefault(),k.stopPropagation())},p=r.trim().length>0,O=!!(e.isDisabled||e.shouldDisableIfInputIsEmpty&&!p),B=()=>{O||c?.(r)!==!1&&(a(),s(""))},X=()=>d&&y?g.jsx(y,{onPressLoadingButton:b}):u?!f||!h||p?g.jsx(u,{onSubmitButton:B,isDisabled:O}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"block md:hidden",children:g.jsx(h,{onPressMicButton:m})}),g.jsxs("div",{className:"chatsystem-composer__desktop-actions",children:[g.jsx(h,{onPressMicButton:m}),g.jsx(u,{onSubmitButton:B,isDisabled:O})]})]}):null;return g.jsxs("div",{className:`chatsystem-composer ${e.classNameContainer??""} w-full`,children:[g.jsxs("div",{className:"chatsystem-composer__field",children:[g.jsx("label",{...I,className:e.classNameLabel,children:o}),g.jsx("textarea",{...w,ref:A,className:`chatsystem-composer__input ${e.classNameTextarea??""}`,onChange:N,value:r,rows:1,onKeyDown:M,onKeyUp:v})]}),g.jsx("div",{className:"chatsystem-composer__actions",children:X()})]})},US=({onSubmitButton:e,isDisabled:t,className:n})=>g.jsx("div",{children:g.jsx("button",{className:`inline-flex
|
|
86
85
|
bg-violet-600
|
|
87
86
|
dark:hover:bg-white
|
|
88
87
|
disabled:opacity-40
|
|
@@ -98,27 +97,27 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
98
97
|
transition-colors
|
|
99
98
|
chatsystem-paperplane-button
|
|
100
99
|
chatsystem-primary-background
|
|
101
|
-
${n??""}`,"data-testid":"send-button",onClick:e,disabled:t,type:"button","aria-label":"Send message",children:
|
|
100
|
+
${n??""}`,"data-testid":"send-button",onClick:e,disabled:t,type:"button","aria-label":"Send message",children:g.jsx("span",{className:"","data-state":"closed",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",className:"text-white dark:text-black",children:[g.jsx("path",{d:"M3 20L21 12L3 4L7.5 12L3 20Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),g.jsx("path",{d:"M7.5 12H14.75",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})})})}),HS=()=>{const{companySettings:e}=S.useContext(Pt);return g.jsx("div",{className:`search
|
|
102
101
|
transition
|
|
103
102
|
ease-in-out
|
|
104
103
|
delay-50
|
|
105
104
|
flex
|
|
106
105
|
justify-center
|
|
107
106
|
items-center
|
|
108
|
-
`,children:
|
|
107
|
+
`,children:g.jsx(us,{facet:e.agent.display[Z.AgentDisplayFacetRoleType.SEARCH]})})},jS=({loadingStatus:e,currentStepName:t,currentStepNumber:n,numberOfSteps:r})=>{const{getCurrentStepTranslated:i,stepTranslation:a,lookingForProductTranslation:s}=is();return g.jsx(g.Fragment,{children:e==="loadingIntermediaryStates"&&g.jsxs("div",{children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-center my-2 text-lg",children:s}),g.jsx("p",{className:"text-center my-1 text-md",children:t&&`${i(t)}`}),n&&g.jsxs("p",{className:"text-center my-2",children:[a,g.jsx("span",{children:" "}),n,"/",r]})]}),g.jsx("div",{className:"flex justify-center",children:g.jsx(HS,{})})]})})},VS=({onPressLoadingButton:e})=>g.jsx("div",{children:g.jsx("button",{className:`
|
|
109
108
|
inline-flex
|
|
110
109
|
bg-white
|
|
111
110
|
dark:hover:bg-white
|
|
112
111
|
disabled:opacity-10
|
|
113
112
|
disabled:text-gray-400
|
|
114
113
|
enabled:bg-white
|
|
115
|
-
text-white p-0.5 border border-white rounded-lg dark:border-white dark:bg-white transition-colors chatsystem-stop-button`,"data-testid":"stop-button","aria-label":"Stop response",onClick:e,type:"button",tabIndex:-1,onMouseDown:t=>t.preventDefault(),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&t.preventDefault()},onKeyUp:t=>{(t.key==="Enter"||t.key===" ")&&t.preventDefault()},children:
|
|
114
|
+
text-white p-0.5 border border-white rounded-lg dark:border-white dark:bg-white transition-colors chatsystem-stop-button`,"data-testid":"stop-button","aria-label":"Stop response",onClick:e,type:"button",tabIndex:-1,onMouseDown:t=>t.preventDefault(),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&t.preventDefault()},onKeyUp:t=>{(t.key==="Enter"||t.key===" ")&&t.preventDefault()},children:g.jsx("span",{className:"","data-state":"closed",children:g.jsxs("svg",{fill:"#000000",height:"24",width:"24",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 297 297",children:[g.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),g.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsxs("g",{id:"SVGRepo_iconCarrier",children:[" ",g.jsx("path",{d:"M148.5,0C66.486,0,0,66.486,0,148.5S66.486,297,148.5,297S297,230.514,297,148.5S230.514,0,148.5,0z M213.292,190.121 c0,12.912-10.467,23.379-23.378,23.379H106.67c-12.911,0-23.378-10.467-23.378-23.379v-83.242c0-12.912,10.467-23.379,23.378-23.379 h83.244c12.911,0,23.378,10.467,23.378,23.379V190.121z"})," "]})]})})})}),zS=4,$S=1;class WS{previousScrollTop=0;hasMeasuredViewport=!1;shouldFollow=!1;observeViewport(t){const n=t.scrollHeight>t.clientHeight,r=t.scrollHeight-t.scrollTop<=t.clientHeight+zS;return this.hasMeasuredViewport&&t.scrollTop<this.previousScrollTop-$S?this.shouldFollow=!1:r&&(this.shouldFollow=!0),this.previousScrollTop=t.scrollTop,this.hasMeasuredViewport=!0,{isAtBottom:r,isScrollable:n}}startFollowing(){this.shouldFollow=!0}shouldFollowContentChange(){return this.shouldFollow}}const GS=e=>{const t=S.useRef(null),n=S.useRef(null),r=S.useRef(new WS),i=S.useRef(null),[a,s]=S.useState(!1),o=()=>{const d=t.current;if(!d)return;const f=r.current.observeViewport({scrollTop:d.scrollTop,scrollHeight:d.scrollHeight,clientHeight:d.clientHeight});s(f.isScrollable&&!f.isAtBottom)},u=({smooth:d=!1,sticky:f=!1})=>{f&&r.current.startFollowing();const h=t.current;h&&h.scrollTo({top:h.scrollHeight,behavior:d?"smooth":"auto"})},c=({smooth:d=!1}={})=>{i.current={smooth:d},r.current.startFollowing()};return S.useEffect(()=>{const d=t.current;if(d)return d.addEventListener("scroll",o),o(),()=>{d.removeEventListener("scroll",o)}},[]),S.useLayoutEffect(()=>{const d=i.current;if(d){i.current=null,u({smooth:d.smooth,sticky:!0});return}r.current.shouldFollowContentChange()?u({smooth:!1}):o()},[e.length]),S.useEffect(()=>{const d=n.current;if(!d||typeof ResizeObserver>"u")return;const f=new ResizeObserver(()=>{r.current.shouldFollowContentChange()?u({smooth:!1}):o()});return f.observe(d),()=>f.disconnect()},[]),{scrollToBottom:u,requestScrollToBottomAfterNextRender:c,messagesContainerRef:t,messagesContentRef:n,showScrollButton:a}},YS=()=>{const e=Kt(),t=e.formatMessage({defaultMessage:"Discussion limit reached",id:"chatbot.DiscussionLimitReached.title"}),n=e.formatMessage({defaultMessage:"The discussion has reached its maximum number of messages. Please start a new one.",id:"chatbot.DiscussionLimitReached.explaination"}),r=e.formatMessage({defaultMessage:"Restart",id:"chatbot.DiscussionLimitReached.cta"});return{DiscussionLimitReachedTitleTranslation:t,DiscussionLimitReachedExplainationTranslation:n,DiscussionLimitReachedCtaTranslation:r}},qS=e=>Ke.createElement("svg",{width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ke.createElement("g",{clipPath:"url(#clip0_1276_7761)"},Ke.createElement("path",{d:"M19.7285 10.9288C20.4413 13.5978 19.7507 16.5635 17.6569 18.6573C15.1798 21.1344 11.4826 21.6475 8.5 20.1966M18.364 8.05071L17.6569 7.3436C14.5327 4.21941 9.46736 4.21941 6.34316 7.3436C3.42964 10.2571 3.23318 14.8588 5.75376 18M18.364 8.05071H14.1213M18.364 8.05071V3.80807",stroke:"#1C274C",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Ke.createElement("defs",null,Ke.createElement("clipPath",{id:"clip0_1276_7761"},Ke.createElement("rect",{width:24,height:24,fill:"white"})))),XS=({onReset:e})=>{const{DiscussionLimitReachedCtaTranslation:t,DiscussionLimitReachedExplainationTranslation:n,DiscussionLimitReachedTitleTranslation:r}=YS();return g.jsx(g.Fragment,{children:g.jsx("div",{className:"px-3 mt-4",children:g.jsxs("div",{role:"status","aria-live":"polite",className:"info-banner not-prose flex items-start gap-3 rounded-lg bg-blue-50 border-l-4 border-blue-500 p-4 shadow-sm",children:[g.jsx("div",{className:"flex flex-col justify-center items-center mx-3",children:g.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"!w-5 !h-5 mt-0.5 flex-shrink-0 pointer-events-none",children:g.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16Zm.75-11.5a.75.75 0 10-1.5 0 .75.75 0 001.5 0ZM9 8.75A.75.75 0 019.75 8h.5a.75.75 0 01.75.75v5a.75.75 0 01-.75.75h-.5A.75.75 0 019 13.75v-5Z",clipRule:"evenodd"})})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("p",{className:"font-semibold",children:r}),g.jsx("p",{className:"text-sm break-words",children:n}),g.jsx("div",{className:"my-2",children:g.jsxs("button",{type:"button",onClick:e,title:t,"aria-label":t,className:`group inline-flex items-center gap-2 rounded-full px-3 py-1.5
|
|
116
115
|
font-medium text-blue-700 dark:text-blue-300
|
|
117
116
|
bg-blue-50/70 hover:bg-blue-100 dark:bg-blue-900/20 dark:hover:bg-blue-900/30
|
|
118
117
|
ring-1 ring-inset ring-blue-600/20 hover:ring-blue-600/30
|
|
119
118
|
shadow-sm transition-all duration-200
|
|
120
119
|
focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/50
|
|
121
|
-
active:scale-[0.98]`,children:[
|
|
120
|
+
active:scale-[0.98]`,children:[g.jsx(qS,{"aria-hidden":"true",className:"w-5 h-5 transition-transform duration-200 group-hover:rotate-180"}),g.jsx("span",{children:t})]})})]})]})})})},QS=({onClick:e,label:t="voir les messages plus récents",className:n})=>{const[r,i]=S.useState(!1);return S.useEffect(()=>{const a=requestAnimationFrame(()=>i(!0));return()=>cancelAnimationFrame(a)},[]),g.jsx("button",{onClick:e,className:["chatsystem-scroll-to-bottom absolute z-10 select-none outline-none","left-auto translate-x-0 top-auto","transition-all duration-300 ease-out",r?"opacity-100 translate-y-0":"opacity-0 -translate-y-1",n??""].join(" "),"aria-label":t,title:t,children:g.jsx("span",{className:["inline-flex items-center justify-center","w-9 h-9","rounded-full bg-white shadow-md","hover:shadow-lg transition-shadow","p-2"].join(" "),children:g.jsx(Qc,{className:"w-4 h-4",fill:"#64748b"})})})},Hu=({message:e,actionLabel:t,onClick:n})=>g.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-md border border-sky-100 bg-sky-50 px-3 py-2 text-xs text-sky-900 shadow-sm",children:[g.jsx("div",{className:"mt-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full bg-sky-500 text-[10px] font-semibold text-white",children:"i"}),g.jsxs("div",{className:"flex-1",children:[g.jsx("p",{className:"leading-snug",children:e}),g.jsx("button",{type:"button",onClick:n,className:"mt-1 inline-flex items-center text-[11px] font-medium text-sky-700 hover:text-sky-900 hover:underline",children:t})]})]}),KS=({instanceId:e,config:t,status:n,labels:r,onSubmit:i})=>{const a=Ds(`support-fallback:${e}`,[{id:"email",type:"email"},{id:"phone",type:"tel"}]),s=String(a.value.email??""),o=String(a.value.phone??""),u=n==="submitting",c=n==="submitted";return g.jsx(Ps,{modifier:"contact-capture",state:n,children:c?g.jsx(Rn,{tone:"success",children:r.success}):g.jsxs("form",{className:"chatsystem-interactive-widget__form grid gap-3",onSubmit:async d=>{d.preventDefault(),await i({email:s,phone:o})&&a.clear()},children:[g.jsx(on,{title:r.title,description:r.description}),g.jsxs("div",{className:"chatsystem-interactive-widget__fields grid gap-3 sm:grid-cols-2",children:[g.jsx(In,{id:"support-fallback-email",label:r.email,required:t.requireEmail,children:g.jsx("input",{id:"support-fallback-email",className:"chatsystem-interactive-widget__control w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm outline-none",type:"email",value:s,required:t.requireEmail,disabled:u,placeholder:r.email,"aria-label":r.email,onChange:d=>a.setValue({...a.value,email:d.currentTarget.value})})}),g.jsx(In,{id:"support-fallback-phone",label:r.phone,required:t.requirePhone,children:g.jsx("input",{id:"support-fallback-phone",className:"chatsystem-interactive-widget__control w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm outline-none",type:"tel",value:o,required:t.requirePhone,disabled:u,placeholder:r.phone,"aria-label":r.phone,onChange:d=>a.setValue({...a.value,phone:d.currentTarget.value})})})]}),n==="failed"&&g.jsx(Rn,{tone:"danger",children:r.error}),g.jsx(Ei,{children:g.jsx(sr,{type:"submit",disabled:u,children:u?r.submitting:r.submit})})]})})},JS=({instanceId:e,config:t,status:n,scheduleLabel:r,labels:i,onSubmit:a})=>{const s=Ds(`support-closed-hours:${e}`,[{id:"email",type:"email"},{id:"phone",type:"tel"},{id:"reason",type:"textarea"}]),o=String(s.value.email??""),u=String(s.value.phone??""),c=String(s.value.reason??""),d=n==="submitting",f=n==="submitted";return g.jsx(Ps,{modifier:"closed-hours-contact-capture",state:n,children:f?g.jsx(Rn,{tone:"success",children:i.success}):g.jsxs("form",{className:"chatsystem-interactive-widget__form grid gap-3",onSubmit:async h=>{h.preventDefault(),await a({email:o,phone:u,reason:c})&&s.clear()},children:[g.jsxs("div",{children:[g.jsx(on,{title:i.title,description:i.description}),r?g.jsxs("p",{className:"chatsystem-interactive-widget__schedule text-xs font-medium text-slate-600",children:[i.schedulePrefix," ",r]}):null]}),g.jsxs("div",{className:"chatsystem-interactive-widget__fields grid gap-3 sm:grid-cols-2",children:[g.jsx(In,{id:"support-closed-email",label:i.email,required:t.requireEmail,children:g.jsx("input",{id:"support-closed-email",className:"chatsystem-interactive-widget__control w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm outline-none",type:"email",value:o,required:t.requireEmail,disabled:d,placeholder:i.email,"aria-label":i.email,onChange:h=>s.setValue({...s.value,email:h.currentTarget.value})})}),g.jsx(In,{id:"support-closed-phone",label:i.phone,required:t.requirePhone,children:g.jsx("input",{id:"support-closed-phone",className:"chatsystem-interactive-widget__control w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm outline-none",type:"tel",value:u,required:t.requirePhone,disabled:d,placeholder:i.phone,"aria-label":i.phone,onChange:h=>s.setValue({...s.value,phone:h.currentTarget.value})})}),g.jsx(In,{id:"support-closed-reason",label:i.reason,required:t.requireReason,children:g.jsx("textarea",{id:"support-closed-reason",className:"chatsystem-interactive-widget__control min-h-24 w-full resize-y rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm outline-none",value:c,required:t.requireReason,disabled:d,placeholder:i.reason,"aria-label":i.reason,onChange:h=>s.setValue({...s.value,reason:h.currentTarget.value})})})]}),n==="failed"&&g.jsx(Rn,{tone:"danger",children:i.error}),g.jsx(Ei,{children:g.jsx(sr,{type:"submit",disabled:d,children:d?i.submitting:i.submit})})]})})},ZS=({onPressMicButton:e,isDisabled:t,className:n})=>g.jsx("div",{children:g.jsx("button",{className:`inline-flex
|
|
122
121
|
bg-violet-600
|
|
123
122
|
dark:hover:bg-white
|
|
124
123
|
disabled:opacity-10
|
|
@@ -134,12 +133,12 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
134
133
|
enabled:hover:scale-[1.02] active:scale-[0.98]
|
|
135
134
|
chatsystem-mic-button
|
|
136
135
|
chatsystem-primary-background
|
|
137
|
-
${n??""}`,"data-testid":"mic-button",onClick:e,disabled:t,type:"button","aria-label":"Start voice input",children:b.jsx("span",{"data-state":"closed",children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",className:"text-white dark:text-black",children:[b.jsx("path",{d:"M12 14.5c1.66 0 3-1.34 3-3V6.5c0-1.66-1.34-3-3-3s-3 1.34-3 3v5c0 1.66 1.34 3 3 3Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),b.jsx("path",{d:"M12 14.5V18",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),b.jsx("path",{d:"M8.5 18h7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),b.jsx("path",{d:"M7 11.5c0 2.76 2.24 5 5 5s5-2.24 5-5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})})})});function qS(){const[e,t]=S.useState("idle"),[n,r]=S.useState(null),[i,a]=S.useState(0),s=S.useRef(null),o=S.useRef(null),u=S.useRef([]),c=S.useRef(null),d=S.useRef(null),f=S.useRef(null),h=S.useRef(null),m=S.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null);try{f.current?.disconnect()}catch{}f.current=null;try{d.current?.disconnect()}catch{}d.current=null;const v=c.current;c.current=null,v&&v.close().catch(()=>{}),a(0)},[]),y=S.useCallback(v=>{try{const R=new AudioContext,M=R.createAnalyser(),A=R.createMediaStreamSource(v);M.fftSize=256,M.smoothingTimeConstant=.85,A.connect(M),c.current=R,d.current=M,f.current=A;const p=new Uint8Array(M.fftSize),L=()=>{const B=d.current;if(!B)return;B.getByteTimeDomainData(p);let G=0;for(let V=0;V<p.length;V++){const j=(p[V]-128)/128;G+=j*j}const N=Math.sqrt(G/p.length),H=Math.min(1,N*6);a(H),h.current=requestAnimationFrame(L)};h.current=requestAnimationFrame(L)}catch{a(0)}},[]),g=S.useCallback(async()=>{r(null),m();try{const v=await navigator.mediaDevices.getUserMedia({audio:!0});o.current=v,y(v);const M=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/ogg"].find(p=>MediaRecorder.isTypeSupported(p))||"",A=new MediaRecorder(v,M?{mimeType:M}:void 0);s.current=A,u.current=[],A.ondataavailable=p=>{p.data&&p.data.size>0&&u.current.push(p.data)},A.onerror=()=>{t("error"),r("Recorder error.")},A.onstart=()=>t("recording"),A.onstop=()=>t("stopped"),A.start()}catch(v){m(),t("error"),r(v?.message??"Microphone permission denied.")}},[y,m]),w=S.useCallback(async()=>{const v=s.current,R=o.current;return!v||e!=="recording"?null:new Promise(M=>{v.onstop=()=>{m();const A=v.mimeType||"audio/webm",p=new Blob(u.current,{type:A}),L=A.includes("ogg")?"ogg":"webm",B=new File([p],`voice-message.${L}`,{type:A});R?.getTracks().forEach(G=>G.stop()),o.current=null,s.current=null,M({blob:p,file:B})},v.stop()})},[e,m]),I=S.useCallback(()=>{const v=s.current,R=o.current;try{v&&e==="recording"&&v.stop()}catch{}m(),R?.getTracks().forEach(M=>M.stop()),o.current=null,s.current=null,u.current=[],t("idle")},[e,m]);return S.useEffect(()=>()=>{m(),o.current?.getTracks().forEach(v=>v.stop())},[m]),{state:e,error:n,audioLevel:i,start:g,stop:w,cancel:I}}const XS=()=>{const e=Kt(),t=e.formatMessage({defaultMessage:"Recording...",id:"recordingOverlay.recording"}),n=e.formatMessage({defaultMessage:"Cancel",id:"recordingOverlay.cancel"}),r=e.formatMessage({defaultMessage:"Tap the mic to stop",id:"recordingOverlay.explaination"});return{recordingTranslation:t,cancelTranslation:n,recordingExplainationTranslation:r}},QS=({isOpen:e,onStop:t,onCancel:n,audioLevel:r=0})=>{const{recordingTranslation:i}=XS(),a=S.useMemo(()=>{const s=Math.max(0,Math.min(1,r));return Array.from({length:20},(o,u)=>{const c=Math.sin(u/19*Math.PI*2)*.5+.5,d=u%2===0?.9:.65,f=6+s*(14+c*18)*d;return Math.round(f)})},[r]);return e?b.jsx("div",{className:"relative mt-3 w-full rounded-lg border border-slate-400 bg-white p-1",role:"group","aria-label":"Recording voice message",children:b.jsxs("div",{className:"flex min-h-[48px] items-center gap-3 px-2",children:[b.jsxs("div",{className:"relative flex h-8 w-8 items-center justify-center",children:[b.jsx("span",{className:"absolute h-5 w-5 rounded-full bg-red-100 motion-safe:animate-ping","aria-hidden":!0}),b.jsx("span",{className:"absolute h-5 w-5 rounded-full bg-red-50","aria-hidden":!0}),b.jsx("span",{className:"absolute h-3.5 w-3.5 rounded-full bg-red-200","aria-hidden":!0}),b.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-red-500","aria-hidden":!0})]}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("div",{className:"mb-0.5 text-[11px] font-medium leading-3 text-slate-600",children:i}),b.jsx("div",{className:"flex h-5 items-center gap-[3px] overflow-hidden","aria-hidden":"true",children:a.map((s,o)=>b.jsx("span",{className:"block w-1 rounded-full bg-slate-400 transition-[height,background-color] duration-75",style:{height:`${s}px`,backgroundColor:r>.08?"rgb(59 130 246)":"rgb(148 163 184)"}},o))})]}),b.jsx("button",{type:"button",onClick:n,className:"flex h-9 w-9 items-center justify-center rounded-full text-slate-500 hover:bg-slate-100 hover:text-slate-700","aria-label":"Cancel recording",children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:b.jsx("path",{d:"M6 6l12 12M18 6L6 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),b.jsx("button",{type:"button",onClick:t,className:"flex h-9 w-9 items-center justify-center rounded-full bg-violet-600 text-white hover:bg-violet-700","aria-label":"Validate recording",children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:b.jsx("path",{d:"M5 13l4 4L19 7",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}):null};function KS({conversationStarters:e,onSelect:t}){return b.jsx("div",{className:"conversation-starters",children:e.map(n=>b.jsx("button",{type:"button",className:"conversation-starter-button",onClick:()=>t(n),children:n},n))})}const JS=({conversationStarters:e,conversationItems:t,isLoading:n,isCustomerSupportMode:r,isAtMaxMessages:i})=>e.length===0||n||r||i?!1:!t.some(s=>s.userType==="user"),Yd=({containerClassName:e})=>{const t=Fd({componentId:"composer",initialValue:"",isValid:De=>typeof De=="string"}),n=S.useRef(null),r=Hc(),{appToken:i,contactCaptureInstanceId:a,loadingStatus:s,numberOfSteps:o,currentStepName:u,currentStepNumber:c,isAtMaxMessages:d,isCustomerSupportMode:f,customerSupportStatusMessage:h,fallbackContactCaptureConfig:m,fallbackContactCaptureStatus:y,shouldDisplayFallbackContactCapture:g,submitFallbackContactCapture:w,closedHoursContactCaptureConfig:I,closedHoursBusinessHours:v,closedHoursContactCaptureStatus:R,shouldDisplayClosedHoursContactCapture:M,submitClosedHoursContactCapture:A,isTextareaDisabled:p,cancelRequest:L,submitTextMessage:B,submitAudio:G}=r,{placeholderTranslation:N,infoBannerExplainationTranslation:H,infoBannerTitleTranslation:V,customerSupportRestartTranslation:j,customerSupportFallbackTitleTranslation:z,customerSupportFallbackDescriptionTranslation:Z,customerSupportFallbackEmailTranslation:be,customerSupportFallbackPhoneTranslation:he,customerSupportFallbackSubmitTranslation:le,customerSupportFallbackSubmittingTranslation:we,customerSupportFallbackSuccessTranslation:E,customerSupportFallbackErrorTranslation:$,customerSupportClosedHoursTitleTranslation:ne,customerSupportClosedHoursDescriptionTranslation:x,customerSupportClosedHoursSchedulePrefixTranslation:J,customerSupportClosedHoursReasonTranslation:ue,customerSupportClosedHoursSuccessTranslation:X}=Ka(),{currentConversation:ae,resetConversation:re,archivedConversation:oe,setArchivedConversationAsMain:ie}=ni(),{companySettings:Oe}=S.useContext(Pt),{recentMessagesTranslation:Y}=Ja(),{scrollToBottom:je,showScrollButton:Ue,messagesContainerRef:et,requestScrollToBottomAfterNextRender:it,messagesContentRef:at}=HS(ae.items),[Me,ut]=S.useState(!1),{start:St,stop:ge,cancel:Le,audioLevel:ve}=qS(),[Ae,k]=S.useState(!0),[P,q]=S.useState(()=>typeof window>"u"?!0:!(window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches));S.useEffect(()=>{if(typeof window>"u")return;const De=window.matchMedia("(pointer: coarse)"),lt=window.matchMedia("(hover: none)"),Ct=()=>q(!(De.matches||lt.matches));return Ct(),De.addEventListener?(De.addEventListener("change",Ct),lt.addEventListener("change",Ct)):(De.addListener(Ct),lt.addListener(Ct)),()=>{De.removeEventListener?(De.removeEventListener("change",Ct),lt.removeEventListener("change",Ct)):(De.removeListener(Ct),lt.removeListener(Ct))}},[]);const ye=s!=="notLoading"||ae.items.length>0?{maxHeight:"100vh"}:{height:"250px"},Qe=oe.items.length>0,Ee=()=>{ie(),k(!1)},ke=De=>B(De)?(k(!1),it({smooth:!0}),!0):!1,mt=async()=>{ut(!0),await St()},pt=async()=>{const De=await ge();ut(!1),De&&G(De.file)},ze=()=>{Le(),ut(!1)},ct=Oe?.agent?.text?.conversationStarters??[],tt=JS({conversationStarters:ct,conversationItems:ae.items,isLoading:s!=="notLoading",isCustomerSupportMode:f,isAtMaxMessages:d});return b.jsxs("div",{className:["chatbox-root relative p-2","flex flex-col min-h-0 overflow-visible","h-auto",e??"mx-auto"].join(" "),ref:n,style:ye,children:[b.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 messagesContainer",ref:et,children:b.jsxs("div",{ref:at,children:[ae.items.map((De,lt)=>b.jsx(Ix,{content:De.content,userType:De.userType,metaData:De.metaData,context:{discussionId:ae.discussionId,messageIndex:lt,appToken:i},seenRootEl:et.current},De.temporaryId)),b.jsx(PS,{currentStepName:u,currentStepNumber:c,loadingStatus:s,numberOfSteps:o})]})}),Ue&&b.jsx("div",{className:"chatsystem-scroll-to-bottom-anchor",children:b.jsx($S,{label:Y,onClick:()=>je({smooth:!0,sticky:!0})})}),!f&&d&&b.jsx(zS,{onReset:re}),M&&I&&b.jsx(GS,{instanceId:a,config:I,status:R,scheduleLabel:v?.todayScheduleLabel,labels:{title:ne,description:x,schedulePrefix:J,email:be,phone:he,reason:ue,submit:le,submitting:we,success:X,error:$},onSubmit:A}),g&&m&&b.jsx(WS,{instanceId:a,config:m,status:y,labels:{title:z,description:Z,email:be,phone:he,submit:le,submitting:we,success:E,error:$},onSubmit:w}),h&&b.jsx(Lu,{actionLabel:j,message:h,onClick:re}),Qe&&Ae&&b.jsx(Lu,{actionLabel:V,message:H,onClick:Ee}),tt&&b.jsx(KS,{conversationStarters:ct,onSelect:ke}),b.jsx("div",{className:"chatbox-input-wrapper flex-shrink-0",children:Me?b.jsx(QS,{isOpen:Me,onStop:pt,onCancel:ze,audioLevel:ve}):b.jsx(OS,{value:t.value,onChange:t.setValue,classNameTextarea:"",classNameContainer:"relative mt-2 border-slate-400 border-[1px] rounded-lg p-1",SubmitComponent:LS,isDisabled:p,shouldDisableIfInputIsEmpty:!0,"aria-label":"TextArea For Bot Conversation",onSubmit:ke,placeholder:N,autoFocus:P,isLoadingStream:s!=="notLoading",LoadingComponent:MS,onPressLoadingButton:L,onPressMicButton:mt,MicComponent:YS,audioEnabled:Oe?.agent?.isAudioAllowed&&!f})})]})};function Xr(){return Xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xr.apply(this,arguments)}function qd(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Ba(e,t){return Ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Ba(e,t)}function Xd(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ba(e,t)}var Rr={exports:{}};/*
|
|
136
|
+
${n??""}`,"data-testid":"mic-button",onClick:e,disabled:t,type:"button","aria-label":"Start voice input",children:g.jsx("span",{"data-state":"closed",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",className:"text-white dark:text-black",children:[g.jsx("path",{d:"M12 14.5c1.66 0 3-1.34 3-3V6.5c0-1.66-1.34-3-3-3s-3 1.34-3 3v5c0 1.66 1.34 3 3 3Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),g.jsx("path",{d:"M12 14.5V18",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),g.jsx("path",{d:"M8.5 18h7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),g.jsx("path",{d:"M7 11.5c0 2.76 2.24 5 5 5s5-2.24 5-5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})})})});function eC(){const[e,t]=S.useState("idle"),[n,r]=S.useState(null),[i,a]=S.useState(0),s=S.useRef(null),o=S.useRef(null),u=S.useRef([]),c=S.useRef(null),d=S.useRef(null),f=S.useRef(null),h=S.useRef(null),m=S.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null);try{f.current?.disconnect()}catch{}f.current=null;try{d.current?.disconnect()}catch{}d.current=null;const w=c.current;c.current=null,w&&w.close().catch(()=>{}),a(0)},[]),y=S.useCallback(w=>{try{const N=new AudioContext,M=N.createAnalyser(),v=N.createMediaStreamSource(w);M.fftSize=256,M.smoothingTimeConstant=.85,v.connect(M),c.current=N,d.current=M,f.current=v;const p=new Uint8Array(M.fftSize),O=()=>{const B=d.current;if(!B)return;B.getByteTimeDomainData(p);let X=0;for(let W=0;W<p.length;W++){const H=(p[W]-128)/128;X+=H*H}const k=Math.sqrt(X/p.length),U=Math.min(1,k*6);a(U),h.current=requestAnimationFrame(O)};h.current=requestAnimationFrame(O)}catch{a(0)}},[]),b=S.useCallback(async()=>{r(null),m();try{const w=await navigator.mediaDevices.getUserMedia({audio:!0});o.current=w,y(w);const M=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/ogg"].find(p=>MediaRecorder.isTypeSupported(p))||"",v=new MediaRecorder(w,M?{mimeType:M}:void 0);s.current=v,u.current=[],v.ondataavailable=p=>{p.data&&p.data.size>0&&u.current.push(p.data)},v.onerror=()=>{t("error"),r("Recorder error.")},v.onstart=()=>t("recording"),v.onstop=()=>t("stopped"),v.start()}catch(w){m(),t("error"),r(w?.message??"Microphone permission denied.")}},[y,m]),A=S.useCallback(async()=>{const w=s.current,N=o.current;return!w||e!=="recording"?null:new Promise(M=>{w.onstop=()=>{m();const v=w.mimeType||"audio/webm",p=new Blob(u.current,{type:v}),O=v.includes("ogg")?"ogg":"webm",B=new File([p],`voice-message.${O}`,{type:v});N?.getTracks().forEach(X=>X.stop()),o.current=null,s.current=null,M({blob:p,file:B})},w.stop()})},[e,m]),I=S.useCallback(()=>{const w=s.current,N=o.current;try{w&&e==="recording"&&w.stop()}catch{}m(),N?.getTracks().forEach(M=>M.stop()),o.current=null,s.current=null,u.current=[],t("idle")},[e,m]);return S.useEffect(()=>()=>{m(),o.current?.getTracks().forEach(w=>w.stop())},[m]),{state:e,error:n,audioLevel:i,start:b,stop:A,cancel:I}}const tC=()=>{const e=Kt(),t=e.formatMessage({defaultMessage:"Recording...",id:"recordingOverlay.recording"}),n=e.formatMessage({defaultMessage:"Cancel",id:"recordingOverlay.cancel"}),r=e.formatMessage({defaultMessage:"Tap the mic to stop",id:"recordingOverlay.explaination"});return{recordingTranslation:t,cancelTranslation:n,recordingExplainationTranslation:r}},nC=({isOpen:e,onStop:t,onCancel:n,audioLevel:r=0})=>{const{recordingTranslation:i}=tC(),a=S.useMemo(()=>{const s=Math.max(0,Math.min(1,r));return Array.from({length:20},(o,u)=>{const c=Math.sin(u/19*Math.PI*2)*.5+.5,d=u%2===0?.9:.65,f=6+s*(14+c*18)*d;return Math.round(f)})},[r]);return e?g.jsx("div",{className:"relative mt-3 w-full rounded-lg border border-slate-400 bg-white p-1",role:"group","aria-label":"Recording voice message",children:g.jsxs("div",{className:"flex min-h-[48px] items-center gap-3 px-2",children:[g.jsxs("div",{className:"relative flex h-8 w-8 items-center justify-center",children:[g.jsx("span",{className:"absolute h-5 w-5 rounded-full bg-red-100 motion-safe:animate-ping","aria-hidden":!0}),g.jsx("span",{className:"absolute h-5 w-5 rounded-full bg-red-50","aria-hidden":!0}),g.jsx("span",{className:"absolute h-3.5 w-3.5 rounded-full bg-red-200","aria-hidden":!0}),g.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-red-500","aria-hidden":!0})]}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"mb-0.5 text-[11px] font-medium leading-3 text-slate-600",children:i}),g.jsx("div",{className:"flex h-5 items-center gap-[3px] overflow-hidden","aria-hidden":"true",children:a.map((s,o)=>g.jsx("span",{className:"block w-1 rounded-full bg-slate-400 transition-[height,background-color] duration-75",style:{height:`${s}px`,backgroundColor:r>.08?"rgb(59 130 246)":"rgb(148 163 184)"}},o))})]}),g.jsx("button",{type:"button",onClick:n,className:"flex h-9 w-9 items-center justify-center rounded-full text-slate-500 hover:bg-slate-100 hover:text-slate-700","aria-label":"Cancel recording",children:g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:g.jsx("path",{d:"M6 6l12 12M18 6L6 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),g.jsx("button",{type:"button",onClick:t,className:"flex h-9 w-9 items-center justify-center rounded-full bg-violet-600 text-white hover:bg-violet-700","aria-label":"Validate recording",children:g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:g.jsx("path",{d:"M5 13l4 4L19 7",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}):null};function rC({conversationStarters:e,onSelect:t}){return g.jsx("div",{className:"conversation-starters",children:e.map(n=>g.jsx("button",{type:"button",className:"conversation-starter-button",onClick:()=>t(n),children:n},n))})}const iC=({conversationStarters:e,conversationItems:t,isLoading:n,isCustomerSupportMode:r,isAtMaxMessages:i})=>e.length===0||n||r||i?!1:!t.some(s=>s.userType==="user"),ef=({containerClassName:e})=>{const t=Wd({componentId:"composer",initialValue:"",isValid:ze=>typeof ze=="string"}),n=S.useRef(null),r=Yc(),{appToken:i,contactCaptureInstanceId:a,loadingStatus:s,numberOfSteps:o,currentStepName:u,currentStepNumber:c,isAtMaxMessages:d,isCustomerSupportMode:f,customerSupportStatusMessage:h,fallbackContactCaptureConfig:m,fallbackContactCaptureStatus:y,shouldDisplayFallbackContactCapture:b,submitFallbackContactCapture:A,closedHoursContactCaptureConfig:I,closedHoursBusinessHours:w,closedHoursContactCaptureStatus:N,shouldDisplayClosedHoursContactCapture:M,submitClosedHoursContactCapture:v,isTextareaDisabled:p,cancelRequest:O,submitTextMessage:B,submitAudio:X}=r,{placeholderTranslation:k,infoBannerExplainationTranslation:U,infoBannerTitleTranslation:W,customerSupportRestartTranslation:H,customerSupportFallbackTitleTranslation:G,customerSupportFallbackDescriptionTranslation:ee,customerSupportFallbackEmailTranslation:pe,customerSupportFallbackPhoneTranslation:ge,customerSupportFallbackSubmitTranslation:we,customerSupportFallbackSubmittingTranslation:ve,customerSupportFallbackSuccessTranslation:E,customerSupportFallbackErrorTranslation:z,customerSupportClosedHoursTitleTranslation:K,customerSupportClosedHoursDescriptionTranslation:x,customerSupportClosedHoursSchedulePrefixTranslation:ne,customerSupportClosedHoursReasonTranslation:re,customerSupportClosedHoursSuccessTranslation:J}=rs(),{currentConversation:se,resetConversation:oe,archivedConversation:fe,setArchivedConversationAsMain:te}=ai(),{companySettings:De}=S.useContext(Pt),{recentMessagesTranslation:Q}=is(),{scrollToBottom:ke,showScrollButton:je,messagesContainerRef:qe,requestScrollToBottomAfterNextRender:xt,messagesContentRef:At}=GS(se.items),[Be,ot]=S.useState(!1),{start:ut,stop:Ee,cancel:Ne,audioLevel:Se}=eC(),[Ae,L]=S.useState(!0),[j,P]=S.useState(()=>typeof window>"u"?!0:!(window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches));S.useEffect(()=>{if(typeof window>"u")return;const ze=window.matchMedia("(pointer: coarse)"),wt=window.matchMedia("(hover: none)"),ft=()=>P(!(ze.matches||wt.matches));return ft(),ze.addEventListener?(ze.addEventListener("change",ft),wt.addEventListener("change",ft)):(ze.addListener(ft),wt.addListener(ft)),()=>{ze.removeEventListener?(ze.removeEventListener("change",ft),wt.removeEventListener("change",ft)):(ze.removeListener(ft),wt.removeListener(ft))}},[]);const ue=s!=="notLoading"||se.items.length>0?{maxHeight:"100vh"}:{height:"250px"},Re=fe.items.length>0,Ze=()=>{te(),L(!1)},et=ze=>B(ze)?(L(!1),xt({smooth:!0}),!0):!1,Te=async()=>{ot(!0),await ut()},Fe=async()=>{const ze=await Ee();ot(!1),ze&&X(ze.file)},We=()=>{Ne(),ot(!1)},ct=De?.agent?.text?.conversationStarters??[],Xe=iC({conversationStarters:ct,conversationItems:se.items,isLoading:s!=="notLoading",isCustomerSupportMode:f,isAtMaxMessages:d});return g.jsxs("div",{className:["chatbox-root relative p-2","flex flex-col min-h-0 overflow-visible","h-auto",e??"mx-auto"].join(" "),ref:n,style:ue,children:[g.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 messagesContainer",ref:qe,children:g.jsxs("div",{ref:At,children:[se.items.map((ze,wt)=>g.jsx(Ox,{content:ze.content,userType:ze.userType,metaData:ze.metaData,context:{discussionId:se.discussionId,messageIndex:wt,appToken:i},seenRootEl:qe.current},ze.temporaryId)),g.jsx(jS,{currentStepName:u,currentStepNumber:c,loadingStatus:s,numberOfSteps:o})]})}),je&&g.jsx("div",{className:"chatsystem-scroll-to-bottom-anchor",children:g.jsx(QS,{label:Q,onClick:()=>ke({smooth:!0,sticky:!0})})}),!f&&d&&g.jsx(XS,{onReset:oe}),M&&I&&g.jsx(JS,{instanceId:a,config:I,status:N,scheduleLabel:w?.todayScheduleLabel,labels:{title:K,description:x,schedulePrefix:ne,email:pe,phone:ge,reason:re,submit:we,submitting:ve,success:J,error:z},onSubmit:v}),b&&m&&g.jsx(KS,{instanceId:a,config:m,status:y,labels:{title:G,description:ee,email:pe,phone:ge,submit:we,submitting:ve,success:E,error:z},onSubmit:A}),h&&g.jsx(Hu,{actionLabel:H,message:h,onClick:oe}),Re&&Ae&&g.jsx(Hu,{actionLabel:W,message:U,onClick:Ze}),Xe&&g.jsx(rC,{conversationStarters:ct,onSelect:et}),g.jsx("div",{className:"chatbox-input-wrapper flex-shrink-0",children:Be?g.jsx(nC,{isOpen:Be,onStop:Fe,onCancel:We,audioLevel:Se}):g.jsx(FS,{value:t.value,onChange:t.setValue,classNameTextarea:"",classNameContainer:"relative mt-2 border-slate-400 border-[1px] rounded-lg p-1",SubmitComponent:US,isDisabled:p,shouldDisableIfInputIsEmpty:!0,"aria-label":"TextArea For Bot Conversation",onSubmit:et,placeholder:k,autoFocus:j,isLoadingStream:s!=="notLoading",LoadingComponent:VS,onPressLoadingButton:O,onPressMicButton:Te,MicComponent:ZS,audioEnabled:De?.agent?.isAudioAllowed&&!f})})]})};function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jr.apply(this,arguments)}function tf(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function za(e,t){return za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},za(e,t)}function nf(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,za(e,t)}var Dr={exports:{}};/*
|
|
138
137
|
object-assign
|
|
139
138
|
(c) Sindre Sorhus
|
|
140
139
|
@license MIT
|
|
141
|
-
*/var
|
|
142
|
-
Valid keys: `+JSON.stringify(Object.keys(E),null," "));var Y=Oe(ae,ie,J,ue,X+"."+ie,n);if(Y)return Y}return null}return w($)}function z(E){switch(typeof E){case"number":case"string":case"undefined":return!0;case"boolean":return!E;case"object":if(Array.isArray(E))return E.every(z);if(E===null||o(E))return!0;var $=f(E);if($){var ne=$.call(E),x;if($!==E.entries){for(;!(x=ne.next()).done;)if(!z(x.value))return!1}else for(;!(x=ne.next()).done;){var J=x.value;if(J&&!z(J[1]))return!1}}else return!1;return!0;default:return!1}}function Z(E,$){return E==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function be(E){var $=typeof E;return Array.isArray(E)?"array":E instanceof RegExp?"object":Z($,E)?"symbol":$}function he(E){if(typeof E>"u"||E===null)return""+E;var $=be(E);if($==="object"){if(E instanceof Date)return"date";if(E instanceof RegExp)return"regexp"}return $}function le(E){var $=he(E);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function we(E){return!E.constructor||!E.constructor.name?h:E.constructor.name}return m.checkPropTypes=i,m.resetWarningCache=i.resetWarningCache,m.PropTypes=m,m},ia}var aa,Uu;function nC(){if(Uu)return aa;Uu=1;var e=Ns();function t(){}function n(){}return n.resetWarningCache=t,aa=function(){function r(s,o,u,c,d,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},aa}var Hu;function rC(){if(Hu)return Rr.exports;if(Hu=1,process.env.NODE_ENV!=="production"){var e=ja(),t=!0;Rr.exports=tC()(e.isElement,t)}else Rr.exports=nC()();return Rr.exports}var iC=rC();const pe=Ha(iC);function aC(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function sC(e,t){e.classList?e.classList.add(t):aC(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function ju(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function oC(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=ju(e.className,t):e.setAttribute("class",ju(e.className&&e.className.baseVal||"",t))}const Vu={disabled:!1};var uC=process.env.NODE_ENV!=="production"?pe.oneOfType([pe.number,pe.shape({enter:pe.number,exit:pe.number,appear:pe.number}).isRequired]):null,cC=process.env.NODE_ENV!=="production"?pe.oneOfType([pe.string,pe.shape({enter:pe.string,exit:pe.string,active:pe.string}),pe.shape({enter:pe.string,enterDone:pe.string,enterActive:pe.string,exit:pe.string,exitDone:pe.string,exitActive:pe.string})]):null;const Kd=S.createContext(null);var Jd=function(t){return t.scrollTop},Gn="unmounted",rn="exited",an="entering",Sn="entered",Fa="exiting",Ft=(function(e){Xd(t,e);function t(r,i){var a;a=e.call(this,r,i)||this;var s=i,o=s&&!s.isMounting?r.enter:r.appear,u;return a.appearStatus=null,r.in?o?(u=rn,a.appearStatus=an):u=Sn:r.unmountOnExit||r.mountOnEnter?u=Gn:u=rn,a.state={status:u},a.nextCallback=null,a}t.getDerivedStateFromProps=function(i,a){var s=i.in;return s&&a.status===Gn?{status:rn}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var a=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==an&&s!==Sn&&(a=an):(s===an||s===Sn)&&(a=Fa)}this.updateStatus(!1,a)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,a,s,o;return a=s=o=i,i!=null&&typeof i!="number"&&(a=i.exit,s=i.enter,o=i.appear!==void 0?i.appear:s),{exit:a,enter:s,appear:o}},n.updateStatus=function(i,a){if(i===void 0&&(i=!1),a!==null)if(this.cancelNextCallback(),a===an){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:$n.findDOMNode(this);s&&Jd(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===rn&&this.setState({status:Gn})},n.performEnter=function(i){var a=this,s=this.props.enter,o=this.context?this.context.isMounting:i,u=this.props.nodeRef?[o]:[$n.findDOMNode(this),o],c=u[0],d=u[1],f=this.getTimeouts(),h=o?f.appear:f.enter;if(!i&&!s||Vu.disabled){this.safeSetState({status:Sn},function(){a.props.onEntered(c)});return}this.props.onEnter(c,d),this.safeSetState({status:an},function(){a.props.onEntering(c,d),a.onTransitionEnd(h,function(){a.safeSetState({status:Sn},function(){a.props.onEntered(c,d)})})})},n.performExit=function(){var i=this,a=this.props.exit,s=this.getTimeouts(),o=this.props.nodeRef?void 0:$n.findDOMNode(this);if(!a||Vu.disabled){this.safeSetState({status:rn},function(){i.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:Fa},function(){i.props.onExiting(o),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:rn},function(){i.props.onExited(o)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,a){a=this.setNextCallback(a),this.setState(i,a)},n.setNextCallback=function(i){var a=this,s=!0;return this.nextCallback=function(o){s&&(s=!1,a.nextCallback=null,i(o))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,a){this.setNextCallback(a);var s=this.props.nodeRef?this.props.nodeRef.current:$n.findDOMNode(this),o=i==null&&!this.props.addEndListener;if(!s||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=u[0],d=u[1];this.props.addEndListener(c,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Gn)return null;var a=this.props,s=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var o=qd(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S.createElement(Kd.Provider,{value:null},typeof s=="function"?s(i,o):S.cloneElement(S.Children.only(s),o))},t})(S.Component);Ft.contextType=Kd;Ft.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:pe.shape({current:typeof Element>"u"?pe.any:function(e,t,n,r,i,a){var s=e[t];return pe.instanceOf(s&&"ownerDocument"in s?s.ownerDocument.defaultView.Element:Element)(e,t,n,r,i,a)}}),children:pe.oneOfType([pe.func.isRequired,pe.element.isRequired]).isRequired,in:pe.bool,mountOnEnter:pe.bool,unmountOnExit:pe.bool,appear:pe.bool,enter:pe.bool,exit:pe.bool,timeout:function(t){var n=uC;t.addEndListener||(n=n.isRequired);for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return n.apply(void 0,[t].concat(i))},addEndListener:pe.func,onEnter:pe.func,onEntering:pe.func,onEntered:pe.func,onExit:pe.func,onExiting:pe.func,onExited:pe.func}:{};function yn(){}Ft.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:yn,onEntering:yn,onEntered:yn,onExit:yn,onExiting:yn,onExited:yn};Ft.UNMOUNTED=Gn;Ft.EXITED=rn;Ft.ENTERING=an;Ft.ENTERED=Sn;Ft.EXITING=Fa;var lC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return sC(t,r)})},sa=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return oC(t,r)})},Rs=(function(e){Xd(t,e);function t(){for(var r,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=e.call.apply(e,[this].concat(a))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(o,u){var c=r.resolveArguments(o,u),d=c[0],f=c[1];r.removeClasses(d,"exit"),r.addClass(d,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(o,u)},r.onEntering=function(o,u){var c=r.resolveArguments(o,u),d=c[0],f=c[1],h=f?"appear":"enter";r.addClass(d,h,"active"),r.props.onEntering&&r.props.onEntering(o,u)},r.onEntered=function(o,u){var c=r.resolveArguments(o,u),d=c[0],f=c[1],h=f?"appear":"enter";r.removeClasses(d,h),r.addClass(d,h,"done"),r.props.onEntered&&r.props.onEntered(o,u)},r.onExit=function(o){var u=r.resolveArguments(o),c=u[0];r.removeClasses(c,"appear"),r.removeClasses(c,"enter"),r.addClass(c,"exit","base"),r.props.onExit&&r.props.onExit(o)},r.onExiting=function(o){var u=r.resolveArguments(o),c=u[0];r.addClass(c,"exit","active"),r.props.onExiting&&r.props.onExiting(o)},r.onExited=function(o){var u=r.resolveArguments(o),c=u[0];r.removeClasses(c,"exit"),r.addClass(c,"exit","done"),r.props.onExited&&r.props.onExited(o)},r.resolveArguments=function(o,u){return r.props.nodeRef?[r.props.nodeRef.current,o]:[o,u]},r.getClassNames=function(o){var u=r.props.classNames,c=typeof u=="string",d=c&&u?u+"-":"",f=c?""+d+o:u[o],h=c?f+"-active":u[o+"Active"],m=c?f+"-done":u[o+"Done"];return{baseClassName:f,activeClassName:h,doneClassName:m}},r}var n=t.prototype;return n.addClass=function(i,a,s){var o=this.getClassNames(a)[s+"ClassName"],u=this.getClassNames("enter"),c=u.doneClassName;a==="appear"&&s==="done"&&c&&(o+=" "+c),s==="active"&&i&&Jd(i),o&&(this.appliedClasses[a][s]=o,lC(i,o))},n.removeClasses=function(i,a){var s=this.appliedClasses[a],o=s.base,u=s.active,c=s.done;this.appliedClasses[a]={},o&&sa(i,o),u&&sa(i,u),c&&sa(i,c)},n.render=function(){var i=this.props;i.classNames;var a=qd(i,["classNames"]);return S.createElement(Ft,Xr({},a,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(S.Component);Rs.defaultProps={classNames:""};Rs.propTypes=process.env.NODE_ENV!=="production"?Xr({},Ft.propTypes,{classNames:cC,onEnter:pe.func,onEntering:pe.func,onEntered:pe.func,onExit:pe.func,onExiting:pe.func,onExited:pe.func}):{};const Zd=()=>{const e=Kt(),t=e.formatMessage({defaultMessage:"Open chat menu",id:"chatbot.widget.menu.open"}),n=e.formatMessage({defaultMessage:"Start a new discussion",id:"chatbot.widget.menu.startNewDiscussion"}),r=e.formatMessage({defaultMessage:"Close chat",id:"chatbot.widget.close"});return{openMenuTranslation:t,startNewDiscussionTranslation:n,closeChatTranslation:r}},dC=({setIsWidgetOpen:e})=>{const{closeChatTranslation:t}=Zd();return b.jsx(b.Fragment,{children:b.jsx("button",{type:"button","aria-label":t,onClick:()=>e(!1),className:`chatsystem-close-button
|
|
140
|
+
*/var sa,ju;function aC(){if(ju)return sa;ju=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var s={},o=0;o<10;o++)s["_"+String.fromCharCode(o)]=o;var u=Object.getOwnPropertyNames(s).map(function(d){return s[d]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return sa=i()?Object.assign:function(a,s){for(var o,u=r(a),c,d=1;d<arguments.length;d++){o=Object(arguments[d]);for(var f in o)t.call(o,f)&&(u[f]=o[f]);if(e){c=e(o);for(var h=0;h<c.length;h++)n.call(o,c[h])&&(u[c[h]]=o[c[h]])}}return u},sa}var oa,Vu;function Bs(){if(Vu)return oa;Vu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return oa=e,oa}var ua,zu;function rf(){return zu||(zu=1,ua=Function.call.bind(Object.prototype.hasOwnProperty)),ua}var ca,$u;function sC(){if($u)return ca;$u=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Bs(),n={},r=rf();e=function(a){var s="Warning: "+a;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(a,s,o,u,c){if(process.env.NODE_ENV!=="production"){for(var d in a)if(r(a,d)){var f;try{if(typeof a[d]!="function"){var h=Error((u||"React class")+": "+o+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=a[d](s,d,u,o,null,t)}catch(y){f=y}if(f&&!(f instanceof Error)&&e((u||"React class")+": type specification of "+o+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var m=c?c():"";e("Failed "+o+" type: "+f.message+(m??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ca=i,ca}var la,Wu;function oC(){if(Wu)return la;Wu=1;var e=Ya(),t=aC(),n=Bs(),r=rf(),i=sC(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var u="Warning: "+o;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function s(){return null}return la=function(o,u){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(E){var z=E&&(c&&E[c]||E[d]);if(typeof z=="function")return z}var h="<<anonymous>>",m={array:I("array"),bigint:I("bigint"),bool:I("boolean"),func:I("function"),number:I("number"),object:I("object"),string:I("string"),symbol:I("symbol"),any:w(),arrayOf:N,element:M(),elementType:v(),instanceOf:p,node:k(),objectOf:B,oneOf:O,oneOfType:X,shape:W,exact:H};function y(E,z){return E===z?E!==0||1/E===1/z:E!==E&&z!==z}function b(E,z){this.message=E,this.data=z&&typeof z=="object"?z:{},this.stack=""}b.prototype=Error.prototype;function A(E){if(process.env.NODE_ENV!=="production")var z={},K=0;function x(re,J,se,oe,fe,te,De){if(oe=oe||h,te=te||se,De!==n){if(u){var Q=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Q.name="Invariant Violation",Q}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ke=oe+":"+se;!z[ke]&&K<3&&(a("You are manually calling a React.PropTypes validation function for the `"+te+"` prop on `"+oe+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),z[ke]=!0,K++)}}return J[se]==null?re?J[se]===null?new b("The "+fe+" `"+te+"` is marked as required "+("in `"+oe+"`, but its value is `null`.")):new b("The "+fe+" `"+te+"` is marked as required in "+("`"+oe+"`, but its value is `undefined`.")):null:E(J,se,oe,fe,te)}var ne=x.bind(null,!1);return ne.isRequired=x.bind(null,!0),ne}function I(E){function z(K,x,ne,re,J,se){var oe=K[x],fe=pe(oe);if(fe!==E){var te=ge(oe);return new b("Invalid "+re+" `"+J+"` of type "+("`"+te+"` supplied to `"+ne+"`, expected ")+("`"+E+"`."),{expectedType:E})}return null}return A(z)}function w(){return A(s)}function N(E){function z(K,x,ne,re,J){if(typeof E!="function")return new b("Property `"+J+"` of component `"+ne+"` has invalid PropType notation inside arrayOf.");var se=K[x];if(!Array.isArray(se)){var oe=pe(se);return new b("Invalid "+re+" `"+J+"` of type "+("`"+oe+"` supplied to `"+ne+"`, expected an array."))}for(var fe=0;fe<se.length;fe++){var te=E(se,fe,ne,re,J+"["+fe+"]",n);if(te instanceof Error)return te}return null}return A(z)}function M(){function E(z,K,x,ne,re){var J=z[K];if(!o(J)){var se=pe(J);return new b("Invalid "+ne+" `"+re+"` of type "+("`"+se+"` supplied to `"+x+"`, expected a single ReactElement."))}return null}return A(E)}function v(){function E(z,K,x,ne,re){var J=z[K];if(!e.isValidElementType(J)){var se=pe(J);return new b("Invalid "+ne+" `"+re+"` of type "+("`"+se+"` supplied to `"+x+"`, expected a single ReactElement type."))}return null}return A(E)}function p(E){function z(K,x,ne,re,J){if(!(K[x]instanceof E)){var se=E.name||h,oe=ve(K[x]);return new b("Invalid "+re+" `"+J+"` of type "+("`"+oe+"` supplied to `"+ne+"`, expected ")+("instance of `"+se+"`."))}return null}return A(z)}function O(E){if(!Array.isArray(E))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),s;function z(K,x,ne,re,J){for(var se=K[x],oe=0;oe<E.length;oe++)if(y(se,E[oe]))return null;var fe=JSON.stringify(E,function(De,Q){var ke=ge(Q);return ke==="symbol"?String(Q):Q});return new b("Invalid "+re+" `"+J+"` of value `"+String(se)+"` "+("supplied to `"+ne+"`, expected one of "+fe+"."))}return A(z)}function B(E){function z(K,x,ne,re,J){if(typeof E!="function")return new b("Property `"+J+"` of component `"+ne+"` has invalid PropType notation inside objectOf.");var se=K[x],oe=pe(se);if(oe!=="object")return new b("Invalid "+re+" `"+J+"` of type "+("`"+oe+"` supplied to `"+ne+"`, expected an object."));for(var fe in se)if(r(se,fe)){var te=E(se,fe,ne,re,J+"."+fe,n);if(te instanceof Error)return te}return null}return A(z)}function X(E){if(!Array.isArray(E))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var z=0;z<E.length;z++){var K=E[z];if(typeof K!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+we(K)+" at index "+z+"."),s}function x(ne,re,J,se,oe){for(var fe=[],te=0;te<E.length;te++){var De=E[te],Q=De(ne,re,J,se,oe,n);if(Q==null)return null;Q.data&&r(Q.data,"expectedType")&&fe.push(Q.data.expectedType)}var ke=fe.length>0?", expected one of type ["+fe.join(", ")+"]":"";return new b("Invalid "+se+" `"+oe+"` supplied to "+("`"+J+"`"+ke+"."))}return A(x)}function k(){function E(z,K,x,ne,re){return G(z[K])?null:new b("Invalid "+ne+" `"+re+"` supplied to "+("`"+x+"`, expected a ReactNode."))}return A(E)}function U(E,z,K,x,ne){return new b((E||"React class")+": "+z+" type `"+K+"."+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ne+"`.")}function W(E){function z(K,x,ne,re,J){var se=K[x],oe=pe(se);if(oe!=="object")return new b("Invalid "+re+" `"+J+"` of type `"+oe+"` "+("supplied to `"+ne+"`, expected `object`."));for(var fe in E){var te=E[fe];if(typeof te!="function")return U(ne,re,J,fe,ge(te));var De=te(se,fe,ne,re,J+"."+fe,n);if(De)return De}return null}return A(z)}function H(E){function z(K,x,ne,re,J){var se=K[x],oe=pe(se);if(oe!=="object")return new b("Invalid "+re+" `"+J+"` of type `"+oe+"` "+("supplied to `"+ne+"`, expected `object`."));var fe=t({},K[x],E);for(var te in fe){var De=E[te];if(r(E,te)&&typeof De!="function")return U(ne,re,J,te,ge(De));if(!De)return new b("Invalid "+re+" `"+J+"` key `"+te+"` supplied to `"+ne+"`.\nBad object: "+JSON.stringify(K[x],null," ")+`
|
|
141
|
+
Valid keys: `+JSON.stringify(Object.keys(E),null," "));var Q=De(se,te,ne,re,J+"."+te,n);if(Q)return Q}return null}return A(z)}function G(E){switch(typeof E){case"number":case"string":case"undefined":return!0;case"boolean":return!E;case"object":if(Array.isArray(E))return E.every(G);if(E===null||o(E))return!0;var z=f(E);if(z){var K=z.call(E),x;if(z!==E.entries){for(;!(x=K.next()).done;)if(!G(x.value))return!1}else for(;!(x=K.next()).done;){var ne=x.value;if(ne&&!G(ne[1]))return!1}}else return!1;return!0;default:return!1}}function ee(E,z){return E==="symbol"?!0:z?z["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&z instanceof Symbol:!1}function pe(E){var z=typeof E;return Array.isArray(E)?"array":E instanceof RegExp?"object":ee(z,E)?"symbol":z}function ge(E){if(typeof E>"u"||E===null)return""+E;var z=pe(E);if(z==="object"){if(E instanceof Date)return"date";if(E instanceof RegExp)return"regexp"}return z}function we(E){var z=ge(E);switch(z){case"array":case"object":return"an "+z;case"boolean":case"date":case"regexp":return"a "+z;default:return z}}function ve(E){return!E.constructor||!E.constructor.name?h:E.constructor.name}return m.checkPropTypes=i,m.resetWarningCache=i.resetWarningCache,m.PropTypes=m,m},la}var da,Gu;function uC(){if(Gu)return da;Gu=1;var e=Bs();function t(){}function n(){}return n.resetWarningCache=t,da=function(){function r(s,o,u,c,d,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},da}var Yu;function cC(){if(Yu)return Dr.exports;if(Yu=1,process.env.NODE_ENV!=="production"){var e=Ya(),t=!0;Dr.exports=oC()(e.isElement,t)}else Dr.exports=uC()();return Dr.exports}var lC=cC();const me=Ga(lC);function dC(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function fC(e,t){e.classList?e.classList.add(t):dC(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function qu(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function hC(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=qu(e.className,t):e.setAttribute("class",qu(e.className&&e.className.baseVal||"",t))}const Xu={disabled:!1};var mC=process.env.NODE_ENV!=="production"?me.oneOfType([me.number,me.shape({enter:me.number,exit:me.number,appear:me.number}).isRequired]):null,pC=process.env.NODE_ENV!=="production"?me.oneOfType([me.string,me.shape({enter:me.string,exit:me.string,active:me.string}),me.shape({enter:me.string,enterDone:me.string,enterActive:me.string,exit:me.string,exitDone:me.string,exitActive:me.string})]):null;const af=S.createContext(null);var sf=function(t){return t.scrollTop},Yn="unmounted",rn="exited",an="entering",xn="entered",$a="exiting",Ft=(function(e){nf(t,e);function t(r,i){var a;a=e.call(this,r,i)||this;var s=i,o=s&&!s.isMounting?r.enter:r.appear,u;return a.appearStatus=null,r.in?o?(u=rn,a.appearStatus=an):u=xn:r.unmountOnExit||r.mountOnEnter?u=Yn:u=rn,a.state={status:u},a.nextCallback=null,a}t.getDerivedStateFromProps=function(i,a){var s=i.in;return s&&a.status===Yn?{status:rn}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var a=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==an&&s!==xn&&(a=an):(s===an||s===xn)&&(a=$a)}this.updateStatus(!1,a)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,a,s,o;return a=s=o=i,i!=null&&typeof i!="number"&&(a=i.exit,s=i.enter,o=i.appear!==void 0?i.appear:s),{exit:a,enter:s,appear:o}},n.updateStatus=function(i,a){if(i===void 0&&(i=!1),a!==null)if(this.cancelNextCallback(),a===an){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Wn.findDOMNode(this);s&&sf(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===rn&&this.setState({status:Yn})},n.performEnter=function(i){var a=this,s=this.props.enter,o=this.context?this.context.isMounting:i,u=this.props.nodeRef?[o]:[Wn.findDOMNode(this),o],c=u[0],d=u[1],f=this.getTimeouts(),h=o?f.appear:f.enter;if(!i&&!s||Xu.disabled){this.safeSetState({status:xn},function(){a.props.onEntered(c)});return}this.props.onEnter(c,d),this.safeSetState({status:an},function(){a.props.onEntering(c,d),a.onTransitionEnd(h,function(){a.safeSetState({status:xn},function(){a.props.onEntered(c,d)})})})},n.performExit=function(){var i=this,a=this.props.exit,s=this.getTimeouts(),o=this.props.nodeRef?void 0:Wn.findDOMNode(this);if(!a||Xu.disabled){this.safeSetState({status:rn},function(){i.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:$a},function(){i.props.onExiting(o),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:rn},function(){i.props.onExited(o)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,a){a=this.setNextCallback(a),this.setState(i,a)},n.setNextCallback=function(i){var a=this,s=!0;return this.nextCallback=function(o){s&&(s=!1,a.nextCallback=null,i(o))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,a){this.setNextCallback(a);var s=this.props.nodeRef?this.props.nodeRef.current:Wn.findDOMNode(this),o=i==null&&!this.props.addEndListener;if(!s||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=u[0],d=u[1];this.props.addEndListener(c,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Yn)return null;var a=this.props,s=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var o=tf(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S.createElement(af.Provider,{value:null},typeof s=="function"?s(i,o):S.cloneElement(S.Children.only(s),o))},t})(S.Component);Ft.contextType=af;Ft.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:me.shape({current:typeof Element>"u"?me.any:function(e,t,n,r,i,a){var s=e[t];return me.instanceOf(s&&"ownerDocument"in s?s.ownerDocument.defaultView.Element:Element)(e,t,n,r,i,a)}}),children:me.oneOfType([me.func.isRequired,me.element.isRequired]).isRequired,in:me.bool,mountOnEnter:me.bool,unmountOnExit:me.bool,appear:me.bool,enter:me.bool,exit:me.bool,timeout:function(t){var n=mC;t.addEndListener||(n=n.isRequired);for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return n.apply(void 0,[t].concat(i))},addEndListener:me.func,onEnter:me.func,onEntering:me.func,onEntered:me.func,onExit:me.func,onExiting:me.func,onExited:me.func}:{};function Tn(){}Ft.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Tn,onEntering:Tn,onEntered:Tn,onExit:Tn,onExiting:Tn,onExited:Tn};Ft.UNMOUNTED=Yn;Ft.EXITED=rn;Ft.ENTERING=an;Ft.ENTERED=xn;Ft.EXITING=$a;var gC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return fC(t,r)})},fa=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return hC(t,r)})},Fs=(function(e){nf(t,e);function t(){for(var r,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=e.call.apply(e,[this].concat(a))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(o,u){var c=r.resolveArguments(o,u),d=c[0],f=c[1];r.removeClasses(d,"exit"),r.addClass(d,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(o,u)},r.onEntering=function(o,u){var c=r.resolveArguments(o,u),d=c[0],f=c[1],h=f?"appear":"enter";r.addClass(d,h,"active"),r.props.onEntering&&r.props.onEntering(o,u)},r.onEntered=function(o,u){var c=r.resolveArguments(o,u),d=c[0],f=c[1],h=f?"appear":"enter";r.removeClasses(d,h),r.addClass(d,h,"done"),r.props.onEntered&&r.props.onEntered(o,u)},r.onExit=function(o){var u=r.resolveArguments(o),c=u[0];r.removeClasses(c,"appear"),r.removeClasses(c,"enter"),r.addClass(c,"exit","base"),r.props.onExit&&r.props.onExit(o)},r.onExiting=function(o){var u=r.resolveArguments(o),c=u[0];r.addClass(c,"exit","active"),r.props.onExiting&&r.props.onExiting(o)},r.onExited=function(o){var u=r.resolveArguments(o),c=u[0];r.removeClasses(c,"exit"),r.addClass(c,"exit","done"),r.props.onExited&&r.props.onExited(o)},r.resolveArguments=function(o,u){return r.props.nodeRef?[r.props.nodeRef.current,o]:[o,u]},r.getClassNames=function(o){var u=r.props.classNames,c=typeof u=="string",d=c&&u?u+"-":"",f=c?""+d+o:u[o],h=c?f+"-active":u[o+"Active"],m=c?f+"-done":u[o+"Done"];return{baseClassName:f,activeClassName:h,doneClassName:m}},r}var n=t.prototype;return n.addClass=function(i,a,s){var o=this.getClassNames(a)[s+"ClassName"],u=this.getClassNames("enter"),c=u.doneClassName;a==="appear"&&s==="done"&&c&&(o+=" "+c),s==="active"&&i&&sf(i),o&&(this.appliedClasses[a][s]=o,gC(i,o))},n.removeClasses=function(i,a){var s=this.appliedClasses[a],o=s.base,u=s.active,c=s.done;this.appliedClasses[a]={},o&&fa(i,o),u&&fa(i,u),c&&fa(i,c)},n.render=function(){var i=this.props;i.classNames;var a=tf(i,["classNames"]);return S.createElement(Ft,Jr({},a,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(S.Component);Fs.defaultProps={classNames:""};Fs.propTypes=process.env.NODE_ENV!=="production"?Jr({},Ft.propTypes,{classNames:pC,onEnter:me.func,onEntering:me.func,onEntered:me.func,onExit:me.func,onExiting:me.func,onExited:me.func}):{};const bC=({setIsWidgetOpen:e})=>{const{closeChatTranslation:t}=cs();return g.jsx(g.Fragment,{children:g.jsx("button",{type:"button","aria-label":t,onClick:()=>e(!1),className:`chatsystem-close-button
|
|
143
142
|
inline-flex items-center justify-center
|
|
144
143
|
rounded-full p-1.5
|
|
145
144
|
text-white
|
|
@@ -150,13 +149,13 @@ Valid keys: `+JSON.stringify(Object.keys(E),null," "));var Y=Oe(ae,ie,J,ue,X+".
|
|
|
150
149
|
focus-visible:ring-white/80
|
|
151
150
|
focus-visible:ring-offset-2
|
|
152
151
|
focus-visible:ring-offset-violet-700
|
|
153
|
-
`,"data-testid":"close-button",children:
|
|
152
|
+
`,"data-testid":"close-button",children:g.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none","aria-hidden":"true",className:"select-none outline-none",children:g.jsx("path",{d:"M6 6L18 18M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})})},of=({onStartNewDiscussion:e,className:t="",tone:n="light"})=>{const[r,i]=S.useState(!1),a=S.useRef(null),s=S.useRef(null),{openMenuTranslation:o,startNewDiscussionTranslation:u}=cs();S.useEffect(()=>{if(!r)return;a.current?.querySelector('[role="menuitem"]')?.focus();const d=f=>{a.current?.contains(f.target)||i(!1)};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[r]);const c=n==="dark"?"text-white bg-white/10 hover:bg-white/20 focus-visible:ring-white/80 focus-visible:ring-offset-violet-700":"text-slate-700 bg-slate-100 hover:bg-slate-200 focus-visible:ring-slate-400 focus-visible:ring-offset-white";return g.jsxs("div",{ref:a,className:`relative inline-flex ${t}`,onMouseDown:d=>d.stopPropagation(),onKeyDown:d=>{d.key!=="Escape"||!r||(d.preventDefault(),d.stopPropagation(),i(!1),s.current?.focus())},children:[g.jsx("button",{ref:s,type:"button","aria-label":o,"aria-haspopup":"menu","aria-expanded":r,onClick:()=>i(d=>!d),className:`inline-flex items-center justify-center rounded-full p-1.5 transition-transform duration-150 ease-out hover:scale-110 active:scale-95 focus:outline-none focus-visible:ring-offset-2 ${c}`,"data-testid":"discussion-menu-button",children:g.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none","aria-hidden":"true",className:"select-none outline-none",children:[g.jsx("circle",{cx:"5",cy:"12",r:"1.5",fill:"currentColor"}),g.jsx("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"}),g.jsx("circle",{cx:"19",cy:"12",r:"1.5",fill:"currentColor"})]})}),r&&g.jsx("div",{role:"menu",className:"absolute right-0 top-full z-30 mt-2 min-w-[210px] rounded-md border border-slate-200 bg-white p-1 shadow-lg",onMouseDown:d=>d.stopPropagation(),children:g.jsx("button",{type:"button",role:"menuitem",className:"block w-full rounded px-3 py-2 text-left text-sm text-slate-800 hover:bg-slate-100",onClick:()=>{e(),i(!1),s.current?.focus()},children:u})})]})},Wa=({placement:e="inline",className:t=""})=>{const{companySettings:n}=S.useContext(Pt);if(n.branding?.poweredByChatSystemVisible===!1)return null;const r=e==="widget-badge";return g.jsxs("div",{className:`chatsystem-powered-by ${r?"chatsystem-powered-by--badge":""} ${t}`,children:[g.jsx("span",{children:"Powered by"}),g.jsx("a",{href:"https://www.chatsystem.ai",target:"_blank",rel:"noopener noreferrer",className:"chatsystem-powered-by__link",children:"ChatSystem"})]})},EC=S.forwardRef(({setIsWidgetOpen:e},t)=>{const{companySettings:n}=S.useContext(Pt),{resetConversation:r}=ai(),i=n.agent?.customNameToDisplay||"Assistant";return g.jsxs("div",{ref:t,role:"region","aria-label":i,onKeyDown:a=>{a.key!=="Escape"||a.defaultPrevented||(a.preventDefault(),a.stopPropagation(),e(!1))},className:`
|
|
154
153
|
chatBox chatsystem-widget-window fixed z-[2147483647]
|
|
155
154
|
inset-0 w-screen h-[100svh] rounded-none bg-white md:rounded-xl
|
|
156
155
|
md:inset-auto md:right-6
|
|
157
156
|
md:w-[min(100vw-1rem,400px)]
|
|
158
157
|
flex flex-col
|
|
159
|
-
`,children:[
|
|
158
|
+
`,children:[g.jsxs("div",{className:"chatsystem-widget-surface h-full w-full min-h-0 shadow-xl flex flex-col overflow-hidden",children:[g.jsxs("div",{className:"chatsystem-header chatsystem-primary-background relative z-20 flex items-center justify-start py-2 pl-3 text-left text-white",children:[g.jsx(zd,{className:"chatSystem-widgetLogo",logo:g.jsx($d,{}),label:i}),g.jsxs("div",{className:"chatsystem-header__actions",children:[g.jsx(of,{className:"chatsystem-header__menu",tone:"dark",onStartNewDiscussion:r}),g.jsx(bC,{setIsWidgetOpen:e})]})]}),g.jsx(ef,{}),g.jsx(Wa,{className:"chatsystem-powered-by-mobile"})]}),g.jsx(Wa,{placement:"widget-badge",className:"chatsystem-powered-by-widget-badge"})]})}),TC=({launcherRef:e,isWidgetOpen:t,setIsWidgetOpen:n})=>{const r=S.useRef(null),i=S.useRef(!1),a=s=>{const o=r.current,u=o?.getRootNode();i.current=!!(o&&u?.activeElement&&o.contains(u.activeElement)),n(s)};return S.useEffect(()=>{if(!t)return;const s=o=>{const u=r.current;if(!u)return;const c=e.current,d=typeof o.composedPath=="function"?o.composedPath():[];if(d.length>0){if(d.includes(u)||c&&d.includes(c))return}else{const f=o.target;if(f&&(u.contains(f)||c?.contains(f)))return}n(!1)};return document.addEventListener("pointerdown",s,!0),()=>{document.removeEventListener("pointerdown",s,!0)}},[t,n,e]),g.jsx("div",{children:g.jsx(Fs,{nodeRef:r,in:t,timeout:200,classNames:"menuTransition",unmountOnExit:!0,onEntered:()=>{const s=e.current,o=s?.getRootNode();s&&o?.activeElement===s&&r.current?.querySelector(".chatsystem-close-button")?.focus()},onExited:()=>{i.current&&e.current?.focus(),i.current=!1},children:g.jsx(EC,{ref:r,setIsWidgetOpen:a})})})},yC=()=>{const{resetConversation:e}=ai();return g.jsx("div",{className:"relative z-20 flex justify-end px-2 pt-2",children:g.jsx(of,{tone:"light",onStartNewDiscussion:e})})};var Xt=(e=>(e.LAUNCHER="launcher",e.CHATBOX="chatbox",e))(Xt||{});const _C=({displayMode:e})=>{const[t,n]=S.useState(!1),r=S.useRef(null);return g.jsxs(g.Fragment,{children:[e===Xt.LAUNCHER&&g.jsxs(g.Fragment,{children:[g.jsx(Gm,{launcherRef:r,isWidgetOpen:t,setIsWidgetOpen:n}),g.jsx(TC,{launcherRef:r,isWidgetOpen:t,setIsWidgetOpen:n})]}),e===Xt.CHATBOX&&g.jsxs("div",{className:"chatBox w-full max-w-[1200px] mx-auto",children:[g.jsx(yC,{}),g.jsx(ef,{}),g.jsx(Wa,{className:"chatsystem-powered-by-inline"})]})]})},xC=e=>Object.values(Xt).includes(e),SC=e=>{const t=Vt();return xC(e)?e:(t.warn(`Display mode not valid. Using ${Xt.LAUNCHER} as default.`),Xt.LAUNCHER)},uf=()=>({hasFetchedSettings:!1,hasDisplayedCSS:!1}),CC=()=>{const[e,t]=S.useState(uf()),n=S.useCallback(()=>{t(i=>({...i,hasFetchedSettings:!0}))},[]),r=S.useCallback(()=>{t(i=>({...i,hasDisplayedCSS:!0}))},[]);return{appInternalContext:e,setAppInternalContext:t,setHasFetchedSettings:n,setHasDisplayedCss:r}},IC=S.createContext({appInternalContext:uf(),setAppInternalContext:()=>{},setHasFetchedSettings:()=>{}});function AC(e,t={},n,r){const i=lr(),{id:a,nonce:s,target:o,disableConstructable:u}=t,c=o,d=S.useRef(null),f=S.useRef(null);S.useEffect(()=>{if(!o)return;if(!e){n&&(i.log("No custom css found."),r?.());return}if(!u&&"adoptedStyleSheets"in c&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype)return d.current||(d.current=new CSSStyleSheet,c.adoptedStyleSheets=[...c.adoptedStyleSheets,d.current]),d.current.replaceSync(e),i.log("Loading custom css via stylesheet."),r?.(),()=>{const m=c.adoptedStyleSheets||[],y=m.indexOf(d.current);if(y>=0){const b=m.slice();b.splice(y,1),c.adoptedStyleSheets=b}d.current=null};if(!f.current){const m=document.createElement("style");m.type="text/css",a&&(m.id=a),s&&(m.nonce=s),(c instanceof Document&&c.head||c).appendChild(m),f.current=m}return f.current.textContent=e,i.log("Loading custom css via style tag."),r?.(),()=>{f.current?.parentNode?.removeChild(f.current),f.current=null}},[e,a,s,o,u,n,i,r])}const wC=`*, ::before, ::after {
|
|
160
159
|
--tw-border-spacing-x: 0;
|
|
161
160
|
--tw-border-spacing-y: 0;
|
|
162
161
|
--tw-translate-x: 0;
|
|
@@ -2136,7 +2135,7 @@ video {
|
|
|
2136
2135
|
padding-right: 6rem;
|
|
2137
2136
|
}
|
|
2138
2137
|
}
|
|
2139
|
-
`,
|
|
2138
|
+
`,vC=`.chatSystemWidget {
|
|
2140
2139
|
--chatsystem-primary-color: #7c3aed;
|
|
2141
2140
|
--chatsystem-primary-color-hover: color-mix(
|
|
2142
2141
|
in srgb,
|
|
@@ -2681,7 +2680,7 @@ video {
|
|
|
2681
2680
|
outline: 2px solid var(--chatsystem-primary-color);
|
|
2682
2681
|
outline-offset: 2px;
|
|
2683
2682
|
}
|
|
2684
|
-
`,
|
|
2683
|
+
`,kC=`/* React-Css Transitions */
|
|
2685
2684
|
.menuTransition-enter {
|
|
2686
2685
|
opacity: 0;
|
|
2687
2686
|
transform: scale(0.9) translateX(200px);
|
|
@@ -2750,7 +2749,14 @@ textarea::placeholder {
|
|
|
2750
2749
|
.messagesContainer {
|
|
2751
2750
|
outline:none
|
|
2752
2751
|
}
|
|
2753
|
-
|
|
2752
|
+
|
|
2753
|
+
.launcher:focus-visible,
|
|
2754
|
+
.chatsystem-close-button:focus-visible,
|
|
2755
|
+
.chatsystem-header__menu > button:focus-visible {
|
|
2756
|
+
outline: 2px solid currentColor;
|
|
2757
|
+
outline-offset: 3px;
|
|
2758
|
+
}
|
|
2759
|
+
`,NC=`/* Core mic button */
|
|
2754
2760
|
.mic-core {
|
|
2755
2761
|
position: absolute;
|
|
2756
2762
|
inset: 0;
|
|
@@ -2798,7 +2804,7 @@ textarea::placeholder {
|
|
|
2798
2804
|
70% { opacity: 0.12; }
|
|
2799
2805
|
100% { transform: scale(2.1); opacity: 0; }
|
|
2800
2806
|
}
|
|
2801
|
-
`,
|
|
2807
|
+
`,RC=`/* 1) Remove UA outline on the shadow host */
|
|
2802
2808
|
:host(:focus),
|
|
2803
2809
|
:host(:focus-visible) { outline: none; }
|
|
2804
2810
|
|
|
@@ -2810,9 +2816,9 @@ textarea::placeholder {
|
|
|
2810
2816
|
|
|
2811
2817
|
/* Ensure the wrapper itself doesn't get a default outline either */
|
|
2812
2818
|
.app-root:focus { outline: none; }
|
|
2813
|
-
`,
|
|
2814
|
-
${
|
|
2815
|
-
${
|
|
2816
|
-
${
|
|
2817
|
-
${
|
|
2819
|
+
`,Qu=`${wC}
|
|
2820
|
+
${vC}
|
|
2821
|
+
${kC}
|
|
2822
|
+
${RC}
|
|
2823
|
+
${NC}`;function OC({displayMode:e,appRoot:t,styleId:n}){const r=CC(),{hasFetchedSettings:i}=Mm(),{companySettings:a}=S.useContext(Pt);return S.useEffect(()=>{i&&r.setHasFetchedSettings()},[i,r.setHasFetchedSettings]),AC(a?.agent?.display?.CSSRules,{id:n,target:t},i,r.setHasDisplayedCss),g.jsx(IC.Provider,{value:r,children:r.appInternalContext.hasDisplayedCSS&&g.jsx("div",{className:"chatSystemWidget app-root",children:g.jsx(_C,{displayMode:e})})})}function cf({cssHref:e,displayMode:t=Xt.LAUNCHER}){const n=SC(t),r=n===Xt.LAUNCHER?"body":"inline",i=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),a=S.useRef(null),[s,o]=S.useState(null),[u,c]=S.useState(null);return S.useEffect(()=>{if(typeof document>"u")return;const d=r==="inline"?a.current:document.body;if(!d)return;const f=document.createElement("div");f.dataset.chatsystemView=n,d.appendChild(f);const h=f.attachShadow({mode:"open",delegatesFocus:!0});c(h);let m=!1;try{if("adoptedStyleSheets"in h&&!e){const b=new CSSStyleSheet;b.replaceSync(Qu),h.adoptedStyleSheets=[...h.adoptedStyleSheets,b],m=!0}}catch{}if(!m)if(e){const b=document.createElement("link");b.rel="stylesheet",b.href=e,h.appendChild(b)}else{const b=document.createElement("style");b.textContent=Qu,h.appendChild(b)}const y=document.createElement("div");return h.appendChild(y),o(y),()=>{o(null),c(null),f.remove()}},[n,e,r]),g.jsxs(g.Fragment,{children:[r==="inline"&&g.jsx("div",{ref:a}),s&&u&&Wn.createPortal(g.jsx(OC,{displayMode:n,appRoot:u,styleId:`chatsystem-custom-${i}`}),s)]})}function LC({cssHref:e,displayMode:t,appToken:n,agentId:r,shouldDisplayLogs:i,apiUrl:a,identityProvider:s,runtimeAdapter:o}){return g.jsx(Xc,{appToken:n,agentId:r,shouldDisplayLogs:i,apiUrl:a,identityProvider:s,runtimeAdapter:o,children:g.jsx(cf,{cssHref:e,displayMode:t})})}exports.App=LC;exports.WidgetRuntime=Xc;exports.WidgetView=cf;
|
|
2818
2824
|
//# sourceMappingURL=index.cjs.map
|