Files
advanced-camera-card/docs/js/search.min.js
T
2025-10-11 19:44:57 -07:00

8 lines
144 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*!
* Docsify Plugin: search v5.0.0-rc.3
* https://docsify.js.org
* (c) 2017-2025
* MIT license
*/
!function(){"use strict";function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var t={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function n(e){t=e}var r={exec:()=>null};function i(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(o.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var o={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,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,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")},a=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,s=/(?:[*+-]|\d{1,9}[.)])/,u=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,l=i(u).replace(/bull/g,s).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(),c=i(u).replace(/bull/g,s).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(),h=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,f=/(?!\s*\])(?:\\.|[^\[\]\\])+/,p=i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",f).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),d=i(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,s).getRegex(),y="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",g=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,m=i("^ {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",g).replace("tag",y).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),b=i(h).replace("hr",a).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex(),v={blockquote:i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",b).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:p,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:a,html:m,lheading:l,list:d,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:b,table:r,text:/^[^\n]+/},k=i("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",a).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex(),w={...v,lheading:c,table:k,paragraph:i(h).replace("hr",a).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",k).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex()},x={...v,html:i("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",g).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:r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:i(h).replace("hr",a).replace("heading"," *#{1,6} *[^\n]").replace("lheading",l).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_=/^( {2,}|\\)\n(?!\s*$)/,S=/[\p{P}\p{S}]/u,P=/[\s\p{P}\p{S}]/u,A=/[^\s\p{P}\p{S}]/u,E=i(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,P).getRegex(),O=/(?!~)[\p{P}\p{S}]/u,R=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,T=i(R,"u").replace(/punct/g,S).getRegex(),K=i(R,"u").replace(/punct/g,O).getRegex(),C="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",I=i(C,"gu").replace(/notPunctSpace/g,A).replace(/punctSpace/g,P).replace(/punct/g,S).getRegex(),D=i(C,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,O).getRegex(),q=i("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,A).replace(/punctSpace/g,P).replace(/punct/g,S).getRegex(),$=i(/\\(punct)/,"gu").replace(/punct/g,S).getRegex(),j=i(/^<(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(),B=i(g).replace("(?:--\x3e|$)","--\x3e").getRegex(),z=i("^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",B).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),N=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,M=i(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",N).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),F=i(/^!?\[(label)\]\[(ref)\]/).replace("label",N).replace("ref",f).getRegex(),L=i(/^!?\[(ref)\](?:\[\])?/).replace("ref",f).getRegex(),U={_backpedal:r,anyPunctuation:$,autolink:j,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:_,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:r,emStrongLDelim:T,emStrongRDelimAst:I,emStrongRDelimUnd:q,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:M,nolink:L,punctuation:E,reflink:F,reflinkSearch:i("reflink|nolink(?!\\()","g").replace("reflink",F).replace("nolink",L).getRegex(),tag:z,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:r},V={...U,link:i(/^!?\[(label)\]\((.*?)\)/).replace("label",N).getRegex(),reflink:i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",N).getRegex()},Y={...U,emStrongRDelimAst:D,emStrongLDelim:K,url:i(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Z={...Y,br:i(_).replace("{2,}","*").getRegex(),text:i(Y.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:v,gfm:w,pedantic:x},H={normal:U,gfm:Y,breaks:Z,pedantic:V},G={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},X=e=>G[e];function W(e,t){if(t){if(o.escapeTest.test(e))return e.replace(o.escapeReplace,X)}else if(o.escapeTestNoEncode.test(e))return e.replace(o.escapeReplaceNoEncode,X);return e}function J(e){try{e=encodeURI(e).replace(o.percentDecode,"%")}catch{return null}return e}function ee(e,t){let n=e.replace(o.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(o.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(o.slashPipe,"|");return n}function te(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){let o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.slice(0,r-i)}function ne(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 re=class{options;rules;lexer;constructor(e){this.options=e||t}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=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:te(e,"\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=te(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],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:te(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=te(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=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.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=t[2].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);for(;e;){let f,p=e.split("\n",1)[0];if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting," "),f=l):f=l.replace(this.rules.other.tabCharGlobal," "),i.test(l)||o.test(l)||a.test(l)||t.test(l)||n.test(l))break;if(f.search(this.rules.other.nonSpaceChar)>=h||!l.trim())s+="\n"+f.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()&&(c=!0),r+=p+"\n",e=e.substring(p.length+1),u=f.slice(h)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(a=!0));let f,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(s),p&&(f="[ ] "!==p[0],s=s.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!p,checked:f,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=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[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=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}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:t[0],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=ee(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:t[0],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(ee(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)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}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=te(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)),ne(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 ne(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!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){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}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}}}},ie=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new re,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 n={other:o,block:Q.normal,inline:H.normal};this.options.pedantic?(n.block=Q.pedantic,n.inline=H.pedantic):this.options.gfm&&(n.block=Q.gfm,this.options.breaks?n.inline=H.breaks:n.inline=H.gfm),this.tokenizer.rules=n}static get rules(){return{block:Q,inline:H}}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(o.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){for(this.options.pedantic&&(e=e.replace(o.tabCharGlobal," ").replace(o.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=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&&(i=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let o=t.at(-1);n&&"paragraph"===o?.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,o="";for(;e;){let r;if(i||(o=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let a=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&&(a=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(a)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(o=r.raw.slice(-1)),i=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},oe=class{options;parser;constructor(e){this.options=e||t}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(o.notSpaceStart)?.[0],i=e.replace(o.endingNewline,"")+"\n";return r?'<pre><code class="language-'+W(r)+'">'+(n?i:W(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:W(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}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){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?"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+" "+W(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</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>${W(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=J(e);if(null===i)return r;let o='<a href="'+(e=i)+'"';return t&&(o+=' title="'+W(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=J(e);if(null===i)return W(n);let o=`<img src="${e=i}" alt="${n}"`;return t&&(o+=` title="${W(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:W(e.text)}},ae=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""}},se=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ae}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}let o=i;switch(o.type){case"space":n+=this.renderer.space(o);continue;case"hr":n+=this.renderer.hr(o);continue;case"heading":n+=this.renderer.heading(o);continue;case"code":n+=this.renderer.code(o);continue;case"table":n+=this.renderer.table(o);continue;case"blockquote":n+=this.renderer.blockquote(o);continue;case"list":n+=this.renderer.list(o);continue;case"html":n+=this.renderer.html(o);continue;case"paragraph":n+=this.renderer.paragraph(o);continue;case"text":{let i=o,a=this.renderer.text(i);for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],a+="\n"+this.renderer.text(i);n+=t?this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a,escaped:!0}]}):a;continue}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}parseInline(e,t=this.renderer){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"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}},ue=class{options;block;constructor(e){this.options=e||t}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ie.lex:ie.lexInline}provideParser(){return this.block?se.parse:se.parseInline}},le=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=se;Renderer=oe;TextRenderer=ae;Lexer=ie;Tokenizer=re;Hooks=ue;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 oe(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 re(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 ue;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];ue.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>o.call(t,e)));let n=i.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{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 ie.lex(e,t??this.defaults)}parser(e,t){return se.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"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let a=i.hooks?i.hooks.provideLexer():e?ie.lex:ie.lexInline,s=i.hooks?i.hooks.provideParser():e?se.parse:se.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then((e=>a(e,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>s(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(o);try{i.hooks&&(t=i.hooks.preprocess(t));let e=a(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}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>"+W(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ce(e,t){return le.parse(e,t)}ce.options=ce.setOptions=function(e){return le.setOptions(e),ce.defaults=le.defaults,n(ce.defaults),ce},ce.getDefaults=e,ce.defaults=t,ce.use=function(...e){return le.use(...e),ce.defaults=le.defaults,n(ce.defaults),ce},ce.walkTokens=function(e,t){return le.walkTokens(e,t)},ce.parseInline=le.parseInline,ce.Parser=se,ce.parser=se.parse,ce.Renderer=oe,ce.TextRenderer=ae,ce.Lexer=ie,ce.lexer=ie.lex,ce.Tokenizer=re,ce.Hooks=ue,ce.parse=ce,ce.options,ce.setOptions,ce.use,ce.walkTokens,ce.parseInline,se.parse,ie.lex;const he=/&(?:amp|lt|gt|quot|#(0+)?39);/g,fe=RegExp(he.source),pe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};const de=/[&<>"']/g,ye=RegExp(de.source),ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};const me={space:()=>"",code({text:e}){const t=e.replace(/\n$/,"");return(n=t)&&ye.test(n)?n.replace(de,(e=>ge[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:()=>"",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:({text:e})=>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||""}},be=ce.setOptions({renderer:me});function ve(e){const t=be.parse(e);var n;return function(e){return e&&e.replace("!>","").replace("?>","")}((n=t)&&fe.test(n)?n.replace(he,(e=>pe[e]||"'")):n||"").trim()}var ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function we(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xe,_e={exports:{}};var Se=(xe||(xe=1,_e.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:ke,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,y=[].slice;function g(e,t,n){return y.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 P="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]})),A=new Set(P.map((function(e){return r[e]}))),E=null;function O(e){return E=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=E.get(t);if(n)return n;if(o(t)){n=[],E.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(A.has(t.constructor))n=t;else{var a,u=s(t);for(a in n=u===Object.prototype?{}:Object.create(u),E.set(t,n),t)l(t,a)&&(n[a]=e(t[a]))}return n}(e),E=null,e}var R={}.toString;function T(e){return R.call(e).slice(8,-1)}var K="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",C="symbol"==typeof K?function(e){var t;return null!=e&&(t=e[K])&&t.apply(e)}:function(){return null};function I(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var D={};function q(e){var t,n,r,i;if(1===arguments.length){if(o(e))return e.slice();if(this===D&&"string"==typeof e)return[e];if(i=C(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 $="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},j=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],B=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(j),z={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 N(e,t){this.name=e,this.message=t}function M(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 F(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=M(e,t)}function L(e,t){this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=M(e,this.failures)}p(N).from(Error).extend({toString:function(){return this.name+": "+this.message}}),p(F).from(N),p(L).from(N);var U=B.reduce((function(e,t){return e[t]=t+"Error",e}),{}),V=N,Y=B.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=z[t]||n,this.inner=null)}return p(r).from(V),e[t]=r,e}),{});Y.Syntax=SyntaxError,Y.Type=TypeError,Y.Range=RangeError;var Z=j.reduce((function(e,t){return e[t+"Error"]=Y[t],e}),{}),Q=B.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Y[t]),e}),{});function H(){}function G(e){return e}function X(e,t){return null==e||e===G?t:function(n){return t(e(n))}}function W(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function J(e,t){return e===H?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?W(r,this.onsuccess):r),i&&(this.onerror=this.onerror?W(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===H?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?W(n,this.onsuccess):n),r&&(this.onerror=this.onerror?W(r,this.onerror):r)}}function te(e,t){return e===H?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?W(i,this.onsuccess):i),o&&(this.onerror=this.onerror?W(o,this.onerror):o),void 0===r?void 0===n?void 0:n:a(r,n)}}function ne(e,t){return e===H?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function re(e,t){return e===H?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)}}Q.ModifyError=F,Q.DexieError=N,Q.BulkError=L;var ie="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function oe(e){ie=e}var ae={},se=100,ue=(P="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]}(),j=P[0],B=P[1],P=P[2],B=B&&B.then,j&&j.constructor),le=!!P,ce=function(e,t){be.push([e,t]),fe&&(queueMicrotask(Re),fe=!1)},he=!0,fe=!0,pe=[],de=[],ye=G,ge={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:H,pgp:!1,env:{},finalize:H},me=ge,be=[],ve=0,we=[];function xe(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!==ae)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Pe(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&&Te();n&&"function"==typeof n.then?e(t,(function(e,t){n instanceof xe?n._then(e,t):n.then(e,t)})):(t._state=!0,t._value=n,Ae(t)),r&&Ke()}}),Pe.bind(null,t))}catch(n){Pe(t,n)}}(this,e)}var _e={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 xe((function(t,s){Ee(i,new Se(He(n,e,o,a),He(r,e,o,a),t,s,e))}));return this._consoleTask&&(s._consoleTask=this._consoleTask),s}return n.prototype=ae,n},set:function(e){f(this,"then",e&&e.prototype===ae?_e:{get:function(){return e},set:_e.set})}};function Se(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 Pe(e,t){var n,r;de.push(t),null===e._state&&(n=e._lib&&Te(),t=ye(t),e._state=!1,e._value=t,r=e,pe.some((function(e){return e._value===r._value}))||pe.push(r),Ae(e),n&&Ke())}function Ae(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Ee(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===ve&&(++ve,ce((function(){0==--ve&&Ce()}),[]))}function Ee(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(Oe,[n,e,t])}else e._listeners.push(t)}function Oe(e,t,n){try{var r,i=t._value;!t._state&&de.length&&(de=[]),r=ie&&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(){Qe(ge,(function(){Te()&&Ke()}))}function Te(){var e=he;return fe=he=!1,e}function Ke(){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=we.slice(0),n=t.length;n;)t[--n]()}function Ie(e){return new xe(ae,!1,e)}function De(e,t){var n=me;return function(){var r=Te(),i=me;try{return Ye(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{Ye(i,!1),r&&Ke()}}}c(xe.prototype,{then:_e,_then:function(e,t){Ee(this,new Se(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:Ie)(e)})):this.then(null,(function(e){return(e&&e.name===t?n:Ie)(e)}))},finally:function(e){return this.then((function(t){return xe.resolve(e()).then((function(){return t}))}),(function(t){return xe.resolve(e()).then((function(){return Ie(t)}))}))},timeout:function(e,t){var n=this;return e<1/0?new xe((function(r,i){var o=setTimeout((function(){return i(new Y.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&f(xe.prototype,Symbol.toStringTag,"Dexie.Promise"),ge.env=Ze(),c(xe,{all:function(){var e=q.apply(null,arguments).map(Ue);return new xe((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return xe.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){return e instanceof xe?e:e&&"function"==typeof e.then?new xe((function(t,n){e.then(t,n)})):new xe(ae,!0,e)},reject:Ie,race:function(){var e=q.apply(null,arguments).map(Ue);return new xe((function(t,n){e.map((function(e){return xe.resolve(e).then(t,n)}))}))},PSD:{get:function(){return me},set:function(e){return me=e}},totalEchoes:{get:function(){return ze}},newPSD:Me,usePSD:Qe,scheduler:{get:function(){return ce},set:function(e){ce=e}},rejectionMapper:{get:function(){return ye},set:function(e){ye=e}},follow:function(e,t){return new xe((function(n,r){return Me((function(t,n){var r=me;r.unhandleds=[],r.onunhandled=n,r.finalize=W((function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},we.push((function t(){e(),we.splice(we.indexOf(t),1)})),++ve,ce((function(){0==--ve&&Ce()}),[])}),r.finalize),e()}),t,n,r)}))}}),ue&&(ue.allSettled&&f(xe,"allSettled",(function(){var e=q.apply(null,arguments).map(Ue);return new xe((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,i){return xe.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(xe,"any",(function(){var e=q.apply(null,arguments).map(Ue);return new xe((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach((function(e,o){return xe.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--r||n(new AggregateError(i))}))}))}))})),ue.withResolvers&&(xe.withResolvers=ue.withResolvers));var qe={awaits:0,echoes:0,id:0},$e=0,je=[],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,ge.env,o.env=le?{Promise:xe,PromiseProp:{value:xe,configurable:!0,writable:!0},all:xe.all,race:xe.race,allSettled:xe.allSettled,any:xe.any,resolve:xe.resolve,reject:xe.reject}:{},t&&a(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=Qe(o,e,n,r),0===o.ref&&o.finalize(),r}function Fe(){return qe.id||(qe.id=++$e),++qe.awaits,qe.echoes+=se,qe.id}function Le(){return!!qe.awaits&&(0==--qe.awaits&&(qe.id=0),qe.echoes=qe.awaits*se,!0)}function Ue(e){return qe.echoes&&e&&e.constructor===ue?(Fe(),e.then((function(e){return Le(),e}),(function(e){return Le(),Xe(e)}))):e}function Ve(){var e=je[je.length-1];je.pop(),Ye(e,!1)}function Ye(e,t){var n,i=me;(t?!qe.echoes||Be++&&e===me:!Be||--Be&&e===me)||queueMicrotask(t?function(e){++ze,qe.echoes&&0!=--qe.echoes||(qe.echoes=qe.awaits=qe.id=0),je.push(me),Ye(e,!0)}.bind(null,e):Ve),e!==me&&(me=e,i===ge&&(ge.env=Ze()),le&&(n=ge.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 Ze(){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 Qe(e,t,n,r,i){var o=me;try{return Ye(e,!0),t(n,r,i)}finally{Ye(o,!1)}}function He(e,t,n,r){return"function"!=typeof e?e:function(){var i=me;n&&Fe(),Ye(t,!0);try{return e.apply(this,arguments)}finally{Ye(i,!1),r&&queueMicrotask(Le)}}}function Ge(e){Promise===ue&&0===qe.echoes?0===Be?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+B).indexOf("[native code]")&&(Fe=Le=H);var Xe=xe.reject,We=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=O(t))[e],t}}function ut(){throw Y.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=ie&&"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 Y.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var s=Te();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===U.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 Y.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Xe(new Y.DatabaseClosed);t.open().catch(H)}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&&Ke()}},pt.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?Xe(new Y.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!==We){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map((function(t){return e[t]})))}!n&&ie&&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?xe.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 Y.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?xe.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?xe.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?xe.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 Y.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Y.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 L("".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 Y.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Y.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 L("".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 Y.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 L("".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 L("".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||ne;var l={subscribers:[],fire:a=a||H,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 Y.InvalidArgument("Invalid event config");var n=s(e,G,(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 yt(e,t){return p(t).from({prototype:e}),t}function gt(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 Y.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=H}),(function(t){e.fail(t),n=H}))||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 Pt=(At.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)},At.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")},At.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},At.prototype._iterate=function(e,t){return wt(this._ctx,e,t,this._ctx.table.core)},At.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},At.prototype.raw=function(){return this._ctx.valueMapper=null,this},At.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return wt(t,e,n,t.table.core)}))},At.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(gt(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)},At.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)},At.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&gt(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)},At.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,gt(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},At.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},At.prototype.until=function(e,t){return mt(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},At.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},At.prototype.last=function(e){return this.reverse().first(e)},At.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},At.prototype.and=function(e){return this.filter(e)},At.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},At.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},At.prototype.desc=function(){return this.reverse()},At.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},At.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},At.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},At.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)},At.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&gt(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)},At.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},At.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},At.prototype.lastKey=function(e){return this.reverse().firstKey(e)},At.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},At.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,y+=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=[],y=0,g=[];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=[],y=[],g=c?[]:null,m=[],b=0;b<a;++b){var v=u[b],k={value:O(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))?(y.push(k.value),c&&g.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<y.length||o&&"object"==typeof e)&&l.mutate({trans:r,type:"put",keys:g,values:y,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<n}).then((function(e){return p(y.length,e)}))})).then((function(){return(0<m.length||o&&e===Et)&&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=gt(n)&&n.limit===1/0&&("function"!=typeof e||e===Et)&&{index:n.index,range:n.range};return i(0).then((function(){if(0<d.length)throw new F("Error modifying one or more objects",d,y,g);return t.length}))}))}))},At.prototype.delete=function(){var e=this._ctx,t=e.range;return gt(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 F("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-e);return t-e}))}))})):this.modify(Et)},At);function At(){}var Et=function(e,t){return t.value=null};function Ot(e,t){return e<t?-1:e===t?0:1}function Rt(e,t){return t<e?-1:e===t?0:1}function Tt(e,t,n){return(e=e instanceof qt?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function Kt(e){return new e.Collection(e,(function(){return Dt("")})).limit(0)}function Ct(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?Ot:Rt;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 It(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,y=p;y<h;++y){var g=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[y],u[y],a,l);null===g&&null===d?p=y+1:(null===d||0<a(d,g))&&(d=g)}return n(null!==d?function(){e.continue(d+c)}:r),!1})),e}function It(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Dt(e){return{type:1,lower:e,upper:e}}var qt=(Object.defineProperty($t.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),$t.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)?Kt(this):new this.Collection(this,(function(){return It(e,t,!n,!r)}))}catch(e){return Tt(this,Je)}},$t.prototype.equals=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return Dt(e)}))},$t.prototype.above=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return It(e,void 0,!0)}))},$t.prototype.aboveOrEqual=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return It(e,void 0,!1)}))},$t.prototype.below=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return It(void 0,e,!1,!0)}))},$t.prototype.belowOrEqual=function(e){return null==e?Tt(this,Je):new this.Collection(this,(function(){return It(void 0,e)}))},$t.prototype.startsWith=function(e){return"string"!=typeof e?Tt(this,et):this.between(e,e+We,!0,!0)},$t.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Ct(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],We)},$t.prototype.equalsIgnoreCase=function(e){return Ct(this,(function(e,t){return e===t[0]}),[e],"")},$t.prototype.anyOfIgnoreCase=function(){var e=q.apply(D,arguments);return 0===e.length?Kt(this):Ct(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},$t.prototype.startsWithAnyOfIgnoreCase=function(){var e=q.apply(D,arguments);return 0===e.length?Kt(this):Ct(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,We)},$t.prototype.anyOf=function(){var e=this,t=q.apply(D,arguments),n=this._cmp;try{t.sort(n)}catch(r){return Tt(this,Je)}if(0===t.length)return Kt(this);var r=new this.Collection(this,(function(){return It(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},$t.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},$t.prototype.noneOf=function(){var e=q.apply(D,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})},$t.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 Kt(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",Y.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])},y=l?function(e){return 0<o(e,u[p][0])}:function(e){return 0<=o(e,u[p][0])},g=d;return(e=new this.Collection(this,(function(){return It(u[0][0],u[u.length-1][1],!l,!c)})))._ondirectionchange=function(e){h="next"===e?(g=d,i):(g=y,o),u.sort(f)},e._addAlgorithm((function(e,t,r){for(var o,a=e.key;g(a);)if(++p===u.length)return t(r),!1;return!d(o=a)&&!y(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},$t.prototype.startsWithAnyOf=function(){var e=q.apply(D,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Kt(this):this.inAnyRange(e.map((function(e){return[e,e+We]}))):Tt(this,"startsWithAnyOf() only works with strings")},$t);function $t(){}function jt(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{Qe(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 Y.DatabaseClosed(r);case"MissingAPIError":throw new Y.MissingAPI(r.message,r);default:throw new Y.OpenFailed(r)}if(!this.active)throw new Y.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 Y.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 Y.ReadOnly("Transaction is readonly"));if(!this.active)return Xe(new Y.TransactionInactive);if(this._locked())return new xe((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},me])}));if(n)return Me((function(){var e=new xe((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 xe((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=xe.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 xe((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 Y.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 Y.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?"++":"")+Vt(t)}}function Vt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Yt(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 Zt=function(e){try{return e.only([[]]),Zt=function(){return[[]]},[[]]}catch(e){return Zt=function(){return We},We}};function Qt(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 Ht(e){return[].slice.call(e)}var Gt=0;function Xt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function Wt(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 y=[],g=[],m=0;if("deleteRange"===i){if(4===s.type)return e({numFailures:m,failures:g,results:[],lastResult:void 0});3===s.type?y.push(f=l.clear()):y.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)y.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)y.push(f=l[i](b[k])),f.onerror=d}function w(t){t=t.target.result,y.forEach((function(e,t){return null!=e.error&&(g[t]=e.error)})),e({numFailures:m,failures:g,results:"delete"===i?o:y.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=jt(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=jt(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=jt(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=jt(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=jt(u),f.onsuccess=De((function(n){var r,i,o,a,s=f.result;s?(s.___id=++Gt,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=jt(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=jt(t)}))}}}var a,s,u,l=(s=n,u=Ht((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:Qt(t)},indexes:Ht(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:Qt(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:Zt(t),schema:n}}function Jt(e,n,r,i){var o=r.IDBKeyRange;return r.indexedDB,{dbcore:(i=Wt(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=Yt("$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})):xe.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 Y.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=$(l);return p&&Fe(),a=xe.follow((function(){var e;(f=l(s))&&p&&(e=Le.bind(null,null),f.then(e,e))})),f&&"function"==typeof f.then?xe.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?xe.resolve(l.shift()(s.idbtrans)).then(e):xe.resolve()}().then((function(){ln(c,u)}))):xe.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 xe.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){ie&&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)||(ie&&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 g(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),i=Ut(Vt(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]=Yt(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:"["+g(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=(yn.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 Y.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new Y.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Y.Schema("Index must have a name and cannot be an empty string")})),t[n]=Yt(n,i,r)}}))},yn.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},yn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=re(this._cfg.contentUpgrade||H,e),this},yn);function yn(){}function gn(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},Pn(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},Pn(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 Pn(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=An(r)),e.d=An(e)}function An(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 En(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||A.has(r.constructor)?r:e(r));return i}(t[n])})),e}function On(e,t){return e.all||t.all||Object.keys(e).some((function(n){return t[n]&&_n(t[n],e[n])}))}c(kn.prototype,((B={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)}})[K]=function(){return Sn(this)},B));var Rn={},Tn={},Kn=!1;function Cn(e){En(Tn,e),Kn||(Kn=!0,setTimeout((function(){Kn=!1,In(Tn,!(Tn={}))}),0))}function In(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(Rn);r<i.length;r++)Dn(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=Rn["idb://".concat(o,"/").concat(s)])&&Dn(a,e,n,t))}n.forEach((function(e){return e()}))}function Dn(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];On(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 y=d[p];u=y[0],l=y[1],e.queries.query[u]=l}}function qn(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 Y.DatabaseClosed("db.open() was cancelled")}function u(){return new xe((function(r,l){if(s(),!n)throw new Y.MissingAPI;var c=e.name,p=t.autoSchema||!o?n.open(c):n.open(c,o);if(!p)throw new Y.MissingAPI;p.onerror=jt(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 Y.NoSuchDatabase("Database ".concat(c," doesnt exist")))}))):(h.onerror=jt(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,y,m=e.idbdb=p.result,b=g(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=g(s.objectStoreNames,0),tn(n,[n._allTables],i(l),l);else if(fn(e,e._dbSchema,v),((y=sn(hn(0,(y=e).idbdb,v),y._dbSchema)).add.length||y.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&&(y=e._deps,v=c,m=y.indexedDB,y=y.IDBKeyRange,mn(m)||v===nt||gn(m,y).put({name:v}).catch(H)),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 xe.reject(e)}))}var l,c=t.dbReadyResolve,h=null,f=!1;return xe.race([r,("undefined"==typeof navigator?xe.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=[],xe.resolve(bn((function(){return e.on.ready.fire(e.vip)}))).then((function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(re,H);return t.onReadyBeingFired=[],xe.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),In(t,!0)),e}))}function $n(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 jn(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:Qt(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:jn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:jn(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(jn(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(jn(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===H)break;return a._promise("readwrite",(function(){return f(e)}),!0);case"put":if(c.fire===H&&h.fire===H)break;return a._promise("readwrite",(function(){return f(e)}),!0);case"delete":if(u.fire===H)break;return a._promise("readwrite",(function(){return f(e)}),!0);case"deleteRange":if(u.fire===H)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?O(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?xe.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?O(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 Vn(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Yn={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 Y.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),y[e]||(y[e]=new kn)}var c,h,f,d=t.trans,y=t.mutatedParts||(t.mutatedParts={}),g=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)?(g.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),g.add(w)):(g.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||(g.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=En(d.mutatedParts||{},y),e}))}}),y=(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(y).forEach((function(e){d[e]=function(i){var o=!!(d=me.subscr),u=Un(me,s)&&Vn(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=y[e](i))[0],d[1]);if(("query"===e&&o.isPrimaryKey&&!i.values?p:l(o.name||"")).add(d),!o.isPrimaryKey){if("count"!==e){var g="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 g.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 Zn(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 Qn(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 Hn(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 Qn(e,l)})):Qn(f,l))&&(a.addKey(d),i.push(p)))}switch(n.type){case"add":var y=(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),!y.hasKey(e)&&(y.addKey(e),!0)})):i.map((function(e){return c(e)})).filter((function(e){return!y.hasKey(e)&&(y.addKey(e),!0)})));break;case"put":var g=(new kn).addKeys(n.values.map((function(e){return c(e)})));r=e.filter((function(e){return!g.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!Qn(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 Gn(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 Wn(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&&I(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=Rn["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,y=Object.values(h.queries.query);d<y.length;d++)for(var g=0,m=(k=y[d]).slice();g<m.length;g++)On((w=m[g]).obsSet,s.mutatedParts)&&(I(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=Hn(w.res,w.req,p,f,w,x),w.dirty?(I(k,w),w.subscribers.forEach((function(e){return a.add(e)}))):x!==w.res&&(w.res=x,w.promise=xe.resolve({result:x}))):(w.dirty&&I(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=Rn["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&&Cn(e.mutatedParts),a.then((function(t){0<t.numFailures&&(I(s.optimisticOps,e),(t=Zn(0,e,t))&&s.optimisticOps.push(t),e.mutatedParts&&Cn(e.mutatedParts))})),a.catch((function(){I(s.optimisticOps,e),e.mutatedParts&&Cn(e.mutatedParts)}))):a.then((function(n){var r=Zn(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(".")?O(e):t({},e),o.keyPath,n.results[r]),e}))}),n);s.optimisticOps.push(r),queueMicrotask((function(){return e.mutatedParts&&Cn(e.mutatedParts)}))})),a):i.mutate(e)},query:function(e){if(!Un(me,i)||!Vn("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=Rn["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&&Gn(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 Gn(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=O(n);return e})).catch((function(e){return h&&u&&I(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||(Rn["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=h)),Wn(u,h,o,a),u.promise.then((function(n){return{result:Hn(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 Y.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Y.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 xe((function(e,n){if(t._state.openComplete)return n(new Y.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new Y.DatabaseClosed);t.open().catch(H)}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 Qe(ge,(function(){return qn(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 xe((function(t){e.dbReadyResolve=t})),e.openCanceller=new xe((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 Y.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new Y.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 xe((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||gn(r,e).delete(n).catch(H),i()})),n.onerror=jt(o),n.onblocked=t._fireOnBlocked}if(n)throw new Y.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 Y.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 Y.InvalidArgument("Invalid transaction mode: "+e);o=it}if(i){if(i.mode===rt&&o===it){if(!s)throw new Y.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 Y.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 xe.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===U.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=$(o);return l&&Fe(),a=xe.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=$n(u)))}),a),(u&&"function"==typeof u.then?xe.resolve(u).then((function(e){return s.active?e:Xe(new Y.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?Qe(me.transless,(function(){return r._whenReady(u)})):this._whenReady(u)},nr.prototype.table=function(e){if(!l(this._allTables,e))throw new Y.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:H,dbReadyPromise:null,cancelOpen:H,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};c.dbReadyPromise=new xe((function(e){c.dbReadyResolve=e})),c.openCanceller=new xe((function(e,t){c.cancelOpen=t})),this._state=c,this.name=e,this.on=dt(this,"populate","blocked","versionchange","close",{ready:[re,H]}),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||xe.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,yt(Pt.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!==G?e:null}}))),this.Table=(a=this,yt(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:[J,H],reading:[X,G],updating:[te,H],deleting:[ee,H]})}))),this.Transaction=(s=this,yt(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 xe((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,yt(dn.prototype,(function(e){this.db=u,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))),this.WhereClause=(l=this,yt(qt.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 Y.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=Zt(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(Yn),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)}))}B="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[B]=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(P){rr={indexedDB:null,IDBKeyRange:null}}function ar(e){var t,n=!1,r=new ir((function(r){var i,o=$(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 Ge(d)},p=function(e){En(s,e),On(u,s)&&f()},d=function(){var c,d,y;!a&&rr.indexedDB&&(s={},c={},i&&i.abort(),i=new AbortController,y=function(t){var n=Te();try{o&&Fe();var r=Me(e,t);return r=o?r.finally(Le):r}finally{n&&Ke()}}(d={subscr:c,signal:i.signal,requery:f,querier:e,trans:null}),Promise.resolve(y).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),Ge((function(){return!a&&r.next&&r.next(e)})))}),(function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||a||Ge((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),In(e,!0)}finally{cr=t}}c(sr,t(t({},Q),{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}))})):gn(n,t).toCollection().primaryKeys()).then(e)}catch(e){return Xe(new Y.MissingAPI)}var t,n},defineClass:function(){return function(e){a(this,e)}},ignoreTransaction:function(e){return me.trans?Qe(me.transless,e):e()},vip:bn,async:function(e){return function(){try{var t=$n(e.apply(this,arguments));return t&&"function"==typeof t.then?t:xe.resolve(t)}catch(t){return Xe(t)}}},spawn:function(e,t,n){try{var r=$n(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:xe.resolve(r)}catch(e){return Xe(e)}},currentTransaction:{get:function(){return me.trans||null}},waitFor:function(e,t){return t=xe.resolve("function"==typeof e?sr.ignoreTransaction(e):e).timeout(t||6e4),me.trans?me.trans.waitFor(t):t},Promise:xe,debug:{get:function(){return ie},set:function(e){oe(e)}},derive:p,extend:a,props:c,override:m,Events:dt,on:Mt,liveQuery:ar,extendObservabilitySet:En,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:O,getObjectDiff:zn,cmp:lt,asap:v,minKey:-1/0,addons:[],connections:tt,errnames:U,dependencies:rr,cache:Rn,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=Zt(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){ie&&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&&(ie&&console.debug("Dexie: handling persisted pageshow"),hr(),ur({all:new kn(-1/0,[[]])}))}))),xe.rejectionMapper=function(e,t){return!e||e instanceof N||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Z[e.name]?e:(t=new Z[e.name](t||e.message,e),"stack"in e&&f(t,"stack",{get:function(){return this.inner.stack}}),t)},oe(ie),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}()),_e.exports),Pe=we(Se);const Ae=Symbol.for("Dexie"),Ee=globalThis[Ae]||(globalThis[Ae]=Pe);if(Pe.semVer!==Ee.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Pe.semVer} and ${Ee.semVer}`);let Oe=[];const Re=new Ee("docsify");async function Te(e,t=!1){if(t){const t=await Re.expires.get(e);return t?t.value:0}const n=await Re.search.where({indexKey:e}).toArray();return n||null}Re.version(1).stores({search:"slug, title, body, path, indexKey",expires:"key, value"});const Ke={EXPIRE_KEY:"docsify.search.expires",INDEX_KEY:"docsify.search.index"};function Ce(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return String(e).replace(/[&<>"']/g,(e=>t[e]))}function Ie(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 De(e){return e.text||"list"!==e.type||(e.text=e.raw),e.text}function qe(e,t="",n,r,i){const o=window.marked.lexer(t),a=window.Docsify.slugify,s=[];let u,l="";return o.forEach(((t,o)=>{if("heading"===t.type&&t.depth<=r){const{str:r,config:o}=function(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}}(t.text);u=n.toURL(e,{id:a(o.id||t.text)}),r&&(l=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}}(r).content,l=function(e=""){return e.replace(/(<\/?a.*?>)/gi,"")}(l.trim())),s[u]={slug:u,title:l,body:"",path:e,indexKey:i}}else{if(0===o&&(u=n.toURL(e),s[u]={slug:u,title:"/"!==e?e.slice(1):"Home Page",body:ve(t.text||""),path:e,indexKey:i}),!u)return;s[u]?s[u].body?(t.text=Ie(t),t.text=De(t),s[u].body+="\n"+ve(t.text||"")):(t.text=Ie(t),t.text=De(t),s[u].body=ve(t.text||"")):s[u]={slug:u,title:"",body:""},s[u].path=e,s[u].indexKey=i}})),a.clear(),s}function $e(e){return e&&e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}async function je(e,t){const n="auto"===e.paths,r=n?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}(t.router):e.paths;let i="";if(r.length&&n&&e.pathNamespaces){const t=r[0];if(Array.isArray(e.pathNamespaces))i=e.pathNamespaces.filter((e=>t.slice(0,e.length)===e))[0]||i;else if(e.pathNamespaces instanceof RegExp){const n=t.match(e.pathNamespaces);n&&(i=n[0])}const n=-1===r.indexOf(i+"/"),o=-1===r.indexOf(i+"/README");n&&o&&r.unshift(i+"/")}else-1===r.indexOf("/")&&-1===r.indexOf("/README")&&r.unshift("/");const o=((a=e.namespace)?`${Ke.EXPIRE_KEY}/${a}`:Ke.EXPIRE_KEY)+i;var a;const s=function(e){return e?`${Ke.INDEX_KEY}/${e}`:Ke.INDEX_KEY}(e.namespace)+i,u=await Te(o,!0)<Date.now();if(Oe=await Te(s),u)Oe=[];else if(!n)return;const l=r.length;let c=0;r.forEach((n=>{if(!!Array.isArray(Oe)&&Oe.some((e=>e.path===n)))return c++;Docsify.get(t.router.getFile(n),!1,t.config.requestHeaders).then((async r=>{Oe[n]=qe(n,r,t.router,e.depth,s),l===++c&&await async function(e,t){Oe=Object.values(Oe).flatMap((e=>Object.values(e))),await Re.search.bulkPut(Oe),await Re.expires.put({key:t,value:Date.now()+e})}(e.maxAge,o)}))}))}let Be="";function ze(e){const t=Docsify.dom.find(".search"),n=Docsify.dom.find(t,".results-panel"),r=Docsify.dom.find(".search .results-status");if(!e)return n.innerHTML="",void(r.textContent="");const i=function(e){const t=[];let n=(e=e.trim()).split(/[\s\-,\\/]+/);1!==n.length&&(n=[e,...n]);for(const e of Oe){let r=0,i="",o="",a="";const s=e.title&&e.title.trim(),u=e.body&&e.body.trim(),l=e.slug||"";if(s&&(n.forEach((e=>{const t=new RegExp(Ce($e(e)).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"gi");let n=-1,l=-1;if(o=s?Ce($e(s)):s,a=u?Ce($e(u)):u,n=s?o.search(t):-1,l=u?a.search(t):-1,n>=0||l>=0){r+=n>=0?3:l>=0?2:0,l<0&&(l=0);let o=0,s=0;o=l<11?0:l-10,s=0===o?100:l+e.length+90,a&&s>a.length&&(s=a.length);const u=a&&a.substring(o,s).replace(t,(e=>`<mark>${e}</mark>`));i+=u}})),r>0)){const e={title:o,content:u?i:"",url:l,score:r};t.push(e)}}return t.sort(((e,t)=>t.score-e.score))}(e);let o="";i.forEach(((e,t)=>{const n=e.content?`...${e.content}...`:"",r=(e.title||"").replace(/<[^>]+>/g,"");o+=`\n <div class="matching-post" aria-label="search result ${t+1}">\n <a href="${e.url}" title="${r}">\n <p class="title clamp-1">${e.title}</p>\n <p class="content clamp-2">${n}</p>\n </a>\n </div>\n `})),n.innerHTML=o||"",r.textContent=i.length?`Found ${i.length} results`:Be}function Ne(e,t){if(!Docsify.dom.find(".sidebar"))return;const n=t.router.parse().query.s||"";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 .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)}(t,Ce(n)),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=>ze(e.target.value.trim())),100)})),Docsify.dom.on(n,"click",(e=>{t.value="",ze()}))}(),n&&setTimeout((e=>ze(n)),500)}function Me(e,t){!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)Be=e;else{const n=Object.keys(e).filter((e=>t.indexOf(e)>-1))[0];Be=e[n]}}(e.noData,t.route.path)}const Fe={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};window.$docsify=window.$docsify||{},$docsify.plugins=[function(e,t){const{util:n}=Docsify,r=t.config.search||Fe;Array.isArray(r)?Fe.paths=r:"object"==typeof r&&(Fe.paths=Array.isArray(r.paths)?r.paths:"auto",Fe.maxAge=n.isPrimitive(r.maxAge)?r.maxAge:Fe.maxAge,Fe.placeholder=r.placeholder||Fe.placeholder,Fe.noData=r.noData||Fe.noData,Fe.depth=r.depth||Fe.depth,Fe.namespace=r.namespace||Fe.namespace,Fe.pathNamespaces=r.pathNamespaces||Fe.pathNamespaces,Fe.keyBindings=r.keyBindings||Fe.keyBindings);const i="auto"===Fe.paths;e.init((()=>{const{keyBindings:e}=t.config;e.constructor===Object&&(e.focusSearch={bindings:Fe.keyBindings,callback(e){const t=document.querySelector(".sidebar"),n=document.querySelector(".sidebar-toggle"),r=t?.querySelector('input[type="search"]'),i=t?.getBoundingClientRect().x<0;i&&n?.click(),setTimeout((()=>r?.focus()),i?250:0)}})})),e.mounted((e=>{Ne(0,t),!i&&je(Fe,t)})),e.doneEach((e=>{Me(Fe,t),i&&je(Fe,t)}))},...$docsify.plugins||[]]}();
//# sourceMappingURL=search.min.js.map