UNPKG

docsify

Version:

A magical documentation generator.

9 lines • 155 kB
/*!
 * Docsify Plugin: search v5.1.0
 * https://docsify.js.org
 * (c) 2017-2026
 * MIT license
 */
!function(){"use strict";function e(e=""){const t={};return e&&(e=e.replace(/^('|")/,"").replace(/('|")$/,"").replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g,((e,n,r)=>-1!==n.indexOf(":")?e:(!0!==(r=r&&r.replace(/&quot;/g,"")||!0)&&void 0!==t[n]?(Array.isArray(t[n])||r===t[n]||(t[n]=[t[n]]),t[n].includes(r)||t[n].push(r)):t[n]=r,""))).trim()),{str:e,config:t}}function t(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return String(e).replace(/[&<>"']/g,(e=>t[e]))}function n(e){const t=Object.create(null);return function(n){const r="string"==typeof(i=n)||"number"==typeof i?n:JSON.stringify(n);var i;return r in t?t[r]:t[r]=e(n)}}const r=n((e=>/(:|(\/{2}))/g.test(e))),i=n((e=>{if(/\/$/g.test(e))return e;const t=e.match(/(\S*\/)[^/]+$/);return t?t[1]:""})),o=n((e=>e.replace(/^\/+/,"/").replace(/([^:])\/{2,}/g,"$1/")));function a(e){return e.split("/").filter((e=>-1===e.indexOf("#"))).join("/")}function s(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var u={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function l(e){u=e}var c={exec:()=>null};function h(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(p.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var f=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),p={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},d=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,g=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,y=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,m=h(y).replace(/bull/g,g).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),b=h(y).replace(/bull/g,g).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),v=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,k=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,w=h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",k).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),x=h(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,g).getRegex(),_="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",S=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,E=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",S).replace("tag",_).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),P=h(v).replace("hr",d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_).getRegex(),A={blockquote:h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",P).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:w,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:d,html:E,lheading:m,list:x,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:P,table:c,text:/^[^\n]+/},R=h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_).getRegex(),O={...A,lheading:b,table:R,paragraph:h(v).replace("hr",d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",R).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_).getRegex()},T={...A,html:h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",S).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:c,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(v).replace("hr",d).replace("heading"," *#{1,6} *[^\n]").replace("lheading",m).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},C=/^( {2,}|\\)\n(?!\s*$)/,K=/[\p{P}\p{S}]/u,D=/[\s\p{P}\p{S}]/u,$=/[^\s\p{P}\p{S}]/u,I=h(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,D).getRegex(),j=/(?!~)[\p{P}\p{S}]/u,q=h(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",f?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),B=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,z=h(B,"u").replace(/punct/g,K).getRegex(),N=h(B,"u").replace(/punct/g,j).getRegex(),M="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",F=h(M,"gu").replace(/notPunctSpace/g,$).replace(/punctSpace/g,D).replace(/punct/g,K).getRegex(),L=h(M,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,j).getRegex(),U=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$).replace(/punctSpace/g,D).replace(/punct/g,K).getRegex(),Q=h(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,K).getRegex(),V=h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,$).replace(/punctSpace/g,D).replace(/punct/g,K).getRegex(),H=h(/\\(punct)/,"gu").replace(/punct/g,K).getRegex(),Y=h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Z=h(S).replace("(?:--\x3e|$)","--\x3e").getRegex(),W=h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Z).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),X=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,G=h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",X).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),J=h(/^!?\[(label)\]\[(ref)\]/).replace("label",X).replace("ref",k).getRegex(),ee=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",k).getRegex(),te=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ne={_backpedal:c,anyPunctuation:H,autolink:Y,blockSkip:q,br:C,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:c,delLDelim:c,delRDelim:c,emStrongLDelim:z,emStrongRDelimAst:F,emStrongRDelimUnd:U,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:G,nolink:ee,punctuation:I,reflink:J,reflinkSearch:h("reflink|nolink(?!\\()","g").replace("reflink",J).replace("nolink",ee).getRegex(),tag:W,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:c},re={...ne,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",X).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X).getRegex()},ie={...ne,emStrongRDelimAst:L,emStrongLDelim:N,delLDelim:Q,delRDelim:V,url:h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",te).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",te).getRegex()},oe={...ie,br:h(C).replace("{2,}","*").getRegex(),text:h(ie.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ae={normal:A,gfm:O,pedantic:T},se={normal:ne,gfm:ie,breaks:oe,pedantic:re},ue={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},le=e=>ue[e];function ce(e,t){if(t){if(p.escapeTest.test(e))return e.replace(p.escapeReplace,le)}else if(p.escapeTestNoEncode.test(e))return e.replace(p.escapeReplaceNoEncode,le);return e}function he(e){try{e=encodeURI(e).replace(p.percentDecode,"%")}catch{return null}return e}function fe(e,t){let n=e.replace(p.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(p.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(p.slashPipe,"|");return n}function pe(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function de(e){let t=e.split("\n"),n=t.length-1;for(;n>=0&&p.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join("\n")}function ge(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function ye(e,t,n,r,i){let o=t.href,a=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let u={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:o,title:a,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,u}var me=class{options;rules;lexer;constructor(e){this.options=e||u}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:de(t[0]),n=e.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=pe(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:pe(t[0],"\n"),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:pe(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=pe(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,o=!1,a=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))a.push(e[t]),o=!0;else{if(o)break;a.push(e[t])}e=e.slice(t);let s=a.join("\n"),u=s.replace(this.rules.other.blockquoteSetextReplace,"\n    $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${s}`:s,r=r?`${r}\n${u}`:u;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=l,0===e.length)break;let c=i.at(-1);if("code"===c?.type)break;if("blockquote"===c?.type){let t=c,o=t.raw+"\n"+e.join("\n"),a=this.blockquote(o);i[i.length-1]=a,n=n.substring(0,n.length-t.raw.length)+a.raw,r=r.substring(0,r.length-t.text.length)+a.text;break}if("list"!==c?.type);else{let t=c,o=t.raw+"\n"+e.join("\n"),a=this.list(o);i[i.length-1]=a,n=n.substring(0,n.length-c.raw.length)+a.raw,r=r.substring(0,r.length-t.raw.length)+a.raw,e=o.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let o=this.rules.other.listItemRegex(n),a=!1;for(;e;){let n=!1,r="",s="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let u=ge(t[2].split("\n",1)[0],t[1].length),l=e.split("\n",1)[0],c=!u.trim(),h=0;if(this.options.pedantic?(h=2,s=u.trimStart()):c?h=t[1].length+1:(h=u.search(this.rules.other.nonSpaceChar),h=h>4?1:h,s=u.slice(h),h+=t[1].length),c&&this.rules.other.blankLine.test(l)&&(r+=l+"\n",e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),i=this.rules.other.fencesBeginRegex(h),o=this.rules.other.headingBeginRegex(h),a=this.rules.other.htmlBeginRegex(h),f=this.rules.other.blockquoteBeginRegex(h);for(;e;){let p,d=e.split("\n",1)[0];if(l=d,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,"  "),p=l):p=l.replace(this.rules.other.tabCharGlobal,"    "),i.test(l)||o.test(l)||a.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=h||!l.trim())s+="\n"+p.slice(h);else{if(c||u.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||i.test(u)||o.test(u)||n.test(u))break;s+="\n"+l}c=!l.trim(),r+=d+"\n",e=e.substring(d.length+1),u=p.slice(h)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(a=!0)),i.items.push({type:"list_item",raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(!s)return;s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(!e.task||"text"!==t?.type&&"paragraph"!==t?.type)e.task&&(e.task=!1);else{e.text=e.text.replace(this.rules.other.listReplaceTask,""),t.raw=t.raw.replace(this.rules.other.listReplaceTask,""),t.text=t.text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:"checkbox",raw:n[0]+" ",checked:"[ ]"!==n[0]};e.checked=t.checked,i.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:"paragraph",raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}if(!i.loose){let t=e.tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=de(t[0]);return{type:"html",block:!0,raw:e,pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:pe(t[0],"\n"),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=fe(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:pe(t[0],"\n"),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?o.align.push("right"):this.rules.other.tableAlignCenter.test(e)?o.align.push("center"):this.rules.other.tableAlignLeft.test(e)?o.align.push("left"):o.align.push(null);for(let e=0;e<n.length;e++)o.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:o.align[e]});for(let e of i)o.rows.push(fe(e,o.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]}))));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:pe(t[0],"\n"),depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=pe(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ye(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ye(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(r[1]||r[2]||r[3]||r[4])&&(!r[4]||!n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[3]||!n||this.rules.inline.punctuation.exec(n))){let n,i,o=[...r[0]].length-1,a=o,s=0,u="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);null!==(r=u.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(i=[...n].length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&o%3&&!((o+i)%3)){s+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+s);let t=[...r[0]][0].length,u=e.slice(0,o+r.index+t+i);if(Math.min(o,i)%2){let e=u.slice(1,-1);return{type:"em",raw:u,text:e,tokens:this.lexer.inlineTokens(e)}}let l=u.slice(2,-2);return{type:"strong",raw:u,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,i,o=[...r[0]].length-1,a=o,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+o);null!==(r=s.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(i=[...n].length,i!==o))continue;if(r[3]||r[4]){a+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a);let t=[...r[0]][0].length,s=e.slice(0,o+r.index+t+i),u=s.slice(o,-o);return{type:"del",raw:s,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},be=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||u,this.options.tokenizer=this.options.tokenizer||new me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:p,block:ae.normal,inline:se.normal};this.options.pedantic?(t.block=ae.pedantic,t.inline=se.pedantic):this.options.gfm&&(t.block=ae.gfm,this.options.breaks?t.inline=se.breaks:t.inline=se.gfm),this.tokenizer.rules=t}static get rules(){return{block:ae,inline:se}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(p.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(p.tabCharGlobal,"    ").replace(p.spaceLine,""));let r=1/0;for(;e;){if(!(e.length<r)){this.infiniteLoopError(e.charCodeAt(0));break}let i;if(r=e.length,this.options.extensions?.block?.some((n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0))))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);1===i.raw.length&&void 0!==n?n.raw+="\n":t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let o=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){let r=t.at(-1);n&&"paragraph"===r?.type?(r.raw+=(r.raw.endsWith("\n")?"":"\n")+i.raw,r.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=o.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n,r=e,i=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!==(i=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(i=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(i=this.tokenizer.rules.inline.blockSkip.exec(r));)n=i[2]?i[2].length:0,r=r.slice(0,i.index+n)+"["+"a".repeat(i[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,a="",s=1/0;for(;e;){if(!(e.length<s)){this.infiniteLoopError(e.charCodeAt(0));break}let n;if(s=e.length,o||(a=""),o=!1,this.options.extensions?.inline?.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))continue;if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let r=t.at(-1);"text"===n.type&&"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,r,a)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e,r,a)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let i=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0;let r=t.at(-1);"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(!this.options.silent)throw new Error(t);console.error(t)}},ve=class{options;parser;constructor(e){this.options=e||u}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(p.notSpaceStart)?.[0],i=e.replace(p.endingNewline,"")+"\n";return r?'<pre><code class="language-'+ce(r)+'">'+(n?i:ce(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:ce(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ce(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=he(e);if(null===i)return r;let o='<a href="'+(e=i)+'"';return t&&(o+=' title="'+ce(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=he(e);if(null===i)return ce(n);let o=`<img src="${e=i}" alt="${ce(n)}"`;return t&&(o+=` title="${ce(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ce(e.text)}},ke=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},we=class e{options;renderer;textRenderer;constructor(e){this.options=e||u,this.options.renderer=this.options.renderer||new ve,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ke}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){t+=n||"";continue}}let i=r;switch(i.type){case"space":t+=this.renderer.space(i);break;case"hr":t+=this.renderer.hr(i);break;case"heading":t+=this.renderer.heading(i);break;case"code":t+=this.renderer.code(i);break;case"table":t+=this.renderer.table(i);break;case"blockquote":t+=this.renderer.blockquote(i);break;case"list":t+=this.renderer.list(i);break;case"checkbox":t+=this.renderer.checkbox(i);break;case"html":t+=this.renderer.html(i);break;case"def":t+=this.renderer.def(i);break;case"paragraph":t+=this.renderer.paragraph(i);break;case"text":t+=this.renderer.text(i);break;default:{let e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}let o=i;switch(o.type){case"escape":case"text":n+=t.text(o);break;case"html":n+=t.html(o);break;case"link":n+=t.link(o);break;case"image":n+=t.image(o);break;case"checkbox":n+=t.checkbox(o);break;case"strong":n+=t.strong(o);break;case"em":n+=t.em(o);break;case"codespan":n+=t.codespan(o);break;case"br":n+=t.br(o);break;case"del":n+=t.del(o);break;default:{let e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},xe=class{options;block;constructor(e){this.options=e||u}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?be.lex:be.lexInline}provideParser(e=this.block){return e?we.parse:we.parseInline}},_e=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=we;Renderer=ve;TextRenderer=ke;Lexer=be;Tokenizer=me;Hooks=xe;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ve(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new me(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new xe;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],o=t[r];xe.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&xe.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return o.call(t,n)})();let r=i.call(t,e);return o.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await o.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return be.lex(e,t??this.defaults)}parser(e,t){return we.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?be.lex:be.lexInline)(n,i),o=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(o,i.walkTokens));let a=await(i.hooks?await i.hooks.provideParser(e):e?we.parse:we.parseInline)(o,i);return i.hooks?await i.hooks.postprocess(a):a})().catch(o);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?be.lex:be.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?we.parse:we.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return o(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+ce(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Se(e,t){return _e.parse(e,t)}Se.options=Se.setOptions=function(e){return _e.setOptions(e),Se.defaults=_e.defaults,l(Se.defaults),Se},Se.getDefaults=s,Se.defaults=u,Se.use=function(...e){return _e.use(...e),Se.defaults=_e.defaults,l(Se.defaults),Se},Se.walkTokens=function(e,t){return _e.walkTokens(e,t)},Se.parseInline=_e.parseInline,Se.Parser=we,Se.parser=we.parse,Se.Renderer=ve,Se.TextRenderer=ke,Se.Lexer=be,Se.lexer=be.lex,Se.Tokenizer=me,Se.Hooks=xe,Se.parse=Se,Se.options,Se.setOptions,Se.use,Se.walkTokens,Se.parseInline,we.parse,be.lex;const Ee=/&(?:amp|lt|gt|quot|#(0+)?39);/g,Pe=RegExp(Ee.source),Ae={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};const Re=/[&<>"']/g,Oe=RegExp(Re.source),Te={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};const Ce={space:()=>"",code({text:e}){const t=e.replace(/\n$/,"");return(n=t)&&Oe.test(n)?n.replace(Re,(e=>Te[e])):n||"";var n},blockquote({tokens:e}){return this.parser?.parse(e)||""},html:()=>"",heading({tokens:e}){return this.parser?.parseInline(e)||""},hr:()=>"",list(e){let t="";for(let n=0;n<e.items.length;n++){const r=e.items[n];t+=this.listitem?.(r)}return t},listitem(e){let t="";if(e.task){const n=this.checkbox?.({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser?.parse(e.tokens,!!e.loose),`${t||""}`},checkbox:e=>"",paragraph({tokens:e}){return this.parser?.parseInline(e)||""},table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell?.(e.header[t]);t+=this.tablerow?.({text:n});let r="";for(let t=0;t<e.rows.length;t++){const i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell?.(i[e]);r+=this.tablerow?.({text:n})}return t+" "+r},tablerow:({text:e})=>e,tablecell(e){return this.parser?.parseInline(e.tokens)||""},strong({tokens:e}){return this.parser?.parseInline(e)||""},em({tokens:e}){return this.parser?.parseInline(e)||""},codespan:({text:e})=>e,br:()=>" ",del({tokens:e}){return this.parser?.parseInline(e)},link({tokens:e,href:t,title:n}){return`${this.parser?.parseInline(e)||""} ${t||""} ${n||""}`},image:({title:e,text:t,href:n})=>`${t||""} ${n||""} ${e||""}`,text(e){return e.tokens?this.parser?.parseInline(e.tokens)||"":e.text||""}},Ke=Se.setOptions({renderer:Ce});function De(e){const t=Ke.parse(e);var n;return function(e){return e&&e.replace("!>","").replace("?>","")}((n=t)&&Pe.test(n)?n.replace(Ee,(e=>Ae[e]||"'")):n||"").trim()}var $e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var je,qe={exports:{}};var Be=(je||(je=1,qe.exports=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function n(e,t,n){for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:$e,i=Object.keys,o=Array.isArray;function a(e,t){return"object"!=typeof t||i(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||r.Promise||(r.Promise=Promise);var s=Object.getPrototypeOf,u={}.hasOwnProperty;function l(e,t){return u.call(e,t)}function c(e,t){"function"==typeof t&&(t=t(s(e))),("undefined"==typeof Reflect?i:Reflect.ownKeys)(t).forEach((function(n){f(e,n,t[n])}))}var h=Object.defineProperty;function f(e,t,n,r){h(e,t,a(n&&l(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function p(e){return{from:function(t){return e.prototype=Object.create(t.prototype),f(e.prototype,"constructor",e),{extend:c.bind(null,e.prototype)}}}}var d=Object.getOwnPropertyDescriptor,g=[].slice;function y(e,t,n){return g.call(e,t,n)}function m(e,t){return t(e)}function b(e){if(!e)throw new Error("Assertion Failed")}function v(e){r.setImmediate?setImmediate(e):setTimeout(e,0)}function k(e,t){if("string"==typeof t&&l(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=k(e,t[r]);n.push(o)}return n}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return null==s?void 0:k(s,t.substr(a+1))}}function w(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){b("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)w(e,t[r],n[r])}else{var a,s,u=t.indexOf(".");-1!==u?(a=t.substr(0,u),""===(s=t.substr(u+1))?void 0===n?o(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n:w(u=(u=e[a])&&l(e,a)?u:e[a]={},s,n)):void 0===n?o(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function x(e){var t,n={};for(t in e)l(e,t)&&(n[t]=e[t]);return n}var _=[].concat;function S(e){return _.apply([],e)}var E="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(S([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return r[e]})),P=new Set(E.map((function(e){return r[e]}))),A=null;function R(e){return A=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=A.get(t);if(n)return n;if(o(t)){n=[],A.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(P.has(t.constructor))n=t;else{var a,u=s(t);for(a in n=u===Object.prototype?{}:Object.create(u),A.set(t,n),t)l(t,a)&&(n[a]=e(t[a]))}return n}(e),A=null,e}var O={}.toString;function T(e){return O.call(e).slice(8,-1)}var C="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",K="symbol"==typeof C?function(e){var t;return null!=e&&(t=e[C])&&t.apply(e)}:function(){return null};function D(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var $={};function I(e){var t,n,r,i;if(1===arguments.length){if(o(e))return e.slice();if(this===$&&"string"==typeof e)return[e];if(i=K(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"!=typeof(t=e.length))return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var j="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},q=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(se=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"]),B={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function z(e,t){this.name=e,this.message=t}function N(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}function M(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=N(e,t)}function F(e,t){this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=N(e,this.failures)}p(z).from(Error).extend({toString:function(){return this.name+": "+this.message}}),p(M).from(z),p(F).from(z);var L=q.reduce((function(e,t){return e[t]=t+"Error",e}),{}),U=z,Q=q.reduce((function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=B[t]||n,this.inner=null)}return p(r).from(U),e[t]=r,e}),{});Q.Syntax=SyntaxError,Q.Type=TypeError,Q.Range=RangeError;var V=se.reduce((function(e,t){return e[t+"Error"]=Q[t],e}),{}),H=q.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Q[t]),e}),{});function Y(){}function Z(e){return e}function W(e,t){return null==e||e===Z?t:function(n){return t(e(n))}}function X(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function G(e,t){return e===Y?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?X(r,this.onsuccess):r),i&&(this.onerror=this.onerror?X(i,this.onerror):i),void 0!==o?o:n}}function J(e,t){return e===Y?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?X(n,this.onsuccess):n),r&&(this.onerror=this.onerror?X(r,this.onerror):r)}}function ee(e,t){return e===Y?t:function(n){var r=e.apply(this,arguments);a(n,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?X(i,this.onsuccess):i),o&&(this.onerror=this.onerror?X(o,this.onerror):o),void 0===r?void 0===n?void 0:n:a(r,n)}}function te(e,t){return e===Y?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function ne(e,t){return e===Y?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}H.ModifyError=M,H.DexieError=z,H.BulkError=F;var re="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ie(e){re=e}var oe={},ae=100,se=(E="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,s(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,s(t),e]}(),E[0]),ue=(q=E[1],E=E[2],q=q&&q.then,se&&se.constructor),le=!!E,ce=function(e,t){be.push([e,t]),fe&&(queueMicrotask(Re),fe=!1)},he=!0,fe=!0,pe=[],de=[],ge=Z,ye={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Y,pgp:!1,env:{},finalize:Y},me=ye,be=[],ve=0,ke=[];function we(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=me;if("function"!=typeof e){if(e!==oe)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Se(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n((function(n){if(null===t._state){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var r=t._lib&&Oe();n&&"function"==typeof n.then?e(t,(function(e,t){n instanceof we?n._then(e,t):n.then(e,t)})):(t._state=!0,t._value=n,Ee(t)),r&&Te()}}),Se.bind(null,t))}catch(n){Se(t,n)}}(this,e)}var xe={get:function(){var e=me,t=ze;function n(n,r){var i=this,o=!e.global&&(e!==me||t!==ze),a=o&&!Le(),s=new we((function(t,s){Pe(i,new _e(Ze(n,e,o,a),Ze(r,e,o,a),t,s,e))}));return this._consoleTask&&(s._consoleTask=this._consoleTask),s}return n.prototype=oe,n},set:function(e){f(this,"then",e&&e.prototype===oe?xe:{get:function(){return e},set:xe.set})}};function _e(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function Se(e,t){var n,r;de.push(t),null===e._state&&(n=e._lib&&Oe(),t=ge(t),e._state=!1,e._value=t,r=e,pe.some((function(e){return e._value===r._value}))||pe.push(r),Ee(e),n&&Te())}function Ee(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Pe(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===ve&&(++ve,ce((function(){0==--ve&&Ce()}),[]))}function Pe(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++ve,ce(Ae,[n,e,t])}else e._listeners.push(t)}function Ae(e,t,n){try{var r,i=t._value;!t._state&&de.length&&(de=[]),r=re&&t._consoleTask?t._consoleTask.run((function(){return e(i)})):e(i),t._state||-1!==de.indexOf(i)||function(e){for(var t=pe.length;t;)if(pe[--t]._value===e._value)return pe.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--ve&&Ce(),--n.psd.ref||n.psd.finalize()}}function Re(){Ye(ye,(function(){Oe()&&Te()}))}function Oe(){var e=he;return fe=he=!1,e}function Te(){var e,t,n;do{for(;0<be.length;)for(e=be,be=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(0<be.length);fe=he=!0}function Ce(){var e=pe;pe=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=ke.slice(0),n=t.length;n;)t[--n]()}function Ke(e){return new we(oe,!1,e)}function De(e,t){var n=me;return function(){var r=Oe(),i=me;try{return Ve(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{Ve(i,!1),r&&Te()}}}c(we.prototype,{then:xe,_then:function(e,t){Pe(this,new _e(null,null,e,t,me))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=e,n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return(e instanceof t?n:Ke)(e)})):this.then(null,(function(e){return(e&&e.name===t?n:Ke)(e)}))},finally:function(e){return this.then((function(t){return we.resolve(e()).then((function(){return t}))}),(function(t){return we.resolve(e()).then((function(){return Ke(t)}))}))},timeout:function(e,t){var n=this;return e<1/0?new we((function(r,i){var o=setTimeout((function(){return i(new Q.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&f(we.prototype,Symbol.toStringTag,"Dexie.Promise"),ye.env=He(),c(we,{all:function(){var e=I.apply(null,arguments).map(Ue);return new we((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return we.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){return e instanceof we?e:e&&"function"==typeof e.then?new we((function(t,n){e.then(t,n)})):new we(oe,!0,e)},reject:Ke,race:function(){var e=I.apply(null,arguments).map(Ue);return new we((function(t,n){e.map((function(e){return we.resolve(e).then(t,n)}))}))},PSD:{get:function(){return me},set:function(e){return me=e}},totalEchoes:{get:function(){return ze}},newPSD:Me,usePSD:Ye,scheduler:{get:function(){return ce},set:function(e){ce=e}},rejectionMapper:{get:function(){return ge},set:function(e){ge=e}},follow:function(e,t){return new we((function(n,r){return Me((function(t,n){var r=me;r.unhandleds=[],r.onunhandled=n,r.finalize=X((function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},ke.push((function t(){e(),ke.splice(ke.indexOf(t),1)})),++ve,ce((function(){0==--ve&&Ce()}),[])}),r.finalize),e()}),t,n,r)}))}}),ue&&(ue.allSettled&&f(we,"allSettled",(function(){var e=I.apply(null,arguments).map(Ue);return new we((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,i){return we.resolve(e).then((function(e){return r[i]={status:"fulfilled",value:e}}),(function(e){return r[i]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),ue.any&&"undefined"!=typeof AggregateError&&f(we,"any",(function(){var e=I.apply(null,arguments).map(Ue);return new we((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach((function(e,o){return we.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--r||n(new AggregateError(i))}))}))}))})),ue.withResolvers&&(we.withResolvers=ue.withResolvers));var Ie={awaits:0,echoes:0,id:0},je=0,qe=[],Be=0,ze=0,Ne=0;function Me(e,t,n,r){var i=me,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++Ne,ye.env,o.env=le?{Promise:we,PromiseProp:{value:we,configurable:!0,writable:!0},all:we.all,race:we.race,allSettled:we.allSettled,any:we.any,resolve:we.resolve,reject:we.reject}:{},t&&a(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=Ye(o,e,n,r),0===o.ref&&o.finalize(),r}function Fe(){return Ie.id||(Ie.id=++je),++Ie.awaits,Ie.echoes+=ae,Ie.id}function Le(){return!!Ie.awaits&&(0==--Ie.awaits&&(Ie.id=0),Ie.echoes=Ie.awaits*ae,!0)}function Ue(e){return Ie.echoes&&e&&e.constructor===ue?(Fe(),e.then((function(e){return Le(),e}),(function(e){return Le(),Xe(e)}))):e}function Qe(){var e=qe[qe.length-1];qe.pop(),Ve(e,!1)}function Ve(e,t){var n,i=me;(t?!Ie.echoes||Be++&&e===me:!Be||--Be&&e===me)||queueMicrotask(t?function(e){++ze,Ie.echoes&&0!=--Ie.echoes||(Ie.echoes=Ie.awaits=Ie.id=0),qe.push(me),Ve(e,!0)}.bind(null,e):Qe),e!==me&&(me=e,i===ye&&(ye.env=He()),le&&(n=ye.env.Promise,t=e.env,(i.global||e.global)&&(Object.defineProperty(r,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function He(){var e=r.Promise;return le?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(r,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function Ye(e,t,n,r,i){var o=me;try{return Ve(e,!0),t(n,r,i)}finally{Ve(o,!1)}}function Ze(e,t,n,r){return"function"!=typeof e?e:function(){var i=me;n&&Fe(),Ve(t,!0);try{return e.apply(this,arguments)}finally{Ve(i,!1),r&&queueMicrotask(Le)}}}function We(e){Promise===ue&&0===Ie.echoes?0===Be?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+q).indexOf("[native code]")&&(Fe=Le=Y);var Xe=we.reject,Ge=String.fromCharCode(65535),Je="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",et="String expected.",tt=[],nt="__dbnames",rt="readonly",it="readwrite";function ot(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var at={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function st(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=R(t))[e],t}}function ut(){throw Q.Type()}function lt(e,t){try{var n=ct(e),r=ct(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}(ht(e),ht(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var a=lt(e[o],t[o]);if(0!==a)return a}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function ct(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)||"ArrayBuffer"===(e=T(e))?"binary":e}function ht(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var ft=(pt.prototype._trans=function(e,t,n){var r=this._tx||me.trans,i=this.name,o=re&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function a(e,n,r){if(!r.schema[i])throw new Q.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var s=Oe();try{var u=r&&r.db._novip===this.db._novip?r===me.trans?r._promise(e,a,n):Me((function(){return r._promise(e,a,n)}),{trans:r,transless:me.transless||me}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||me.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===L.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then((function(){return e(t,n,r,i)}))):Xe(o)}return o._promise(n,(function(e,t){return Me((function(){return me.trans=o,i(e,t,o)}))})).then((function(e){if("readwrite"===n)try{o.idbtrans.commit()}catch(e){}return"readonly"===n?e:o._completion.then((function(){return e}))}))}if(t._state.openComplete)return Xe(new Q.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Xe(new Q.DatabaseClosed);t.open().catch(Y)}return t._state.dbReadyPromise.then((function(){return e(t,n,r,i)}))}(this.db,e,[this.name],a);return o&&(u._consoleTask=o,u=u.catch((function(e){return console.trace(e),Xe(e)}))),u}finally{s&&Te()}},pt.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?Xe(new Q.Type("Invalid argument to Table.get()")):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)},pt.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(o(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=i(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){if(e.compound&&t.every((function(t){return 0<=e.keyPath.indexOf(t)}))){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1})).sort((function(e,t){return e.keyPath.length-t.keyPath.length}))[0];if(n&&this.db._maxKey!==Ge){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map((function(t){return e[t]})))}!n&&re&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var a=this.schema.idxByName;function s(e,t){return 0===lt(e,t)}var u=t.reduce((function(t,n){var r=t[0],i=t[1],u=(t=a[n],e[n]);return[r||t,r||!t?ot(i,t&&t.multi?function(e){return e=k(e,n),o(e)&&e.some((function(e){return s(u,e)}))}:function(e){return s(u,k(e,n))}):i]}),[null,null]);return r=u[0],u=u[1],r?this.where(r.name).equals(e[r.keyPath]).filter(u):n?this.filter(u):this.where(t).equals("")},pt.prototype.filter=function(e){return this.toCollection().and(e)},pt.prototype.count=function(e){return this.toCollection().count(e)},pt.prototype.offset=function(e){return this.toCollection().offset(e)},pt.prototype.limit=function(e){return this.toCollection().limit(e)},pt.prototype.each=function(e){return this.toCollection().each(e)},pt.prototype.toArray=function(e){return this.toCollection().toArray(e)},pt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},pt.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,o(e)?"[".concat(e.join("+"),"]"):e))},pt.prototype.reverse=function(){return this.toCollection().reverse()},pt.prototype.mapToClass=function(t){var n,r=this.db,i=this.name;function o(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=t).prototype instanceof ut&&(function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,n=t),Object.defineProperty(o.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),o.prototype.table=function(){return i},t=o);for(var a=new Set,u=t.prototype;u;u=s(u))Object.getOwnPropertyNames(u).forEach((function(e){return a.add(e)}));function l(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!a.has(n))try{r[n]=e[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=l,this.hook("reading",l),t},pt.prototype.defineClass=function(){return this.mapToClass((function(e){a(this,e)}))},pt.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=st(o)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?we.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{w(e,o,t)}catch(t){}return t}))},pt.prototype.update=function(e,t){return"object"!=typeof e||o(e)?this.where(":id").equals(e).modify(t):void 0===(e=k(e,this.schema.primKey.keyPath))?Xe(new Q.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},pt.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=st(o)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?we.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{w(e,o,t)}catch(t){}return t}))},pt.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?we.reject(e.failures[0]):void 0}))},pt.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:at})})).then((function(e){return e.numFailures?we.reject(e.failures[0]):void 0}))},pt.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},pt.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=(s=r.schema.primKey).auto;if((s=s.keyPath)&&i)throw new Q.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Q.InvalidArgument("Arguments objects and keys must have the same length");var a=e.length,s=s&&n?e.map(st(s)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:s,wantResults:o}).then((function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new F("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(a," operations failed"),e)}))}))},pt.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=(s=r.schema.primKey).auto;if((s=s.keyPath)&&i)throw new Q.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Q.InvalidArgument("Arguments objects and keys must have the same length");var a=e.length,s=s&&n?e.map(st(s)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:s,wantResults:o}).then((function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new F("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(a," operations failed"),e)}))}))},pt.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map((function(e){return e.key})),i=e.map((function(e){return e.changes})),o=[];return this._trans("readwrite",(function(a){return n.getMany({trans:a,keys:r,cache:"clone"}).then((function(s){var u=[],l=[];e.forEach((function(e,n){var r=e.key,i=e.changes,a=s[n];if(a){for(var c=0,h=Object.keys(i);c<h.length;c++){var f=h[c],p=i[f];if(f===t.schema.primKey.keyPath){if(0!==lt(p,r))throw new Q.Constraint("Cannot update primary key in bulkUpdate()")}else w(a,f,p)}o.push(n),u.push(r),l.push(a)}}));var c=u.length;return n.mutate({trans:a,type:"put",keys:u,values:l,updates:{keys:r,changeSpecs:i}}).then((function(e){var n=e.numFailures,r=e.failures;if(0===n)return c;for(var i=0,a=Object.keys(r);i<a.length;i++){var s,u=a[i],l=o[Number(u)];null!=l&&(s=r[u],delete r[u],r[l]=s)}throw new F("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(c," operations failed"),r)}))}))}))},pt.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,i=e.lastResult;if(e=e.failures,0===r)return i;throw new F("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)}))},pt);function pt(){}function dt(e){function t(t,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=s;for(var r=1,a=arguments.length;r<a;++r)s(arguments[r]);return t;function s(e,r,a){if("object"!=typeof e){var u;r=r||te;var l={subscribers:[],fire:a=a||Y,subscribe:function(e){-1===l.subscribers.indexOf(e)&&(l.subscribers.push(e),l.fire=r(l.fire,e))},unsubscribe:function(e){l.subscribers=l.subscribers.filter((function(t){return t!==e})),l.fire=l.subscribers.reduce(r,a)}};return n[e]=t[e]=l}i(u=e).forEach((function(e){var t=u[e];if(o(t))s(e,u[e][0],u[e][1]);else{if("asap"!==t)throw new Q.InvalidArgument("Invalid event config");var n=s(e,Z,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){v((function(){e.apply(null,t)}))}))}))}}))}}function gt(e,t){return p(t).from({prototype:e}),t}function yt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function mt(e,t){e.filter=ot(e.filter,t)}function bt(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ot(r(),t())}:t,e.justLimit=n&&!r}function vt(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Q.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function kt(e,t,n){var r=vt(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function wt(e,t,n,r){var i=e.replayFilter?ot(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(e,n,r){var a,s;i&&!i(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))||("[object ArrayBuffer]"==(s=""+(a=n.primaryKey))&&(s=""+new Uint8Array(a)),l(o,s)||(o[s]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(a,n),xt(kt(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return xt(kt(e,r,n),ot(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function xt(e,t,n,r){var i=De(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=Y}),(function(t){e.fail(t),n=Y}))||i(e.value,e,(function(e){return n=e})),n()}))}))}var _t=(St.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var r=t.add;if(o(r))return n(n([],o(e)?e:[],!0),r).sort();if("number"==typeof r)return(Number(e)||0)+r;if("bigint"==typeof r)try{return BigInt(e)+r}catch(e){return BigInt(0)+r}throw new TypeError("Invalid term ".concat(r))}if(void 0!==t.remove){var i=t.remove;if(o(i))return o(e)?e.filter((function(e){return!i.includes(e)})).sort():[];if("number"==typeof i)return Number(e)-i;if("bigint"==typeof i)try{return BigInt(e)-i}catch(e){return BigInt(0)-i}throw new TypeError("Invalid subtrahend ".concat(i))}return(r=null===(r=t.replacePrefix)||void 0===r?void 0:r[0])&&"string"==typeof e&&e.startsWith(r)?t.replacePrefix[1]+e.substring(r.length):e},St);function St(e){this["@@propmod"]=e}var Et=(Pt.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Xe.bind(null,n.error)):n.table._trans("readonly",e).then(t)},Pt.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Xe.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},Pt.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},Pt.prototype._iterate=function(e,t){return wt(this._ctx,e,t,this._ctx.table.core)},Pt.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&a(n,e),t._ctx=n,t},Pt.prototype.raw=function(){return this._ctx.valueMapper=null,this},Pt.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return wt(t,e,n,t.table.core)}))},Pt.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(yt(n,!0))return r.count({trans:e,query:{index:vt(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var i=0;return wt(n,(function(){return++i,!1}),e,r).then((function(){return i}))})).then(e)},Pt.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function s(e,t){return lt(o(e,i),o(t,i))*a}return this.toArray((function(e){return e.sort(s)})).then(t)},Pt.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&yt(n,!0)&&0<n.limit){var r=n.valueMapper,i=vt(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then((function(e){return e=e.result,r?e.map(r):e}))}var o=[];return wt(n,(function(e){return o.push(e)}),e,n.table.core).then((function(){return o}))}),e)},Pt.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,yt(t)?bt(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n((function(){e.advance(t),t=0})),!1)}})):bt(t,(function(){var t=e;return function(){return--t<0}}))),this},Pt.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),bt(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}}),!0),this},Pt.prototype.until=function(e,t){return mt(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},Pt.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},Pt.prototype.last=function(e){return this.reverse().first(e)},Pt.prototype.filter=function(e){var t;return mt(this._ctx,(function(t){return e(t.value)})),(t=this._ctx).isMatch=ot(t.isMatch,e),this},Pt.prototype.and=function(e){return this.filter(e)},Pt.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},Pt.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Pt.prototype.desc=function(){return this.reverse()},Pt.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},Pt.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},Pt.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},Pt.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},Pt.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&yt(t,!0)&&0<t.limit)return this._read((function(e){var n=vt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},Pt.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},Pt.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},Pt.prototype.lastKey=function(e){return this.reverse().firstKey(e)},Pt.prototype.distinct=function(){var e;if(!(e=(e=this._ctx).index&&e.table.schema.idxByName[e.index])||!e.multi)return this;var t={};return mt(this._ctx,(function(e){var n=e.primaryKey.toString();return e=l(t,n),t[n]=!0,!e})),this},Pt.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var o,a,s;s="function"==typeof e?e:(o=i(e),a=o.length,function(t){for(var n=!1,r=0;r<a;++r){var i=o[r],s=e[i],u=k(t,i);s instanceof _t?(w(t,i,s.execute(u)),n=!0):u!==s&&(w(t,i,s),n=!0)}return n});var u,l=n.table.core,c=(u=l.schema.primaryKey).outbound,h=u.extractKey,f=200;function p(e,t){var n=t.failures;t=t.numFailures,g+=e-t;for(var r=0,o=i(n);r<o.length;r++){var a=o[r];d.push(n[a])}}(u=t.db._options.modifyChunkSize)&&(f="object"==typeof u?u[l.name]||u["*"]||200:u);var d=[],g=0,y=[];return t.clone().primaryKeys().then((function(t){function i(n){var a=Math.min(f,t.length-n);return l.getMany({trans:r,keys:t.slice(n,n+a),cache:"immutable"}).then((function(u){for(var d=[],g=[],y=c?[]:null,m=[],b=0;b<a;++b){var v=u[b],k={value:R(v),primKey:t[n+b]};!1!==s.call(k,k.value,k)&&(null==k.value?m.push(t[n+b]):c||0===lt(h(v),h(k.value))?(g.push(k.value),c&&y.push(t[n+b])):(m.push(t[n+b]),d.push(k.value)))}return Promise.resolve(0<d.length&&l.mutate({trans:r,type:"add",values:d}).then((function(e){for(var t in e.failures)m.splice(parseInt(t),1);p(d.length,e)}))).then((function(){return(0<g.length||o&&"object"==typeof e)&&l.mutate({trans:r,type:"put",keys:y,values:g,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<n}).then((function(e){return p(g.length,e)}))})).then((function(){return(0<m.length||o&&e===At)&&l.mutate({trans:r,type:"delete",keys:m,criteria:o,isAdditionalChunk:0<n}).then((function(e){return p(m.length,e)}))})).then((function(){return t.length>n+a&&i(n+f)}))}))}var o=yt(n)&&n.limit===1/0&&("function"!=typeof e||e===At)&&{index:n.index,range:n.range};return i(0).then((function(){if(0<d.length)throw new M("Error modifying one or more objects",d,g,y);return t.length}))}))}))},Pt.prototype.delete=function(){var e=this._ctx,t=e.range;return yt(e)&&(e.isPrimKey||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((function(e){var n=e.failures;if(e.lastResult,e.results,e=e.numFailures)throw new M("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-e);return t-e}))}))})):this.modify(At)},Pt);function Pt(){}var At=function(e,t){return t.value=null};function Rt(e,t){return e<t?-1:e===t?0:1}function Ot(e,t){return t<e?-1:e===t?0:1}function Tt(e,t,n){return(e=e instanceof It?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function Ct(e){return new e.Collection(e,(function(){return $t("")})).limit(0)}function Kt(e,t,n,r){var i,o,a,s,u,l,c,h=n.length;if(!n.every((function(e){return"string"==typeof e})))return Tt(e,et);function f(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},a="next"===e?Rt:Ot;var t=n.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));s=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),c="next"===(l=e)?"":r}f("next"),(e=new e.Collection(e,(function(){return Dt(s[0],u[h-1]+r)})))._ondirectionchange=function(e){f(e)};var p=0;return e._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,u,p))return!0;for(var d=null,g=p;g<h;++g){var y=function(e,t,n,r,i,o){for(var a=Math.min(e.length,r.length),s=-1,u=0;u<a;++u){var l=t[u];if(l!==r[u])return i(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):i(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):0<=s?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[u],l)<0&&(s=u)}return a<r.length&&"next"===o?e+n.substr(e.length):a<e.length&&"prev"===o?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}(i,f,s[g],u[g],a,l);null===y&&null===d?p=g+1:(null===d||0<a(d,y))&&(d=y)}return n(null!==d?function(){e.continue(d+c)}:r),!1})),e}function Dt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function $t(e){return{type:1,lower:e,upper:e}}var It=(Object.defineProperty(jt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),jt.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Ct(this):new this.Collection(this,(function(){return Dt(e,t,!n,!r)}))}catch(e){return Tt(this,Je)}},jt.prototype.equals=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return $t(e)}))},jt.prototype.above=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return Dt(e,void 0,!0)}))},jt.prototype.aboveOrEqual=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return Dt(e,void 0,!1)}))},jt.prototype.below=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return Dt(void 0,e,!1,!0)}))},jt.prototype.belowOrEqual=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return Dt(void 0,e)}))},jt.prototype.startsWith=function(e){return"string"!=typeof e?Tt(this,et):this.between(e,e+Ge,!0,!0)},jt.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Kt(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Ge)},jt.prototype.equalsIgnoreCase=function(e){return Kt(this,(function(e,t){return e===t[0]}),[e],"")},jt.prototype.anyOfIgnoreCase=function(){var e=I.apply($,arguments);return 0===e.length?Ct(this):Kt(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},jt.prototype.startsWithAnyOfIgnoreCase=function(){var e=I.apply($,arguments);return 0===e.length?Ct(this):Kt(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Ge)},jt.prototype.anyOf=function(){var e=this,t=I.apply($,arguments),n=this._cmp;try{t.sort(n)}catch(r){return Tt(this,Je)}if(0===t.length)return Ct(this);var r=new this.Collection(this,(function(){return Dt(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm((function(e,r,o){for(var a=e.key;0<n(a,t[i]);)if(++i===t.length)return r(o),!1;return 0===n(a,t[i])||(r((function(){e.continue(t[i])})),!1)})),r},jt.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},jt.prototype.noneOf=function(){var e=I.apply($,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Tt(this,Je)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},jt.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,a=this._min,s=this._max;if(0===e.length)return Ct(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return Tt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Q.InvalidArgument);var u,l=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers,h=i;function f(e,t){return h(e[0],t[0])}try{(u=e.reduce((function(e,t){for(var n=0,i=e.length;n<i;++n){var o=e[n];if(r(t[0],o[1])<0&&0<r(t[1],o[0])){o[0]=a(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return n===i&&e.push(t),e}),[])).sort(f)}catch(e){return Tt(this,Je)}var p=0,d=c?function(e){return 0<i(e,u[p][1])}:function(e){return 0<=i(e,u[p][1])},g=l?function(e){return 0<o(e,u[p][0])}:function(e){return 0<=o(e,u[p][0])},y=d;return(e=new this.Collection(this,(function(){return Dt(u[0][0],u[u.length-1][1],!l,!c)})))._ondirectionchange=function(e){h="next"===e?(y=d,i):(y=g,o),u.sort(f)},e._addAlgorithm((function(e,t,r){for(var o,a=e.key;y(a);)if(++p===u.length)return t(r),!1;return!d(o=a)&&!g(o)||(0===n._cmp(a,u[p][1])||0===n._cmp(a,u[p][0])||t((function(){h===i?e.continue(u[p][0]):e.continue(u[p][1])})),!1)})),e},jt.prototype.startsWithAnyOf=function(){var e=I.apply($,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Ct(this):this.inAnyRange(e.map((function(e){return[e,e+Ge]}))):Tt(this,"startsWithAnyOf() only works with strings")},jt);function jt(){}function qt(e){return De((function(t){return Bt(t),e(t.target.error),!1}))}function Bt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var zt="storagemutated",Nt="x-storagemutated-1",Mt=dt(null,zt),Ft=(Lt.prototype._lock=function(){return b(!me.global),++this._reculock,1!==this._reculock||me.global||(me.lockOwnerFor=this),this},Lt.prototype._unlock=function(){if(b(!me.global),0==--this._reculock)for(me.global||(me.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{Ye(e[1],e[0])}catch(e){}}return this},Lt.prototype._locked=function(){return this._reculock&&me.lockOwnerFor!==this},Lt.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Q.DatabaseClosed(r);case"MissingAPIError":throw new Q.MissingAPI(r.message,r);default:throw new Q.OpenFailed(r)}if(!this.active)throw new Q.TransactionInactive;return b(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=De((function(n){Bt(n),t._reject(e.error)})),e.onabort=De((function(n){Bt(n),t.active&&t._reject(new Q.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=De((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&Mt.storagemutated.fire(e.mutatedParts)})),this},Lt.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Xe(new Q.ReadOnly("Transaction is readonly"));if(!this.active)return Xe(new Q.TransactionInactive);if(this._locked())return new we((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},me])}));if(n)return Me((function(){var e=new we((function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var i=new we((function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return i._lib=!0,i},Lt.prototype._root=function(){return this.parent?this.parent._root():this},Lt.prototype.waitFor=function(e){var t,n=this._root(),r=we.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then((function(){return r})):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}());var i=n._waitingFor;return new we((function(e,t){r.then((function(t){return n._waitingQueue.push(De(e.bind(null,t)))}),(function(e){return n._waitingQueue.push(De(t.bind(null,e)))})).finally((function(){n._waitingFor===i&&(n._waitingFor=null)}))}))},Lt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Q.Abort))},Lt.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(l(t,e))return t[e];var n=this.schema[e];if(!n)throw new Q.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},Lt);function Lt(){}function Ut(e,t,n,r,i,o,a){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!a?"&":"")+(r?"*":"")+(i?"++":"")+Qt(t)}}function Qt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Vt(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce((function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e}),{}))};var r}var Ht=function(e){try{return e.only([[]]),Ht=function(){return[[]]},[[]]}catch(e){return Ht=function(){return Ge},Ge}};function Yt(e){return null==e?function(){}:"string"==typeof e?1===(t=e).split(".").length?function(e){return e[t]}:function(e){return k(e,t)}:function(t){return k(t,e)};var t}function Zt(e){return[].slice.call(e)}var Wt=0;function Xt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function Gt(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen;return e=e.upperOpen,void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}function i(e){var t,n=e.name;return{name:n,schema:e,mutate:function(e){var t=e.trans,i=e.type,o=e.keys,a=e.values,s=e.range;return new Promise((function(e,u){e=De(e);var l=t.objectStore(n),c=null==l.keyPath,h="put"===i||"add"===i;if(!h&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var f,p=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function d(e){++m,Bt(e)}var g=[],y=[],m=0;if("deleteRange"===i){if(4===s.type)return e({numFailures:m,failures:y,results:[],lastResult:void 0});3===s.type?g.push(f=l.clear()):g.push(f=l.delete(r(s)))}else{var b=(c=h?c?[a,o]:[a,null]:[o,null])[0],v=c[1];if(h)for(var k=0;k<p;++k)g.push(f=v&&void 0!==v[k]?l[i](b[k],v[k]):l[i](b[k])),f.onerror=d;else for(k=0;k<p;++k)g.push(f=l[i](b[k])),f.onerror=d}function w(t){t=t.target.result,g.forEach((function(e,t){return null!=e.error&&(y[t]=e.error)})),e({numFailures:m,failures:y,results:"delete"===i?o:g.map((function(e){return e.result})),lastResult:t})}f.onerror=function(e){d(e),w(e)},f.onsuccess=w}))},getMany:function(e){var t=e.trans,r=e.keys;return new Promise((function(e,i){e=De(e);for(var o,a=t.objectStore(n),s=r.length,u=new Array(s),l=0,c=0,h=function(t){t=t.target,u[t._pos]=t.result,++c===l&&e(u)},f=qt(i),p=0;p<s;++p)null!=r[p]&&((o=a.get(r[p]))._pos=p,o.onsuccess=h,o.onerror=f,++l);0===l&&e(u)}))},get:function(e){var t=e.trans,r=e.key;return new Promise((function(e,i){e=De(e);var o=t.objectStore(n).get(r);o.onsuccess=function(t){return e(t.target.result)},o.onerror=qt(i)}))},query:(t=c,function(e){return new Promise((function(i,o){i=De(i);var a,s,u,l=e.trans,c=e.values,h=e.limit,f=e.query,p=h===1/0?void 0:h,d=f.index;if(f=f.range,l=l.objectStore(n),d=d.isPrimaryKey?l:l.index(d.name),f=r(f),0===h)return i({result:[]});t?((p=c?d.getAll(f,p):d.getAllKeys(f,p)).onsuccess=function(e){return i({result:e.target.result})},p.onerror=qt(o)):(a=0,s=!c&&"openKeyCursor"in d?d.openKeyCursor(f):d.openCursor(f),u=[],s.onsuccess=function(e){var t=s.result;return t?(u.push(c?t.value:t.primaryKey),++a===h?i({result:u}):void t.continue()):i({result:u})},s.onerror=qt(o))}))}),openCursor:function(e){var t=e.trans,i=e.values,o=e.query,a=e.reverse,s=e.unique;return new Promise((function(e,u){e=De(e);var l=o.index,c=o.range,h=t.objectStore(n),f=(h=l.isPrimaryKey?h:h.index(l.name),l=a?s?"prevunique":"prev":s?"nextunique":"next",!i&&"openKeyCursor"in h?h.openKeyCursor(r(c),l):h.openCursor(r(c),l));f.onerror=qt(u),f.onsuccess=De((function(n){var r,i,o,a,s=f.result;s?(s.___id=++Wt,s.done=!1,r=s.continue.bind(s),i=(i=s.continuePrimaryKey)&&i.bind(s),o=s.advance.bind(s),a=function(){throw new Error("Cursor not stopped")},s.trans=t,s.stop=s.continue=s.continuePrimaryKey=s.advance=function(){throw new Error("Cursor not started")},s.fail=De(u),s.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},s.start=function(e){function t(){if(f.result)try{e()}catch(e){s.fail(e)}else s.done=!0,s.start=function(){throw new Error("Cursor behind last entry")},s.stop()}var n=new Promise((function(e,t){e=De(e),f.onerror=qt(t),s.fail=t,s.stop=function(t){s.stop=s.continue=s.continuePrimaryKey=s.advance=a,e(t)}}));return f.onsuccess=De((function(e){f.onsuccess=t,t()})),s.continue=r,s.continuePrimaryKey=i,s.advance=o,t(),n},e(s)):e(null)}),u)}))},count:function(e){var t=e.query,i=e.trans,o=t.index,a=t.range;return new Promise((function(e,t){var s=i.objectStore(n),u=o.isPrimaryKey?s:s.index(o.name);(u=(s=r(a))?u.count(s):u.count()).onsuccess=De((function(t){return e(t.target.result)})),u.onerror=qt(t)}))}}}var a,s,u,l=(s=n,u=Zt((a=e).objectStoreNames),{schema:{name:a.name,tables:u.map((function(e){return s.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=o(t),i={};return n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Yt(t)},indexes:Zt(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry;return e=e.keyPath,r={name:t,compound:o(e),keyPath:e,unique:n,multiEntry:r,extractKey:Yt(e)},i[Xt(e)]=r})),getIndexByKeyPath:function(e){return i[Xt(e)]}},i[":id"]=n.primaryKey,null!=t&&(i[Xt(t)]=n.primaryKey),n}))},hasGetAll:0<u.length&&"getAll"in s.objectStore(u[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),c=(n=l.schema,l.hasGetAll),h=(l=n.tables.map(i),{});return l.forEach((function(e){return h[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!h[e])throw new Error("Table '".concat(e,"' not found"));return h[e]},MIN_KEY:-1/0,MAX_KEY:Ht(t),schema:n}}function Jt(e,n,r,i){var o=r.IDBKeyRange;return r.indexedDB,{dbcore:(i=Gt(n,o,i),e.dbcore.reduce((function(e,n){return n=n.create,t(t({},e),n(e))}),i))}}function en(e,t){var n=t.db;t=Jt(e._middlewares,n,e._deps,t),e.core=t.dbcore,e.tables.forEach((function(t){var n=t.name;e.core.schema.tables.some((function(e){return e.name===n}))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function tn(e,t,n,r){n.forEach((function(n){var i=r[n];t.forEach((function(t){var r=function e(t,n){return d(t,n)||(t=s(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?f(t,n,{get:function(){return this.table(n)},set:function(e){h(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function nn(e,t){t.forEach((function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]}))}function rn(e,t){return e._cfg.version-t._cfg.version}function on(e,t,n,r){var o=e._dbSchema;n.objectStoreNames.contains("$meta")&&!o.$meta&&(o.$meta=Vt("$meta",pn("")[0],[]),e._storeNames.push("$meta"));var a=e._createTransaction("readwrite",e._storeNames,o);a.create(n),a._completion.catch(r);var s=a._reject.bind(a),u=me.transless||me;Me((function(){return me.trans=a,me.transless=u,0!==t?(en(e,n),l=t,((r=a).storeNames.includes("$meta")?r.table("$meta").get("version").then((function(e){return null!=e?e:l})):we.resolve(l)).then((function(t){return o=t,s=a,u=n,l=[],t=(r=e)._versions,c=r._dbSchema=hn(0,r.idbdb,u),0!==(t=t.filter((function(e){return e._cfg.version>=o}))).length?(t.forEach((function(e){l.push((function(){var t=c,n=e._cfg.dbschema;fn(r,t,u),fn(r,n,u),c=r._dbSchema=n;var a=sn(t,n);a.add.forEach((function(e){un(u,e[0],e[1].primKey,e[1].indexes)})),a.change.forEach((function(e){if(e.recreate)throw new Q.Upgrade("Not yet support for changing primary key");var t=u.objectStore(e.name);e.add.forEach((function(e){return cn(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),cn(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>o){en(r,u),s._memoizedTables={};var h=x(n);a.del.forEach((function(e){h[e]=t[e]})),nn(r,[r.Transaction.prototype]),tn(r,[r.Transaction.prototype],i(h),h),s.schema=h;var f,p=j(l);return p&&Fe(),a=we.follow((function(){var e;(f=l(s))&&p&&(e=Le.bind(null,null),f.then(e,e))})),f&&"function"==typeof f.then?we.resolve(f):a.then((function(){return f}))}})),l.push((function(t){var n,i,o=e._cfg.dbschema;n=o,i=t,[].slice.call(i.db.objectStoreNames).forEach((function(e){return null==n[e]&&i.db.deleteObjectStore(e)})),nn(r,[r.Transaction.prototype]),tn(r,[r.Transaction.prototype],r._storeNames,r._dbSchema),s.schema=r._dbSchema})),l.push((function(t){r.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(r.idbdb.version/10)===e._cfg.version?(r.idbdb.deleteObjectStore("$meta"),delete r._dbSchema.$meta,r._storeNames=r._storeNames.filter((function(e){return"$meta"!==e}))):t.objectStore("$meta").put(e._cfg.version,"version"))}))})),function e(){return l.length?we.resolve(l.shift()(s.idbtrans)).then(e):we.resolve()}().then((function(){ln(c,u)}))):we.resolve();var r,o,s,u,l,c})).catch(s)):(i(o).forEach((function(e){un(n,e,o[e].primKey,o[e].indexes)})),en(e,n),void we.follow((function(){return e.on.populate.fire(a)})).catch(s));var r,l}))}function an(e,t){ln(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=hn(0,e.idbdb,t);fn(e,e._dbSchema,t);for(var r=0,i=sn(n,e._dbSchema).change;r<i.length;r++){var o=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var n=t.objectStore(e.name);e.add.forEach((function(t){re&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),cn(n,t)}))}(i[r]);if("object"==typeof o)return o.value}}function sn(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var a={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)a.recreate=!0,r.change.push(a);else{var s=i.idxByName,u=o.idxByName,l=void 0;for(l in s)u[l]||a.del.push(l);for(l in u){var c=s[l],h=u[l];c?c.src!==h.src&&a.change.push(h):a.add.push(h)}(0<a.del.length||0<a.add.length||0<a.change.length)&&r.change.push(a)}}else r.add.push([n,o])}return r}function un(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return cn(i,e)})),i}function ln(e,t){i(e).forEach((function(n){t.db.objectStoreNames.contains(n)||(re&&console.debug("Dexie: Creating missing table",n),un(t,n,e[n].primKey,e[n].indexes))}))}function cn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function hn(e,t,n){var r={};return y(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),i=Ut(Qt(s=t.keyPath),s||"",!0,!1,!!t.autoIncrement,s&&"string"!=typeof s,!0),o=[],a=0;a<t.indexNames.length;++a){var s=(u=t.index(t.indexNames[a])).keyPath,u=Ut(u.name,s,!!u.unique,!!u.multiEntry,!1,s&&"string"!=typeof s,!1);o.push(u)}r[e]=Vt(e,i,o)})),r}function fn(e,t,n){for(var i=n.db.objectStoreNames,o=0;o<i.length;++o){var a=i[o],s=n.objectStore(a);e._hasGetAll="getAll"in s;for(var u=0;u<s.indexNames.length;++u){var l=s.indexNames[u],c=s.index(l).keyPath,h="string"==typeof c?c:"["+y(c).join("+")+"]";!t[a]||(c=t[a].idxByName[h])&&(c.name=l,delete t[a].idxByName[h],t[a].idxByName[l]=c)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&r.WorkerGlobalScope&&r instanceof r.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function pn(e){return e.split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Ut(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),o(r),0===t)}))}var dn=(gn.prototype._parseStoresSpec=function(e,t){i(e).forEach((function(n){if(null!==e[n]){var r=pn(e[n]),i=r.shift();if(i.unique=!0,i.multi)throw new Q.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new Q.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Q.Schema("Index must have a name and cannot be an empty string")})),t[n]=Vt(n,i,r)}}))},gn.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?a(this._cfg.storesSource,e):e,e=t._versions;var n={},r={};return e.forEach((function(e){a(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)})),t._dbSchema=r,nn(t,[t._allTables,t,t.Transaction.prototype]),tn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],i(r),r),t._storeNames=i(r),this},gn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=ne(this._cfg.contentUpgrade||Y,e),this},gn);function gn(){}function yn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new tr(nt,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function mn(e){return e&&"function"==typeof e.databases}function bn(e){return Me((function(){return me.letThrough=!0,e()}))}function vn(e){return!("from"in e)}var kn=function(e,t){if(!this){var n=new kn;return e&&"d"in e&&a(n,e),n}a(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function wn(e,t,n){var r=lt(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(vn(e))return a(e,{from:t,to:n,d:1});var i=e.l;if(r=e.r,lt(n,e.from)<0)return i?wn(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},En(e);if(0<lt(t,e.to))return r?wn(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},En(e);lt(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<lt(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,i&&!e.l&&xn(e,i),r&&n&&xn(e,r)}}function xn(e,t){vn(t)||function e(t,n){var r=n.from,i=n.to,o=n.l;n=n.r,wn(t,r,i),o&&e(t,o),n&&e(t,n)}(e,t)}function _n(e,t){var n=Sn(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=Sn(e),a=o.next(i.from),s=a.value;!r.done&&!a.done;){if(lt(s.from,i.to)<=0&&0<=lt(s.to,i.from))return!0;lt(i.from,s.from)<0?i=(r=n.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}function Sn(e){var t=vn(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&lt(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||lt(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function En(e){var n,r,i=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),o=1<i?"r":i<-1?"l":"";o&&(n="r"==o?"l":"r",r=t({},e),i=e[o],e.from=i.from,e.to=i.to,e[o]=i[o],r[o]=i[n],(e[n]=r).d=Pn(r)),e.d=Pn(e)}function Pn(e){var t=e.r;return e=e.l,(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function An(e,t){return i(t).forEach((function(n){e[n]?xn(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)l(t,n)&&(r=t[n],i[n]=!r||"object"!=typeof r||P.has(r.constructor)?r:e(r));return i}(t[n])})),e}function Rn(e,t){return e.all||t.all||Object.keys(e).some((function(n){return t[n]&&_n(t[n],e[n])}))}c(kn.prototype,((q={add:function(e){return xn(this,e),this},addKey:function(e){return wn(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return wn(t,e,e)})),this},hasKey:function(e){var t=Sn(this).next(e).value;return t&&lt(t.from,e)<=0&&0<=lt(t.to,e)}})[C]=function(){return Sn(this)},q));var On={},Tn={},Cn=!1;function Kn(e){An(Tn,e),Cn||(Cn=!0,setTimeout((function(){Cn=!1,Dn(Tn,!(Tn={}))}),0))}function Dn(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(On);r<i.length;r++)$n(a=i[r],e,n,t);else for(var o in e){var a,s=/^idb\:\/\/(.*)\/(.*)\//.exec(o);s&&(o=s[1],s=s[2],(a=On["idb://".concat(o,"/").concat(s)])&&$n(a,e,n,t))}n.forEach((function(e){return e()}))}function $n(e,t,n,r){for(var i=[],o=0,a=Object.entries(e.queries.query);o<a.length;o++){for(var s=a[o],u=s[0],l=[],c=0,h=s[1];c<h.length;c++){var f=h[c];Rn(t,f.obsSet)?f.subscribers.forEach((function(e){return n.add(e)})):r&&l.push(f)}r&&i.push([u,l])}if(r)for(var p=0,d=i;p<d.length;p++){var g=d[p];u=g[0],l=g[1],e.queries.query[u]=l}}function In(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Xe(t.dbOpenError):e}));t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,o=Math.round(10*e.verno),a=!1;function s(){if(t.openCanceller!==r)throw new Q.DatabaseClosed("db.open() was cancelled")}function u(){return new we((function(r,l){if(s(),!n)throw new Q.MissingAPI;var c=e.name,p=t.autoSchema||!o?n.open(c):n.open(c,o);if(!p)throw new Q.MissingAPI;p.onerror=qt(l),p.onblocked=De(e._fireOnBlocked),p.onupgradeneeded=De((function(r){var i;h=p.transaction,t.autoSchema&&!e._options.allowEmptyDB?(p.onerror=Bt,h.abort(),p.result.close(),(i=n.deleteDatabase(c)).onsuccess=i.onerror=De((function(){l(new Q.NoSuchDatabase("Database ".concat(c," doesnt exist")))}))):(h.onerror=qt(l),r=r.oldVersion>Math.pow(2,62)?0:r.oldVersion,f=r<1,e.idbdb=p.result,a&&an(e,h),on(e,r/10,h,l))}),l),p.onsuccess=De((function(){h=null;var n,s,l,d,g,m=e.idbdb=p.result,b=y(m.objectStoreNames);if(0<b.length)try{var v=m.transaction(1===(d=b).length?d[0]:d,"readonly");if(t.autoSchema)s=m,l=v,(n=e).verno=s.version/10,l=n._dbSchema=hn(0,s,l),n._storeNames=y(s.objectStoreNames,0),tn(n,[n._allTables],i(l),l);else if(fn(e,e._dbSchema,v),((g=sn(hn(0,(g=e).idbdb,v),g._dbSchema)).add.length||g.change.some((function(e){return e.add.length||e.change.length})))&&!a)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),m.close(),o=m.version+1,a=!0,r(u());en(e,v)}catch(n){}tt.push(e),m.onversionchange=De((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),m.onclose=De((function(t){e.on("close").fire(t)})),f&&(g=e._deps,v=c,m=g.indexedDB,g=g.IDBKeyRange,mn(m)||v===nt||yn(m,g).put({name:v}).catch(Y)),r()}),l)})).catch((function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),u();break;case"VersionError":if(0<o)return o=0,u()}return we.reject(e)}))}var l,c=t.dbReadyResolve,h=null,f=!1;return we.race([r,("undefined"==typeof navigator?we.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){function t(){return indexedDB.databases().finally(e)}l=setInterval(t,100),t()})).finally((function(){return clearInterval(l)})):Promise.resolve()).then(u)]).then((function(){return s(),t.onReadyBeingFired=[],we.resolve(bn((function(){return e.on.ready.fire(e.vip)}))).then((function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(ne,Y);return t.onReadyBeingFired=[],we.resolve(bn((function(){return r(e.vip)}))).then(n)}}))})).finally((function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)})).catch((function(n){t.dbOpenError=n;try{h&&h.abort()}catch(n){}return r===t.openCanceller&&e._close(),Xe(n)})).finally((function(){t.openComplete=!0,c()})).then((function(){var t;return f&&(t={},e.tables.forEach((function(n){n.schema.indexes.forEach((function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new kn(-1/0,[[[]]]))})),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new kn(-1/0,[[[]]])})),Mt(zt).fire(t),Dn(t,!0)),e}))}function jn(e){function t(t){return e.next(t)}var n=i(t),r=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t);return t=i.value,i.done?t:t&&"function"==typeof t.then?t.then(n,r):o(t)?Promise.all(t).then(n,r):n(t)}}return i(t)()}function qn(e,t,n){for(var r=o(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var Bn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),i=r.schema,o={},a=[];function s(e,n,r){var i=Xt(e),u=o[i]=o[i]||[],l=null==e?0:"string"==typeof e?1:e.length,c=0<n;return c=t(t({},r),{name:c?"".concat(i,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:c,keyTail:n,keyLength:l,extractKey:Yt(e),unique:!c&&r.unique}),u.push(c),c.isPrimaryKey||a.push(c),1<l&&s(2===l?e[0]:e.slice(0,l-1),n+1,r),u.sort((function(e,t){return e.keyTail-t.keyTail})),c}n=s(i.primaryKey.keyPath,0,i.primaryKey),o[":id"]=[n];for(var u=0,l=i.indexes;u<l.length;u++){var c=l[u];s(c.keyPath,0,c)}function h(n){var r,i=n.query.index;return i.isVirtual?t(t({},n),{query:{index:i.lowLevelIndex,range:(r=n.query.range,i=i.keyTail,{type:1===r.type?2:r.type,lower:qn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:qn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},i),{primaryKey:n,indexes:a,getIndexByKeyPath:function(e){return(e=o[Xt(e)])&&e[0]}}),count:function(e){return r.count(h(e))},query:function(e){return r.query(h(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,a=n.keyLength;return o?r.openCursor(h(t)).then((function(e){return e&&s(e)})):r.openCursor(t);function s(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(qn(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,a).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(qn(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return n.value}}})}}})}})}};function zn(e,t,n,r){return n=n||{},r=r||"",i(e).forEach((function(i){var o,a,s;l(t,i)?(o=e[i],a=t[i],"object"==typeof o&&"object"==typeof a&&o&&a?(s=T(o))!==T(a)?n[r+i]=t[i]:"Object"===s?zn(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i]):o!==a&&(n[r+i]=t[i])):n[r+i]=void 0})),i(t).forEach((function(i){l(e,i)||(n[r+i]=t[i])})),n}function Nn(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var Mn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return t(t({},e),{table:function(r){var i=e.table(r),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var a=me.trans,s=a.table(r).hook,u=s.deleting,c=s.creating,h=s.updating;switch(e.type){case"add":if(c.fire===Y)break;return a._promise("readwrite",(function(){return f(e)}),!0);case"put":if(c.fire===Y&&h.fire===Y)break;return a._promise("readwrite",(function(){return f(e)}),!0);case"delete":if(u.fire===Y)break;return a._promise("readwrite",(function(){return f(e)}),!0);case"deleteRange":if(u.fire===Y)break;return a._promise("readwrite",(function(){return function e(n,r,a){return i.query({trans:n,values:!1,query:{index:o,range:r},limit:a}).then((function(i){var o=i.result;return f({type:"delete",keys:o,trans:n}).then((function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):o.length<a?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:o[o.length-1],lowerOpen:!0}),a)}))}))}(e.trans,e.range,1e4)}),!0)}return i.mutate(e);function f(e){var r,a,s,f=me.trans,p=e.keys||Nn(o,e);if(!p)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?t(t({},e),{keys:p}):t({},e)).type&&(e.values=n([],e.values)),e.keys&&(e.keys=n([],e.keys)),r=i,s=p,("add"===(a=e).type?Promise.resolve([]):r.getMany({trans:a.trans,keys:s,cache:"immutable"})).then((function(t){var n=p.map((function(n,r){var i,a,s,p=t[r],d={onerror:null,onsuccess:null};return"delete"===e.type?u.fire.call(d,n,p,f):"add"===e.type||void 0===p?(i=c.fire.call(d,n,e.values[r],f),null==n&&null!=i&&(e.keys[r]=n=i,o.outbound||w(e.values[r],o.keyPath,n))):(i=zn(p,e.values[r]),(a=h.fire.call(d,i,n,p,f))&&(s=e.values[r],Object.keys(a).forEach((function(e){l(s,e)?s[e]=a[e]:w(s,e,a[e])})))),d}));return i.mutate(e).then((function(r){for(var i=r.failures,o=r.results,a=r.numFailures,s=(r=r.lastResult,0);s<p.length;++s){var u=(o||p)[s],l=n[s];null==u?l.onerror&&l.onerror(i[s]):l.onsuccess&&l.onsuccess("put"===e.type&&t[s]?e.values[s]:u)}return{failures:i,results:o,numFailures:a,lastResult:r}})).catch((function(e){return n.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}}})}})}};function Fn(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===lt(t.keys[i],e[o])&&(r.push(n?R(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}var Ln={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=Fn(e.keys,e.trans._cache,"clone"===e.cache);return t?we.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?R(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function Un(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function Qn(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Vn={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,r=new kn(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(me.subscr&&"readonly"!==n)throw new Q.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(me.querier));return e.transaction(t,n,r)},table:function(a){var s=e.table(a),u=s.schema,l=u.primaryKey,c=u.indexes,h=l.extractKey,f=l.outbound,p=l.autoIncrement&&c.filter((function(e){return e.compound&&e.keyPath.includes(l.keyPath)})),d=t(t({},s),{mutate:function(t){function i(e){return e="idb://".concat(n,"/").concat(a,"/").concat(e),g[e]||(g[e]=new kn)}var c,h,f,d=t.trans,g=t.mutatedParts||(t.mutatedParts={}),y=i(""),m=i(":dels"),b=t.type,v="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[Nn(l,t).filter((function(e){return e})),t.values]:[],k=v[0],w=v[1];return v=t.trans._cache,o(k)?(y.addKeys(k),(v="delete"===b||k.length===w.length?Fn(k,v):null)||m.addKeys(k),(v||w)&&(c=i,h=v,f=w,u.indexes.forEach((function(e){var t=c(e.name||"");function n(t){return null!=t?e.extractKey(t):null}function r(n){return e.multiEntry&&o(n)?n.forEach((function(e){return t.addKey(e)})):t.addKey(n)}(h||f).forEach((function(e,t){var i=h&&n(h[t]);0!==lt(i,t=f&&n(f[t]))&&(null!=i&&r(i),null!=t&&r(t))}))})))):k?(w={from:null!==(w=k.lower)&&void 0!==w?w:e.MIN_KEY,to:null!==(w=k.upper)&&void 0!==w?w:e.MAX_KEY},m.add(w),y.add(w)):(y.add(r),m.add(r),u.indexes.forEach((function(e){return i(e.name).add(r)}))),s.mutate(t).then((function(e){return!k||"add"!==t.type&&"put"!==t.type||(y.addKeys(e.results),p&&p.forEach((function(n){for(var r=t.values.map((function(e){return n.extractKey(e)})),o=n.keyPath.findIndex((function(e){return e===l.keyPath})),a=0,s=e.results.length;a<s;++a)r[a][o]=e.results[a];i(n.name).addKeys(r)}))),d.mutatedParts=An(d.mutatedParts||{},g),e}))}}),g=(c=function(t){t=(n=t.query).index;var n=n.range;return[t,new kn(null!==(t=n.lower)&&void 0!==t?t:e.MIN_KEY,null!==(n=n.upper)&&void 0!==n?n:e.MAX_KEY)]},{get:function(e){return[l,new kn(e.key)]},getMany:function(e){return[l,(new kn).addKeys(e.keys)]},count:c,query:c,openCursor:c});return i(g).forEach((function(e){d[e]=function(i){var o=!!(d=me.subscr),u=Un(me,s)&&Qn(e,i)?i.obsSet={}:d;if(o){var l=function(e){return e="idb://".concat(n,"/").concat(a,"/").concat(e),u[e]||(u[e]=new kn)},c=l(""),p=l(":dels"),d=(o=(d=g[e](i))[0],d[1]);if(("query"===e&&o.isPrimaryKey&&!i.values?p:l(o.name||"")).add(d),!o.isPrimaryKey){if("count"!==e){var y="query"===e&&f&&i.values&&s.query(t(t({},i),{values:!1}));return s[e].apply(this,arguments).then((function(t){if("query"===e){if(f&&i.values)return y.then((function(e){return e=e.result,c.addKeys(e),t}));var n=i.values?t.result.map(h):t.result;(i.values?c:p).addKeys(n)}else if("openCursor"===e){var r=t,o=i.values;return r&&Object.create(r,{key:{get:function(){return p.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return p.addKey(e),e}},value:{get:function(){return o&&c.addKey(r.primaryKey),r.value}}})}return t}))}p.add(r)}}return s[e].apply(this,arguments)}})),d}})}};function Hn(e,n,r){if(0===r.numFailures)return n;if("deleteRange"===n.type)return null;var i=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return r.numFailures===i?null:(n=t({},n),o(n.keys)&&(n.keys=n.keys.filter((function(e,t){return!(t in r.failures)}))),"values"in n&&o(n.values)&&(n.values=n.values.filter((function(e,t){return!(t in r.failures)}))),n)}function Yn(e,t){return n=e,(void 0===(r=t).lower||(r.lowerOpen?0<lt(n,r.lower):0<=lt(n,r.lower)))&&(void 0===t.upper||(t.upperOpen?lt(e,t.upper)<0:lt(e,t.upper)<=0));var n,r}function Zn(e,t,n,r,i,a){if(!n||0===n.length)return e;var s=t.query.index,u=s.multiEntry,l=t.query.range,c=r.schema.primaryKey.extractKey,h=s.extractKey,f=(s.lowLevelIndex||s).extractKey;return n=n.reduce((function(e,n){var r=e,i=[];if("add"===n.type||"put"===n.type)for(var a=new kn,s=n.values.length-1;0<=s;--s){var f,p=n.values[s],d=c(p);a.hasKey(d)||(f=h(p),(u&&o(f)?f.some((function(e){return Yn(e,l)})):Yn(f,l))&&(a.addKey(d),i.push(p)))}switch(n.type){case"add":var g=(new kn).addKeys(t.values?e.map((function(e){return c(e)})):e);r=e.concat(t.values?i.filter((function(e){return e=c(e),!g.hasKey(e)&&(g.addKey(e),!0)})):i.map((function(e){return c(e)})).filter((function(e){return!g.hasKey(e)&&(g.addKey(e),!0)})));break;case"put":var y=(new kn).addKeys(n.values.map((function(e){return c(e)})));r=e.filter((function(e){return!y.hasKey(t.values?c(e):e)})).concat(t.values?i:i.map((function(e){return c(e)})));break;case"delete":var m=(new kn).addKeys(n.keys);r=e.filter((function(e){return!m.hasKey(t.values?c(e):e)}));break;case"deleteRange":var b=n.range;r=e.filter((function(e){return!Yn(c(e),b)}))}return r}),e),n===e?e:(n.sort((function(e,t){return lt(f(e),f(t))||lt(c(e),c(t))})),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(i.dirty=!0)),a?Object.freeze(n):n)}function Wn(e,t){return 0===lt(e.lower,t.lower)&&0===lt(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function Xn(e,t){return function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=lt(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return-1}return t}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return-1;if(0===(t=lt(e,t))){if(n&&r)return 0;if(n)return-1;if(r)return 1}return t}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function Gn(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",(function(){var r,i;e.subscribers.delete(n),0===e.subscribers.size&&(r=e,i=t,setTimeout((function(){0===r.subscribers.size&&D(i,r)}),3e3))}))}var Jn={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,i){var o,a,s=e.transaction(t,r,i);return"readwrite"===r&&(a=(o=new AbortController).signal,i=function(i){return function(){if(o.abort(),"readwrite"===r){for(var a=new Set,u=0,l=t;u<l.length;u++){var c=l[u],h=On["idb://".concat(n,"/").concat(c)];if(h){var f=e.table(c),p=h.optimisticOps.filter((function(e){return e.trans===s}));if(s._explicit&&i&&s.mutatedParts)for(var d=0,g=Object.values(h.queries.query);d<g.length;d++)for(var y=0,m=(k=g[d]).slice();y<m.length;y++)Rn((w=m[y]).obsSet,s.mutatedParts)&&(D(k,w),w.subscribers.forEach((function(e){return a.add(e)})));else if(0<p.length){h.optimisticOps=h.optimisticOps.filter((function(e){return e.trans!==s}));for(var b=0,v=Object.values(h.queries.query);b<v.length;b++)for(var k,w,x,_=0,S=(k=v[b]).slice();_<S.length;_++)null!=(w=S[_]).res&&s.mutatedParts&&(i&&!w.dirty?(x=Object.isFrozen(w.res),x=Zn(w.res,w.req,p,f,w,x),w.dirty?(D(k,w),w.subscribers.forEach((function(e){return a.add(e)}))):x!==w.res&&(w.res=x,w.promise=we.resolve({result:x}))):(w.dirty&&D(k,w),w.subscribers.forEach((function(e){return a.add(e)}))))}}}a.forEach((function(e){return e()}))}}},s.addEventListener("abort",i(!1),{signal:a}),s.addEventListener("error",i(!1),{signal:a}),s.addEventListener("complete",i(!0),{signal:a})),s},table:function(r){var i=e.table(r),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var a=me.trans;if(o.outbound||"disabled"===a.db._options.cache||a.explicit||"readwrite"!==a.idbtrans.mode)return i.mutate(e);var s=On["idb://".concat(n,"/").concat(r)];return s?(a=i.mutate(e),"add"!==e.type&&"put"!==e.type||!(50<=e.values.length||Nn(o,e).some((function(e){return null==e})))?(s.optimisticOps.push(e),e.mutatedParts&&Kn(e.mutatedParts),a.then((function(t){0<t.numFailures&&(D(s.optimisticOps,e),(t=Hn(0,e,t))&&s.optimisticOps.push(t),e.mutatedParts&&Kn(e.mutatedParts))})),a.catch((function(){D(s.optimisticOps,e),e.mutatedParts&&Kn(e.mutatedParts)}))):a.then((function(n){var r=Hn(0,t(t({},e),{values:e.values.map((function(e,r){var i;return n.failures[r]||w(e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?R(e):t({},e),o.keyPath,n.results[r]),e}))}),n);s.optimisticOps.push(r),queueMicrotask((function(){return e.mutatedParts&&Kn(e.mutatedParts)}))})),a):i.mutate(e)},query:function(e){if(!Un(me,i)||!Qn("query",e))return i.query(e);var t="immutable"===(null===(s=me.trans)||void 0===s?void 0:s.db._options.cache),o=(l=me).requery,a=l.signal,s=function(e,t,n,r){var i=On["idb://".concat(e,"/").concat(t)];if(!i)return[];if(!(t=i.queries[n]))return[null,!1,i,null];var o=t[(r.query?r.query.index.name:null)||""];if(!o)return[null,!1,i,null];switch(n){case"query":var a=o.find((function(e){return e.req.limit===r.limit&&e.req.values===r.values&&Wn(e.req.query.range,r.query.range)}));return a?[a,!0,i,o]:[o.find((function(e){return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&Xn(e.req.query.range,r.query.range)})),!1,i,o];case"count":return a=o.find((function(e){return Wn(e.req.query.range,r.query.range)})),[a,!!a,i,o]}}(n,r,"query",e),u=s[0],l=s[1],c=s[2],h=s[3];return u&&l?u.obsSet=e.obsSet:(l=i.query(e).then((function(e){var n=e.result;if(u&&(u.res=n),t){for(var r=0,i=n.length;r<i;++r)Object.freeze(n[r]);Object.freeze(n)}else e.result=R(n);return e})).catch((function(e){return h&&u&&D(h,u),Promise.reject(e)})),u={obsSet:e.obsSet,promise:l,subscribers:new Set,type:"query",req:e,dirty:!1},h?h.push(u):(h=[u],(c=c||(On["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=h)),Gn(u,h,o,a),u.promise.then((function(n){return{result:Zn(n.result,e,null==c?void 0:c.optimisticOps,i,u,t)}}))}})}})}};function er(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var tr=(nr.prototype.version=function(e){if(isNaN(e)||e<.1)throw new Q.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Q.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(rn),n.stores({}),this._state.autoSchema=!1,n)},nr.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||me.letThrough||this._vip)?e():new we((function(e,n){if(t._state.openComplete)return n(new Q.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new Q.DatabaseClosed);t.open().catch(Y)}t._state.dbReadyPromise.then(e,n)})).then(e)},nr.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:t,name:i}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:i}),e.sort((function(e,t){return e.level-t.level})),this},nr.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this},nr.prototype.open=function(){var e=this;return Ye(ye,(function(){return In(e)}))},nr.prototype._close=function(){var e=this._state,t=tt.indexOf(this);if(0<=t&&tt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new we((function(t){e.dbReadyResolve=t})),e.openCanceller=new we((function(t,n){e.cancelOpen=n})))},nr.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen;e=this._state,t?(e.isBeingOpened&&e.cancelOpen(new Q.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new Q.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},nr.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new we((function(i,o){function a(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=De((function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,mn(r)||n===nt||yn(r,e).delete(n).catch(Y),i()})),n.onerror=qt(o),n.onblocked=t._fireOnBlocked}if(n)throw new Q.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(a):a()}))},nr.prototype.backendDB=function(){return this.idbdb},nr.prototype.isOpen=function(){return null!==this.idbdb},nr.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},nr.prototype.hasFailed=function(){return null!==this._state.dbOpenError},nr.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(nr.prototype,"tables",{get:function(){var e=this;return i(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!1,configurable:!0}),nr.prototype.transaction=function(){var e=function(e,t,n){var r=arguments.length;if(r<2)throw new Q.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,S(i),n]}.apply(this,arguments);return this._transaction.apply(this,e)},nr.prototype._transaction=function(e,t,n){var r=this,i=me.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,a,s=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){if("string"!=typeof(e=e instanceof r.Table?e.name:e))throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e})),"r"==e||e===rt)o=rt;else{if("rw"!=e&&e!=it)throw new Q.InvalidArgument("Invalid transaction mode: "+e);o=it}if(i){if(i.mode===rt&&o===it){if(!s)throw new Q.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&a.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!s)throw new Q.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),s&&i&&!i.active&&(i=null)}}catch(n){return i?i._promise(null,(function(e,t){t(n)})):Xe(n)}var u=function e(t,n,r,i,o){return we.resolve().then((function(){var a=me.transless||me,s=t._createTransaction(n,r,t._dbSchema,i);if(s.explicit=!0,a={trans:s,transless:a},i)s.idbtrans=i.idbtrans;else try{s.create(),s.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(a){return a.name===L.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then((function(){return e(t,n,r,null,o)}))):Xe(a)}var u,l=j(o);return l&&Fe(),a=we.follow((function(){var e;(u=o.call(s,s))&&(l?(e=Le.bind(null,null),u.then(e,e)):"function"==typeof u.next&&"function"==typeof u.throw&&(u=jn(u)))}),a),(u&&"function"==typeof u.then?we.resolve(u).then((function(e){return s.active?e:Xe(new Q.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):a.then((function(){return u}))).then((function(e){return i&&s._resolve(),s._completion.then((function(){return e}))})).catch((function(e){return s._reject(e),Xe(e)}))}))}.bind(null,this,o,a,i,n);return i?i._promise(o,u,"lock"):me.trans?Ye(me.transless,(function(){return r._whenReady(u)})):this._whenReady(u)},nr.prototype.table=function(e){if(!l(this._allTables,e))throw new Q.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},nr);function nr(e,n){var r=this;this._middlewares={},this.verno=0;var i=nr.dependencies;this._options=n=t({addons:nr.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},i=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,a,s,u,l,c={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Y,dbReadyPromise:null,cancelOpen:Y,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};c.dbReadyPromise=new we((function(e){c.dbReadyResolve=e})),c.openCanceller=new we((function(e,t){c.cancelOpen=t})),this._state=c,this.name=e,this.on=dt(this,"populate","blocked","versionchange","close",{ready:[ne,Y]}),this.on.ready.subscribe=m(this.on.ready.subscribe,(function(e){return function(t,n){nr.vip((function(){var i,o=r._state;o.openComplete?(o.dbOpenError||we.resolve().then(t),n&&e(t)):o.onReadyBeingFired?(o.onReadyBeingFired.push(t),n&&e(t)):(e(t),i=r,n||e((function e(){i.on.ready.unsubscribe(t),i.on.ready.unsubscribe(e)})))}))}})),this.Collection=(o=this,gt(Et.prototype,(function(e,t){this.db=o;var n=at,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx;e=(t=i.table).hook.reading.fire,this._ctx={table:t,index:i.index,isPrimKey:!i.index||t.schema.primKey.keyPath&&i.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:e!==Z?e:null}}))),this.Table=(a=this,gt(ft.prototype,(function(e,t,n){this.db=a,this._tx=n,this.name=e,this.schema=t,this.hook=a._allTables[e]?a._allTables[e].hook:dt(null,{creating:[G,Y],reading:[W,Z],updating:[ee,Y],deleting:[J,Y]})}))),this.Transaction=(s=this,gt(Ft.prototype,(function(e,t,n,r,i){var o=this;this.db=s,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=dt(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new we((function(e,t){o._resolve=e,o._reject=t})),this._completion.then((function(){o.active=!1,o.on.complete.fire()}),(function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),Xe(e)}))}))),this.Version=(u=this,gt(dn.prototype,(function(e){this.db=u,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))),this.WhereClause=(l=this,gt(It.prototype,(function(e,t,n){if(this.db=l,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=lt,this._descending=function(e,t){return lt(t,e)},this._max=function(e,t){return 0<lt(e,t)?e:t},this._min=function(e,t){return lt(e,t)<0?e:t},this._IDBKeyRange=l._deps.IDBKeyRange,!this._IDBKeyRange)throw new Q.MissingAPI}))),this.on("versionchange",(function(e){0<e.newVersion?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close({disableAutoOpen:!1})})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=Ht(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),tt.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Ln),this.use(Jn),this.use(Vn),this.use(Bn),this.use(Mn);var h=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;if("table"===t)return function(e){return er(r.table(e),h)};var i=Reflect.get(e,t,n);return i instanceof ft?er(i,h):"tables"===t?i.map((function(e){return er(e,h)})):"_createTransaction"===t?function(){return er(i.apply(this,arguments),h)}:i}});this.vip=h,i.forEach((function(e){return e(r)}))}q="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";var rr,ir=(or.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},or.prototype[q]=function(){return this},or);function or(e){this._subscribe=e}try{rr={indexedDB:r.indexedDB||r.mozIndexedDB||r.webkitIndexedDB||r.msIndexedDB,IDBKeyRange:r.IDBKeyRange||r.webkitIDBKeyRange}}catch(E){rr={indexedDB:null,IDBKeyRange:null}}function ar(e){var t,n=!1,r=new ir((function(r){var i,o=j(e),a=!1,s={},u={},c={get closed(){return a},unsubscribe:function(){a||(a=!0,i&&i.abort(),h&&Mt.storagemutated.unsubscribe(p))}};r.start&&r.start(c);var h=!1,f=function(){return We(d)},p=function(e){An(s,e),Rn(u,s)&&f()},d=function(){var c,d,g;!a&&rr.indexedDB&&(s={},c={},i&&i.abort(),i=new AbortController,g=function(t){var n=Oe();try{o&&Fe();var r=Me(e,t);return r=o?r.finally(Le):r}finally{n&&Te()}}(d={subscr:c,signal:i.signal,requery:f,querier:e,trans:null}),Promise.resolve(g).then((function(e){n=!0,t=e,a||d.signal.aborted||(s={},function(e){for(var t in e)if(l(e,t))return;return 1}(u=c)||h||(Mt(zt,p),h=!0),We((function(){return!a&&r.next&&r.next(e)})))}),(function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||a||We((function(){a||r.error&&r.error(e)}))})))};return setTimeout(f,0),c}));return r.hasValue=function(){return n},r.getValue=function(){return t},r}var sr=tr;function ur(e){var t=cr;try{cr=!0,Mt.storagemutated.fire(e),Dn(e,!0)}finally{cr=t}}c(sr,t(t({},H),{delete:function(e){return new sr(e,{addons:[]}).delete()},exists:function(e){return new sr(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return n=(t=sr.dependencies).indexedDB,t=t.IDBKeyRange,(mn(n)?Promise.resolve(n.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==nt}))})):yn(n,t).toCollection().primaryKeys()).then(e)}catch(e){return Xe(new Q.MissingAPI)}var t,n},defineClass:function(){return function(e){a(this,e)}},ignoreTransaction:function(e){return me.trans?Ye(me.transless,e):e()},vip:bn,async:function(e){return function(){try{var t=jn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:we.resolve(t)}catch(t){return Xe(t)}}},spawn:function(e,t,n){try{var r=jn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:we.resolve(r)}catch(e){return Xe(e)}},currentTransaction:{get:function(){return me.trans||null}},waitFor:function(e,t){return t=we.resolve("function"==typeof e?sr.ignoreTransaction(e):e).timeout(t||6e4),me.trans?me.trans.waitFor(t):t},Promise:we,debug:{get:function(){return re},set:function(e){ie(e)}},derive:p,extend:a,props:c,override:m,Events:dt,on:Mt,liveQuery:ar,extendObservabilitySet:An,getByKeyPath:k,setByKeyPath:w,delByKeyPath:function(e,t){"string"==typeof t?w(e,t,void 0):"length"in t&&[].map.call(t,(function(t){w(e,t,void 0)}))},shallowClone:x,deepClone:R,getObjectDiff:zn,cmp:lt,asap:v,minKey:-1/0,addons:[],connections:tt,errnames:L,dependencies:rr,cache:On,semVer:"4.0.11",version:"4.0.11".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),sr.maxKey=Ht(sr.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Mt(zt,(function(e){cr||(e=new CustomEvent(Nt,{detail:e}),cr=!0,dispatchEvent(e),cr=!1)})),addEventListener(Nt,(function(e){e=e.detail,cr||ur(e)})));var lr,cr=!1,hr=function(){};return"undefined"!=typeof BroadcastChannel&&((hr=function(){(lr=new BroadcastChannel(Nt)).onmessage=function(e){return e.data&&ur(e.data)}})(),"function"==typeof lr.unref&&lr.unref(),Mt(zt,(function(e){cr||lr.postMessage(e)}))),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",(function(e){if(!tr.disableBfCache&&e.persisted){re&&console.debug("Dexie: handling persisted pagehide"),null!=lr&&lr.close();for(var t=0,n=tt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}})),addEventListener("pageshow",(function(e){!tr.disableBfCache&&e.persisted&&(re&&console.debug("Dexie: handling persisted pageshow"),hr(),ur({all:new kn(-1/0,[[]])}))}))),we.rejectionMapper=function(e,t){return!e||e instanceof z||e instanceof TypeError||e instanceof SyntaxError||!e.name||!V[e.name]?e:(t=new V[e.name](t||e.message,e),"stack"in e&&f(t,"stack",{get:function(){return this.inner.stack}}),t)},ie(re),t(tr,Object.freeze({__proto__:null,Dexie:tr,liveQuery:ar,Entity:ut,cmp:lt,PropModification:_t,replacePrefix:function(e,t){return new _t({replacePrefix:[e,t]})},add:function(e){return new _t({add:e})},remove:function(e){return new _t({remove:e})},default:tr,RangeSet:kn,mergeRanges:xn,rangesOverlap:_n}),{default:tr}),tr}()),qe.exports),ze=Ie(Be);const Ne=Symbol.for("Dexie"),Me=globalThis[Ne]||(globalThis[Ne]=ze);if(ze.semVer!==Me.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ze.semVer} and ${Me.semVer}`);const{liveQuery:Fe,mergeRanges:Le,rangesOverlap:Ue,RangeSet:Qe,cmp:Ve,Entity:He,PropModification:Ye,replacePrefix:Ze,add:We,remove:Xe}=Me;let Ge=[];const Je=new Me("docsify");async function et(e,t=!1){if(t){const t=await Je.expires.get(e);return t?t.value:0}const n=await Je.search.where({indexKey:e}).toArray();return n||null}Je.version(1).stores({search:"slug, title, body, path, indexKey",expires:"key, value"});const tt={EXPIRE_KEY:"docsify.search.expires",INDEX_KEY:"docsify.search.index"};function nt(e){return e.text||"table"!==e.type||(e.rows.unshift(e.header),e.text=e.rows.map((e=>e.map((e=>e.text)).join(" | "))).join(" |\n ")),e.text}function rt(e){return e.text||"list"!==e.type||(e.text=e.raw),e.text}function it(t="",n,s){const u=window.marked.lexer(t),l=[],c=t=>{if(!t||"link"!==t.type&&"image"!==t.type)return;const{config:u}=e(t.title||"");if(!u.include||!t.href)return;const c=r(t.href)?t.href:function(...e){return o(e.map(a).join("/"))}(s.router.getBasePath(),i(n),t.href);let h="code";/\.(md|markdown)/.test(c)?h="markdown":/\.mmd/.test(c)&&(h="mermaid"),l.push({url:c,type:h,fragment:u.fragment,omitFragmentLine:u.omitFragmentLine})};return u.forEach((e=>{"paragraph"===e.type?(e.tokens||[]).forEach(c):"table"===e.type&&((e.header||[]).forEach((e=>{(e.tokens||[]).forEach(c)})),(e.rows||[]).forEach((e=>{e.forEach((e=>{(e.tokens||[]).forEach(c)}))})))})),l}async function ot(e="",t,n){const r=it(e,t,n);if(!r.length)return"";return(await Promise.all(r.map((e=>new Promise((t=>{Docsify.get(e.url,!1,n.config.requestHeaders).then((n=>{let r=n||"";e.fragment&&(r=function(e,t,n){if(!t)return e;let r=`(?:###|\\/\\/\\/)\\s*\\[${t}\\]`;n&&(r=`.*${r}.*\n`);const i=new RegExp(`(?:${r})([\\s\\S]*?)(?:${r})`);return((e.match(i)||[])[1]||"").trim()}(r,e.fragment,e.omitFragmentLine)),t("markdown"===e.type?r:De(r))}),(()=>t("")))})))))).filter(Boolean).join("\n")}function at(e){return e&&e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}async function st(t,n){const r="auto"===t.paths,i=r?function(e){const t=[];return Docsify.dom.findAll(".sidebar-nav a:not(.section-link):not([data-nosearch])").forEach((n=>{const r=n.href,i=n.getAttribute("href"),o=e.parse(r).path;o&&-1===t.indexOf(o)&&!Docsify.util.isAbsolutePath(i)&&t.push(o)})),t}(n.router):t.paths;let o="";if(i.length&&r&&t.pathNamespaces){const e=i[0];if(Array.isArray(t.pathNamespaces))o=t.pathNamespaces.filter((t=>e.slice(0,t.length)===t))[0]||o;else if(t.pathNamespaces instanceof RegExp){const n=e.match(t.pathNamespaces);n&&(o=n[0])}const n=-1===i.indexOf(o+"/"),r=-1===i.indexOf(o+"/README");n&&r&&i.unshift(o+"/")}else-1===i.indexOf("/")&&-1===i.indexOf("/README")&&i.unshift("/");const a=((s=t.namespace)?`${tt.EXPIRE_KEY}/${s}`:tt.EXPIRE_KEY)+o;var s;const u=function(e){return e?`${tt.INDEX_KEY}/${e}`:tt.INDEX_KEY}(t.namespace)+o,l=await et(a,!0)<Date.now();if(Ge=await et(u),l)Ge=[];else if(!r)return;const c=i.length;let h=0;const f=async()=>{c===++h&&await async function(e,t,n){const r=[];Object.values(Ge).forEach((e=>{e&&"object"==typeof e&&("slug"in e?r.push(e):Object.values(e).forEach((e=>{e&&"object"==typeof e&&"slug"in e&&r.push(e)})))})),Ge=r;const i=Je.table("search"),o=Je.table("expires");await Je.transaction("rw",i,o,(async()=>{await i.where({indexKey:n}).delete(),await i.bulkPut(r),await o.put({key:t,value:Date.now()+e})}))}(t.maxAge,a,u)};i.forEach((r=>{!!Array.isArray(Ge)&&Ge.some((e=>e.path===r))?f():Docsify.get(n.router.getFile(r),!1,n.config.requestHeaders).then((async i=>{const o=await ot(i,r,n),a=o?`${i}\n${o}`:i;return Ge[r]=function(t,n="",r,i,o){const a=window.marked.lexer(n),s=window.Docsify.slugify,u={};let l,c="",h="";return a.forEach(((n,a)=>{if("heading"===n.type&&n.depth<=i){const{str:i,config:a}=e(n.text);l=r.toURL(t,{id:s(a.id||n.text)}),i&&(c=function(e=""){let t,n;return/<!-- {docsify-ignore} -->/g.test(e)&&(e=e.replace("\x3c!-- {docsify-ignore} --\x3e",""),n=!0),/{docsify-ignore}/g.test(e)&&(e=e.replace("{docsify-ignore}",""),n=!0),/<!-- {docsify-ignore-all} -->/g.test(e)&&(e=e.replace("\x3c!-- {docsify-ignore-all} --\x3e",""),t=!0),/{docsify-ignore-all}/g.test(e)&&(e=e.replace("{docsify-ignore-all}",""),t=!0),{content:e,ignoreAllSubs:t,ignoreSubHeading:n}}(i).content,c=function(e=""){return e.replace(/(<\/?a.*?>)/gi,"")}(c.trim())),!h&&c&&(h=c),u[l]={slug:l,title:c,body:"",path:t,indexKey:o}}else{const e="code"===n.type?n.text:null;if(0===a&&(l=r.toURL(t),u[l]={slug:l,title:"/"!==t?t.slice(1):"Home Page",body:"",path:t,indexKey:o}),!l)return;u[l]?u[l].body?(n.text=nt(n),n.text=rt(n),u[l].body+="\n"+(e??De(n.text||""))):(n.text=nt(n),n.text=rt(n),u[l].body=e??De(n.text||"")):u[l]={slug:l,title:"",body:""},u[l].path=t,u[l].indexKey=o}})),s.clear(),Object.values(u).forEach((e=>{e.pageTitle=h})),u}(r,a,n.router,t.depth,u),f()}),(()=>f()))}))}let ut="",lt="none";function ct(e){return(e||"").replace(/(?:[\uD83C-\uD83E][\uDC00-\uDFFF])|[\u2600-\u27BF\u2B00-\u2BFF]|\uFE0E|\uFE0F|\u200D|\u20E3/g,"").replace(/\s+/g," ").trim()}function ht(e){try{return decodeURIComponent(e)}catch{return e}}function ft(e){for(const t of e.childNodes){if(t.nodeType===Node.TEXT_NODE&&t.textContent.trim())return t.textContent.trim();if(t.nodeType===Node.ELEMENT_NODE){if("UL"===t.tagName)break;const e=t.textContent.trim();if(e)return e}}return""}function pt(e){const t=function(e){const t=ht((e||"").split("?")[0]);return Docsify.dom.findAll(".sidebar-nav a").find((e=>ht((e.getAttribute("href")||"").split("?")[0])===t))}(e);if(!t)return null;const n=[t.textContent.trim()];let r=t.closest("li");for(;r;){const e=r.parentElement?r.parentElement.closest("li"):null;if(e){const t=ft(e);t&&n.unshift(t)}r=e}return n}function dt(e){const n=Docsify.dom.find(".search"),r=Docsify.dom.find(n,".results-panel"),i=Docsify.dom.find(".search .results-status");if(!e)return r.innerHTML="",void(i.textContent="");const o=function(e){const n=[];let r=(e=e.trim()).split(/[\s\-,\\/]+/);1!==r.length&&(r=[e,...r]);for(const e of Ge){let i=0,o="",a="",s="";const u=e.title&&e.title.trim(),l=e.body&&e.body.trim(),c=e.slug||"";if(u&&(a=t(at(u)),s=l?t(at(l)):l,r.forEach((e=>{const n=new RegExp(t(at(e)).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"gi"),r=u?a.search(n):-1;let c=l?s.search(n):-1;if(r>=0||c>=0){i+=r>=0?3:c>=0?2:0,c<0&&(c=0);const t=c<11?0:c-10;let a=0===t?100:c+e.length+90;s&&a>s.length&&(a=s.length);const u=s&&s.substring(t,a).replace(n,(e=>`<mark>${e}</mark>`));o+=u}})),i>0)){const r=e.pageTitle&&e.pageTitle.trim(),s={title:a,content:l?o:"",url:c,score:i,page:r?t(at(r)):""};n.push(s)}}return n.sort(((e,t)=>t.score-e.score))}(e);let a="";o.forEach(((e,n)=>{const r=e.content?`...${e.content}...`:"",i=(e.title||"").replace(/<[^>]+>/g,"");a+=`\n      <div class="matching-post" aria-label="search result ${n+1}">\n        <a href="${e.url}" title="${i}">\n          <p class="title clamp-1">${e.title}</p>\n          <p class="content clamp-2">${r}</p>\n          ${function(e){if("breadcrumb"===lt){const n=pt(e.url);return n&&n.length?`<p class="search-breadcrumb clamp-1">${n.map(((e,r)=>{const i=t(ct(e));return r===n.length-1?`<strong>${i}</strong>`:i})).join(" › ")}</p>`:e.page?`<p class="search-breadcrumb clamp-1"><strong>${ct(e.page)}</strong></p>`:""}if("page"===lt){const t=e.page&&e.page!==e.title?e.page:"";return t?`<p class="search-breadcrumb clamp-1"><strong>${ct(t)}</strong></p>`:""}return""}(e)}\n        </a>\n      </div>\n    `})),r.innerHTML=a||"",i.textContent=o.length?`Found ${o.length} results`:ut}function gt(e,n){if(!Docsify.dom.find(".sidebar"))return;const r=n.router.parse().query.s||"";lt=e.resultSource||lt,Docsify.dom.style("/* prettier-ignore */\n:root {\n  --plugin-search-input-bg           : var(--form-element-bg);\n  --plugin-search-input-border-color : var(--sidebar-border-color);\n  --plugin-search-input-border-radius: var(--form-element-border-radius);\n  --plugin-search-input-color        : var(--form-element-color);\n  --plugin-search-kbd-bg             : var(--color-bg);\n  --plugin-search-kbd-border         : 1px solid var(--color-mono-3);\n  --plugin-search-kbd-border-radius  : 4px;\n  --plugin-search-kbd-color          : var(--color-mono-5);\n  --plugin-search-margin             : 10px;\n  --plugin-search-reset-bg           : var(--theme-color);\n  --plugin-search-reset-border       : transparent;\n  --plugin-search-reset-border-radius: var(--border-radius);\n  --plugin-search-reset-color        : #fff;\n}\n\n.search {\n  margin: var(--plugin-search-margin);\n}\n\n/* Input */\n/* ================================== */\n.search .input-wrap {\n  position: relative;\n}\n\n.search input {\n  width: 100%;\n  padding-inline-end: 36px;\n  border: 1px solid var(--plugin-search-input-border-color);\n  border-radius: var(--plugin-search-input-border-radius);\n  background: var(--plugin-search-input-bg);\n  color: var(--plugin-search-input-color);\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button {\n  appearance: none;\n}\n\n.search .clear-button,\n.search .kbd-group {\n  visibility: hidden;\n  display: flex;\n  gap: 0.15em;\n  position: absolute;\n  right: 7px;\n  top: 50%;\n  opacity: 0;\n  translate: 0 -50%;\n  transition-property: opacity, visibility;\n  transition-duration: var(--duration-medium);\n}\n\n/* Note: invalid = empty, valid = not empty */\n.search input:valid ~ .clear-button,\n.search input:invalid:where(:focus, :hover) ~ .kbd-group,\n.search .kbd-group:hover {\n  visibility: visible;\n  opacity: 1;\n}\n\n.search .clear-button {\n  --_button-size: 20px;\n  --_content-size: 12px;\n\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: var(--_button-size);\n  width: var(--_button-size);\n  border: var(--plugin-search-reset-border);\n  border-radius: var(--plugin-search-reset-border-radius);\n  background: var(--plugin-search-reset-bg);\n  cursor: pointer;\n}\n\n.search .clear-button::before,\n.search .clear-button::after {\n  content: '';\n  position: absolute;\n  height: 2px;\n  width: var(--_content-size);\n  color: var(--plugin-search-reset-color);\n  background: var(--plugin-search-reset-color);\n}\n\n.search .clear-button::before {\n  rotate: 45deg;\n}\n\n.search .clear-button::after {\n  rotate: -45deg;\n}\n\n.search kbd {\n  border: var(--plugin-search-kbd-border);\n  border-radius: var(--plugin-search-kbd-border-radius);\n  background: var(--plugin-search-kbd-bg);\n  color: var(--plugin-search-kbd-color);\n  font-size: var(--font-size-s);\n}\n\n/* Results */\n/* ================================== */\n.search a:hover {\n  color: var(--theme-color);\n}\n\n.search .results-panel:empty {\n  display: none;\n}\n\n/* Hide other sidebar items when results are shown */\n.search:has(.results-panel:not(:empty)) ~ * {\n  display: none;\n}\n\n/* Dim other sidebar items when no results are found */\n.search:where(:has(input:valid:focus), :has(.results-panel::empty)) ~ * {\n  opacity: 0.2;\n}\n\n.search .matching-post {\n  overflow: hidden;\n  padding: 1em 0 1.2em 0;\n  border-bottom: 1px solid var(--color-mono-2);\n}\n\n.search .matching-post:hover a {\n  text-decoration-color: transparent;\n}\n\n.search .matching-post:hover .title {\n  text-decoration: inherit;\n  text-decoration-color: var(--link-underline-color-hover);\n}\n\n.search .matching-post .title {\n  margin: 0 0 0.5em 0;\n  line-height: 1.4;\n}\n\n.search .matching-post .content {\n  margin: 0;\n  color: var(--color-mono-6);\n  font-size: var(--font-size-s);\n}\n\n.search .matching-post .search-breadcrumb {\n  margin: 0.35em 0 0 0;\n  color: var(--color-mono-7);\n  font-size: var(--font-size-s);\n  text-align: right;\n}\n\n.search .results-status {\n  margin-bottom: 0;\n  color: var(--color-mono-6);\n  font-size: var(--font-size-s);\n}\n\n.search .results-status:empty {\n  display: none;\n}\n"),function(e,t=""){const{insertAfter:n,insertBefore:r}=e.config?.search||{},i=`\n    <div class="input-wrap">\n      <input type="search" value="${t}" required aria-keyshortcuts="/ control+k meta+k" />\n      <button class="clear-button" title="Clear search">\n        <span class="visually-hidden">Clear search</span>\n      </button>\n      <div class="kbd-group">\n        <kbd title="Press / to search">/</kbd>\n        <kbd title="Press Control+K to search">⌃K</kbd>\n      </div>\n    </div>\n    <p class="results-status" aria-live="polite"></p>\n    <div class="results-panel"></div>\n  `,o=Docsify.dom.find(".sidebar"),a=Docsify.dom.create("section",i),s=o.querySelector(`:scope ${n||r||"> :first-child"}`);a.classList.add("search"),a.setAttribute("role","search"),o.insertBefore(a,n?s.nextSibling:s)}(n,t(r)),function(){const e=Docsify.dom.find(".search"),t=Docsify.dom.find(e,"input"),n=Docsify.dom.find(e,".clear-button");let r;Docsify.dom.on(e,"click",(e=>-1===["A","H2","P","EM"].indexOf(e.target.tagName)&&e.stopPropagation())),Docsify.dom.on(t,"input",(e=>{clearTimeout(r),r=setTimeout((t=>dt(e.target.value.trim())),100)})),Docsify.dom.on(n,"click",(e=>{t.value="",dt()}))}(),r&&setTimeout((e=>dt(r)),500)}function yt(e,t){lt=e.resultSource||lt,function(e,t){const n=Docsify.dom.getNode('.search input[type="search"]');if(n)if("string"==typeof e)n.placeholder=e;else{const r=Object.keys(e).filter((e=>t.indexOf(e)>-1))[0];n.placeholder=e[r]}}(e.placeholder,t.route.path),function(e,t){if("string"==typeof e)ut=e;else{const n=Object.keys(e).filter((e=>t.indexOf(e)>-1))[0];ut=e[n]}}(e.noData,t.route.path)}const mt={placeholder:"Type to search",noData:"No Results!",paths:"auto",depth:2,maxAge:864e5,namespace:void 0,pathNamespaces:void 0,keyBindings:["/","meta+k","ctrl+k"],insertAfter:void 0,insertBefore:void 0,resultSource:"none"};window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(e,t){const{util:n}=Docsify,r=t.config.search||mt;Array.isArray(r)?mt.paths=r:"object"==typeof r&&(mt.paths=Array.isArray(r.paths)?r.paths:"auto",mt.maxAge=n.isPrimitive(r.maxAge)?r.maxAge:mt.maxAge,mt.placeholder=r.placeholder||mt.placeholder,mt.noData=r.noData||mt.noData,mt.depth=r.depth||mt.depth,mt.namespace=r.namespace||mt.namespace,mt.pathNamespaces=r.pathNamespaces||mt.pathNamespaces,mt.keyBindings=r.keyBindings||mt.keyBindings,mt.resultSource=r.resultSource||mt.resultSource);const i="auto"===mt.paths;e.init((()=>{const{keyBindings:e}=t.config;e.constructor===Object&&(e.focusSearch={bindings:mt.keyBindings,callback(e){const t=document.querySelector(".sidebar"),n=document.querySelector(".sidebar-toggle"),r=t?.querySelector('input[type="search"]'),i=(t?.getBoundingClientRect().x??0)<0;i&&n?.click(),setTimeout((()=>r?.focus()),i?250:0)}})})),e.mounted((e=>{gt(mt,t),!i&&st(mt,t)})),e.doneEach((e=>{yt(mt,t),i&&st(mt,t)}))},...window.$docsify.plugins||[]]}();
//# sourceMappingURL=search.min.js.map