@malloy-publisher/sdk 0.2.6 → 0.3.0
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/README.md +172 -204
- package/dist/ServerProvider-CGnLjzag.cjs.js +1 -0
- package/dist/{ServerProvider-ksC5Su_x.es.js → ServerProvider-DSK9rfSY.es.js} +245 -245
- package/dist/client/api.d.ts +13 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/ApiErrorDisplay.d.ts +1 -2
- package/dist/components/Dashboard/Dashboard.d.ts +4 -2
- package/dist/components/Dashboard/promoteMeasureRow.d.ts +36 -0
- package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +14 -0
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +58 -0
- package/dist/components/DocumentStorage/DocumentStorageProvider.d.ts +18 -0
- package/dist/components/DocumentStorage/index.d.ts +3 -0
- package/dist/components/Model/index.d.ts +0 -1
- package/dist/components/RenderedResult/RenderedResult.d.ts +12 -0
- package/dist/components/RenderedResult/ResultContainer.d.ts +7 -1
- package/dist/components/RenderedResult/index.d.ts +1 -0
- package/dist/components/RenderedResult/resultSizing.d.ts +183 -0
- package/dist/components/drill/index.d.ts +1 -0
- package/dist/components/drill/useDrillSelf.d.ts +46 -0
- package/dist/components/given/filterValue.d.ts +63 -0
- package/dist/components/given/index.d.ts +1 -0
- package/dist/components/given/useGivenUrlParams.d.ts +39 -0
- package/dist/components/index.d.ts +2 -3
- package/dist/components/styles.d.ts +3 -3
- package/dist/core-8NVBCLZh.cjs.js +148 -0
- package/dist/{core-xdZbLgaF.es.js → core-B8oMW4sm.es.js} +3540 -2335
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useSuggestOptions.d.ts +28 -12
- package/dist/index.cjs.js +281 -1
- package/dist/index.es.js +45803 -79
- package/dist/sdk.css +1 -1
- package/dist/styles.css +0 -1
- package/package.json +2 -6
- package/src/components/ApiErrorDisplay.tsx +1 -1
- package/src/components/Connections/EditConnectionDialog.tsx +96 -86
- package/src/components/Dashboard/Dashboard.tsx +60 -95
- package/src/components/Dashboard/DashboardTile.tsx +25 -2
- package/src/components/Dashboard/promoteMeasureRow.spec.ts +137 -0
- package/src/components/Dashboard/promoteMeasureRow.ts +129 -0
- package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +81 -0
- package/src/components/DocumentStorage/BrowserDocumentStorage.ts +105 -0
- package/src/components/DocumentStorage/DocumentStorage.ts +73 -0
- package/src/components/DocumentStorage/DocumentStorageProvider.tsx +46 -0
- package/src/components/DocumentStorage/index.ts +15 -0
- package/src/components/Environment/Connections.tsx +15 -15
- package/src/components/Model/ModelCell.tsx +2 -1
- package/src/components/Model/index.ts +0 -1
- package/src/components/Notebook/Notebook.tsx +10 -76
- package/src/components/Notebook/NotebookCell.tsx +2 -8
- package/src/components/RenderedResult/RenderedResult.tsx +86 -76
- package/src/components/RenderedResult/ResultContainer.tsx +21 -24
- package/src/components/RenderedResult/index.ts +15 -0
- package/src/components/RenderedResult/resultSizing.spec.ts +249 -0
- package/src/components/RenderedResult/resultSizing.ts +308 -0
- package/src/components/ResultsDialog.tsx +2 -1
- package/src/components/drill/index.ts +5 -0
- package/src/components/drill/useDrillSelf.spec.tsx +64 -0
- package/src/components/drill/useDrillSelf.ts +110 -0
- package/src/components/given/GivenInput.spec.tsx +196 -2
- package/src/components/given/GivenInput.tsx +300 -25
- package/src/components/given/filterValue.spec.ts +112 -0
- package/src/components/given/filterValue.ts +188 -0
- package/src/components/given/index.ts +4 -0
- package/src/components/given/useGivenUrlParams.spec.tsx +74 -0
- package/src/components/given/useGivenUrlParams.ts +87 -0
- package/src/components/index.ts +5 -3
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useGivensState.spec.ts +158 -0
- package/src/hooks/useGivensState.ts +114 -23
- package/src/hooks/useSuggestOptions.dom.spec.ts +60 -1
- package/src/hooks/useSuggestOptions.ts +94 -51
- package/vite.config.ts +0 -1
- package/dist/ServerProvider-xXW1HJOJ.cjs.js +0 -1
- package/dist/components/AnalyzePackageButton.d.ts +0 -6
- package/dist/components/Workbook/BrowserWorkbookStorage.d.ts +0 -9
- package/dist/components/Workbook/EditableMalloyCell.d.ts +0 -11
- package/dist/components/Workbook/ModelPicker.d.ts +0 -11
- package/dist/components/Workbook/MutableCell.d.ts +0 -17
- package/dist/components/Workbook/Workbook.d.ts +0 -7
- package/dist/components/Workbook/WorkbookList.d.ts +0 -7
- package/dist/components/Workbook/WorkbookManager.d.ts +0 -84
- package/dist/components/Workbook/WorkbookStorage.d.ts +0 -17
- package/dist/components/Workbook/WorkbookStorageProvider.d.ts +0 -12
- package/dist/components/Workbook/index.d.ts +0 -7
- package/dist/core-RvrkY1Ss.cjs.js +0 -148
- package/dist/index-B3scIDRd.cjs.js +0 -356
- package/dist/index-Bda7HuZc.es.js +0 -66409
- package/dist/markdown-editor.css +0 -341
- package/src/components/AnalyzePackageButton.tsx +0 -319
- package/src/components/Workbook/BrowserWorkbookStorage.ts +0 -64
- package/src/components/Workbook/EditableMalloyCell.tsx +0 -49
- package/src/components/Workbook/ModelPicker.tsx +0 -134
- package/src/components/Workbook/MutableCell.tsx +0 -458
- package/src/components/Workbook/Workbook.tsx +0 -501
- package/src/components/Workbook/WorkbookList.tsx +0 -110
- package/src/components/Workbook/WorkbookManager.ts +0 -214
- package/src/components/Workbook/WorkbookStorage.ts +0 -35
- package/src/components/Workbook/WorkbookStorageProvider.tsx +0 -40
- package/src/components/Workbook/index.ts +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ApiErrorDisplay, type ApiErrorDisplayProps } from './ApiErrorDisplay';
|
|
2
2
|
export { useRouterClickHandler, type NavigationClick } from './click_helper';
|
|
3
3
|
export * from './Dashboard';
|
|
4
4
|
export * from './DataAppViewer';
|
|
@@ -16,5 +16,4 @@ export * from './QueryResult';
|
|
|
16
16
|
export * from './RenderedResult';
|
|
17
17
|
export { ServerProvider, useServer } from './ServerProvider';
|
|
18
18
|
export type { ServerContextValue, ServerProviderProps } from './ServerProvider';
|
|
19
|
-
export * from './
|
|
20
|
-
export type { WorkbookStorage } from './Workbook';
|
|
19
|
+
export * from './DocumentStorage';
|
|
@@ -50,9 +50,9 @@ export declare const MALLOY_ACCENT: {
|
|
|
50
50
|
* `MONO_FONT_FAMILY` defined in the publisher app's theme.
|
|
51
51
|
*/
|
|
52
52
|
export declare const MONO_FONT_FAMILY = "\"JetBrains Mono\", \"ui-monospace\", \"SFMono-Regular\", \"Menlo\", monospace";
|
|
53
|
-
export declare const StyledCard: StyledComponent< CardOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "children" | "
|
|
53
|
+
export declare const StyledCard: StyledComponent< CardOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "children" | "sx" | "variant" | "square" | "elevation" | "raised"> & MUIStyledCommonProps<Theme>, {}, {}>;
|
|
54
54
|
export declare const StyledCardContent: StyledComponent< CardContentOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "children" | "sx"> & MUIStyledCommonProps<Theme>, {}, {}>;
|
|
55
|
-
export declare const StyledCardMedia: StyledComponent< CardMediaOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "
|
|
55
|
+
export declare const StyledCardMedia: StyledComponent< CardMediaOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "children" | "sx" | "image" | "src"> & MUIStyledCommonProps<Theme>, {}, {}>;
|
|
56
56
|
export declare const CleanNotebookContainer: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
57
57
|
export declare const CleanNotebookHeader: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
58
58
|
export declare const CleanNotebookSection: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -64,7 +64,7 @@ export declare const StyledExplorerPage: StyledComponent<MUIStyledCommonProps<Th
|
|
|
64
64
|
export declare const StyledExplorerBanner: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
65
65
|
export declare const StyledExplorerContent: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
66
66
|
export declare const StyledExplorerPanel: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
67
|
-
export declare const PackageCard: StyledComponent< CardOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "children" | "
|
|
67
|
+
export declare const PackageCard: StyledComponent< CardOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "children" | "sx" | "variant" | "square" | "elevation" | "raised"> & MUIStyledCommonProps<Theme>, {}, {}>;
|
|
68
68
|
export declare const PackageCardContent: StyledComponent< CardContentOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "children" | "sx"> & MUIStyledCommonProps<Theme>, {}, {}>;
|
|
69
69
|
export declare const PackageSectionTitle: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
70
70
|
export declare const PackageContainer: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ve=require("./engine-oniguruma-BkproSVE.cjs.js");let Q=class extends Error{constructor(e){super(e),this.name="ShikiError"}},je=!1,Kn=!1;function _s(t=!0,e=!1){je=t,Kn=e}function H(t,e=3){if(je&&!(typeof je=="number"&&e>je)){if(Kn)throw new Error(`[SHIKI DEPRECATE]: ${t}`);console.trace(`[SHIKI DEPRECATE]: ${t}`)}}function ks(t){return Ht(t)}function Ht(t){return Array.isArray(t)?Ss(t):t instanceof RegExp?t:typeof t=="object"?ws(t):t}function Ss(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Ht(t[n]);return e}function ws(t){let e={};for(let n in t)e[n]=Ht(t[n]);return e}function Xn(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function Qn(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Qn(t.substring(0,t.length-1)):t.substr(~e+1)}var ft=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Me=class{static hasCaptures(t){return t===null?!1:(ft.lastIndex=0,ft.test(t))}static replaceCaptures(t,e,n){return t.replace(ft,(r,s,a,o)=>{let i=n[parseInt(s||a,10)];if(i){let l=e.substring(i.start,i.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Jn(t,e){return t<e?-1:t>e?1:0}function Yn(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let a=Jn(t[s],e[s]);if(a!==0)return a}return 0}return n-r}function hn(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Zn(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var er=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},ze=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Es(t),e)}static createFromParsedTheme(t,e){return Rs(t,e)}_cachedMatchRoot=new er(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(s=>vs(t.parent,s.parentScopes));return r?new tr(r.fontStyle,r.foreground,r.background):null}},dt=class Ue{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new Ue(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new Ue(n,e[r]);return n}push(e){return new Ue(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function vs(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}for(;t&&!As(t.scopeName,r);){if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function As(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var tr=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Es(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,a=e.length;s<a;s++){let o=e[s];if(!o.settings)continue;let i;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),i=h.split(",")}else Array.isArray(o.scope)?i=o.scope:i=[""];let l=-1;if(typeof o.settings.fontStyle=="string"){l=0;let h=o.settings.fontStyle.split(" ");for(let d=0,p=h.length;d<p;d++)switch(h[d]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof o.settings.foreground=="string"&&hn(o.settings.foreground)&&(c=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&hn(o.settings.background)&&(u=o.settings.background);for(let h=0,d=i.length;h<d;h++){let f=i[h].trim().split(" "),k=f[f.length-1],y=null;f.length>1&&(y=f.slice(0,f.length-1),y.reverse()),n[r++]=new xs(k,y,s,l,c,u)}}return n}var xs=class{constructor(t,e,n,r,s,a){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=a}},X=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(X||{});function Rs(t,e){t.sort((l,c)=>{let u=Jn(l.scope,c.scope);return u!==0||(u=Yn(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",s="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(s=l.background)}let a=new Is(e),o=new tr(n,a.getId(r),a.getId(s)),i=new Ts(new xt(0,null,-1,0,0),[]);for(let l=0,c=t.length;l<c;l++){let u=t[l];i.insert(0,u.scope,u.parentScopes,u.fontStyle,a.getId(u.foreground),a.getId(u.background))}return new ze(a,o,i)}var Is=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Ns=Object.freeze([]),xt=class nr{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,a){this.scopeDepth=e,this.parentScopes=n||Ns,this.fontStyle=r,this.foreground=s,this.background=a}clone(){return new nr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},Ts=class Rt{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){const a=n.parentScopes[s].length-e.parentScopes[r].length;if(a!==0)return a;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,a;if(r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Rt._cmpBySpecificity),n}insert(e,n,r,s,a,o){if(n===""){this._doInsertHere(e,r,s,a,o);return}let i=n.indexOf("."),l,c;i===-1?(l=n,c=""):(l=n.substring(0,i),c=n.substring(i+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new Rt(this._mainRule.clone(),xt.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(e+1,c,r,s,a,o)}_doInsertHere(e,n,r,s,a){if(n===null){this._mainRule.acceptOverwrite(e,r,s,a);return}for(let o=0,i=this._rulesWithParentScopes.length;o<i;o++){let l=this._rulesWithParentScopes[o];if(Yn(l.parentScopes,n)===0){l.acceptOverwrite(e,r,s,a);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new xt(e,n,r,s,a))}},ie=class U{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=U.getLanguageId(e),r=U.getTokenType(e),s=U.getFontStyle(e),a=U.getForeground(e),o=U.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,a,o,i){let l=U.getLanguageId(e),c=U.getTokenType(e),u=U.containsBalancedBrackets(e)?1:0,h=U.getFontStyle(e),d=U.getForeground(e),p=U.getBackground(e);return n!==0&&(l=n),r!==8&&(c=r),s!==null&&(u=s?1:0),a!==-1&&(h=a),o!==0&&(d=o),i!==0&&(p=i),(l<<0|c<<8|u<<10|h<<11|d<<15|p<<24)>>>0}};function qe(t,e){const n=[],r=Ps(t);let s=r.next();for(;s!==null;){let l=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let c=o();if(n.push({matcher:c,priority:l}),s!==",")break;s=r.next()}return n;function a(){if(s==="-"){s=r.next();const l=a();return c=>!!l&&!l(c)}if(s==="("){s=r.next();const l=i();return s===")"&&(s=r.next()),l}if(pn(s)){const l=[];do l.push(s),s=r.next();while(pn(s));return c=>e(l,c)}return null}function o(){const l=[];let c=a();for(;c;)l.push(c),c=a();return u=>l.every(h=>h(u))}function i(){const l=[];let c=o();for(;c&&(l.push(c),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");c=o()}return u=>l.some(h=>h(u))}}function pn(t){return!!t&&!!t.match(/[\w\.:]+/)}function Ps(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function rr(t){typeof t.dispose=="function"&&t.dispose()}var Ae=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Ls=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},$s=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Os=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ae(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new $s;for(const n of t)Ms(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof Ae){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Ms(t,e,n,r){const s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const a=n.lookup(e);t instanceof Ae?We({baseGrammar:a,selfGrammar:s},r):It(t.ruleName,{baseGrammar:a,selfGrammar:s,repository:s.repository},r);const o=n.injections(t.scopeName);if(o)for(const i of o)r.add(new Ae(i))}function It(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];Ve([r],e,n)}}function We(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Ve(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Ve(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Ve(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?Xn({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Ve(r.patterns,{...e,repository:s},n);const a=r.include;if(!a)continue;const o=sr(a);switch(o.kind){case 0:We({...e,selfGrammar:e.baseGrammar},n);break;case 1:We(e,n);break;case 2:It(o.ruleName,{...e,repository:s},n);break;case 3:case 4:const i=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(i){const l={baseGrammar:e.baseGrammar,selfGrammar:i,repository:s};o.kind===4?It(o.ruleName,l,n):We(l,n)}else o.kind===4?n.add(new Ls(o.scopeName,o.ruleName)):n.add(new Ae(o.scopeName));break}}}var Gs=class{kind=0},Bs=class{kind=1},Fs=class{constructor(t){this.ruleName=t}kind=2},Ds=class{constructor(t){this.scopeName=t}kind=3},js=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function sr(t){if(t==="$base")return new Gs;if(t==="$self")return new Bs;const e=t.indexOf("#");if(e===-1)return new Ds(t);if(e===0)return new Fs(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new js(n,r)}}var Us=/\\(\d+)/,fn=/\\(\d+)/g,Ws=-1,ar=-2;var Te=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Me.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Me.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Qn(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Me.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Me.replaceCaptures(this._contentName,t,e)}},Hs=class extends Te{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},zs=class extends Te{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null),this._match=new Ee(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new xe,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},dn=class extends Te{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new xe,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Nt=class extends Te{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,a,o,i,l,c){super(t,e,n,r),this._begin=new Ee(s,this.id),this.beginCaptures=a,this._end=new Ee(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new xe;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Ke=class extends Te{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,a,o,i,l){super(t,e,n,r),this._begin=new Ee(s,this.id),this.beginCaptures=a,this.whileCaptures=i,this._while=new Ee(o,ar),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new xe;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new xe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},or=class O{static createCaptureRule(e,n,r,s,a){return e.registerRule(o=>new Hs(n,o,r,s,a))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new zs(e.$vscodeTextmateLocation,e.id,e.name,e.match,O._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Xn({},r,e.repository));let a=e.patterns;return typeof a>"u"&&e.include&&(a=[{include:e.include}]),new dn(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,O._compilePatterns(a,n,r))}return e.while?new Ke(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,O._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,O._compileCaptures(e.whileCaptures||e.captures,n,r),O._compilePatterns(e.patterns,n,r)):new Nt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,O._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,O._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,O._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let a=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const i=parseInt(o,10);i>a&&(a=i)}for(let o=0;o<=a;o++)s[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const i=parseInt(o,10);let l=0;e[o].patterns&&(l=O.getCompiledRuleId(e[o],n,r)),s[i]=O.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,l)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let a=0,o=e.length;a<o;a++){const i=e[a];let l=-1;if(i.include){const c=sr(i.include);switch(c.kind){case 0:case 1:l=O.getCompiledRuleId(r[i.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=O.getCompiledRuleId(u,n,r));break;case 3:case 4:const h=c.scopeName,d=c.kind===4?c.ruleName:null,p=n.getExternalGrammar(h,r);if(p)if(d){let f=p.repository[d];f&&(l=O.getCompiledRuleId(f,n,p.repository))}else l=O.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else l=O.getCompiledRuleId(i,n,r);if(l!==-1){const c=n.getRule(l);let u=!1;if((c instanceof dn||c instanceof Nt||c instanceof Ke)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;s.push(l)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},Ee=class ir{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let s=0,a=[],o=!1;for(let i=0;i<r;i++)if(e.charAt(i)==="\\"&&i+1<r){const c=e.charAt(i+1);c==="z"?(a.push(e.substring(s,i)),a.push("$(?!\\n)(?<!\\n)"),s=i+2):(c==="A"||c==="G")&&(o=!0),i++}this.hasAnchor=o,s===0?this.source=e:(a.push(e.substring(s,r)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Us.test(this.source):this.hasBackReferences=!1}clone(){return new ir(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>e.substring(s.start,s.end));return fn.lastIndex=0,this.source.replace(fn,(s,a)=>Zn(r[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],a,o,i,l;for(a=0,o=this.source.length;a<o;a++)i=this.source.charAt(a),e[a]=i,n[a]=i,r[a]=i,s[a]=i,i==="\\"&&a+1<o&&(l=this.source.charAt(a+1),l==="A"?(e[a+1]="",n[a+1]="",r[a+1]="A",s[a+1]="A"):l==="G"?(e[a+1]="",n[a+1]="G",r[a+1]="",s[a+1]="G"):(e[a+1]=l,n[a+1]=l,r[a+1]=l,s[a+1]=l),a++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},xe=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new gn(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new gn(t,r,this._items.map(s=>s.ruleId))}},gn=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
|
+
`)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},gt=class{constructor(t,e){this.languageId=t,this.tokenType=e}},qs=class Tt{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new gt(e,8),this._embeddedLanguagesMatcher=new Vs(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Tt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new gt(0,0);_getBasicScopeAttributes=new er(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new gt(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(Tt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Vs=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>Zn(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}};typeof process<"u"&&process.env.VSCODE_TEXTMATE_DEBUG;var mn=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function lr(t,e,n,r,s,a,o,i){const l=e.content.length;let c=!1,u=-1;if(o){const p=Ks(t,e,n,r,s,a);s=p.stack,r=p.linePos,n=p.isFirstLine,u=p.anchorPosition}const h=Date.now();for(;!c;){if(i!==0&&Date.now()-h>i)return new mn(s,!0);d()}return new mn(s,!1);function d(){const p=Xs(t,e,n,r,s,u);if(!p){a.produce(s,l),c=!0;return}const f=p.captureIndices,k=p.matchedRuleId,y=f&&f.length>0?f[0].end>r:!1;if(k===Ws){const S=s.getRule(t);a.produce(s,f[0].start),s=s.withContentNameScopesList(s.nameScopesList),ke(t,e,n,s,a,S.endCaptures,f),a.produce(s,f[0].end);const C=s;if(s=s.parent,u=C.getAnchorPos(),!y&&C.getEnterPos()===r){s=C,a.produce(s,l),c=!0;return}}else{const S=t.getRule(k);a.produce(s,f[0].start);const C=s,w=S.getName(e.content,f),L=s.contentNameScopesList.pushAttributed(w,t);if(s=s.push(k,r,u,f[0].end===l,null,L,L),S instanceof Nt){const R=S;ke(t,e,n,s,a,R.beginCaptures,f),a.produce(s,f[0].end),u=f[0].end;const q=R.getContentName(e.content,f),F=L.pushAttributed(q,t);if(s=s.withContentNameScopesList(F),R.endHasBackReferences&&(s=s.withEndRule(R.getEndWithResolvedBackReferences(e.content,f))),!y&&C.hasSameRuleAs(s)){s=s.pop(),a.produce(s,l),c=!0;return}}else if(S instanceof Ke){const R=S;ke(t,e,n,s,a,R.beginCaptures,f),a.produce(s,f[0].end),u=f[0].end;const q=R.getContentName(e.content,f),F=L.pushAttributed(q,t);if(s=s.withContentNameScopesList(F),R.whileHasBackReferences&&(s=s.withEndRule(R.getWhileWithResolvedBackReferences(e.content,f))),!y&&C.hasSameRuleAs(s)){s=s.pop(),a.produce(s,l),c=!0;return}}else if(ke(t,e,n,s,a,S.captures,f),a.produce(s,f[0].end),s=s.pop(),!y){s=s.safePop(),a.produce(s,l),c=!0;return}}f[0].end>r&&(r=f[0].end,n=!1)}}function Ks(t,e,n,r,s,a){let o=s.beginRuleCapturedEOL?0:-1;const i=[];for(let l=s;l;l=l.pop()){const c=l.getRule(t);c instanceof Ke&&i.push({rule:c,stack:l})}for(let l=i.pop();l;l=i.pop()){const{ruleScanner:c,findOptions:u}=Ys(l.rule,t,l.stack.endRule,n,r===o),h=c.findNextMatchSync(e,r,u);if(h){if(h.ruleId!==ar){s=l.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(a.produce(l.stack,h.captureIndices[0].start),ke(t,e,n,l.stack,a,l.rule.whileCaptures,h.captureIndices),a.produce(l.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>r&&(r=h.captureIndices[0].end,n=!1))}else{s=l.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:o,isFirstLine:n}}function Xs(t,e,n,r,s,a){const o=Qs(t,e,n,r,s,a),i=t.getInjections();if(i.length===0)return o;const l=Js(i,t,e,n,r,s,a);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:o}function Qs(t,e,n,r,s,a){const o=s.getRule(t),{ruleScanner:i,findOptions:l}=cr(o,t,s.endRule,n,r===a),c=i.findNextMatchSync(e,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Js(t,e,n,r,s,a,o){let i=Number.MAX_VALUE,l=null,c,u=0;const h=a.contentNameScopesList.getScopeNames();for(let d=0,p=t.length;d<p;d++){const f=t[d];if(!f.matcher(h))continue;const k=e.getRule(f.ruleId),{ruleScanner:y,findOptions:S}=cr(k,e,null,r,s===o),C=y.findNextMatchSync(n,s,S);if(!C)continue;const w=C.captureIndices[0].start;if(!(w>=i)&&(i=w,l=C.captureIndices,c=C.ruleId,u=f.priority,i===s))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function cr(t,e,n,r,s){return{ruleScanner:t.compileAG(e,n,r,s),findOptions:0}}function Ys(t,e,n,r,s){return{ruleScanner:t.compileWhileAG(e,n,r,s),findOptions:0}}function ke(t,e,n,r,s,a,o){if(a.length===0)return;const i=e.content,l=Math.min(a.length,o.length),c=[],u=o[0].end;for(let h=0;h<l;h++){const d=a[h];if(d===null)continue;const p=o[h];if(p.length===0)continue;if(p.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=p.start;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?s.produceFromScopes(c[c.length-1].scopes,p.start):s.produce(r,p.start),d.retokenizeCapturedWithRuleId){const k=d.getName(i,o),y=r.contentNameScopesList.pushAttributed(k,t),S=d.getContentName(i,o),C=y.pushAttributed(S,t),w=r.push(d.retokenizeCapturedWithRuleId,p.start,-1,!1,null,y,C),L=t.createOnigString(i.substring(0,p.end));lr(t,L,n&&p.start===0,p.start,w,s,!1,0),rr(L);continue}const f=d.getName(i,o);if(f!==null){const y=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(f,t);c.push(new Zs(y,p.end))}}for(;c.length>0;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Zs=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function ea(t,e,n,r,s,a,o,i){return new na(t,e,n,r,s,a,o,i)}function yn(t,e,n,r,s){const a=qe(e,Xe),o=or.getCompiledRuleId(n,r,s.repository);for(const i of a)t.push({debugSelector:e,matcher:i.matcher,ruleId:o,grammar:s,priority:i.priority})}function Xe(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let s=n;s<e.length;s++)if(ta(e[s],r))return n=s+1,!0;return!1})}function ta(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var na=class{constructor(t,e,n,r,s,a,o,i){if(this._rootScopeName=t,this.balancedBracketSelectors=a,this._onigLib=i,this._basicScopeAttributesProvider=new qs(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Cn(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const l of Object.keys(s)){const c=qe(l,Xe);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:s[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const s=r.injections;if(s)for(let o in s)yn(e,o,s[o],this,r);const a=this._grammarRepository.injections(n);a&&a.forEach(o=>{const i=this.getExternalGrammar(o);if(i){const l=i.injectionSelector;l&&yn(e,l,i,this,i)}})}return e.sort((s,a)=>s.priority-a.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Cn(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=or.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===Pt.NULL){s=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=ie.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let p;d?p=Se.createRootAndLookUpScopeName(d,h,this):p=Se.createRoot("unknown",h),e=new Pt(null,this._rootId,-1,-1,!1,null,p,p)}else s=!1,e.reset();t=t+`
|
|
3
|
+
`;const a=this.createOnigString(t),o=a.content.length,i=new sa(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=lr(this,a,s,0,e,i,!0,r);return rr(a),{lineLength:o,lineTokens:i,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Cn(t,e){return t=ks(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var Se=class V{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,s=e?.scopePath??null;for(const a of n)s=dt.push(s,a.scopeNames),r=new V(r,s,a.encodedTokenAttributes);return r}static createRoot(e,n){return new V(null,new dt(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const s=r.getMetadataForScope(e),a=new dt(null,e),o=r.themeProvider.themeMatch(a),i=V.mergeAttributes(n,s,o);return new V(null,a,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return V.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let s=-1,a=0,o=0;return r!==null&&(s=r.fontStyle,a=r.foregroundId,o=r.backgroundId),ie.set(e,n.languageId,n.tokenType,null,s,a,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return V._pushAttributed(this,e,n);const r=e.split(/ /g);let s=this;for(const a of r)s=V._pushAttributed(s,a,n);return s}static _pushAttributed(e,n,r){const s=r.getMetadataForScope(n),a=e.scopePath.push(n),o=r.themeProvider.themeMatch(a),i=V.mergeAttributes(e.tokenAttributes,s,o);return new V(e,a,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},Pt=class ae{constructor(e,n,r,s,a,o,i,l){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=a,this.endRule=o,this.nameScopesList=i,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new ae(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:ae._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?Se.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){ae._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,s,a,o,i){return new ae(this,e,n,r,s,a,o,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new ae(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const r=Se.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new ae(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Se.fromExtension(r,n.contentNameScopesList))}},ra=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):qe(n,Xe).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>qe(n,Xe).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},sa=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(a)&&(r=ie.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(a))}if(s&&(r=ie.set(r,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},aa=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,s){if(!this._grammars.has(t)){let a=this._rawGrammars.get(t);if(!a)return null;this._grammars.set(t,ea(t,a,e,n,r,s,this,this._onigLib))}return this._grammars.get(t)}},oa=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new aa(ze.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(ze.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new ra(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,s,a){const o=new Os(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(i=>this._loadSingleGrammar(i.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,r,s,a)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,s=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,n=0,r=null,s=null,a=null){return this._syncRegistry.grammarForScopeName(e,n,r,s,a)}},Lt=Pt.NULL;const ia=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Pe{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Pe.prototype.normal={};Pe.prototype.property={};Pe.prototype.space=void 0;function ur(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new Pe(n,r,e)}function $t(t){return t.toLowerCase()}class B{constructor(e,n){this.attribute=n,this.property=e}}B.prototype.attribute="";B.prototype.booleanish=!1;B.prototype.boolean=!1;B.prototype.commaOrSpaceSeparated=!1;B.prototype.commaSeparated=!1;B.prototype.defined=!1;B.prototype.mustUseProperty=!1;B.prototype.number=!1;B.prototype.overloadedBoolean=!1;B.prototype.property="";B.prototype.spaceSeparated=!1;B.prototype.space=void 0;let la=0;const v=ce(),N=ce(),Ot=ce(),m=ce(),x=ce(),fe=ce(),D=ce();function ce(){return 2**++la}const Mt=Object.freeze(Object.defineProperty({__proto__:null,boolean:v,booleanish:N,commaOrSpaceSeparated:D,commaSeparated:fe,number:m,overloadedBoolean:Ot,spaceSeparated:x},Symbol.toStringTag,{value:"Module"})),mt=Object.keys(Mt);class zt extends B{constructor(e,n,r,s){let a=-1;if(super(e,n),bn(this,"space",s),typeof r=="number")for(;++a<mt.length;){const o=mt[a];bn(this,mt[a],(r&Mt[o])===Mt[o])}}}zt.prototype.defined=!0;function bn(t,e,n){n&&(t[e]=n)}function Ce(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const a=new zt(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),e[r]=a,n[$t(r)]=r,n[$t(a.attribute)]=r}return new Pe(e,n,t.space)}const hr=Ce({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:m,ariaColIndex:m,ariaColSpan:m,ariaControls:x,ariaCurrent:null,ariaDescribedBy:x,ariaDetails:null,ariaDisabled:N,ariaDropEffect:x,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:x,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:x,ariaLevel:m,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:x,ariaPlaceholder:null,ariaPosInSet:m,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:x,ariaRowCount:m,ariaRowIndex:m,ariaRowSpan:m,ariaSelected:N,ariaSetSize:m,ariaSort:null,ariaValueMax:m,ariaValueMin:m,ariaValueNow:m,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function pr(t,e){return e in t?t[e]:e}function fr(t,e){return pr(t,e.toLowerCase())}const ca=Ce({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fe,acceptCharset:x,accessKey:x,action:null,allow:null,allowFullScreen:v,allowPaymentRequest:v,allowUserMedia:v,alt:null,as:null,async:v,autoCapitalize:null,autoComplete:x,autoFocus:v,autoPlay:v,blocking:x,capture:null,charSet:null,checked:v,cite:null,className:x,cols:m,colSpan:null,content:null,contentEditable:N,controls:v,controlsList:x,coords:m|fe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:v,defer:v,dir:null,dirName:null,disabled:v,download:Ot,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:v,formTarget:null,headers:x,height:m,hidden:Ot,high:m,href:null,hrefLang:null,htmlFor:x,httpEquiv:x,id:null,imageSizes:null,imageSrcSet:null,inert:v,inputMode:null,integrity:null,is:null,isMap:v,itemId:null,itemProp:x,itemRef:x,itemScope:v,itemType:x,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:v,low:m,manifest:null,max:null,maxLength:m,media:null,method:null,min:null,minLength:m,multiple:v,muted:v,name:null,nonce:null,noModule:v,noValidate:v,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:v,optimum:m,pattern:null,ping:x,placeholder:null,playsInline:v,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:v,referrerPolicy:null,rel:x,required:v,reversed:v,rows:m,rowSpan:m,sandbox:x,scope:null,scoped:v,seamless:v,selected:v,shadowRootClonable:v,shadowRootDelegatesFocus:v,shadowRootMode:null,shape:null,size:m,sizes:null,slot:null,span:m,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:m,step:null,style:null,tabIndex:m,target:null,title:null,translate:null,type:null,typeMustMatch:v,useMap:null,value:N,width:m,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:x,axis:null,background:null,bgColor:null,border:m,borderColor:null,bottomMargin:m,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:v,declare:v,event:null,face:null,frame:null,frameBorder:null,hSpace:m,leftMargin:m,link:null,longDesc:null,lowSrc:null,marginHeight:m,marginWidth:m,noResize:v,noHref:v,noShade:v,noWrap:v,object:null,profile:null,prompt:null,rev:null,rightMargin:m,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:m,valueType:null,version:null,vAlign:null,vLink:null,vSpace:m,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:v,disableRemotePlayback:v,prefix:null,property:null,results:m,security:null,unselectable:null},space:"html",transform:fr}),ua=Ce({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:D,accentHeight:m,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:m,amplitude:m,arabicForm:null,ascent:m,attributeName:null,attributeType:null,azimuth:m,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:m,by:null,calcMode:null,capHeight:m,className:x,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:m,diffuseConstant:m,direction:null,display:null,dur:null,divisor:m,dominantBaseline:null,download:v,dx:null,dy:null,edgeMode:null,editable:null,elevation:m,enableBackground:null,end:null,event:null,exponent:m,externalResourcesRequired:null,fill:null,fillOpacity:m,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:fe,g2:fe,glyphName:fe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:m,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:m,horizOriginX:m,horizOriginY:m,id:null,ideographic:m,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:m,k:m,k1:m,k2:m,k3:m,k4:m,kernelMatrix:D,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:m,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:m,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:m,overlineThickness:m,paintOrder:null,panose1:null,path:null,pathLength:m,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:x,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:m,pointsAtY:m,pointsAtZ:m,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D,rev:D,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D,requiredFeatures:D,requiredFonts:D,requiredFormats:D,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:m,specularExponent:m,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:m,strikethroughThickness:m,string:null,stroke:null,strokeDashArray:D,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:m,strokeOpacity:m,strokeWidth:null,style:null,surfaceScale:m,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D,tabIndex:m,tableValues:null,target:null,targetX:m,targetY:m,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:m,underlineThickness:m,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:m,values:null,vAlphabetic:m,vMathematical:m,vectorEffect:null,vHanging:m,vIdeographic:m,version:null,vertAdvY:m,vertOriginX:m,vertOriginY:m,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:m,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pr}),dr=Ce({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),gr=Ce({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fr}),mr=Ce({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),ha=/[A-Z]/g,_n=/-[a-z]/g,pa=/^data[-\w.:]+$/i;function fa(t,e){const n=$t(e);let r=e,s=B;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&pa.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(_n,ga);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!_n.test(a)){let o=a.replace(ha,da);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}s=zt}return new s(r,e)}function da(t){return"-"+t.toLowerCase()}function ga(t){return t.charAt(1).toUpperCase()}const ma=ur([hr,ca,dr,gr,mr],"html"),yr=ur([hr,ua,dr,gr,mr],"svg"),kn={}.hasOwnProperty;function ya(t,e){const n=e||{};function r(s,...a){let o=r.invalid;const i=r.handlers;if(s&&kn.call(s,t)){const l=String(s[t]);o=kn.call(i,l)?i[l]:r.unknown}if(o)return o.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Ca=/["&'<>`]/g,ba=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_a=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ka=/[|\\{}()[\]^$+*?.]/g,Sn=new WeakMap;function Sa(t,e){if(t=t.replace(e.subset?wa(e.subset):Ca,r),e.subset||e.escapeOnly)return t;return t.replace(ba,n).replace(_a,r);function n(s,a,o){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,o.charCodeAt(a+2),e)}function r(s,a,o){return e.format(s.charCodeAt(0),o.charCodeAt(a+1),e)}}function wa(t){let e=Sn.get(t);return e||(e=va(t),Sn.set(t,e)),e}function va(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(ka,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Aa=/[\dA-Fa-f]/;function Ea(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!Aa.test(String.fromCharCode(e))?r:r+";"}const xa=/\d/;function Ra(t,e,n){const r="&#"+String(t);return n&&e&&!xa.test(String.fromCharCode(e))?r:r+";"}const Ia=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],yt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Na=["cent","copy","divide","gt","lt","not","para","times"],Cr={}.hasOwnProperty,Gt={};let Ge;for(Ge in yt)Cr.call(yt,Ge)&&(Gt[yt[Ge]]=Ge);const Ta=/[^\dA-Za-z]/;function Pa(t,e,n,r){const s=String.fromCharCode(t);if(Cr.call(Gt,s)){const a=Gt[s],o="&"+a;return n&&Ia.includes(a)&&!Na.includes(a)&&(!r||e&&e!==61&&Ta.test(String.fromCharCode(e)))?o:o+";"}return""}function La(t,e,n){let r=Ea(t,e,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=Pa(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const a=Ra(t,e,n.omitOptionalSemicolons);a.length<r.length&&(r=a)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function de(t,e){return Sa(t,Object.assign({format:La},e))}const $a=/^>|^->|<!--|-->|--!>|<!-$/g,Oa=[">"],Ma=["<",">"];function Ga(t,e,n,r){return r.settings.bogusComments?"<?"+de(t.value,Object.assign({},r.settings.characterReferences,{subset:Oa}))+">":"<!--"+t.value.replace($a,s)+"-->";function s(a){return de(a,Object.assign({},r.settings.characterReferences,{subset:Ma}))}}function Ba(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function wn(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function Fa(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Da(t){return t.join(" ").trim()}const ja=/[ \t\n\f\r]/g;function qt(t){return typeof t=="object"?t.type==="text"?vn(t.value):!1:vn(t)}function vn(t){return t.replace(ja,"")===""}const P=_r(1),br=_r(-1),Ua=[];function _r(t){return e;function e(n,r,s){const a=n?n.children:Ua;let o=(r||0)+t,i=a[o];if(!s)for(;i&&qt(i);)o+=t,i=a[o];return i}}const Wa={}.hasOwnProperty;function kr(t){return e;function e(n,r,s){return Wa.call(t,n.tagName)&&t[n.tagName](n,r,s)}}const Vt=kr({body:za,caption:Ct,colgroup:Ct,dd:Xa,dt:Ka,head:Ct,html:Ha,li:Va,optgroup:Qa,option:Ja,p:qa,rp:An,rt:An,tbody:Za,td:En,tfoot:eo,th:En,thead:Ya,tr:to});function Ct(t,e,n){const r=P(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&qt(r.value.charAt(0)))}function Ha(t,e,n){const r=P(n,e);return!r||r.type!=="comment"}function za(t,e,n){const r=P(n,e);return!r||r.type!=="comment"}function qa(t,e,n){const r=P(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Va(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Ka(t,e,n){const r=P(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Xa(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function An(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Qa(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Ja(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Ya(t,e,n){const r=P(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Za(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function eo(t,e,n){return!P(n,e)}function to(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function En(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const no=kr({body:ao,colgroup:oo,head:so,html:ro,tbody:io});function ro(t){const e=P(t,-1);return!e||e.type!=="comment"}function so(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function ao(t){const e=P(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&qt(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function oo(t,e,n){const r=br(n,e),s=P(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Vt(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function io(t,e,n){const r=br(n,e),s=P(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Vt(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const Be={name:[[`
|
|
4
|
+
\f\r &/=>`.split(""),`
|
|
5
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
6
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
7
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
8
|
+
\f\r &>`.split(""),`\0
|
|
9
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
10
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
11
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function lo(t,e,n,r){const s=r.schema,a=s.space==="svg"?!1:r.settings.omitOptionalTags;let o=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const i=[];let l;s.space==="html"&&t.tagName==="svg"&&(r.schema=yr);const c=co(r,t.properties),u=r.all(s.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=s,u&&(o=!1),(c||!a||!no(t,e,n))&&(i.push("<",t.tagName,c?" "+c:""),o&&(s.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&i.push(" "),i.push("/")),i.push(">")),i.push(u),!o&&(!a||!Vt(t,e,n))&&i.push("</"+t.tagName+">"),i.join("")}function co(t,e){const n=[];let r=-1,s;if(e){for(s in e)if(e[s]!==null&&e[s]!==void 0){const a=uo(t,s,e[s]);a&&n.push(a)}}for(;++r<n.length;){const a=t.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&a!=='"'&&a!=="'"&&(n[r]+=" ")}return n.join("")}function uo(t,e,n){const r=fa(t.schema,e),s=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,a=t.settings.allowDangerousCharacters?0:1;let o=t.quote,i;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=de(r.attribute,Object.assign({},t.settings.characterReferences,{subset:Be.name[s][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Fa:Da)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?l:(t.settings.preferUnquoted&&(i=de(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:Be.unquoted[s][a]}))),i!==n&&(t.settings.quoteSmart&&wn(n,o)>wn(n,t.alternative)&&(o=t.alternative),i=o+de(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?Be.single:Be.double)[s][a],attribute:!0}))+o),l+(i&&"="+i))}const ho=["<","&"];function Sr(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:de(t.value,Object.assign({},r.settings.characterReferences,{subset:ho}))}function po(t,e,n,r){return r.settings.allowDangerousHtml?t.value:Sr(t,e,n,r)}function fo(t,e,n,r){return r.all(t)}const go=ya("type",{invalid:mo,unknown:yo,handlers:{comment:Ga,doctype:Ba,element:lo,raw:po,root:fo,text:Sr}});function mo(t){throw new Error("Expected node, not `"+t+"`")}function yo(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Co={},bo={},_o=[];function wr(t,e){const n=e||Co,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ko,all:So,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ia,characterReferences:n.characterReferences||bo,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?yr:ma,quote:r,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function ko(t,e,n){return go(t,e,n,this)}function So(t){const e=[],n=t&&t.children||_o;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}const Kt=String.raw,xn=Kt`(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})`,Rn=Kt`\u{E0061}-\u{E007A}`,wo=()=>new RegExp(Kt`[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[${Rn}]{2}[\u{E0030}-\u{E0039}${Rn}]{1,3}\u{E007F}|${xn}(?:\u200D${xn})*`,"gu"),W=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function tt(t,e,n,r){const s=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1];let o=0,i="";for(const l of t.matchAll(s)){const{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===W.DEFAULT==!o)){n instanceof Function?i+=n(l,{context:o?W.CHAR_CLASS:W.DEFAULT,negated:a[a.length-1]}):i+=n;continue}c[0]==="["?(o++,a.push(c[1]==="^")):c==="]"&&o&&(o--,a.pop()),i+=c}return i}function vo(t,e,n,r){tt(t,e,n,r)}function Ao(t,e,n=0,r){if(!new RegExp(e,"su").test(t))return null;const s=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let a=0,o;for(;o=s.exec(t);){const{0:i,groups:{$skip:l}}=o;if(!l&&(!r||r===W.DEFAULT==!a))return o;i==="["?a++:i==="]"&&a&&a--,s.lastIndex==o.index&&s.lastIndex++}return null}function Fe(t,e,n){return!!Ao(t,e,0,n)}function Eo(t,e){const n=/\\?./gsu;n.lastIndex=e;let r=t.length,s=0,a=1,o;for(;o=n.exec(t);){const[i]=o;if(i==="[")s++;else if(s)i==="]"&&s--;else if(i==="(")a++;else if(i===")"&&(a--,!a)){r=o.index;break}}return t.slice(e,r)}const le="$E$";class Xt extends RegExp{_captureMap;_namesByIndex;constructor(e,n,r){if(e instanceof RegExp&&r)throw new Error("Cannot provide options when copying a regexp");const s=!!r?.useEmulationGroups,a=s?xo(e):null;super(a?.expression||e,n);const o=s?a:e instanceof Xt?e:null;o&&(this._captureMap=o._captureMap,this._namesByIndex=o._namesByIndex)}exec(e){const n=RegExp.prototype.exec.call(this,e);if(!n||!this._captureMap)return n;const r=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);for(let a=1;a<r.length;a++)if(this._captureMap[a].exclude){const o=this._captureMap[a].transfer;if(o&&n.length>o){n[o]=r[a];const i=this._namesByIndex[o];i&&(n.groups[i]=r[a],this.hasIndices&&(n.indices.groups[i]=s[a])),this.hasIndices&&(n.indices[o]=s[a])}}else n.push(r[a]),this.hasIndices&&n.indices.push(s[a]);return n}}function xo(t){const e=le.replace(/\$/g,"\\$"),n=[{exclude:!1}],r={0:""};let s=0;return t=tt(t,String.raw`\((?:(?!\?)|\?<(?![=!])(?<name>[^>]+)>)(?<mark>(?:\$(?<transfer>[1-9]\d*))?${e})?`,({0:a,groups:{name:o,mark:i,transfer:l}})=>i?(n.push({exclude:!0,transfer:l&&+l}),a.slice(0,-i.length)):(s++,o&&(r[s]=o),n.push({exclude:!1}),a),W.DEFAULT),{_captureMap:n,_namesByIndex:r,expression:t}}const Ro=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Io(t,e,n,r){return t.slice(0,e)+r+t.slice(e+n.length)}const In=new RegExp(String.raw`(?<noncapturingStart>${Ro})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function No(t,e){if(!/\(\?>/.test(t))return t;const n="(?>",r=`(?:(?=(${e?.useEmulationGroups?le:""}`,s=[0];let a=0,o=0,i=NaN,l;do{l=!1;let c=0,u=0,h=!1,d;for(In.lastIndex=Number.isNaN(i)?0:i+r.length;d=In.exec(t);){const{0:p,index:f,groups:{capturingStart:k,noncapturingStart:y}}=d;if(p==="[")c++;else if(c)p==="]"&&c--;else if(p===n&&!h)i=f,h=!0;else if(h&&y)u++;else if(k)h?u++:(a++,s.push(a+o));else if(p===")"&&h){if(!u){o++,t=`${t.slice(0,i)}${r}${t.slice(i+n.length,f)}))<$$${o+a}>)${t.slice(f+1)}`,l=!0;break}u--}}}while(l);return t=tt(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:c,groups:{backrefNum:u,wrappedBackrefNum:h}})=>{if(u){const d=+u;if(d>s.length-1)throw new Error(`Backref "${c}" greater than number of captures`);return`\\${s[d]}`}return`\\${h}`},W.DEFAULT),t}const vr=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,bt=new RegExp(String.raw`
|
|
12
|
+
\\(?: \d+
|
|
13
|
+
| c[A-Za-z]
|
|
14
|
+
| [gk]<[^>]+>
|
|
15
|
+
| [pPu]\{[^\}]+\}
|
|
16
|
+
| u[A-Fa-f\d]{4}
|
|
17
|
+
| x[A-Fa-f\d]{2}
|
|
18
|
+
)
|
|
19
|
+
| \((?: \? (?: [:=!>]
|
|
20
|
+
| <(?:[=!]|[^>]+>)
|
|
21
|
+
| [A-Za-z\-]+:
|
|
22
|
+
| \(DEFINE\)
|
|
23
|
+
))?
|
|
24
|
+
| (?<qBase>${vr})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
25
|
+
| \\?.
|
|
26
|
+
`.replace(/\s+/g,""),"gsu");function To(t){if(!new RegExp(`${vr}\\+`).test(t))return t;const e=[];let n=null,r=null,s="",a=0,o;for(bt.lastIndex=0;o=bt.exec(t);){const{0:i,index:l,groups:{qBase:c,qMod:u,invalidQ:h}}=o;if(i==="[")a||(r=l),a++;else if(i==="]")a?a--:r=null;else if(!a)if(u==="+"&&s&&!s.startsWith("(")){if(h)throw new Error(`Invalid quantifier "${i}"`);let d=-1;if(/^\{\d+\}$/.test(c))t=Io(t,l+c.length,u,"");else{if(s===")"||s==="]"){const p=s===")"?n:r;if(p===null)throw new Error(`Invalid unmatched "${s}"`);t=`${t.slice(0,p)}(?>${t.slice(p,l)}${c})${t.slice(l+i.length)}`}else t=`${t.slice(0,l-s.length)}(?>${s}${c})${t.slice(l+i.length)}`;d+=4}bt.lastIndex+=d}else i[0]==="("?e.push(l):i===")"&&(n=e.length?e.pop():null);s=i}return t}const j=String.raw,Po=j`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Bt=j`\(\?R=(?<rDepth>[^\)]+)\)|${Po}`,nt=j`\(\?<(?![=!])(?<captureName>[^>]+)>`,te=new RegExp(j`${nt}|${Bt}|\(\?|\\?.`,"gsu"),_t="Cannot use multiple overlapping recursions",Ft=new RegExp(j`(?:\$[1-9]\d*)?${le.replace(/\$/g,j`\$`)}`,"y");function Lo(t,e){if(!new RegExp(Bt,"su").test(t))return t;if(Fe(t,j`\(\?\(DEFINE\)`,W.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const n=!!e?.useEmulationGroups,r=Fe(t,j`\\[1-9]`,W.DEFAULT),s=new Map,a=[];let o=!1,i=0,l=0,c;for(te.lastIndex=0;c=te.exec(t);){const{0:u,groups:{captureName:h,rDepth:d,gRNameOrNum:p,gRDepth:f}}=c;if(u==="[")i++;else if(i)u==="]"&&i--;else if(d){if(Nn(d),o)throw new Error(_t);if(r)throw new Error("Numbered backrefs cannot be used with global recursion");const k=t.slice(0,c.index),y=t.slice(te.lastIndex);if(Fe(y,Bt,W.DEFAULT))throw new Error(_t);return Tn(k,y,+d,!1,n)}else if(p){Nn(f);let k=!1;for(const F of a)if(F.name===p||F.num===+p){if(k=!0,F.hasRecursedWithin)throw new Error(_t);break}if(!k)throw new Error(j`Recursive \g cannot be used outside the referenced group "\g<${p}&R=${f}>"`);const y=s.get(p),S=Eo(t,y);if(r&&Fe(S,j`${nt}|\((?!\?)`,W.DEFAULT))throw new Error("Numbered backrefs cannot be used with recursion of capturing groups");const C=t.slice(y,c.index),w=S.slice(C.length+u.length),L=Tn(C,w,+f,!0,n),R=t.slice(0,y),q=t.slice(y+S.length);t=`${R}${L}${q}`,te.lastIndex+=L.length-u.length-C.length-w.length,a.forEach(F=>F.hasRecursedWithin=!0),o=!0}else if(h)l++,s.set(String(l),te.lastIndex),s.set(h,te.lastIndex),a.push({num:l,name:h});else if(u.startsWith("(")){const k=u==="(";k&&(l++,s.set(String(l),te.lastIndex+(n?$o(t,te.lastIndex):0))),a.push(k?{num:l}:{})}else u===")"&&a.pop()}return t}function Nn(t){const e=`Max depth must be integer between 2 and 100; used ${t}`;if(!/^[1-9]\d*$/.test(t))throw new Error(e);if(t=+t,t<2||t>100)throw new Error(e)}function Tn(t,e,n,r,s){const a=new Set;r&&vo(t+e,nt,({groups:{captureName:i}})=>{a.add(i)},W.DEFAULT);const o=n-1;return`${t}${Pn(`(?:${t}`,o,r?a:null,"forward",s)}(?:)${Pn(`${e})`,o,r?a:null,"backward",s)}${e}`}function Pn(t,e,n,r,s){const o=l=>r==="backward"?e-l+2-1:l+2;let i="";for(let l=0;l<e;l++){const c=o(l);i+=tt(t,j`${nt}|\\k<(?<backref>[^>]+)>${s?j`|(?<unnamed>\()(?!\?)(?:${Ft.source})?`:""}`,({0:u,index:h,groups:{captureName:d,backref:p,unnamed:f}})=>{if(p&&n&&!n.has(p))return u;if(f)return`(${le}`;const k=`_$${c}`;return d?`(?<${d}${k}>${s?le:""}`:j`\k<${p}${k}>`},W.DEFAULT)}return i}function $o(t,e){Ft.lastIndex=e;const n=Ft.exec(t);return n?n[0].length:0}var T=String.fromCodePoint,_=String.raw,Oo=(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),Mo=(()=>{try{new RegExp("","v")}catch{return!1}return!0})();function Qe(t,{enable:e,disable:n}){return{dotAll:!n?.dotAll&&!!(e?.dotAll||t.dotAll),ignoreCase:!n?.ignoreCase&&!!(e?.ignoreCase||t.ignoreCase)}}function Je(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function Dt(t,e){return Ln[t]>=Ln[e]}function ee(t,e){if(!t)throw new Error(e??"Value expected");return t}var Ln={ES2025:2025,ES2024:2024,ES2018:2018},Go={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Ar(t){if(t?.target!==void 0&&!Go[t.target])throw new Error(`Unexpected target "${t.target}"`);const e={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,target:"auto",verbose:!1,...t,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...t?.rules}};return e.target==="auto"&&(e.target=Oo?"ES2025":Mo?"ES2024":"ES2018"),e}var Bo=new Set([T(304),T(305)]);function Er(t){if(Bo.has(t))return[t];const e=new Set,n=t.toLowerCase(),r=n.toUpperCase(),s=Uo.get(n),a=Do.get(n),o=jo.get(n);return[...r].length===1&&e.add(r),o&&e.add(o),s&&e.add(s),e.add(n),a&&e.add(a),[...e]}var xr=new Set(`C Other
|
|
27
|
+
Cc Control cntrl
|
|
28
|
+
Cf Format
|
|
29
|
+
Cn Unassigned
|
|
30
|
+
Co Private_Use
|
|
31
|
+
Cs Surrogate
|
|
32
|
+
L Letter
|
|
33
|
+
LC Cased_Letter
|
|
34
|
+
Ll Lowercase_Letter
|
|
35
|
+
Lm Modifier_Letter
|
|
36
|
+
Lo Other_Letter
|
|
37
|
+
Lt Titlecase_Letter
|
|
38
|
+
Lu Uppercase_Letter
|
|
39
|
+
M Mark Combining_Mark
|
|
40
|
+
Mc Spacing_Mark
|
|
41
|
+
Me Enclosing_Mark
|
|
42
|
+
Mn Nonspacing_Mark
|
|
43
|
+
N Number
|
|
44
|
+
Nd Decimal_Number digit
|
|
45
|
+
Nl Letter_Number
|
|
46
|
+
No Other_Number
|
|
47
|
+
P Punctuation punct
|
|
48
|
+
Pc Connector_Punctuation
|
|
49
|
+
Pd Dash_Punctuation
|
|
50
|
+
Pe Close_Punctuation
|
|
51
|
+
Pf Final_Punctuation
|
|
52
|
+
Pi Initial_Punctuation
|
|
53
|
+
Po Other_Punctuation
|
|
54
|
+
Ps Open_Punctuation
|
|
55
|
+
S Symbol
|
|
56
|
+
Sc Currency_Symbol
|
|
57
|
+
Sk Modifier_Symbol
|
|
58
|
+
Sm Math_Symbol
|
|
59
|
+
So Other_Symbol
|
|
60
|
+
Z Separator
|
|
61
|
+
Zl Line_Separator
|
|
62
|
+
Zp Paragraph_Separator
|
|
63
|
+
Zs Space_Separator
|
|
64
|
+
ASCII
|
|
65
|
+
ASCII_Hex_Digit AHex
|
|
66
|
+
Alphabetic Alpha
|
|
67
|
+
Any
|
|
68
|
+
Assigned
|
|
69
|
+
Bidi_Control Bidi_C
|
|
70
|
+
Bidi_Mirrored Bidi_M
|
|
71
|
+
Case_Ignorable CI
|
|
72
|
+
Cased
|
|
73
|
+
Changes_When_Casefolded CWCF
|
|
74
|
+
Changes_When_Casemapped CWCM
|
|
75
|
+
Changes_When_Lowercased CWL
|
|
76
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
77
|
+
Changes_When_Titlecased CWT
|
|
78
|
+
Changes_When_Uppercased CWU
|
|
79
|
+
Dash
|
|
80
|
+
Default_Ignorable_Code_Point DI
|
|
81
|
+
Deprecated Dep
|
|
82
|
+
Diacritic Dia
|
|
83
|
+
Emoji
|
|
84
|
+
Emoji_Component EComp
|
|
85
|
+
Emoji_Modifier EMod
|
|
86
|
+
Emoji_Modifier_Base EBase
|
|
87
|
+
Emoji_Presentation EPres
|
|
88
|
+
Extended_Pictographic ExtPict
|
|
89
|
+
Extender Ext
|
|
90
|
+
Grapheme_Base Gr_Base
|
|
91
|
+
Grapheme_Extend Gr_Ext
|
|
92
|
+
Hex_Digit Hex
|
|
93
|
+
IDS_Binary_Operator IDSB
|
|
94
|
+
IDS_Trinary_Operator IDST
|
|
95
|
+
ID_Continue IDC
|
|
96
|
+
ID_Start IDS
|
|
97
|
+
Ideographic Ideo
|
|
98
|
+
Join_Control Join_C
|
|
99
|
+
Logical_Order_Exception LOE
|
|
100
|
+
Lowercase Lower
|
|
101
|
+
Math
|
|
102
|
+
Noncharacter_Code_Point NChar
|
|
103
|
+
Pattern_Syntax Pat_Syn
|
|
104
|
+
Pattern_White_Space Pat_WS
|
|
105
|
+
Quotation_Mark QMark
|
|
106
|
+
Radical
|
|
107
|
+
Regional_Indicator RI
|
|
108
|
+
Sentence_Terminal STerm
|
|
109
|
+
Soft_Dotted SD
|
|
110
|
+
Terminal_Punctuation Term
|
|
111
|
+
Unified_Ideograph UIdeo
|
|
112
|
+
Uppercase Upper
|
|
113
|
+
Variation_Selector VS
|
|
114
|
+
White_Space space
|
|
115
|
+
XID_Continue XIDC
|
|
116
|
+
XID_Start XIDS`.split(/\s/)),Rr=new Map;for(const t of xr)Rr.set(rt(t),t);var Fo=new Set(["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji","RGI_Emoji_Flag_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence"]),Ir=new Map;for(const t of Fo)Ir.set(rt(t),t);var Do=new Map([["s",T(383)],[T(383),"s"]]),jo=new Map([[T(223),T(7838)],[T(107),T(8490)],[T(229),T(8491)],[T(969),T(8486)]]),Uo=new Map([ne(453),ne(456),ne(459),ne(498),...kt(8072,8079),...kt(8088,8095),...kt(8104,8111),ne(8124),ne(8140),ne(8188)]),Nr=new Map([["alnum",_`[\p{Alpha}\p{Nd}]`],["alpha",_`\p{Alpha}`],["ascii",_`\p{ASCII}`],["blank",_`[\p{Zs}\t]`],["cntrl",_`\p{cntrl}`],["digit",_`\p{Nd}`],["graph",_`[\P{space}&&\P{cntrl}&&\P{Cn}&&\P{Cs}]`],["lower",_`\p{Lower}`],["print",_`[[\P{space}&&\P{cntrl}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",_`[\p{P}\p{S}]`],["space",_`\p{space}`],["upper",_`\p{Upper}`],["word",_`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",_`\p{AHex}`]]),Wo=new Set(["alnum","blank","graph","print","word","xdigit"]);function Ho(t,e){const n=[];for(let r=t;r<=e;r++)n.push(r);return n}function rt(t){return t.replace(/[- _]+/g,"").toLowerCase()}function ne(t){const e=T(t);return[e.toLowerCase(),e]}function kt(t,e){return Ho(t,e).map(n=>ne(n))}var Tr=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]),b={Alternator:"Alternator",Assertion:"Assertion",Backreference:"Backreference",Character:"Character",CharacterClassClose:"CharacterClassClose",CharacterClassHyphen:"CharacterClassHyphen",CharacterClassIntersector:"CharacterClassIntersector",CharacterClassOpen:"CharacterClassOpen",CharacterSet:"CharacterSet",Directive:"Directive",GroupClose:"GroupClose",GroupOpen:"GroupOpen",Subroutine:"Subroutine",Quantifier:"Quantifier",VariableLengthCharacterSet:"VariableLengthCharacterSet",EscapedNumber:"EscapedNumber"},$={any:"any",digit:"digit",dot:"dot",hex:"hex",non_newline:"non_newline",posix:"posix",property:"property",space:"space",word:"word"},st={flags:"flags",keep:"keep"},M={absent_repeater:"absent_repeater",atomic:"atomic",capturing:"capturing",group:"group",lookahead:"lookahead",lookbehind:"lookbehind"},$n=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]),Pr=_`\[\^?`,Lr=`c.? | C(?:-.?)?|${_`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${_`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${_`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${_`o\{[^\}]*\}?`}|${_`\d{1,3}`}`,$r=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,De=new RegExp(_`
|
|
117
|
+
\\ (?:
|
|
118
|
+
${Lr}
|
|
119
|
+
| [gk]<[^>]*>?
|
|
120
|
+
| [gk]'[^']*'?
|
|
121
|
+
| .
|
|
122
|
+
)
|
|
123
|
+
| \( (?: \? (?:
|
|
124
|
+
[:=!>(]
|
|
125
|
+
| <[=!]
|
|
126
|
+
| <[^>]*>
|
|
127
|
+
| '[^']*'
|
|
128
|
+
| ~\|?
|
|
129
|
+
| # (?:[^)\\] | \\.?)*
|
|
130
|
+
| [imx\-]+[:)]
|
|
131
|
+
)?)?
|
|
132
|
+
| ${$r.source}
|
|
133
|
+
| ${Pr}
|
|
134
|
+
| .
|
|
135
|
+
`.replace(/\s+/g,""),"gsu"),St=new RegExp(_`
|
|
136
|
+
\\ (?:
|
|
137
|
+
${Lr}
|
|
138
|
+
| .
|
|
139
|
+
)
|
|
140
|
+
| \[:[^:]*:\]
|
|
141
|
+
| ${Pr}
|
|
142
|
+
| &&
|
|
143
|
+
| .
|
|
144
|
+
`.replace(/\s+/g,""),"gsu");function Or(t,e="",n){if(n={captureGroup:!1,singleline:!1,...n},typeof t!="string")throw new Error("String expected as pattern");if(!/^[imxDSW]*$/.test(e))throw new Error(`Flags "${e}" includes unsupported value`);const r=e.includes("x"),s=[r],a={captureGroup:n.captureGroup,getCurrentModX:()=>s.at(-1),numOpenGroups:0,popModX(){s.pop()},pushModX(h){s.push(h)},replaceCurrentModX(h){s[s.length-1]=h},singleline:n.singleline};let o=[],i;for(De.lastIndex=0;i=De.exec(t);){const h=zo(a,t,i[0],De.lastIndex);h.tokens?o.push(...h.tokens):h.token&&o.push(h.token),h.lastIndex!==void 0&&(De.lastIndex=h.lastIndex)}const l=[];let c=0;o.forEach(h=>{h.type===b.GroupOpen&&(h.kind===M.capturing?h.number=++c:h.raw==="("&&l.push(h))}),c||l.forEach((h,d)=>{h.kind=M.capturing,h.number=d+1});const u=c||l.length;return o=o.map(h=>h.type===b.EscapedNumber?ei(h,u):h).flat(),{tokens:o,flags:{ignoreCase:e.includes("i"),dotAll:e.includes("m"),extended:r,digitIsAscii:e.includes("D"),spaceIsAscii:e.includes("S"),wordIsAscii:e.includes("W")},rules:n}}function zo(t,e,n,r){const[s,a,o]=n;if(s==="["){const i=qo(e,n,r);return{tokens:i.tokens,lastIndex:i.lastIndex}}if(s==="\\"){if("AbBGzZ".includes(a))return{token:A(b.Assertion,n,{kind:n})};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:A(b.Subroutine,n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:A(b.Backreference,n)}}if(a==="K")return{token:A(b.Directive,n,{kind:st.keep})};if(a==="N")return{token:A(b.CharacterSet,n,{kind:$.non_newline})};if(a==="O")return{token:A(b.CharacterSet,n,{kind:$.any})};if("RX".includes(a))return{token:A(b.VariableLengthCharacterSet,n,{kind:n})};if("yY".includes(a))throw new Error(`Unsupported grapheme boundary "${n}"`);const i=Mr(n,{inCharClass:!1});return Array.isArray(i)?{tokens:i}:{token:i}}if(s==="("){if(o==="#"){if(e[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if("-imx".includes(o))return{token:Xo(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:A(b.GroupOpen,n,{kind:M.group})};if(n==="(?>")return{token:A(b.GroupOpen,n,{kind:M.atomic})};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:A(b.GroupOpen,n,{kind:o==="<"?M.lookbehind:M.lookahead,negate:n.endsWith("!")})};if(o==="<"||o==="'"||n==="("&&t.captureGroup){const i=A(b.GroupOpen,n,{kind:M.capturing});return n!=="("&&(i.name=n.slice(3,-1)),{token:i}}if(o==="~"){if(n==="(?~|")throw new Error(`Unsupported absent function kind "${n}"`);return{token:A(b.GroupOpen,n,{kind:M.absent_repeater})}}throw o==="("?new Error(`Unsupported conditional "${n}"`):n==="(?"?new Error("Invalid group"):new Error(`Unexpected group "${n}"`)}if(n===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:A(b.GroupClose,n)}}if(n==="#"&&t.getCurrentModX()){const i=e.indexOf(`
|
|
145
|
+
`,r);return{lastIndex:i===-1?e.length:i}}if(/^\s$/.test(n)&&t.getCurrentModX()){const i=/\s+/y;return i.lastIndex=r,{lastIndex:i.exec(e)?i.lastIndex:r}}if(n===".")return{token:A(b.CharacterSet,n,{kind:$.dot})};if(n==="^"||n==="$"){const i=t.singleline?{"^":_`\A`,$:_`\Z`}[n]:n;return{token:A(b.Assertion,n,{kind:i})}}return n==="|"?{token:A(b.Alternator,n)}:$r.test(n)?{token:Qo(n)}:(Gr(n),{token:A(b.Character,n,{value:n.codePointAt(0)})})}function qo(t,e,n){const r=[A(b.CharacterClassOpen,e,{negate:e[1]==="^"})];let s=1,a;for(St.lastIndex=n;a=St.exec(t);){const o=a[0];if(o[0]==="["&&o[1]!==":")s++,r.push(A(b.CharacterClassOpen,o,{negate:o[1]==="^"}));else if(o==="]"){if(r.at(-1).type===b.CharacterClassOpen)r.push(A(b.Character,o,{value:93}));else if(s--,r.push(A(b.CharacterClassClose,o)),!s)break}else{const i=Vo(o);Array.isArray(i)?r.push(...i):r.push(i)}}return{tokens:r,lastIndex:St.lastIndex||t.length}}function Vo(t){if(t[0]==="\\")return Mr(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!Nr.get(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return A(b.CharacterSet,t,{kind:$.posix,negate:!!e.groups.negate,value:e.groups.name})}return t==="-"?A(b.CharacterClassHyphen,t):t==="&&"?A(b.CharacterClassIntersector,t):(Gr(t),A(b.Character,t,{value:t.codePointAt(0)}))}function Mr(t,{inCharClass:e}){const n=t[1];if(n==="c"||n==="C")return Ko(t);if("dDhHsSwW".includes(n))return Jo(t);if(t.startsWith(_`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return Yo(t)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(t))try{const r=t.split(/\\x/).slice(1).map(i=>parseInt(i,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),a=new TextEncoder;return[...s].map(i=>{const l=[...a.encode(i)].map(c=>`\\x${c.toString(16)}`).join("");return A(b.Character,l,{value:i.codePointAt(0)})})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return A(b.Character,t,{value:Zo(t)});if($n.has(n))return A(b.Character,t,{value:$n.get(n)});if(/\d/.test(n))return A(b.EscapedNumber,t,{inCharClass:e});if(t==="\\")throw new Error(_`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return A(b.Character,t,{value:t.codePointAt(1)});throw new Error(`Unexpected escape "${t}"`)}function A(t,e,n){return{type:t,raw:e,...n}}function Ko(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return A(b.Character,t,{value:e.toUpperCase().codePointAt(0)-64})}function Xo(t,e){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[imx\-]*))?/.exec(t).groups;r??="";const s=(e.getCurrentModX()||n.includes("x"))&&!r.includes("x"),a=On(n),o=On(r),i={};if(a&&(i.enable=a),o&&(i.disable=o),t.endsWith(")"))return e.replaceCurrentModX(s),A(b.Directive,t,{kind:st.flags,flags:i});if(t.endsWith(":")){e.pushModX(s),e.numOpenGroups++;const l=A(b.GroupOpen,t,{kind:M.group});return(a||o)&&(l.flags=i),l}throw new Error(`Unexpected flag modifier "${t}"`)}function Qo(t){const e={};if(t[0]==="{"){const{min:n,max:r}=/^\{(?<min>\d*)(?:,(?<max>\d*))?/.exec(t).groups,s=1e5;if(+n>s||+r>s)throw new Error("Quantifier value unsupported in Oniguruma");e.min=+n,e.max=r===void 0?+n:r===""?1/0:+r,e.greedy=!t.endsWith("?"),e.possessive=!1}else e.min=t[0]==="+"?1:0,e.max=t[0]==="?"?1:1/0,e.greedy=t[1]!=="?",e.possessive=t[1]==="+";return A(b.Quantifier,t,e)}function Jo(t){const e=t[1].toLowerCase();return A(b.CharacterSet,t,{kind:{d:$.digit,h:$.hex,s:$.space,w:$.word}[e],negate:t[1]!==e})}function Yo(t){const{p:e,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups,s=e==="P"&&!n||e==="p"&&!!n;return A(b.CharacterSet,t,{kind:$.property,negate:s,value:r})}function On(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function Zo(t){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function ei(t,e){const{raw:n,inCharClass:r}=t,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=e))return[A(b.Backreference,n)];const a=[],o=s.match(/^[0-7]+|\d/g);for(let i=0;i<o.length;i++){const l=o[i];let c;if(i===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(_`Octal encoded byte above 177 unsupported "${n}"`)}else c=l.codePointAt(0);a.push(A(b.Character,(i===0?"\\":"")+l,{value:c}))}return a}function Gr(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`)}function Qt({alternatives:t},e){return t.length===1&&t[0].elements.length===1&&(!e||e(t[0].elements[0]))}function ti({type:t}){return t===g.Assertion||t===g.Directive}function ni(t){const e=[g.Character,g.CharacterClass,g.CharacterSet];return e.includes(t.type)||t.type===g.Quantifier&&t.min&&e.includes(t.element.type)}function Br({type:t}){return t===g.CapturingGroup||t===g.Group}function Le({type:t,kind:e}){return t===g.Assertion&&(e===E.lookahead||e===E.lookbehind)}function ge(t,e,n){let r=t.node;for(;r.parent;)r=r.parent;function s(o,i){for(let l=0;l<o.length;l++){const c=a(o[l],i,l,o);l=Math.max(-1,l+c)}}function a(o,i=null,l=null,c=null){let u=0,h=!1;const d={node:o,parent:i,key:l,container:c,ast:r,remove(){ee(c,"Container expected").splice(Math.max(0,l+u),1),u-=1},removeAllNextSiblings(){return ee(c,"Container expected").splice(l+1)},removeAllPrevSiblings(){const S=l+u;return u-=S,ee(c,"Container expected").splice(0,Math.max(0,S))},replaceWith(S){si(S,i),c?c[Math.max(0,l+u)]=S:i[l]=S},skip(){h=!0}},p=ri(o).find(S=>!!n[S]),f=p&&n[p],k=typeof f=="function"?f:f?.enter,y=f?.exit;if(k?.(d,e),!h)switch(o.type){case g.Regex:a(o.pattern,o,"pattern"),a(o.flags,o,"flags");break;case g.Alternative:case g.CharacterClass:s(o.elements,o);break;case g.Assertion:Le(o)&&s(o.alternatives,o);break;case g.Backreference:case g.Character:case g.CharacterSet:case g.Directive:case g.Flags:case g.Recursion:case g.Subroutine:case g.VariableLengthCharacterSet:break;case g.AbsentFunction:case g.CapturingGroup:case g.Group:case g.Pattern:s(o.alternatives,o);break;case g.CharacterClassIntersection:s(o.classes,o);break;case g.CharacterClassRange:a(o.min,o,"min"),a(o.max,o,"max");break;case g.Quantifier:a(o.element,o,"element");break;default:throw new Error(`Unexpected node type "${o.type}"`)}return y?.(d,e),u}a(t.node,t.parent,t.key,t.container)}var Mn={AnyGroup:"AnyGroup",AnyNode:"AnyNode"};function ri(t){const e=[Mn.AnyNode];return(Br(t)||Le(t))&&e.push(Mn.AnyGroup),e.push(t.type),e}function si(t,e){"parent"in e&&(t.parent=e)}var g={AbsentFunction:"AbsentFunction",Alternative:"Alternative",Assertion:"Assertion",Backreference:"Backreference",CapturingGroup:"CapturingGroup",Character:"Character",CharacterClass:"CharacterClass",CharacterClassIntersection:"CharacterClassIntersection",CharacterClassRange:"CharacterClassRange",CharacterSet:"CharacterSet",Directive:"Directive",Flags:"Flags",Group:"Group",Pattern:"Pattern",Quantifier:"Quantifier",Regex:"Regex",Subroutine:"Subroutine",VariableLengthCharacterSet:"VariableLengthCharacterSet",Recursion:"Recursion"},ai={repeater:"repeater"},E={line_end:"line_end",line_start:"line_start",lookahead:"lookahead",lookbehind:"lookbehind",search_start:"search_start",string_end:"string_end",string_end_newline:"string_end_newline",string_start:"string_start",word_boundary:"word_boundary"},I=$,He=st,Ye={grapheme:"grapheme",newline:"newline"};function Fr({tokens:t,flags:e,rules:n},r){const s={skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,verbose:!1,...r},a={capturingGroups:[],current:0,hasNumberedRef:!1,namedGroupsByName:new Map,parent:null,skipBackrefValidation:s.skipBackrefValidation,skipLookbehindValidation:s.skipLookbehindValidation,skipPropertyNameValidation:s.skipPropertyNameValidation,subroutines:[],token:null,tokens:t,verbose:s.verbose,walk:o};function o(p,f){const k=t[a.current];switch(a.parent=p,a.token=k,a.current++,k.type){case b.Alternator:return se();case b.Assertion:return di(k);case b.Backreference:return oi(a);case b.Character:return Ur(k.value,{useLastValid:!!f.isCheckingRangeEnd});case b.CharacterClassHyphen:return ii(a,f);case b.CharacterClassOpen:return li(a,f);case b.CharacterSet:return ci(a);case b.Directive:return Ci(k);case b.GroupOpen:return ui(a,f);case b.Quantifier:return hi(a);case b.Subroutine:return pi(a);case b.VariableLengthCharacterSet:return wi(k.kind);default:throw new Error(`Unexpected token type "${k.type}"`)}}const i=ki(_i(),bi(e));let l=i.pattern.alternatives[0];for(;a.current<t.length;){const p=o(l,{});p.type===g.Alternative?(i.pattern.alternatives.push(p),l=p):l.elements.push(p)}const{capturingGroups:c,hasNumberedRef:u,namedGroupsByName:h,subroutines:d}=a;if(u&&h.size&&!n.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:p}of d)if(typeof p=="number"){if(p>c.length)throw new Error("Subroutine uses a group number that's not defined")}else if(h.has(p)){if(h.get(p).length>1)throw new Error(_`Subroutine uses a duplicate group name "\g<${p}>"`)}else throw new Error(_`Subroutine uses a group name that's not defined "\g<${p}>"`);return ge({node:i},null,{AnyNode({node:p,parent:f}){p.parent=f}}),i}function oi(t){const{raw:e}=t.token,n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),s=(a,o=!1)=>{const i=t.capturingGroups.length;let l=!1;if(a>i)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,jt(o?i+1-a:a,{orphan:l})};if(n){const a=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(a)return s(+a.groups.num,!!a.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return jt(r)}return s(+r)}function ii(t,e){const{parent:n,tokens:r,walk:s}=t,a=n.elements.at(-1),o=r[t.current];if(!e.isCheckingRangeEnd&&a&&a.type!==g.CharacterClass&&a.type!==g.CharacterClassRange&&o&&o.type!==b.CharacterClassOpen&&o.type!==b.CharacterClassClose&&o.type!==b.CharacterClassIntersector){const i=s(n,{...e,isCheckingRangeEnd:!0});if(a.type===g.Character&&i.type===g.Character)return n.elements.pop(),yi(a,i);throw new Error("Invalid character class range")}return Ur(45)}function li(t,e){const{token:n,tokens:r,verbose:s,walk:a}=t,o=r[t.current];let i=Ut({negate:n.negate});const l=i.elements[0];let c=Gn(o);for(;c.type!==b.CharacterClassClose;){if(c.type===b.CharacterClassIntersector)l.classes.push(Ut({negate:!1,baseOnly:!0})),t.current++;else{const u=l.classes.at(-1);u.elements.push(a(u,e))}c=Gn(r[t.current],o)}if(s||xi(l),l.classes.length===1){const u=l.classes[0];u.negate=i.negate!==u.negate,i=u}return t.current++,i}function ci({token:t,skipPropertyNameValidation:e}){let{kind:n,negate:r,value:s}=t;if(n===$.property){const a=rt(s);if(Wo.has(a))n=$.posix,s=a;else return he(s,{negate:r,skipPropertyNameValidation:e})}return n===$.posix?{type:g.CharacterSet,kind:I.posix,negate:r,value:s}:Wt(n,{negate:r})}function ui(t,e){const{token:n,tokens:r,capturingGroups:s,namedGroupsByName:a,skipLookbehindValidation:o,verbose:i,walk:l}=t;let c=gi(n);const u=c.type===g.AbsentFunction,h=c.kind===E.lookbehind,d=h&&c.negate;if(c.type===g.CapturingGroup&&(s.push(c),c.name&&Je(a,c.name,[]).push(c)),u&&e.isInAbsentFunction)throw new Error("Nested absent function not supported by Oniguruma");let p=Bn(r[t.current]);for(;p.type!==b.GroupClose;){if(p.type===b.Alternator)c.alternatives.push(se()),t.current++;else{const f=c.alternatives.at(-1),k=l(f,{...e,isInAbsentFunction:e.isInAbsentFunction||u,isInLookbehind:e.isInLookbehind||h,isInNegLookbehind:e.isInNegLookbehind||d});if(f.elements.push(k),(h||e.isInLookbehind)&&!o){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(d||e.isInNegLookbehind){if(k.kind===E.lookahead||k.type===g.CapturingGroup)throw new Error(y)}else if(k.kind===E.lookahead||k.kind===E.lookbehind&&k.negate)throw new Error(y)}}p=Bn(r[t.current])}return i||(c=Ai(c)),t.current++,c}function hi({token:t,parent:e}){const{min:n,max:r,greedy:s,possessive:a}=t,o=e.elements.at(-1);if(!o||o.type===g.Assertion||o.type===g.Directive)throw new Error("Quantifier requires a repeatable token");const i=Wr(o,n,r,s,a);return e.elements.pop(),i}function pi(t){const{token:e,capturingGroups:n,subroutines:r}=t;let s=e.raw.slice(3,-1);const a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(a){const i=+a.groups.num,l=n.length;if(t.hasNumberedRef=!0,s={"":i,"+":l+i,"-":l+1-i}[a.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const o=Si(s);return r.push(o),o}function fi(t){return{type:g.AbsentFunction,kind:t,alternatives:[se()]}}function se(){return{type:g.Alternative,elements:[]}}function Dr(t,e){const n=!!e?.negate;return{type:g.Assertion,kind:t,...t===E.word_boundary&&{negate:n}}}function di({kind:t}){return Dr(ee({"^":E.line_start,$:E.line_end,"\\A":E.string_start,"\\b":E.word_boundary,"\\B":E.word_boundary,"\\G":E.search_start,"\\z":E.string_end,"\\Z":E.string_end_newline}[t],`Unexpected assertion kind "${t}"`),{negate:t===_`\B`})}function jt(t,e){const n=!!e?.orphan;return{type:g.Backreference,...n&&{orphan:n},ref:t}}function gi({flags:t,kind:e,name:n,negate:r,number:s}){switch(e){case M.absent_repeater:return fi(ai.repeater);case M.atomic:return K({atomic:!0});case M.capturing:return jr(s,n);case M.group:return K({flags:t});case M.lookahead:case M.lookbehind:return we({behind:e===M.lookbehind,negate:r});default:throw new Error(`Unexpected group kind "${e}"`)}}function jr(t,e){const n=e!==void 0;if(n&&!Ei(e))throw new Error(`Group name "${e}" invalid in Oniguruma`);return{type:g.CapturingGroup,number:t,...n&&{name:e},alternatives:[se()]}}function Ur(t,e){const n={useLastValid:!1,...e};if(t>1114111){const r=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:g.Character,value:t}}function Ut(t){const e={baseOnly:!1,negate:!1,...t};return{type:g.CharacterClass,negate:e.negate,elements:e.baseOnly?[]:[mi()]}}function mi(){return{type:g.CharacterClassIntersection,classes:[Ut({negate:!1,baseOnly:!0})]}}function yi(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:g.CharacterClassRange,min:t,max:e}}function Wt(t,{negate:e}){const n={type:g.CharacterSet,kind:ee(I[t],`Unexpected character set kind "${t}"`)};return(t===$.digit||t===$.hex||t===$.space||t===$.word)&&(n.negate=e),n}function Ci({kind:t,flags:e}){const n={type:g.Directive,kind:ee(He[t],`Unexpected directive kind "${t}"`)};return t===st.flags&&(n.flags=e),n}function bi({ignoreCase:t,dotAll:e,extended:n,digitIsAscii:r,spaceIsAscii:s,wordIsAscii:a}){return{type:g.Flags,ignoreCase:t,dotAll:e,extended:n,digitIsAscii:r,spaceIsAscii:s,wordIsAscii:a}}function K(t){const e=t?.atomic,n=t?.flags;return{type:g.Group,...e&&{atomic:e},...n&&{flags:n},alternatives:[se()]}}function we(t){const e={behind:!1,negate:!1,...t};return{type:g.Assertion,kind:e.behind?E.lookbehind:E.lookahead,negate:e.negate,alternatives:[se()]}}function _i(){return{type:g.Pattern,alternatives:[se()]}}function Wr(t,e,n,r=!0,s=!1){const a={type:g.Quantifier,min:e,max:n,greedy:r,possessive:s,element:t};return n<e?{...a,min:n,max:e,possessive:!0}:a}function ki(t,e){return{type:g.Regex,pattern:t,flags:e}}function Si(t){return{type:g.Subroutine,ref:t}}function he(t,e){const n={negate:!1,skipPropertyNameValidation:!1,...e};return{type:g.CharacterSet,kind:I.property,value:n.skipPropertyNameValidation?t:vi(t),negate:n.negate}}function wi(t){return{type:g.VariableLengthCharacterSet,kind:ee({"\\R":Ye.newline,"\\X":Ye.grapheme}[t],`Unexpected varcharset kind "${t}"`)}}function vi(t){const e=rt(t);if(Ir.has(e))throw new Error(_`Unicode property "\p{${t}}" unsupported in Oniguruma`);const n=Rr.get(e);return n||t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}function Ai(t){const e=t.alternatives[0].elements[0];return t.type===g.Group&&Qt(t,n=>n.type===g.Group)&&!(t.atomic&&e.flags)&&!(t.flags&&(e.atomic||e.flags))?(t.atomic?e.atomic=!0:t.flags&&(e.flags=t.flags),e):t}function Ei(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function xi(t){for(let e=0;e<t.classes.length;e++){const n=t.classes[e],r=n.elements[0];n.elements.length===1&&r.type===g.CharacterClass&&(t.classes[e]=r,r.negate=n.negate!==r.negate)}}function Gn(t,e){return ee(t,`${e?.value===93?"Empty":"Unclosed"} character class`)}function Bn(t){return ee(t,"Unclosed group")}function Ri(t,e){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e},r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Dt(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};ge({node:t},r,Hr);const s={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},a={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};ge({node:t},a,zr);const o={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return ge({node:t},o,Ii),t._strategy=r.strategy,t}var Hr={AbsentFunction({node:t,replaceWith:e}){const n=Z(K(),[Re(we({negate:!0}),t.alternatives),he("Any")]),r=Wr(n,0,1/0);n.parent=r,e(Z(K(),[r]))},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:r}){const s=t.elements.filter(a=>a.kind===He.flags);for(let a=n+1;a<e.alternatives.length;a++){const o=e.alternatives[a];Je(r,o,[]).push(...s)}},exit({node:t},{flagDirectivesByAlt:e}){if(e.get(t)?.length){const n=Vr(e.get(t));if(n){const r=Z(K({flags:n}),t.elements);r.parent=t,t.elements=[r]}}}},Assertion({node:t,key:e,container:n,ast:r,remove:s,replaceWith:a},o){const{kind:i,negate:l}=t,{asciiWordBoundaries:c,avoidSubclass:u,supportedGNodes:h,wordIsAscii:d}=o;if(i===E.line_end)a(z(_`(?=\z|\n)`));else if(i===E.line_start)a(z(_`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}));else if(i===E.lookbehind)o.passedLookbehind=!0;else if(i===E.search_start)if(h.has(t))r.flags.sticky=!0,s();else{const p=n[e-1];if(p&&ni(p))a(Z(we({negate:!0})));else{if(u)throw new Error(_`Uses "\G" in a way that requires a subclass`);a(Dr(E.string_start)),o.strategy="search_start_clip"}}else if(i===E.string_end_newline)a(z(_`(?=\n?\z)`));else if(i===E.word_boundary&&!d&&!c){const p=`(?:(?<=${Y})(?!${Y})|(?<!${Y})(?=${Y}))`,f=`(?:(?<=${Y})(?=${Y})|(?<!${Y})(?!${Y}))`;a(z(l?f:p))}},Backreference({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!vt(n)&&(n=wt(n,e),t.ref=n)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:n}){let{name:r}=t;r&&!vt(r)&&(r=wt(r,e),t.name=r),n.set(t.number,t),r&&n.set(r,t)},CharacterSet({node:t,replaceWith:e},{accuracy:n,minTargetEs2024:r,digitIsAscii:s,spaceIsAscii:a,wordIsAscii:o}){const{kind:i,negate:l,value:c}=t;if(s&&(i===I.digit||c==="digit")){e(Wt(I.digit,{negate:l}));return}if(a&&(i===I.space||c==="space")){e(At(z(Ni),l));return}if(o&&(i===I.word||c==="word")){e(Wt(I.word,{negate:l}));return}if(i===I.any)e(he("Any"));else if(i===I.digit)e(he("Nd",{negate:l}));else if(i===I.hex)e(he("AHex",{negate:l}));else if(i===I.non_newline)e(z(_`[^\n]`));else if(i===I.space)e(he("space",{negate:l}));else if(i===I.word)e(At(z(Y),l));else if(i===I.property)xr.has(c)||(t.key="sc");else if(i===I.posix)if(!r&&(c==="graph"||c==="print")){if(n==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let u={graph:"!-~",print:" -~"}[c];l&&(u=`\0-${T(u.codePointAt(0)-1)}${T(u.codePointAt(2)+1)}-`),e(z(`[${u}]`))}else e(At(z(Nr.get(c)),l))},Directive(t,e){const{node:n,parent:r,ast:s,remove:a,replaceWith:o,removeAllPrevSiblings:i,removeAllNextSiblings:l}=t,{kind:c,flags:u}=n;if(c===He.flags)if(!u.enable&&!u.disable)a();else{const h=Z(K({flags:u}),l());o(h),Jr(h,t,e,Hr)}else if(c===He.keep){const h=s.pattern.alternatives[0].elements[0],p=Qt(s.pattern,f=>f.type===g.Group)&&h.alternatives.length===1?h:s.pattern;if(r.parent!==p||p.alternatives.length>1)throw new Error(_`Uses "\K" in a way that's unsupported`);o(Z(we({behind:!0}),i()))}},Flags({node:t,parent:e}){["digitIsAscii","extended","spaceIsAscii","wordIsAscii"].forEach(n=>delete t[n]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:n}=t.flags;e?.extended&&delete e.extended,n?.extended&&delete n.extended,e?.dotAll&&n?.dotAll&&delete e.dotAll,e?.ignoreCase&&n?.ignoreCase&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,n&&!Object.keys(n).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},Pattern:{enter({node:t},{supportedGNodes:e}){const n=[];let r=!1,s=!1;for(const a of t.alternatives)if(a.elements.length===1&&a.elements[0].kind===E.search_start)a.elements.pop();else{const o=Xr(a.elements);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):s=!0}r&&!s&&n.forEach(a=>e.add(a))},exit(t,{accuracy:e,passedLookbehind:n,strategy:r}){if(e==="strict"&&n&&r)throw new Error(_`Uses "\G" in a way that requires non-strict accuracy`)}},Quantifier({node:t}){if(t.element.type===g.Quantifier){const e=Z(K(),[t.element]);e.parent=t,t.element=e}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!vt(n)&&(n=wt(n,e),t.ref=n)},VariableLengthCharacterSet({node:t,replaceWith:e},{accuracy:n,minTargetEs2024:r}){const{kind:s}=t;if(s===Ye.newline)e(z(`(?>\r
|
|
146
|
+
?|[
|
|
147
|
+
\v\f
\u2028\u2029])`));else if(s===Ye.grapheme){if(n==="strict")throw new Error(_`Use of "\X" requires non-strict accuracy`);const a=r?_`\p{RGI_Emoji}`:wo().source.replace(/\\u\{/g,"\\x{");e(z(_`(?>\r\n|${a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}))}else throw new Error(`Unexpected varcharset kind "${s}"`)}},zr={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){const{orphan:r,ref:s}=t;r||n.set(t,[...e.get(s).map(({node:a})=>a)])},CapturingGroup:{enter({node:t,replaceWith:e,skip:n},{groupOriginByCopy:r,groupsByName:s,multiplexCapturesToLeftByRef:a,openRefs:o,reffedNodesByReferencer:i}){const l=r.get(t);if(l&&o.has(t.number)){const u=Fn(t.number);i.set(u,o.get(t.number)),e(u),n();return}o.set(t.number,t),a.set(t.number,[]),t.name&&Je(a,t.name,[]);const c=a.get(t.name??t.number);for(let u=0;u<c.length;u++){const h=c[u];if(l===h.node||l&&l===h.origin||t===h.origin){c.splice(u,1);break}}if(a.get(t.number).push({node:t,origin:l}),t.name&&a.get(t.name).push({node:t,origin:l}),t.name){const u=Je(s,t.name,new Map);let h=!1;if(l)h=!0;else for(const d of u.values())if(!d.hasDuplicateNameToRemove){h=!0;break}s.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:h})}l&&(t._originNumber=l.number)},exit({node:t},{openRefs:e}){e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=Qe(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Recursion({node:t,parent:e},{reffedNodesByReferencer:n}){const{ref:r}=t;let s=e;for(;(s=s.parent)&&!(s.type===g.CapturingGroup&&(s.name===r||s.number===r)););n.set(t,s)},Subroutine(t,e){const{node:n,replaceWith:r}=t,{ref:s}=n,a=e.subroutineRefMap.get(s),o=s===0,i=o?Fn(0):qr(a,e.groupOriginByCopy,null);let l=i;if(!o){const c=Vr(Li(a,h=>h.type===g.Group&&!!h.flags)),u=c?Qe(e.globalFlags,c):e.globalFlags;Ti(u,e.currentFlags)||(l=Z(K({flags:$i(u)}),[i]))}r(l),o||Jr(l,t,e,zr)}},Ii={Backreference({node:t,replaceWith:e},n){if(t.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,t.ref);return}const s=n.reffedNodesByReferencer.get(t).filter(a=>Pi(a,t));if(!s.length)e(Z(we({negate:!0})));else if(s.length>1){const a=s.map(o=>Re(se(),[jt(o.number)]));e(Re(K(),a))}else t.ref=s[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Recursion({node:t},e){t.ref!==0&&(t.ref=e.reffedNodesByReferencer.get(t).number)},Regex:{exit({node:t},e){const n=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let r=0;r<n;r++){const s=jr();t.pattern.alternatives.at(-1).elements.push(s)}}}},Ni="[ -\r ]",Y=_`[\p{L}\p{M}\p{N}\p{Pc}]`;function Re(t,e){return e.forEach(n=>n.parent=t),t[Jt(t)]=e,t}function Ti(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function Pi(t,e){let n=e;do{if(n.type===g.Pattern)return!1;if(n.type===g.Alternative)continue;if(n===t)return!1;const r=Kr(n.parent);for(const s of r){if(s===n)break;if(s===t||Qr(s,t))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function qr(t,e,n,r){const s=Array.isArray(t)?[]:{};for(const[a,o]of Object.entries(t))a==="parent"?s.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?s[a]=qr(o,e,s,n):(a==="type"&&o===g.CapturingGroup&&e.set(s,e.get(t)??t),s[a]=o);return s}function Fn(t){return{type:g.Recursion,ref:t}}function Li(t,e){const n=[];for(;t=t.parent;)(!e||e(t))&&n.push(t);return n}function wt(t,e){if(e.has(t))return e.get(t);const n=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,n),n}function Jt(t){for(const e of["alternatives","classes","elements"])if(t[e])return e;return null}function Vr(t){const e=["dotAll","ignoreCase"],n={enable:{},disable:{}};return t.forEach(({flags:r})=>{e.forEach(s=>{r.enable?.[s]&&(delete n.disable[s],n.enable[s]=!0),r.disable?.[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function $i({dotAll:t,ignoreCase:e}){const n={};return(t||e)&&(n.enable={},t&&(n.enable.dotAll=!0),e&&(n.enable.ignoreCase=!0)),(!t||!e)&&(n.disable={},!t&&(n.disable.dotAll=!0),!e&&(n.disable.ignoreCase=!0)),n}function Kr(t){if(!t)throw new Error("Node expected");if(t.type===g.Quantifier)return[t.element];const e=Jt(t);return e&&t[e]}function Xr(t){const e=t.find(n=>n.kind===E.search_start||Oi(n,{negate:!1})||!ti(n));if(!e)return null;if(e.kind===E.search_start)return e;if(Le(e))return e.alternatives[0].elements[0];if(Br(e)){const n=[];for(const r of e.alternatives){const s=Xr(r.elements);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function Qr(t,e){const n=Kr(t)??[];for(const r of n)if(r===e||Qr(r,e))return!0;return!1}function Oi(t,e){const n={negate:null,...e};return Le(t)&&(n.negate===null||t.negate===n.negate)&&Qt(t,r=>r.kind===E.search_start)}function vt(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function z(t,e){const r=Fr(Or(t),e).pattern.alternatives;return r.length>1||r[0].elements.length>1?Re(K(),r):r[0].elements[0]}function Z(t,e){const n=Jt(t);return t[n][0].parent=t,e&&Re(t[n][0],e),t}function At(t,e){return t.negate=e,t}function Jr(t,{parent:e,key:n,container:r},s,a){ge({node:t,parent:e,key:n,container:r},s,a)}function Mi(t,e){const n=Ar(e),r=Dt(n.target,"ES2024"),s=Dt(n.target,"ES2025"),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,i=null;if(!s){const p=[t.flags.ignoreCase];ge({node:t},{getCurrentModI:()=>p.at(-1),popModI(){p.pop()},pushModI(f){p.push(f)},setHasCasedChar(){p.at(-1)?o=!0:i=!0}},Gi)}const l={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||o)&&!i)};let c=null;const u={accuracy:n.accuracy,appliedGlobalFlags:l,avoidSubclass:n.avoidSubclass,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:c,recursionLimit:a,useAppliedIgnoreCase:!!(!s&&o&&i),useFlagMods:s,useFlagV:r,verbose:n.verbose};function h(p){switch(u.lastNode=c,c=p,p.type){case g.Regex:return{pattern:h(p.pattern),flags:h(p.flags),options:{...p.options}};case g.Alternative:return p.elements.map(h).join("");case g.Assertion:return Ui(p,u,h);case g.Backreference:return Wi(p,u);case g.CapturingGroup:return Hi(p,u,h);case g.Character:return zi(p,u);case g.CharacterClass:return qi(p,u,h);case g.CharacterClassIntersection:if(!u.useFlagV)throw new Error("Use of class intersection requires min target ES2024");return p.classes.map(h).join("&&");case g.CharacterClassRange:return Vi(p,u);case g.CharacterSet:return Ki(p,u);case g.Flags:return Xi(p,u);case g.Group:return Qi(p,u,h);case g.Pattern:return p.alternatives.map(h).join("|");case g.Quantifier:return h(p.element)+el(p);case g.Recursion:return Ji(p,u);default:throw new Error(`Unexpected node type "${p.type}"`)}}const d=h(t);return r||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d}var Gi={AnyGroup:{enter({node:t},e){const n=e.getCurrentModI();e.pushModI(t.flags?Qe({ignoreCase:n},t.flags).ignoreCase:n)},exit(t,e){e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){Yt(T(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),Yr(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind===I.property&&Tr.has(t.value)&&e.setHasCasedChar()}},Bi=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Fi=new Set(["-","\\","]","^","["]),Di=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Dn=new Map([[9,_`\t`],[10,_`\n`],[11,_`\v`],[12,_`\f`],[13,_`\r`],[8232,_`\u2028`],[8233,_`\u2029`],[65279,_`\uFEFF`]]),ji=/^\p{Cased}$/u;function Yt(t){return ji.test(t)}function Ui(t,e,n){const{kind:r,negate:s,alternatives:a}=t;if(Le(t))return`(?${`${r===E.lookahead?"":"<"}${s?"!":"="}`}${a.map(n).join("|")})`;if(r===E.string_end)return"$";if(r===E.string_start)return"^";if(r===E.word_boundary)return s?_`\B`:_`\b`;throw new Error(`Unexpected assertion kind "${r}"`)}function Wi({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t}function Hi({name:t,number:e,alternatives:n,_originNumber:r},s,a){return s.captureMap.set(e,{ignoreCase:s.currentFlags.ignoreCase}),`(${t?`?<${t}>`:""}${!s.avoidSubclass&&r?`${r<e?`$${r}`:""}${le}`:""}${n.map(a).join("|")})`}function zi({value:t},e){const n=T(t),r=pe(t,{isAfterBackref:e.lastNode.type===g.Backreference,inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(r!==n)return r;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&Yt(n)){const s=Er(n);return e.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n}function qi({negate:t,parent:e,elements:n},r,s){const a=()=>`[${t?"^":""}${n.map(s).join("")}]`;if(!r.inCharClass){r.inCharClass=!0;const i=a();return r.inCharClass=!1,i}const o=n[0]?.type;if(!t&&o&&((!r.useFlagV||!r.verbose)&&e.type===g.CharacterClass&&o!==g.CharacterClassIntersection||!r.verbose&&e.type===g.CharacterClassIntersection&&n.length===1&&o!==g.CharacterClass&&o!==g.CharacterClassRange))return n.map(s).join("");if(!r.useFlagV&&e.type===g.CharacterClass)throw new Error("Use of nested character class requires min target ES2024");return a()}function Vi(t,e){const n=t.min.value,r=t.max.value,s={isAfterBackref:!1,inCharClass:!0,useFlagV:e.useFlagV},a=pe(n,s),o=pe(r,s),i=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const l=Yr(t);Yi(l).forEach(u=>{i.add(Array.isArray(u)?`${pe(u[0],s)}-${pe(u[1],s)}`:pe(u,s))})}return`${a}-${o}${[...i].join("")}`}function Ki({kind:t,negate:e,value:n,key:r},s){if(t===I.dot)return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":_`[^\n]`;if(t===I.digit)return e?_`\D`:_`\d`;if(t===I.property){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&Tr.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?_`\P`:_`\p`}{${r?`${r}=`:""}${n}}`}if(t===I.word)return e?_`\W`:_`\w`;throw new Error(`Unexpected character set kind "${t}"`)}function Xi(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")}function Qi({atomic:t,flags:e,parent:n,alternatives:r},s,a){const o=s.currentFlags;e&&(s.currentFlags=Qe(o,e));const i=r.map(a).join("|"),l=!s.verbose&&r.length===1&&n.type!==g.Quantifier&&!t&&(!s.useFlagMods||!e)?i:`(?${Zi(t,e,s.useFlagMods)}${i})`;return s.currentFlags=o,l}function Ji({ref:t},e){const n=e.recursionLimit;return t===0?`(?R=${n})`:_`\g<${t}&R=${n}>`}function Yr(t,e){const n=!!e?.firstOnly,r=t.min.value,s=t.max.value,a=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return a;for(let o=r;o<=s;o++){const i=T(o);if(!Yt(i))continue;const l=Er(i).filter(c=>{const u=c.codePointAt(0);return u<r||u>s});if(l.length&&(a.push(...l),n))break}return a}function pe(t,{isAfterBackref:e,inCharClass:n,useFlagV:r}){if(Dn.has(t))return Dn.get(t);if(t<32||t>126&&t<160||t>262143||e&&tl(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?Di:Fi:Bi,a=T(t);return(s.has(a)?"\\":"")+a}function Yi(t){const e=t.map(s=>s.codePointAt(0)).sort((s,a)=>s-a),n=[];let r=null;for(let s=0;s<e.length;s++)e[s+1]===e[s]+1?r??=e[s]:r===null?n.push(e[s]):(n.push([r,e[s]]),r=null);return n}function Zi(t,e,n){if(t)return">";let r="";if(e&&n){const{enable:s,disable:a}=e;r=(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")+(a?"-":"")+(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")}return`${r}:`}function el({min:t,max:e,greedy:n,possessive:r}){let s;return!t&&e===1?s="?":!t&&e===1/0?s="*":t===1&&e===1/0?s="+":t===e?s=`{${t}}`:s=`{${t},${e===1/0?"":e}}`,s+(r?"+":n?"":"?")}function tl(t){return t>47&&t<58}var nl=class Zr extends Xt{#e;rawArgs;constructor(e,n,r){if(e instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");super(e,n),e instanceof Zr?(this.#e=e.#e,this.rawArgs=e.rawArgs):(this.#e=null,this.rawArgs={pattern:e.source,flags:e.flags,options:{}}),n!==void 0&&(this.rawArgs.flags=n)}else{const s={strategy:null,useEmulationGroups:!1,...r};super(e,n,{useEmulationGroups:s.useEmulationGroups}),this.#e=s.strategy,this.rawArgs={pattern:e,flags:n??"",options:{...s.strategy&&{strategy:s.strategy},...s.useEmulationGroups&&{useEmulationGroups:!0}}}}}exec(e){const n=super.exec,r=this.global||this.sticky,s=this.lastIndex;if(this.#e==="search_start_clip"&&r&&s){this.lastIndex=0;const a=n.call(this,e.slice(s));return a&&(rl(a,this,e,s),this.lastIndex+=s),a}return n.call(this,e)}};function rl(t,e,n,r){if(t.input=n,t.index+=r,e.hasIndices){const s=t.indices;for(let o=0;o<s.length;o++){const i=s[o];i&&(s[o]=[i[0]+r,i[1]+r])}const a=s.groups;a&&Object.keys(a).forEach(o=>{const i=a[o];i&&(a[o]=[i[0]+r,i[1]+r])})}}function sl(t,e){const n=Ar(e),r=n.avoidSubclass,s=Or(t,n.flags,{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}),a=Fr(s,{skipBackrefValidation:n.rules.allowOrphanBackrefs,verbose:n.verbose}),o=Ri(a,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:r,bestEffortTarget:n.target}),i=Mi(o,n),l={useEmulationGroups:!r},c={pattern:No(To(Lo(i.pattern,l)),l),flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`},u=!r&&c.pattern.includes(le),h=o._strategy;return(u||h)&&(c.options={...h&&{strategy:h},...u&&{useEmulationGroups:u}}),c}function al(t,e){const n=sl(t,e);return n.options?new nl(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}const jn=4294967295;class ol{constructor(e,n={}){this.patterns=e,this.options=n;const{forgiving:r=!1,cache:s,regexConstructor:a}=n;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const i=s?.get(o);if(i){if(i instanceof RegExp)return i;if(r)return null;throw i}try{const l=a(o);return s?.set(o,l),l}catch(l){if(s?.set(o,l),r)return null;throw l}})}regexps;findNextMatchSync(e,n,r){const s=typeof e=="string"?e:e.content,a=[];function o(i,l,c=0){return{index:i,captureIndices:l.indices.map(u=>u==null?{start:jn,end:jn,length:0}:{start:u[0]+c,end:u[1]+c,length:u[1]-u[0]})}}for(let i=0;i<this.regexps.length;i++){const l=this.regexps[i];if(l)try{l.lastIndex=n;const c=l.exec(s);if(!c)continue;if(c.index===n)return o(i,c,0);a.push([i,c,0])}catch(c){if(this.options.forgiving)continue;throw c}}if(a.length){const i=Math.min(...a.map(l=>l[1].index));for(const[l,c,u]of a)if(c.index===i)return o(l,c,u)}return null}}function es(t,e){return al(t,{global:!0,hasIndices:!0,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function il(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||=n=>es(n,{target:e.target}),{createScanner(n){return new ol(n,e)},createString(n){return{content:n}}}}function ts(t){return H("import `createOnigurumaEngine` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead"),ve.createOnigurumaEngine(t)}function ll(t){return H("import `createOnigurumaEngine` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead"),ve.createOnigurumaEngine(t)}function cl(t){return H("import `loadWasm` from `@shikijs/engine-oniguruma` or `shiki/engine/oniguruma` instead"),ve.loadWasm(t)}function ns(t){return Array.isArray(t)?t:[t]}function $e(t,e=!1){const n=t.split(/(\r?\n)/g);let r=0;const s=[];for(let a=0;a<n.length;a+=2){const o=e?n[a]+(n[a+1]||""):n[a];s.push([o,r]),r+=n[a].length,r+=n[a+1]?.length||0}return s}function at(t){return!t||["plaintext","txt","text","plain"].includes(t)}function Zt(t){return t==="ansi"||at(t)}function ot(t){return t==="none"}function en(t){return ot(t)}function tn(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const r of n)r&&!t.properties.class.includes(r)&&t.properties.class.push(r);return t}function rs(t,e){let n=0;const r=[];for(const s of e)s>n&&r.push({...t,content:t.content.slice(n,s),offset:t.offset+n}),n=s;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function ss(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((r,s)=>r-s);return n.length?t.map(r=>r.flatMap(s=>{const a=n.filter(o=>s.offset<o&&o<s.offset+s.content.length).map(o=>o-s.offset).sort((o,i)=>o-i);return a.length?rs(s,a):s})):t}async function nn(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function Ie(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[s,a]of Object.entries(e?.colorReplacements||{}))typeof a=="string"?n[s]=a:s===r&&Object.assign(n,a);return n}function re(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function rn(t){const e={};return t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle&&(t.fontStyle&X.Italic&&(e["font-style"]="italic"),t.fontStyle&X.Bold&&(e["font-weight"]="bold"),t.fontStyle&X.Underline&&(e["text-decoration"]="underline")),e}function as(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function os(t){const e=$e(t,!0).map(([s])=>s);function n(s){if(s===t.length)return{line:e.length-1,character:e[e.length-1].length};let a=s,o=0;for(const i of e){if(a<i.length)break;a-=i.length,o++}return{line:o,character:a}}function r(s,a){let o=0;for(let i=0;i<s;i++)o+=e[i].length;return o+=a,o}return{lines:e,indexToPos:n,posToIndex:r}}class G extends Error{constructor(e){super(e),this.name="ShikiError"}}const is=new WeakMap;function it(t,e){is.set(t,e)}function Ne(t){return is.get(t)}class be{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new be(Object.fromEntries(ns(n).map(r=>[r,Lt])),e)}constructor(...e){if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,s]=e;this.lang=r,this._stacks={[s]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}get scopes(){return H("GrammarState.scopes is deprecated, use GrammarState.getScopes() instead"),Un(this._stacks[this.theme])}getScopes(e=this.theme){return Un(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.scopes}}}function Un(t){const e=[],n=new Set;function r(s){if(n.has(s))return;n.add(s);const a=s?.nameScopesList?.scopeName;a&&e.push(a),s.parent&&r(s.parent)}return r(t),e}function ul(t,e){if(!(t instanceof be))throw new G("Invalid grammar state");return t.getInternalStack(e)}function ls(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new G(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...s.indexToPos(o),offset:o}}else{const i=s.lines[o.line];if(i===void 0)throw new G(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${s.lines.length}`);if(o.character<0||o.character>i.length)throw new G(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${i.length}`);return{...o,offset:s.posToIndex(o.line,o.character)}}};const s=os(n.source),a=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));hl(a),t.set(n.meta,{decorations:a,converter:s,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const s=e(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return ss(n,s)},code(n){if(!this.options.decorations?.length)return;const r=e(this),s=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new G(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(u,h,d,p){const f=s[u];let k="",y=-1,S=-1;if(h===0&&(y=0),d===0&&(S=0),d===Number.POSITIVE_INFINITY&&(S=f.children.length),y===-1||S===-1)for(let w=0;w<f.children.length;w++)k+=cs(f.children[w]),y===-1&&k.length===h&&(y=w+1),S===-1&&k.length===d&&(S=w+1);if(y===-1)throw new G(`Failed to find start index for decoration ${JSON.stringify(p.start)}`);if(S===-1)throw new G(`Failed to find end index for decoration ${JSON.stringify(p.end)}`);const C=f.children.slice(y,S);if(!p.alwaysWrap&&C.length===f.children.length)i(f,p,"line");else if(!p.alwaysWrap&&C.length===1&&C[0].type==="element")i(C[0],p,"token");else{const w={type:"element",tagName:"span",properties:{},children:C};i(w,p,"wrapper"),f.children.splice(y,C.length,w)}}function o(u,h){s[u]=i(s[u],h,"line")}function i(u,h,d){const p=h.properties||{},f=h.transform||(k=>k);return u.tagName=h.tagName||"span",u.properties={...u.properties,...p,class:u.properties.class},h.properties?.class&&tn(u,h.properties.class),u=f(u,d)||u,u}const l=[],c=r.decorations.sort((u,h)=>h.start.offset-u.start.offset);for(const u of c){const{start:h,end:d}=u;if(h.line===d.line)a(h.line,h.character,d.character,u);else if(h.line<d.line){a(h.line,h.character,Number.POSITIVE_INFINITY,u);for(let p=h.line+1;p<d.line;p++)l.unshift(()=>o(p,u));a(d.line,0,d.character,u)}}l.forEach(u=>u())}}}function hl(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new G(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;r<t.length;r++){const s=t[r],a=n.start.offset<s.start.offset&&s.start.offset<n.end.offset,o=n.start.offset<s.end.offset&&s.end.offset<n.end.offset,i=s.start.offset<n.start.offset&&n.start.offset<s.end.offset,l=s.start.offset<n.end.offset&&n.end.offset<s.end.offset;if(a||o||i||l){if(o&&o||i&&l)continue;throw new G(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function cs(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(cs).join(""):""}const pl=[ls()];function Ze(t){return[...t.transformers||[],...pl]}var oe=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Et={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function fl(t,e){const n=t.indexOf("\x1B[",e);if(n!==-1){const r=t.indexOf("m",n);return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function Wn(t,e){let n=1;const r=t[e+n++];let s;if(r==="2"){const a=[t[e+n++],t[e+n++],t[e+n]].map(o=>Number.parseInt(o));a.length===3&&!a.some(o=>Number.isNaN(o))&&(s={type:"rgb",rgb:a})}else if(r==="5"){const a=Number.parseInt(t[e+n]);Number.isNaN(a)||(s={type:"table",index:Number(a)})}return[n,s]}function dl(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n],s=Number.parseInt(r);if(!Number.isNaN(s))if(s===0)e.push({type:"resetAll"});else if(s<=9)Et[s]&&e.push({type:"setDecoration",value:Et[s]});else if(s<=29){const a=Et[s-20];a&&e.push({type:"resetDecoration",value:a})}else if(s<=37)e.push({type:"setForegroundColor",value:{type:"named",name:oe[s-30]}});else if(s===38){const[a,o]=Wn(t,n);o&&e.push({type:"setForegroundColor",value:o}),n+=a}else if(s===39)e.push({type:"resetForegroundColor"});else if(s<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:oe[s-40]}});else if(s===48){const[a,o]=Wn(t,n);o&&e.push({type:"setBackgroundColor",value:o}),n+=a}else s===49?e.push({type:"resetBackgroundColor"}):s>=90&&s<=97?e.push({type:"setForegroundColor",value:{type:"named",name:oe[s-90+8]}}):s>=100&&s<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:oe[s-100+8]}})}return e}function gl(){let t=null,e=null,n=new Set;return{parse(r){const s=[];let a=0;do{const o=fl(r,a),i=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(i.length>0&&s.push({value:i,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const l=dl(o.sequence);for(const c of l)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}a=o.position}while(a<r.length);return s}}}var ml={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function yl(t=ml){function e(i){return t[i]}function n(i){return`#${i.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let c=0;c<oe.length;c++)r.push(e(oe[c]));let i=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let h=0;h<6;h++)r.push(n([i[c],i[u],i[h]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function a(i){return s()[i]}function o(i){switch(i.type){case"named":return e(i.name);case"rgb":return n(i.rgb);case"table":return a(i.index)}}return{value:o}}function us(t,e,n){const r=Ie(t,n),s=$e(e),a=yl(Object.fromEntries(oe.map(i=>[i,t.colors?.[`terminal.ansi${i[0].toUpperCase()}${i.substring(1)}`]]))),o=gl();return s.map(i=>o.parse(i[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?a.value(l.background):t.bg,u=l.foreground?a.value(l.foreground):t.fg):(c=l.foreground?a.value(l.foreground):t.fg,u=l.background?a.value(l.background):void 0),c=re(c,r),u=re(u,r),l.decorations.has("dim")&&(c=Cl(c));let h=X.None;return l.decorations.has("bold")&&(h|=X.Bold),l.decorations.has("italic")&&(h|=X.Italic),l.decorations.has("underline")&&(h|=X.Underline),{content:l.value,offset:i[1],color:c,bgColor:u,fontStyle:h}}))}function Cl(t){const e=t.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(e)if(e[3]){const r=Math.round(Number.parseInt(e[3],16)/2).toString(16).padStart(2,"0");return`#${e[1]}${e[2]}${r}`}else return e[2]?`#${e[1]}${e[2]}80`:`#${Array.from(e[1]).map(r=>`${r}${r}`).join("")}80`;const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function Oe(t,e,n={}){const{lang:r="text",theme:s=t.getLoadedThemes()[0]}=n;if(at(r)||ot(s))return $e(e).map(l=>[{content:l[0],offset:l[1]}]);const{theme:a,colorMap:o}=t.setTheme(s);if(r==="ansi")return us(a,e,n);const i=t.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==i.name)throw new Q(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(a.name))throw new Q(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return ps(e,i,a,o,n)}function hs(...t){if(t.length===2)return Ne(t[1]);const[e,n,r={}]=t,{lang:s="text",theme:a=e.getLoadedThemes()[0]}=r;if(at(s)||ot(a))throw new Q("Plain language does not have grammar state");if(s==="ansi")throw new Q("ANSI language does not have grammar state");const{theme:o,colorMap:i}=e.setTheme(a),l=e.getLanguage(s);return new be(et(n,l,o,i,r).stateStack,l.name,o.name)}function ps(t,e,n,r,s){const a=et(t,e,n,r,s),o=new be(et(t,e,n,r,s).stateStack,e.name,n.name);return it(a.tokens,o),a.tokens}function et(t,e,n,r,s){const a=Ie(n,s),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:i=500}=s,l=$e(t);let c=s.grammarState?ul(s.grammarState,n.name)??Lt:s.grammarContextCode!=null?et(s.grammarContextCode,e,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:Lt,u=[];const h=[];for(let d=0,p=l.length;d<p;d++){const[f,k]=l[d];if(f===""){u=[],h.push([]);continue}if(o>0&&f.length>=o){u=[],h.push([{content:f,offset:k,color:"",fontStyle:0}]);continue}let y,S,C;s.includeExplanation&&(y=e.tokenizeLine(f,c),S=y.tokens,C=0);const w=e.tokenizeLine2(f,c,i),L=w.tokens.length/2;for(let R=0;R<L;R++){const q=w.tokens[2*R],F=R+1<L?w.tokens[2*R+2]:f.length;if(q===F)continue;const ln=w.tokens[2*R+1],Cs=re(r[ie.getForeground(ln)],a),bs=ie.getFontStyle(ln),ht={content:f.substring(q,F),offset:k+q,color:Cs,fontStyle:bs};if(s.includeExplanation){const cn=[];if(s.includeExplanation!=="scopeName")for(const J of n.settings){let ue;switch(typeof J.scope){case"string":ue=J.scope.split(/,/).map(pt=>pt.trim());break;case"object":ue=J.scope;break;default:continue}cn.push({settings:J,selectors:ue.map(pt=>pt.split(/ /))})}ht.explanation=[];let un=0;for(;q+un<F;){const J=S[C],ue=f.substring(J.startIndex,J.endIndex);un+=ue.length,ht.explanation.push({content:ue,scopes:s.includeExplanation==="scopeName"?bl(J.scopes):_l(cn,J.scopes)}),C+=1}}u.push(ht)}h.push(u),u=[],c=w.ruleStack}return{tokens:h,stateStack:c}}function bl(t){return t.map(e=>({scopeName:e}))}function _l(t,e){const n=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];n[r]={scopeName:a,themeMatches:Sl(t,a,e.slice(0,r))}}return n}function Hn(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function kl(t,e,n){if(!Hn(t[t.length-1],e))return!1;let r=t.length-2,s=n.length-1;for(;r>=0&&s>=0;)Hn(t[r],n[s])&&(r-=1),s-=1;return r===-1}function Sl(t,e,n){const r=[];for(const{selectors:s,settings:a}of t)for(const o of s)if(kl(o,e,n)){r.push(a);break}return r}function lt(t,e,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),s=r.map(l=>{const c=Oe(t,e,{...n,theme:l.theme}),u=Ne(c),h=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:c,state:u,theme:h}}),a=wl(...s.map(l=>l.tokens)),o=a[0].map((l,c)=>l.map((u,h)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),a.forEach((p,f)=>{const{content:k,explanation:y,offset:S,...C}=p[c][h];d.variants[r[f].color]=C}),d})),i=s[0].state?new be(Object.fromEntries(s.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),s[0].state.lang):void 0;return i&&it(o,i),o}function wl(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){const s=t.map(l=>l[r]),a=e.map(()=>[]);e.forEach((l,c)=>l.push(a[c]));const o=s.map(()=>0),i=s.map(l=>l[0]);for(;i.every(l=>l);){const l=Math.min(...i.map(c=>c.content.length));for(let c=0;c<n;c++){const u=i[c];u.content.length===l?(a[c].push(u),o[c]+=1,i[c]=s[c][o[c]]):(a[c].push({...u,content:u.content.slice(0,l)}),i[c]={...u,content:u.content.slice(l),offset:u.offset+l})}}}return e}function me(t,e,n){let r,s,a,o,i,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-"}=n,h=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,S)=>y.color===c?-1:S.color===c?1:0);if(h.length===0)throw new Q("`themes` option must not be empty");const d=lt(t,e,n);if(l=Ne(d),c&&!h.find(y=>y.color===c))throw new Q(`\`themes\` option must contain the defaultColor key \`${c}\``);const p=h.map(y=>t.getTheme(y.theme)),f=h.map(y=>y.color);a=d.map(y=>y.map(S=>vl(S,f,u,c))),l&&it(a,l);const k=h.map(y=>Ie(y.theme,n));s=h.map((y,S)=>(S===0&&c?"":`${u+y.color}:`)+(re(p[S].fg,k[S])||"inherit")).join(";"),r=h.map((y,S)=>(S===0&&c?"":`${u+y.color}-bg:`)+(re(p[S].bg,k[S])||"inherit")).join(";"),o=`shiki-themes ${p.map(y=>y.name).join(" ")}`,i=c?void 0:[s,r].join(";")}else if("theme"in n){const c=Ie(n.theme,n);a=Oe(t,e,n);const u=t.getTheme(n.theme);r=re(u.bg,c),s=re(u.fg,c),o=u.name,l=Ne(a)}else throw new Q("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:s,bg:r,themeName:o,rootStyle:i,grammarState:l}}function vl(t,e,n,r){const s={content:t.content,explanation:t.explanation,offset:t.offset},a=e.map(l=>rn(t.variants[l])),o=new Set(a.flatMap(l=>Object.keys(l))),i={};return a.forEach((l,c)=>{for(const u of o){const h=l[u]||"inherit";if(c===0&&r)i[u]=h;else{const d=u==="color"?"":u==="background-color"?"-bg":`-${u}`,p=n+e[c]+(u==="color"?"":d);i[p]=h}}}),s.htmlStyle=i,s}function ye(t,e,n,r={meta:{},options:n,codeToHast:(s,a)=>ye(t,s,a),codeToTokens:(s,a)=>me(t,s,a)}){let s=e;for(const p of Ze(n))s=p.preprocess?.call(r,s,n)||s;let{tokens:a,fg:o,bg:i,themeName:l,rootStyle:c,grammarState:u}=me(t,s,n);const{mergeWhitespaces:h=!0}=n;h===!0?a=Al(a):h==="never"&&(a=El(a));const d={...r,get source(){return s}};for(const p of Ze(n))a=p.tokens?.call(d,a)||a;return fs(a,{...n,fg:o,bg:i,themeName:l,rootStyle:c},d,u)}function fs(t,e,n,r=Ne(t)){const s=Ze(e),a=[],o={type:"root",children:[]},{structure:i="classic",tabindex:l="0"}=e;let c={type:"element",tagName:"pre",properties:{class:`shiki ${e.themeName||""}`,style:e.rootStyle||`background-color:${e.bg};color:${e.fg}`,...l!==!1&&l!=null?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(e.meta||{})).filter(([f])=>!f.startsWith("_")))},children:[]},u={type:"element",tagName:"code",properties:{},children:a};const h=[],d={...n,structure:i,addClassToHast:tn,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return o},get pre(){return c},get code(){return u},get lines(){return h}};if(t.forEach((f,k)=>{k&&(i==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&a.push({type:"text",value:`
|
|
148
|
+
`}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},S=0;for(const C of f){let w={type:"element",tagName:"span",properties:{...C.htmlAttrs},children:[{type:"text",value:C.content}]};typeof C.htmlStyle=="string"&&H("`htmlStyle` as a string is deprecated. Use an object instead.");const L=as(C.htmlStyle||rn(C));L&&(w.properties.style=L);for(const R of s)w=R?.span?.call(d,w,k+1,S,y,C)||w;i==="inline"?o.children.push(w):i==="classic"&&y.children.push(w),S+=C.content.length}if(i==="classic"){for(const C of s)y=C?.line?.call(d,y,k+1)||y;h.push(y),a.push(y)}}),i==="classic"){for(const f of s)u=f?.code?.call(d,u)||u;c.children.push(u);for(const f of s)c=f?.pre?.call(d,c)||c;o.children.push(c)}let p=o;for(const f of s)p=f?.root?.call(d,p)||p;return r&&it(p,r),p}function Al(t){return t.map(e=>{const n=[];let r="",s=0;return e.forEach((a,o)=>{const l=!(a.fontStyle&&a.fontStyle&X.Underline);l&&a.content.match(/^\s+$/)&&e[o+1]?(s||(s=a.offset),r+=a.content):r?(l?n.push({...a,offset:s,content:r+a.content}):n.push({content:r,offset:s},a),s=0,r=""):n.push(a)}),n})}function El(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,s,a,o]=r;if(!s&&!o)return n;const i=[{...n,offset:n.offset+s.length,content:a}];return s&&i.unshift({content:s,offset:n.offset}),o&&i.push({content:o,offset:n.offset+s.length+a.length}),i}))}function sn(t,e,n){const r={meta:{},options:n,codeToHast:(a,o)=>ye(t,a,o),codeToTokens:(a,o)=>me(t,a,o)};let s=wr(ye(t,e,n,r));for(const a of Ze(n))s=a.postprocess?.call(r,s,n)||s;return s}const zn={light:"#333333",dark:"#bbbbbb"},qn={light:"#fffffe",dark:"#1e1e1e"},Vn="__shiki_resolved";function ct(t){if(t?.[Vn])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:r}=e;if(!n||!r){const i=e.settings?e.settings.find(l=>!l.name&&!l.scope):void 0;i?.settings?.foreground&&(r=i.settings.foreground),i?.settings?.background&&(n=i.settings.background),!r&&e?.colors?.["editor.foreground"]&&(r=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?zn.light:zn.dark),n||(n=e.type==="light"?qn.light:qn.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const a=new Map;function o(i){if(a.has(i))return a.get(i);s+=1;const l=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${l}`]?o(i):(a.set(i,l),l)}e.settings=e.settings.map(i=>{const l=i.settings?.foreground&&!i.settings.foreground.startsWith("#"),c=i.settings?.background&&!i.settings.background.startsWith("#");if(!l&&!c)return i;const u={...i,settings:{...i.settings}};if(l){const h=o(i.settings.foreground);e.colorReplacements[h]=i.settings.foreground,u.settings.foreground=h}if(c){const h=o(i.settings.background);e.colorReplacements[h]=i.settings.background,u.settings.background=h}return u});for(const i of Object.keys(e.colors||{}))if((i==="editor.foreground"||i==="editor.background"||i.startsWith("terminal.ansi"))&&!e.colors[i]?.startsWith("#")){const l=o(e.colors[i]);e.colorReplacements[l]=e.colors[i],e.colors[i]=l}return Object.defineProperty(e,Vn,{enumerable:!1,writable:!1,value:!0}),e}async function ds(t){return Array.from(new Set((await Promise.all(t.filter(e=>!Zt(e)).map(async e=>await nn(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function gs(t){return(await Promise.all(t.map(async n=>en(n)?null:ct(await nn(n))))).filter(n=>!!n)}class xl extends oa{constructor(e,n,r,s={}){super(e),this._resolver=e,this._themes=n,this._langs=r,this._alias=s,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const n=ct(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=ze.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){if(this._alias[e]){const n=new Set([e]);for(;this._alias[e];){if(e=this._alias[e],n.has(e))throw new G(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const s=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(s.name=e.name,this._resolvedGrammars.set(e.name,s),e.aliases&&e.aliases.forEach(a=>{this._alias[a]=e.name}),this._loadedLanguagesCache=null,n.size)for(const a of n)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const s of e)this.resolveEmbeddedLanguages(s);const n=Array.from(this._langGraph.entries()),r=n.filter(([s,a])=>!a);if(r.length){const s=n.filter(([a,o])=>o&&o.embeddedLangs?.some(i=>r.map(([l])=>l).includes(i))).filter(a=>!r.includes(a));throw new G(`Missing languages ${r.map(([a])=>`\`${a}\``).join(", ")}, required by ${s.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[s,a]of n)this._resolver.addLanguage(a);for(const[s,a]of n)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){if(this._langMap.set(e.name,e),this._langGraph.set(e.name,e),e.embeddedLangs)for(const n of e.embeddedLangs)this._langGraph.set(n,this._langMap.get(n))}}class Rl{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let s=1;s<=n.length;s++){const a=n.slice(0,s).join(".");r=[...r,...this._injections.get(a)||[]]}return r}}let _e=0;function an(t){_e+=1,t.warnings!==!1&&_e>=10&&_e%10===0&&console.warn(`[Shiki] ${_e} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new G("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(ct),s=new Rl(t.engine,n),a=new xl(s,r,n,t.langAlias);let o;function i(C){y();const w=a.getGrammar(typeof C=="string"?C:C.name);if(!w)throw new G(`Language \`${C}\` not found, you may need to load it first`);return w}function l(C){if(C==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const w=a.getTheme(C);if(!w)throw new G(`Theme \`${C}\` not found, you may need to load it first`);return w}function c(C){y();const w=l(C);o!==C&&(a.setTheme(w),o=C);const L=a.getColorMap();return{theme:w,colorMap:L}}function u(){return y(),a.getLoadedThemes()}function h(){return y(),a.getLoadedLanguages()}function d(...C){y(),a.loadLanguages(C.flat(1))}async function p(...C){return d(await ds(C))}function f(...C){y();for(const w of C.flat(1))a.loadTheme(w)}async function k(...C){return y(),f(await gs(C))}function y(){if(e)throw new G("Shiki instance has been disposed")}function S(){e||(e=!0,a.dispose(),_e-=1)}return{setTheme:c,getTheme:l,getLanguage:i,getLoadedThemes:u,getLoadedLanguages:h,loadLanguage:p,loadLanguageSync:d,loadTheme:k,loadThemeSync:f,dispose:S,[Symbol.dispose]:S}}async function on(t={}){t.loadWasm&&H("`loadWasm` option is deprecated. Use `engine: createOnigurumaEngine(loadWasm)` instead.");const[e,n,r]=await Promise.all([gs(t.themes||[]),ds(t.langs||[]),t.engine||ve.createOnigurumaEngine(t.loadWasm||ve.getDefaultWasmLoader())]);return an({...t,themes:e,langs:n,engine:r})}function Il(t={}){return H("`getShikiInternal` is deprecated. Use `createShikiInternal` instead."),on(t)}async function ut(t={}){const e=await on(t);return{getLastGrammarState:(...n)=>hs(e,...n),codeToTokensBase:(n,r)=>Oe(e,n,r),codeToTokensWithThemes:(n,r)=>lt(e,n,r),codeToTokens:(n,r)=>me(e,n,r),codeToHast:(n,r)=>ye(e,n,r),codeToHtml:(n,r)=>sn(e,n,r),...e,getInternalContext:()=>e}}function Nl(t={}){const e=an(t);return{getLastGrammarState:(...n)=>hs(e,...n),codeToTokensBase:(n,r)=>Oe(e,n,r),codeToTokensWithThemes:(n,r)=>lt(e,n,r),codeToTokens:(n,r)=>me(e,n,r),codeToHast:(n,r)=>ye(e,n,r),codeToHtml:(n,r)=>sn(e,n,r),...e,getInternalContext:()=>e}}function ms(t){let e;async function n(r={}){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else return e=t({...r,themes:r.themes||[],langs:r.langs||[]}),e}return n}const Tl=ms(ut);function Pl(t={}){return H("`getHighlighterCore` is deprecated. Use `createHighlighterCore` or `getSingletonHighlighterCore` instead."),ut(t)}function Ll(t,e,n){let r,s,a;if(e)H("`createdBundledHighlighter` signature with `bundledLanguages` and `bundledThemes` is deprecated. Use the options object signature instead."),r=t,s=e,a=()=>ts(n);else{const i=t;r=i.langs,s=i.themes,a=i.engine}async function o(i){function l(p){if(typeof p=="string"){if(Zt(p))return[];const f=r[p];if(!f)throw new Q(`Language \`${p}\` is not included in this bundle. You may want to load it from external source.`);return f}return p}function c(p){if(en(p))return"none";if(typeof p=="string"){const f=s[p];if(!f)throw new Q(`Theme \`${p}\` is not included in this bundle. You may want to load it from external source.`);return f}return p}const u=(i.themes??[]).map(p=>c(p)),h=(i.langs??[]).map(p=>l(p)),d=await ut({engine:i.engine??a(),...i,themes:u,langs:h});return{...d,loadLanguage(...p){return d.loadLanguage(...p.map(l))},loadTheme(...p){return d.loadTheme(...p.map(c))}}}return o}function ys(t){let e;async function n(r={}){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else return e=t({...r,themes:r.themes||[],langs:r.langs||[]}),e}return n}function $l(t){const e=ys(t);return{getSingletonHighlighter(n){return e(n)},async codeToHtml(n,r){return(await e({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)})).codeToHtml(n,r)},async codeToHast(n,r){return(await e({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)})).codeToHast(n,r)},async codeToTokens(n,r){return(await e({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)})).codeToTokens(n,r)},async codeToTokensBase(n,r){return(await e({langs:[r.lang],themes:[r.theme]})).codeToTokensBase(n,r)},async codeToTokensWithThemes(n,r){return(await e({langs:[r.lang],themes:Object.values(r.themes).filter(Boolean)})).codeToTokensWithThemes(n,r)},async getLastGrammarState(n,r){return(await e({langs:[r.lang],themes:[r.theme]})).getLastGrammarState(n,r)}}}function Ol(t){return H("import `createJavaScriptRegexEngine` from `@shikijs/engine-javascript` or `shiki/engine/javascript` instead"),il(t)}function Ml(t){return H("import `defaultJavaScriptRegexConstructor` from `@shikijs/engine-javascript` or `shiki/engine/javascript` instead"),es(t)}function Gl(t={}){const{name:e="css-variables",variablePrefix:n="--shiki-",fontStyle:r=!0}=t,s=o=>t.variableDefaults?.[o]?`var(${n}${o}, ${t.variableDefaults[o]})`:`var(${n}${o})`,a={name:e,type:"dark",colors:{"editor.foreground":s("foreground"),"editor.background":s("background"),"terminal.ansiBlack":s("ansi-black"),"terminal.ansiRed":s("ansi-red"),"terminal.ansiGreen":s("ansi-green"),"terminal.ansiYellow":s("ansi-yellow"),"terminal.ansiBlue":s("ansi-blue"),"terminal.ansiMagenta":s("ansi-magenta"),"terminal.ansiCyan":s("ansi-cyan"),"terminal.ansiWhite":s("ansi-white"),"terminal.ansiBrightBlack":s("ansi-bright-black"),"terminal.ansiBrightRed":s("ansi-bright-red"),"terminal.ansiBrightGreen":s("ansi-bright-green"),"terminal.ansiBrightYellow":s("ansi-bright-yellow"),"terminal.ansiBrightBlue":s("ansi-bright-blue"),"terminal.ansiBrightMagenta":s("ansi-bright-magenta"),"terminal.ansiBrightCyan":s("ansi-bright-cyan"),"terminal.ansiBrightWhite":s("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:s("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:s("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:s("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:s("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],settings:{foreground:s("token-constant")}},{scope:["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],settings:{foreground:s("token-keyword")}},{scope:"variable.parameter.function",settings:{foreground:s("token-parameter")}},{scope:["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],settings:{foreground:s("token-function")}},{scope:["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],settings:{foreground:s("token-string-expression")}},{scope:["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],settings:{foreground:s("token-punctuation")}},{scope:["markup.underline.link","punctuation.definition.metadata.markdown"],settings:{foreground:s("token-link")}},{scope:["beginning.punctuation.definition.list.markdown"],settings:{foreground:s("token-string")}},{scope:["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],settings:{foreground:s("token-keyword")}},{scope:["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],settings:{foreground:s("token-inserted")}},{scope:["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],settings:{foreground:s("token-deleted")}},{scope:["markup.changed","punctuation.definition.changed"],settings:{foreground:s("token-changed")}}]};return r||(a.tokenColors=a.tokenColors?.map(o=>(o.settings?.fontStyle&&delete o.settings.fontStyle,o))),a}exports.FontStyle=X;exports.ShikiError=Q;exports.StackElementMetadata=ie;exports.addClassToHast=tn;exports.applyColorReplacements=re;exports.codeToHast=ye;exports.codeToHtml=sn;exports.codeToTokens=me;exports.codeToTokensBase=Oe;exports.codeToTokensWithThemes=lt;exports.createCssVariablesTheme=Gl;exports.createHighlighterCore=ut;exports.createHighlighterCoreSync=Nl;exports.createJavaScriptRegexEngine=Ol;exports.createOnigurumaEngine=ts;exports.createPositionConverter=os;exports.createShikiInternal=on;exports.createShikiInternalSync=an;exports.createSingletonShorthands=$l;exports.createWasmOnigEngine=ll;exports.createdBundledHighlighter=Ll;exports.defaultJavaScriptRegexConstructor=Ml;exports.enableDeprecationWarnings=_s;exports.getHighlighterCore=Pl;exports.getShikiInternal=Il;exports.getSingletonHighlighterCore=Tl;exports.getTokenStyleObject=rn;exports.hastToHtml=wr;exports.isNoneTheme=ot;exports.isPlainLang=at;exports.isSpecialLang=Zt;exports.isSpecialTheme=en;exports.loadWasm=cl;exports.makeSingletonHighlighter=ys;exports.makeSingletonHighlighterCore=ms;exports.normalizeGetter=nn;exports.normalizeTheme=ct;exports.resolveColorReplacements=Ie;exports.splitLines=$e;exports.splitToken=rs;exports.splitTokens=ss;exports.stringifyTokenStyle=as;exports.toArray=ns;exports.tokenizeAnsiWithTheme=us;exports.tokenizeWithTheme=ps;exports.tokensToHast=fs;exports.transformerDecorations=ls;exports.warnDeprecated=H;
|