varja=Object.create;varRn=Object.defineProperty;varva=Object.getOwnPropertyDescriptor;varwa=Object.getOwnPropertyNames;varba=Object.getPrototypeOf,Ea=Object.prototype.hasOwnProperty;varVi=n=>Rn(n,"__esModule",{value:!0});varTa=(n,e)=>{Vi(n);for(vartine)Rn(n,t,{get:e[t],enumerable:!0})},ka=(n,e,t)=>{if(e&&typeofe=="object"||typeofe=="function")for(letrofwa(e))!Ea.call(n,r)&&r!=="default"&&Rn(n,r,{get:()=>e[r],enumerable:!(t=va(e,r))||t.enumerable});returnn},X=n=>ka(Vi(Rn(n!=null?ja(ba(n)):{},"default",n&&n.__esModule&&"default"inn?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);varzi=(()=>{for(varn=newUint8Array(128),e=0;e<64;e++)n[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;returnt=>{for(varr=t.length,i=newUint8Array((r-(t[r-1]=="=")-(t[r-2]=="="))*3/4|0),o=0,a=0;o<r;){varl=n[t.charCodeAt(o++)],c=n[t.charCodeAt(o++)],d=n[t.charCodeAt(o++)],m=n[t.charCodeAt(o++)];i[a++]=l<<2|c>>4,i[a++]=c<<4|d>>2,i[a++]=d<<6|m}returni}})();Ta(exports,{default:()=>Fi});varEr=X(require("obsidian"));varL=X(require("obsidian"));varJi=X(require("obsidian"));functionoe(n){lete=newJi.Notice("",8e3),t=createFragment(r=>{r.createEl("b",{text:"Templater Error"}),r.createEl("span",{text:":"}),r.createEl("br"),r.createEl("span",{text:n.message}),ninstanceofP&&n.console_msg&&(r.createEl("br"),r.createEl("span",{text:"Check console for more information"}),console.error("Templater Error:",n.message,`
`,n.console_msg))});e.noticeEl.appendChild(t)}varP=classextendsError{constructor(e,t){super(e);this.console_msg=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}};asyncfunctionSe(n,e){try{returnawaitn()}catch(t){returntinstanceofP?oe(t):oe(newP(e,t.message)),null}}functionCe(n,e){try{returnn()}catch(t){returnoe(newP(e,t.message)),null}}varre=function(){functionn(){}returnn.explainIfInvalidTSDocTagName=function(e){if(e[0]!=="@")return'A TSDoc tag name must start with an "@" symbol';if(!n._tsdocTagNameRegExp.test(e))return"A TSDoc tag name must start with a letter and contain only letters and numbers"},n.validateTSDocTagName=function(e){vart=n.explainIfInvalidTSDocTagName(e);if(t)thrownewError(t)},n.explainIfInvalidLinkUrl=function(e){if(e.length===0)return"The URL cannot be empty";if(!n._urlSchemeRegExp.test(e))return'An @link URL must begin with a scheme comprised only of letters and numbers followed by "://". (For general URLs, use an HTML "<a>" tag instead.)';if(!n._urlSchemeAfterRegExp.test(e))return'An @link URL must have at least one character after "://"'},n.explainIfInvalidHtmlName=function(e){if(!n._htmlNameRegExp.test(e))return"An HTML name must be an ASCII letter followed by zero or more letters, digits, or hyphens"},n.validateHtmlName=function(e){vart=n.explainIfInvalidHtmlName(e);if(t)thrownewError(t)},n.explainIfInvalidPackageName=function(e){if(e.length===0)return"The package name cannot be an empty string";if(!n._validPackageNameRegExp.test(e))return"The package name ".concat(JSON.stringify(e)," is not a valid package name")},n.explainIfInvalidImportPath=function(e,t){if(e.length>0){if(e.indexOf("//")>=0)return'An import path must not contain "//"';if(e[e.length-1]==="/")return'An import path must not end with "/"';if(!t&&e[0]==="/")return'An import path must not start with "/" unless prefixed by a package name'}},n.isSystemSelector=function(e){returnn._systemSelectors.has(e)},n.explainIfInvalidUnquotedIdentifier=function(e){if(e.length===0)return"The identifier cannot be an empty string";if(n._identifierBadCharRegExp.test(e))return"The identifier cannot non-word characters";if(n._identifierNumberStartRegExp.test(e))return"The identifier must not start with a number"},n.explainIfInvalidUnquotedMemberIdentifier=function(e){vart=n.explainIfInvalidUnquotedIdentifier(e);if(t!==void0)returnt;if(n.isSystemSelector(e))return'The identifier "'.concat(e,'" must be quoted because it is a TSDoc system selector name')},n._tsdocTagNameRegExp=/^@[a-z][a-z0-9]*$/i,n._urlSchemeRegExp=/^[a-z][a-z0-9]*\:\/\//i,n._urlSchemeAfterRegExp=/^[a-z][a-z0-9]*\:\/\/./i,n._htmlNameRegExp=/^[a-z]+[a-z0-9\-]*$/i,n._identifierBadCharRegExp=/[^a-z0-9_$]/i,n._identifierNumberStartRegExp=/^[0-9]/,n._validPackageNameRegExp=/^(?:@[a-z0-9\-_\.]+\/)?[a-z0-9\-_\.]+$/i,n._systemSelectors=newSet(["instance","static","constructor","class","enum","function","interface","namespace","type","variable"]),n}();varPr=function(){functionn(){this._docNodeDefinitionsByKind=newMap,this._docNodeDefinitionsByConstructor=newMap}returnn.prototype.registerDocNodes=function(e,t){varr=re.explainIfInvalidPackageName(e);if(r)thrownewError("Invalid NPM package name: "+r);for(vari=0,o=t;i<o.length;i++){vara=o[i];if(!n._nodeKindRegExp.test(a.docNodeKind))thrownewError("The DocNode kind ".concat(JSON.stringify(a.docNodeKind)," is not a valid identifier.")+" It must start with an underscore or letter, and be comprised of letters, numbers, and underscores");varl=this._docNodeDefinitionsByKind.get(a.docNodeKind);if(l!==void0)thrownewError('The DocNode kind "'.concat(a.docNodeKind,'" was already registered')+" by ".concat(l.packageName));if(l=this._docNodeDefinitionsByConstructor.get(a.constructor),l!==void0)thrownewError("This DocNode constructor was already registered by ".concat(l.packageName)+" as ".concat(l.docNodeKind));varc={docNodeKind:a.docNodeKind,constructor:a.constructor,packageName:e,allowedChildKinds:newSet};this._docNodeDefinitionsByKind.set(a.docNodeKind
`:this.range.toString()},n}();var Ma=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),y;(function(n){n.Spacing="Spacing",n.BlockTag="BlockTag",n.CodeSpan_OpeningDelimiter="CodeSpan_OpeningDelimiter",n.CodeSpan_Code="CodeSpan_Code",n.CodeSpan_ClosingDelimiter="CodeSpan_ClosingDelimiter",n.DeclarationReference_PackageName="DeclarationReference_PackageName",n.DeclarationReference_ImportPath="DeclarationReference_ImportPath",n.DeclarationReference_ImportHash="DeclarationReference_ImportHash",n.ErrorText="ErrorText",n.NonstandardText="NonstandardText",n.EscapedText="EscapedText",n.FencedCode_OpeningFence="FencedCode_OpeningFence",n.FencedCode_Language="FencedCode_Language",n.FencedCode_Code="FencedCode_Code",n.FencedCode_ClosingFence="FencedCode_ClosingFence",n.HtmlAttribute_Name="HtmlAttribute_Name",n.HtmlAttribute_Equals="HtmlAttribute_Equals",n.HtmlAttribute_Value="HtmlAttribute_Value",n.HtmlEndTag_OpeningDelimiter="HtmlEndTag_OpeningDelimiter",n.HtmlEndTag_Name="HtmlEndTag_Name",n.HtmlEndTag_ClosingDelimiter="HtmlEndTag_ClosingDelimiter",n.HtmlStartTag_OpeningDelimiter="HtmlStartTag_OpeningDelimiter",n.HtmlStartTag_Name="HtmlStartTag_Name",n.HtmlStartTag_ClosingDelimiter="HtmlStartTag_ClosingDelimiter",n.InlineTag_OpeningDelimiter="InlineTag_OpeningDelimiter",n.InlineTag_TagName="InlineTag_TagName",n.InlineTag_TagContent="InlineTag_TagContent",n.InlineTag_ClosingDelimiter="InlineTag_ClosingDelimiter",n.LinkTag_UrlDestination="LinkTag_UrlDestination",n.LinkTag_Pipe="LinkTag_Pipe",n.LinkTag_LinkText="LinkTag_LinkText",n.MemberIdentifier_LeftQuote="MemberIdentifier_LeftQuote",n.MemberIdentifier_Identifier="MemberIdentifier_Identifier",n.MemberIdentifier_RightQuote="MemberIdentifier_RightQuote",n.MemberReference_Dot="MemberReference_Dot",n.MemberReference_LeftParenthesis="MemberReference_LeftParenthesis",n.MemberReference_Colon="MemberReference_Colon",n.MemberReference_RightParenthesis="MemberReference_RightParenthesis",n.MemberSelector="MemberSelector",n.DocMemberSymbol_LeftBracket="DocMemberSymbol_LeftBracket",n.DocMemberSymbol_RightBracket="DocMemberSymbol_RightBracket",n.ParamBlock_ParameterName="ParamBlock_ParameterName",n.ParamBlock_Hyphen="ParamBlock_Hyphen",n.PlainText="PlainText",n.SoftBreak="SoftBreak"})(y||(y={}));var j=function(n){Ma(e,n);function e(t){var r=n.call(this,t)||this;if(t.excerptKind===y.Spacing)for(var i=0,o=t.content.tokens;i<o.length;i++){var a=o[i];switch(a.kind){case u.Spacing:case u.Newline:case u.EndOfInput:break;default:throw new Error("The excerptKind=Spacing but the range contains a non-whitespace token")}}return r._excerptKind=t.excerptKind,r._content=t.content,r}return Object.defineProperty(e.prototype,"kind",{get:function(){return g.Excerpt},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"excerptKind",{get:function(){return this._excerptKind},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},enumerable:!1,configurable:!0}),e}(T);var Oa=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Yn=function(n){Oa(e,n);function e(t){var r=n.call(this,t)||this;return re.validateTSDocTagName(t.tagName),r._tagName=t.tagName,r._tagNameWithUpperCase=t.tagName.toUpperCase(),T.isParsedParameters(t
`?(++t,r=1):++r)}return{line:t,column:r}},n.prototype._validateBounds=function(){if(this.pos<0)throw new Error("TextRange.pos cannot be negative");if(this.end<0)throw new Error("TextRange.end cannot be negative");if(this.end<this.pos)throw new Error("TextRange.end cannot be smaller than TextRange.pos");if(this.pos>this.buffer.length)throw new Error("TextRange.pos cannot exceed the associated text buffer length");if(this.end>this.buffer.length)throw new Error("TextRange.end cannot exceed the associated text buffer length")},n.empty=new n("",0,0),n}();var hn=function(){function n(e){this.messageId=e.messageId,this.unformattedText=e.messageText,this.textRange=e.textRange,this.tokenSequence=e.tokenSequence,this.docNode=e.docNode,this._text=void 0}return n._formatMessageText=function(e,t){if(e||(e="An unknown error occurred"),t.pos!==0||t.end!==0){var r=t.getLocation(t.pos);if(r.line)return"(".concat(r.line,",").concat(r.column,"): ")+e}return e},Object.defineProperty(n.prototype,"text",{get:function(){return this._text===void 0&&(this._text=n._formatMessageText(this.unformattedText,this.textRange)),this._text},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return this.text},n}();var Lr=function(){function n(){this._messages=[]}return Object.defineProperty(n.prototype,"messages",{get:function(){return this._messages},enumerable:!1,configurable:!0}),n.prototype.addMessage=function(e){this._messages.push(e)},n.prototype.addMessageForTextRange=function(e,t,r){this.addMessage(new hn({messageId:e,messageText:t,textRange:r}))},n.prototype.addMessageForTokenSequence=function(e,t,r,i){this.addMessage(new hn({messageId:e,messageText:t,textRange:r.getContainingTextRange(),tokenSequence:r,docNode:i}))},n.prototype.addMessageForDocErrorText=function(e){var t;e.textExcerpt?t=e.textExcerpt:t=e.errorLocation,this.addMessage(new hn({messageId:e.messageId,messageText:e.errorMessage,textRange:t.getContainingTextRange(),tokenSequence:t,docNode:e}))},n}();var Hr=function(){function n(e,t){this.commentRange=ze.empty,this.lines=[],this.tokens=[],this.configuration=e,this.sourceRange=t,this.docComment=new Gn({configuration:this.configuration}),this.log=new Lr}return n}();var xt=function(){function n(e){this.parserContext=e.parserContext,this._startIndex=e.startIndex,this._endIndex=e.endIndex,this._validateBounds()}return n.createEmpty=function(e){return new n({parserContext:e,startIndex:0,endIndex:0})},Object.defineProperty(n.prototype,"startIndex",{get:function(){return this._startIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"endIndex",{get:function(){return this._endIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tokens",{get:function(){return this.parserContext.tokens.slice(this._startIndex,this._endIndex)},enumerable:!1,configurable:!0}),n.prototype.getNewSequence=function(e,t){return new n({parserContext:this.parserContext,startIndex:e,endIndex:t})},n.prototype.getContainingTextRange=function(){return this.isEmpty()?ze.empty:this.parserContext.sourceRange.getNewRange(this.parserContext.tokens[this._startIndex].range.pos,this.parserContext.tokens[this._endIndex-1].range.end)},n.prototype.isEmpty=function(){return this._startIndex===this._endIndex},n.prototype.toString=function(){return this.tokens.map(function(e){return e.toString()}).join("")},n.prototype._validateBounds=function(){if(this.startIndex<0)throw new Error("TokenSequence.startIndex cannot be negative");if(this.endIndex<0)throw new Error("TokenSequence.endIndex cannot be negative");if(this.endIndex<this.startIndex)throw new Error("TokenSequence.endIndex cannot be smaller than TokenSequence.startIndex");if(this.startIndex>this.parserContext.tokens.length)throw new Error("TokenSequence.startIndex cannot exceed the associated token array");if(this.endIndex>this.parserContext.tokens.length)throw new Error("TokenSequence.endIndex cannot exceed the associated token array")},n}();var pe;(function(n){n[n.BeginComment1=0]="BeginComment1",n[n.BeginComment2=1]="BeginComment2",n[n.CollectingFirstLine=2]="CollectingFirstLine
`?(m.push(t.getNewRange(w,w)),a=c):n._whitespaceCharacterRegExp.test(_)||(l=c,d=pe.CollectingLine);break}}returne.commentRange=t.getNewRange(i,o),e.lines=m,!0},n._whitespaceCharacterRegExp=/^\s$/,n}();varAn=function(){functionn(){}returnn.readTokens=function(e){n._ensureInitialized();for(vart=[],r=void0,i=0,o=e;i<o.length;i++){vara=o[i];n._pushTokensForLine(t,a),r=a}returnr?t.push(newPt(u.EndOfInput,r.getNewRange(r.end,r.end),r)):t.push(newPt(u.EndOfInput,ze.empty,ze.empty)),t},n.isPunctuation=function(e){returnn._ensureInitialized(),n._punctuationTokens[e]||!1},n._pushTokensForLine=function(e,t){for(varr=t.buffer,i=t.end,o=t.pos,a=void0,l=o;o<i;){varc=r.charCodeAt(o),d=n._charCodeMap[c];d===void0&&(d=u.Other),a!==void0&&d===a&&n._isMultiCharacterToken(a)||(a!==void0&&e.push(newPt(a,t.getNewRange(l,o),t)),l=o,a=d),++o}a!==void0&&e.push(newPt(a,t.getNewRange(l,o),t)),e.push(newPt(u.Newline,t.getNewRange(t.end,t.end),t))},n._isMultiCharacterToken=function(e){switch(e){caseu.Spacing:caseu.AsciiWord:caseu.Other:return!0}return!1},n._ensureInitialized=function(){if(!n._charCodeMap){n._charCodeMap={},n._punctuationTokens={};for(vare=n._commonMarkPunctuationCharacters,t=0;t<e.length;++t){varr=e.charCodeAt(t);n._charCodeMap[r]=u.OtherPunctuation}for(vari={"\\":u.Backslash,"<":u.LessThan,">":u.GreaterThan,"=":u.Equals,"'":u.SingleQuote,'"':u.DoubleQuote,"/":u.Slash,"-":u.Hyphen,"@":u.AtSign,"{":u.LeftCurlyBracket,"}":u.RightCurlyBracket,"`":u.Backtick,".":u.Period,":":u.Colon,",":u.Comma,"[":u.LeftSquareBracket,"]":u.RightSquareBracket,"|":u.Pipe,"(":u.LeftParenthesis,")":u.RightParenthesis,"#":u.PoundSymbol,"+":u.Plus,$:u.DollarSign},o=0,a=Object.getOwnPropertyNames(i);o<a.length;o++){varl=a[o];n._charCodeMap[l.charCodeAt(0)]=i[l],n._punctuationTokens[i[l]]=!0}n._punctuationTokens[u.OtherPunctuation]=!0;for(varc=n._wordCharacters,t=0;t<c.length;++t){varr=c.charCodeAt(t);n._charCodeMap[r]=u.AsciiWord}n._charCodeMap[" ".charCodeAt(0)]=u.Spacing,n._charCodeMap[" ".charCodeAt(0)]=u.Spacing}},n._commonMarkPunctuationCharacters="!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~",n._wordCharacters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_",n}();var$r=function(){functionn(e,t){if(this._parserContext=e,this.tokens=e.tokens,t){if(t.parserContext!==this._parserContext)thrownewError("The embeddedTokenSequence must use the same parser context");this._readerStartIndex=t.startIndex,this._readerEndIndex=t.endIndex}elsethis._readerStartIndex=0,this._readerEndIndex=this.tokens.length;this._currentIndex=this._readerStartIndex,this._accumulatedStartIndex=this._readerStartIndex}returnn.prototype.extractAccumulatedSequence=function(){if(this._accumulatedStartIndex===this._currentIndex)thrownewError("Parser assertion failed: The queue should not be empty when extractAccumulatedSequence() is called");vare=newxt({parserContext:this._parserContext,startIndex:this._accumulatedStartIndex,endIndex:this._currentIndex});returnthis._accumulatedStartIndex=this._currentIndex,e},n.prototype.isAccumulatedSequenceEmpty=function(){returnthis._accumulatedStartIndex===this._currentIndex},n.prototype.tryExtractAccumulatedSequence=function(){if(!this.isAccumulatedSequenceEmpty())returnthis.extractAccumulatedSequence()},n.prototype.assertAccumulatedSequenceIsEmpty=function(){if(!this.isAccumulatedSequenceEmpty()){vare=newxt({parserContext:this._parserContext,startIndex:this._accumulatedStartIndex,endIndex:this._currentIndex}),t=e.tokens.map(function(r){returnr.toString()});thrownewError(`Parser assertion failed: The queue should be empty, but it contains:
`+JSON.stringify(t))}},n.prototype.peekToken=function(){returnthis.tokens[this._currentIndex]},n.prototype.peekTokenKind=function(){returnthis._currentIndex>=this._readerEndIndex?u.EndOfInput:this.tokens[this._currentIndex].kind},n.prototype.peekTokenAfterKind=function(){returnthis._currentIndex+1>=this._readerEndIndex?u.EndOfInput:this.tokens[this._currentIndex+1].kind},n.prototype.peekTokenAfterAfterKind=function(){returnthis._currentIndex+2>=this._readerEndIndex?u.EndOfInput:this.tokens[this._currentIndex+2].kind},n.prototype.readToken=function(){if(this._currentIndex>=this._readerEndIndex)thrownewError("Cannot read past end of stream");vare=this.tokens[this._currentIndex];if(e.kind===u.EndOfInput)thrownewError("The EndOfInput token cannot be read");returnthis._currentIndex++,e},n.prototype.peekPreviousTokenKind=function(){returnthis._currentIndex===0?u.EndOfInput:this.tokens[this._currentIndex-1].kind},n.prototype.createMarker=function(){returnthis._currentIndex},n.prototype.backtrackToMarker=function(e){if(e>this._currentIndex)thrownewError("The marker has expired");this._currentIndex=e,e<this._accumulatedStartIndex&&(this._accumulatedStartIndex=e)},n}();varlr=function(){returnlr=Object.assign||function(n){for(vare,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(variine)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}returnn},lr.apply(this,arguments)};function_n(n){returnn!==void0&&Object.hasOwnProperty.call(n,"failureMessage")}varro=function(){functionn(e){this._parserContext=e,this._configuration=e.configuration,this._currentSection=e.docComment.summarySection}returnn.prototype.parse=function(){for(vare=new$r(this._parserContext),t=!1;!t;)switch(e.peekTokenKind()){caseu.EndOfInput:t=!0;break;caseu.Newline:this._pushAccumulatedPlainText(e),e.readToken(),this._pushNode(newrr({parsed:!0,configuration:this._configuration,softBreakExcerpt:e.extractAccumulatedSequence()}));break;caseu.Backslash:this._pushAccumulatedPlainText(e),this._pushNode(this._parseBackslashEscape(e));break;caseu.AtSign:this._pushAccumulatedPlainText(e),this._parseAndPushBlock(e);break;caseu.LeftCurlyBracket:{this._pushAccumulatedPlainText(e);varr=e.createMarker(),i=this._parseInlineTag(e),o=this._parserContext.docComment;if(iinstanceofdn){vara=e.createMarker()-1;o.inheritDocTag===void0?this._parserContext.docComment.inheritDocTag=i:this._pushNode(this._backtrackAndCreateErrorRange(e,r,a,v.ExtraInheritDocTag,"A doc comment cannot have more than one @inheritDoc tag"))}elsethis._pushNode(i);break}caseu.RightCurlyBracket:this._pushAccumulatedPlainText(e),this._pushNode(this._createError(e,v.EscapeRightBrace,'The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag'));break;caseu.LessThan:this._pushAccumulatedPlainText(e),e.peekTokenAfterKind()===u.Slash?this._pushNode(this._parseHtmlEndTag(e)):this._pushNode(this._parseHtmlStartTag(e));break;caseu.GreaterThan:this._pushAccumulatedPlainText(e),this._pushNode(this._createError(e,v.EscapeGreaterThan,'The ">" character should be escaped using a backslash to avoid confusion with an HTML tag'));break;caseu.Backtick:this._pushAccumulatedPlainText(e),e.peekTokenAfterKind()===u.Backtick&&e.peekTokenAfterAfterKind()===u.Backtick?this._pushNode(this._parseFencedCode(e)):this._pushNode(this._parseCodeSpan(e));break;default:e.readToken();break}this._pushAccumulatedPlainText(e),this._performValidationChecks()},n.prototype._performValidationChecks=function(){vare=this._parserContext.docComment;e.deprecatedBlock&&(cr.hasAnyTextContent(e.deprecatedBlock)||this._parserContext.log.addMessageForTokenSequence(v.MissingDeprecationMessage,"The ".concat(e.deprecatedBlock.blockTag.tagName," block must include a deprecation message,")+" e.g. describing the recommended alternative",e.deprecatedBlock.blockTag.getTokenSequence(),e.deprecatedBlock)),e.inheritDocTag&&(e.remarksBlock&&this._parserContext.log.addMessageForTokenSequence(v.InheritDocIncompatibleTag,'A "'.concat(e.remarksBlock.blockTag.tagName,'" block must not be used, beca
This is mostly useful when writing scripts requiring some context information.
`,functions:{template_file:{name:"template_file",description:"The`TFile`objectrepresentingthetemplatefile.",definition:"tp.config.template_file"},target_file:{name:"target_file",description:"The`TFile`objectrepresentingthetargetfilewherethetemplatewillbeinserted.",definition:"tp.config.target_file"},run_mode:{name:"run_mode",description:"The`RunMode`,representingthewayTemplaterwaslaunched(Createnewfromtemplate,Appendtoactivefile,...).",definition:"tp.config.run_mode"},active_file:{name:"active_file",description:"Theactivefile(ifexisting)whenlaunchingTemplater.",definition:"tp.config.active_file?"}}},date:{name:"date",description:"Thismodulecontainseveryinternalfunctionrelatedtodates.",functions:{now:{name:"now",description:"Retrievesthedate.",definition:'tp.date.now(format: string = "YYYY-MM-DD", offset?: number\u23AEstring, reference?: string, reference_format?: string)',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'},{name:"offset",description:"Durationtooffsetthedatefrom.Ifanumberisprovided,durationwillbeaddedtothedateindays.YoucanalsospecifytheoffsetasastringusingtheISO8601format."},{name:"reference",description:"Thedatereferential,e.g.setthistothenote's title."},{name:"reference_format",description:"The format for the reference date. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/)."}],examples:[{name:"Date now",example:"<% tp.date.now() %>"},{name:"Date now with format",example:'<%tp.date.now("Do MMMM YYYY")%>'},{name:"Last week",example:'<%tp.date.now("YYYY-MM-DD",-7)%>'},{name:"Next week",example:'<%tp.date.now("YYYY-MM-DD",7)%>'},{name:"Last month",example:'<%tp.date.now("YYYY-MM-DD","P-1M")%>'},{name:"Next year",example:'<%tp.date.now("YYYY-MM-DD","P1Y")%>'},{name:"File'stitledate+1day(tomorrow)",example:'<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>'},{name:"File's title date - 1 day (yesterday)",example:'<%tp.date.now("YYYY-MM-DD",-1,tp.file.title,"YYYY-MM-DD")%>'}]},tomorrow:{name:"tomorrow",description:"Retrieves tomorrow'sdate.",definition:'tp.date.tomorrow(format: string = "YYYY-MM-DD")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"Datetomorrow",example:"<%tp.date.tomorrow()%>"},{name:"Datetomorrowwithformat",example:'<% tp.date.tomorrow("DoMMMMYYYY") %>'}]},yesterday:{name:"yesterday",description:"Retrievesyesterday's date.",definition:'tp.date.yesterday(format:string="YYYY-MM-DD")',args:[{name:"format",description:'Theformatforthedate.Defaultsto`"YYYY-MM-DD"`.Referto[formatreference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"Date yesterday",example:"<% tp.date.yesterday() %>"},{name:"Date yesterday with format",example:'<% tp.date.yesterday("Do MMMM YYYY") %>'}]},weekday:{name:"weekday",description:"",definition:'tp.date.weekday(format: string = "YYYY-MM-DD", weekday: number, reference?: string, reference_format?: string)',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'},{name:"weekday",description:"Week day number. If the locale assigns Monday as the first day of the week, `0` will be Monday, `-7` will be last week's day."},{name:"reference",description:"The date referential, e.g. set this to the note's title."},{name:"reference_format",description:"The format for the reference date. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/)."}],examples:[{name:"This week's Monday",example:'<% tp.date.weekday("YYYY-MM-DD", 0) %>'},{name:"Next Monday",example:'<% tp.date.weekday("YYYY-MM-DD", 7) %>'},{name:"File's title Monday",example:'<% tp.date.weekday("YYYY-MM-DD", 0, tp.file.title, "YYYY-MM-DD") %>'},{nam
`}],examples:[{name:"File cursor",example:"<% tp.file.cursor() %>"},{name:"File multi-cursor",example:"<% tp.file.cursor(1) %>Content<% tp.file.cursor(1) %>"}]},cursor_append:{name:"cursor_append",description:"Appends some content after the active cursor in the file.",definition:"tp.file.cursor_append(content: string)",args:[{name:"content",description:"The content to append after the active cursor."}],examples:[{name:"File cursor append",example:'<% tp.file.cursor_append("Some text") %>'}]},exists:{name:"exists",description:"Check to see if a file exists by it's file path. The full path to the file, relative to the Vault and containing the extension, must be provided.",definition:"tp.file.exists(filepath: string)",args:[{name:"filepath",description:"The full file path of the file we want to check existence for."}],examples:[{name:"File existence",example:'<% await tp.file.exists("MyFolder/MyFile.md") %>'},{name:"File existence of current file",example:'<% await tp.file.exists(tp.file.folder(true) + "/" + tp.file.title + ".md") %>'}]},find_tfile:{name:"find_tfile",description:"Search for a file and returns its `TFile` instance.",definition:"tp.file.find_tfile(filename: string)",args:[{name:"filename",description:"The filename we want to search and resolve as a `TFile`."}],examples:[{name:"File find TFile",example:'<% tp.file.find_tfile("MyFile").basename %>'}]},folder:{name:"folder",description:"Retrieves the file's folder name.",definition:"tp.file.folder(absolute: boolean = false)",args:[{name:"absolute",description:"If set to `true`, returns the vault-absolute path of the folder. If `false`, only returns the basename of the folder (the last part). Defaults to `false`."}],examples:[{name:"File folder (Folder)",example:"<% tp.file.folder() %>"},{name:"File folder with vault-absolute path (Path/To/Folder)",example:"<% tp.file.folder(true) %>"}]},include:{name:"include",description:"Includes the file's link content. Templates in the included content will be resolved.",definition:"tp.file.include(include_link: string \u23AE TFile)",args:[{name:"include_link",description:'The link to the file to include, e.g. `"[[MyFile]]"`, or a TFile object. Also supports sections or blocks inclusions.'}],examples:[{name:"File include",example:'<% await tp.file.include("[[Template1]]") %>'},{name:"File include TFile",example:'<% await tp.file.include(tp.file.find_tfile("MyFile")) %>'},{name:"File include section",example:'<% await tp.file.include("[[MyFile#Section1]]") %>'},{name:"File include block",example:'<% await tp.file.include("[[MyFile#^block1]]") %>'}]},last_modified_date:{name:"last_modified_date",description:"Retrieves the file's last modification date.",definition:'tp.file.last_modified_date(format: string = "YYYY-MM-DD HH:mm")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD HH:mm"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"File last modified date",example:"<% tp.file.last_modified_date() %>"},{name:"File last modified date with format",example:'<% tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm") %>'}]},move:{name:"move",description:"Moves the file to the desired vault location.",definition:"tp.file.move(new_path: string, file_to_move?: TFile)",args:[{name:"new_path",description:'The new vault relative path of the file, without the file extension. Note: the new path needs to include the folder and the filename, e.g. `"/Notes/MyNote"`.'},{name:"file_to_move",description:"The file to move, defaults to the current file."}],examples:[{name:"File move",example:'<%* await tp.file.move("/A/B/" + tp.file.title) %>'},{name:"File move and rename",example:'<%* await tp.file.move("/A/B/NewTitle") %>'}]},path:{name:"path",description:"Retrieves the file's absolute path on the system.",definition:"tp.file.path(relative: boolean = false)",args:[{name:"relative",description:"If set to `true`, only retrieves the vault's relative path."}],examples:[{name:"File path",example:"<% tp.file.path() %>"},{name:"File relative path (relative to vault root)
let value = await tp.system.prompt("Please enter a value");
%>
# <% value %>
selected value: <% value %>`}]},suggester:{name:"suggester",description:"Spawns a suggester prompt and returns the user's chosen item.",definition:'tp.system.suggester(text_items: string[] \u23AE ((item: T) => string), items: T[], throw_on_cancel: boolean = false, placeholder: string = "", limit?: number = undefined)',args:[{name:"text_items",description:"Array of strings representing the text that will be displayed for each item in the suggester prompt. This can also be a function that maps an item to its text representation."},{name:"items",description:"Array containing the values of each item in the correct order."},{name:"throw_on_cancel",description:"Throws an error if the prompt is canceled, instead of returning a `null` value."},{name:"placeholder",description:"Placeholder string of the prompt."},{name:"limit",description:"Limit the number of items rendered at once (useful to improve performance when displaying large lists)."}],examples:[{name:"Suggester",example:'<% await tp.system.suggester(["Happy", "Sad", "Confused"], ["Happy", "Sad", "Confused"]) %>'},{name:"Suggester with mapping function (same as above example)",example:'<% await tp.system.suggester((item) => item, ["Happy", "Sad", "Confused"]) %>'},{name:"Suggester for files",example:"[[<% (await tp.system.suggester((item) => item.basename, tp.app.vault.getMarkdownFiles())).basename %>]]"},{name:"Suggester for tags",example:'<% await tp.system.suggester(item => item, Object.keys(tp.app.metadataCache.getTags()).map(x => x.replace("#", ""))) %>'},{name:"Reuse value from suggester",example:`<%*
let selectedValue = await tp.system.suggester(["Happy", "Sad", "Confused"], ["Happy", "Sad", "Confused"]);
%>
# <% selectedValue %>
selected value: <% selectedValue %>`}]},multi_suggester:{name:"multi_suggester",description:"Spawns a suggester prompt that supports selecting multiple items and returns the user's chosen items.",definition:'tp.system.multi_suggester(text_items: string[] \u23AE ((item: T) => string), items: T[], throw_on_cancel: boolean = false, title: string = "", limit?: number = undefined)',args:[{name:"text_items",description:"Array of strings representing the text that will be displayed for each item in the suggester prompt. This can also be a function that maps an item to its text representation."},{name:"items",description:"Array containing the values of each item in the correct order."},{name:"throw_on_cancel",description:"Throws an error if the prompt is canceled, instead of returning a `null` value."},{name:"title",description:"Text placed at the top of the modal."},{name:"limit",description:"Limit the number of items rendered at once (useful to improve performance when displaying large lists)."}],examples:[{name:"Multi-suggester",example:'<% await tp.system.multi_suggester(["Happy", "Sad", "Confused"], ["Happy", "Sad", "Confused"]) %>'},{name:"Multi-suggester with mapping function (same as above example)",example:'<% await tp.system.multi_suggester((item) => item, ["Happy", "Sad", "Confused"]) %>'},{name:"Multi-suggester for files",example:"<% (await tp.system.multi_suggester((item) => item.basename, tp.app.vault.getMarkdownFiles())).map(f => `[[${f.basename}]]`) %>"},{name:"Multi-suggester for tags",example:'<% await tp.system.multi_suggester(item => item, Object.keys(tp.app.metadataCache.getTags()).map(x => x.replace("#", ""))) %>'},{name:"Reuse value from multi-suggester",example:`<%*
let selectedValues = await tp.system.multi_suggester(["Happy", "Sad", "Confused"], ["Happy", "Sad", "Confused"]);
selected values: <% selectedValues %>`}]}}},web:{name:"web",description:"This modules contains every internal function related to the web (making web requests).",functions:{daily_quote:{name:"daily_quote",description:"Retrieves and parses the daily quote from `https://github.com/Zachatoo/quotes-database` as a callout.",definition:"tp.web.daily_quote()",examples:[{name:"Daily quote",example:"<% await tp.web.daily_quote() %>"}]},random_picture:{name:"random_picture",description:"Gets a random image from `https://unsplash.com/`.",definition:"tp.web.random_picture(size?: string, query?: string, include_size?: boolean)",args:[{name:"size",description:"Image size in the format `<width>x<height>`."},{name:"query",description:"Limits selection to photos matching a search term. Multiple search terms can be passed separated by a comma."},{name:"include_size",description:"Optional argument to include the specified size in the image link markdown. Defaults to false."}],examples:[{name:"Random picture",example:"<% await tp.web.random_picture() %>"},{name:"Random picture with size",example:'<% await tp.web.random_picture("200x200") %>'},{name:"Random picture with size and query",example:'<% await tp.web.random_picture("200x200", "landscape,water") %>'}]},request:{name:"request",description:"Makes a HTTP request to the specified URL. Optionally, you can specify a path to extract specific data from the response.",definition:"tp.web.request(url: string, path?: string)",args:[{name:"url",description:"The URL to which the HTTP request will be made."},{name:"path",description:"A path within the response JSON to extract specific data."}],examples:[{name:"Simple request",example:'<% await tp.web.request("https://jsonplaceholder.typicode.com/todos/1") %>'},{name:"Request with path",example:'<% await tp.web.request("https://jsonplaceholder.typicode.com/todos", "0.title") %>'}]}}}},Xo={tp:ec};vartc=["app","config","date","file","frontmatter","hooks","obsidian","system","user","web"],nc=newSet(tc);functionZo(n){returntypeofn=="string"&&nc.has(n)}functionDi(n){return!!(n.definition||n.returns||n.args)}varPi=class{constructor(e){this.plugin=e;this.documentation=Xo}get_all_modules_documentation(){lete=this.documentation.tp;return(!this.plugin.settings||!this.plugin.settings.user_scripts_folder)&&(e=Object.values(e).filter(t=>t.name!=="user")),Object.values(e).map(t=>(t.queryKey=t.name,t))}asyncget_all_functions_documentation(e,t){if(e==="app")returnthis.get_app_functions_documentation(this.plugin.app,t);if(e==="user"){if(!this.plugin.settings||!this.plugin.settings.user_scripts_folder)return;letr=awaitSe(async()=>{leti=Je(this.plugin.app,this.plugin.settings.user_scripts_folder).filter(a=>a.extension=="js");returnawaitso(this.plugin.app,i)},"User Scripts folder doesn't exist");return!r||r.length===0?void0:r.reduce((i,o)=>o.extension!=="js"?i:[...i,{name:o.basename,queryKey:o.basename,definition:"",description:o.description,returns:o.returns,args:o.arguments.reduce((l,c)=>(l[c.name]={name:c.name,description:c.description},l),{}),example:""}],[])}if(!!this.documentation.tp[e].functions)returnObject.values(this.documentation.tp[e].functions).map(r=>(r.queryKey=r.name,r))}get_app_functions_documentation(e,t){if(!xn(e))return[];letr=t.split(".");if(r.length===0)return[];leti=e;for(letc=0;c<r.length-1;c++){letd=r[c];if(dini){if(!xn(i[d]))return[];i=i[d]}}leto=["tp","app",...r.slice(0,r.length-1)].join("."),a=r.slice(0,r.length-1).join("."),l=[];for(letcini){letd=`${o}.${c}`,m=a?`${a}.${c}`:c;l.push({name:c,queryKey:m,definition:typeofi[c]=="function"?`${d}(${lo(i[c])})`:d,description:"",returns:"",example:""})}returnl}get_module_documentation(e){returnthis.documentation.tp[e]}get_function_documentation(e,t){returnthis.documentation.tp[e].functions[t]}get_argument_documentation(e,t,r){leti=this.get_function_documentation(e,t);return!i||!i.args?null:i.args[r]}};varNi=classextendsea.EditorSuggest{constructor(e){super(e.app);this.tp_keyword_regex=/tp\.(?<module>[a-z]*)?(?<fn_trigger>\.(?<fn>[a-zA-Z_.]*)?)?$/;this.documenta