yanki 0.8.3 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var J=Object.defineProperty;var u=(e,t)=>J(e,"name",{value:t,configurable:!0});import{t as h,u as y,n as M,m as I,l as L,b as U,c as D,f as z,s as F,i as H}from"../sync-files-
|
|
2
|
+
var J=Object.defineProperty;var u=(e,t)=>J(e,"name",{value:t,configurable:!0});import{t as h,u as y,n as M,m as I,l as L,b as U,c as D,f as z,s as F,i as H}from"../sync-files-B0ZsV0tB.js";import s from"chalk";import{globby as j}from"globby";import W from"node:fs/promises";import q from"node:path";import B from"slash";import G from"node:os";import K from"yargs";import{hideBin as Q}from"yargs/helpers";import"rehype-mathjax";import"rehype-parse";import"node:crypto";var V="0.8.4";const R=process?.versions?.node!==void 0,c={verbose:!1,log(...e){if(!this.verbose)return;const t=s.gray("[Log]");R?console.warn(t,...e):console.log(t,...e)},logPrefixed(e,...t){this.info(s.blue(`[${e}]`),...t)},info(...e){if(!this.verbose)return;const t=s.green("[Info]");R?console.warn(t,...e):console.info(t,...e)},infoPrefixed(e,...t){this.info(s.blue(`[${e}]`),...t)},warn(...e){console.warn(s.yellow("[Warning]"),...e)},warnPrefixed(e,...t){this.warn(s.blue(`[${e}]`),...t)},error(...e){console.error(s.red("[Error]"),...e)},errorPrefixed(e,...t){this.error(s.blue(`[${e}]`),...t)}},g={"anki-auto-launch":{alias:"l",default:!1,describe:"Attempt to open the Anki desktop app if it's not already running. (Experimental, macOS only.)",type:"boolean"}},A={"anki-web":{alias:"w",default:!0,describe:'Automatically sync any changes to AnkiWeb after Yanki has finished syncing locally. If false, only local Anki data is updated and you must manually invoke a sync to AnkiWeb. This is the equivalent of pushing the "sync" button in the Anki app.',type:"boolean"}},w={"anki-connect":{default:"http://127.0.0.1:8765",describe:"Host and port of the Anki-Connect server. The default is usually fine. See the Anki-Connect documentation for more information.",type:"string"}},S={verbose:{default:!1,describe:"Enable verbose logging.",type:"boolean"}};function b(e){return{json:{default:!1,describe:e,type:"boolean"}}}u(b,"jsonOption");const C={"dry-run":{alias:"d",default:!1,describe:"Run without making any changes to the Anki database. See a report of what would have been done.",type:"boolean"}};function O(e){return{namespace:{alias:"n",default:h.namespace,describe:e,type:"string"}}}u(O,"namespaceOption");const E=G.homedir();function X(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return E?e.replace(/^~(?=$|\/|\\)/,E):e}u(X,"untildify");const k=u(e=>{const{code:t}=e.cause;throw t==="ECONNREFUSED"&&(c.error("Failed to connect to Anki. Make sure Anki is running and AnkiConnect is installed."),process.exitCode=1,process.exit()),e instanceof Error?e:new Error("Unknown error")},"ankiNotRunningErrorHandler"),$=K(Q(process.argv));await $.scriptName("yanki").usage("$0 [command]","Run a Yanki command. Defaults to `sync` if a command is not provided.").command(["$0 <directory> [options]","sync <directory> [options]"],"Perform a one-way synchronization from a local directory of Markdown files to the Anki database. Any Markdown files in subdirectories are included as well.",e=>e.positional("directory",{demandOption:!0,describe:"The path to the local directory of Markdown files to sync.",type:"string"}).option(C).option(O("Advanced option for managing multiple Yanki synchronization groups. Case insensitive. See the readme for more information.")).option(w).option(g).option(A).option("manage-filenames",{alias:"m",choices:["off","prompt","response"],default:h.manageFilenames,describe:'Rename local note files to match their content. Useful if you want to feel have semantically reasonable note file names without managing them by hand. The `"prompt"` option will attempt to create the filename based on the "front" of the card, while `"response"` will prioritize the "back", "Cloze", or "type in the answer" portions of the card. Truncation, sanitization, and deduplication are taken care of.',type:"string"}).option("max-filename-length",{default:void 0,defaultDescription:String(h.maxFilenameLength),describe:"If `manage-filenames` is enabled, this option specifies the maximum length of the filename in characters.",type:"number"}).option("sync-media",{alias:"s",choices:["off","all","local","remote"],default:h.syncMediaAssets,describe:"Sync image, video, and audio assets to Anki's media storage system. Clean up is managed automatically. The `all` argument will save both local and remote assets to Anki, while `local` will only save local assets, `remote` will only save remote assets, and `off` will not save any assets.",type:"string"}).option(b("Output the sync report as JSON.")).option(S),async({ankiAutoLaunch:e,ankiConnect:t,ankiWeb:i,directory:o,dryRun:a,json:r,manageFilenames:n,maxFilenameLength:d,namespace:f,recursive:l=!0,syncMedia:m,verbose:p})=>{c.verbose=p;const v=B(X(o)),P=l?`${v}/**/*.md`:`${v}/*.md`,x=await j(P,{absolute:!0});if(x.length===0){c.error(`No Markdown files found in "${v}".`),process.exitCode=1;return}n==="off"&&d!==void 0&&c.warn("Ignoring `max-filename-length` option because `manage-filenames` is not enabled.");const{host:Y,port:T}=y(t),N=await M(x,{ankiConnectOptions:{autoLaunch:e,host:Y,port:T},ankiWeb:i,dryRun:a,manageFilenames:n,maxFilenameLength:d,namespace:f,syncMediaAssets:m}).catch(k);r?(process.stdout.write(JSON.stringify(N,void 0,2)),process.stdout.write(`
|
|
3
3
|
`)):(process.stderr.write(I(N,p)),process.stderr.write(`
|
|
4
4
|
`))}).command("list [options]","Utility command to list Yanki-created notes in the Anki database.",e=>e.option(O("Advanced option to list notes in a specific namespace. Case insensitive. Notes from the default internal namespace are listed by default. Pass `'*'` to list all Yanki-created notes in the Anki database.")).options(w).options(g).option(b("Output the list of notes as JSON to stdout.")),async({ankiAutoLaunch:e,ankiConnect:t,json:i,namespace:o})=>{const{host:a,port:r}=y(t),n=await L({ankiConnectOptions:{autoLaunch:e,host:a,port:r},namespace:o}).catch(k);i?(process.stdout.write(JSON.stringify(n,void 0,2)),process.stdout.write(`
|
|
5
5
|
`)):(process.stdout.write(U(n)),process.stdout.write(`
|
|
@@ -7,4 +7,4 @@ var J=Object.defineProperty;var u=(e,t)=>J(e,"name",{value:t,configurable:!0});i
|
|
|
7
7
|
`)):(process.stderr.write(z(l,n)),process.stderr.write(`
|
|
8
8
|
`))}).command("style [options]","Utility command to set the CSS stylesheet for all present and future Yanki-created notes.",e=>e.option(C).option("css",{alias:"c",default:void 0,describe:"Path to the CSS stylesheet to set for all Yanki-created notes. If not provided, the default Anki stylesheet is used.",type:"string"}).options(w).options(g).option(A).option(b("Output the list of updated note types / models as JSON to stdout.")).option(S),async({ankiAutoLaunch:e,ankiConnect:t,ankiWeb:i,css:o,dryRun:a,json:r,verbose:n})=>{const{host:d,port:f}=y(t);let l;if(o!==void 0){if(q.extname(o)!==".css"){c.error("The provided CSS file must have a .css extension."),process.exitCode=1;return}try{l=await W.readFile(o,"utf8")}catch(p){p instanceof Error?c.error(`Error loading CSS file: ${p.message}`):c.error(`Unknown error loading CSS file: ${String(p)}`),process.exitCode=1;return}}const m=await F({ankiConnectOptions:{autoLaunch:e,host:d,port:f},ankiWeb:i,css:l??void 0,dryRun:a}).catch(k);r?(process.stdout.write(JSON.stringify(m,void 0,2)),process.stdout.write(`
|
|
9
9
|
`)):(process.stderr.write(H(m,n)),process.stderr.write(`
|
|
10
|
-
`))}).demandCommand(1).alias("h","help").version(
|
|
10
|
+
`))}).demandCommand(1).alias("h","help").version(V).alias("v","version").help().wrap(process.stdout.isTTY?Math.min(120,$.terminalWidth()):0).parse();
|
package/dist/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as i,d as n,o as r,g as m,a as f,e as p,h as u,k as d,f as S,b as y,i as F,m as O,p as c,j as R,q as N,l as g,r as k,s as h,n as w,u as A}from"../sync-files-
|
|
1
|
+
import{c as i,d as n,o as r,g as m,a as f,e as p,h as u,k as d,f as S,b as y,i as F,m as O,p as c,j as R,q as N,l as g,r as k,s as h,n as w,u as A}from"../sync-files-B0ZsV0tB.js";import"rehype-mathjax";import"rehype-parse";import"node:path";import"node:crypto";export{i as cleanNotes,n as defaultCleanOptions,r as defaultGetNoteFromMarkdownOptions,m as defaultGetStyleOptions,f as defaultListOptions,p as defaultRenameFilesOptions,u as defaultSetStyleOptions,d as defaultSyncFilesOptions,S as formatCleanResult,y as formatListResult,F as formatSetStyleResult,O as formatSyncFilesResult,c as getNoteFromMarkdown,R as getStyle,N as hostAndPortToUrl,g as listNotes,k as renameFiles,h as setStyle,w as syncFiles,A as urlToHostAndPort};
|
|
@@ -8,7 +8,7 @@ var Nf=Object.defineProperty;var a=(t,e)=>Nf(t,"name",{value:e,configurable:!0})
|
|
|
8
8
|
}
|
|
9
9
|
`,Rt="yanki",ii=!0,ko=60,Mf="Yanki",Kn="(Empty)",$f=V("root",[V("element",{properties:{},tagName:"p"},[V("element",{properties:{},tagName:"em"},[V("text",Kn)])])]),Bf="content",qf="metadata",zf="metadata",Uf=!0,So=120,Yn="Untitled",si=["avif","gif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],oi=["3gp","aac","avi","flac","flv","m4a","mkv","mov","mp3","mp4","mpeg","mpg","oga","ogg","ogv","ogx","opus","spx","swf","wav","webm"],ai=typeof window>"u"?typeof process>"u"?"other":"node":"browser";ai==="browser"?/windows/i.test(navigator.userAgent)||/mac/i.test(navigator.userAgent):ai==="node"&&(process.platform==="win32"||process.platform);function Ge(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}a(Ge,"assertPath$2");function xo(t,e){for(var n="",r=0,i=-1,s=0,o,l=0;l<=t.length;++l){if(l<t.length)o=t.charCodeAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||s===1))if(i!==l-1&&s===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){u===-1?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=l,s=0;continue}}else if(n.length===2||n.length===1){n="",r=0,i=l,s=0;continue}}e&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+t.slice(i+1,l):n=t.slice(i+1,l),r=l-i-1;i=l,s=0}else o===46&&s!==-1?++s:s=-1}return n}a(xo,"normalizeStringPosix");function jf(t,e){var n=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+r:n+t+r:r}a(jf,"_format");var W={process_cwd:"",setCWD:a(function(e){W.process_cwd=e},"setCWD"),resolve:a(function(){for(var e="",n=!1,r,i=arguments.length-1;i>=-1&&!n;i--){var s;i>=0?s=arguments[i]:(r===void 0&&(r=W.process_cwd),s=r),Ge(s),s.length!==0&&s+"/"!==e&&(e=s+"/"+e,n=s.charCodeAt(0)===47)}return e=xo(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},"resolve"),normalize:a(function(e){if(Ge(e),e.length===0)return".";var n=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;return e=xo(e,!n),e.length===0&&!n&&(e="."),e.length>0&&r&&(e+="/"),n?"/"+e:e},"normalize"),isAbsolute:a(function(e){return Ge(e),e.length>0&&e.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var e,n=0;n<arguments.length;++n){var r=arguments[n];Ge(r),r.length>0&&(e===void 0?e=r:e+="/"+r)}return e===void 0?".":W.normalize(e)},"join"),relative:a(function(e,n){if(Ge(e),Ge(n),e===n||(e=W.resolve(e),n=W.resolve(n),e===n))return"";for(var r=1;r<e.length&&e.charCodeAt(r)===47;++r);for(var i=e.length,s=i-r,o=1;o<n.length&&n.charCodeAt(o)===47;++o);for(var l=n.length,u=l-o,c=s<u?s:u,h=-1,f=0;f<=c;++f){if(f===c){if(u>c){if(n.charCodeAt(o+f)===47)return n.slice(o+f+1);if(f===0)return n.slice(o+f)}else s>c&&(e.charCodeAt(r+f)===47?h=f:f===0&&(h=0));break}var p=e.charCodeAt(r+f),d=n.charCodeAt(o+f);if(p!==d)break;p===47&&(h=f)}var m="";for(f=r+h+1;f<=i;++f)(f===i||e.charCodeAt(f)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+n.slice(o+h):(o+=h,n.charCodeAt(o)===47&&++o,n.slice(o))},"relative"),_makeLong:a(function(e){return e},"_makeLong"),dirname:a(function(e){if(Ge(e),e.length===0)return".";for(var n=e.charCodeAt(0),r=n===47,i=-1,s=!0,o=e.length-1;o>=1;--o)if(n=e.charCodeAt(o),n===47){if(!s){i=o;break}}else s=!1;return i===-1?r?"/":".":r&&i===1?"//":e.slice(0,i)},"dirname"),basename:a(function(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ge(e);var r=0,i=-1,s=!0,o;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var l=n.length-1,u=-1;for(o=e.length-1;o>=0;--o){var c=e.charCodeAt(o);if(c===47){if(!s){r=o+1;break}}else u===-1&&(s=!1,u=o+1),l>=0&&(c===n.charCodeAt(l)?--l===-1&&(i=o):(l=-1,i=u))}return r===i?i=u:i===-1&&(i=e.length),e.slice(r,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!s){r=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":e.slice(r,i)}},"basename"),extname:a(function(e){Ge(e);for(var n=-1,r=0,i=-1,s=!0,o=0,l=e.length-1;l>=0;--l){var u=e.charCodeAt(l);if(u===47){if(!s){r=l+1;break}continue}i===-1&&(s=!1,i=l+1),u===46?n===-1?n=l:o!==1&&(o=1):n!==-1&&(o=-1)}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?"":e.slice(n,i)},"extname"),format:a(function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return jf("/",e)},"format"),parse:a(function(e){Ge(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return n;var r=e.charCodeAt(0),i=r===47,s;i?(n.root="/",s=1):s=0;for(var o=-1,l=0,u=-1,c=!0,h=e.length-1,f=0;h>=s;--h){if(r=e.charCodeAt(h),r===47){if(!c){l=h+1;break}continue}u===-1&&(c=!1,u=h+1),r===46?o===-1?o=h:f!==1&&(f=1):o!==-1&&(f=-1)}return o===-1||u===-1||f===0||f===1&&o===u-1&&o===l+1?u!==-1&&(l===0&&i?n.base=n.name=e.slice(1,u):n.base=n.name=e.slice(l,u)):(l===0&&i?(n.name=e.slice(1,o),n.base=e.slice(1,u)):(n.name=e.slice(l,o),n.base=e.slice(l,u)),n.ext=e.slice(o,u)),l>0?n.dir=e.slice(0,l-1):i&&(n.dir="/"),n},"parse"),sep:"/",delimiter:":",win32:null,posix:null};W.posix=W;var Gf=Object.defineProperty,vo=a((t,e)=>Gf(t,"name",{value:e,configurable:!0}),"a");const Jn=typeof window>"u"?typeof process>"u"?"other":"node":"browser",_o=Jn==="browser"?/windows/i.test(navigator.userAgent)?"windows":/mac/i.test(navigator.userAgent)?"mac":"other":Jn==="node"?process.platform==="win32"?"windows":process.platform==="darwin"?"mac":"other":"other";let li=0;const Hf=5e3;let Co=0;const Vf=100;async function ui(){if(_o==="mac"&&Jn==="node"){const{openApp:t}=await import("./index-UHZxbkBe.js");if(Co>=Vf){console.warn("Too many Anki App launch attempts this session, ignoring");return}(li===0||Date.now()-li>Hf)&&(console.warn("Attempting to launch Anki app"),li=Date.now(),Co++,await t("/Applications/Anki.app",{background:!0,newInstance:!1,wait:!1}))}else console.warn("Automatic Anki App launch is only supported on Mac OS in Node.js environment")}a(ui,"h"),vo(ui,"launchAnkiApp");const it={autoLaunch:!1,fetchAdapter:fetch.bind(globalThis),host:"http://127.0.0.1",key:void 0,port:8765,version:6};class pn{static{a(this,"f")}static{vo(this,"YankiConnect")}autoLaunch;fetchAdapter;host;key;port;version;card={answerCards:this.build("answerCards"),areDue:this.build("areDue"),areSuspended:this.build("areSuspended"),cardsInfo:this.build("cardsInfo"),cardsModTime:this.build("cardsModTime"),cardsToNotes:this.build("cardsToNotes"),findCards:this.build("findCards"),forgetCards:this.build("forgetCards"),getEaseFactors:this.build("getEaseFactors"),getIntervals:this.build("getIntervals"),relearnCards:this.build("relearnCards"),setEaseFactors:this.build("setEaseFactors"),setSpecificValueOfCard:this.build("setSpecificValueOfCard"),suspend:this.build("suspend"),suspended:this.build("suspended"),unsuspend:this.build("unsuspend")};deck={changeDeck:this.build("changeDeck"),cloneDeckConfigId:this.build("cloneDeckConfigId"),createDeck:this.build("createDeck"),deckNames:this.build("deckNames"),deckNamesAndIds:this.build("deckNamesAndIds"),deleteDecks:this.build("deleteDecks"),getDeckConfig:this.build("getDeckConfig"),getDeckStats:this.build("getDeckStats"),getDecks:this.build("getDecks"),removeDeckConfigId:this.build("removeDeckConfigId"),saveDeckConfig:this.build("saveDeckConfig"),setDeckConfigId:this.build("setDeckConfigId")};graphical={guiAddCards:this.build("guiAddCards"),guiAnswerCard:this.build("guiAnswerCard"),guiBrowse:this.build("guiBrowse"),guiCheckDatabase:this.build("guiCheckDatabase"),guiCurrentCard:this.build("guiCurrentCard"),guiDeckBrowser:this.build("guiDeckBrowser"),guiDeckOverview:this.build("guiDeckOverview"),guiDeckReview:this.build("guiDeckReview"),guiEditNote:this.build("guiEditNote"),guiExitAnki:this.build("guiExitAnki"),guiImportFile:this.build("guiImportFile"),guiSelectNote:this.build("guiSelectNote"),guiSelectedNotes:this.build("guiSelectedNotes"),guiShowAnswer:this.build("guiShowAnswer"),guiShowQuestion:this.build("guiShowQuestion"),guiStartCardTimer:this.build("guiStartCardTimer"),guiUndo:this.build("guiUndo")};media={deleteMediaFile:this.build("deleteMediaFile"),getMediaDirPath:this.build("getMediaDirPath"),getMediaFilesNames:this.build("getMediaFilesNames"),retrieveMediaFile:this.build("retrieveMediaFile"),storeMediaFile:this.build("storeMediaFile")};miscellaneous={apiReflect:this.build("apiReflect"),exportPackage:this.build("exportPackage"),getProfiles:this.build("getProfiles"),importPackage:this.build("importPackage"),loadProfile:this.build("loadProfile"),multi:this.build("multi"),reloadCollection:this.build("reloadCollection"),requestPermission:this.build("requestPermission"),sync:this.build("sync"),version:this.build("version")};model={createModel:this.build("createModel"),findAndReplaceInModels:this.build("findAndReplaceInModels"),findModelsById:this.build("findModelsById"),findModelsByName:this.build("findModelsByName"),modelFieldAdd:this.build("modelFieldAdd"),modelFieldDescriptions:this.build("modelFieldDescriptions"),modelFieldFonts:this.build("modelFieldFonts"),modelFieldNames:this.build("modelFieldNames"),modelFieldRemove:this.build("modelFieldRemove"),modelFieldRename:this.build("modelFieldRename"),modelFieldReposition:this.build("modelFieldReposition"),modelFieldSetDescription:this.build("modelFieldSetDescription"),modelFieldSetFont:this.build("modelFieldSetFont"),modelFieldSetFontSize:this.build("modelFieldSetFontSize"),modelFieldsOnTemplates:this.build("modelFieldsOnTemplates"),modelNames:this.build("modelNames"),modelNamesAndIds:this.build("modelNamesAndIds"),modelStyling:this.build("modelStyling"),modelTemplateAdd:this.build("modelTemplateAdd"),modelTemplateRemove:this.build("modelTemplateRemove"),modelTemplateRename:this.build("modelTemplateRename"),modelTemplateReposition:this.build("modelTemplateReposition"),modelTemplates:this.build("modelTemplates"),updateModelStyling:this.build("updateModelStyling"),updateModelTemplates:this.build("updateModelTemplates")};note={addNote:this.build("addNote"),addNotes:this.build("addNotes"),addTags:this.build("addTags"),canAddNotes:this.build("canAddNotes"),canAddNotesWithErrorDetail:this.build("canAddNotesWithErrorDetail"),clearUnusedTags:this.build("clearUnusedTags"),deleteNotes:this.build("deleteNotes"),findNotes:this.build("findNotes"),getNoteTags:this.build("getNoteTags"),getTags:this.build("getTags"),notesInfo:this.build("notesInfo"),removeEmptyNotes:this.build("removeEmptyNotes"),removeTags:this.build("removeTags"),replaceTags:this.build("replaceTags"),replaceTagsInAllNotes:this.build("replaceTagsInAllNotes"),updateNote:this.build("updateNote"),updateNoteFields:this.build("updateNoteFields"),updateNoteModel:this.build("updateNoteModel"),updateNoteTags:this.build("updateNoteTags")};statistic={cardReviews:this.build("cardReviews"),getCollectionStatsHTML:this.build("getCollectionStatsHTML"),getLatestReviewID:this.build("getLatestReviewID"),getNumCardsReviewedByDay:this.build("getNumCardsReviewedByDay"),getNumCardsReviewedToday:this.build("getNumCardsReviewedToday"),getReviewsOfCards:this.build("getReviewsOfCards"),insertReviews:this.build("insertReviews")};constructor(e){if(this.host=e?.host??it.host,this.port=e?.port??it.port,this.version=e?.version??it.version,this.key=e?.key??it.key,this.autoLaunch=e?.autoLaunch??it.autoLaunch,it.fetchAdapter===void 0)throw new Error("A fetch implementation is required");if(this.fetchAdapter=e?.fetchAdapter??it.fetchAdapter,(_o!=="mac"||Jn!=="node")&&this.autoLaunch!==!1&&(console.warn("The autoLaunch option is only supported in a Node environment on macOS"),this.autoLaunch=!1),this.version!==6)throw new Error("YankiConnect currently only supports Anki-Connect API version 6");this.autoLaunch==="immediately"&&ui()}build(e){return async n=>{const r=await this.invoke(e,n);if(r.error!==null)throw new Error(String(r.error));return r.result}}async invoke(e,n){let r,i;try{if(r=await this.fetchAdapter(`${this.host}:${this.port}`,{body:JSON.stringify({action:e,...this.key===void 0?{}:{key:this.key},params:n,version:this.version}),headers:{"Access-Control-Allow-Origin":"*","Content-Type":"application/json"},method:"POST",mode:"cors"}),r===void 0)throw new Error("Anki-Connect response is undefined");if(r.status!==200)throw new Error(`Anki-Connect response status is ${r.status}`);if(i=await r.json(),this.autoLaunch!==!1&&i.error==="collection is not available")throw new Error(i.error)}catch(s){if(this.autoLaunch!==!1)return console.warn("Can't connect to Anki app, retrying with auto-launch..."),await ui(),await new Promise(o=>{setTimeout(o,500)}),n===void 0?this.invoke(e):this.invoke(e,n);throw s}if(!("error"in i))throw new Error("response is missing required error field");if(!("result"in i))throw new Error("response is missing required result field");return i}}const ge={ankiConnectOptions:it,ankiWeb:!1,basePath:void 0,cwd:W.process_cwd,dryRun:!1,fetchAdapter:void 0,fileAdapter:void 0,manageFilenames:"off",maxFilenameLength:60,namespace:"Yanki",obsidianVault:void 0,syncMediaAssets:"local"};async function Ft(){if(ai==="node"){const t=await import("node:fs/promises");if(t===void 0)throw new Error("Issue loading file functions in Node environment");return{async readFile(e){return t.readFile(e,"utf8")},async readFileBuffer(e){return t.readFile(e)},async rename(e,n){await t.rename(e,n)},async stat(e){return t.stat(e)},async writeFile(e,n){await t.writeFile(e,n,"utf8")}}}throw new Error('The "readFile", "readFileBuffer", "rename" , "stat", and "writeFile" function implementations must be provided to the function when running in the browser')}a(Ft,"getDefaultFileAdapter");function dn(){return fetch.bind(globalThis)}a(dn,"getDefaultFetchAdapter");const Wf=a(t=>{const e=new DataView(t);let n="";for(let r=0;r<e.byteLength;r+=4)n+=e.getUint32(r).toString(16).padStart(8,"0");return n},"bufferToHex"),Kf=a(t=>async(e,{outputFormat:n="hex"}={})=>{typeof e=="string"&&(e=new globalThis.TextEncoder().encode(e));const r=await globalThis.crypto.subtle.digest(t,e);return n==="hex"?Wf(r):r},"create$3"),Yf=Kf("SHA-256");async function No(t,e,n=Bf){switch(n){case"content":{const r=await e.readFileBuffer(t);return(await Yf(r)).slice(0,16)}case"metadata":{const{mtimeMs:r,size:i}=await e.stat(t),s=`${r??""}${i??""}`;return s===""?No(t,e,"name"):Wn(s,16)}case"name":return Wn(t,16)}}a(No,"getFileContentHash");function Ao(t,e){const{basePath:n,cwd:r,obsidianMode:i=!0}=e,s=!(i&&n!==void 0&&!t.startsWith(".")),o=W.join(n??"",s?r??"":"",t);return W.normalize(o)}a(Ao,"resolveWithBasePath");function mn(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}a(mn,"escapeStringRegexp");const Jf=[["\xDF","ss"],["\u1E9E","Ss"],["\xE4","ae"],["\xC4","Ae"],["\xF6","oe"],["\xD6","Oe"],["\xFC","ue"],["\xDC","Ue"],["\xC0","A"],["\xC1","A"],["\xC2","A"],["\xC3","A"],["\xC4","Ae"],["\xC5","A"],["\xC6","AE"],["\xC7","C"],["\xC8","E"],["\xC9","E"],["\xCA","E"],["\xCB","E"],["\xCC","I"],["\xCD","I"],["\xCE","I"],["\xCF","I"],["\xD0","D"],["\xD1","N"],["\xD2","O"],["\xD3","O"],["\xD4","O"],["\xD5","O"],["\xD6","Oe"],["\u0150","O"],["\xD8","O"],["\xD9","U"],["\xDA","U"],["\xDB","U"],["\xDC","Ue"],["\u0170","U"],["\xDD","Y"],["\xDE","TH"],["\xDF","ss"],["\xE0","a"],["\xE1","a"],["\xE2","a"],["\xE3","a"],["\xE4","ae"],["\xE5","a"],["\xE6","ae"],["\xE7","c"],["\xE8","e"],["\xE9","e"],["\xEA","e"],["\xEB","e"],["\xEC","i"],["\xED","i"],["\xEE","i"],["\xEF","i"],["\xF0","d"],["\xF1","n"],["\xF2","o"],["\xF3","o"],["\xF4","o"],["\xF5","o"],["\xF6","oe"],["\u0151","o"],["\xF8","o"],["\xF9","u"],["\xFA","u"],["\xFB","u"],["\xFC","ue"],["\u0171","u"],["\xFD","y"],["\xFE","th"],["\xFF","y"],["\u1E9E","SS"],["\xE0","a"],["\xC0","A"],["\xE1","a"],["\xC1","A"],["\xE2","a"],["\xC2","A"],["\xE3","a"],["\xC3","A"],["\xE8","e"],["\xC8","E"],["\xE9","e"],["\xC9","E"],["\xEA","e"],["\xCA","E"],["\xEC","i"],["\xCC","I"],["\xED","i"],["\xCD","I"],["\xF2","o"],["\xD2","O"],["\xF3","o"],["\xD3","O"],["\xF4","o"],["\xD4","O"],["\xF5","o"],["\xD5","O"],["\xF9","u"],["\xD9","U"],["\xFA","u"],["\xDA","U"],["\xFD","y"],["\xDD","Y"],["\u0103","a"],["\u0102","A"],["\u0110","D"],["\u0111","d"],["\u0129","i"],["\u0128","I"],["\u0169","u"],["\u0168","U"],["\u01A1","o"],["\u01A0","O"],["\u01B0","u"],["\u01AF","U"],["\u1EA1","a"],["\u1EA0","A"],["\u1EA3","a"],["\u1EA2","A"],["\u1EA5","a"],["\u1EA4","A"],["\u1EA7","a"],["\u1EA6","A"],["\u1EA9","a"],["\u1EA8","A"],["\u1EAB","a"],["\u1EAA","A"],["\u1EAD","a"],["\u1EAC","A"],["\u1EAF","a"],["\u1EAE","A"],["\u1EB1","a"],["\u1EB0","A"],["\u1EB3","a"],["\u1EB2","A"],["\u1EB5","a"],["\u1EB4","A"],["\u1EB7","a"],["\u1EB6","A"],["\u1EB9","e"],["\u1EB8","E"],["\u1EBB","e"],["\u1EBA","E"],["\u1EBD","e"],["\u1EBC","E"],["\u1EBF","e"],["\u1EBE","E"],["\u1EC1","e"],["\u1EC0","E"],["\u1EC3","e"],["\u1EC2","E"],["\u1EC5","e"],["\u1EC4","E"],["\u1EC7","e"],["\u1EC6","E"],["\u1EC9","i"],["\u1EC8","I"],["\u1ECB","i"],["\u1ECA","I"],["\u1ECD","o"],["\u1ECC","O"],["\u1ECF","o"],["\u1ECE","O"],["\u1ED1","o"],["\u1ED0","O"],["\u1ED3","o"],["\u1ED2","O"],["\u1ED5","o"],["\u1ED4","O"],["\u1ED7","o"],["\u1ED6","O"],["\u1ED9","o"],["\u1ED8","O"],["\u1EDB","o"],["\u1EDA","O"],["\u1EDD","o"],["\u1EDC","O"],["\u1EDF","o"],["\u1EDE","O"],["\u1EE1","o"],["\u1EE0","O"],["\u1EE3","o"],["\u1EE2","O"],["\u1EE5","u"],["\u1EE4","U"],["\u1EE7","u"],["\u1EE6","U"],["\u1EE9","u"],["\u1EE8","U"],["\u1EEB","u"],["\u1EEA","U"],["\u1EED","u"],["\u1EEC","U"],["\u1EEF","u"],["\u1EEE","U"],["\u1EF1","u"],["\u1EF0","U"],["\u1EF3","y"],["\u1EF2","Y"],["\u1EF5","y"],["\u1EF4","Y"],["\u1EF7","y"],["\u1EF6","Y"],["\u1EF9","y"],["\u1EF8","Y"],["\u0621","e"],["\u0622","a"],["\u0623","a"],["\u0624","w"],["\u0625","i"],["\u0626","y"],["\u0627","a"],["\u0628","b"],["\u0629","t"],["\u062A","t"],["\u062B","th"],["\u062C","j"],["\u062D","h"],["\u062E","kh"],["\u062F","d"],["\u0630","dh"],["\u0631","r"],["\u0632","z"],["\u0633","s"],["\u0634","sh"],["\u0635","s"],["\u0636","d"],["\u0637","t"],["\u0638","z"],["\u0639","e"],["\u063A","gh"],["\u0640","_"],["\u0641","f"],["\u0642","q"],["\u0643","k"],["\u0644","l"],["\u0645","m"],["\u0646","n"],["\u0647","h"],["\u0648","w"],["\u0649","a"],["\u064A","y"],["\u064E\u200E","a"],["\u064F","u"],["\u0650\u200E","i"],["\u0660","0"],["\u0661","1"],["\u0662","2"],["\u0663","3"],["\u0664","4"],["\u0665","5"],["\u0666","6"],["\u0667","7"],["\u0668","8"],["\u0669","9"],["\u0686","ch"],["\u06A9","k"],["\u06AF","g"],["\u067E","p"],["\u0698","zh"],["\u06CC","y"],["\u06F0","0"],["\u06F1","1"],["\u06F2","2"],["\u06F3","3"],["\u06F4","4"],["\u06F5","5"],["\u06F6","6"],["\u06F7","7"],["\u06F8","8"],["\u06F9","9"],["\u067C","p"],["\u0681","z"],["\u0685","c"],["\u0689","d"],["\uFEAB","d"],["\uFEAD","r"],["\u0693","r"],["\uFEAF","z"],["\u0696","g"],["\u069A","x"],["\u06AB","g"],["\u06BC","n"],["\u06C0","e"],["\u06D0","e"],["\u06CD","ai"],["\u0679","t"],["\u0688","d"],["\u0691","r"],["\u06BA","n"],["\u06C1","h"],["\u06BE","h"],["\u06D2","e"],["\u0410","A"],["\u0430","a"],["\u0411","B"],["\u0431","b"],["\u0412","V"],["\u0432","v"],["\u0413","G"],["\u0433","g"],["\u0414","D"],["\u0434","d"],["\u044A\u0435","ye"],["\u042A\u0435","Ye"],["\u044A\u0415","yE"],["\u042A\u0415","YE"],["\u0415","E"],["\u0435","e"],["\u0401","Yo"],["\u0451","yo"],["\u0416","Zh"],["\u0436","zh"],["\u0417","Z"],["\u0437","z"],["\u0418","I"],["\u0438","i"],["\u044B\u0439","iy"],["\u042B\u0439","Iy"],["\u042B\u0419","IY"],["\u044B\u0419","iY"],["\u0419","Y"],["\u0439","y"],["\u041A","K"],["\u043A","k"],["\u041B","L"],["\u043B","l"],["\u041C","M"],["\u043C","m"],["\u041D","N"],["\u043D","n"],["\u041E","O"],["\u043E","o"],["\u041F","P"],["\u043F","p"],["\u0420","R"],["\u0440","r"],["\u0421","S"],["\u0441","s"],["\u0422","T"],["\u0442","t"],["\u0423","U"],["\u0443","u"],["\u0424","F"],["\u0444","f"],["\u0425","Kh"],["\u0445","kh"],["\u0426","Ts"],["\u0446","ts"],["\u0427","Ch"],["\u0447","ch"],["\u0428","Sh"],["\u0448","sh"],["\u0429","Sch"],["\u0449","sch"],["\u042A",""],["\u044A",""],["\u042B","Y"],["\u044B","y"],["\u042C",""],["\u044C",""],["\u042D","E"],["\u044D","e"],["\u042E","Yu"],["\u044E","yu"],["\u042F","Ya"],["\u044F","ya"],["\u0103","a"],["\u0102","A"],["\u0219","s"],["\u0218","S"],["\u021B","t"],["\u021A","T"],["\u0163","t"],["\u0162","T"],["\u015F","s"],["\u015E","S"],["\xE7","c"],["\xC7","C"],["\u011F","g"],["\u011E","G"],["\u0131","i"],["\u0130","I"],["\u0561","a"],["\u0531","A"],["\u0562","b"],["\u0532","B"],["\u0563","g"],["\u0533","G"],["\u0564","d"],["\u0534","D"],["\u0565","ye"],["\u0535","Ye"],["\u0566","z"],["\u0536","Z"],["\u0567","e"],["\u0537","E"],["\u0568","y"],["\u0538","Y"],["\u0569","t"],["\u0539","T"],["\u056A","zh"],["\u053A","Zh"],["\u056B","i"],["\u053B","I"],["\u056C","l"],["\u053C","L"],["\u056D","kh"],["\u053D","Kh"],["\u056E","ts"],["\u053E","Ts"],["\u056F","k"],["\u053F","K"],["\u0570","h"],["\u0540","H"],["\u0571","dz"],["\u0541","Dz"],["\u0572","gh"],["\u0542","Gh"],["\u0573","tch"],["\u0543","Tch"],["\u0574","m"],["\u0544","M"],["\u0575","y"],["\u0545","Y"],["\u0576","n"],["\u0546","N"],["\u0577","sh"],["\u0547","Sh"],["\u0578","vo"],["\u0548","Vo"],["\u0579","ch"],["\u0549","Ch"],["\u057A","p"],["\u054A","P"],["\u057B","j"],["\u054B","J"],["\u057C","r"],["\u054C","R"],["\u057D","s"],["\u054D","S"],["\u057E","v"],["\u054E","V"],["\u057F","t"],["\u054F","T"],["\u0580","r"],["\u0550","R"],["\u0581","c"],["\u0551","C"],["\u0578\u0582","u"],["\u0548\u0552","U"],["\u0548\u0582","U"],["\u0583","p"],["\u0553","P"],["\u0584","q"],["\u0554","Q"],["\u0585","o"],["\u0555","O"],["\u0586","f"],["\u0556","F"],["\u0587","yev"],["\u10D0","a"],["\u10D1","b"],["\u10D2","g"],["\u10D3","d"],["\u10D4","e"],["\u10D5","v"],["\u10D6","z"],["\u10D7","t"],["\u10D8","i"],["\u10D9","k"],["\u10DA","l"],["\u10DB","m"],["\u10DC","n"],["\u10DD","o"],["\u10DE","p"],["\u10DF","zh"],["\u10E0","r"],["\u10E1","s"],["\u10E2","t"],["\u10E3","u"],["\u10E4","ph"],["\u10E5","q"],["\u10E6","gh"],["\u10E7","k"],["\u10E8","sh"],["\u10E9","ch"],["\u10EA","ts"],["\u10EB","dz"],["\u10EC","ts"],["\u10ED","tch"],["\u10EE","kh"],["\u10EF","j"],["\u10F0","h"],["\u010D","c"],["\u010F","d"],["\u011B","e"],["\u0148","n"],["\u0159","r"],["\u0161","s"],["\u0165","t"],["\u016F","u"],["\u017E","z"],["\u010C","C"],["\u010E","D"],["\u011A","E"],["\u0147","N"],["\u0158","R"],["\u0160","S"],["\u0164","T"],["\u016E","U"],["\u017D","Z"],["\u0780","h"],["\u0781","sh"],["\u0782","n"],["\u0783","r"],["\u0784","b"],["\u0785","lh"],["\u0786","k"],["\u0787","a"],["\u0788","v"],["\u0789","m"],["\u078A","f"],["\u078B","dh"],["\u078C","th"],["\u078D","l"],["\u078E","g"],["\u078F","gn"],["\u0790","s"],["\u0791","d"],["\u0792","z"],["\u0793","t"],["\u0794","y"],["\u0795","p"],["\u0796","j"],["\u0797","ch"],["\u0798","tt"],["\u0799","hh"],["\u079A","kh"],["\u079B","th"],["\u079C","z"],["\u079D","sh"],["\u079E","s"],["\u079F","d"],["\u07A0","t"],["\u07A1","z"],["\u07A2","a"],["\u07A3","gh"],["\u07A4","q"],["\u07A5","w"],["\u07A6","a"],["\u07A7","aa"],["\u07A8","i"],["\u07A9","ee"],["\u07AA","u"],["\u07AB","oo"],["\u07AC","e"],["\u07AD","ey"],["\u07AE","o"],["\u07AF","oa"],["\u07B0",""],["\u03B1","a"],["\u03B2","v"],["\u03B3","g"],["\u03B4","d"],["\u03B5","e"],["\u03B6","z"],["\u03B7","i"],["\u03B8","th"],["\u03B9","i"],["\u03BA","k"],["\u03BB","l"],["\u03BC","m"],["\u03BD","n"],["\u03BE","ks"],["\u03BF","o"],["\u03C0","p"],["\u03C1","r"],["\u03C3","s"],["\u03C4","t"],["\u03C5","y"],["\u03C6","f"],["\u03C7","x"],["\u03C8","ps"],["\u03C9","o"],["\u03AC","a"],["\u03AD","e"],["\u03AF","i"],["\u03CC","o"],["\u03CD","y"],["\u03AE","i"],["\u03CE","o"],["\u03C2","s"],["\u03CA","i"],["\u03B0","y"],["\u03CB","y"],["\u0390","i"],["\u0391","A"],["\u0392","B"],["\u0393","G"],["\u0394","D"],["\u0395","E"],["\u0396","Z"],["\u0397","I"],["\u0398","TH"],["\u0399","I"],["\u039A","K"],["\u039B","L"],["\u039C","M"],["\u039D","N"],["\u039E","KS"],["\u039F","O"],["\u03A0","P"],["\u03A1","R"],["\u03A3","S"],["\u03A4","T"],["\u03A5","Y"],["\u03A6","F"],["\u03A7","X"],["\u03A8","PS"],["\u03A9","O"],["\u0386","A"],["\u0388","E"],["\u038A","I"],["\u038C","O"],["\u038E","Y"],["\u0389","I"],["\u038F","O"],["\u03AA","I"],["\u03AB","Y"],["\u0101","a"],["\u0113","e"],["\u0123","g"],["\u012B","i"],["\u0137","k"],["\u013C","l"],["\u0146","n"],["\u016B","u"],["\u0100","A"],["\u0112","E"],["\u0122","G"],["\u012A","I"],["\u0136","K"],["\u013B","L"],["\u0145","N"],["\u016A","U"],["\u010D","c"],["\u0161","s"],["\u017E","z"],["\u010C","C"],["\u0160","S"],["\u017D","Z"],["\u0105","a"],["\u010D","c"],["\u0119","e"],["\u0117","e"],["\u012F","i"],["\u0161","s"],["\u0173","u"],["\u016B","u"],["\u017E","z"],["\u0104","A"],["\u010C","C"],["\u0118","E"],["\u0116","E"],["\u012E","I"],["\u0160","S"],["\u0172","U"],["\u016A","U"],["\u040C","Kj"],["\u045C","kj"],["\u0409","Lj"],["\u0459","lj"],["\u040A","Nj"],["\u045A","nj"],["\u0422\u0441","Ts"],["\u0442\u0441","ts"],["\u0105","a"],["\u0107","c"],["\u0119","e"],["\u0142","l"],["\u0144","n"],["\u015B","s"],["\u017A","z"],["\u017C","z"],["\u0104","A"],["\u0106","C"],["\u0118","E"],["\u0141","L"],["\u0143","N"],["\u015A","S"],["\u0179","Z"],["\u017B","Z"],["\u0404","Ye"],["\u0406","I"],["\u0407","Yi"],["\u0490","G"],["\u0454","ye"],["\u0456","i"],["\u0457","yi"],["\u0491","g"],["\u0132","IJ"],["\u0133","ij"],["\xA2","c"],["\xA5","Y"],["\u07FF","b"],["\u09F3","t"],["\u0AF1","Bo"],["\u0E3F","B"],["\u20A0","CE"],["\u20A1","C"],["\u20A2","Cr"],["\u20A3","F"],["\u20A5","m"],["\u20A6","N"],["\u20A7","Pt"],["\u20A8","Rs"],["\u20A9","W"],["\u20AB","s"],["\u20AC","E"],["\u20AD","K"],["\u20AE","T"],["\u20AF","Dp"],["\u20B0","S"],["\u20B1","P"],["\u20B2","G"],["\u20B3","A"],["\u20B4","S"],["\u20B5","C"],["\u20B6","tt"],["\u20B7","S"],["\u20B8","T"],["\u20B9","R"],["\u20BA","L"],["\u20BD","P"],["\u20BF","B"],["\uFE69","$"],["\uFFE0","c"],["\uFFE5","Y"],["\uFFE6","W"],["\u{1D400}","A"],["\u{1D401}","B"],["\u{1D402}","C"],["\u{1D403}","D"],["\u{1D404}","E"],["\u{1D405}","F"],["\u{1D406}","G"],["\u{1D407}","H"],["\u{1D408}","I"],["\u{1D409}","J"],["\u{1D40A}","K"],["\u{1D40B}","L"],["\u{1D40C}","M"],["\u{1D40D}","N"],["\u{1D40E}","O"],["\u{1D40F}","P"],["\u{1D410}","Q"],["\u{1D411}","R"],["\u{1D412}","S"],["\u{1D413}","T"],["\u{1D414}","U"],["\u{1D415}","V"],["\u{1D416}","W"],["\u{1D417}","X"],["\u{1D418}","Y"],["\u{1D419}","Z"],["\u{1D41A}","a"],["\u{1D41B}","b"],["\u{1D41C}","c"],["\u{1D41D}","d"],["\u{1D41E}","e"],["\u{1D41F}","f"],["\u{1D420}","g"],["\u{1D421}","h"],["\u{1D422}","i"],["\u{1D423}","j"],["\u{1D424}","k"],["\u{1D425}","l"],["\u{1D426}","m"],["\u{1D427}","n"],["\u{1D428}","o"],["\u{1D429}","p"],["\u{1D42A}","q"],["\u{1D42B}","r"],["\u{1D42C}","s"],["\u{1D42D}","t"],["\u{1D42E}","u"],["\u{1D42F}","v"],["\u{1D430}","w"],["\u{1D431}","x"],["\u{1D432}","y"],["\u{1D433}","z"],["\u{1D434}","A"],["\u{1D435}","B"],["\u{1D436}","C"],["\u{1D437}","D"],["\u{1D438}","E"],["\u{1D439}","F"],["\u{1D43A}","G"],["\u{1D43B}","H"],["\u{1D43C}","I"],["\u{1D43D}","J"],["\u{1D43E}","K"],["\u{1D43F}","L"],["\u{1D440}","M"],["\u{1D441}","N"],["\u{1D442}","O"],["\u{1D443}","P"],["\u{1D444}","Q"],["\u{1D445}","R"],["\u{1D446}","S"],["\u{1D447}","T"],["\u{1D448}","U"],["\u{1D449}","V"],["\u{1D44A}","W"],["\u{1D44B}","X"],["\u{1D44C}","Y"],["\u{1D44D}","Z"],["\u{1D44E}","a"],["\u{1D44F}","b"],["\u{1D450}","c"],["\u{1D451}","d"],["\u{1D452}","e"],["\u{1D453}","f"],["\u{1D454}","g"],["\u{1D456}","i"],["\u{1D457}","j"],["\u{1D458}","k"],["\u{1D459}","l"],["\u{1D45A}","m"],["\u{1D45B}","n"],["\u{1D45C}","o"],["\u{1D45D}","p"],["\u{1D45E}","q"],["\u{1D45F}","r"],["\u{1D460}","s"],["\u{1D461}","t"],["\u{1D462}","u"],["\u{1D463}","v"],["\u{1D464}","w"],["\u{1D465}","x"],["\u{1D466}","y"],["\u{1D467}","z"],["\u{1D468}","A"],["\u{1D469}","B"],["\u{1D46A}","C"],["\u{1D46B}","D"],["\u{1D46C}","E"],["\u{1D46D}","F"],["\u{1D46E}","G"],["\u{1D46F}","H"],["\u{1D470}","I"],["\u{1D471}","J"],["\u{1D472}","K"],["\u{1D473}","L"],["\u{1D474}","M"],["\u{1D475}","N"],["\u{1D476}","O"],["\u{1D477}","P"],["\u{1D478}","Q"],["\u{1D479}","R"],["\u{1D47A}","S"],["\u{1D47B}","T"],["\u{1D47C}","U"],["\u{1D47D}","V"],["\u{1D47E}","W"],["\u{1D47F}","X"],["\u{1D480}","Y"],["\u{1D481}","Z"],["\u{1D482}","a"],["\u{1D483}","b"],["\u{1D484}","c"],["\u{1D485}","d"],["\u{1D486}","e"],["\u{1D487}","f"],["\u{1D488}","g"],["\u{1D489}","h"],["\u{1D48A}","i"],["\u{1D48B}","j"],["\u{1D48C}","k"],["\u{1D48D}","l"],["\u{1D48E}","m"],["\u{1D48F}","n"],["\u{1D490}","o"],["\u{1D491}","p"],["\u{1D492}","q"],["\u{1D493}","r"],["\u{1D494}","s"],["\u{1D495}","t"],["\u{1D496}","u"],["\u{1D497}","v"],["\u{1D498}","w"],["\u{1D499}","x"],["\u{1D49A}","y"],["\u{1D49B}","z"],["\u{1D49C}","A"],["\u{1D49E}","C"],["\u{1D49F}","D"],["\u{1D4A2}","g"],["\u{1D4A5}","J"],["\u{1D4A6}","K"],["\u{1D4A9}","N"],["\u{1D4AA}","O"],["\u{1D4AB}","P"],["\u{1D4AC}","Q"],["\u{1D4AE}","S"],["\u{1D4AF}","T"],["\u{1D4B0}","U"],["\u{1D4B1}","V"],["\u{1D4B2}","W"],["\u{1D4B3}","X"],["\u{1D4B4}","Y"],["\u{1D4B5}","Z"],["\u{1D4B6}","a"],["\u{1D4B7}","b"],["\u{1D4B8}","c"],["\u{1D4B9}","d"],["\u{1D4BB}","f"],["\u{1D4BD}","h"],["\u{1D4BE}","i"],["\u{1D4BF}","j"],["\u{1D4C0}","h"],["\u{1D4C1}","l"],["\u{1D4C2}","m"],["\u{1D4C3}","n"],["\u{1D4C5}","p"],["\u{1D4C6}","q"],["\u{1D4C7}","r"],["\u{1D4C8}","s"],["\u{1D4C9}","t"],["\u{1D4CA}","u"],["\u{1D4CB}","v"],["\u{1D4CC}","w"],["\u{1D4CD}","x"],["\u{1D4CE}","y"],["\u{1D4CF}","z"],["\u{1D4D0}","A"],["\u{1D4D1}","B"],["\u{1D4D2}","C"],["\u{1D4D3}","D"],["\u{1D4D4}","E"],["\u{1D4D5}","F"],["\u{1D4D6}","G"],["\u{1D4D7}","H"],["\u{1D4D8}","I"],["\u{1D4D9}","J"],["\u{1D4DA}","K"],["\u{1D4DB}","L"],["\u{1D4DC}","M"],["\u{1D4DD}","N"],["\u{1D4DE}","O"],["\u{1D4DF}","P"],["\u{1D4E0}","Q"],["\u{1D4E1}","R"],["\u{1D4E2}","S"],["\u{1D4E3}","T"],["\u{1D4E4}","U"],["\u{1D4E5}","V"],["\u{1D4E6}","W"],["\u{1D4E7}","X"],["\u{1D4E8}","Y"],["\u{1D4E9}","Z"],["\u{1D4EA}","a"],["\u{1D4EB}","b"],["\u{1D4EC}","c"],["\u{1D4ED}","d"],["\u{1D4EE}","e"],["\u{1D4EF}","f"],["\u{1D4F0}","g"],["\u{1D4F1}","h"],["\u{1D4F2}","i"],["\u{1D4F3}","j"],["\u{1D4F4}","k"],["\u{1D4F5}","l"],["\u{1D4F6}","m"],["\u{1D4F7}","n"],["\u{1D4F8}","o"],["\u{1D4F9}","p"],["\u{1D4FA}","q"],["\u{1D4FB}","r"],["\u{1D4FC}","s"],["\u{1D4FD}","t"],["\u{1D4FE}","u"],["\u{1D4FF}","v"],["\u{1D500}","w"],["\u{1D501}","x"],["\u{1D502}","y"],["\u{1D503}","z"],["\u{1D504}","A"],["\u{1D505}","B"],["\u{1D507}","D"],["\u{1D508}","E"],["\u{1D509}","F"],["\u{1D50A}","G"],["\u{1D50D}","J"],["\u{1D50E}","K"],["\u{1D50F}","L"],["\u{1D510}","M"],["\u{1D511}","N"],["\u{1D512}","O"],["\u{1D513}","P"],["\u{1D514}","Q"],["\u{1D516}","S"],["\u{1D517}","T"],["\u{1D518}","U"],["\u{1D519}","V"],["\u{1D51A}","W"],["\u{1D51B}","X"],["\u{1D51C}","Y"],["\u{1D51E}","a"],["\u{1D51F}","b"],["\u{1D520}","c"],["\u{1D521}","d"],["\u{1D522}","e"],["\u{1D523}","f"],["\u{1D524}","g"],["\u{1D525}","h"],["\u{1D526}","i"],["\u{1D527}","j"],["\u{1D528}","k"],["\u{1D529}","l"],["\u{1D52A}","m"],["\u{1D52B}","n"],["\u{1D52C}","o"],["\u{1D52D}","p"],["\u{1D52E}","q"],["\u{1D52F}","r"],["\u{1D530}","s"],["\u{1D531}","t"],["\u{1D532}","u"],["\u{1D533}","v"],["\u{1D534}","w"],["\u{1D535}","x"],["\u{1D536}","y"],["\u{1D537}","z"],["\u{1D538}","A"],["\u{1D539}","B"],["\u{1D53B}","D"],["\u{1D53C}","E"],["\u{1D53D}","F"],["\u{1D53E}","G"],["\u{1D540}","I"],["\u{1D541}","J"],["\u{1D542}","K"],["\u{1D543}","L"],["\u{1D544}","M"],["\u{1D546}","N"],["\u{1D54A}","S"],["\u{1D54B}","T"],["\u{1D54C}","U"],["\u{1D54D}","V"],["\u{1D54E}","W"],["\u{1D54F}","X"],["\u{1D550}","Y"],["\u{1D552}","a"],["\u{1D553}","b"],["\u{1D554}","c"],["\u{1D555}","d"],["\u{1D556}","e"],["\u{1D557}","f"],["\u{1D558}","g"],["\u{1D559}","h"],["\u{1D55A}","i"],["\u{1D55B}","j"],["\u{1D55C}","k"],["\u{1D55D}","l"],["\u{1D55E}","m"],["\u{1D55F}","n"],["\u{1D560}","o"],["\u{1D561}","p"],["\u{1D562}","q"],["\u{1D563}","r"],["\u{1D564}","s"],["\u{1D565}","t"],["\u{1D566}","u"],["\u{1D567}","v"],["\u{1D568}","w"],["\u{1D569}","x"],["\u{1D56A}","y"],["\u{1D56B}","z"],["\u{1D56C}","A"],["\u{1D56D}","B"],["\u{1D56E}","C"],["\u{1D56F}","D"],["\u{1D570}","E"],["\u{1D571}","F"],["\u{1D572}","G"],["\u{1D573}","H"],["\u{1D574}","I"],["\u{1D575}","J"],["\u{1D576}","K"],["\u{1D577}","L"],["\u{1D578}","M"],["\u{1D579}","N"],["\u{1D57A}","O"],["\u{1D57B}","P"],["\u{1D57C}","Q"],["\u{1D57D}","R"],["\u{1D57E}","S"],["\u{1D57F}","T"],["\u{1D580}","U"],["\u{1D581}","V"],["\u{1D582}","W"],["\u{1D583}","X"],["\u{1D584}","Y"],["\u{1D585}","Z"],["\u{1D586}","a"],["\u{1D587}","b"],["\u{1D588}","c"],["\u{1D589}","d"],["\u{1D58A}","e"],["\u{1D58B}","f"],["\u{1D58C}","g"],["\u{1D58D}","h"],["\u{1D58E}","i"],["\u{1D58F}","j"],["\u{1D590}","k"],["\u{1D591}","l"],["\u{1D592}","m"],["\u{1D593}","n"],["\u{1D594}","o"],["\u{1D595}","p"],["\u{1D596}","q"],["\u{1D597}","r"],["\u{1D598}","s"],["\u{1D599}","t"],["\u{1D59A}","u"],["\u{1D59B}","v"],["\u{1D59C}","w"],["\u{1D59D}","x"],["\u{1D59E}","y"],["\u{1D59F}","z"],["\u{1D5A0}","A"],["\u{1D5A1}","B"],["\u{1D5A2}","C"],["\u{1D5A3}","D"],["\u{1D5A4}","E"],["\u{1D5A5}","F"],["\u{1D5A6}","G"],["\u{1D5A7}","H"],["\u{1D5A8}","I"],["\u{1D5A9}","J"],["\u{1D5AA}","K"],["\u{1D5AB}","L"],["\u{1D5AC}","M"],["\u{1D5AD}","N"],["\u{1D5AE}","O"],["\u{1D5AF}","P"],["\u{1D5B0}","Q"],["\u{1D5B1}","R"],["\u{1D5B2}","S"],["\u{1D5B3}","T"],["\u{1D5B4}","U"],["\u{1D5B5}","V"],["\u{1D5B6}","W"],["\u{1D5B7}","X"],["\u{1D5B8}","Y"],["\u{1D5B9}","Z"],["\u{1D5BA}","a"],["\u{1D5BB}","b"],["\u{1D5BC}","c"],["\u{1D5BD}","d"],["\u{1D5BE}","e"],["\u{1D5BF}","f"],["\u{1D5C0}","g"],["\u{1D5C1}","h"],["\u{1D5C2}","i"],["\u{1D5C3}","j"],["\u{1D5C4}","k"],["\u{1D5C5}","l"],["\u{1D5C6}","m"],["\u{1D5C7}","n"],["\u{1D5C8}","o"],["\u{1D5C9}","p"],["\u{1D5CA}","q"],["\u{1D5CB}","r"],["\u{1D5CC}","s"],["\u{1D5CD}","t"],["\u{1D5CE}","u"],["\u{1D5CF}","v"],["\u{1D5D0}","w"],["\u{1D5D1}","x"],["\u{1D5D2}","y"],["\u{1D5D3}","z"],["\u{1D5D4}","A"],["\u{1D5D5}","B"],["\u{1D5D6}","C"],["\u{1D5D7}","D"],["\u{1D5D8}","E"],["\u{1D5D9}","F"],["\u{1D5DA}","G"],["\u{1D5DB}","H"],["\u{1D5DC}","I"],["\u{1D5DD}","J"],["\u{1D5DE}","K"],["\u{1D5DF}","L"],["\u{1D5E0}","M"],["\u{1D5E1}","N"],["\u{1D5E2}","O"],["\u{1D5E3}","P"],["\u{1D5E4}","Q"],["\u{1D5E5}","R"],["\u{1D5E6}","S"],["\u{1D5E7}","T"],["\u{1D5E8}","U"],["\u{1D5E9}","V"],["\u{1D5EA}","W"],["\u{1D5EB}","X"],["\u{1D5EC}","Y"],["\u{1D5ED}","Z"],["\u{1D5EE}","a"],["\u{1D5EF}","b"],["\u{1D5F0}","c"],["\u{1D5F1}","d"],["\u{1D5F2}","e"],["\u{1D5F3}","f"],["\u{1D5F4}","g"],["\u{1D5F5}","h"],["\u{1D5F6}","i"],["\u{1D5F7}","j"],["\u{1D5F8}","k"],["\u{1D5F9}","l"],["\u{1D5FA}","m"],["\u{1D5FB}","n"],["\u{1D5FC}","o"],["\u{1D5FD}","p"],["\u{1D5FE}","q"],["\u{1D5FF}","r"],["\u{1D600}","s"],["\u{1D601}","t"],["\u{1D602}","u"],["\u{1D603}","v"],["\u{1D604}","w"],["\u{1D605}","x"],["\u{1D606}","y"],["\u{1D607}","z"],["\u{1D608}","A"],["\u{1D609}","B"],["\u{1D60A}","C"],["\u{1D60B}","D"],["\u{1D60C}","E"],["\u{1D60D}","F"],["\u{1D60E}","G"],["\u{1D60F}","H"],["\u{1D610}","I"],["\u{1D611}","J"],["\u{1D612}","K"],["\u{1D613}","L"],["\u{1D614}","M"],["\u{1D615}","N"],["\u{1D616}","O"],["\u{1D617}","P"],["\u{1D618}","Q"],["\u{1D619}","R"],["\u{1D61A}","S"],["\u{1D61B}","T"],["\u{1D61C}","U"],["\u{1D61D}","V"],["\u{1D61E}","W"],["\u{1D61F}","X"],["\u{1D620}","Y"],["\u{1D621}","Z"],["\u{1D622}","a"],["\u{1D623}","b"],["\u{1D624}","c"],["\u{1D625}","d"],["\u{1D626}","e"],["\u{1D627}","f"],["\u{1D628}","g"],["\u{1D629}","h"],["\u{1D62A}","i"],["\u{1D62B}","j"],["\u{1D62C}","k"],["\u{1D62D}","l"],["\u{1D62E}","m"],["\u{1D62F}","n"],["\u{1D630}","o"],["\u{1D631}","p"],["\u{1D632}","q"],["\u{1D633}","r"],["\u{1D634}","s"],["\u{1D635}","t"],["\u{1D636}","u"],["\u{1D637}","v"],["\u{1D638}","w"],["\u{1D639}","x"],["\u{1D63A}","y"],["\u{1D63B}","z"],["\u{1D63C}","A"],["\u{1D63D}","B"],["\u{1D63E}","C"],["\u{1D63F}","D"],["\u{1D640}","E"],["\u{1D641}","F"],["\u{1D642}","G"],["\u{1D643}","H"],["\u{1D644}","I"],["\u{1D645}","J"],["\u{1D646}","K"],["\u{1D647}","L"],["\u{1D648}","M"],["\u{1D649}","N"],["\u{1D64A}","O"],["\u{1D64B}","P"],["\u{1D64C}","Q"],["\u{1D64D}","R"],["\u{1D64E}","S"],["\u{1D64F}","T"],["\u{1D650}","U"],["\u{1D651}","V"],["\u{1D652}","W"],["\u{1D653}","X"],["\u{1D654}","Y"],["\u{1D655}","Z"],["\u{1D656}","a"],["\u{1D657}","b"],["\u{1D658}","c"],["\u{1D659}","d"],["\u{1D65A}","e"],["\u{1D65B}","f"],["\u{1D65C}","g"],["\u{1D65D}","h"],["\u{1D65E}","i"],["\u{1D65F}","j"],["\u{1D660}","k"],["\u{1D661}","l"],["\u{1D662}","m"],["\u{1D663}","n"],["\u{1D664}","o"],["\u{1D665}","p"],["\u{1D666}","q"],["\u{1D667}","r"],["\u{1D668}","s"],["\u{1D669}","t"],["\u{1D66A}","u"],["\u{1D66B}","v"],["\u{1D66C}","w"],["\u{1D66D}","x"],["\u{1D66E}","y"],["\u{1D66F}","z"],["\u{1D670}","A"],["\u{1D671}","B"],["\u{1D672}","C"],["\u{1D673}","D"],["\u{1D674}","E"],["\u{1D675}","F"],["\u{1D676}","G"],["\u{1D677}","H"],["\u{1D678}","I"],["\u{1D679}","J"],["\u{1D67A}","K"],["\u{1D67B}","L"],["\u{1D67C}","M"],["\u{1D67D}","N"],["\u{1D67E}","O"],["\u{1D67F}","P"],["\u{1D680}","Q"],["\u{1D681}","R"],["\u{1D682}","S"],["\u{1D683}","T"],["\u{1D684}","U"],["\u{1D685}","V"],["\u{1D686}","W"],["\u{1D687}","X"],["\u{1D688}","Y"],["\u{1D689}","Z"],["\u{1D68A}","a"],["\u{1D68B}","b"],["\u{1D68C}","c"],["\u{1D68D}","d"],["\u{1D68E}","e"],["\u{1D68F}","f"],["\u{1D690}","g"],["\u{1D691}","h"],["\u{1D692}","i"],["\u{1D693}","j"],["\u{1D694}","k"],["\u{1D695}","l"],["\u{1D696}","m"],["\u{1D697}","n"],["\u{1D698}","o"],["\u{1D699}","p"],["\u{1D69A}","q"],["\u{1D69B}","r"],["\u{1D69C}","s"],["\u{1D69D}","t"],["\u{1D69E}","u"],["\u{1D69F}","v"],["\u{1D6A0}","w"],["\u{1D6A1}","x"],["\u{1D6A2}","y"],["\u{1D6A3}","z"],["\u{1D6A4}","l"],["\u{1D6A5}","j"],["\u{1D6E2}","A"],["\u{1D6E3}","B"],["\u{1D6E4}","G"],["\u{1D6E5}","D"],["\u{1D6E6}","E"],["\u{1D6E7}","Z"],["\u{1D6E8}","I"],["\u{1D6E9}","TH"],["\u{1D6EA}","I"],["\u{1D6EB}","K"],["\u{1D6EC}","L"],["\u{1D6ED}","M"],["\u{1D6EE}","N"],["\u{1D6EF}","KS"],["\u{1D6F0}","O"],["\u{1D6F1}","P"],["\u{1D6F2}","R"],["\u{1D6F3}","TH"],["\u{1D6F4}","S"],["\u{1D6F5}","T"],["\u{1D6F6}","Y"],["\u{1D6F7}","F"],["\u{1D6F8}","x"],["\u{1D6F9}","PS"],["\u{1D6FA}","O"],["\u{1D6FB}","D"],["\u{1D6FC}","a"],["\u{1D6FD}","b"],["\u{1D6FE}","g"],["\u{1D6FF}","d"],["\u{1D700}","e"],["\u{1D701}","z"],["\u{1D702}","i"],["\u{1D703}","th"],["\u{1D704}","i"],["\u{1D705}","k"],["\u{1D706}","l"],["\u{1D707}","m"],["\u{1D708}","n"],["\u{1D709}","ks"],["\u{1D70A}","o"],["\u{1D70B}","p"],["\u{1D70C}","r"],["\u{1D70D}","s"],["\u{1D70E}","s"],["\u{1D70F}","t"],["\u{1D710}","y"],["\u{1D711}","f"],["\u{1D712}","x"],["\u{1D713}","ps"],["\u{1D714}","o"],["\u{1D715}","d"],["\u{1D716}","E"],["\u{1D717}","TH"],["\u{1D718}","K"],["\u{1D719}","f"],["\u{1D71A}","r"],["\u{1D71B}","p"],["\u{1D71C}","A"],["\u{1D71D}","V"],["\u{1D71E}","G"],["\u{1D71F}","D"],["\u{1D720}","E"],["\u{1D721}","Z"],["\u{1D722}","I"],["\u{1D723}","TH"],["\u{1D724}","I"],["\u{1D725}","K"],["\u{1D726}","L"],["\u{1D727}","M"],["\u{1D728}","N"],["\u{1D729}","KS"],["\u{1D72A}","O"],["\u{1D72B}","P"],["\u{1D72C}","S"],["\u{1D72D}","TH"],["\u{1D72E}","S"],["\u{1D72F}","T"],["\u{1D730}","Y"],["\u{1D731}","F"],["\u{1D732}","X"],["\u{1D733}","PS"],["\u{1D734}","O"],["\u{1D735}","D"],["\u{1D736}","a"],["\u{1D737}","v"],["\u{1D738}","g"],["\u{1D739}","d"],["\u{1D73A}","e"],["\u{1D73B}","z"],["\u{1D73C}","i"],["\u{1D73D}","th"],["\u{1D73E}","i"],["\u{1D73F}","k"],["\u{1D740}","l"],["\u{1D741}","m"],["\u{1D742}","n"],["\u{1D743}","ks"],["\u{1D744}","o"],["\u{1D745}","p"],["\u{1D746}","r"],["\u{1D747}","s"],["\u{1D748}","s"],["\u{1D749}","t"],["\u{1D74A}","y"],["\u{1D74B}","f"],["\u{1D74C}","x"],["\u{1D74D}","ps"],["\u{1D74E}","o"],["\u{1D74F}","a"],["\u{1D750}","e"],["\u{1D751}","i"],["\u{1D752}","k"],["\u{1D753}","f"],["\u{1D754}","r"],["\u{1D755}","p"],["\u{1D756}","A"],["\u{1D757}","B"],["\u{1D758}","G"],["\u{1D759}","D"],["\u{1D75A}","E"],["\u{1D75B}","Z"],["\u{1D75C}","I"],["\u{1D75D}","TH"],["\u{1D75E}","I"],["\u{1D75F}","K"],["\u{1D760}","L"],["\u{1D761}","M"],["\u{1D762}","N"],["\u{1D763}","KS"],["\u{1D764}","O"],["\u{1D765}","P"],["\u{1D766}","R"],["\u{1D767}","TH"],["\u{1D768}","S"],["\u{1D769}","T"],["\u{1D76A}","Y"],["\u{1D76B}","F"],["\u{1D76C}","X"],["\u{1D76D}","PS"],["\u{1D76E}","O"],["\u{1D76F}","D"],["\u{1D770}","a"],["\u{1D771}","v"],["\u{1D772}","g"],["\u{1D773}","d"],["\u{1D774}","e"],["\u{1D775}","z"],["\u{1D776}","i"],["\u{1D777}","th"],["\u{1D778}","i"],["\u{1D779}","k"],["\u{1D77A}","l"],["\u{1D77B}","m"],["\u{1D77C}","n"],["\u{1D77D}","ks"],["\u{1D77E}","o"],["\u{1D77F}","p"],["\u{1D780}","r"],["\u{1D781}","s"],["\u{1D782}","s"],["\u{1D783}","t"],["\u{1D784}","y"],["\u{1D785}","f"],["\u{1D786}","x"],["\u{1D787}","ps"],["\u{1D788}","o"],["\u{1D789}","a"],["\u{1D78A}","e"],["\u{1D78B}","i"],["\u{1D78C}","k"],["\u{1D78D}","f"],["\u{1D78E}","r"],["\u{1D78F}","p"],["\u{1D790}","A"],["\u{1D791}","V"],["\u{1D792}","G"],["\u{1D793}","D"],["\u{1D794}","E"],["\u{1D795}","Z"],["\u{1D796}","I"],["\u{1D797}","TH"],["\u{1D798}","I"],["\u{1D799}","K"],["\u{1D79A}","L"],["\u{1D79B}","M"],["\u{1D79C}","N"],["\u{1D79D}","KS"],["\u{1D79E}","O"],["\u{1D79F}","P"],["\u{1D7A0}","S"],["\u{1D7A1}","TH"],["\u{1D7A2}","S"],["\u{1D7A3}","T"],["\u{1D7A4}","Y"],["\u{1D7A5}","F"],["\u{1D7A6}","X"],["\u{1D7A7}","PS"],["\u{1D7A8}","O"],["\u{1D7A9}","D"],["\u{1D7AA}","av"],["\u{1D7AB}","g"],["\u{1D7AC}","d"],["\u{1D7AD}","e"],["\u{1D7AE}","z"],["\u{1D7AF}","i"],["\u{1D7B0}","i"],["\u{1D7B1}","th"],["\u{1D7B2}","i"],["\u{1D7B3}","k"],["\u{1D7B4}","l"],["\u{1D7B5}","m"],["\u{1D7B6}","n"],["\u{1D7B7}","ks"],["\u{1D7B8}","o"],["\u{1D7B9}","p"],["\u{1D7BA}","r"],["\u{1D7BB}","s"],["\u{1D7BC}","s"],["\u{1D7BD}","t"],["\u{1D7BE}","y"],["\u{1D7BF}","f"],["\u{1D7C0}","x"],["\u{1D7C1}","ps"],["\u{1D7C2}","o"],["\u{1D7C3}","a"],["\u{1D7C4}","e"],["\u{1D7C5}","i"],["\u{1D7C6}","k"],["\u{1D7C7}","f"],["\u{1D7C8}","r"],["\u{1D7C9}","p"],["\u{1D7CA}","F"],["\u{1D7CB}","f"],["\u249C","(a)"],["\u249D","(b)"],["\u249E","(c)"],["\u249F","(d)"],["\u24A0","(e)"],["\u24A1","(f)"],["\u24A2","(g)"],["\u24A3","(h)"],["\u24A4","(i)"],["\u24A5","(j)"],["\u24A6","(k)"],["\u24A7","(l)"],["\u24A8","(m)"],["\u24A9","(n)"],["\u24AA","(o)"],["\u24AB","(p)"],["\u24AC","(q)"],["\u24AD","(r)"],["\u24AE","(s)"],["\u24AF","(t)"],["\u24B0","(u)"],["\u24B1","(v)"],["\u24B2","(w)"],["\u24B3","(x)"],["\u24B4","(y)"],["\u24B5","(z)"],["\u24B6","(A)"],["\u24B7","(B)"],["\u24B8","(C)"],["\u24B9","(D)"],["\u24BA","(E)"],["\u24BB","(F)"],["\u24BC","(G)"],["\u24BD","(H)"],["\u24BE","(I)"],["\u24BF","(J)"],["\u24C0","(K)"],["\u24C1","(L)"],["\u24C3","(N)"],["\u24C4","(O)"],["\u24C5","(P)"],["\u24C6","(Q)"],["\u24C7","(R)"],["\u24C8","(S)"],["\u24C9","(T)"],["\u24CA","(U)"],["\u24CB","(V)"],["\u24CC","(W)"],["\u24CD","(X)"],["\u24CE","(Y)"],["\u24CF","(Z)"],["\u24D0","(a)"],["\u24D1","(b)"],["\u24D2","(b)"],["\u24D3","(c)"],["\u24D4","(e)"],["\u24D5","(f)"],["\u24D6","(g)"],["\u24D7","(h)"],["\u24D8","(i)"],["\u24D9","(j)"],["\u24DA","(k)"],["\u24DB","(l)"],["\u24DC","(m)"],["\u24DD","(n)"],["\u24DE","(o)"],["\u24DF","(p)"],["\u24E0","(q)"],["\u24E1","(r)"],["\u24E2","(s)"],["\u24E3","(t)"],["\u24E4","(u)"],["\u24E5","(v)"],["\u24E6","(w)"],["\u24E7","(x)"],["\u24E8","(y)"],["\u24E9","(z)"],["\u010A","C"],["\u010B","c"],["\u0120","G"],["\u0121","g"],["\u0126","H"],["\u0127","h"],["\u017B","Z"],["\u017C","z"],["\u{1D7CE}","0"],["\u{1D7CF}","1"],["\u{1D7D0}","2"],["\u{1D7D1}","3"],["\u{1D7D2}","4"],["\u{1D7D3}","5"],["\u{1D7D4}","6"],["\u{1D7D5}","7"],["\u{1D7D6}","8"],["\u{1D7D7}","9"],["\u{1D7D8}","0"],["\u{1D7D9}","1"],["\u{1D7DA}","2"],["\u{1D7DB}","3"],["\u{1D7DC}","4"],["\u{1D7DD}","5"],["\u{1D7DE}","6"],["\u{1D7DF}","7"],["\u{1D7E0}","8"],["\u{1D7E1}","9"],["\u{1D7E2}","0"],["\u{1D7E3}","1"],["\u{1D7E4}","2"],["\u{1D7E5}","3"],["\u{1D7E6}","4"],["\u{1D7E7}","5"],["\u{1D7E8}","6"],["\u{1D7E9}","7"],["\u{1D7EA}","8"],["\u{1D7EB}","9"],["\u{1D7EC}","0"],["\u{1D7ED}","1"],["\u{1D7EE}","2"],["\u{1D7EF}","3"],["\u{1D7F0}","4"],["\u{1D7F1}","5"],["\u{1D7F2}","6"],["\u{1D7F3}","7"],["\u{1D7F4}","8"],["\u{1D7F5}","9"],["\u{1D7F6}","0"],["\u{1D7F7}","1"],["\u{1D7F8}","2"],["\u{1D7F9}","3"],["\u{1D7FA}","4"],["\u{1D7FB}","5"],["\u{1D7FC}","6"],["\u{1D7FD}","7"],["\u{1D7FE}","8"],["\u{1D7FF}","9"],["\u2460","1"],["\u2461","2"],["\u2462","3"],["\u2463","4"],["\u2464","5"],["\u2465","6"],["\u2466","7"],["\u2467","8"],["\u2468","9"],["\u2469","10"],["\u246A","11"],["\u246B","12"],["\u246C","13"],["\u246D","14"],["\u246E","15"],["\u246F","16"],["\u2470","17"],["\u2471","18"],["\u2472","19"],["\u2473","20"],["\u2474","1"],["\u2475","2"],["\u2476","3"],["\u2477","4"],["\u2478","5"],["\u2479","6"],["\u247A","7"],["\u247B","8"],["\u247C","9"],["\u247D","10"],["\u247E","11"],["\u247F","12"],["\u2480","13"],["\u2481","14"],["\u2482","15"],["\u2483","16"],["\u2484","17"],["\u2485","18"],["\u2486","19"],["\u2487","20"],["\u2488","1."],["\u2489","2."],["\u248A","3."],["\u248B","4."],["\u248C","5."],["\u248D","6."],["\u248E","7."],["\u248F","8."],["\u2490","9."],["\u2491","10."],["\u2492","11."],["\u2493","12."],["\u2494","13."],["\u2495","14."],["\u2496","15."],["\u2497","16."],["\u2498","17."],["\u2499","18."],["\u249A","19."],["\u249B","20."],["\u24EA","0"],["\u24EB","11"],["\u24EC","12"],["\u24ED","13"],["\u24EE","14"],["\u24EF","15"],["\u24F0","16"],["\u24F1","17"],["\u24F2","18"],["\u24F3","19"],["\u24F4","20"],["\u24F5","1"],["\u24F6","2"],["\u24F7","3"],["\u24F8","4"],["\u24F9","5"],["\u24FA","6"],["\u24FB","7"],["\u24FC","8"],["\u24FD","9"],["\u24FE","10"],["\u24FF","0"],["\u{1F670}","&"],["\u{1F671}","&"],["\u{1F672}","&"],["\u{1F673}","&"],["\u{1F674}","&"],["\u{1F675}","&"],["\u{1F676}",'"'],["\u{1F677}",'"'],["\u{1F678}",'"'],["\u203D","?!"],["\u{1F679}","?!"],["\u{1F67A}","?!"],["\u{1F67B}","?!"],["\u{1F67C}","/"],["\u{1F67D}","\\"],["\u{1F707}","AR"],["\u{1F708}","V"],["\u{1F709}","V"],["\u{1F706}","VR"],["\u{1F705}","VF"],["\u{1F729}","2"],["\u{1F72A}","5"],["\u{1F761}","f"],["\u{1F762}","W"],["\u{1F763}","U"],["\u{1F767}","V"],["\u{1F768}","T"],["\u{1F76A}","V"],["\u{1F76B}","MB"],["\u{1F76C}","VB"],["\u{1F772}","3B"],["\u{1F773}","3B"],["\u{1F4AF}","100"],["\u{1F519}","BACK"],["\u{1F51A}","END"],["\u{1F51B}","ON!"],["\u{1F51C}","SOON"],["\u{1F51D}","TOP"],["\u{1F51E}","18"],["\u{1F524}","abc"],["\u{1F520}","ABCD"],["\u{1F521}","abcd"],["\u{1F522}","1234"],["\u{1F523}","T&@%"],["#\uFE0F\u20E3","#"],["*\uFE0F\u20E3","*"],["0\uFE0F\u20E3","0"],["1\uFE0F\u20E3","1"],["2\uFE0F\u20E3","2"],["3\uFE0F\u20E3","3"],["4\uFE0F\u20E3","4"],["5\uFE0F\u20E3","5"],["6\uFE0F\u20E3","6"],["7\uFE0F\u20E3","7"],["8\uFE0F\u20E3","8"],["9\uFE0F\u20E3","9"],["\u{1F51F}","10"],["\u{1F170}\uFE0F","A"],["\u{1F171}\uFE0F","B"],["\u{1F18E}","AB"],["\u{1F191}","CL"],["\u{1F17E}\uFE0F","O"],["\u{1F17F}","P"],["\u{1F198}","SOS"],["\u{1F172}","C"],["\u{1F173}","D"],["\u{1F174}","E"],["\u{1F175}","F"],["\u{1F176}","G"],["\u{1F177}","H"],["\u{1F178}","I"],["\u{1F179}","J"],["\u{1F17A}","K"],["\u{1F17B}","L"],["\u{1F17C}","M"],["\u{1F17D}","N"],["\u{1F180}","Q"],["\u{1F181}","R"],["\u{1F182}","S"],["\u{1F183}","T"],["\u{1F184}","U"],["\u{1F185}","V"],["\u{1F186}","W"],["\u{1F187}","X"],["\u{1F188}","Y"],["\u{1F189}","Z"]],Qf=a((t,e)=>{for(const[n,r]of e)t=t.replace(new RegExp(mn(n),"g"),r);return t},"doCustomReplacements");function Xf(t,e){if(typeof t!="string")throw new TypeError(`Expected a string, got \`${typeof t}\``);e={customReplacements:[],...e};const n=new Map([...Jf,...e.customReplacements]);return t=t.normalize(),t=Qf(t,n),t=t.normalize("NFD").replace(/\p{Diacritic}/gu,"").normalize(),t}a(Xf,"transliterate");const Zf=[["&"," and "],["\u{1F984}"," unicorn "],["\u2665"," love "]],eh=a(t=>t.replace(/([A-Z]{2,})(\d+)/g,"$1 $2").replace(/([a-z\d]+)([A-Z]{2,})/g,"$1 $2").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-rt-z\d]+)/g,"$1 $2"),"decamelize"),th=a((t,e)=>{const n=mn(e);return t.replace(new RegExp(`${n}{2,}`,"g"),e).replace(new RegExp(`^${n}|${n}$`,"g"),"")},"removeMootSeparators"),nh=a(t=>{let e="a-z\\d";if(e+=t.lowercase?"":"A-Z",t.preserveCharacters.length>0)for(const n of t.preserveCharacters){if(n===t.separator)throw new Error(`The separator character \`${t.separator}\` cannot be included in preserved characters: ${t.preserveCharacters}`);e+=mn(n)}return new RegExp(`[^${e}]+`,"g")},"buildPatternSlug");function rh(t,e){if(typeof t!="string")throw new TypeError(`Expected a string, got \`${typeof t}\``);e={separator:"-",lowercase:!0,decamelize:!0,customReplacements:[],preserveLeadingUnderscore:!1,preserveTrailingDash:!1,preserveCharacters:[],...e};const n=e.preserveLeadingUnderscore&&t.startsWith("_"),r=e.preserveTrailingDash&&t.endsWith("-"),i=new Map([...Zf,...e.customReplacements]);t=Xf(t,{customReplacements:i}),e.decamelize&&(t=eh(t));const s=nh(e);return e.lowercase&&(t=t.toLowerCase()),t=t.replace(/([a-zA-Z\d]+)'([ts])(\s|$)/g,"$1$2$3"),t=t.replace(s,e.separator),t=t.replace(/\\/g,""),e.separator&&(t=th(t,e.separator)),n&&(t=`_${t}`),r&&(t=`${t}-`),t}a(rh,"slugify");function pt(t,e=!1){return ih(t,e),Eo(t)}a(pt,"validateAndSanitizeNamespace");function Eo(t){return t.normalize("NFC").trim()}a(Eo,"sanitizeNamespace");function ih(t,e=!1){const n=[];t.trim().length===0&&n.push("Cannot be empty"),t.trim().length>ko&&n.push(`Cannot be longer than ${ko} characters`);const r=[[/:/,"Colon"],[/\u0000/,"Null"],[/\u0001/,"Start of Heading"],[/\u0002/,"Start of Text"],[/\u0003/,"End of Text"],[/\u0004/,"End of Transmission"],[/\u0005/,"Enquiry"],[/\u0006/,"Acknowledge"],[/\u0007/,"Bell"],[/\u0008/,"Backspace"],[/\u0009/,"Horizontal Tab"],[/\u000A/,"Line Feed"],[/\u000B/,"Vertical Tab"],[/\u000C/,"Form Feed"],[/\u000D/,"Carriage Return"],[/\u000E/,"Shift Out"],[/\u000F/,"Shift In"],[/\u0010/,"Data Link Escape"],[/\u0011/,"Device Control 1"],[/\u0012/,"Device Control 2"],[/\u0013/,"Device Control 3"],[/\u0014/,"Device Control 4"],[/\u0015/,"Negative Acknowledge"],[/\u0016/,"Synchronous Idle"],[/\u0017/,"End of Transmission Block"],[/\u0018/,"Cancel"],[/\u0019/,"End of Medium"],[/\u001A/,"Substitute"],[/\u001B/,"Escape"],[/\u001C/,"File Separator"],[/\u001D/,"Group Separator"],[/\u001E/,"Record Separator"],[/\u001F/,"Unit Separator"],[/\u007F/,"Delete"],[/\u0080/,"Padding Character"],[/\u0081/,"High Octet Preset"],[/\u0082/,"Break Permitted Here"],[/\u0083/,"No Break Here"],[/\u0084/,"Index"],[/\u0085/,"Next Line"],[/\u0086/,"Start of Selected Area"],[/\u0087/,"End of Selected Area"],[/\u0088/,"Character Tabulation Set"],[/\u0089/,"Character Tabulation with Justification"],[/\u008A/,"Line Tabulation Set"],[/\u008B/,"Partial Line Forward"],[/\u008C/,"Partial Line Backward"],[/\u008D/,"Reverse Line Feed"],[/\u008E/,"Single Shift Two"],[/\u008F/,"Single Shift Three"],[/\u0090/,"Device Control String"],[/\u0091/,"Private Use One"],[/\u0092/,"Private Use Two"],[/\u0093/,"Set Transmit State"],[/\u0094/,"Cancel Character"],[/\u0095/,"Message Waiting"],[/\u0096/,"Start of Protected Area"],[/\u0097/,"End of Protected Area"],[/\u0098/,"Start of String"],[/\u0099/,"Single Graphic Character Introducer"],[/\u009A/,"Single Character Introducer"],[/\u009B/,"Control Sequence Introducer"],[/\u009C/,"String Terminator"],[/\u009D/,"Operating System Command"],[/\u009E/,"Privacy Message"],[/\u009F/,"Application Program Command"],[/\u00A0/,"Non-breaking Space"],[/\u00AD/,"Soft Hyphen"],[/\u200B/,"Zero-width Space"],[/\u200C/,"Zero-width Non-joiner"],[/\u200D/,"Zero-width Joiner"],[/\u200E/,"Left-to-right Mark"],[/\u200F/,"Right-to-left Mark"],[/\u202A/,"Left-to-right Embedding"],[/\u202B/,"Right-to-left Embedding"],[/\u202C/,"Pop Directional Formatting"],[/\u202D/,"Left-to-right Override"],[/\u202E/,"Right-to-left Override"],[/\uFEFF/,"Byte Order Mark (BOM)"]];e||r.push([/\*/,"Asterisk"]);for(const[i,s]of r){const o=t.match(i);if(o){const l=JSON.stringify(o[0]).slice(1,-1);n.push(`Forbidden character: ${s}: "${l}"`)}}if(n.length>0)throw new Error(`Invalid namespace "${t}":
|
|
10
10
|
- ${n.join(`
|
|
11
|
-
- `)}`)}a(ih,"validateNamespace");function To(t){return`yanki-media-${rh(Eo(t)).replaceAll(/-+/g,"-")}`}a(To,"getSlugifiedNamespace");function sh(t){const e={"application/octet-stream":"mp4","application/ogg":"ogx","application/x-shockwave-flash":"swf","audio/aac":"aac","audio/flac":"flac","audio/mp4":"m4a","audio/mpeg":"mp3","audio/ogg":"ogg","audio/opus":"opus","audio/wav":"wav","audio/webm":"webm","audio/x-speex":"spx","image/avif":"avif","image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","image/tiff":"tif","image/vnd.microsoft.icon":"ico","image/webp":"webp","image/x-icon":"ico","video/3gpp":"3gp","video/flv":"flv","video/matroska":"mkv","video/mp4":"mp4","video/mpeg":"mpg","video/msvideo":"avi","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-flv":"flv","video/x-matroska":"mkv","video/x-msvideo":"avi"};return t in e||console.log(`Unknown MIME type: ${t}`),e[t]}a(sh,"getFileExtensionForMimeType");function gn(t){try{return new URL(t),!0}catch{return!1}}a(gn,"isUrl$1");function oh(t){try{const e=new URL(t);return e.protocol==="file:"?e.pathname:t}catch{return t}}a(oh,"fileUrlToPath");function ah(t){try{const e=new URL(t);if(e.protocol==="file:")return"localFileUrl";if(e.protocol==="http:"||e.protocol==="https:")return"remoteHttpUrl"}catch{return"localFilePath"}return"unsupportedProtocolUrl"}a(ah,"getSrcType");function Io(t,e){if(t===void 0)return;t instanceof Headers||(t=lh(t));const n=(t instanceof Headers?e.map(r=>t.get(r)):e.map(r=>t[r])).filter(r=>r!=null).join("");if(n!=="")return n}a(Io,"getHeadersString");function lh(t){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;return e}a(lh,"convertKeysToLowercase");async function ci(t,e,n=zf,r=Uf){switch(n){case"metadata":{if(e===void 0)return ci(t,e,"name");try{const i=await e(t,{method:"HEAD"}),s=Io(i?.headers,["content-type"]);if(s===void 0)throw new Error("No content-type header found");return sh(s)}catch{return ci(t,e,"name")}}case"name":{let i;const s=new URL(t),o=s.pathname.split(".");return o.length>1?i=o.at(-1):i=s.search.split(".").at(-1),[...oi,...si].includes(i??"")?i:r?"unknown":void 0}}}a(ci,"getFileExtensionFromUrl");async function fi(t,e,n=qf){switch(n){case"content":return console.warn("`content` hash mode is not yet implemented for URLs"),fi(t,e,"metadata");case"metadata":try{const r=await e(t,{method:"HEAD"}),i=Io(r?.headers,["etag","last-modified","content-length"]);if(i===void 0)throw new Error("No headers found");return Wn(i,16)}catch{return fi(t,e,"name")}case"name":return Wn(t,16)}}a(fi,"getUrlContentHash");async function Lo(t,e){const n=gn(t)?await ci(t,e):W.extname(t).slice(1);if(!(n===void 0||!["unknown",...oi,...si].includes(n)))return n}a(Lo,"getAnkiMediaFilenameExtension");async function uh(t,e,n,r){const i=To(e),s=await ch(t,n,r),o=await Lo(t,r),l=o===void 0?"":`.${o}`;let u;if(u=`${i}-${s}${l}`,u.length>So)throw new Error(`Filename too long: ${u}`);return u}a(uh,"getSafeAnkiMediaFilename");async function ch(t,e,n){return gn(t)?fi(t,n):No(t,e)}a(ch,"getContentHash");const Oo=[{id:"abap",name:"ABAP",import:()=>import("./abap-DXFkqnOI.js")},{id:"actionscript-3",name:"ActionScript",import:()=>import("./actionscript-3-BigF1UXR.js")},{id:"ada",name:"Ada",import:()=>import("./ada-CowR2XfX.js")},{id:"angular-html",name:"Angular HTML",import:()=>import("./angular-html-CZfDmWtJ.js").then(function(t){return t.e})},{id:"angular-ts",name:"Angular TypeScript",import:()=>import("./angular-ts-CIhYrOL5.js")},{id:"apache",name:"Apache Conf",import:()=>import("./apache-rS0jd3Ly.js")},{id:"apex",name:"Apex",import:()=>import("./apex-Sfo2eW0G.js")},{id:"apl",name:"APL",import:()=>import("./apl-DPLNWaKG.js")},{id:"applescript",name:"AppleScript",import:()=>import("./applescript-BXKAgOFh.js")},{id:"ara",name:"Ara",import:()=>import("./ara-CG4fK2Nq.js")},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>import("./asciidoc-C539GviS.js")},{id:"asm",name:"Assembly",import:()=>import("./asm-PWN5J14X.js")},{id:"astro",name:"Astro",import:()=>import("./astro-71xeBtnw.js")},{id:"awk",name:"AWK",import:()=>import("./awk-i0IPvypD.js")},{id:"ballerina",name:"Ballerina",import:()=>import("./ballerina-T9ysyp6P.js")},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>import("./bat-BPiaQZfK.js")},{id:"beancount",name:"Beancount",import:()=>import("./beancount-Urb1RsFe.js")},{id:"berry",name:"Berry",aliases:["be"],import:()=>import("./berry-CxrokwfH.js")},{id:"bibtex",name:"BibTeX",import:()=>import("./bibtex-BaedD2tq.js")},{id:"bicep",name:"Bicep",import:()=>import("./bicep-3ghuYFLd.js")},{id:"blade",name:"Blade",import:()=>import("./blade-D3A5GssZ.js")},{id:"c",name:"C",import:()=>import("./c-RCJZWN-0.js")},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>import("./cadence-Bgpqy2XC.js")},{id:"clarity",name:"Clarity",import:()=>import("./clarity-CIekO_uJ.js")},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>import("./clojure-BF6G6X0H.js")},{id:"cmake",name:"CMake",import:()=>import("./cmake-DXZpi2gR.js")},{id:"cobol",name:"COBOL",import:()=>import("./cobol-Bi0pgIzz.js")},{id:"codeowners",name:"CODEOWNERS",import:()=>import("./codeowners-CGmujMTu.js")},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>import("./codeql-BOpLLL-w.js")},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>import("./coffee-Cp6Hkwsd.js")},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>import("./common-lisp-C3qUB5O8.js")},{id:"cpp",name:"C++",aliases:["c++"],import:()=>import("./cpp-CeZn6MzL.js")},{id:"crystal",name:"Crystal",import:()=>import("./crystal-B5pCH4eR.js")},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>import("./csharp-DISxKEhY.js")},{id:"css",name:"CSS",import:()=>import("./css-CbYhyuC0.js")},{id:"csv",name:"CSV",import:()=>import("./csv-B2DkETJQ.js")},{id:"cue",name:"CUE",import:()=>import("./cue-C6Aznpr-.js")},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>import("./cypher-ByMv4Xf1.js")},{id:"d",name:"D",import:()=>import("./d-PifQWv0n.js")},{id:"dart",name:"Dart",import:()=>import("./dart-DZLoTQm4.js")},{id:"dax",name:"DAX",import:()=>import("./dax-DsfXcHUZ.js")},{id:"desktop",name:"Desktop",import:()=>import("./desktop-D71BffLY.js")},{id:"diff",name:"Diff",import:()=>import("./diff-DvyTQcux.js")},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>import("./docker-DNR26wTC.js")},{id:"dream-maker",name:"Dream Maker",import:()=>import("./dream-maker-Eh5U-gDp.js")},{id:"elixir",name:"Elixir",import:()=>import("./elixir-Exce1dLy.js")},{id:"elm",name:"Elm",import:()=>import("./elm-D7CfdsEG.js")},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>import("./emacs-lisp-51pKhIDe.js")},{id:"erb",name:"ERB",import:()=>import("./erb-S7d1X-Y-.js")},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>import("./erlang-DS9ZWoKD.js")},{id:"fennel",name:"Fennel",import:()=>import("./fennel-DuK7IM-L.js")},{id:"fish",name:"Fish",import:()=>import("./fish-DfeQjIbs.js")},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>import("./fluent-KPqz0Sb3.js")},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>import("./fortran-fixed-form-6v7-xzYY.js")},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>import("./fortran-free-form-D6pmzCqS.js")},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>import("./fsharp-JZjmD0Li.js")},{id:"gdresource",name:"GDResource",import:()=>import("./gdresource-YQl50grm.js")},{id:"gdscript",name:"GDScript",import:()=>import("./gdscript-B474tPdy.js")},{id:"gdshader",name:"GDShader",import:()=>import("./gdshader-B_SUYfiV.js")},{id:"genie",name:"Genie",import:()=>import("./genie-DAfrLhwG.js")},{id:"gherkin",name:"Gherkin",import:()=>import("./gherkin-B0PjAhci.js")},{id:"git-commit",name:"Git Commit Message",import:()=>import("./git-commit-XY8bXq83.js")},{id:"git-rebase",name:"Git Rebase Message",import:()=>import("./git-rebase-BE3WlPTi.js")},{id:"gleam",name:"Gleam",import:()=>import("./gleam-Dd6f7Z5P.js")},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>import("./glimmer-js-I0TZ3_O1.js")},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>import("./glimmer-ts-CY38hlIb.js")},{id:"glsl",name:"GLSL",import:()=>import("./glsl-tOUOXML3.js")},{id:"gnuplot",name:"Gnuplot",import:()=>import("./gnuplot-nclm9rTJ.js")},{id:"go",name:"Go",import:()=>import("./go-BJn7Ek5W.js")},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>import("./graphql-DwwLrXH1.js")},{id:"groovy",name:"Groovy",import:()=>import("./groovy-wChcbJ1V.js")},{id:"hack",name:"Hack",import:()=>import("./hack-DmjQSZc3.js")},{id:"haml",name:"Ruby Haml",import:()=>import("./haml-map1ik7u.js")},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>import("./handlebars-CCc9qS91.js")},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>import("./haskell-DOVD4hs_.js")},{id:"haxe",name:"Haxe",import:()=>import("./haxe-Dit6kIrv.js")},{id:"hcl",name:"HashiCorp HCL",import:()=>import("./hcl-CpAANOdC.js")},{id:"hjson",name:"Hjson",import:()=>import("./hjson-DZqG9GXz.js")},{id:"hlsl",name:"HLSL",import:()=>import("./hlsl-DmDrTTlz.js")},{id:"html",name:"HTML",import:()=>import("./html-NmvpQUfQ.js")},{id:"html-derivative",name:"HTML (Derivative)",import:()=>import("./html-derivative-QphQoco-.js")},{id:"http",name:"HTTP",import:()=>import("./http-B58UUte0.js")},{id:"hxml",name:"HXML",import:()=>import("./hxml-4EC8aR1F.js")},{id:"hy",name:"Hy",import:()=>import("./hy-y-6HuL9l.js")},{id:"imba",name:"Imba",import:()=>import("./imba-CyaA9484.js")},{id:"ini",name:"INI",aliases:["properties"],import:()=>import("./ini-DeVv6D4_.js")},{id:"java",name:"Java",import:()=>import("./java-ClXEvkw9.js")},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>import("./javascript-Dch3xQiY.js")},{id:"jinja",name:"Jinja",import:()=>import("./jinja-BrXMjE5a.js")},{id:"jison",name:"Jison",import:()=>import("./jison-DlEKeWyG.js")},{id:"json",name:"JSON",import:()=>import("./json-CupVZNk8.js")},{id:"json5",name:"JSON5",import:()=>import("./json5-Bh8mriwU.js")},{id:"jsonc",name:"JSON with Comments",import:()=>import("./jsonc-DYI1rfmx.js")},{id:"jsonl",name:"JSON Lines",import:()=>import("./jsonl-BUpeXbsf.js")},{id:"jsonnet",name:"Jsonnet",import:()=>import("./jsonnet-C9d3aiqh.js")},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>import("./jssm-Dble9ECP.js")},{id:"jsx",name:"JSX",import:()=>import("./jsx-CsyrCbsw.js")},{id:"julia",name:"Julia",aliases:["jl"],import:()=>import("./julia-jDzGJc6I.js")},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>import("./kotlin-BIxS-Weu.js")},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>import("./kusto-DGEpfOTx.js")},{id:"latex",name:"LaTeX",import:()=>import("./latex-bjPeSN-x.js")},{id:"less",name:"Less",import:()=>import("./less-Du6_OKDb.js")},{id:"liquid",name:"Liquid",import:()=>import("./liquid-DHpvaAyy.js")},{id:"log",name:"Log file",import:()=>import("./log-Ksn5IXup.js")},{id:"logo",name:"Logo",import:()=>import("./logo-DdacRhvC.js")},{id:"lua",name:"Lua",import:()=>import("./lua-Cy9U1SwF.js")},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>import("./make-B9S9BZZh.js")},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>import("./markdown-BdfWgkoX.js")},{id:"marko",name:"Marko",import:()=>import("./marko-neMFgnTa.js")},{id:"matlab",name:"MATLAB",import:()=>import("./matlab-Btshr8M_.js")},{id:"mdc",name:"MDC",import:()=>import("./mdc-_-l14nii.js")},{id:"mdx",name:"MDX",import:()=>import("./mdx-CBPJd_fO.js")},{id:"mermaid",name:"Mermaid",import:()=>import("./mermaid-Dkb1Nx48.js")},{id:"mojo",name:"Mojo",import:()=>import("./mojo--7WWnkdy.js")},{id:"move",name:"Move",import:()=>import("./move-DOHBU7tp.js")},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>import("./narrat-B9CT-1u6.js")},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>import("./nextflow-DBxHOdLe.js")},{id:"nginx",name:"Nginx",import:()=>import("./nginx-C3DmzmOp.js")},{id:"nim",name:"Nim",import:()=>import("./nim-BjhyiCLB.js")},{id:"nix",name:"Nix",import:()=>import("./nix-B7rNE5kf.js")},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>import("./nushell-CrgTADc5.js")},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>import("./objective-c-DHmGyzbM.js")},{id:"objective-cpp",name:"Objective-C++",import:()=>import("./objective-cpp-BWKJ1FCf.js")},{id:"ocaml",name:"OCaml",import:()=>import("./ocaml-RqY_Nz63.js")},{id:"pascal",name:"Pascal",import:()=>import("./pascal-BvCdDh2R.js")},{id:"perl",name:"Perl",import:()=>import("./perl-PZnu_VA7.js")},{id:"php",name:"PHP",import:()=>import("./php-m9Z3qs_k.js")},{id:"plsql",name:"PL/SQL",import:()=>import("./plsql-BbJj1K1w.js")},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>import("./po-HrnDn_2Q.js")},{id:"postcss",name:"PostCSS",import:()=>import("./postcss-DXT9h7v2.js")},{id:"powerquery",name:"PowerQuery",import:()=>import("./powerquery-CApMHEaB.js")},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>import("./powershell-9ZOzOPqN.js")},{id:"prisma",name:"Prisma",import:()=>import("./prisma-BBJYjQ0k.js")},{id:"prolog",name:"Prolog",import:()=>import("./prolog-BH_RS3WO.js")},{id:"proto",name:"Protocol Buffer 3",import:()=>import("./proto-DOtRmeXT.js")},{id:"pug",name:"Pug",aliases:["jade"],import:()=>import("./pug-jyQP1XtO.js")},{id:"puppet",name:"Puppet",import:()=>import("./puppet-37ic6j3l.js")},{id:"purescript",name:"PureScript",import:()=>import("./purescript-Bm5O5oLm.js")},{id:"python",name:"Python",aliases:["py"],import:()=>import("./python-DwuVtWc2.js")},{id:"qml",name:"QML",import:()=>import("./qml-DM3j-f55.js")},{id:"qmldir",name:"QML Directory",import:()=>import("./qmldir-MS3qTAOR.js")},{id:"qss",name:"Qt Style Sheets",import:()=>import("./qss-FJDVp-XM.js")},{id:"r",name:"R",import:()=>import("./r-BXfENWL6.js")},{id:"racket",name:"Racket",import:()=>import("./racket-BbLA0SU8.js")},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>import("./raku-D384ylkT.js")},{id:"razor",name:"ASP.NET Razor",import:()=>import("./razor-DokJXJPk.js")},{id:"reg",name:"Windows Registry Script",import:()=>import("./reg-CrhH3_Og.js")},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>import("./regexp-C_ZPRiAj.js")},{id:"rel",name:"Rel",import:()=>import("./rel-BuawaRXJ.js")},{id:"riscv",name:"RISC-V",import:()=>import("./riscv-D-aEEwJo.js")},{id:"rst",name:"reStructuredText",import:()=>import("./rst-DlAMacAQ.js")},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>import("./ruby-eQ1iIi6H.js")},{id:"rust",name:"Rust",aliases:["rs"],import:()=>import("./rust-DGxQkqYo.js")},{id:"sas",name:"SAS",import:()=>import("./sas-BhBoFsCt.js")},{id:"sass",name:"Sass",import:()=>import("./sass-CMDmr8et.js")},{id:"scala",name:"Scala",import:()=>import("./scala-Cd0cRMx9.js")},{id:"scheme",name:"Scheme",import:()=>import("./scheme-BTeww-4z.js")},{id:"scss",name:"SCSS",import:()=>import("./scss-DoQ2ojfq.js")},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>import("./shaderlab-Bb-6Dmi7.js")},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>import("./shellscript-BZfs-ost.js")},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>import("./shellsession-B6XH_PlG.js")},{id:"smalltalk",name:"Smalltalk",import:()=>import("./smalltalk-DSsji4Hu.js")},{id:"solidity",name:"Solidity",import:()=>import("./solidity-CThH5sBG.js")},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>import("./soy-rVg8SA9F.js")},{id:"sparql",name:"SPARQL",import:()=>import("./sparql-Cmp61EUJ.js")},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>import("./splunk-6XBPEST2.js")},{id:"sql",name:"SQL",import:()=>import("./sql-DxR2xW-a.js")},{id:"ssh-config",name:"SSH Config",import:()=>import("./ssh-config-BH1M7C1g.js")},{id:"stata",name:"Stata",import:()=>import("./stata-DGeqZgIM.js")},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>import("./stylus-DSrLtGYv.js")},{id:"svelte",name:"Svelte",import:()=>import("./svelte-BMtjZn0z.js")},{id:"swift",name:"Swift",import:()=>import("./swift-C8WrqfNz.js")},{id:"system-verilog",name:"SystemVerilog",import:()=>import("./system-verilog-BscxmKrE.js")},{id:"systemd",name:"Systemd Units",import:()=>import("./systemd-IQPSIA3x.js")},{id:"tasl",name:"Tasl",import:()=>import("./tasl-BxwAa5i0.js")},{id:"tcl",name:"Tcl",import:()=>import("./tcl-C_8Fx7bH.js")},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>import("./terraform-DBeuZS66.js")},{id:"tex",name:"TeX",import:()=>import("./tex-BqVuN0dX.js")},{id:"toml",name:"TOML",import:()=>import("./toml-BT9ZzGyQ.js")},{id:"tsv",name:"TSV",import:()=>import("./tsv-DnLUQrgA.js")},{id:"tsx",name:"TSX",import:()=>import("./tsx-BlxWTfDV.js")},{id:"turtle",name:"Turtle",import:()=>import("./turtle-C15OxdQ5.js")},{id:"twig",name:"Twig",import:()=>import("./twig-DDlPLETn.js")},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>import("./typescript-DC8MraHL.js")},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>import("./typespec-DAP_O-zg.js")},{id:"typst",name:"Typst",aliases:["typ"],import:()=>import("./typst-I4qd5QHW.js")},{id:"v",name:"V",import:()=>import("./v-C2TBxDwV.js")},{id:"vala",name:"Vala",import:()=>import("./vala-CO5hpdkB.js")},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>import("./vb-beD-FUib.js")},{id:"verilog",name:"Verilog",import:()=>import("./verilog-DVfdqzEq.js")},{id:"vhdl",name:"VHDL",import:()=>import("./vhdl-QZ3jNtnE.js")},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>import("./viml-BLluXI4E.js")},{id:"vue",name:"Vue",import:()=>import("./vue-CSQt1zmP.js")},{id:"vue-html",name:"Vue HTML",import:()=>import("./vue-html-Bjmswp-o.js")},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>import("./vyper-o-cPXEvd.js")},{id:"wasm",name:"WebAssembly",import:()=>import("./wasm-Cicx_DS6.js")},{id:"wenyan",name:"Wenyan",aliases:["\u6587\u8A00"],import:()=>import("./wenyan-Cavfe_d0.js")},{id:"wgsl",name:"WGSL",import:()=>import("./wgsl-BZz1Hhek.js")},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>import("./wikitext-zfUCmn4z.js")},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>import("./wolfram-BICIrM8O.js")},{id:"xml",name:"XML",import:()=>import("./xml-sp2Egr0Z.js")},{id:"xsl",name:"XSL",import:()=>import("./xsl-BQYvujlj.js")},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>import("./yaml-C5gCGmDW.js")},{id:"zenscript",name:"ZenScript",import:()=>import("./zenscript-B1nm99XP.js")},{id:"zig",name:"Zig",import:()=>import("./zig-xtV5iK4E.js")}],fh=Object.fromEntries(Oo.map(t=>[t.id,t.import])),hh=Object.fromEntries(Oo.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),Po={...fh,...hh},ph=a(async t=>import("./wasm-2oxoyaYy.js").then(e=>e.default(t)),"getWasmInlined"),dh=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>import("./andromeeda-YxQm0tCS.js")},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>import("./aurora-x-BaWyeHV_.js")},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>import("./ayu-dark-Bn5gmY5k.js")},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:()=>import("./catppuccin-frappe-BsOrZxH8.js")},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>import("./catppuccin-latte-BYdKNJ10.js")},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>import("./catppuccin-macchiato-DVLwECkk.js")},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>import("./catppuccin-mocha-CEfge3mM.js")},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>import("./dark-plus-KEYLhlmT.js")},{id:"dracula",displayName:"Dracula",type:"dark",import:()=>import("./dracula-DGO8GyiP.js")},{id:"dracula-soft",displayName:"Dracula Soft",type:"dark",import:()=>import("./dracula-soft-9B1nZgL-.js")},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>import("./github-dark-CzPA46E-.js")},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>import("./github-dark-default-BXF7Vm5l.js")},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>import("./github-dark-dimmed-CRDKj6ck.js")},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>import("./github-light-CRlnGVMD.js")},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>import("./github-light-default-UREJT2Bw.js")},{id:"houston",displayName:"Houston",type:"dark",import:()=>import("./houston-CZZ6oYdA.js")},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>import("./light-plus-BsvsQ1iS.js")},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>import("./material-theme-B2BuIiKK.js")},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>import("./material-theme-darker-BrGg7AAd.js")},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>import("./material-theme-lighter-DDRuGeQH.js")},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>import("./material-theme-ocean-CBL0qBdF.js")},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>import("./material-theme-palenight-D7gg1Usp.js")},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>import("./min-dark-iSbrOpM4.js")},{id:"min-light",displayName:"Min Light",type:"light",import:()=>import("./min-light-BITGhEdf.js")},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>import("./monokai-sMI-pExk.js")},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>import("./night-owl-BeocmOPF.js")},{id:"nord",displayName:"Nord",type:"dark",import:()=>import("./nord-CsyjKwr8.js")},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>import("./one-dark-pro-BTtaZsq5.js")},{id:"one-light",displayName:"One Light",type:"light",import:()=>import("./one-light-alpzPJ78.js")},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>import("./poimandres-Cda-MJFk.js")},{id:"red",displayName:"Red",type:"dark",import:()=>import("./red-jaXbsbtS.js")},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:()=>import("./rose-pine-BIAFg_EN.js")},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:()=>import("./rose-pine-dawn-C5m_N-6l.js")},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:()=>import("./rose-pine-moon-B9S0JTD1.js")},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>import("./slack-dark-C7oZ9nno.js")},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>import("./slack-ochin-hXH8Gyq8.js")},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>import("./snazzy-light-CA9nliXM.js")},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>import("./solarized-dark-C86elO-m.js")},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>import("./solarized-light-xPNGhBYe.js")},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>import("./synthwave-84-BBDuFDsq.js")},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>import("./tokyo-night-eJfcURhx.js")},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>import("./vesper-BSB_bK09.js")},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>import("./vitesse-black-B3g-KkBK.js")},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>import("./vitesse-dark-Bxkoe-BC.js")},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>import("./vitesse-light-Br6ll-O0.js")}],mh=Object.fromEntries(dh.map(t=>[t.id,t.import]));var ze;(function(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"})(ze||(ze={})),typeof process<"u"&&process.env.VSCODE_TEXTMATE_DEBUG;var Mt;(function(t){function e(h){return h.toString(2).padStart(32,"0")}a(e,"toBinaryStr"),t.toBinaryStr=e;function n(h){const f=t.getLanguageId(h),p=t.getTokenType(h),d=t.getFontStyle(h),m=t.getForeground(h),g=t.getBackground(h);console.log({languageId:f,tokenType:p,fontStyle:d,foreground:m,background:g})}a(n,"print"),t.print=n;function r(h){return(h&255)>>>0}a(r,"getLanguageId"),t.getLanguageId=r;function i(h){return(h&768)>>>8}a(i,"getTokenType"),t.getTokenType=i;function s(h){return(h&1024)!==0}a(s,"containsBalancedBrackets"),t.containsBalancedBrackets=s;function o(h){return(h&30720)>>>11}a(o,"getFontStyle"),t.getFontStyle=o;function l(h){return(h&16744448)>>>15}a(l,"getForeground"),t.getForeground=l;function u(h){return(h&4278190080)>>>24}a(u,"getBackground"),t.getBackground=u;function c(h,f,p,d,m,g,y){let b=t.getLanguageId(h),w=t.getTokenType(h),k=t.containsBalancedBrackets(h)?1:0,_=t.getFontStyle(h),C=t.getForeground(h),S=t.getBackground(h);return f!==0&&(b=f),p!==8&&(w=p),d!==null&&(k=d?1:0),m!==-1&&(_=m),g!==0&&(C=g),y!==0&&(S=y),(b<<0|w<<8|k<<10|_<<11|C<<15|S<<24)>>>0}a(c,"set"),t.set=c})(Mt||(Mt={}));function BN(t){return t}a(BN,"toOptionalTokenType");function qN(t){return t}a(qN,"fromOptionalTokenType");function Qn(t,e){const n=[],r=gh(t);let i=r.next();for(;i!==null;){let u=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":u=1;break;case"L":u=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=o();if(n.push({matcher:c,priority:u}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const u=s();return c=>!!u&&!u(c)}if(i==="("){i=r.next();const u=l();return i===")"&&(i=r.next()),u}if(Do(i)){const u=[];do u.push(i),i=r.next();while(Do(i));return c=>e(u,c)}return null}function o(){const u=[];let c=s();for(;c;)u.push(c),c=s();return h=>u.every(f=>f(h))}function l(){const u=[];let c=o();for(;c&&(u.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=o()}return h=>u.some(f=>f(h))}}a(Qn,"createMatchers");function Do(t){return!!t&&!!t.match(/[\w\.:]+/)}a(Do,"isIdentifier");function gh(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}}}a(gh,"newTokenizer");function Ro(t){typeof t.dispose=="function"&&t.dispose()}a(Ro,"disposeOnigString");function yh(t){return hi(t)}a(yh,"clone");function hi(t){return Array.isArray(t)?bh(t):typeof t=="object"?wh(t):t}a(hi,"doClone");function bh(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=hi(t[n]);return e}a(bh,"cloneArray");function wh(t){let e={};for(let n in t)e[n]=hi(t[n]);return e}a(wh,"cloneObj");function Fo(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}a(Fo,"mergeObjects");function Mo(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Mo(t.substring(0,t.length-1)):t.substr(~e+1)}a(Mo,"basename$1");let pi=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;class Xn{static{a(this,"RegexSource")}static hasCaptures(e){return e===null?!1:(pi.lastIndex=0,pi.test(e))}static replaceCaptures(e,n,r){return e.replace(pi,(i,s,o,l)=>{let u=r[parseInt(s||o,10)];if(u){let c=n.substring(u.start,u.end);for(;c[0]===".";)c=c.substring(1);switch(l){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return i})}}function $o(t,e){return t<e?-1:t>e?1:0}a($o,"strcmp");function Bo(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 i=0;i<n;i++){let s=$o(t[i],e[i]);if(s!==0)return s}return 0}return n-r}a(Bo,"strArrCmp");function qo(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))}a(qo,"isValidHexColor");function zo(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}a(zo,"escapeRegExpCharacters");class Uo{static{a(this,"CachedFn")}fn;cache=new Map;constructor(e){this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const n=this.fn(e);return this.cache.set(e,n),n}}class yn{static{a(this,"TopLevelRuleReference")}scopeName;constructor(e){this.scopeName=e}toKey(){return this.scopeName}}class kh{static{a(this,"TopLevelRepositoryRuleReference")}scopeName;ruleName;constructor(e,n){this.scopeName=e,this.ruleName=n}toKey(){return`${this.scopeName}#${this.ruleName}`}}class Sh{static{a(this,"ExternalReferenceCollector")}_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const n=e.toKey();this._seenReferenceKeys.has(n)||(this._seenReferenceKeys.add(n),this._references.push(e))}}class xh{static{a(this,"ScopeDependencyProcessor")}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;constructor(e,n){this.repo=e,this.initialScopeName=n,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new yn(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const n=new Sh;for(const r of e)vh(r,this.initialScopeName,this.repo,n);for(const r of n.references)if(r instanceof yn){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}}function vh(t,e,n,r){const i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const s=n.lookup(e);t instanceof yn?Zn({baseGrammar:s,selfGrammar:i},r):di(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(t.scopeName);if(o)for(const l of o)r.add(new yn(l))}a(vh,"collectReferencesOfReference");function di(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];er([r],e,n)}}a(di,"collectExternalReferencesInTopLevelRepositoryRule");function Zn(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&er(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&er(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}a(Zn,"collectExternalReferencesInTopLevelRule");function er(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Fo({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&er(r.patterns,{...e,repository:i},n);const s=r.include;if(!s)continue;const o=jo(s);switch(o.kind){case 0:Zn({...e,selfGrammar:e.baseGrammar},n);break;case 1:Zn(e,n);break;case 2:di(o.ruleName,{...e,repository:i},n);break;case 3:case 4:const l=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const u={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};o.kind===4?di(o.ruleName,u,n):Zn(u,n)}else o.kind===4?n.add(new kh(o.scopeName,o.ruleName)):n.add(new yn(o.scopeName));break}}}a(er,"collectExternalReferencesInRules");class _h{static{a(this,"BaseReference")}kind=0}class Ch{static{a(this,"SelfReference")}kind=1}class Nh{static{a(this,"RelativeReference")}ruleName;kind=2;constructor(e){this.ruleName=e}}class Ah{static{a(this,"TopLevelReference")}scopeName;kind=3;constructor(e){this.scopeName=e}}class Eh{static{a(this,"TopLevelRepositoryReference")}scopeName;ruleName;kind=4;constructor(e,n){this.scopeName=e,this.ruleName=n}}function jo(t){if(t==="$base")return new _h;if(t==="$self")return new Ch;const e=t.indexOf("#");if(e===-1)return new Ah(t);if(e===0)return new Nh(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new Eh(n,r)}}a(jo,"parseInclude");const Th=/\\(\d+)/,Go=/\\(\d+)/g,Ih=-1,Ho=-2;function zN(t){return t}a(zN,"ruleIdFromNumber");function UN(t){return t}a(UN,"ruleIdToNumber");class bn{static{a(this,"Rule")}$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,n,r,i){this.$location=e,this.id=n,this._name=r||null,this._nameIsCapturing=Xn.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Xn.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Mo(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,n){return!this._nameIsCapturing||this._name===null||e===null||n===null?this._name:Xn.replaceCaptures(this._name,e,n)}getContentName(e,n){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Xn.replaceCaptures(this._contentName,e,n)}}class Lh extends bn{static{a(this,"CaptureRule")}retokenizeCapturedWithRuleId;constructor(e,n,r,i,s){super(e,n,r,i),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,r,i){throw new Error("Not supported!")}}class Oh extends bn{static{a(this,"MatchRule")}_match;captures;_cachedCompiledPatterns;constructor(e,n,r,i,s){super(e,n,r,null),this._match=new Tt(i,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class Vo extends bn{static{a(this,"IncludeOnlyRule")}hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,n,r,i,s){super(e,n,r,i),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const r of this.patterns)e.getRule(r).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class mi extends bn{static{a(this,"BeginEndRule")}_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,n,r,i,s,o,l,u,c,h){super(e,n,r,i),this._begin=new Tt(s,this.id),this.beginCaptures=o,this._end=new Tt(l||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=u,this.applyEndPatternLast=c||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.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(e,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e,n).compileAG(e,r,i)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wn;for(const r of this.patterns)e.getRule(r).collectPatterns(e,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,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}}class tr extends bn{static{a(this,"BeginWhileRule")}_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,n,r,i,s,o,l,u,c){super(e,n,r,i),this._begin=new Tt(s,this.id),this.beginCaptures=o,this.whileCaptures=u,this._while=new Tt(l,Ho),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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(e,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wn;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,r,i){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,r,i)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new wn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"\uFFFF"),this._cachedCompiledWhilePatterns}}class ce{static{a(this,"RuleFactory")}static createCaptureRule(e,n,r,i,s){return e.registerRule(o=>new Lh(n,o,r,i,s))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new Oh(e.$vscodeTextmateLocation,e.id,e.name,e.match,ce._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Fo({},r,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new Vo(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,ce._compilePatterns(s,n,r))}return e.while?new tr(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ce._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,ce._compileCaptures(e.whileCaptures||e.captures,n,r),ce._compilePatterns(e.patterns,n,r)):new mi(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ce._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,ce._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,ce._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let s=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const l=parseInt(o,10);l>s&&(s=l)}for(let o=0;o<=s;o++)i[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const l=parseInt(o,10);let u=0;e[o].patterns&&(u=ce.getCompiledRuleId(e[o],n,r)),i[l]=ce.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,u)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let s=0,o=e.length;s<o;s++){const l=e[s];let u=-1;if(l.include){const c=jo(l.include);switch(c.kind){case 0:case 1:u=ce.getCompiledRuleId(r[l.include],n,r);break;case 2:let h=r[c.ruleName];h&&(u=ce.getCompiledRuleId(h,n,r));break;case 3:case 4:const f=c.scopeName,p=c.kind===4?c.ruleName:null,d=n.getExternalGrammar(f,r);if(d)if(p){let m=d.repository[p];m&&(u=ce.getCompiledRuleId(m,n,d.repository))}else u=ce.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else u=ce.getCompiledRuleId(l,n,r);if(u!==-1){const c=n.getRule(u);let h=!1;if((c instanceof Vo||c instanceof mi||c instanceof tr)&&c.hasMissingPatterns&&c.patterns.length===0&&(h=!0),h)continue;i.push(u)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}}class Tt{static{a(this,"RegExpSource")}source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e){const r=e.length;let i=0,s=[],o=!1;for(let l=0;l<r;l++)if(e.charAt(l)==="\\"&&l+1<r){const c=e.charAt(l+1);c==="z"?(s.push(e.substring(i,l)),s.push("$(?!\\n)(?<!\\n)"),i=l+2):(c==="A"||c==="G")&&(o=!0),l++}this.hasAnchor=o,i===0?this.source=e:(s.push(e.substring(i,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,this.hasBackReferences=Th.test(this.source)}clone(){return new Tt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){let r=n.map(i=>e.substring(i.start,i.end));return Go.lastIndex=0,this.source.replace(Go,(i,s)=>zo(r[parseInt(s,10)]||""))}_buildAnchorCache(){let e=[],n=[],r=[],i=[],s,o,l,u;for(s=0,o=this.source.length;s<o;s++)l=this.source.charAt(s),e[s]=l,n[s]=l,r[s]=l,i[s]=l,l==="\\"&&s+1<o&&(u=this.source.charAt(s+1),u==="A"?(e[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",i[s+1]="A"):u==="G"?(e[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",i[s+1]="G"):(e[s+1]=u,n[s+1]=u,r[s+1]=u,i[s+1]=u),s++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}}class wn{static{a(this,"RegExpSourceList")}_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(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,n){this._items[e].source!==n&&(this._disposeCaches(),this._items[e].setSource(n))}compile(e){if(!this._cached){let n=this._items.map(r=>r.source);this._cached=new Wo(e,n,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,n,r){return this._hasAnchors?n?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,n,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,n,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,n,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,n,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,n,r){let i=this._items.map(s=>s.resolveAnchors(n,r));return new Wo(e,i,this._items.map(s=>s.ruleId))}}class Wo{static{a(this,"CompiledRule")}regExps;rules;scanner;constructor(e,n,r){this.regExps=n,this.rules=r,this.scanner=e.createOnigScanner(n)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let n=0,r=this.rules.length;n<r;n++)e.push(" - "+this.rules[n]+": "+this.regExps[n]);return e.join(`
|
|
11
|
+
- `)}`)}a(ih,"validateNamespace");function To(t){return`yanki-media-${rh(Eo(t)).replaceAll(/-+/g,"-")}`}a(To,"getSlugifiedNamespace");function sh(t){const e={"application/octet-stream":"mp4","application/ogg":"ogx","application/x-shockwave-flash":"swf","audio/aac":"aac","audio/flac":"flac","audio/mp4":"m4a","audio/mpeg":"mp3","audio/ogg":"ogg","audio/opus":"opus","audio/wav":"wav","audio/webm":"webm","audio/x-speex":"spx","image/avif":"avif","image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","image/tiff":"tif","image/vnd.microsoft.icon":"ico","image/webp":"webp","image/x-icon":"ico","video/3gpp":"3gp","video/flv":"flv","video/matroska":"mkv","video/mp4":"mp4","video/mpeg":"mpg","video/msvideo":"avi","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-flv":"flv","video/x-matroska":"mkv","video/x-msvideo":"avi"};return t in e||console.log(`Unknown MIME type: ${t}`),e[t]}a(sh,"getFileExtensionForMimeType");function gn(t){try{const{protocol:e}=new URL(t);return e==="https:"||e==="http:"}catch{return!1}}a(gn,"isUrl$1");function oh(t){try{const e=new URL(t);return e.protocol==="file:"?e.pathname:t}catch{return t}}a(oh,"fileUrlToPath");function ah(t){try{const e=new URL(t);if(e.protocol==="file:")return"localFileUrl";if(e.protocol==="http:"||e.protocol==="https:")return"remoteHttpUrl"}catch{return"localFilePath"}return"localFilePath"}a(ah,"getSrcType");function Io(t,e){if(t===void 0)return;t instanceof Headers||(t=lh(t));const n=(t instanceof Headers?e.map(r=>t.get(r)):e.map(r=>t[r])).filter(r=>r!=null).join("");if(n!=="")return n}a(Io,"getHeadersString");function lh(t){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;return e}a(lh,"convertKeysToLowercase");async function ci(t,e,n=zf,r=Uf){switch(n){case"metadata":{if(e===void 0)return ci(t,e,"name");try{const i=await e(t,{method:"HEAD"}),s=Io(i?.headers,["content-type"]);if(s===void 0)throw new Error("No content-type header found");return sh(s)}catch{return ci(t,e,"name")}}case"name":{let i;const s=new URL(t),o=s.pathname.split(".");return o.length>1?i=o.at(-1):i=s.search.split(".").at(-1),[...oi,...si].includes(i??"")?i:r?"unknown":void 0}}}a(ci,"getFileExtensionFromUrl");async function fi(t,e,n=qf){switch(n){case"content":return console.warn("`content` hash mode is not yet implemented for URLs"),fi(t,e,"metadata");case"metadata":try{const r=await e(t,{method:"HEAD"}),i=Io(r?.headers,["etag","last-modified","content-length"]);if(i===void 0)throw new Error("No headers found");return Wn(i,16)}catch{return fi(t,e,"name")}case"name":return Wn(t,16)}}a(fi,"getUrlContentHash");async function Lo(t,e){const n=gn(t)?await ci(t,e):W.extname(t).slice(1);if(!(n===void 0||!["unknown",...oi,...si].includes(n)))return n}a(Lo,"getAnkiMediaFilenameExtension");async function uh(t,e,n,r){const i=To(e),s=await ch(t,n,r),o=await Lo(t,r),l=o===void 0?"":`.${o}`;let u;if(u=`${i}-${s}${l}`,u.length>So)throw new Error(`Filename too long: ${u}`);return u}a(uh,"getSafeAnkiMediaFilename");async function ch(t,e,n){return gn(t)?fi(t,n):No(t,e)}a(ch,"getContentHash");const Oo=[{id:"abap",name:"ABAP",import:()=>import("./abap-DXFkqnOI.js")},{id:"actionscript-3",name:"ActionScript",import:()=>import("./actionscript-3-BigF1UXR.js")},{id:"ada",name:"Ada",import:()=>import("./ada-CowR2XfX.js")},{id:"angular-html",name:"Angular HTML",import:()=>import("./angular-html-CZfDmWtJ.js").then(function(t){return t.e})},{id:"angular-ts",name:"Angular TypeScript",import:()=>import("./angular-ts-CIhYrOL5.js")},{id:"apache",name:"Apache Conf",import:()=>import("./apache-rS0jd3Ly.js")},{id:"apex",name:"Apex",import:()=>import("./apex-Sfo2eW0G.js")},{id:"apl",name:"APL",import:()=>import("./apl-DPLNWaKG.js")},{id:"applescript",name:"AppleScript",import:()=>import("./applescript-BXKAgOFh.js")},{id:"ara",name:"Ara",import:()=>import("./ara-CG4fK2Nq.js")},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>import("./asciidoc-C539GviS.js")},{id:"asm",name:"Assembly",import:()=>import("./asm-PWN5J14X.js")},{id:"astro",name:"Astro",import:()=>import("./astro-71xeBtnw.js")},{id:"awk",name:"AWK",import:()=>import("./awk-i0IPvypD.js")},{id:"ballerina",name:"Ballerina",import:()=>import("./ballerina-T9ysyp6P.js")},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>import("./bat-BPiaQZfK.js")},{id:"beancount",name:"Beancount",import:()=>import("./beancount-Urb1RsFe.js")},{id:"berry",name:"Berry",aliases:["be"],import:()=>import("./berry-CxrokwfH.js")},{id:"bibtex",name:"BibTeX",import:()=>import("./bibtex-BaedD2tq.js")},{id:"bicep",name:"Bicep",import:()=>import("./bicep-3ghuYFLd.js")},{id:"blade",name:"Blade",import:()=>import("./blade-D3A5GssZ.js")},{id:"c",name:"C",import:()=>import("./c-RCJZWN-0.js")},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>import("./cadence-Bgpqy2XC.js")},{id:"clarity",name:"Clarity",import:()=>import("./clarity-CIekO_uJ.js")},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>import("./clojure-BF6G6X0H.js")},{id:"cmake",name:"CMake",import:()=>import("./cmake-DXZpi2gR.js")},{id:"cobol",name:"COBOL",import:()=>import("./cobol-Bi0pgIzz.js")},{id:"codeowners",name:"CODEOWNERS",import:()=>import("./codeowners-CGmujMTu.js")},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>import("./codeql-BOpLLL-w.js")},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>import("./coffee-Cp6Hkwsd.js")},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>import("./common-lisp-C3qUB5O8.js")},{id:"cpp",name:"C++",aliases:["c++"],import:()=>import("./cpp-CeZn6MzL.js")},{id:"crystal",name:"Crystal",import:()=>import("./crystal-B5pCH4eR.js")},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>import("./csharp-DISxKEhY.js")},{id:"css",name:"CSS",import:()=>import("./css-CbYhyuC0.js")},{id:"csv",name:"CSV",import:()=>import("./csv-B2DkETJQ.js")},{id:"cue",name:"CUE",import:()=>import("./cue-C6Aznpr-.js")},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>import("./cypher-ByMv4Xf1.js")},{id:"d",name:"D",import:()=>import("./d-PifQWv0n.js")},{id:"dart",name:"Dart",import:()=>import("./dart-DZLoTQm4.js")},{id:"dax",name:"DAX",import:()=>import("./dax-DsfXcHUZ.js")},{id:"desktop",name:"Desktop",import:()=>import("./desktop-D71BffLY.js")},{id:"diff",name:"Diff",import:()=>import("./diff-DvyTQcux.js")},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>import("./docker-DNR26wTC.js")},{id:"dream-maker",name:"Dream Maker",import:()=>import("./dream-maker-Eh5U-gDp.js")},{id:"elixir",name:"Elixir",import:()=>import("./elixir-Exce1dLy.js")},{id:"elm",name:"Elm",import:()=>import("./elm-D7CfdsEG.js")},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>import("./emacs-lisp-51pKhIDe.js")},{id:"erb",name:"ERB",import:()=>import("./erb-S7d1X-Y-.js")},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>import("./erlang-DS9ZWoKD.js")},{id:"fennel",name:"Fennel",import:()=>import("./fennel-DuK7IM-L.js")},{id:"fish",name:"Fish",import:()=>import("./fish-DfeQjIbs.js")},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>import("./fluent-KPqz0Sb3.js")},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>import("./fortran-fixed-form-6v7-xzYY.js")},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>import("./fortran-free-form-D6pmzCqS.js")},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>import("./fsharp-JZjmD0Li.js")},{id:"gdresource",name:"GDResource",import:()=>import("./gdresource-YQl50grm.js")},{id:"gdscript",name:"GDScript",import:()=>import("./gdscript-B474tPdy.js")},{id:"gdshader",name:"GDShader",import:()=>import("./gdshader-B_SUYfiV.js")},{id:"genie",name:"Genie",import:()=>import("./genie-DAfrLhwG.js")},{id:"gherkin",name:"Gherkin",import:()=>import("./gherkin-B0PjAhci.js")},{id:"git-commit",name:"Git Commit Message",import:()=>import("./git-commit-XY8bXq83.js")},{id:"git-rebase",name:"Git Rebase Message",import:()=>import("./git-rebase-BE3WlPTi.js")},{id:"gleam",name:"Gleam",import:()=>import("./gleam-Dd6f7Z5P.js")},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>import("./glimmer-js-I0TZ3_O1.js")},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>import("./glimmer-ts-CY38hlIb.js")},{id:"glsl",name:"GLSL",import:()=>import("./glsl-tOUOXML3.js")},{id:"gnuplot",name:"Gnuplot",import:()=>import("./gnuplot-nclm9rTJ.js")},{id:"go",name:"Go",import:()=>import("./go-BJn7Ek5W.js")},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>import("./graphql-DwwLrXH1.js")},{id:"groovy",name:"Groovy",import:()=>import("./groovy-wChcbJ1V.js")},{id:"hack",name:"Hack",import:()=>import("./hack-DmjQSZc3.js")},{id:"haml",name:"Ruby Haml",import:()=>import("./haml-map1ik7u.js")},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>import("./handlebars-CCc9qS91.js")},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>import("./haskell-DOVD4hs_.js")},{id:"haxe",name:"Haxe",import:()=>import("./haxe-Dit6kIrv.js")},{id:"hcl",name:"HashiCorp HCL",import:()=>import("./hcl-CpAANOdC.js")},{id:"hjson",name:"Hjson",import:()=>import("./hjson-DZqG9GXz.js")},{id:"hlsl",name:"HLSL",import:()=>import("./hlsl-DmDrTTlz.js")},{id:"html",name:"HTML",import:()=>import("./html-NmvpQUfQ.js")},{id:"html-derivative",name:"HTML (Derivative)",import:()=>import("./html-derivative-QphQoco-.js")},{id:"http",name:"HTTP",import:()=>import("./http-B58UUte0.js")},{id:"hxml",name:"HXML",import:()=>import("./hxml-4EC8aR1F.js")},{id:"hy",name:"Hy",import:()=>import("./hy-y-6HuL9l.js")},{id:"imba",name:"Imba",import:()=>import("./imba-CyaA9484.js")},{id:"ini",name:"INI",aliases:["properties"],import:()=>import("./ini-DeVv6D4_.js")},{id:"java",name:"Java",import:()=>import("./java-ClXEvkw9.js")},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>import("./javascript-Dch3xQiY.js")},{id:"jinja",name:"Jinja",import:()=>import("./jinja-BrXMjE5a.js")},{id:"jison",name:"Jison",import:()=>import("./jison-DlEKeWyG.js")},{id:"json",name:"JSON",import:()=>import("./json-CupVZNk8.js")},{id:"json5",name:"JSON5",import:()=>import("./json5-Bh8mriwU.js")},{id:"jsonc",name:"JSON with Comments",import:()=>import("./jsonc-DYI1rfmx.js")},{id:"jsonl",name:"JSON Lines",import:()=>import("./jsonl-BUpeXbsf.js")},{id:"jsonnet",name:"Jsonnet",import:()=>import("./jsonnet-C9d3aiqh.js")},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>import("./jssm-Dble9ECP.js")},{id:"jsx",name:"JSX",import:()=>import("./jsx-CsyrCbsw.js")},{id:"julia",name:"Julia",aliases:["jl"],import:()=>import("./julia-jDzGJc6I.js")},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>import("./kotlin-BIxS-Weu.js")},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>import("./kusto-DGEpfOTx.js")},{id:"latex",name:"LaTeX",import:()=>import("./latex-bjPeSN-x.js")},{id:"less",name:"Less",import:()=>import("./less-Du6_OKDb.js")},{id:"liquid",name:"Liquid",import:()=>import("./liquid-DHpvaAyy.js")},{id:"log",name:"Log file",import:()=>import("./log-Ksn5IXup.js")},{id:"logo",name:"Logo",import:()=>import("./logo-DdacRhvC.js")},{id:"lua",name:"Lua",import:()=>import("./lua-Cy9U1SwF.js")},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>import("./make-B9S9BZZh.js")},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>import("./markdown-BdfWgkoX.js")},{id:"marko",name:"Marko",import:()=>import("./marko-neMFgnTa.js")},{id:"matlab",name:"MATLAB",import:()=>import("./matlab-Btshr8M_.js")},{id:"mdc",name:"MDC",import:()=>import("./mdc-_-l14nii.js")},{id:"mdx",name:"MDX",import:()=>import("./mdx-CBPJd_fO.js")},{id:"mermaid",name:"Mermaid",import:()=>import("./mermaid-Dkb1Nx48.js")},{id:"mojo",name:"Mojo",import:()=>import("./mojo--7WWnkdy.js")},{id:"move",name:"Move",import:()=>import("./move-DOHBU7tp.js")},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>import("./narrat-B9CT-1u6.js")},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>import("./nextflow-DBxHOdLe.js")},{id:"nginx",name:"Nginx",import:()=>import("./nginx-C3DmzmOp.js")},{id:"nim",name:"Nim",import:()=>import("./nim-BjhyiCLB.js")},{id:"nix",name:"Nix",import:()=>import("./nix-B7rNE5kf.js")},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>import("./nushell-CrgTADc5.js")},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>import("./objective-c-DHmGyzbM.js")},{id:"objective-cpp",name:"Objective-C++",import:()=>import("./objective-cpp-BWKJ1FCf.js")},{id:"ocaml",name:"OCaml",import:()=>import("./ocaml-RqY_Nz63.js")},{id:"pascal",name:"Pascal",import:()=>import("./pascal-BvCdDh2R.js")},{id:"perl",name:"Perl",import:()=>import("./perl-PZnu_VA7.js")},{id:"php",name:"PHP",import:()=>import("./php-m9Z3qs_k.js")},{id:"plsql",name:"PL/SQL",import:()=>import("./plsql-BbJj1K1w.js")},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>import("./po-HrnDn_2Q.js")},{id:"postcss",name:"PostCSS",import:()=>import("./postcss-DXT9h7v2.js")},{id:"powerquery",name:"PowerQuery",import:()=>import("./powerquery-CApMHEaB.js")},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>import("./powershell-9ZOzOPqN.js")},{id:"prisma",name:"Prisma",import:()=>import("./prisma-BBJYjQ0k.js")},{id:"prolog",name:"Prolog",import:()=>import("./prolog-BH_RS3WO.js")},{id:"proto",name:"Protocol Buffer 3",import:()=>import("./proto-DOtRmeXT.js")},{id:"pug",name:"Pug",aliases:["jade"],import:()=>import("./pug-jyQP1XtO.js")},{id:"puppet",name:"Puppet",import:()=>import("./puppet-37ic6j3l.js")},{id:"purescript",name:"PureScript",import:()=>import("./purescript-Bm5O5oLm.js")},{id:"python",name:"Python",aliases:["py"],import:()=>import("./python-DwuVtWc2.js")},{id:"qml",name:"QML",import:()=>import("./qml-DM3j-f55.js")},{id:"qmldir",name:"QML Directory",import:()=>import("./qmldir-MS3qTAOR.js")},{id:"qss",name:"Qt Style Sheets",import:()=>import("./qss-FJDVp-XM.js")},{id:"r",name:"R",import:()=>import("./r-BXfENWL6.js")},{id:"racket",name:"Racket",import:()=>import("./racket-BbLA0SU8.js")},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>import("./raku-D384ylkT.js")},{id:"razor",name:"ASP.NET Razor",import:()=>import("./razor-DokJXJPk.js")},{id:"reg",name:"Windows Registry Script",import:()=>import("./reg-CrhH3_Og.js")},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>import("./regexp-C_ZPRiAj.js")},{id:"rel",name:"Rel",import:()=>import("./rel-BuawaRXJ.js")},{id:"riscv",name:"RISC-V",import:()=>import("./riscv-D-aEEwJo.js")},{id:"rst",name:"reStructuredText",import:()=>import("./rst-DlAMacAQ.js")},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>import("./ruby-eQ1iIi6H.js")},{id:"rust",name:"Rust",aliases:["rs"],import:()=>import("./rust-DGxQkqYo.js")},{id:"sas",name:"SAS",import:()=>import("./sas-BhBoFsCt.js")},{id:"sass",name:"Sass",import:()=>import("./sass-CMDmr8et.js")},{id:"scala",name:"Scala",import:()=>import("./scala-Cd0cRMx9.js")},{id:"scheme",name:"Scheme",import:()=>import("./scheme-BTeww-4z.js")},{id:"scss",name:"SCSS",import:()=>import("./scss-DoQ2ojfq.js")},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>import("./shaderlab-Bb-6Dmi7.js")},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>import("./shellscript-BZfs-ost.js")},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>import("./shellsession-B6XH_PlG.js")},{id:"smalltalk",name:"Smalltalk",import:()=>import("./smalltalk-DSsji4Hu.js")},{id:"solidity",name:"Solidity",import:()=>import("./solidity-CThH5sBG.js")},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>import("./soy-rVg8SA9F.js")},{id:"sparql",name:"SPARQL",import:()=>import("./sparql-Cmp61EUJ.js")},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>import("./splunk-6XBPEST2.js")},{id:"sql",name:"SQL",import:()=>import("./sql-DxR2xW-a.js")},{id:"ssh-config",name:"SSH Config",import:()=>import("./ssh-config-BH1M7C1g.js")},{id:"stata",name:"Stata",import:()=>import("./stata-DGeqZgIM.js")},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>import("./stylus-DSrLtGYv.js")},{id:"svelte",name:"Svelte",import:()=>import("./svelte-BMtjZn0z.js")},{id:"swift",name:"Swift",import:()=>import("./swift-C8WrqfNz.js")},{id:"system-verilog",name:"SystemVerilog",import:()=>import("./system-verilog-BscxmKrE.js")},{id:"systemd",name:"Systemd Units",import:()=>import("./systemd-IQPSIA3x.js")},{id:"tasl",name:"Tasl",import:()=>import("./tasl-BxwAa5i0.js")},{id:"tcl",name:"Tcl",import:()=>import("./tcl-C_8Fx7bH.js")},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>import("./terraform-DBeuZS66.js")},{id:"tex",name:"TeX",import:()=>import("./tex-BqVuN0dX.js")},{id:"toml",name:"TOML",import:()=>import("./toml-BT9ZzGyQ.js")},{id:"tsv",name:"TSV",import:()=>import("./tsv-DnLUQrgA.js")},{id:"tsx",name:"TSX",import:()=>import("./tsx-BlxWTfDV.js")},{id:"turtle",name:"Turtle",import:()=>import("./turtle-C15OxdQ5.js")},{id:"twig",name:"Twig",import:()=>import("./twig-DDlPLETn.js")},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>import("./typescript-DC8MraHL.js")},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>import("./typespec-DAP_O-zg.js")},{id:"typst",name:"Typst",aliases:["typ"],import:()=>import("./typst-I4qd5QHW.js")},{id:"v",name:"V",import:()=>import("./v-C2TBxDwV.js")},{id:"vala",name:"Vala",import:()=>import("./vala-CO5hpdkB.js")},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>import("./vb-beD-FUib.js")},{id:"verilog",name:"Verilog",import:()=>import("./verilog-DVfdqzEq.js")},{id:"vhdl",name:"VHDL",import:()=>import("./vhdl-QZ3jNtnE.js")},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>import("./viml-BLluXI4E.js")},{id:"vue",name:"Vue",import:()=>import("./vue-CSQt1zmP.js")},{id:"vue-html",name:"Vue HTML",import:()=>import("./vue-html-Bjmswp-o.js")},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>import("./vyper-o-cPXEvd.js")},{id:"wasm",name:"WebAssembly",import:()=>import("./wasm-Cicx_DS6.js")},{id:"wenyan",name:"Wenyan",aliases:["\u6587\u8A00"],import:()=>import("./wenyan-Cavfe_d0.js")},{id:"wgsl",name:"WGSL",import:()=>import("./wgsl-BZz1Hhek.js")},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>import("./wikitext-zfUCmn4z.js")},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>import("./wolfram-BICIrM8O.js")},{id:"xml",name:"XML",import:()=>import("./xml-sp2Egr0Z.js")},{id:"xsl",name:"XSL",import:()=>import("./xsl-BQYvujlj.js")},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>import("./yaml-C5gCGmDW.js")},{id:"zenscript",name:"ZenScript",import:()=>import("./zenscript-B1nm99XP.js")},{id:"zig",name:"Zig",import:()=>import("./zig-xtV5iK4E.js")}],fh=Object.fromEntries(Oo.map(t=>[t.id,t.import])),hh=Object.fromEntries(Oo.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),Po={...fh,...hh},ph=a(async t=>import("./wasm-2oxoyaYy.js").then(e=>e.default(t)),"getWasmInlined"),dh=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>import("./andromeeda-YxQm0tCS.js")},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>import("./aurora-x-BaWyeHV_.js")},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>import("./ayu-dark-Bn5gmY5k.js")},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:()=>import("./catppuccin-frappe-BsOrZxH8.js")},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>import("./catppuccin-latte-BYdKNJ10.js")},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>import("./catppuccin-macchiato-DVLwECkk.js")},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>import("./catppuccin-mocha-CEfge3mM.js")},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>import("./dark-plus-KEYLhlmT.js")},{id:"dracula",displayName:"Dracula",type:"dark",import:()=>import("./dracula-DGO8GyiP.js")},{id:"dracula-soft",displayName:"Dracula Soft",type:"dark",import:()=>import("./dracula-soft-9B1nZgL-.js")},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>import("./github-dark-CzPA46E-.js")},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>import("./github-dark-default-BXF7Vm5l.js")},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>import("./github-dark-dimmed-CRDKj6ck.js")},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>import("./github-light-CRlnGVMD.js")},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>import("./github-light-default-UREJT2Bw.js")},{id:"houston",displayName:"Houston",type:"dark",import:()=>import("./houston-CZZ6oYdA.js")},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>import("./light-plus-BsvsQ1iS.js")},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>import("./material-theme-B2BuIiKK.js")},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>import("./material-theme-darker-BrGg7AAd.js")},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>import("./material-theme-lighter-DDRuGeQH.js")},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>import("./material-theme-ocean-CBL0qBdF.js")},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>import("./material-theme-palenight-D7gg1Usp.js")},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>import("./min-dark-iSbrOpM4.js")},{id:"min-light",displayName:"Min Light",type:"light",import:()=>import("./min-light-BITGhEdf.js")},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>import("./monokai-sMI-pExk.js")},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>import("./night-owl-BeocmOPF.js")},{id:"nord",displayName:"Nord",type:"dark",import:()=>import("./nord-CsyjKwr8.js")},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>import("./one-dark-pro-BTtaZsq5.js")},{id:"one-light",displayName:"One Light",type:"light",import:()=>import("./one-light-alpzPJ78.js")},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>import("./poimandres-Cda-MJFk.js")},{id:"red",displayName:"Red",type:"dark",import:()=>import("./red-jaXbsbtS.js")},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:()=>import("./rose-pine-BIAFg_EN.js")},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:()=>import("./rose-pine-dawn-C5m_N-6l.js")},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:()=>import("./rose-pine-moon-B9S0JTD1.js")},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>import("./slack-dark-C7oZ9nno.js")},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>import("./slack-ochin-hXH8Gyq8.js")},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>import("./snazzy-light-CA9nliXM.js")},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>import("./solarized-dark-C86elO-m.js")},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>import("./solarized-light-xPNGhBYe.js")},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>import("./synthwave-84-BBDuFDsq.js")},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>import("./tokyo-night-eJfcURhx.js")},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>import("./vesper-BSB_bK09.js")},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>import("./vitesse-black-B3g-KkBK.js")},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>import("./vitesse-dark-Bxkoe-BC.js")},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>import("./vitesse-light-Br6ll-O0.js")}],mh=Object.fromEntries(dh.map(t=>[t.id,t.import]));var ze;(function(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"})(ze||(ze={})),typeof process<"u"&&process.env.VSCODE_TEXTMATE_DEBUG;var Mt;(function(t){function e(h){return h.toString(2).padStart(32,"0")}a(e,"toBinaryStr"),t.toBinaryStr=e;function n(h){const f=t.getLanguageId(h),p=t.getTokenType(h),d=t.getFontStyle(h),m=t.getForeground(h),g=t.getBackground(h);console.log({languageId:f,tokenType:p,fontStyle:d,foreground:m,background:g})}a(n,"print"),t.print=n;function r(h){return(h&255)>>>0}a(r,"getLanguageId"),t.getLanguageId=r;function i(h){return(h&768)>>>8}a(i,"getTokenType"),t.getTokenType=i;function s(h){return(h&1024)!==0}a(s,"containsBalancedBrackets"),t.containsBalancedBrackets=s;function o(h){return(h&30720)>>>11}a(o,"getFontStyle"),t.getFontStyle=o;function l(h){return(h&16744448)>>>15}a(l,"getForeground"),t.getForeground=l;function u(h){return(h&4278190080)>>>24}a(u,"getBackground"),t.getBackground=u;function c(h,f,p,d,m,g,y){let b=t.getLanguageId(h),w=t.getTokenType(h),k=t.containsBalancedBrackets(h)?1:0,_=t.getFontStyle(h),C=t.getForeground(h),S=t.getBackground(h);return f!==0&&(b=f),p!==8&&(w=p),d!==null&&(k=d?1:0),m!==-1&&(_=m),g!==0&&(C=g),y!==0&&(S=y),(b<<0|w<<8|k<<10|_<<11|C<<15|S<<24)>>>0}a(c,"set"),t.set=c})(Mt||(Mt={}));function BN(t){return t}a(BN,"toOptionalTokenType");function qN(t){return t}a(qN,"fromOptionalTokenType");function Qn(t,e){const n=[],r=gh(t);let i=r.next();for(;i!==null;){let u=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":u=1;break;case"L":u=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=o();if(n.push({matcher:c,priority:u}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const u=s();return c=>!!u&&!u(c)}if(i==="("){i=r.next();const u=l();return i===")"&&(i=r.next()),u}if(Do(i)){const u=[];do u.push(i),i=r.next();while(Do(i));return c=>e(u,c)}return null}function o(){const u=[];let c=s();for(;c;)u.push(c),c=s();return h=>u.every(f=>f(h))}function l(){const u=[];let c=o();for(;c&&(u.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=o()}return h=>u.some(f=>f(h))}}a(Qn,"createMatchers");function Do(t){return!!t&&!!t.match(/[\w\.:]+/)}a(Do,"isIdentifier");function gh(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}}}a(gh,"newTokenizer");function Ro(t){typeof t.dispose=="function"&&t.dispose()}a(Ro,"disposeOnigString");function yh(t){return hi(t)}a(yh,"clone");function hi(t){return Array.isArray(t)?bh(t):typeof t=="object"?wh(t):t}a(hi,"doClone");function bh(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=hi(t[n]);return e}a(bh,"cloneArray");function wh(t){let e={};for(let n in t)e[n]=hi(t[n]);return e}a(wh,"cloneObj");function Fo(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}a(Fo,"mergeObjects");function Mo(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Mo(t.substring(0,t.length-1)):t.substr(~e+1)}a(Mo,"basename$1");let pi=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;class Xn{static{a(this,"RegexSource")}static hasCaptures(e){return e===null?!1:(pi.lastIndex=0,pi.test(e))}static replaceCaptures(e,n,r){return e.replace(pi,(i,s,o,l)=>{let u=r[parseInt(s||o,10)];if(u){let c=n.substring(u.start,u.end);for(;c[0]===".";)c=c.substring(1);switch(l){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return i})}}function $o(t,e){return t<e?-1:t>e?1:0}a($o,"strcmp");function Bo(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 i=0;i<n;i++){let s=$o(t[i],e[i]);if(s!==0)return s}return 0}return n-r}a(Bo,"strArrCmp");function qo(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))}a(qo,"isValidHexColor");function zo(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}a(zo,"escapeRegExpCharacters");class Uo{static{a(this,"CachedFn")}fn;cache=new Map;constructor(e){this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const n=this.fn(e);return this.cache.set(e,n),n}}class yn{static{a(this,"TopLevelRuleReference")}scopeName;constructor(e){this.scopeName=e}toKey(){return this.scopeName}}class kh{static{a(this,"TopLevelRepositoryRuleReference")}scopeName;ruleName;constructor(e,n){this.scopeName=e,this.ruleName=n}toKey(){return`${this.scopeName}#${this.ruleName}`}}class Sh{static{a(this,"ExternalReferenceCollector")}_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const n=e.toKey();this._seenReferenceKeys.has(n)||(this._seenReferenceKeys.add(n),this._references.push(e))}}class xh{static{a(this,"ScopeDependencyProcessor")}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;constructor(e,n){this.repo=e,this.initialScopeName=n,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new yn(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const n=new Sh;for(const r of e)vh(r,this.initialScopeName,this.repo,n);for(const r of n.references)if(r instanceof yn){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}}function vh(t,e,n,r){const i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const s=n.lookup(e);t instanceof yn?Zn({baseGrammar:s,selfGrammar:i},r):di(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(t.scopeName);if(o)for(const l of o)r.add(new yn(l))}a(vh,"collectReferencesOfReference");function di(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];er([r],e,n)}}a(di,"collectExternalReferencesInTopLevelRepositoryRule");function Zn(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&er(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&er(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}a(Zn,"collectExternalReferencesInTopLevelRule");function er(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Fo({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&er(r.patterns,{...e,repository:i},n);const s=r.include;if(!s)continue;const o=jo(s);switch(o.kind){case 0:Zn({...e,selfGrammar:e.baseGrammar},n);break;case 1:Zn(e,n);break;case 2:di(o.ruleName,{...e,repository:i},n);break;case 3:case 4:const l=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const u={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};o.kind===4?di(o.ruleName,u,n):Zn(u,n)}else o.kind===4?n.add(new kh(o.scopeName,o.ruleName)):n.add(new yn(o.scopeName));break}}}a(er,"collectExternalReferencesInRules");class _h{static{a(this,"BaseReference")}kind=0}class Ch{static{a(this,"SelfReference")}kind=1}class Nh{static{a(this,"RelativeReference")}ruleName;kind=2;constructor(e){this.ruleName=e}}class Ah{static{a(this,"TopLevelReference")}scopeName;kind=3;constructor(e){this.scopeName=e}}class Eh{static{a(this,"TopLevelRepositoryReference")}scopeName;ruleName;kind=4;constructor(e,n){this.scopeName=e,this.ruleName=n}}function jo(t){if(t==="$base")return new _h;if(t==="$self")return new Ch;const e=t.indexOf("#");if(e===-1)return new Ah(t);if(e===0)return new Nh(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new Eh(n,r)}}a(jo,"parseInclude");const Th=/\\(\d+)/,Go=/\\(\d+)/g,Ih=-1,Ho=-2;function zN(t){return t}a(zN,"ruleIdFromNumber");function UN(t){return t}a(UN,"ruleIdToNumber");class bn{static{a(this,"Rule")}$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,n,r,i){this.$location=e,this.id=n,this._name=r||null,this._nameIsCapturing=Xn.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Xn.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Mo(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,n){return!this._nameIsCapturing||this._name===null||e===null||n===null?this._name:Xn.replaceCaptures(this._name,e,n)}getContentName(e,n){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Xn.replaceCaptures(this._contentName,e,n)}}class Lh extends bn{static{a(this,"CaptureRule")}retokenizeCapturedWithRuleId;constructor(e,n,r,i,s){super(e,n,r,i),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,r,i){throw new Error("Not supported!")}}class Oh extends bn{static{a(this,"MatchRule")}_match;captures;_cachedCompiledPatterns;constructor(e,n,r,i,s){super(e,n,r,null),this._match=new Tt(i,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class Vo extends bn{static{a(this,"IncludeOnlyRule")}hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,n,r,i,s){super(e,n,r,i),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const r of this.patterns)e.getRule(r).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class mi extends bn{static{a(this,"BeginEndRule")}_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,n,r,i,s,o,l,u,c,h){super(e,n,r,i),this._begin=new Tt(s,this.id),this.beginCaptures=o,this._end=new Tt(l||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=u,this.applyEndPatternLast=c||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.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(e,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e,n).compileAG(e,r,i)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wn;for(const r of this.patterns)e.getRule(r).collectPatterns(e,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,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}}class tr extends bn{static{a(this,"BeginWhileRule")}_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,n,r,i,s,o,l,u,c){super(e,n,r,i),this._begin=new Tt(s,this.id),this.beginCaptures=o,this.whileCaptures=u,this._while=new Tt(l,Ho),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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(e,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wn;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,r,i){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,r,i)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new wn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"\uFFFF"),this._cachedCompiledWhilePatterns}}class ce{static{a(this,"RuleFactory")}static createCaptureRule(e,n,r,i,s){return e.registerRule(o=>new Lh(n,o,r,i,s))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new Oh(e.$vscodeTextmateLocation,e.id,e.name,e.match,ce._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Fo({},r,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new Vo(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,ce._compilePatterns(s,n,r))}return e.while?new tr(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ce._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,ce._compileCaptures(e.whileCaptures||e.captures,n,r),ce._compilePatterns(e.patterns,n,r)):new mi(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ce._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,ce._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,ce._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let s=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const l=parseInt(o,10);l>s&&(s=l)}for(let o=0;o<=s;o++)i[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const l=parseInt(o,10);let u=0;e[o].patterns&&(u=ce.getCompiledRuleId(e[o],n,r)),i[l]=ce.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,u)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let s=0,o=e.length;s<o;s++){const l=e[s];let u=-1;if(l.include){const c=jo(l.include);switch(c.kind){case 0:case 1:u=ce.getCompiledRuleId(r[l.include],n,r);break;case 2:let h=r[c.ruleName];h&&(u=ce.getCompiledRuleId(h,n,r));break;case 3:case 4:const f=c.scopeName,p=c.kind===4?c.ruleName:null,d=n.getExternalGrammar(f,r);if(d)if(p){let m=d.repository[p];m&&(u=ce.getCompiledRuleId(m,n,d.repository))}else u=ce.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else u=ce.getCompiledRuleId(l,n,r);if(u!==-1){const c=n.getRule(u);let h=!1;if((c instanceof Vo||c instanceof mi||c instanceof tr)&&c.hasMissingPatterns&&c.patterns.length===0&&(h=!0),h)continue;i.push(u)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}}class Tt{static{a(this,"RegExpSource")}source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e){const r=e.length;let i=0,s=[],o=!1;for(let l=0;l<r;l++)if(e.charAt(l)==="\\"&&l+1<r){const c=e.charAt(l+1);c==="z"?(s.push(e.substring(i,l)),s.push("$(?!\\n)(?<!\\n)"),i=l+2):(c==="A"||c==="G")&&(o=!0),l++}this.hasAnchor=o,i===0?this.source=e:(s.push(e.substring(i,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,this.hasBackReferences=Th.test(this.source)}clone(){return new Tt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){let r=n.map(i=>e.substring(i.start,i.end));return Go.lastIndex=0,this.source.replace(Go,(i,s)=>zo(r[parseInt(s,10)]||""))}_buildAnchorCache(){let e=[],n=[],r=[],i=[],s,o,l,u;for(s=0,o=this.source.length;s<o;s++)l=this.source.charAt(s),e[s]=l,n[s]=l,r[s]=l,i[s]=l,l==="\\"&&s+1<o&&(u=this.source.charAt(s+1),u==="A"?(e[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",i[s+1]="A"):u==="G"?(e[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",i[s+1]="G"):(e[s+1]=u,n[s+1]=u,r[s+1]=u,i[s+1]=u),s++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}}class wn{static{a(this,"RegExpSourceList")}_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(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,n){this._items[e].source!==n&&(this._disposeCaches(),this._items[e].setSource(n))}compile(e){if(!this._cached){let n=this._items.map(r=>r.source);this._cached=new Wo(e,n,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,n,r){return this._hasAnchors?n?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,n,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,n,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,n,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,n,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,n,r){let i=this._items.map(s=>s.resolveAnchors(n,r));return new Wo(e,i,this._items.map(s=>s.ruleId))}}class Wo{static{a(this,"CompiledRule")}regExps;rules;scanner;constructor(e,n,r){this.regExps=n,this.rules=r,this.scanner=e.createOnigScanner(n)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let n=0,r=this.rules.length;n<r;n++)e.push(" - "+this.rules[n]+": "+this.regExps[n]);return e.join(`
|
|
12
12
|
`)}findNextMatchSync(e,n,r){const i=this.scanner.findNextMatchSync(e,n,r);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}}class nr{static{a(this,"Theme")}_colorMap;_defaults;_root;static createFromRawTheme(e,n){return this.createFromParsedTheme(Rh(e),n)}static createFromParsedTheme(e,n){return Mh(e,n)}_cachedMatchRoot=new Uo(e=>this._root.match(e));constructor(e,n,r){this._colorMap=e,this._defaults=n,this._root=r}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const n=e.scopeName,i=this._cachedMatchRoot.get(n).find(s=>Ph(e.parent,s.parentScopes));return i?new Ko(i.fontStyle,i.foreground,i.background):null}}class It{static{a(this,"ScopeStack")}parent;scopeName;static push(e,n){for(const r of n)e=new It(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new It(n,e[r]);return n}constructor(e,n){this.parent=e,this.scopeName=n}push(e){return new It(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 Ph(t,e){if(e===null)return!0;let n=0,r=e[n];for(;t;){if(Dh(t.scopeName,r)){if(n++,n===e.length)return!0;r=e[n]}t=t.parent}return!1}a(Ph,"_scopePathMatchesParentScopes");function Dh(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}a(Dh,"_matchesScope");class Ko{static{a(this,"StyleAttributes")}fontStyle;foregroundId;backgroundId;constructor(e,n,r){this.fontStyle=e,this.foregroundId=n,this.backgroundId=r}}function Rh(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,s=e.length;i<s;i++){let o=e[i];if(!o.settings)continue;let l;if(typeof o.scope=="string"){let f=o.scope;f=f.replace(/^[,]+/,""),f=f.replace(/[,]+$/,""),l=f.split(",")}else Array.isArray(o.scope)?l=o.scope:l=[""];let u=-1;if(typeof o.settings.fontStyle=="string"){u=0;let f=o.settings.fontStyle.split(" ");for(let p=0,d=f.length;p<d;p++)switch(f[p]){case"italic":u=u|1;break;case"bold":u=u|2;break;case"underline":u=u|4;break;case"strikethrough":u=u|8;break}}let c=null;typeof o.settings.foreground=="string"&&qo(o.settings.foreground)&&(c=o.settings.foreground);let h=null;typeof o.settings.background=="string"&&qo(o.settings.background)&&(h=o.settings.background);for(let f=0,p=l.length;f<p;f++){let m=l[f].trim().split(" "),g=m[m.length-1],y=null;m.length>1&&(y=m.slice(0,m.length-1),y.reverse()),n[r++]=new Fh(g,y,i,u,c,h)}}return n}a(Rh,"parseTheme");class Fh{static{a(this,"ParsedThemeRule")}scope;parentScopes;index;fontStyle;foreground;background;constructor(e,n,r,i,s,o){this.scope=e,this.parentScopes=n,this.index=r,this.fontStyle=i,this.foreground=s,this.background=o}}function Mh(t,e){t.sort((u,c)=>{let h=$o(u.scope,c.scope);return h!==0||(h=Bo(u.parentScopes,c.parentScopes),h!==0)?h:u.index-c.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let u=t.shift();u.fontStyle!==-1&&(n=u.fontStyle),u.foreground!==null&&(r=u.foreground),u.background!==null&&(i=u.background)}let s=new $h(e),o=new Ko(n,s.getId(r),s.getId(i)),l=new Gn(new jn(0,null,-1,0,0),[]);for(let u=0,c=t.length;u<c;u++){let h=t[u];l.insert(0,h.scope,h.parentScopes,h.fontStyle,s.getId(h.foreground),s.getId(h.background))}return new nr(s,o,l)}a(Mh,"resolveParsedThemeRules");class $h{static{a(this,"ColorMap")}_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let n=0,r=e.length;n<r;n++)this._color2id[e[n]]=n,this._id2color[n]=e[n]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let n=this._color2id[e];if(n)return n;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return n=++this._lastColorId,this._color2id[e]=n,this._id2color[n]=e,n}getColorMap(){return this._id2color.slice(0)}}class jn{static{a(this,"ThemeTrieElementRule")}scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,i,s){this.scopeDepth=e,this.parentScopes=n,this.fontStyle=r,this.foreground=i,this.background=s}clone(){return new jn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,i=e.length;r<i;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}}class Gn{static{a(this,"ThemeTrieElement")}_mainRule;_children;_rulesWithParentScopes;constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _sortBySpecificity(e){return e.length===1||e.sort(this._cmpBySpecificity),e}static _cmpBySpecificity(e,n){if(e.scopeDepth===n.scopeDepth){const r=e.parentScopes,i=n.parentScopes;let s=r===null?0:r.length,o=i===null?0:i.length;if(s===o)for(let l=0;l<s;l++){const u=r[l].length,c=i[l].length;if(u!==c)return c-u}return o-s}return n.scopeDepth-e.scopeDepth}match(e){if(e==="")return Gn._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes));let n=e.indexOf("."),r,i;return n===-1?(r=e,i=""):(r=e.substring(0,n),i=e.substring(n+1)),this._children.hasOwnProperty(r)?this._children[r].match(i):Gn._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes))}insert(e,n,r,i,s,o){if(n===""){this._doInsertHere(e,r,i,s,o);return}let l=n.indexOf("."),u,c;l===-1?(u=n,c=""):(u=n.substring(0,l),c=n.substring(l+1));let h;this._children.hasOwnProperty(u)?h=this._children[u]:(h=new Gn(this._mainRule.clone(),jn.cloneArr(this._rulesWithParentScopes)),this._children[u]=h),h.insert(e+1,c,r,i,s,o)}_doInsertHere(e,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(e,r,i,s);return}for(let o=0,l=this._rulesWithParentScopes.length;o<l;o++){let u=this._rulesWithParentScopes[o];if(Bo(u.parentScopes,n)===0){u.acceptOverwrite(e,r,i,s);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new jn(e,n,r,i,s))}}class gi{static{a(this,"BasicScopeAttributes")}languageId;tokenType;constructor(e,n){this.languageId=e,this.tokenType=n}}class Zr{static{a(this,"BasicScopeAttributesProvider")}_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new gi(e,8),this._embeddedLanguagesMatcher=new Bh(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Zr._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new gi(0,0);_getBasicScopeAttributes=new Uo(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new gi(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(Zr.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/}class Bh{static{a(this,"ScopeMatcher")}values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const n=e.map(([r,i])=>zo(r));n.sort(),n.reverse(),this.scopesRegExp=new RegExp(`^((${n.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const n=e.match(this.scopesRegExp);if(n)return this.values.get(n[1])}}class Yo{static{a(this,"TokenizeStringResult")}stack;stoppedEarly;constructor(e,n){this.stack=e,this.stoppedEarly=n}}function Jo(t,e,n,r,i,s,o,l){const u=e.content.length;let c=!1,h=-1;if(o){const d=qh(t,e,n,r,i,s);i=d.stack,r=d.linePos,n=d.isFirstLine,h=d.anchorPosition}const f=Date.now();for(;!c;){if(l!==0&&Date.now()-f>l)return new Yo(i,!0);p()}return new Yo(i,!1);function p(){const d=zh(t,e,n,r,i,h);if(!d){s.produce(i,u),c=!0;return}const m=d.captureIndices,g=d.matchedRuleId,y=m&&m.length>0?m[0].end>r:!1;if(g===Ih){const b=i.getRule(t);s.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),kn(t,e,n,i,s,b.endCaptures,m),s.produce(i,m[0].end);const w=i;if(i=i.parent,h=w.getAnchorPos(),!y&&w.getEnterPos()===r){i=w,s.produce(i,u),c=!0;return}}else{const b=t.getRule(g);s.produce(i,m[0].start);const w=i,k=b.getName(e.content,m),_=i.contentNameScopesList.pushAttributed(k,t);if(i=i.push(g,r,h,m[0].end===u,null,_,_),b instanceof mi){const C=b;kn(t,e,n,i,s,C.beginCaptures,m),s.produce(i,m[0].end),h=m[0].end;const S=C.getContentName(e.content,m),A=_.pushAttributed(S,t);if(i=i.withContentNameScopesList(A),C.endHasBackReferences&&(i=i.withEndRule(C.getEndWithResolvedBackReferences(e.content,m))),!y&&w.hasSameRuleAs(i)){i=i.pop(),s.produce(i,u),c=!0;return}}else if(b instanceof tr){const C=b;kn(t,e,n,i,s,C.beginCaptures,m),s.produce(i,m[0].end),h=m[0].end;const S=C.getContentName(e.content,m),A=_.pushAttributed(S,t);if(i=i.withContentNameScopesList(A),C.whileHasBackReferences&&(i=i.withEndRule(C.getWhileWithResolvedBackReferences(e.content,m))),!y&&w.hasSameRuleAs(i)){i=i.pop(),s.produce(i,u),c=!0;return}}else if(kn(t,e,n,i,s,b.captures,m),s.produce(i,m[0].end),i=i.pop(),!y){i=i.safePop(),s.produce(i,u),c=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}a(Jo,"_tokenizeString");function qh(t,e,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const l=[];for(let u=i;u;u=u.pop()){const c=u.getRule(t);c instanceof tr&&l.push({rule:c,stack:u})}for(let u=l.pop();u;u=l.pop()){const{ruleScanner:c,findOptions:h}=Gh(u.rule,t,u.stack.endRule,n,r===o),f=c.findNextMatchSync(e,r,h);if(f){if(f.ruleId!==Ho){i=u.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(s.produce(u.stack,f.captureIndices[0].start),kn(t,e,n,u.stack,s,u.rule.whileCaptures,f.captureIndices),s.produce(u.stack,f.captureIndices[0].end),o=f.captureIndices[0].end,f.captureIndices[0].end>r&&(r=f.captureIndices[0].end,n=!1))}else{i=u.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}a(qh,"_checkWhileConditions");function zh(t,e,n,r,i,s){const o=Uh(t,e,n,r,i,s),l=t.getInjections();if(l.length===0)return o;const u=jh(l,t,e,n,r,i,s);if(!u)return o;if(!o)return u;const c=o.captureIndices[0].start,h=u.captureIndices[0].start;return h<c||u.priorityMatch&&h===c?u:o}a(zh,"matchRuleOrInjections");function Uh(t,e,n,r,i,s){const o=i.getRule(t),{ruleScanner:l,findOptions:u}=Qo(o,t,i.endRule,n,r===s),c=l.findNextMatchSync(e,r,u);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}a(Uh,"matchRule");function jh(t,e,n,r,i,s,o){let l=Number.MAX_VALUE,u=null,c,h=0;const f=s.contentNameScopesList.getScopeNames();for(let p=0,d=t.length;p<d;p++){const m=t[p];if(!m.matcher(f))continue;const g=e.getRule(m.ruleId),{ruleScanner:y,findOptions:b}=Qo(g,e,null,r,i===o),w=y.findNextMatchSync(n,i,b);if(!w)continue;const k=w.captureIndices[0].start;if(!(k>=l)&&(l=k,u=w.captureIndices,c=w.ruleId,h=m.priority,l===i))break}return u?{priorityMatch:h===-1,captureIndices:u,matchedRuleId:c}:null}a(jh,"matchInjections");function Qo(t,e,n,r,i){return{ruleScanner:t.compileAG(e,n,r,i),findOptions:0}}a(Qo,"prepareRuleSearch");function Gh(t,e,n,r,i){return{ruleScanner:t.compileWhileAG(e,n,r,i),findOptions:0}}a(Gh,"prepareRuleWhileSearch");function kn(t,e,n,r,i,s,o){if(s.length===0)return;const l=e.content,u=Math.min(s.length,o.length),c=[],h=o[0].end;for(let f=0;f<u;f++){const p=s[f];if(p===null)continue;const d=o[f];if(d.length===0)continue;if(d.start>h)break;for(;c.length>0&&c[c.length-1].endPos<=d.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,d.start):i.produce(r,d.start),p.retokenizeCapturedWithRuleId){const g=p.getName(l,o),y=r.contentNameScopesList.pushAttributed(g,t),b=p.getContentName(l,o),w=y.pushAttributed(b,t),k=r.push(p.retokenizeCapturedWithRuleId,d.start,-1,!1,null,y,w),_=t.createOnigString(l.substring(0,d.end));Jo(t,_,n&&d.start===0,d.start,k,i,!1,0),Ro(_);continue}const m=p.getName(l,o);if(m!==null){const y=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(m,t);c.push(new Hh(y,d.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}a(kn,"handleCaptures");class Hh{static{a(this,"LocalStackElement")}scopes;endPos;constructor(e,n){this.scopes=e,this.endPos=n}}function Vh(t,e,n,r,i,s,o,l){return new Kh(t,e,n,r,i,s,o,l)}a(Vh,"createGrammar");function Xo(t,e,n,r,i){const s=Qn(e,rr),o=ce.getCompiledRuleId(n,r,i.repository);for(const l of s)t.push({debugSelector:e,matcher:l.matcher,ruleId:o,grammar:i,priority:l.priority})}a(Xo,"collectInjections");function rr(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let i=n;i<e.length;i++)if(Wh(e[i],r))return n=i+1,!0;return!1})}a(rr,"nameMatcher");function Wh(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]==="."}a(Wh,"scopesAreMatching");class Kh{static{a(this,"Grammar")}_rootScopeName;balancedBracketSelectors;_onigLib;_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}constructor(e,n,r,i,s,o,l,u){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=u,this._basicScopeAttributesProvider=new Zr(r,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=Zo(n,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const c of Object.keys(s)){const h=Qn(c,rr);for(const f of h)this._tokenTypeMatchers.push({matcher:f.matcher,type:s[c]})}}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},n=[],r=this._rootScopeName,i=e.lookup(r);if(i){const s=i.injections;if(s)for(let l in s)Xo(n,l,s[l],this,i);const o=this._grammarRepository.injections(r);o&&o.forEach(l=>{const u=this.getExternalGrammar(l);if(u){const c=u.injectionSelector;c&&Xo(n,c,u,this,u)}})}return n.sort((s,o)=>s.priority-o.priority),n}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const n=++this._lastRuleId,r=e(n);return this._ruleId2desc[n]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,n){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=Zo(r,n&&n.$base),this._includedGrammars[e]}}tokenizeLine(e,n,r=0){const i=this._tokenize(e,n,!1,r);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,n,r=0){const i=this._tokenize(e,n,!0,r);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,n,r,i){this._rootId===-1&&(this._rootId=ce.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!n||n===Ke.NULL){s=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),f=this.themeProvider.getDefaults(),p=Mt.set(0,h.languageId,h.tokenType,null,f.fontStyle,f.foregroundId,f.backgroundId),d=this.getRule(this._rootId).getName(null,null);let m;d?m=we.createRootAndLookUpScopeName(d,p,this):m=we.createRoot("unknown",p),n=new Ke(null,this._rootId,-1,-1,!1,null,m,m)}else s=!1,n.reset();e=e+`
|
|
13
13
|
`;const o=this.createOnigString(e),l=o.content.length,u=new Jh(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Jo(this,o,s,0,n,u,!0,i);return Ro(o),{lineLength:l,lineTokens:u,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}}function Zo(t,e){return t=yh(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}a(Zo,"initGrammar");class we{static{a(this,"AttributedScopeStack")}parent;scopePath;tokenAttributes;static fromExtension(e,n){let r=e,i=e?.scopePath??null;for(const s of n)i=It.push(i,s.scopeNames),r=new we(r,i,s.encodedTokenAttributes);return r}static createRoot(e,n){return new we(null,new It(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const i=r.getMetadataForScope(e),s=new It(null,e),o=r.themeProvider.themeMatch(s),l=we.mergeAttributes(n,i,o);return new we(null,s,l)}get scopeName(){return this.scopePath.scopeName}constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}toString(){return this.getScopeNames().join(" ")}equals(e){return we.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 i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),Mt.set(e,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return we._pushAttributed(this,e,n);const r=e.split(/ /g);let i=this;for(const s of r)i=we._pushAttributed(i,s,n);return i}static _pushAttributed(e,n,r){const i=r.getMetadataForScope(n),s=e.scopePath.push(n),o=r.themeProvider.themeMatch(s),l=we.mergeAttributes(e.tokenAttributes,i,o);return new we(e,s,l)}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}}class Ke{static{a(this,"StateStackImpl")}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_stackElementBrand=void 0;static NULL=new Ke(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;constructor(e,n,r,i,s,o,l,u){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=l,this.contentNameScopesList=u,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(e){return e===null?!1:Ke._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?we.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(){Ke._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,i,s,o,l){return new Ke(this,e,n,r,i,s,o,l)}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 Ke(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=we.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new Ke(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,we.fromExtension(r,n.contentNameScopesList))}}class Yh{static{a(this,"BalancedBracketSelectors")}balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,n){this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):Qn(r,rr).map(i=>i.matcher)),this.unbalancedBracketScopes=n.flatMap(r=>Qn(r,rr).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const n of this.unbalancedBracketScopes)if(n(e))return!1;for(const n of this.balancedBracketScopes)if(n(e))return!0;return this.allowAny}}class Jh{static{a(this,"LineTokens")}balancedBracketSelectors;_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;constructor(e,n,r,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,n){this.produceFromScopes(e.contentNameScopesList,n)}produceFromScopes(e,n){if(this._lastTokenEndIndex>=n)return;if(this._emitBinaryTokens){let i=e?.tokenAttributes??0,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const l of this._tokenTypeOverrides)l.matcher(o)&&(i=Mt.set(i,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(o))}if(s&&(i=Mt.set(i,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=n;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=n;return}const r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:n,scopes:r}),this._lastTokenEndIndex=n}getResult(e,n){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===n-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,n),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,n){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===n-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,n),this._binaryTokens[this._binaryTokens.length-2]=0);const r=new Uint32Array(this._binaryTokens.length);for(let i=0,s=this._binaryTokens.length;i<s;i++)r[i]=this._binaryTokens[i];return r}}class Qh{static{a(this,"SyncRegistry")}_onigLibPromise;_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;constructor(e,n){this._onigLibPromise=n,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,n){this._rawGrammars.set(e.scopeName,e),n&&this._injectionGrammars.set(e.scopeName,n)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}async grammarForScopeName(e,n,r,i,s){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,Vh(e,o,n,r,i,s,this,await this._onigLibPromise))}return this._grammars.get(e)}}let Xh=class{static{a(this,"Registry")}_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Qh(nr.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(nr.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 Yh(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}async _loadGrammar(e,n,r,i,s){const o=new xh(this._syncRegistry,e);for(;o.Q.length>0;)await Promise.all(o.Q.map(l=>this._loadSingleGrammar(l.scopeName))),o.processQueue();return this._grammarForScopeName(e,n,r,i,s)}async _loadSingleGrammar(e){return this._ensureGrammarCache.has(e)||this._ensureGrammarCache.set(e,this._doLoadSingleGrammar(e)),this._ensureGrammarCache.get(e)}async _doLoadSingleGrammar(e){const n=await this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}async addGrammar(e,n=[],r=0,i=null){return this._syncRegistry.addGrammar(e,n),await this._grammarForScopeName(e.scopeName,r,i)}_grammarForScopeName(e,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(e,n,r,i,s)}};const Zh=Ke.NULL,pe={LANGUAGEID_MASK:255,TOKEN_TYPE_MASK:768,BALANCED_BRACKETS_MASK:1024,FONT_STYLE_MASK:14336,FOREGROUND_MASK:8372224,BACKGROUND_MASK:4286578688,LANGUAGEID_OFFSET:0,TOKEN_TYPE_OFFSET:8,BALANCED_BRACKETS_OFFSET:10,FONT_STYLE_OFFSET:11,FOREGROUND_OFFSET:15,BACKGROUND_OFFSET:24};class nt{static{a(this,"StackElementMetadata")}static toBinaryStr(e){let n=e.toString(2);for(;n.length<32;)n=`0${n}`;return n}static getLanguageId(e){return(e&pe.LANGUAGEID_MASK)>>>pe.LANGUAGEID_OFFSET}static getTokenType(e){return(e&pe.TOKEN_TYPE_MASK)>>>pe.TOKEN_TYPE_OFFSET}static getFontStyle(e){return(e&pe.FONT_STYLE_MASK)>>>pe.FONT_STYLE_OFFSET}static getForeground(e){return(e&pe.FOREGROUND_MASK)>>>pe.FOREGROUND_OFFSET}static getBackground(e){return(e&pe.BACKGROUND_MASK)>>>pe.BACKGROUND_OFFSET}static containsBalancedBrackets(e){return(e&pe.BALANCED_BRACKETS_MASK)!==0}static set(e,n,r,i,s,o){let l=nt.getLanguageId(e),u=nt.getTokenType(e),c=nt.getFontStyle(e),h=nt.getForeground(e),f=nt.getBackground(e);const p=nt.containsBalancedBrackets(e)?1:0;return n!==0&&(l=n),r!==0&&(u=r===8?0:r),i!==ze.NotSet&&(c=i),s!==0&&(h=s),o!==0&&(f=o),(l<<pe.LANGUAGEID_OFFSET|u<<pe.TOKEN_TYPE_OFFSET|c<<pe.FONT_STYLE_OFFSET|p<<pe.BALANCED_BRACKETS_OFFSET|h<<pe.FOREGROUND_OFFSET|f<<pe.BACKGROUND_OFFSET)>>>0}}function ir(t,e=!1){const n=t.split(/(\r?\n)/g);let r=0;const i=[];for(let s=0;s<n.length;s+=2){const o=e?n[s]+(n[s+1]||""):n[s];i.push([o,r]),r+=n[s].length,r+=n[s+1]?.length||0}return i}a(ir,"splitLines$1");function ea(t){return!t||["plaintext","txt","text","plain"].includes(t)}a(ea,"isPlainLang");function ta(t){return t==="ansi"||ea(t)}a(ta,"isSpecialLang");function na(t){return t==="none"}a(na,"isNoneTheme");function ra(t){return na(t)}a(ra,"isSpecialTheme");function ia(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}a(ia,"addClassToHast");function ep(t,e){let n=0;const r=[];for(const i of e)i>n&&r.push({...t,content:t.content.slice(n,i),offset:t.offset+n}),n=i;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}a(ep,"splitToken");function tp(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((r,i)=>r-i);return n.length?t.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,l)=>o-l);return s.length?ep(i,s):i})):t}a(tp,"splitTokens");function sr(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[i,s]of Object.entries(e?.colorReplacements||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}a(sr,"resolveColorReplacements");function dt(t,e){return t&&(e?.[t?.toLowerCase()]||t)}a(dt,"applyColorReplacements");function sa(t){const e={};return t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle&&(t.fontStyle&ze.Italic&&(e["font-style"]="italic"),t.fontStyle&ze.Bold&&(e["font-weight"]="bold"),t.fontStyle&ze.Underline&&(e["text-decoration"]="underline")),e}a(sa,"getTokenStyleObject");function oa(t){return Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}a(oa,"stringifyTokenStyle");function np(t){const e=ir(t,!0).map(([i])=>i);function n(i){let s=i,o=0;for(const l of e){if(s<l.length)break;s-=l.length,o++}return{line:o,character:s}}a(n,"indexToPos");function r(i,s){let o=0;for(let l=0;l<i;l++)o+=e[l].length;return o+=s,o}return a(r,"posToIndex"),{lines:e,indexToPos:n,posToIndex:r}}a(np,"createPositionConverter");var mt=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],yi={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function rp(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}}a(rp,"findSequence");function aa(t,e){let n=1;const r=t[e+n++];let i;if(r==="2"){const s=[t[e+n++],t[e+n++],t[e+n]].map(o=>Number.parseInt(o));s.length===3&&!s.some(o=>Number.isNaN(o))&&(i={type:"rgb",rgb:s})}else if(r==="5"){const s=Number.parseInt(t[e+n]);Number.isNaN(s)||(i={type:"table",index:Number(s)})}return[n,i]}a(aa,"parseColor");function ip(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=Number.parseInt(r);if(!Number.isNaN(i))if(i===0)e.push({type:"resetAll"});else if(i<=9)yi[i]&&e.push({type:"setDecoration",value:yi[i]});else if(i<=29){const s=yi[i-20];s&&e.push({type:"resetDecoration",value:s})}else if(i<=37)e.push({type:"setForegroundColor",value:{type:"named",name:mt[i-30]}});else if(i===38){const[s,o]=aa(t,n);o&&e.push({type:"setForegroundColor",value:o}),n+=s}else if(i===39)e.push({type:"resetForegroundColor"});else if(i<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:mt[i-40]}});else if(i===48){const[s,o]=aa(t,n);o&&e.push({type:"setBackgroundColor",value:o}),n+=s}else i===49?e.push({type:"resetBackgroundColor"}):i>=90&&i<=97?e.push({type:"setForegroundColor",value:{type:"named",name:mt[i-90+8]}}):i>=100&&i<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:mt[i-100+8]}})}return e}a(ip,"parseSequence");function sp(){let t=null,e=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=rp(r,s),l=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(l.length>0&&i.push({value:l,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const u=ip(o.sequence);for(const c of u)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 u)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}s=o.position}while(s<r.length);return i}}}a(sp,"createAnsiSequenceParser");var op={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 ap(t=op){function e(l){return t[l]}a(e,"namedColor");function n(l){return`#${l.map(u=>Math.max(0,Math.min(u,255)).toString(16).padStart(2,"0")).join("")}`}a(n,"rgbColor");let r;function i(){if(r)return r;r=[];for(let c=0;c<mt.length;c++)r.push(e(mt[c]));let l=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let h=0;h<6;h++)for(let f=0;f<6;f++)r.push(n([l[c],l[h],l[f]]));let u=8;for(let c=0;c<24;c++,u+=10)r.push(n([u,u,u]));return r}a(i,"getColorTable");function s(l){return i()[l]}a(s,"tableColor");function o(l){switch(l.type){case"named":return e(l.name);case"rgb":return n(l.rgb);case"table":return s(l.index)}}return a(o,"value"),{value:o}}a(ap,"createColorPalette");function lp(t,e,n){const r=sr(t,n),i=ir(e),s=ap(Object.fromEntries(mt.map(l=>[l,t.colors?.[`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`]]))),o=sp();return i.map(l=>o.parse(l[0]).map(u=>{let c,h;u.decorations.has("reverse")?(c=u.background?s.value(u.background):t.bg,h=u.foreground?s.value(u.foreground):t.fg):(c=u.foreground?s.value(u.foreground):t.fg,h=u.background?s.value(u.background):void 0),c=dt(c,r),h=dt(h,r),u.decorations.has("dim")&&(c=up(c));let f=ze.None;return u.decorations.has("bold")&&(f|=ze.Bold),u.decorations.has("italic")&&(f|=ze.Italic),u.decorations.has("underline")&&(f|=ze.Underline),{content:u.value,offset:l[1],color:c,bgColor:h,fontStyle:f}}))}a(lp,"tokenizeAnsiWithTheme");function up(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}a(up,"dimColor");function bi(t,e,n={}){const{lang:r="text",theme:i=t.getLoadedThemes()[0]}=n;if(ea(r)||na(i))return ir(e).map(u=>[{content:u[0],offset:u[1]}]);const{theme:s,colorMap:o}=t.setTheme(i);if(r==="ansi")return lp(s,e,n);const l=t.getLanguage(r);return cp(e,l,s,o,n)}a(bi,"codeToTokensBase");function cp(t,e,n,r,i){const s=sr(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:l=500}=i,u=ir(t);let c=Zh,h=[];const f=[],p=[];if(i.includeExplanation)for(const d of n.settings){let m;switch(typeof d.scope){case"string":m=d.scope.split(/,/).map(g=>g.trim());break;case"object":m=d.scope;break;default:continue}p.push({settings:d,selectors:m.map(g=>g.split(/ /))})}for(let d=0,m=u.length;d<m;d++){const[g,y]=u[d];if(g===""){h=[],f.push([]);continue}if(o>0&&g.length>=o){h=[],f.push([{content:g,offset:y,color:"",fontStyle:0}]);continue}let b,w,k;i.includeExplanation&&(b=e.tokenizeLine(g,c),w=b.tokens,k=0);const _=e.tokenizeLine2(g,c,l),C=_.tokens.length/2;for(let S=0;S<C;S++){const A=_.tokens[2*S],E=S+1<C?_.tokens[2*S+2]:g.length;if(A===E)continue;const P=_.tokens[2*S+1],N=dt(r[nt.getForeground(P)],s),R=nt.getFontStyle(P),O={content:g.substring(A,E),offset:y+A,color:N,fontStyle:R};if(i.includeExplanation){O.explanation=[];let H=0;for(;A+H<E;){const K=w[k],j=g.substring(K.startIndex,K.endIndex);H+=j.length,O.explanation.push({content:j,scopes:fp(p,K.scopes)}),k+=1}}h.push(O)}f.push(h),h=[],c=_.ruleStack}return f}a(cp,"tokenizeWithTheme");function fp(t,e){const n=[];for(let r=0,i=e.length;r<i;r++){const s=e.slice(0,r),o=e[r];n[r]={scopeName:o,themeMatches:pp(t,o,s)}}return n}a(fp,"explainThemeScopes");function la(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}a(la,"matchesOne");function hp(t,e,n){if(!la(t[t.length-1],e))return!1;let r=t.length-2,i=n.length-1;for(;r>=0&&i>=0;)la(t[r],n[i])&&(r-=1),i-=1;return r===-1}a(hp,"matches");function pp(t,e,n){const r=[];for(const{selectors:i,settings:s}of t)for(const o of i)if(hp(o,e,n)){r.push(s);break}return r}a(pp,"explainThemeScope");function ua(t,e,n){const r=Object.entries(n.themes).filter(o=>o[1]).map(o=>({color:o[0],theme:o[1]})),i=dp(...r.map(o=>bi(t,e,{...n,theme:o.theme})));return i[0].map((o,l)=>o.map((u,c)=>{const h={content:u.content,variants:{},offset:u.offset};return i.forEach((f,p)=>{const{content:d,explanation:m,offset:g,...y}=f[l][c];h.variants[r[p].color]=y}),h}))}a(ua,"codeToTokensWithThemes");function dp(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){const i=t.map(u=>u[r]),s=e.map(()=>[]);e.forEach((u,c)=>u.push(s[c]));const o=i.map(()=>0),l=i.map(u=>u[0]);for(;l.every(u=>u);){const u=Math.min(...l.map(c=>c.content.length));for(let c=0;c<n;c++){const h=l[c];h.content.length===u?(s[c].push(h),o[c]+=1,l[c]=i[c][o[c]]):(s[c].push({...h,content:h.content.slice(0,u)}),l[c]={...h,content:h.content.slice(u),offset:h.offset+u})}}}return e}a(dp,"syncThemesTokenization");class le extends Error{static{a(this,"ShikiError")}constructor(e){super(e),this.name="ShikiError"}}function or(t,e,n){let r,i,s,o,l;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-"}=n,h=Object.entries(n.themes).filter(g=>g[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,y)=>g.color===u?-1:y.color===u?1:0);if(h.length===0)throw new le("`themes` option must not be empty");const f=ua(t,e,n);if(u&&!h.find(g=>g.color===u))throw new le(`\`themes\` option must contain the defaultColor key \`${u}\``);const p=h.map(g=>t.getTheme(g.theme)),d=h.map(g=>g.color);s=f.map(g=>g.map(y=>mp(y,d,c,u)));const m=h.map(g=>sr(g.theme,n));i=h.map((g,y)=>(y===0&&u?"":`${c+g.color}:`)+(dt(p[y].fg,m[y])||"inherit")).join(";"),r=h.map((g,y)=>(y===0&&u?"":`${c+g.color}-bg:`)+(dt(p[y].bg,m[y])||"inherit")).join(";"),o=`shiki-themes ${p.map(g=>g.name).join(" ")}`,l=u?void 0:[i,r].join(";")}else if("theme"in n){const u=sr(n.theme,n.colorReplacements);s=bi(t,e,n);const c=t.getTheme(n.theme);r=dt(c.bg,u),i=dt(c.fg,u),o=c.name}else throw new le("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:l}}a(or,"codeToTokens");function mp(t,e,n,r){const i={content:t.content,explanation:t.explanation,offset:t.offset},s=e.map(u=>sa(t.variants[u])),o=new Set(s.flatMap(u=>Object.keys(u))),l=s.reduce((u,c,h)=>{for(const f of o){const p=c[f]||"inherit";if(h===0&&r)u[f]=p;else{const d=f==="color"?"":f==="background-color"?"-bg":`-${f}`,m=n+e[h]+(f==="color"?"":d);u[f]?u[f]+=`;${m}:${p}`:u[f]=`${m}:${p}`}}return u},{});return i.htmlStyle=r?oa(l):Object.values(l).join(";"),i}a(mp,"mergeToken");function gp(){const t=new WeakMap;function e(r){if(!t.has(r.meta)){let s=function(l){return typeof l=="number"?{...i.indexToPos(l),offset:l}:{...l,offset:i.posToIndex(l.line,l.character)}};a(s,"normalizePosition");const i=np(r.source),o=(r.options.decorations||[]).map(l=>({...l,start:s(l.start),end:s(l.end)}));n(o),t.set(r.meta,{decorations:o,converter:i,source:r.source})}return t.get(r.meta)}a(e,"getContext");function n(r){for(let i=0;i<r.length;i++){const s=r[i];if(s.start.offset>s.end.offset)throw new le(`Invalid decoration range: ${JSON.stringify(s.start)} - ${JSON.stringify(s.end)}`);for(let o=i+1;o<r.length;o++){const l=r[o],u=s.start.offset<l.start.offset&&l.start.offset<s.end.offset,c=s.start.offset<l.end.offset&&l.end.offset<s.end.offset,h=l.start.offset<s.start.offset&&s.start.offset<l.end.offset,f=l.start.offset<s.end.offset&&s.end.offset<l.end.offset;if(u||c||h||f){if(c&&c||h&&f)continue;throw new le(`Decorations ${JSON.stringify(s.start)} and ${JSON.stringify(l.start)} intersect.`)}}}}return a(n,"verifyIntersections"),{name:"shiki:decorations",tokens(r){if(!this.options.decorations?.length)return;const s=e(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]);return tp(r,s)},code(r){if(!this.options.decorations?.length)return;const i=e(this),s=Array.from(r.children).filter(f=>f.type==="element"&&f.tagName==="span");if(s.length!==i.converter.lines.length)throw new le(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function o(f,p,d,m){const g=s[f];let y="",b=-1,w=-1;function k(C){return C.type==="text"?C.value:C.type==="element"?C.children.map(k).join(""):""}if(a(k,"stringify"),p===0&&(b=0),d===0&&(w=0),d===Number.POSITIVE_INFINITY&&(w=g.children.length),b===-1||w===-1)for(let C=0;C<g.children.length;C++)y+=k(g.children[C]),b===-1&&y.length===p&&(b=C+1),w===-1&&y.length===d&&(w=C+1);if(b===-1)throw new le(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(w===-1)throw new le(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const _=g.children.slice(b,w);if(!m.alwaysWrap&&_.length===g.children.length)u(g,m,"line");else if(!m.alwaysWrap&&_.length===1&&_[0].type==="element")u(_[0],m,"token");else{const C={type:"element",tagName:"span",properties:{},children:_};u(C,m,"wrapper"),g.children.splice(b,_.length,C)}}a(o,"applyLineSection");function l(f,p){s[f]=u(s[f],p,"line")}a(l,"applyLine");function u(f,p,d){const m=p.properties||{},g=p.transform||(y=>y);return f.tagName=p.tagName||"span",f.properties={...f.properties,...m,class:f.properties.class},p.properties?.class&&ia(f,p.properties.class),f=g(f,d)||f,f}a(u,"applyDecoration");const c=[],h=i.decorations.sort((f,p)=>p.start.offset-f.start.offset);for(const f of h){const{start:p,end:d}=f;if(p.line===d.line)o(p.line,p.character,d.character,f);else if(p.line<d.line){o(p.line,p.character,Number.POSITIVE_INFINITY,f);for(let m=p.line+1;m<d.line;m++)c.unshift(()=>l(m,f));o(d.line,0,d.character,f)}}c.forEach(f=>f())}}}a(gp,"transformerDecorations");const yp=[gp()];function ar(t){return[...t.transformers||[],...yp]}a(ar,"getTransformers");function lr(t,e,n,r={meta:{},options:n,codeToHast:(i,s)=>lr(t,i,s),codeToTokens:(i,s)=>or(t,i,s)}){let i=e;for(const p of ar(n))i=p.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:l,themeName:u,rootStyle:c}=or(t,i,n);const{mergeWhitespaces:h=!0}=n;h===!0?s=wp(s):h==="never"&&(s=kp(s));const f={...r,get source(){return i}};for(const p of ar(n))s=p.tokens?.call(f,s)||s;return bp(s,{...n,fg:o,bg:l,themeName:u,rootStyle:c},f)}a(lr,"codeToHast");function bp(t,e,n){const r=ar(e),i=[],s={type:"root",children:[]},{structure:o="classic"}=e;let l={type:"element",tagName:"pre",properties:{class:`shiki ${e.themeName||""}`,style:e.rootStyle||`background-color:${e.bg};color:${e.fg}`,tabindex:"0",...Object.fromEntries(Array.from(Object.entries(e.meta||{})).filter(([p])=>!p.startsWith("_")))},children:[]},u={type:"element",tagName:"code",properties:{},children:i};const c=[],h={...n,structure:o,addClassToHast:ia,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return s},get pre(){return l},get code(){return u},get lines(){return c}};if(t.forEach((p,d)=>{d&&(o==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):o==="classic"&&i.push({type:"text",value:`
|
|
14
14
|
`}));let m={type:"element",tagName:"span",properties:{class:"line"},children:[]},g=0;for(const y of p){let b={type:"element",tagName:"span",properties:{},children:[{type:"text",value:y.content}]};const w=y.htmlStyle||oa(sa(y));w&&(b.properties.style=w);for(const k of r)b=k?.span?.call(h,b,d+1,g,m)||b;o==="inline"?s.children.push(b):o==="classic"&&m.children.push(b),g+=y.content.length}if(o==="classic"){for(const y of r)m=y?.line?.call(h,m,d+1)||m;c.push(m),i.push(m)}}),o==="classic"){for(const p of r)u=p?.code?.call(h,u)||u;l.children.push(u);for(const p of r)l=p?.pre?.call(h,l)||l;s.children.push(l)}let f=s;for(const p of r)f=p?.root?.call(h,f)||f;return f}a(bp,"tokensToHast");function wp(t){return t.map(e=>{const n=[];let r="",i=0;return e.forEach((s,o)=>{const u=!(s.fontStyle&&s.fontStyle&ze.Underline);u&&s.content.match(/^\s+$/)&&e[o+1]?(i||(i=s.offset),r+=s.content):r?(u?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=0,r=""):n.push(s)}),n})}a(wp,"mergeWhitespaceTokens");function kp(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[,i,s,o]=r;if(!i&&!o)return n;const l=[{...n,offset:n.offset+i.length,content:s}];return i&&l.unshift({content:i,offset:n.offset}),o&&l.push({content:o,offset:n.offset+i.length+s.length}),l}))}a(kp,"splitWhitespaceTokens");const Sp=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];let Sn=class{static{a(this,"Schema")}constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}};Sn.prototype.property={},Sn.prototype.normal={},Sn.prototype.space=null;function ca(t,e){const n={},r={};let i=-1;for(;++i<t.length;)Object.assign(n,t[i].property),Object.assign(r,t[i].normal);return new Sn(n,r,e)}a(ca,"merge$1");function wi(t){return t.toLowerCase()}a(wi,"normalize$2");let Ee=class{static{a(this,"Info")}constructor(e,n){this.property=e,this.attribute=n}};Ee.prototype.space=null,Ee.prototype.boolean=!1,Ee.prototype.booleanish=!1,Ee.prototype.overloadedBoolean=!1,Ee.prototype.number=!1,Ee.prototype.commaSeparated=!1,Ee.prototype.spaceSeparated=!1,Ee.prototype.commaOrSpaceSeparated=!1,Ee.prototype.mustUseProperty=!1,Ee.prototype.defined=!1;let xp=0;const B=gt(),re=gt(),fa=gt(),I=gt(),Q=gt(),$t=gt(),_e=gt();function gt(){return 2**++xp}a(gt,"increment$1");var ki=Object.freeze({__proto__:null,boolean:B,booleanish:re,commaOrSpaceSeparated:_e,commaSeparated:$t,number:I,overloadedBoolean:fa,spaceSeparated:Q});const Si=Object.keys(ki);let xi=class extends Ee{static{a(this,"DefinedInfo")}constructor(e,n,r,i){let s=-1;if(super(e,n),ha(this,"space",i),typeof r=="number")for(;++s<Si.length;){const o=Si[s];ha(this,Si[s],(r&ki[o])===ki[o])}}};xi.prototype.defined=!0;function ha(t,e,n){n&&(t[e]=n)}a(ha,"mark$1");const vp={}.hasOwnProperty;function Bt(t){const e={},n={};let r;for(r in t.properties)if(vp.call(t.properties,r)){const i=t.properties[r],s=new xi(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[wi(r)]=r,n[wi(s.attribute)]=r}return new Sn(e,n,t.space)}a(Bt,"create$2");const pa=Bt({space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),da=Bt({space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function ma(t,e){return e in t?t[e]:e}a(ma,"caseSensitiveTransform$1");function ga(t,e){return ma(t,e.toLowerCase())}a(ga,"caseInsensitiveTransform$1");const ya=Bt({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ga,properties:{xmlns:null,xmlnsXLink:null}}),ba=Bt({transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:re,ariaAutoComplete:null,ariaBusy:re,ariaChecked:re,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:Q,ariaCurrent:null,ariaDescribedBy:Q,ariaDetails:null,ariaDisabled:re,ariaDropEffect:Q,ariaErrorMessage:null,ariaExpanded:re,ariaFlowTo:Q,ariaGrabbed:re,ariaHasPopup:null,ariaHidden:re,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Q,ariaLevel:I,ariaLive:null,ariaModal:re,ariaMultiLine:re,ariaMultiSelectable:re,ariaOrientation:null,ariaOwns:Q,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:re,ariaReadOnly:re,ariaRelevant:null,ariaRequired:re,ariaRoleDescription:Q,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:re,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null}}),_p=Bt({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ga,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$t,acceptCharset:Q,accessKey:Q,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:Q,autoFocus:B,autoPlay:B,blocking:Q,capture:null,charSet:null,checked:B,cite:null,className:Q,cols:I,colSpan:null,content:null,contentEditable:re,controls:B,controlsList:Q,coords:I|$t,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:fa,draggable:re,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:Q,height:I,hidden:B,high:I,href:null,hrefLang:null,htmlFor:Q,httpEquiv:Q,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:Q,itemRef:Q,itemScope:B,itemType:Q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,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:B,optimum:I,pattern:null,ping:Q,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:Q,required:B,reversed:B,rows:I,rowSpan:I,sandbox:Q,scope:null,scoped:B,seamless:B,selected:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:re,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:re,width:I,wrap:null,align:null,aLink:null,archive:Q,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:re,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:B,disableRemotePlayback:B,prefix:null,property:null,results:I,security:null,unselectable:null}}),Cp=Bt({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:ma,properties:{about:_e,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:Q,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:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,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:$t,g2:$t,glyphName:$t,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:_e,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,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:I,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:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_e,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_e,rev:_e,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_e,requiredFeatures:_e,requiredFonts:_e,requiredFormats:_e,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:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:_e,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_e,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_e,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Np=/^data[-\w.:]+$/i,wa=/-[a-z]/g,Ap=/[A-Z]/g;function Ep(t,e){const n=wi(e);let r=e,i=Ee;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Np.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(wa,Ip);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!wa.test(s)){let o=s.replace(Ap,Tp);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=xi}return new i(r,e)}a(Ep,"find$1");function Tp(t){return"-"+t.toLowerCase()}a(Tp,"kebab$1");function Ip(t){return t.charAt(1).toUpperCase()}a(Ip,"camelcase$1");const Lp=ca([da,pa,ya,ba,_p],"html"),ka=ca([da,pa,ya,ba,Cp],"svg"),Sa={}.hasOwnProperty;function Op(t,e){const n=e||{};function r(i,...s){let o=r.invalid;const l=r.handlers;if(i&&Sa.call(i,t)){const u=String(i[t]);o=Sa.call(l,u)?l[u]:r.unknown}if(o)return o.call(this,i,...s)}return a(r,"one"),r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}a(Op,"zwitch$1");function Pp(t,e){if(t=t.replace(e.subset?Dp(e.subset):/["&'<>`]/g,r),e.subset||e.escapeOnly)return t;return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,n).replace(/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,r);function n(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function r(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}a(Pp,"core$1");function Dp(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}a(Dp,"charactersToExpression$1");function Rp(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!/[\dA-Fa-f]/.test(String.fromCharCode(e))?r:r+";"}a(Rp,"toHexadecimal$1");function Fp(t,e,n){const r="&#"+String(t);return n&&e&&!/\d/.test(String.fromCharCode(e))?r:r+";"}a(Fp,"toDecimal$1");const Mp=["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"],vi={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"},$p=["cent","copy","divide","gt","lt","not","para","times"],xa={}.hasOwnProperty,_i={};let ur;for(ur in vi)xa.call(vi,ur)&&(_i[vi[ur]]=ur);function Bp(t,e,n,r){const i=String.fromCharCode(t);if(xa.call(_i,i)){const s=_i[i],o="&"+s;return n&&Mp.includes(s)&&!$p.includes(s)&&(!r||e&&e!==61&&/[^\da-z]/i.test(String.fromCharCode(e)))?o:o+";"}return""}a(Bp,"toNamed$1");function qp(t,e,n){let r=Rp(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Bp(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=Fp(t,e,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}a(qp,"formatSmart$1");function qt(t,e){return Pp(t,Object.assign({format:qp},e))}a(qt,"stringifyEntities$1");const zp=/^>|^->|<!--|-->|--!>|<!-$/g,Up=[">"],jp=["<",">"];function Gp(t,e,n,r){return r.settings.bogusComments?"<?"+qt(t.value,Object.assign({},r.settings.characterReferences,{subset:Up}))+">":"<!--"+t.value.replace(zp,i)+"-->";function i(s){return qt(s,Object.assign({},r.settings.characterReferences,{subset:jp}))}}a(Gp,"comment$1");function Hp(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}a(Hp,"doctype$1");function va(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}a(va,"ccount$1");function Vp(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}a(Vp,"stringify$1$1");function Wp(t){return t.join(" ").trim()}a(Wp,"stringify$4");const Kp=/[ \t\n\f\r]/g;function Ci(t){return typeof t=="object"?t.type==="text"?_a(t.value):!1:_a(t)}a(Ci,"whitespace$1");function _a(t){return t.replace(Kp,"")===""}a(_a,"empty$2");const oe=Na(1),Ca=Na(-1),Yp=[];function Na(t){return e;function e(n,r,i){const s=n?n.children:Yp;let o=(r||0)+t,l=s[o];if(!i)for(;l&&Ci(l);)o+=t,l=s[o];return l}}a(Na,"siblings$1");const Jp={}.hasOwnProperty;function Aa(t){return e;function e(n,r,i){return Jp.call(t,n.tagName)&&t[n.tagName](n,r,i)}}a(Aa,"omission$1");const Ni=Aa({body:Xp,caption:Ai,colgroup:Ai,dd:nd,dt:td,head:Ai,html:Qp,li:ed,optgroup:rd,option:id,p:Zp,rp:Ea,rt:Ea,tbody:od,td:Ta,tfoot:ad,th:Ta,thead:sd,tr:ld});function Ai(t,e,n){const r=oe(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ci(r.value.charAt(0)))}a(Ai,"headOrColgroupOrCaption$1");function Qp(t,e,n){const r=oe(n,e);return!r||r.type!=="comment"}a(Qp,"html$1$1");function Xp(t,e,n){const r=oe(n,e);return!r||r.type!=="comment"}a(Xp,"body$1$1");function Zp(t,e,n){const r=oe(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"))}a(Zp,"p$2");function ed(t,e,n){const r=oe(n,e);return!r||r.type==="element"&&r.tagName==="li"}a(ed,"li$1");function td(t,e,n){const r=oe(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}a(td,"dt$1");function nd(t,e,n){const r=oe(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}a(nd,"dd$1");function Ea(t,e,n){const r=oe(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}a(Ea,"rubyElement$1");function rd(t,e,n){const r=oe(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}a(rd,"optgroup$1");function id(t,e,n){const r=oe(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}a(id,"option$1");function sd(t,e,n){const r=oe(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}a(sd,"thead$1");function od(t,e,n){const r=oe(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}a(od,"tbody$1$1");function ad(t,e,n){return!oe(n,e)}a(ad,"tfoot$1");function ld(t,e,n){const r=oe(n,e);return!r||r.type==="element"&&r.tagName==="tr"}a(ld,"tr$1");function Ta(t,e,n){const r=oe(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}a(Ta,"cells$1");const ud=Aa({body:hd,colgroup:pd,head:fd,html:cd,tbody:dd});function cd(t){const e=oe(t,-1);return!e||e.type!=="comment"}a(cd,"html$6");function fd(t){const e=t.children,n=[];let r=-1;for(;++r<e.length;){const i=e[r];if(i.type==="element"&&(i.tagName==="title"||i.tagName==="base")){if(n.includes(i.tagName))return!1;n.push(i.tagName)}}return e.length>0}a(fd,"head$1");function hd(t){const e=oe(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ci(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}a(hd,"body$2");function pd(t,e,n){const r=Ca(n,e),i=oe(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Ni(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}a(pd,"colgroup$1");function dd(t,e,n){const r=Ca(n,e),i=oe(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Ni(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}a(dd,"tbody$2");const cr={name:[[`
|
|
@@ -62,7 +62,8 @@ var Nf=Object.defineProperty;var a=(t,e)=>Nf(t,"name",{value:e,configurable:!0})
|
|
|
62
62
|
{{type:Back}}`,YankiNamespace:"{{YankiNamespace}}"}],inOrderFields:["Front","Back","YankiNamespace"],modelName:"Yanki - Basic (type in the answer)"}],Er=cs.map(t=>t.modelName);async function Kl(t,e,n=!1){if(n)return;const r=[];for(const i of e)i.noteId!==void 0&&r.push(i.noteId);await t.note.deleteNotes({notes:r})}a(Kl,"deleteNotes");async function yb(t,e,n=!1){if(e.noteId===void 0)throw new Error("Note ID is undefined");n||await t.note.updateNoteModel({note:{...e,id:e.noteId,tags:e.tags??[]}})}a(yb,"updateNoteModel");async function fs(t,e,n){if(e.noteId!==void 0)throw new Error("Note already has an ID");if(n)return 0;const r=await t.note.addNote({note:{...e,options:{allowDuplicate:!0}}}).catch(async i=>{if(i instanceof Error){if(i.message===`model was not found: ${e.modelName}`){const s=cs.find(o=>o.modelName===e.modelName);if(s===void 0)throw new Error(`Model not found: ${e.modelName}`);return await t.model.createModel(s),fs(t,e,n)}if(i.message===`deck was not found: ${e.deckName}`){if(e.deckName==="")throw new Error("Deck name is empty");return await t.deck.createDeck({deck:e.deckName}),fs(t,e,n)}throw i}else throw new TypeError("Unknown error")});if(r===null)throw new Error("Note creation failed");return await Xl(t,e,n),r}a(fs,"addNote");async function bb(t,e,n,r){if(e.noteId===void 0)throw new Error("Local note ID is undefined");if(n.cards===void 0)throw new Error("Remote note cards are undefined");let i=!1;if((!Sb(e.tags??[],n.tags??[])||!wb(e.fields,n.fields))&&(r||(await t.note.updateNote({note:{...e,id:e.noteId}}),kb(e.fields,n.fields)||await Xl(t,e,r)),i=!0),e.deckName!==n.deckName){if(e.deckName==="")throw new Error("Local deck name is empty");r||await t.deck.changeDeck({cards:n.cards,deck:e.deckName}),i=!0}return i}a(bb,"updateNote");function wb(t,e){const n=["Front","Back"];for(const r of n)if(t[r]!==e[r])return!1;return!0}a(wb,"areFieldsEqual");function kb(t,e){const n=Ar(`${t.Front}
|
|
63
63
|
${t.Back}`).map(({filename:i})=>i).sort(),r=Ar(`${e.Front}
|
|
64
64
|
${e.Back}`).map(({filename:i})=>i).sort();if(n.length!==r.length)return!1;for(const[i,s]of n.entries())if(s!==r[i])return!1;return!0}a(kb,"areMediaElementsEqual");function Sb(t,e){if(t.length!==e.length)return!1;for(const[n,r]of t.entries())if(r!==e[n])return!1;return!0}a(Sb,"areTagsEqual");async function hs(t,e=ge.namespace){const n=await t.note.findNotes({query:`"YankiNamespace:${e}"`});return await Yl(t,n)}a(hs,"getRemoteNotes");async function Yl(t,e){const n=await t.note.notesInfo({notes:e}),r=[];if(n.every(l=>l.noteId===void 0))return Array.from({length:n.length}).fill(void 0);const i=n.flatMap(l=>l.cards??[]),s=await t.deck.getDecks({cards:i}),o=new Map;for(const[l,u]of Object.entries(s))for(const c of u)o.set(c,l);for(const l of n){if(l.noteId===void 0){r.push(void 0);continue}const u=new Set;for(const c of l.cards){const h=o.get(c);if(h===void 0)throw new Error(`No deck found for card ${c}`);u.add(h)}if(u.size===0)throw new Error(`No decks found for note ${l.noteId}`);if(u.size>1)throw new Error(`Multiple decks found for note ${l.noteId}`);if(!Er.includes(l.modelName))throw new Error(`Unknown model name ${l.modelName} for note ${l.noteId}`);r.push({cards:l.cards,deckName:[...u][0],fields:{Back:l.fields.Back.value??"",Front:l.fields.Front.value??"",YankiNamespace:l.fields.YankiNamespace.value??""},modelName:l.modelName,noteId:l.noteId,tags:l.tags})}return r}a(Yl,"getRemoteNotesById");async function Jl(t,e,n,r){const i=[...new Set(e.map(f=>f.deckName))].filter(Boolean),o=[...new Set(n.map(f=>f.deckName))].filter(Boolean).filter(f=>!i.includes(f)),l=[];for(const f of o){const p=f.split("::");if(p.length!==1)for(;p.length>1;){p.pop();const d=p.join("::");if(i.some(m=>d.includes(m)))break;l.push(d)}}const u=[...new Set([...o,...l])],c=await t.deck.getDeckStats({decks:u}),h=Object.values(c).reduce((f,p,d)=>{const m=u[d];if(r){const g=n.filter(b=>b.deckName===m).length,y=e.filter(b=>b.deckName===m).length;p.total_in_deck===g&&y===0&&!f.includes(m)&&f.push(m)}else p.total_in_deck===0&&!f.includes(m)&&f.push(m);return f},[]);return r||await t.deck.deleteDecks({cardsToo:!0,decks:h}),h}a(Jl,"deleteOrphanedDecks");async function Ql(t,e,n,r){let i;try{const{css:s}=await t.model.modelStyling({modelName:e});i=s}catch(s){if(s instanceof Error){if(s.message===`model was not found: ${e}`){const o=cs.find(l=>l.modelName===e);if(o===void 0)throw new Error(`Model not found: ${e}`);return r?!1:(await t.model.createModel(o),Ql(t,o.modelName,n,r))}throw s}else throw new TypeError("Unknown error")}return i!==void 0&&i===n?!1:(r||await t.model.updateModelStyling({model:{css:n,name:e}}),!0)}a(Ql,"updateModelStyle");async function xb(t,e=Er[0]){const{css:n}=await t.model.modelStyling({modelName:e});return n}a(xb,"getModelStyle");async function Xl(t,e,n){const r=Ar(`${e.fields.Front}
|
|
65
|
-
${e.fields.Back}`),i=[];for(const{filename:s,originalSrc:o}of r)if((await t.media.getMediaFilesNames({pattern:s})).length===0){if(!n)try{const u=await t.media.storeMediaFile(gn(o)?{deleteExisting:!0,filename:s,url:o}:{deleteExisting:!0,filename:s,path:o});s!==u&&console.warn(`Anki media filename mismatch: Expected: "${s}" -> Received: "${u}"`)}catch{console.warn(`Anki could not store media file: "${s}"
|
|
65
|
+
${e.fields.Back}`),i=[];for(const{filename:s,originalSrc:o}of r)if((await t.media.getMediaFilesNames({pattern:s})).length===0){if(!n)try{const u=await t.media.storeMediaFile(gn(o)?{deleteExisting:!0,filename:s,url:o}:{deleteExisting:!0,filename:s,path:o});s!==u&&console.warn(`Anki media filename mismatch: Expected: "${s}" -> Received: "${u}"`)}catch(u){console.warn(`Anki could not store media file: "${s}"
|
|
66
|
+
${String(u)}`)}i.push({filename:s,originalSrc:o})}return i}a(Xl,"uploadMediaForNote");async function Zl(t,e,n,r){if(r)return[];const i=To(n),s=[];for(const u of e){const c=Ar(`${u.fields.Front}
|
|
66
67
|
${u.fields.Back}`);for(const{filename:h}of c)s.push(h)}const o=await t.media.getMediaFilesNames({pattern:`${i}-*`}),l=[];for(const u of o)s.includes(u)||(await t.media.deleteMediaFile({filename:u}),l.push(u));return l}a(Zl,"deleteUnusedMedia");async function An(t){try{const{permission:e}=await t.miscellaneous.requestPermission();if(e==="denied")throw new Error('Permission denied, please add this source to the "webCorsOriginList" in the Anki-Connect add-on configuration options.');return"granted"}catch(e){if(e instanceof Error&&(e.message==="fetch failed"||e.message==="net::ERR_CONNECTION_REFUSED"))return"ankiUnreachable";throw e}}a(An,"requestPermission");async function ps(t){try{await t.miscellaneous.sync()}catch{console.warn("Could not sync to AnkiWeb.")}}a(ps,"syncToAnkiWeb");var vb="addenda",_b="aircraft",Cb="algae",Nb="alumnae",Ab="alumni",Eb="alveoli",Tb="amoebae",Ib="analyses",Lb="antennae",Ob="antitheses",Pb="apices",Db="appendices",Rb="automata",Fb="axes",Mb="bacilli",$b="bacteria",Bb="bacula",qb="barracks",zb="bases",Ub="beaux",jb="bison",Gb="buffalo",Hb="bureaus",Vb="cacti",Wb="calves",Kb="carcinomata",Yb="carp",Jb="censuses",Qb="chassis",Xb="cherubim",Zb="children",e0="cloacae",t0="cod",n0="codices",r0="concerti",i0="consortia",s0="corpora",o0="crises",a0="criteria",l0="curricula",u0="cystomata",c0="data",f0="deer",h0="diagnoses",p0="dice",d0="dwarfs",m0="echoes",g0="elves",y0="elk",b0="ellipses",w0="embargoes",k0="emphases",S0="errata",x0="fezes",v0="firmware",_0="fish",C0="foci",N0="feet",A0="formulae",E0="fungi",T0="gallows",I0="genera",L0="glomeruli",O0="geese",P0="graffiti",D0="grouse",R0="halves",F0="hamuli",M0="heroes",$0="hippopotami",B0="hooves",q0="hovercraft",z0="hypotheses",U0="ilia",j0="incubi",G0="indices",H0="interstitia",V0="kakapo",W0="knives",K0="larvae",Y0="leaves",J0="libretti",Q0="lives",X0="loaves",Z0="loculi",ew="loci",tw="lice",nw="men",rw="matrices",iw="means",sw="measles",ow="media",aw="media",lw="memoranda",uw="millennia",cw="minutiae",fw="moose",hw="mice",pw="nebulae",dw="nemeses",mw="neuroses",gw="news",yw="nucleoli",bw="nuclei",ww="oases",kw="occipita",Sw="offspring",xw="omphaloi",vw="opera",_w="ova",Cw="oxen",Nw="paralyses",Aw="parentheses",Ew="people",Tw="phenomena",Iw="phyla",Lw="pike",Ow="polyhedra",Pw="potatoes",Dw="primi",Rw="prognoses",Fw="quizzes",Mw="radii",$w="referenda",Bw="salmon",qw="scarves",zw="scrota",Uw="selves",jw="seminomata",Gw="series",Hw="sheep",Vw="shelves",Ww="shrimp",Kw="simulacra",Yw="soliloquies",Jw="spacecraft",Qw="species",Xw="spectra",Zw="squid",ek="stimuli",tk="strata",nk="swine",rk="syconia",ik="syllabi",sk="symposia",ok="synopses",ak="syntheses",lk="tableaus",uk="testes",ck="those",fk="theses",hk="thieves",pk="thrombi",dk="tomatoes",mk="teeth",gk="tori",yk="trout",bk="tuna",wk="umbilici",kk="uteri",Sk="vertebrae",xk="vertices",vk="vetoes",_k="vitae",Ck="vortices",Nk="watercraft",Ak="wharves",Ek="wives",Tk="wolves",Ik="women",Lk={addendum:vb,aircraft:_b,alga:Cb,alumna:Nb,alumnus:Ab,alveolus:Eb,amoeba:Tb,analysis:Ib,antenna:Lb,antithesis:Ob,apex:Pb,appendix:Db,automaton:Rb,axis:Fb,bacillus:Mb,bacterium:$b,baculum:Bb,barracks:qb,basis:zb,beau:Ub,bison:jb,buffalo:Gb,bureau:Hb,cactus:Vb,calf:Wb,carcinoma:Kb,carp:Yb,census:Jb,chassis:Qb,cherub:Xb,child:Zb,ch\u00E2teau:"ch\xE2teaus",cloaca:e0,cod:t0,codex:n0,concerto:r0,consortium:i0,corpus:s0,crisis:o0,criterion:a0,curriculum:l0,cystoma:u0,datum:c0,deer:f0,diagnosis:h0,die:p0,dwarf:d0,echo:m0,elf:g0,elk:y0,ellipsis:b0,embargo:w0,emphasis:k0,erratum:S0,"faux pas":"faux pas",fez:x0,firmware:v0,fish:_0,focus:C0,foot:N0,formula:A0,fungus:E0,gallows:T0,genus:I0,glomerulus:L0,goose:O0,graffito:P0,grouse:D0,half:R0,hamulus:F0,hero:M0,hippopotamus:$0,hoof:B0,hovercraft:q0,hypothesis:z0,iliac:U0,incubus:j0,index:G0,interstitium:H0,kakapo:V0,knife:W0,larva:K0,leaf:Y0,libretto:J0,life:Q0,loaf:X0,loculus:Z0,locus:ew,louse:tw,man:nw,matrix:rw,means:iw,measles:sw,media:ow,medium:aw,memorandum:lw,millennium:uw,minutia:cw,moose:fw,mouse:hw,nebula:pw,nemesis:dw,neurosis:mw,news:gw,nucleolus:yw,nucleus:bw,oasis:ww,occiput:kw,offspring:Sw,omphalos:xw,opus:vw,ovum:_w,ox:Cw,paralysis:Nw,parenthesis:Aw,person:Ew,phenomenon:Tw,phylum:Iw,pike:Lw,polyhedron:Ow,potato:Pw,primus:Dw,prognosis:Rw,quiz:Fw,radius:Mw,referendum:$w,salmon:Bw,scarf:qw,scrotum:zw,self:Uw,seminoma:jw,series:Gw,sheep:Hw,shelf:Vw,shrimp:Ww,simulacrum:Kw,soliloquy:Yw,spacecraft:Jw,species:Qw,spectrum:Xw,squid:Zw,stimulus:ek,stratum:tk,swine:nk,syconium:rk,syllabus:ik,symposium:sk,synopsis:ok,synthesis:ak,tableau:lk,testis:uk,that:ck,thesis:fk,thief:hk,this:"these",thrombus:pk,tomato:dk,tooth:mk,torus:gk,trout:yk,tuna:bk,umbilicus:wk,uterus:kk,vertebra:Sk,vertex:xk,veto:vk,vita:_k,vortex:Ck,watercraft:Nk,wharf:Ak,wife:Ek,wolf:Tk,woman:Ik};const Ok=Lk;var Pk=new Map(Object.entries(Ok)),eu=Ji(Pk);function Wt(t,e,n){if(typeof e=="number"&&(n=e),eu.has(t.toLowerCase())){e=eu.get(t.toLowerCase());const r=t.charAt(0);r===r.toUpperCase()&&(e=r+e.slice(1)),t===t.toUpperCase()&&(e=e.toUpperCase())}else typeof e!="string"&&(e=(t.replace(/(?:s|x|z|ch|sh)$/i,"$&e").replace(/([^aeiou])y$/i,"$1ie")+"s").replace(/i?e?s$/i,r=>t.slice(-1)===t.slice(-1).toLowerCase()?r.toLowerCase():r.toUpperCase()));return Math.abs(n)===1?t:e}a(Wt,"plur");const tu=a(t=>Number.isFinite(t)?t:0,"toZeroIfInfinity");function Dk(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(tu(t*1e3)%1e3),nanoseconds:Math.trunc(tu(t*1e6)%1e3)}}a(Dk,"parseNumber");function Rk(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}a(Rk,"parseBigint");function Fk(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Dk(t);break}case"bigint":return Rk(t)}throw new TypeError("Expected a finite number or bigint")}a(Fk,"parseMilliseconds");const Mk=a(t=>t===0||t===0n,"isZero"),$k=a((t,e)=>e===1||e===1n?t:`${t}s`,"pluralize"),Bk=1e-7,qk=24n*60n*60n*1000n;function ds(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e},e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let r=[];const i=a((c,h)=>{const f=Math.floor(c*10**h+Bk);return(Math.round(f)/10**h).toFixed(h)},"floorDecimals"),s=a((c,h,f,p)=>{if(!((r.length===0||!e.colonNotation)&&Mk(c)&&!(e.colonNotation&&f==="m"))){if(p=p??String(c),e.colonNotation){const d=p.includes(".")?p.split(".")[0].length:p.length,m=r.length>0?2:1;p="0".repeat(Math.max(0,m-d))+p}else p+=e.verbose?" "+$k(h,c):f;r.push(p)}},"add"),o=Fk(t),l=BigInt(o.days);if(s(l/365n,"year","y"),s(l%365n,"day","d"),s(Number(o.hours),"hour","h"),s(Number(o.minutes),"minute","m"),e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const c=Number(o.seconds),h=Number(o.milliseconds),f=Number(o.microseconds),p=Number(o.nanoseconds);if(s(c,"second","s"),e.formatSubMilliseconds)s(h,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{const d=h+f/1e3+p/1e6,m=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=d>=1?Math.round(d):Math.ceil(d),y=m?d.toFixed(m):g;s(Number.parseFloat(y),"millisecond","ms",y)}}else{const c=(n?Number(t%qk):t)/1e3%60,h=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=i(c,h),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(r.length===0)return"0"+(e.verbose?" milliseconds":"ms");const u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(r=r.slice(0,Math.max(e.unitCount,1))),r.join(u)}a(ds,"prettyMilliseconds");const nu={...ge};async function zk(t){const e=performance.now(),{ankiConnectOptions:n,ankiWeb:r,dryRun:i,namespace:s}=Ne(nu,t??{}),o=pt(s,!0),l=new pn(n);if(await An(l)==="ankiUnreachable")throw new Error("Anki is unreachable. Is Anki running?");const c=await hs(l,o);await Kl(l,c,i);const h=await Jl(l,[],c,i),f=await Zl(l,[],o,i),p=c.length>0||h.length>0;return!i&&r&&(p||ii)&&await ps(l),{ankiWeb:r,deletedDecks:h,deletedMedia:f,deletedNotes:c,dryRun:i,duration:performance.now()-e,namespace:o}}a(zk,"cleanNotes");function Uk(t,e=!1){const n=t.deletedDecks.length,r=t.deletedNotes.length,i=t.deletedMedia.length;if(n===0&&r===0&&i===0)return"Nothing to delete";const s=[];if(s.push(`${t.dryRun?"Will":"Successfully"} deleted ${r} ${Wt("note",r)}, ${n} ${Wt("deck",n)}, and ${i} media ${Wt("asset",i)} from Anki${t.dryRun?"":` in ${ds(t.duration)}`}.`),e){if(r>0){s.push("",t.dryRun?"Notes to delete:":"Deleted notes:");for(const o of t.deletedNotes){const l=ri(us(o.fields.Front),50);s.push(` Note ID ${o.noteId} ${l}`)}}if(n>0){s.push("",t.dryRun?"Decks to delete:":"Deleted decks:");for(const o of t.deletedDecks)s.push(` ${o}`)}if(i>0){s.push("",t.dryRun?"Media assets to delete:":"Deleted media assets:");for(const o of t.deletedMedia)s.push(` ${o}`)}}return s.join(`
|
|
67
68
|
`)}a(Uk,"formatCleanResult");const ru={...ge};async function jk(t){const e=performance.now(),{ankiConnectOptions:n,namespace:r}=Ne(ru,t??{}),i=pt(r,!0),s=new pn(n);if(await An(s)==="ankiUnreachable")throw new Error("Anki is unreachable. Is Anki running?");const l=await hs(s,i);return{duration:performance.now()-e,namespace:i,notes:l}}a(jk,"listNotes");function Gk(t){if(t.notes.length===0)return"No notes found.";const e=[];for(const n of t.notes){const r=ri(us(n.fields.Front),50);e.push(`Note ID ${n.noteId} ${r}`)}return e.join(`
|
|
68
69
|
`)}a(Gk,"formatListResult");function iu(){return/[<>:"/\\|?*\u0000-\u001F]/g}a(iu,"filenameReservedRegex");function Hk(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}a(Hk,"windowsReservedNameRegex");const Vk=100,Wk=/^\.+(\\|\/)|^\.+$/,Kk=/\.+$/;function Yk(t,e={}){const n=/[\u0000-\u001F\u0080-\u009F]/g,r=/([<>:"/\\|?*\u0000-\u001F]){2,}/g;if(typeof t!="string")throw new TypeError("Expected a string");const i=e.replacement===void 0?"!":e.replacement;if(iu().test(i)&&n.test(i))throw new Error("Replacement string cannot contain reserved filename characters");i.length>0&&(t=t.replace(r,"$1")),t=t.normalize("NFD"),t=t.replace(Wk,i),t=t.replace(iu(),i),t=t.replace(n,i),t=t.replace(Kk,""),i.length>0&&(!(t[0]===".")&&t[0]==="."&&(t=i+t),t[t.length-1]==="."&&(t+=i)),t=Hk().test(t)?t+i:t;const s=typeof e.maxLength=="number"?e.maxLength:Vk;if(t.length>s){const o=t.lastIndexOf(".");if(o===-1)t=t.slice(0,s);else{const l=t.slice(0,o),u=t.slice(o);t=l.slice(0,Math.max(1,s-u.length))+u}}return t}a(Yk,"filenamify");const Jk="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Qk=128;let kt,Kt;function Xk(t){!kt||kt.length<t?(kt=Buffer.allocUnsafe(t*Qk),yo.getRandomValues(kt),Kt=0):Kt+t>kt.length&&(yo.getRandomValues(kt),Kt=0),Kt+=t}a(Xk,"fillPool");function Zk(t=21){Xk(t-=0);let e="";for(let n=Kt-t;n<Kt;n++)e+=Jk[kt[n]&63];return e}a(Zk,"nanoid");function e1(t,e,n){if(e==="off")throw new Error("manageFilenames must not be off");switch(t.modelName){case"Yanki - Basic":case"Yanki - Basic (and reversed card)":case"Yanki - Basic (type in the answer)":{const r=Dt(lt(t.fields.Front).replace(Kn,"").replace(Yn,"")),i=Dt(lt(t.fields.Back).replace(Kn,"").replace(Yn,""));switch(e){case"prompt":return lt(r??i??"",n);case"response":return lt(i??r??"",n)}}case"Yanki - Cloze":{const r=Dt(lt(t.fields.Front).replace(Kn,"").replace(Yn,""));if(r===void 0)return lt("",n);const i=Dt(r.split("{{").at(0)??""),s=Dt(/{{\w\d*::([^:}]+)/.exec(r)?.at(0)),o=Dt(r.split("}}").at(1)?.split("{{").at(0)??"");switch(e){case"prompt":return lt(i??o??s??"",n);case"response":return lt(s??i??o??"",n)}}}}a(e1,"getSafeTitleForNote");function lt(t,e){let n=Yk(us(t).trim(),{maxLength:Number.MAX_SAFE_INTEGER,replacement:" "}).replaceAll(/\s+/g," ").trim();if(n.length===0&&(n=Yn),e===void 0)return n;const r=Math.min(e,So-12);return ri(n,r)}a(lt,"getSafeFilename");function t1(t,e){let n=ms(t,1),r=2;for(;e.includes(n.toLowerCase());)n=ms(t,r),r++;return n}a(t1,"getUniqueFilePath");function n1(t,e){const n=ms(t,2);return e.includes(n.toLowerCase())?t:su(t)}a(n1,"auditUniqueFilePath");function su(t){const e=t.endsWith(".")||t.endsWith(")")?void 0:W.extname(t),n=W.basename(t,e).replace(/\s\(\d+\)$/,"");return W.join(W.dirname(t),`${n}${e??""}`)}a(su,"stripFilenameIncrement");function ms(t,e){const n=W.extname(t),r=W.basename(t,n),i=`${su(r)} (${e})`;return W.join(W.dirname(t),`${i}${n}`)}a(ms,"appendFilenameIncrement");function r1(t){return`${t}-${Zk(8)}`}a(r1,"getTemporarilyUniqueFilePath");function ou(t,e,n){const i=st((n||{}).ignore||[]),s=i1(e);let o=-1;for(;++o<s.length;)Ma(t,"text",l);function l(c,h){let f=-1,p;for(;++f<h.length;){const d=h[f],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return u(c,h)}a(l,"visitor");function u(c,h){const f=h[h.length-1],p=s[o][0],d=s[o][1];let m=0;const y=f.children.indexOf(c);let b=!1,w=[];p.lastIndex=0;let k=p.exec(c.value);for(;k;){const _=k.index,C={index:k.index,input:k.input,stack:[...h,c]};let S=d(...k,C);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=_+1:(m!==_&&w.push({type:"text",value:c.value.slice(m,_)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=_+k[0].length,b=!0),!p.global)break;k=p.exec(c.value)}return b?(m<c.value.length&&w.push({type:"text",value:c.value.slice(m)}),f.children.splice(y,1,...w)):w=[c],y+w.length}a(u,"handler")}a(ou,"findAndReplace");function i1(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([s1(i[0]),o1(i[1])])}return e}a(i1,"toPairs");function s1(t){return typeof t=="string"?new RegExp(mn(t),"g"):t}a(s1,"toExpression");function o1(t){return typeof t=="function"?t:function(){return t}}a(o1,"toFunction");const a1=a(function(t={}){const{automaticAlias:e=!1,obsidianVault:n}=t;return function(r){ou(r,[[/!\[\[([^\]]+)]]/g,function(i,s){const[o,l]=s.split("|");return V("image",{altText:l,url:gn(o)?o:encodeURI(o)})}],[/\[\[([^\]]+)]]/g,function(i,s){let[o,l]=s.split("|");const u=o.split("#")?.at(-1);return l??=e?u??o.split("/").pop():o,o=n?`obsidian://open?vault=${encodeURIComponent(n)}&file=${encodeURIComponent(o)}.md`:gn(o)?o:encodeURI(o),V("link",{url:o},[V("text",l)])}]],{ignore:["link","image"]})}},"plugin$2"),l1=a(function(t,e,n,r,i){const s=st(r),o=[];if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index for start")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index for start");if(typeof n=="number"){if(n<0||n===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index for end")}else if(n=t.children.indexOf(n),n<0)throw new Error("Expected child node or index for end");for(;++e<n;)s(t.children[e],e,t)&&o.push(t.children[e]);return o},"findAllBetween"),u1=a(function(t,e,n){const r=st(n),i=[];let s=-1;if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(e>t.children.length&&(e=t.children.length);++s<e;)r(t.children[s],s,t)&&i.push(t.children[s]);return i},"findAllBefore"),c1=a(function(t,e,n){const r=st(n),i=[];if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)r(t.children[e],e,t)&&i.push(t.children[e]);return i},"findAllAfter"),au={a:"amber",b:"blue",c:"cyan",d:"brown",e:"espresso",f:"fuchsia",g:"green",h:"hotpink",i:"indigo",j:"jade",k:"kiwi",l:"lime",m:"magenta",n:"navyblue",o:"orange",p:"purple",q:"pink",r:"red",s:"silver",t:"teal",u:"umber",v:"violet",w:"white",x:"gray",y:"yellow",z:"black"},f1={dictionary:au,markerTagName:"mark",markerClassName:"flexible-marker",actionForEmptyContent:"mark"},h1=/=([a-z]?)=(?![\s=])([\s\S]*?)(?<![\s=])==/,p1=/=([a-z]?)=(?![\s=])([\s\S]*?)(?<![\s=])==/g,d1=/=([a-z]?)=(?![\s]|=+\s)/,m1=/=([a-z]?)=(?![\s]|=+\s)/g,g1=/(?<!\s|\s=|\s==|\s===|\s====)==/,y1=/(?<!\s|\s=|\s==|\s===|\s====)==/g,b1=/=([a-z]?)=\s*==/,lu=/=([a-z]?)=\s*==/g;function w1(t){return t.filter(e=>!!e)}a(w1,"clsx");const k1=a(t=>{const e=Object.assign({},f1,t);t?.dictionary&&Object.keys(t.dictionary).length&&(e.dictionary=Object.assign({},au,t.dictionary));const n=a((l,u)=>{let c;const h=l?e.dictionary[l]:void 0,f=typeof e.markerTagName=="string"?e.markerTagName:e.markerTagName(h),p=typeof e.markerClassName=="function"?e.markerClassName(h):w1([e.markerClassName,!l&&`${e.markerClassName}-default`,h&&`${e.markerClassName}-${h}`,!u.length&&`${e.markerClassName}-empty`]);return e.markerProperties&&(c=e.markerProperties(h),Object.entries(c).forEach(([d,m])=>{(typeof m=="string"&&m===""||Array.isArray(m)&&m.length===0)&&c&&(c[d]=void 0),d==="className"&&delete c?.className})),{type:"mark",children:u,data:{hName:f,hProperties:{className:p,...c&&{...c}}}}},"constructMarkNode"),r=a(function(l,u,c){if(!c||typeof u>"u"||!h1.test(l.value))return;const h=[],f=l.value;let p="",d=0,m=0;const g=Array.from(f.matchAll(p1));for(let y=0;y<g.length;y++){const b=g[y],[w,k,_]=b,C=b.index,S=w.length,A=d+m;if(d=C,m=S,C>A){const P=f.substring(A,C),N=V("text",P);h.push(N)}const E=n(k,[{type:"text",value:_.trim()}]);h.push(E),p=f.slice(C+S)}if(p){const y=V("text",p);h.push(y)}h.length&&c.children.splice(u,1,...h)},"visitorFirst"),i=a(function(l,u,c){if(!c||typeof u>"u"||!d1.test(l.value))return;const h=l,f=Oi(c,h,function(R){return R.type==="text"&&g1.test(R.value)});if(!f)return;const p=u1(c,h),d=l1(c,h,f),m=c1(c,f),g=h.value,y=Array.from(g.matchAll(m1))[0],[b,w]=y,k=b.length,_=y.index;if(_>0){const R=g.substring(0,_),O=V("text",R);p.push(O)}if(g.length>_+k){const R=g.slice(_+k),O=V("text",R);d.unshift(O)}const C=f.value,S=Array.from(C.matchAll(y1))[0],[A]=S,E=A.length,P=S.index;if(P>0){const R=C.substring(0,P),O=V("text",R);d.push(O)}if(C.length>P+E){const R=C.slice(P+E),O=V("text",R);m.unshift(O)}const N=n(w,d);return c.children=[...p,N,...m],u},"visitorSecond"),s=a(function(l,u,c){if(!c||typeof u>"u"||!b1.test(l.value))return;if(e.actionForEmptyContent==="remove")return l.value=l.value.replaceAll(lu,""),l.value.trim()===""?[Ti,u]:Ce;const h=[],f=l.value;let p="",d=0,m=0;const g=Array.from(f.matchAll(lu));for(let y=0;y<g.length;y++){const b=g[y],[w,k]=b,_=b.index,C=w.length,S=d+m;if(d=_,m=C,_>S){const E=f.substring(S,_),P=V("text",E);h.push(P)}const A=n(k,[]);h.push(A),p=f.slice(_+C)}if(p){const y=V("text",p);h.push(y)}h.length&&c.children.splice(u,1,...h)},"visitorThird");return a(l=>{if(ee(l,"text",r),ee(l,"text",i),e.actionForEmptyContent!=="keep"&&ee(l,"text",s),e.equalityOperator){const u=new RegExp(e.equalityOperator,"gi");ee(l,"text",c=>{c.value=c.value.replaceAll(u,"==")})}},"transformer")},"plugin$1");var uu={exports:{}};(function(t){(function(){var e;e=t.exports=i,e.format=i,e.vsprintf=r,typeof console<"u"&&typeof console.log=="function"&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}a(n,"printf");function r(s,o){return i.apply(null,[s].concat(o))}a(r,"vsprintf");function i(s){for(var o=1,l=[].slice.call(arguments),u=0,c=s.length,h="",f,p=!1,d,m,g=!1,y,b=a(function(){return l[o++]},"nextArg"),w=a(function(){for(var k="";/\d/.test(s[u]);)k+=s[u++],f=s[u];return k.length>0?parseInt(k):null},"slurpNumber");u<c;++u)if(f=s[u],p)switch(p=!1,f=="."?(g=!1,f=s[++u]):f=="0"&&s[u+1]=="."?(g=!0,u+=2,f=s[u]):g=!0,y=w(),f){case"b":h+=parseInt(b(),10).toString(2);break;case"c":d=b(),typeof d=="string"||d instanceof String?h+=d:h+=String.fromCharCode(parseInt(d,10));break;case"d":h+=parseInt(b(),10);break;case"f":m=String(parseFloat(b()).toFixed(y||6)),h+=g?m:m.replace(/^0/,"");break;case"j":h+=JSON.stringify(b());break;case"o":h+="0"+parseInt(b(),10).toString(8);break;case"s":h+=b();break;case"x":h+="0x"+parseInt(b(),10).toString(16);break;case"X":h+="0x"+parseInt(b(),10).toString(16).toUpperCase();break;default:h+=f;break}else f==="%"?p=!0:h+=f;return h}a(i,"format")})()})(uu);var S1=uu.exports,x1=Ji(S1);const Tr=Object.assign(St(Error),{eval:St(EvalError),range:St(RangeError),reference:St(ReferenceError),syntax:St(SyntaxError),type:St(TypeError),uri:St(URIError)});function St(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){const i=n&&x1(n,...r);return new t(i)}a(e,"FormattedError")}a(St,"create");const Ir={}.hasOwnProperty,cu={yaml:"-",toml:"+"};function gs(t){const e=[];let n=-1;const r=Array.isArray(t)?t:t?[t]:["yaml"];for(;++n<r.length;)e[n]=v1(r[n]);return e}a(gs,"toMatters");function v1(t){let e=t;if(typeof e=="string"){if(!Ir.call(cu,e))throw Tr("Missing matter definition for `%s`",e);e={type:e,marker:cu[e]}}else if(typeof e!="object")throw Tr("Expected matter to be an object, not `%j`",e);if(!Ir.call(e,"type"))throw Tr("Missing `type` in matter `%j`",e);if(!Ir.call(e,"fence")&&!Ir.call(e,"marker"))throw Tr("Missing `marker` or `fence` in matter `%j`",e);return e}a(v1,"matter");function _1(t){const e=gs(t),n={};let r=-1;for(;++r<e.length;){const i=e[r],s=ys(i,"open").charCodeAt(0),o=C1(i),l=n[s];Array.isArray(l)?l.push(o):n[s]=[o]}return{flow:n}}a(_1,"frontmatter");function C1(t){const e=t.anywhere,n=t.type,r=n+"Fence",i=r+"Sequence",s=n+"Value",o={tokenize:h,partial:!0};let l,u=0;return{tokenize:c,concrete:!0};function c(f,p,d){const m=this;return g;function g(A){const E=m.now();return E.column===1&&(E.line===1||e)&&(l=ys(t,"open"),u=0,A===l.charCodeAt(u))?(f.enter(n),f.enter(r),f.enter(i),y(A)):d(A)}function y(A){return u===l.length?(f.exit(i),q(A)?(f.enter("whitespace"),b(A)):w(A)):A===l.charCodeAt(u++)?(f.consume(A),y):d(A)}function b(A){return q(A)?(f.consume(A),b):(f.exit("whitespace"),w(A))}function w(A){return F(A)?(f.exit(r),f.enter("lineEnding"),f.consume(A),f.exit("lineEnding"),l=ys(t,"close"),u=0,f.attempt(o,S,k)):d(A)}function k(A){return A===null||F(A)?C(A):(f.enter(s),_(A))}function _(A){return A===null||F(A)?(f.exit(s),C(A)):(f.consume(A),_)}function C(A){return A===null?d(A):(f.enter("lineEnding"),f.consume(A),f.exit("lineEnding"),f.attempt(o,S,k))}function S(A){return f.exit(n),p(A)}}function h(f,p,d){let m=0;return g;function g(k){return k===l.charCodeAt(m)?(f.enter(r),f.enter(i),y(k)):d(k)}function y(k){return m===l.length?(f.exit(i),q(k)?(f.enter("whitespace"),b(k)):w(k)):k===l.charCodeAt(m++)?(f.consume(k),y):d(k)}function b(k){return q(k)?(f.consume(k),b):(f.exit("whitespace"),w(k))}function w(k){return k===null||F(k)?(f.exit(r),p(k)):d(k)}}}a(C1,"createConstruct");function ys(t,e){return t.marker?fu(t.marker,e).repeat(3):fu(t.fence,e)}a(ys,"fence$1");function fu(t,e){return typeof t=="string"?t:t[e]}a(fu,"pick$1");function N1(t){const e=gs(t),n={},r={};let i=-1;for(;++i<e.length;){const s=e[i];n[s.type]=A1(s),r[s.type]=E1,r[s.type+"Value"]=T1}return{enter:n,exit:r}}a(N1,"frontmatterFromMarkdown");function A1(t){return e;function e(n){this.enter({type:t.type,value:""},n),this.buffer()}}a(A1,"opener");function E1(t){const e=this.resume(),n=this.stack[this.stack.length-1];this.exit(t),n.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,"")}a(E1,"close");function T1(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}a(T1,"value");function I1(t){const e=[],n={},r=gs(t);let i=-1;for(;++i<r.length;){const s=r[i];n[s.type]=L1(s);const o=bs(s,"open");e.push({atBreak:!0,character:o.charAt(0),after:mn(o.charAt(1))})}return{unsafe:e,handlers:n}}a(I1,"frontmatterToMarkdown");function L1(t){const e=bs(t,"open"),n=bs(t,"close");return r;function r(i){return e+(i.value?`
|
|
@@ -220,11 +221,9 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
220
221
|
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(i&&n.sep&&!n.value){const o=[];for(let l=0;l<n.sep.length;++l){const u=n.sep[l];switch(u.type){case"newline":o.push(l);break;case"space":break;case"comment":u.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Et(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(sf(n.key)&&!Et(n.sep,"newline")){const o=an(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:u}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Et(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=an(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Et(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){r&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Et(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=Xr(r),s=an(i);of(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
221
222
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
222
223
|
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Xr(e),r=an(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Xr(e),r=an(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function aN(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new sN||null,prettyErrors:e}}a(aN,"parseOptions");function lN(t,e={}){const{lineCounter:n,prettyErrors:r}=aN(e),i=new oN(n?.addNewLine),s=new eN(e);let o=null;for(const l of s.compose(i.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Bn(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Vc(t,n)),o.warnings.forEach(Vc(t,n))),o}a(lN,"parseDocument");function af(t,e,n){let r;const i=lN(t,n);if(!i)return null;if(i.warnings.forEach(s=>xc(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}a(af,"parse");function lf(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){const{keepUndefined:i}=n??e??{};if(!i)return}return new Hn(t,r,n).toString(n)}a(lf,"stringify");const uN={...ge};async function cN(t,e){const{obsidianVault:n}=Ne(uN,e??{}),r=is().use(X_).use(P1,[{anywhere:!1,marker:"-",type:"yaml"}]).use(a1,{automaticAlias:!0,obsidianVault:n}).use(o_,{singleTilde:!1}).use(S_).use(u_).use(k1);return r.run(r.parse(t))}a(cN,"getAstFromMarkdown");function fN(t,e){return ee(t,e,(n,r,i)=>{if(i&&r!==void 0)return i.children.splice(r,1),He}),t}a(fN,"deleteFirstNodeOfType");function hN(t){let e=1;return ee(t,"delete",(n,r,i)=>{if(i===void 0||r===void 0||!("children"in n))return Ce;const s=n.children.at(-1),o=n.children.length>1&&s?.type==="emphasis"?[V("text",`{{c${e}::`),...n.children.slice(0,-1),V("text","::"),...n.children.slice(-1),V("text","}}")]:[V("text",`{{c${e}::`),...n.children,V("text","}}")];i.children.splice(r,1,...o),e+=1}),t}a(hN,"replaceDeleteNodesWithClozeMarkup");function uf(t){let e,n=!1;if(ee(t,"thematicBreak",(s,o,l)=>o===void 0||l===void 0?Ce:(e=o,l.children[o+1]?.type==="thematicBreak"&&(n=!0),He)),e===void 0)return[t,void 0];const r={children:t.children.slice(0,e),type:"root"},i={children:t.children.slice(e+(n?2:1)),type:"root"};return[r,i]}a(uf,"splitTreeAtThematicBreak");function pN(t){let e;if(ee(t,r=>{if(r.type==="thematicBreak")return e=void 0,He;if(r.type==="delete")return e="Yanki - Cloze",He}),e!==void 0)return e;if(!mN(t)&&gN(t))return"Yanki - Basic (type in the answer)";let n;return ee(t,"thematicBreak",(r,i,s)=>{if(s===null||i===null)return Ce;e=n?.type==="thematicBreak"&&r.type==="thematicBreak"?"Yanki - Basic (and reversed card)":"Yanki - Basic",n=r}),e??"Yanki - Basic"}a(pN,"getYankiModelNameFromTree");function dN(t){let e;if(ee(t,"yaml",r=>"value"in r?(e=r.value,He):Ce),!e)return{};const n=af(e);if(!n)throw new Error("Could not parse frontmatter");return n}a(dN,"getFrontmatterFromTree");function mN(t){let e=!1;return ee(t,"thematicBreak",()=>(e=!0,He)),e}a(mN,"hasThematicBreak");function gN(t){let e,n=0;return ee(t,r=>{if(r.type==="text"&&r.value.trim()!=="")e=r,n++;else if(r.type==="emphasis"&&r.children.some(i=>i.type==="text"&&i.value.trim()!==""))return e=r,n++,Ti}),e!==void 0&&e.type==="emphasis"&&n>1}a(gN,"isLastVisibleNodeEmphasisWithOthers");function yN(t){let e,n,r;if(ee(t,"emphasis",(i,s,o)=>{if(o===void 0||s===void 0||i.type!=="emphasis")return Ce;e=i,n=o,r=s}),n&&e&&typeof r=="number")return n.children.splice(r,1),e}a(yN,"removeLastEmphasis");const cf={namespaceValidationAndSanitization:!0,...ge};async function ff(t,e){const{basePath:n,cwd:r,fetchAdapter:i=dn(),fileAdapter:s=await Ft(),namespace:o,namespaceValidationAndSanitization:l,obsidianVault:u,syncMediaAssets:c}=Ne(cf,e??{}),h=l?pt(o):o;let f=await cN(t,{obsidianVault:u});const p=pN(f),d=dN(f);f=fN(f,"yaml");let m="",g="";switch(p){case"Yanki - Basic":case"Yanki - Basic (and reversed card)":{const[b,w]=uf(f);m=await Vt(b,{basePath:n,cssClassNames:[Rt,`namespace-${h}`,"front",`model-${p}`],cwd:r,fetchAdapter:i,fileAdapter:s,namespace:h,syncMediaAssets:c,useEmptyPlaceholder:!0}),g=await Vt(w,{basePath:n,cssClassNames:[Rt,`namespace-${h}`,"back",`model-${p}`],cwd:r,fetchAdapter:i,fileAdapter:s,namespace:h,syncMediaAssets:c,useEmptyPlaceholder:!0});break}case"Yanki - Cloze":{f=hN(f);const[b,w]=uf(f);m=await Vt(b,{basePath:n,cssClassNames:[Rt,`namespace-${h}`,"front",`model-${p}`],cwd:r,fetchAdapter:i,fileAdapter:s,namespace:h,syncMediaAssets:c,useEmptyPlaceholder:!0}),g=await Vt(w,{basePath:n,cssClassNames:[Rt,`namespace-${h}`,"back",`model-${p}`],cwd:r,fetchAdapter:i,fileAdapter:s,namespace:h,syncMediaAssets:c,useEmptyPlaceholder:!1});break}case"Yanki - Basic (type in the answer)":{const b=yN(f);if(b===void 0)throw new Error("Could not find emphasis in Basic (type in the answer) note AST.");const w=f,k=V("root",V("paragraph",b.children));m=await Vt(w,{basePath:n,cssClassNames:[Rt,`namespace-${h}`,"front",`model-${p}`],cwd:r,fetchAdapter:i,fileAdapter:s,namespace:h,syncMediaAssets:c,useEmptyPlaceholder:!0}),g=await Vt(k,{basePath:n,cssClassNames:[Rt,`namespace-${h}`,"back",`model-${p}`],cwd:r,fetchAdapter:i,fileAdapter:s,namespace:h,syncMediaAssets:c,useEmptyPlaceholder:!1});break}}return{deckName:"",fields:{Back:g,Front:m,YankiNamespace:h},modelName:p,noteId:d.noteId??void 0,tags:d.tags??[]}}a(ff,"getNoteFromMarkdown");const bN={...ge};async function hf(t,e){const{basePath:n,fetchAdapter:r=dn(),fileAdapter:i=await Ft(),namespace:s,obsidianVault:o,syncMediaAssets:l}=Ne(bN,e??{}),u=pt(s);t.sort((f,p)=>f.localeCompare(p));const c=kN(t,{basePath:n}),h=[];for(const[f,p]of t.entries()){const d=await i.readFile(p),m=await ff(d,{basePath:n,cwd:W.dirname(p),fetchAdapter:r,fileAdapter:i,namespace:u,namespaceValidationAndSanitization:!1,obsidianVault:o,syncMediaAssets:l});m.deckName===""&&(m.deckName=c[f]),h.push({filePath:p,filePathOriginal:p,markdown:d,note:m})}return h}a(hf,"loadLocalNotes");const wN={...ge,mode:"common-root"};function kN(t,e){const{basePath:n,cwd:r,mode:i}=Ne(wN,e??{}),s=t.map(h=>W.dirname(Ao(h,{basePath:n,cwd:r})).split(W.sep)),o=s.reduce((h,f)=>h.filter((d,m)=>d===f[m])),l=s.some(h=>h.at(-1)===o.at(-1)),u=i==="common-parent"||l?1:0;return s.map(h=>h.slice(o.length-u).join("::"))}a(kN,"getDeckNamesFromFilePaths");const SN={...ge};async function pf(t,e){const{dryRun:n,fileAdapter:r=await Ft(),manageFilenames:i,maxFilenameLength:s}=Ne(SN,e??{});if(i!=="off"){const o=[];for(const u of t){const{filePath:c,note:h}=u;if(c===void 0)throw new Error("File path is undefined");const f=e1(h,i,s),p=W.join(W.dirname(c),`${f}${W.extname(c)}`),d=t1(p,o);u.filePath=d,o.push(d.toLowerCase())}for(const u of t){const{filePath:c}=u;if(c===void 0)throw new Error("File path is undefined");u.filePath=n1(c,o)}const l=new Map;for(const u of t){const{filePath:c,filePathOriginal:h}=u;if(h===void 0)throw new Error("Original file path is undefined.");if(c===void 0)throw new Error("File path is undefined.");if(c===h)continue;let f=c;t.some(({filePath:p,filePathOriginal:d})=>p!==c&&d?.toLowerCase()===c.toLowerCase())&&(f=r1(c),l.set(f,c)),n||await r.rename(h,f)}for(const[u,c]of l)n||await r.rename(u,c)}return t.sort((o,l)=>o.filePath.localeCompare(l.filePath)),t}a(pf,"renameNotes");const df={...ge};async function xN(t,e){const{basePath:n,dryRun:r,fetchAdapter:i=dn(),fileAdapter:s=await Ft(),manageFilenames:o,maxFilenameLength:l,namespace:u,obsidianVault:c,syncMediaAssets:h}=Ne(df,e??{}),f=pt(u),p=await hf(t,{basePath:n,fetchAdapter:i,fileAdapter:s,namespace:f,obsidianVault:c,syncMediaAssets:h}),d=await pf(p,{dryRun:r,fileAdapter:s,manageFilenames:o,maxFilenameLength:l});return{dryRun:r,notes:d}}a(xN,"renameFiles");const lo={css:Ff,...ge},vN={...ge};async function _N(t){const{ankiConnectOptions:e}=Ne(lo,t??{}),n=new pn(e);if(await An(n)==="ankiUnreachable")throw new Error("Anki is unreachable. Is Anki running?");const i=new Set;for(const s of Er){const o=await xb(n,s);i.add(o)}if(i.size===0)throw new Error("No CSS found in any Yanki model.");if(i.size>1)throw new Error("Expected all Yanki models to have identical CSS.");return[...i][0]}a(_N,"getStyle");async function CN(t){const e=performance.now(),{ankiConnectOptions:n,ankiWeb:r,css:i,dryRun:s}=Ne(lo,t??{}),o=new pn(n);if(await An(o)==="ankiUnreachable")throw new Error("Anki is unreachable. Is Anki running?");const u=[];for(const h of Er){const f=await Ql(o,h,i,s);u.push({action:f?"updated":"unchanged",name:h})}const c=u.some(h=>h.action!=="unchanged");return!s&&r&&(c||ii)&&await ps(o),{ankiWeb:r,dryRun:s,duration:performance.now()-e,models:u}}a(CN,"setStyle");function NN(t,e=!1){const n=[],r=t.models.filter(s=>s.action==="unchanged"),i=t.models.filter(s=>s.action==="updated");if(n.push(`${t.dryRun?"Will":"Successfully"} update ${i.length} ${Wt("model",i.length)} and left ${r.length} ${Wt("model",r.length)} unchanged${t.dryRun?"":` in ${ds(t.duration)}`}.`),e){if(i.length>0){n.push("",t.dryRun?"Models to update:":"Updated models:");for(const s of i)n.push(` ${s.name}`)}if(r.length>0){n.push("",t.dryRun?"Models unchanged:":"Unchanged models:");for(const s of r)n.push(` ${s.name}`)}}return n.join(`
|
|
223
|
-
`)}a(NN,"formatSetStyleResult");async function AN(t,e){const[n,r]=EN(t),i=t.split(
|
|
224
|
-
`);if(n===void 0||r===void 0)return e===void 0?t:["---",lf({noteId:e}).trim(),`---
|
|
224
|
+
`)}a(NN,"formatSetStyleResult");async function AN(t,e){const[n,r]=EN(t),i=t.split(/\r?\n/);if(n===void 0||r===void 0)return e===void 0?t:["---",lf({noteId:e}).trim(),`---
|
|
225
225
|
`,...i].join(`
|
|
226
226
|
`);const s=i.slice(n+1,r).join(`
|
|
227
227
|
`),o=await af(s)??{};e===void 0?delete o.noteId:o.noteId=e;const l=lf(o,{lineWidth:0}).trim();return[...i.slice(0,n+1),l,...i.slice(r)].join(`
|
|
228
|
-
`)}a(AN,"setNoteIdInFrontmatter");function EN(t){const e=t.split(`
|
|
229
|
-
`);if(!e.join("").trim().startsWith("---"))return[void 0,void 0];const n=e.findIndex(i=>i.startsWith("---")),r=e.findIndex((i,s)=>s>n&&i.startsWith("---"));return n===-1||r===-1?[void 0,void 0]:[n,r]}a(EN,"getFrontmatterRange");const mf={...ge};async function TN(t,e){const n=performance.now(),{ankiConnectOptions:r,ankiWeb:i,dryRun:s,namespace:o}=Ne(mf,e??{}),l=pt(o),u=[],c=new pn(r);if(await An(c)==="ankiUnreachable")return{ankiWeb:i,deletedDecks:[],deletedMedia:[],dryRun:s,duration:performance.now()-n,namespace:l,synced:t.map(_=>({action:"ankiUnreachable",note:_}))};const f=await hs(c,l),p=f.filter(_=>!t.some(C=>C.noteId===_?.noteId));await Kl(c,p,s);for(const _ of p)u.push({action:"deleted",note:_});for(const _ of t)_.deckName===""&&(_.deckName=Mf);for(const _ of t){if(_.noteId===void 0)continue;const C=IN(t,_.noteId);if(C.length<=1)continue;const S=f.find(E=>E?.noteId===_.noteId),A=LN(C,S);for(const E of C)E!==A&&(E.noteId=void 0)}const d=t.map(_=>_.noteId).map(_=>_??-1),m=await Yl(c,d);for(const[_,C]of m.entries()){const S=t[_];if(C===void 0||S.fields.YankiNamespace!==C.fields.YankiNamespace){const A=await fs(c,{...S,noteId:void 0},s);u.push({action:"created",note:{...S,noteId:A}})}else if(S.modelName===C.modelName){const A=await bb(c,S,C,s);u.push({action:A?"updated":"unchanged",note:S})}else{if(C.noteId===void 0)throw new Error("Remote note ID is undefined");await yb(c,S,s),u.push({action:"updated",note:S})}}const g=[],y=[];for(const _ of u)_.action==="deleted"?y.push(_.note):g.push(_.note);const b=await Jl(c,g,f,s),w=await Zl(c,g,l,s),k=b.length>0||u.some(_=>_.action!=="unchanged");return!s&&i&&(k||ii)&&await ps(c),{ankiWeb:i,deletedDecks:b,deletedMedia:w,dryRun:s,duration:performance.now()-n,namespace:l,synced:u}}a(TN,"syncNotes");function IN(t,e){return t.filter(n=>n.noteId===void 0?!1:n.noteId===e)}a(IN,"findNotesWithDuplicateIds");function LN(t,e){return t.find(n=>n.fields.Front===e?.fields.Front&&n.fields.Back===e?.fields.Back)??t[0]}a(LN,"selectNoteToKeep");const gf={...ge,...mf};async function ON(t,e){const n=performance.now(),{ankiConnectOptions:r,ankiWeb:i,basePath:s,dryRun:o,fetchAdapter:l=dn(),fileAdapter:u=await Ft(),manageFilenames:c,maxFilenameLength:h,namespace:f,obsidianVault:p,syncMediaAssets:d}=Ne(gf,e??{}),m=pt(f),g=await hf(t,{basePath:s,fetchAdapter:l,fileAdapter:u,namespace:m,obsidianVault:p,syncMediaAssets:d}),y=await pf(g,{dryRun:o,fileAdapter:u,manageFilenames:c,maxFilenameLength:h}),b=y.map(E=>E.note),{deletedDecks:w,deletedMedia:k,synced:_}=await TN(b,{ankiConnectOptions:r,ankiWeb:i,dryRun:o,namespace:m}),C=_.filter(E=>E.action!=="deleted");for(const[E,P]of y.entries()){const N=C[E];if((P.note.noteId===void 0||P.note.noteId!==N.note.noteId)&&N.action!=="ankiUnreachable"){const R=await AN(P.markdown,N.note.noteId);await u.writeFile(P.filePath,R)}N.filePath=P.filePath,N.filePathOriginal=P.filePathOriginal}const A=[..._.filter(E=>E.action==="deleted").map(E=>({action:"deleted",filePath:void 0,filePathOriginal:void 0,note:E.note})),...C].sort((E,P)=>(E.filePath??"").localeCompare(P.filePath??""));return{ankiWeb:i,deletedDecks:w,deletedMedia:k,dryRun:o,duration:performance.now()-n,namespace:m,synced:A}}a(ON,"syncFiles");function PN(t,e=!1){const n=[],{synced:r}=t,i=r.reduce((u,c)=>(u[c.action]=(u[c.action]||0)+1,u),{}),s=r.filter(u=>u.action!=="deleted").length,o=r.filter(u=>u.filePath!==u.filePathOriginal).length,l=i.ankiUnreachable>0;if(n.push(`${t.dryRun?"Will sync":l?"Failed to sync":"Successfully synced"} ${s} ${Wt("note",s)} to Anki${t.dryRun?"":` in ${ds(t.duration)}`}.`),e){n.push("",t.dryRun?"Sync Plan Summary:":"Sync Summary:");for(const[u,c]of Object.entries(i))n.push(` ${ni(u)}: ${c}`);o>0&&n.push("",`Local notes renamed: ${o}`),t.deletedDecks.length>0&&n.push("",`Decks pruned: ${t.deletedDecks.length}`),t.deletedMedia.length>0&&n.push("",`Media assets deleted: ${t.deletedMedia.length}`),n.push("",t.dryRun?"Sync Plan Details:":"Sync Details:");for(const{action:u,filePath:c,note:h}of r)c===void 0?n.push(` Note ID ${h.noteId} ${ni(u)} (From Anki)`):n.push(` Note ID ${h.noteId} ${ni(u)} ${c}`)}return n.join(`
|
|
228
|
+
`)}a(AN,"setNoteIdInFrontmatter");function EN(t){const e=t.split(/\r?\n/);if(!e.join("").trim().startsWith("---"))return[void 0,void 0];const n=e.findIndex(i=>i.startsWith("---")),r=e.findIndex((i,s)=>s>n&&i.startsWith("---"));return n===-1||r===-1?[void 0,void 0]:[n,r]}a(EN,"getFrontmatterRange");const mf={...ge};async function TN(t,e){const n=performance.now(),{ankiConnectOptions:r,ankiWeb:i,dryRun:s,namespace:o}=Ne(mf,e??{}),l=pt(o),u=[],c=new pn(r);if(await An(c)==="ankiUnreachable")return{ankiWeb:i,deletedDecks:[],deletedMedia:[],dryRun:s,duration:performance.now()-n,namespace:l,synced:t.map(_=>({action:"ankiUnreachable",note:_}))};const f=await hs(c,l),p=f.filter(_=>!t.some(C=>C.noteId===_?.noteId));await Kl(c,p,s);for(const _ of p)u.push({action:"deleted",note:_});for(const _ of t)_.deckName===""&&(_.deckName=Mf);for(const _ of t){if(_.noteId===void 0)continue;const C=IN(t,_.noteId);if(C.length<=1)continue;const S=f.find(E=>E?.noteId===_.noteId),A=LN(C,S);for(const E of C)E!==A&&(E.noteId=void 0)}const d=t.map(_=>_.noteId).map(_=>_??-1),m=await Yl(c,d);for(const[_,C]of m.entries()){const S=t[_];if(C===void 0||S.fields.YankiNamespace!==C.fields.YankiNamespace){const A=await fs(c,{...S,noteId:void 0},s);u.push({action:"created",note:{...S,noteId:A}})}else if(S.modelName===C.modelName){const A=await bb(c,S,C,s);u.push({action:A?"updated":"unchanged",note:S})}else{if(C.noteId===void 0)throw new Error("Remote note ID is undefined");await yb(c,S,s),u.push({action:"updated",note:S})}}const g=[],y=[];for(const _ of u)_.action==="deleted"?y.push(_.note):g.push(_.note);const b=await Jl(c,g,f,s),w=await Zl(c,g,l,s),k=b.length>0||u.some(_=>_.action!=="unchanged");return!s&&i&&(k||ii)&&await ps(c),{ankiWeb:i,deletedDecks:b,deletedMedia:w,dryRun:s,duration:performance.now()-n,namespace:l,synced:u}}a(TN,"syncNotes");function IN(t,e){return t.filter(n=>n.noteId===void 0?!1:n.noteId===e)}a(IN,"findNotesWithDuplicateIds");function LN(t,e){return t.find(n=>n.fields.Front===e?.fields.Front&&n.fields.Back===e?.fields.Back)??t[0]}a(LN,"selectNoteToKeep");const gf={...ge,...mf};async function ON(t,e){const n=performance.now(),{ankiConnectOptions:r,ankiWeb:i,basePath:s,dryRun:o,fetchAdapter:l=dn(),fileAdapter:u=await Ft(),manageFilenames:c,maxFilenameLength:h,namespace:f,obsidianVault:p,syncMediaAssets:d}=Ne(gf,e??{}),m=pt(f),g=await hf(t,{basePath:s,fetchAdapter:l,fileAdapter:u,namespace:m,obsidianVault:p,syncMediaAssets:d}),y=await pf(g,{dryRun:o,fileAdapter:u,manageFilenames:c,maxFilenameLength:h}),b=y.map(E=>E.note),{deletedDecks:w,deletedMedia:k,synced:_}=await TN(b,{ankiConnectOptions:r,ankiWeb:i,dryRun:o,namespace:m}),C=_.filter(E=>E.action!=="deleted");for(const[E,P]of y.entries()){const N=C[E];if((P.note.noteId===void 0||P.note.noteId!==N.note.noteId)&&N.action!=="ankiUnreachable"){const R=await AN(P.markdown,N.note.noteId);await u.writeFile(P.filePath,R)}N.filePath=P.filePath,N.filePathOriginal=P.filePathOriginal}const A=[..._.filter(E=>E.action==="deleted").map(E=>({action:"deleted",filePath:void 0,filePathOriginal:void 0,note:E.note})),...C].sort((E,P)=>(E.filePath??"").localeCompare(P.filePath??""));return{ankiWeb:i,deletedDecks:w,deletedMedia:k,dryRun:o,duration:performance.now()-n,namespace:m,synced:A}}a(ON,"syncFiles");function PN(t,e=!1){const n=[],{synced:r}=t,i=r.reduce((u,c)=>(u[c.action]=(u[c.action]||0)+1,u),{}),s=r.filter(u=>u.action!=="deleted").length,o=r.filter(u=>u.filePath!==u.filePathOriginal).length,l=i.ankiUnreachable>0;if(n.push(`${t.dryRun?"Will sync":l?"Failed to sync":"Successfully synced"} ${s} ${Wt("note",s)} to Anki${t.dryRun?"":` in ${ds(t.duration)}`}.`),e){n.push("",t.dryRun?"Sync Plan Summary:":"Sync Summary:");for(const[u,c]of Object.entries(i))n.push(` ${ni(u)}: ${c}`);o>0&&n.push("",`Local notes renamed: ${o}`),t.deletedDecks.length>0&&n.push("",`Decks pruned: ${t.deletedDecks.length}`),t.deletedMedia.length>0&&n.push("",`Media assets deleted: ${t.deletedMedia.length}`),n.push("",t.dryRun?"Sync Plan Details:":"Sync Details:");for(const{action:u,filePath:c,note:h}of r)c===void 0?n.push(` Note ID ${h.noteId} ${ni(u)} (From Anki)`):n.push(` Note ID ${h.noteId} ${ni(u)} ${c}`)}return n.join(`
|
|
230
229
|
`)}a(PN,"formatSyncFilesResult");export{ru as a,Gk as b,zk as c,nu as d,df as e,Uk as f,vN as g,lo as h,NN as i,_N as j,gf as k,jk as l,PN as m,ON as n,cf as o,ff as p,Pf as q,xN as r,CN as s,ge as t,Of as u};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yanki",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A CLI tool and TypeScript library for syncing Markdown to Anki flashcards.",
|
|
6
6
|
"repository": {
|
|
@@ -51,13 +51,14 @@
|
|
|
51
51
|
"@types/hast": "^3.0.4",
|
|
52
52
|
"@types/lodash-es": "^4.17.12",
|
|
53
53
|
"@types/mdast": "^4.0.4",
|
|
54
|
-
"@types/node": "^20.14.
|
|
54
|
+
"@types/node": "^20.14.9",
|
|
55
55
|
"@types/unist": "^3.0.2",
|
|
56
56
|
"@types/yargs": "^17.0.32",
|
|
57
57
|
"chalk": "^5.3.0",
|
|
58
58
|
"globby": "^14.0.1",
|
|
59
59
|
"rehype-mathjax": "^6.0.0",
|
|
60
60
|
"rehype-parse": "^9.0.0",
|
|
61
|
+
"slash": "^5.1.0",
|
|
61
62
|
"yargs": "^17.7.2"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
"remark-rehype": "^11.1.0",
|
|
91
92
|
"remark-remove-comments": "^1.0.1",
|
|
92
93
|
"remark-wiki-link": "^2.0.1",
|
|
94
|
+
"rimraf": "^5.0.7",
|
|
93
95
|
"sort-keys": "^5.0.0",
|
|
94
96
|
"tsx": "^4.15.7",
|
|
95
97
|
"type-fest": "^4.20.1",
|
|
@@ -108,7 +110,7 @@
|
|
|
108
110
|
},
|
|
109
111
|
"scripts": {
|
|
110
112
|
"build": "pkgroll --clean-dist --minify",
|
|
111
|
-
"clean": "git clean -fdX &&
|
|
113
|
+
"clean": "git clean -fdX && rimraf ./pnpm-lock.yaml",
|
|
112
114
|
"coverage": "vitest run --coverage",
|
|
113
115
|
"fix": "shared-config --fix",
|
|
114
116
|
"lint": "shared-config --lint",
|