modernleft-docs/.obsidian/plugins/obsidian-linter/main.js

325 lines
673 KiB
JavaScript
Raw Normal View History

2025-01-17 01:48:51 +00:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var mf=Object.create;var or=Object.defineProperty;var ou=Object.getOwnPropertyDescriptor;var ff=Object.getOwnPropertyNames;var gf=Object.getPrototypeOf,hf=Object.prototype.hasOwnProperty;var Tn=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),su=(e,n)=>{for(var t in n)or(e,t,{get:n[t],enumerable:!0})},lu=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ff(n))!hf.call(e,r)&&r!==t&&or(e,r,{get:()=>n[r],enumerable:!(i=ou(n,r))||i.enumerable});return e};var Cn=(e,n,t)=>(t=e!=null?mf(gf(e)):{},lu(n||!e||!e.__esModule?or(t,"default",{value:e,enumerable:!0}):t,e)),yf=e=>lu(or({},"__esModule",{value:!0}),e),L=(e,n,t,i)=>{for(var r=i>1?void 0:i?ou(n,t):n,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(i?o(n,t,r):o(r))||r);return i&&r&&or(n,t,r),r};var Gs=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var Y=(e,n,t)=>(Gs(e,n,"read from private field"),t?t.call(e):n.get(e)),xe=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)},Fe=(e,n,t,i)=>(Gs(e,n,"write to private field"),i?i.call(e,t):n.set(e,t),t);var Zs=(e,n,t,i)=>({set _(r){Fe(e,n,r,t)},get _(){return Y(e,n,i)}}),me=(e,n,t)=>(Gs(e,n,"access private method"),t);var so=Tn((Ju,oo)=>{(function(e,n){"use strict";typeof define=="function"&&define.amd?define(n):typeof oo=="object"&&oo.exports?oo.exports=n():e.log=n()})(Ju,function(){"use strict";var e=function(){},n="undefined",t=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],r={},a=null;function o(f,b){var h=f[b];if(typeof h.bind=="function")return h.bind(f);try{return Function.prototype.bind.call(h,f)}catch{return function(){return Function.prototype.apply.apply(h,[f,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(f){return f==="debug"&&(f="log"),typeof console===n?!1:f==="trace"&&t?s:console[f]!==void 0?o(console,f):console.log!==void 0?o(console,"log"):e}function c(){for(var f=this.getLevel(),b=0;b<i.length;b++){var h=i[b];this[h]=b<f?e:this.methodFactory(h,f,this.name)}if(this.log=this.debug,typeof console===n&&f<this.levels.SILENT)return"No console available for logging"}function u(f){return function(){typeof console!==n&&(c.call(this),this[f].apply(this,arguments))}}function d(f,b,h){return l(f)||u.apply(this,arguments)}function m(f,b){var h=this,k,A,S,T="loglevel";typeof f=="string"?T+=":"+f:typeof f=="symbol"&&(T=void 0);function M(z){var V=(i[z]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=V;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+V+";"}catch{}}}function E(){var z;if(!(typeof window===n||!T)){try{z=window.localStorage[T]}catch{}if(typeof z===n)try{var V=window.document.cookie,$=encodeURIComponent(T),D=V.indexOf($+"=");D!==-1&&(z=/^([^;]+)/.exec(V.slice(D+$.length+1))[1])}catch{}return h.levels[z]===void 0&&(z=void 0),z}}function O(){if(!(typeof window===n||!T)){try{window.localStorage.removeItem(T)}catch{}try{window.document.cookie=encodeURIComponent(T)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function N(z){var V=z;if(typeof V=="string"&&h.levels[V.toUpperCase()]!==void 0&&(V=h.levels[V.toUpperCase()]),typeof V=="number"&&V>=0&&V<=h.levels.SILENT)return V;throw new TypeError("log.setLevel() called with invalid level: "+z)}h.name=f,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=b||d,h.getLevel=function(){return S??A??k},h.setLevel=function(z,V){return S=N(z),V!==!1&&M(S),c.call(h)},h.setDefaultLevel=function(z){A=N(z),E()||h.setLevel(z,!1)},h.resetLevel=function(){S=null,O(),c.call(h)},h.enableAll=function(z){h.setLevel(h.levels.TRACE,z)},h.disableAll=function(z){h.setLevel(h.levels.SILENT,z)},h.rebuild=function(){if(a!==h&&(k=N(a.getLevel())),c.call(h),a===h)for(var z in r)r[z].rebuild()},k=N(a?a.getLevel():"WARN");var B=E();B!=null&&(S=N(B)),c.call(h)}a=new m,a.getLogger=f
`,u),d==-1&&(d=l.length-1);var p=l.substring(u,d+1);(i.hasOwnProperty?i.hasOwnProperty(p):i[p]!==void 0)?c+=String.fromCharCode(i[p]):(m==a&&(p=l.substring(u),d=l.length),c+=String.fromCharCode(m),i[p]=m,t[m++]=p),u=d+1}return c}var a=4e4,o=r(e);a=65535;var s=r(n);return{chars1:o,chars2:s,lineArray:t}};I.prototype.diff_charsToLines_=function(e,n){for(var t=0;t<e.length;t++){for(var i=e[t][1],r=[],a=0;a<i.length;a++)r[a]=n[i.charCodeAt(a)];e[t][1]=r.join("")}};I.prototype.diff_commonPrefix=function(e,n){if(!e||!n||e.charAt(0)!=n.charAt(0))return 0;for(var t=0,i=Math.min(e.length,n.length),r=i,a=0;t<r;)e.substring(a,r)==n.substring(a,r)?(t=r,a=t):i=r,r=Math.floor((i-t)/2+t);return r};I.prototype.diff_commonSuffix=function(e,n){if(!e||!n||e.charAt(e.length-1)!=n.charAt(n.length-1))return 0;for(var t=0,i=Math.min(e.length,n.length),r=i,a=0;t<r;)e.substring(e.length-r,e.length-a)==n.substring(n.length-r,n.length-a)?(t=r,a=t):i=r,r=Math.floor((i-t)/2+t);return r};I.prototype.diff_commonOverlap_=function(e,n){var t=e.length,i=n.length;if(t==0||i==0)return 0;t>i?e=e.substring(t-i):t<i&&(n=n.substring(0,t));var r=Math.min(t,i);if(e==n)return r;for(var a=0,o=1;;){var s=e.substring(r-o),l=n.indexOf(s);if(l==-1)return a;o+=l,(l==0||e.substring(r-o)==n.substring(0,o))&&(a=o,o++)}};I.prototype.diff_halfMatch_=function(e,n){if(this.Diff_Timeout<=0)return null;var t=e.length>n.length?e:n,i=e.length>n.length?n:e;if(t.length<4||i.length*2<t.length)return null;var r=this;function a(f,b,h){for(var k=f.substring(h,h+Math.floor(f.length/4)),A=-1,S="",T,M,E,O;(A=b.indexOf(k,A+1))!=-1;){var N=r.diff_commonPrefix(f.substring(h),b.substring(A)),B=r.diff_commonSuffix(f.substring(0,h),b.substring(0,A));S.length<B+N&&(S=b.substring(A-B,A)+b.substring(A,A+N),T=f.substring(0,h-B),M=f.substring(h+N),E=b.substring(0,A-B),O=b.substring(A+N))}return S.length*2>=f.length?[T,M,E,O,S]:null}var o=a(t,i,Math.ceil(t.length/4)),s=a(t,i,Math.ceil(t.length/2)),l;if(!o&&!s)return null;s?o?l=o[4].length>s[4].length?o:s:l=s:l=o;var c,u,d,m;e.length>n.length?(c=l[0],u=l[1],d=l[2],m=l[3]):(d=l[0],m=l[1],c=l[2],u=l[3]);var p=l[4];return[c,u,d,m,p]};I.prototype.diff_cleanupSemantic=function(e){for(var n=!1,t=[],i=0,r=null,a=0,o=0,s=0,l=0,c=0;a<e.length;)e[a][0]==G?(t[i++]=a,o=l,s=c,l=0,c=0,r=e[a][1]):(e[a][0]==oe?l+=e[a][1].length:c+=e[a][1].length,r&&r.length<=Math.max(o,s)&&r.length<=Math.max(l,c)&&(e.splice(t[i-1],0,new I.Diff(ie,r)),e[t[i-1]+1][0]=oe,i--,i--,a=i>0?t[i-1]:-1,o=0,s=0,l=0,c=0,r=null,n=!0)),a++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(e[a-1][0]==ie&&e[a][0]==oe){var u=e[a-1][1],d=e[a][1],m=this.diff_commonOverlap_(u,d),p=this.diff_commonOverlap_(d,u);m>=p?(m>=u.length/2||m>=d.length/2)&&(e.splice(a,0,new I.Diff(G,d.substring(0,m))),e[a-1][1]=u.substring(0,u.length-m),e[a+1][1]=d.substring(m),a++):(p>=u.length/2||p>=d.length/2)&&(e.splice(a,0,new I.Diff(G,u.substring(0,p))),e[a-1][0]=oe,e[a-1][1]=d.substring(0,d.length-p),e[a+1][0]=ie,e[a+1][1]=u.substring(p),a++),a++}a++}};I.prototype.diff_cleanupSemanticLossless=function(e){function n(p,f){if(!p||!f)return 6;var b=p.charAt(p.length-1),h=f.charAt(0),k=b.match(I.nonAlphaNumericRegex_),A=h.match(I.nonAlphaNumericRegex_),S=k&&b.match(I.whitespaceRegex_),T=A&&h.match(I.whitespaceRegex_),M=S&&b.match(I.linebreakRegex_),E=T&&h.match(I.linebreakRegex_),O=M&&p.match(I.blanklineEndRegex_),N=E&&f.match(I.blanklineStartRegex_);return O||N?5:M||E?4:k&&!S&&T?3:S||T?2:k||A?1:0}for(var t=1;t<e.length-1;){if(e[t-1][0]==G&&e[t+1][0]==G){var i=e[t-1][1],r=e[t][1],a=e[t+1][1],o=this.diff_commonSuffix(i,r);if(o){var s=r.substring(r.length-o);i=i.substring(0,i.length-o),r=s+r.substring(0,r.length-o),a=s+a}for(var l=i,c=r,u=a,d=n(i,r)+n(r,a);r.charAt(0)===a.charAt(0);){i+=r.charAt(0),r=r.substring(1)+a.charAt(0),a=a.substring(1);var m=n(i,r)+n(r,a);m>=d&&(d=m,l=i,c=r,u=a)}e[t-1][1]!=l&&(l?e[t-1][1]=l:(e.splice(t-1,1),t--),e[t][1]=c,u?e[t+1][1]=u:(e.splice(t+1,1),t--))}t++}};I.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;I.whitespaceRegex_=/\s/;I.linebreakRegex_=/[\r\n]/;I.blanklineEnd
`),i=0,r=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;i<t.length;){var a=t[i].match(r);if(!a)throw new Error("Invalid patch string: "+t[i]);var o=new I.patch_obj;for(n.push(o),o.start1=parseInt(a[1],10),a[2]===""?(o.start1--,o.length1=1):a[2]=="0"?o.length1=0:(o.start1--,o.length1=parseInt(a[2],10)),o.start2=parseInt(a[3],10),a[4]===""?(o.start2--,o.length2=1):a[4]=="0"?o.length2=0:(o.start2--,o.length2=parseInt(a[4],10)),i++;i<t.length;){var s=t[i].charAt(0);try{var l=decodeURI(t[i].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+l)}if(s=="-")o.diffs.push(new I.Diff(ie,l));else if(s=="+")o.diffs.push(new I.Diff(oe,l));else if(s==" ")o.diffs.push(new I.Diff(G,l));else{if(s=="@")break;if(s!=="")throw new Error('Invalid patch mode "'+s+'" in: '+l)}i++}}return n};I.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0};I.patch_obj.prototype.toString=function(){var e,n;this.length1===0?e=this.start1+",0":this.length1==1?e=this.start1+1:e=this.start1+1+","+this.length1,this.length2===0?n=this.start2+",0":this.length2==1?n=this.start2+1:n=this.start2+1+","+this.length2;for(var t=["@@ -"+e+" +"+n+` @@
`],i,r=0;r<this.diffs.length;r++){switch(this.diffs[r][0]){case oe:i="+";break;case ie:i="-";break;case G:i=" ";break}t[r+1]=i+encodeURI(this.diffs[r][1])+`
`}return t.join("").replace(/%20/g," ")};ji.exports=I;ji.exports.diff_match_patch=I;ji.exports.DIFF_DELETE=ie;ji.exports.DIFF_INSERT=oe;ji.exports.DIFF_EQUAL=G});var _m=Tn((p_,Ym)=>{Ym.exports=hA;var pw=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],mw=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fw=["Su","Mo","Tu","We","Th","Fr","Sa"],Ms=["January","February","March","April","May","June","July","August","September","October","November","December"],gw=["ACDT","ACST","ACWT","ADT","ACT","AEDT","AEST","AFT","AKDT","AKST","ALMT","AMT","AMST","ANAT","ANAST","AQTT","ART","AST","AWDT","AWST","AZOT","AZOST","AZT","AZST","BNT","BDT","BOT","BRT","BRST","BST","BTT","B","CAST","CAT","CCT","CDT","CEDT","CEST","CET","CHADT","CHAST","CHOT","CHOST","CHsT","CHUT","CIT","CKT","CLST","CLT","COT","CST","CVT","CWST","CXT","C","DAVT","DDUT","DST","EASST","EAST","EAT","ECT","EDT","EEDT","EEST","EET","EGT","EGST","EST","E","EIT","FET","FJT","FJST","FKST","FKT","FNT","F","GALT","GAMT","GET","GFT","GILT","GMT","GST","GYT","G","HADT","HAST","HKT","HOVT","HOVST","HST","ICT","IDT","IOT","IRDT","IRKT","IRKST","IRST","IST","JST","KGT","KOST","KRAT","KRAST","KST","KUYT","LHDT","LHST","LINT","L","MAGT","MAGST","MART","MAWT","MDT","MeST","MHT","MIST","MMT","MSD","MSK","MST","MUT","MVT","MYT","NCT","NDT","NFT","N","NOVT","NOVST","NPT","NRT","NST","NT","NUT","NZDT","NZST","OMST","OMSST","ORAT","O","PDT","PET","PETT","PETST","PGT","PHT","PHOT","PKT","PMDT","PMST","PONT","PST","PWT","PYT","PYST","P","QYZT","RET","ROTT","R","SAKT","SAMT","SAST","SBT","SCT","SGT","SRT","SLT","SLST","SRET","SST","SYOT","TAHT","TFT","TJT","TKT","TLT","TMT","TOT","TRUT","TVT","T","ULAT","ULAST","UTC","UYST","UYT","UZT","U","VET","VLAT","VLAST","VOLT","VUT","V","WAKT","WAT","WAST","WDT","WEDT","WEST","WET","WFT","WGT","WGST","WIB","WIT","WITA","WST","WT","YAKT","YAKST","YAP","YEK","YEKS"],Is=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hw=new RegExp(pw.join("|"),"i"),yw=new RegExp(mw.join("|"),"i"),bw=new RegExp("\\b("+fw.join("|")+")\\b","i"),vw=new RegExp(Ms.join("|"),"i"),kw=new RegExp(Is.join("|"),"i"),ww=new RegExp("\\b("+gw.join("|")+")\\b","i"),Aw=/(\d+)(st|nd|rd|th)\b/i,xw=/(\d{1,4})([/.-])(\d{1,2})[/.-](\d{1,4})/,Lw=/((\+|-)(12:00|11:00|10:00|09:30|09:00|08:00|07:00|06:00|05:00|04:00|03:30|03:00|02:00|01:00|00:00|01:00|02:00|03:00|03:30|04:00|04:30|05:00|05:30|05:45|06:00|06:30|07:00|08:00|08:45|09:00|09:30|10:00|10:30|11:00|12:00|12:45|13:00|14:00))$/,Sw=/((\+|-)(1200|1100|1000|0930|0900|0800|0700|0600|0500|0400|0330|0300|0200|0100|0000|0100|0200|0300|0330|0400|0430|0500|0530|0545|0600|0630|0700|0800|0845|0900|0930|1000|1030|1100|1200|1245|1300|1400))$/,Ji="("+["AM?","PM?"].join("|")+")",Ew=new RegExp("0\\d\\:\\d{1,2}\\:\\d{1,2}(\\s*)"+Ji,"i"),Tw=new RegExp("0\\d\\:\\d{1,2}(\\s*)"+Ji,"i"),Cw=new RegExp("0\\d(\\s*)"+Ji,"i"),Ow=new RegExp("\\d{1,2}\\:\\d{1,2}\\:\\d{1,2}(\\s*)"+Ji,"i"),Mw=new RegExp("\\d{1,2}\\:\\d{1,2}(\\s*)"+Ji,"i"),Iw=new RegExp("\\d{1,2}(\\s*)"+Ji,"i"),Fw=new RegExp("\\d{1,2}"),Rw=new RegExp(Ms.join("|")+"-\\d{2}","i"),Bw=new RegExp(Is.join("|")+"-\\d{2}","i"),Xc=new RegExp("(\\d{1,2})(\\D+)("+Ms.join("|")+"|"+Is.join("|")+")(\\2)('?\\d{2,4})"),Dw=/\d{2}:\d{2}:\d{2}\.\d{3}/,Kw=/\d{2}:\d{2}:\d{2}\.\d{2}/,zw=/\d{2}:\d{2}:\d{2}\.\d{1}/,Nw=/T\d{2}:\d{2}:\d{2}/,Yw=/0\d:\d{2}:\d{2}/,_w=/0\d:\d{2}/,Pw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}/,Hw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{3}/,qw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{2}/,Uw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{1}/,Ww=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]/,Vw=/24:00:\d{2}/,jw=/24:00:\d{2}\.\d{3}/,$w=/24:00:\d{2}\.\d{2}/,Gw=/24:00:\d{2}\.\d{1}/,Zw=/24:00/,Qw=/\d{4}/,Jw=/\d{2}/,Xw=/'\d{2}/,Bm=/0\d/,Dm=/\d{1,2}/,eA=/0\d/,tA=/\d{1,2}/,nA=/^([1-9])\/([1-9]|0[1-9])$/,iA=/^([1-9])\/(1[012])$/,rA=/^(0[1-9]|[12][0-9]|3[01])\/([1-9])$/,aA=/^(0[1-9]|[12][0-9]|3[01])\/(1[012]|0[1-9])$/,oA=/^([1-9])(\D)([1-9][0-9])$/,sA=/^([1-9])(\D)([0][0-9])$/,lA=/^(0[1-9]|1[012])(\D)([1-9][0-9])$/,cA=/^(0[1-9]|1[012])(\D)([0][0-9])$/,eu=/([/][M]|[M][/]|[MM]|[M
`+e.mark.snippet),i+" "+t):i}function lr(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Su(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}lr.prototype=Object.create(Error.prototype);lr.prototype.constructor=lr;lr.prototype.toString=function(n){return this.name+": "+Su(this,n)};var Ge=lr;function Qs(e,n,t,i,r){var a="",o="",s=Math.floor(r/2)-1;return i-n>s&&(a=" ... ",n=i-s+a.length),t-i>s&&(o=" ...",t=i+s-o.length),{str:a+e.slice(n,t).replace(/\t/g,"\u2192")+o,pos:i-n+a.length}}function Js(e,n){return Ee.repeat(" ",n-e.length)+e}function Of(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var t=/\r?\n|\r|\0/g,i=[0],r=[],a,o=-1;a=t.exec(e.buffer);)r.push(a.index),i.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var s="",l,c,u=Math.min(e.line+n.linesAfter,r.length).toString().length,d=n.maxLength-(n.indent+u+3);for(l=1;l<=n.linesBefore&&!(o-l<0);l++)c=Qs(e.buffer,i[o-l],r[o-l],e.position-(i[o]-i[o-l]),d),s=Ee.repeat(" ",n.indent)+Js((e.line-l+1).toString(),u)+" | "+c.str+`
`+s;for(c=Qs(e.buffer,i[o],r[o],e.position,d),s+=Ee.repeat(" ",n.indent)+Js((e.line+1).toString(),u)+" | "+c.str+`
`,s+=Ee.repeat("-",n.indent+u+3+c.pos)+`^
`,l=1;l<=n.linesAfter&&!(o+l>=r.length);l++)c=Qs(e.buffer,i[o+l],r[o+l],e.position-(i[o]-i[o+l]),d),s+=Ee.repeat(" ",n.indent)+Js((e.line+l+1).toString(),u)+" | "+c.str+`
`;return s.replace(/\n$/,"")}var Mf=Of,If=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ff=["scalar","sequence","mapping"];function Rf(e){var n={};return e!==null&&Object.keys(e).forEach(function(t){e[t].forEach(function(i){n[String(i)]=t})}),n}function Bf(e,n){if(n=n||{},Object.keys(n).forEach(function(t){if(If.indexOf(t)===-1)throw new Ge('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(t){return t},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Rf(n.styleAliases||null),Ff.indexOf(this.kind)===-1)throw new Ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ue=Bf;function cu(e,n){var t=[];return e[n].forEach(function(i){var r=t.length;t.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&a.multi===i.multi&&(r=o)}),t[r]=i}),t}function Df(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,t;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(n=0,t=arguments.length;n<t;n+=1)arguments[n].forEach(i);return e}function el(e){return this.extend(e)}el.prototype.extend=function(n){var t=[],i=[];if(n instanceof Ue)i.push(n);else if(Array.isArray(n))i=i.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(t=t.concat(n.implicit)),n.explicit&&(i=i.concat(n.explicit));else throw new Ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(a){if(!(a instanceof Ue))throw new Ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new Ge("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new Ge("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(a){if(!(a instanceof Ue))throw new Ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(el.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=cu(r,"implicit"),r.compiledExplicit=cu(r,"explicit"),r.compiledTypeMap=Df(r.compiledImplicit,r.compiledExplicit),r};var Kf=el,zf=new Ue("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Nf=new Ue("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Yf=new Ue("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),_f=new Kf({explicit:[zf,Nf,Yf]});function Pf(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function Hf(){return null}function qf(e){return e===null}var Uf=new Ue("tag:yaml.org,2002:null",{kind:"scalar",resolve:Pf,construct:Hf,predicate:qf,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Wf(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function Vf(e){return e==="true"||e==="True"||e==="TRUE"}function jf(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var $f=new Ue("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Wf,construct:Vf,predicate:jf,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});functio
\r`;function yg(e){if(e===null)return!1;var n,t,i=0,r=e.length,a=al;for(t=0;t<r;t++)if(n=a.indexOf(e.charAt(t)),!(n>64)){if(n<0)return!1;i+=6}return i%8===0}function bg(e){var n,t,i=e.replace(/[\r\n=]/g,""),r=i.length,a=al,o=0,s=[];for(n=0;n<r;n++)n%4===0&&n&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(i.charAt(n));return t=r%4*6,t===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):t===18?(s.push(o>>10&255),s.push(o>>2&255)):t===12&&s.push(o>>4&255),new Uint8Array(s)}function vg(e){var n="",t=0,i,r,a=e.length,o=al;for(i=0;i<a;i++)i%3===0&&i&&(n+=o[t>>18&63],n+=o[t>>12&63],n+=o[t>>6&63],n+=o[t&63]),t=(t<<8)+e[i];return r=a%3,r===0?(n+=o[t>>18&63],n+=o[t>>12&63],n+=o[t>>6&63],n+=o[t&63]):r===2?(n+=o[t>>10&63],n+=o[t>>4&63],n+=o[t<<2&63],n+=o[64]):r===1&&(n+=o[t>>2&63],n+=o[t<<4&63],n+=o[64],n+=o[64]),n}function kg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var wg=new Ue("tag:yaml.org,2002:binary",{kind:"scalar",resolve:yg,construct:bg,predicate:kg,represent:vg}),Ag=Object.prototype.hasOwnProperty,xg=Object.prototype.toString;function Lg(e){if(e===null)return!0;var n=[],t,i,r,a,o,s=e;for(t=0,i=s.length;t<i;t+=1){if(r=s[t],o=!1,xg.call(r)!=="[object Object]")return!1;for(a in r)if(Ag.call(r,a))if(!o)o=!0;else return!1;if(!o)return!1;if(n.indexOf(a)===-1)n.push(a);else return!1}return!0}function Sg(e){return e!==null?e:[]}var Eg=new Ue("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Lg,construct:Sg}),Tg=Object.prototype.toString;function Cg(e){if(e===null)return!0;var n,t,i,r,a,o=e;for(a=new Array(o.length),n=0,t=o.length;n<t;n+=1){if(i=o[n],Tg.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;a[n]=[r[0],i[r[0]]]}return!0}function Og(e){if(e===null)return[];var n,t,i,r,a,o=e;for(a=new Array(o.length),n=0,t=o.length;n<t;n+=1)i=o[n],r=Object.keys(i),a[n]=[r[0],i[r[0]]];return a}var Mg=new Ue("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Cg,construct:Og}),Ig=Object.prototype.hasOwnProperty;function Fg(e){if(e===null)return!0;var n,t=e;for(n in t)if(Ig.call(t,n)&&t[n]!==null)return!1;return!0}function Rg(e){return e!==null?e:{}}var Bg=new Ue("tag:yaml.org,2002:set",{kind:"mapping",resolve:Fg,construct:Rg}),Cu=ug.extend({implicit:[fg,hg],explicit:[wg,Eg,Mg,Bg]}),nn=Object.prototype.hasOwnProperty,eo=1,Ou=2,Mu=3,to=4,Xs=1,Dg=2,uu=3,Kg=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zg=/[\x85\u2028\u2029]/,Ng=/[,\[\]\{\}]/,Iu=/^(?:!|!!|![a-z\-]+!)$/i,Fu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function du(e){return Object.prototype.toString.call(e)}function It(e){return e===10||e===13}function Mn(e){return e===9||e===32}function tt(e){return e===9||e===32||e===10||e===13}function Ei(e){return e===44||e===91||e===93||e===123||e===125}function Yg(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function _g(e){return e===120?2:e===117?4:e===85?8:0}function Pg(e){return 48<=e&&e<=57?e-48:-1}function pu(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Hg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Ru=new Array(256),Bu=new Array(256);for(On=0;On<256;On++)Ru[On]=pu(On)?1:0,Bu[On]=pu(On);var On;function qg(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Cu,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Du(e,n){var t={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return t.snippet=Mf(t),new Ge(n,t)}function _(e,n){throw Du(e,n)}function no(e,n){e.onWarning&&e.onWarning.call(null,Du(e,n))}var mu={YAML:function(n,t,i){var r,a,o;n.version!==null&&_(n,"duplication of %YAML directive"),i.length!==1&&_(n,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&_(n,"ill-formed argument of the YAML directive"),a=parseInt(r[1],10),o=parseInt(r[2],10),a!==1&&_(n,"unacceptable YAML version of the document"),n.version=i[0],n.checkLineBreaks=o<2,o!==1&&o!==2&&no(n,"unsupported YAML version of the document")},TAG:function(n,t,i){var r,a;i.length!==2&&_(n,"TAG directive accepts exactly two arguments"),r=i[0],a=i[1],Iu.test(r)||_(n,"ill-formed tag handle (first argument) of the TAG directive"),nn.call(n.tagMap,r)&&_(n,'there is a previously declared suffix for "'+r+'" tag handle'),Fu.test(a)||_(n,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{_(n,"tag prefix is malformed: "+a)}n.tagMap[r]=a}};function tn(e,n,t,i){var r,a,o,s;if(n<t){if(s=e.input.slice(n,t),i)for(r=0,a=s.length;r<a;r+=1)o=s.charCodeAt(r),o===9||32<=o&&o<=1114111||_(e,"expected valid JSON character");else Kg.test(s)&&_(e,"the stream contains non-printable characters");e.result+=s}}function fu(e,n,t,i){var r,a,o,s;for(Ee.isObject(t)||_(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(t),o=0,s=r.length;o<s;o+=1)a=r[o],nn.call(n,a)||(n[a]=t[a],i[a]=!0)}function Ti(e,n,t,i,r,a,o,s,l){var c,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,u=r.length;c<u;c+=1)Array.isArray(r[c])&&_(e,"nested arrays are not supported inside keys"),typeof r=="object"&&du(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&du(r)==="[object Object]"&&(r="[object Object]"),r=String(r),n===null&&(n={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(c=0,u=a.length;c<u;c+=1)fu(e,n,a[c],t);else fu(e,n,a,t);else!e.json&&!nn.call(t,r)&&nn.call(n,r)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,_(e,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(n,r,{configurable:!0,enumerable:!0,writable:!0,value:a}):n[r]=a,delete t[r];return n}function ol(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):_(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Le(e,n,t){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;Mn(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(n&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(It(r))for(ol(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return t!==-1&&i!==0&&e.lineIndent<t&&no(e,"deficient indentation"),i}function ao(e){var n=e.position,t;return t=e.input.charCodeAt(n),!!((t===45||t===46)&&t===e.input.charCodeAt(n+1)&&t===e.input.charCodeAt(n+2)&&(n+=3,t=e.input.charCodeAt(n),t===0||tt(t)))}function sl(e,n){n===1?e.result+=" ":n>1&&(e.result+=Ee.rep
`,n-1))}function Ug(e,n,t){var i,r,a,o,s,l,c,u,d=e.kind,m=e.result,p;if(p=e.input.charCodeAt(e.position),tt(p)||Ei(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(r=e.input.charCodeAt(e.position+1),tt(r)||t&&Ei(r)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;p!==0;){if(p===58){if(r=e.input.charCodeAt(e.position+1),tt(r)||t&&Ei(r))break}else if(p===35){if(i=e.input.charCodeAt(e.position-1),tt(i))break}else{if(e.position===e.lineStart&&ao(e)||t&&Ei(p))break;if(It(p))if(l=e.line,c=e.lineStart,u=e.lineIndent,Le(e,!1,-1),e.lineIndent>=n){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=u;break}}s&&(tn(e,a,o,!1),sl(e,e.line-l),a=o=e.position,s=!1),Mn(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return tn(e,a,o,!1),e.result?!0:(e.kind=d,e.result=m,!1)}function Wg(e,n){var t,i,r;if(t=e.input.charCodeAt(e.position),t!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(t=e.input.charCodeAt(e.position))!==0;)if(t===39)if(tn(e,i,e.position,!0),t=e.input.charCodeAt(++e.position),t===39)i=e.position,e.position++,r=e.position;else return!0;else It(t)?(tn(e,i,r,!0),sl(e,Le(e,!1,n)),i=r=e.position):e.position===e.lineStart&&ao(e)?_(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);_(e,"unexpected end of the stream within a single quoted scalar")}function Vg(e,n){var t,i,r,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,t=i=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return tn(e,t,e.position,!0),e.position++,!0;if(s===92){if(tn(e,t,e.position,!0),s=e.input.charCodeAt(++e.position),It(s))Le(e,!1,n);else if(s<256&&Ru[s])e.result+=Bu[s],e.position++;else if((o=_g(s))>0){for(r=o,a=0;r>0;r--)s=e.input.charCodeAt(++e.position),(o=Yg(s))>=0?a=(a<<4)+o:_(e,"expected hexadecimal character");e.result+=Hg(a),e.position++}else _(e,"unknown escape sequence");t=i=e.position}else It(s)?(tn(e,t,i,!0),sl(e,Le(e,!1,n)),t=i=e.position):e.position===e.lineStart&&ao(e)?_(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}_(e,"unexpected end of the stream within a double quoted scalar")}function jg(e,n){var t=!0,i,r,a,o=e.tag,s,l=e.anchor,c,u,d,m,p,f=Object.create(null),b,h,k,A;if(A=e.input.charCodeAt(e.position),A===91)u=93,p=!1,s=[];else if(A===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),A=e.input.charCodeAt(++e.position);A!==0;){if(Le(e,!0,n),A=e.input.charCodeAt(e.position),A===u)return e.position++,e.tag=o,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=s,!0;t?A===44&&_(e,"expected the node content, but found ','"):_(e,"missed comma between flow collection entries"),h=b=k=null,d=m=!1,A===63&&(c=e.input.charCodeAt(e.position+1),tt(c)&&(d=m=!0,e.position++,Le(e,!0,n))),i=e.line,r=e.lineStart,a=e.position,Ci(e,n,eo,!1,!0),h=e.tag,b=e.result,Le(e,!0,n),A=e.input.charCodeAt(e.position),(m||e.line===i)&&A===58&&(d=!0,A=e.input.charCodeAt(++e.position),Le(e,!0,n),Ci(e,n,eo,!1,!0),k=e.result),p?Ti(e,s,f,h,b,k,i,r,a):d?s.push(Ti(e,null,f,h,b,k,i,r,a)):s.push(b),Le(e,!0,n),A=e.input.charCodeAt(e.position),A===44?(t=!0,A=e.input.charCodeAt(++e.position)):t=!1}_(e,"unexpected end of the stream within a flow collection")}function $g(e,n){var t,i,r=Xs,a=!1,o=!1,s=n,l=0,c=!1,u,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Xs===r?r=d===43?uu:Dg:_(e,"repeat of a chomping mode identifier");else if((u=Pg(d))>=0)u===0?_(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?_(e,"repeat of an indentation width identifier"):(s=n+u-1,o=!0);else break;if(Mn(d)){do d=e.input.charCodeAt(++e.position);while(Mn(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!It(d)&&d!==0)}for(;d!==0;){for(ol(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!o||e.lineIn
`,a?1+l:l):r===Xs&&a&&(e.result+=`
`);break}for(i?Mn(d)?(c=!0,e.result+=Ee.repeat(`
`,a?1+l:l)):c?(c=!1,e.result+=Ee.repeat(`
`,l+1)):l===0?a&&(e.result+=" "):e.result+=Ee.repeat(`
`,l):e.result+=Ee.repeat(`
`,a?1+l:l),a=!0,o=!0,l=0,t=e.position;!It(d)&&d!==0;)d=e.input.charCodeAt(++e.position);tn(e,t,e.position,!1)}return!0}function gu(e,n){var t,i=e.tag,r=e.anchor,a=[],o,s=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,_(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!tt(o))));){if(s=!0,e.position++,Le(e,!0,-1)&&e.lineIndent<=n){a.push(null),l=e.input.charCodeAt(e.position);continue}if(t=e.line,Ci(e,n,Mu,!1,!0),a.push(e.result),Le(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===t||e.lineIndent>n)&&l!==0)_(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return s?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=a,!0):!1}function Gg(e,n,t){var i,r,a,o,s,l,c=e.tag,u=e.anchor,d={},m=Object.create(null),p=null,f=null,b=null,h=!1,k=!1,A;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),A=e.input.charCodeAt(e.position);A!==0;){if(!h&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,_(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),a=e.line,(A===63||A===58)&&tt(i))A===63?(h&&(Ti(e,d,m,p,f,null,o,s,l),p=f=b=null),k=!0,h=!0,r=!0):h?(h=!1,r=!0):_(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,A=i;else{if(o=e.line,s=e.lineStart,l=e.position,!Ci(e,t,Ou,!1,!0))break;if(e.line===a){for(A=e.input.charCodeAt(e.position);Mn(A);)A=e.input.charCodeAt(++e.position);if(A===58)A=e.input.charCodeAt(++e.position),tt(A)||_(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(Ti(e,d,m,p,f,null,o,s,l),p=f=b=null),k=!0,h=!1,r=!1,p=e.tag,f=e.result;else if(k)_(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(k)_(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0}if((e.line===a||e.lineIndent>n)&&(h&&(o=e.line,s=e.lineStart,l=e.position),Ci(e,n,to,!0,r)&&(h?f=e.result:b=e.result),h||(Ti(e,d,m,p,f,b,o,s,l),p=f=b=null),Le(e,!0,-1),A=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>n)&&A!==0)_(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return h&&Ti(e,d,m,p,f,null,o,s,l),k&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=d),k}function Zg(e){var n,t=!1,i=!1,r,a,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&_(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(t=!0,o=e.input.charCodeAt(++e.position)):o===33?(i=!0,r="!!",o=e.input.charCodeAt(++e.position)):r="!",n=e.position,t){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(n,e.position),o=e.input.charCodeAt(++e.position)):_(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!tt(o);)o===33&&(i?_(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(n-1,e.position+1),Iu.test(r)||_(e,"named tag handle cannot contain such characters"),i=!0,n=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(n,e.position),Ng.test(a)&&_(e,"tag suffix cannot contain flow indicator characters")}a&&!Fu.test(a)&&_(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{_(e,"tag name is malformed: "+a)}return t?e.tag=a:nn.call(e.tagMap,r)?e.tag=e.tagMap[r]+a:r==="!"?e.tag="!"+a:r==="!!"?e.tag="tag:yaml.org,2002:"+a:_(e,'undeclared tag handle "'+r+'"'),!0}function Qg(e){var n,t;if(t=e.input.charCodeAt(e.position),t!==38)return!1;for(e.anchor!==null&&_(e,"duplication of an anchor property"),t=e.input.charCodeAt(++e.position),n=e.position;t!==0&&!tt(t)&&!Ei(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&_(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Jg(e){var n,t,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var t=new qg(e,n),i=e.indexOf("\0");for(i!==-1&&(t.position=i,_(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)Xg(t);return t.documents}function eh(e,n,t){n!==null&&typeof n=="object"&&typeof t>"u"&&(t=n,n=null);var i=Ku(e,t);if(typeof n!="function")return i;for(var r=0,a=i.length;r<a;r+=1)n(i[r])}function th(e,n){var t=Ku(e,n);if(t.length!==0){if(t.length===1)return t[0];throw new Ge("expected a single document in the stream, but found more")}}var nh=eh,ih=th,zu={loadAll:nh,load:ih},Nu=Object.prototype.toString,Yu=Object.prototype.hasOwnProperty,ll=65279,rh=9,cr=10,ah=13,oh=32,sh=33,lh=34,tl=35,ch=37,uh=38,dh=39,ph=42,_u=44,mh=45,io=58,fh=61,gh=62,hh=63,yh=64,Pu=91,Hu=93,bh=96,qu=123,vh=124,Uu=125,We={};We[0]="\\0";We[7]="\\a";We[8]="\\b";We[9]="\\t";We[10]="\\n";We[11]="\\v";We[12]="\\f";We[13]="\\r";We[27]="\\e";We[34]='\\"';We[92]="\\\\";We[133]="\\N";We[160]="\\_";We[8232]="\\L";We[8233]="\\P";var kh=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],wh=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Ah(e,n){var t,i,r,a,o,s,l;if(n===null)return{};for(t={},i=Object.keys(n),r=0,a=i.length;r<a;r+=1)o=i[r],s=String(n[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&Yu.call(l.styleAliases,s)&&(s=l.styleAliases[s]),t[o]=s;return t}function xh(e){var n,t,i;if(n=e.toString(16).toUpperCase(),e<=255)t="x",i=2;else if(e<=65535)t="u",i=4;else if(e<=4294967295)t="U",i=8;else throw new Ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+Ee.repeat("0",i-n.length)+n}var Lh=1,ur=2;function Sh(e){this.schema=e.schema||Cu,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ee.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Ah(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ur:Lh,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function hu(e,n){for(var t=Ee.repeat(" ",n),i=0,r=-1,a="",o,s=e.length;i<s;)r=e.indexOf(`
`,i),r===-1?(o=e.slice(i),i=s):(o=e.slice(i,r+1),i=r+1),o.length&&o!==`
`&&(a+=t),a+=o;return a}function nl(e,n){return`
`+Ee.repeat(" ",e.indent*n)}function Eh(e,n){var t,i,r;for(t=0,i=e.implicitTypes.length;t<i;t+=1)if(r=e.implicitTypes[t],r.resolve(n))return!0;return!1}function ro(e){return e===oh||e===rh}function dr(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ll||65536<=e&&e<=1114111}function yu(e){return dr(e)&&e!==ll&&e!==ah&&e!==cr}function bu(e,n,t){var i=yu(e),r=i&&!ro(e);return(t?i:i&&e!==_u&&e!==Pu&&e!==Hu&&e!==qu&&e!==Uu)&&e!==tl&&!(n===io&&!r)||yu(n)&&!ro(n)&&e===tl||n===io&&r}function Th(e){return dr(e)&&e!==ll&&!ro(e)&&e!==mh&&e!==hh&&e!==io&&e!==_u&&e!==Pu&&e!==Hu&&e!==qu&&e!==Uu&&e!==tl&&e!==uh&&e!==ph&&e!==sh&&e!==vh&&e!==fh&&e!==gh&&e!==dh&&e!==lh&&e!==ch&&e!==yh&&e!==bh}function Ch(e){return!ro(e)&&e!==io}function sr(e,n){var t=e.charCodeAt(n),i;return t>=55296&&t<=56319&&n+1<e.length&&(i=e.charCodeAt(n+1),i>=56320&&i<=57343)?(t-55296)*1024+i-56320+65536:t}function Wu(e){var n=/^\n* /;return n.test(e)}var Vu=1,il=2,ju=3,$u=4,Si=5;function Oh(e,n,t,i,r,a,o,s){var l,c=0,u=null,d=!1,m=!1,p=i!==-1,f=-1,b=Th(sr(e,0))&&Ch(sr(e,e.length-1));if(n||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=sr(e,l),!dr(c))return Si;b=b&&bu(c,u,s),u=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=sr(e,l),c===cr)d=!0,p&&(m=m||l-f-1>i&&e[f+1]!==" ",f=l);else if(!dr(c))return Si;b=b&&bu(c,u,s),u=c}m=m||p&&l-f-1>i&&e[f+1]!==" "}return!d&&!m?b&&!o&&!r(e)?Vu:a===ur?Si:il:t>9&&Wu(e)?Si:o?a===ur?Si:il:m?$u:ju}function Mh(e,n,t,i,r){e.dump=function(){if(n.length===0)return e.quotingType===ur?'""':"''";if(!e.noCompatMode&&(kh.indexOf(n)!==-1||wh.test(n)))return e.quotingType===ur?'"'+n+'"':"'"+n+"'";var a=e.indent*Math.max(1,t),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=i||e.flowLevel>-1&&t>=e.flowLevel;function l(c){return Eh(e,c)}switch(Oh(n,s,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,r)){case Vu:return n;case il:return"'"+n.replace(/'/g,"''")+"'";case ju:return"|"+vu(n,e.indent)+ku(hu(n,a));case $u:return">"+vu(n,e.indent)+ku(hu(Ih(n,o),a));case Si:return'"'+Fh(n)+'"';default:throw new Ge("impossible error: invalid scalar style")}}()}function vu(e,n){var t=Wu(e)?String(n):"",i=e[e.length-1]===`
`,r=i&&(e[e.length-2]===`
`||e===`
`),a=r?"+":i?"":"-";return t+a+`
`}function ku(e){return e[e.length-1]===`
`?e.slice(0,-1):e}function Ih(e,n){for(var t=/(\n+)([^\n]*)/g,i=function(){var c=e.indexOf(`
`);return c=c!==-1?c:e.length,t.lastIndex=c,wu(e.slice(0,c),n)}(),r=e[0]===`
`||e[0]===" ",a,o;o=t.exec(e);){var s=o[1],l=o[2];a=l[0]===" ",i+=s+(!r&&!a&&l!==""?`
`:"")+wu(l,n),r=a}return i}function wu(e,n){if(e===""||e[0]===" ")return e;for(var t=/ [^ ]/g,i,r=0,a,o=0,s=0,l="";i=t.exec(e);)s=i.index,s-r>n&&(a=o>r?o:s,l+=`
`+e.slice(r,a),r=a+1),o=s;return l+=`
`,e.length-r>n&&o>r?l+=e.slice(r,o)+`
`+e.slice(o+1):l+=e.slice(r),l.slice(1)}function Fh(e){for(var n="",t=0,i,r=0;r<e.length;t>=65536?r+=2:r++)t=sr(e,r),i=We[t],!i&&dr(t)?(n+=e[r],t>=65536&&(n+=e[r+1])):n+=i||xh(t);return n}function Rh(e,n,t){var i="",r=e.tag,a,o,s;for(a=0,o=t.length;a<o;a+=1)s=t[a],e.replacer&&(s=e.replacer.call(t,String(a),s)),(Wt(e,n,s,!1,!1)||typeof s>"u"&&Wt(e,n,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function Au(e,n,t,i){var r="",a=e.tag,o,s,l;for(o=0,s=t.length;o<s;o+=1)l=t[o],e.replacer&&(l=e.replacer.call(t,String(o),l)),(Wt(e,n+1,l,!0,!0,!1,!0)||typeof l>"u"&&Wt(e,n+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=nl(e,n)),e.dump&&cr===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=a,e.dump=r||"[]"}function Bh(e,n,t){var i="",r=e.tag,a=Object.keys(t),o,s,l,c,u;for(o=0,s=a.length;o<s;o+=1)u="",i!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=a[o],c=t[l],e.replacer&&(c=e.replacer.call(t,l,c)),Wt(e,n,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Wt(e,n,c,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function Dh(e,n,t,i){var r="",a=e.tag,o=Object.keys(t),s,l,c,u,d,m;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Ge("sortKeys must be a boolean or a function");for(s=0,l=o.length;s<l;s+=1)m="",(!i||r!=="")&&(m+=nl(e,n)),c=o[s],u=t[c],e.replacer&&(u=e.replacer.call(t,c,u)),Wt(e,n+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&cr===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,d&&(m+=nl(e,n)),Wt(e,n+1,u,!0,d)&&(e.dump&&cr===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,r+=m));e.tag=a,e.dump=r||"{}"}function xu(e,n,t){var i,r,a,o,s,l;for(r=t?e.explicitTypes:e.implicitTypes,a=0,o=r.length;a<o;a+=1)if(s=r[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof n=="object"&&n instanceof s.instanceOf)&&(!s.predicate||s.predicate(n))){if(t?s.multi&&s.representName?e.tag=s.representName(n):e.tag=s.tag:e.tag="?",s.represent){if(l=e.styleMap[s.tag]||s.defaultStyle,Nu.call(s.represent)==="[object Function]")i=s.represent(n,l);else if(Yu.call(s.represent,l))i=s.represent[l](n,l);else throw new Ge("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function Wt(e,n,t,i,r,a,o){e.tag=null,e.dump=t,xu(e,t,!1)||xu(e,t,!0);var s=Nu.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>n);var u=s==="[object Object]"||s==="[object Array]",d,m;if(u&&(d=e.duplicates.indexOf(t),m=d!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&n>0)&&(r=!1),m&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(u&&m&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s==="[object Object]")i&&Object.keys(e.dump).length!==0?(Dh(e,n,e.dump,r),m&&(e.dump="&ref_"+d+e.dump)):(Bh(e,n,e.dump),m&&(e.dump="&ref_"+d+" "+e.dump));else if(s==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&n>0?Au(e,n-1,e.dump,r):Au(e,n,e.dump,r),m&&(e.dump="&ref_"+d+e.dump)):(Rh(e,n,e.dump),m&&(e.dump="&ref_"+d+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&Mh(e,e.dump,n,a,l);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ge("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Kh(e,n){var t=[],i=[],r,a;for(rl(e,t,i),r=0,a=i.length;r<a;r+=1)n.duplicates.push(t[i[r]]);n.usedDuplicates=new Array(a)}function rl(e,n,t){var i,r,a;if(e!==null&&typeof e=="object")if(r=n.indexOf(e),r!==-1)t.indexOf(r)===-1&&t.push(r);else if(n.push(e),Array.isArray(e))for(r=0,a=e.length;r<a;r+=1)rl(e[r],n,t);else for(i=Object.keys(e),r=0,a=i.length;r<a;r+=1)rl(e[i[r]],n,t)}function zh(e,n){n=n||{};var t=new Sh(n);t.noRefs||Kh(e,t);var i=e;return t.replacer&&(i=t.replacer.call({"":i},"",i)),Wt(t,0,i,!0,!0)?t.dump+`
`:""}var Nh=zh,Yh={dump:Nh};function cl(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var ul=zu.load,jA=zu.loadAll,dl=Yh.dump,Gu=Ge;var $A=cl("safeLoad","load"),GA=cl("safeLoadAll","loadAll"),ZA=cl("safeDump","dump");function pr(e,n){if(e==null)return null;let t=pl(e,n);return typeof t=="string"?t:null}function Zu(e,n){if(e==null)return null;let t=pl(e,n);return typeof t=="number"?t:null}function Qu(e,n){if(e==null)return null;let t=pl(e,n);return typeof t=="boolean"?t:null}function pl(e,n){n=n.replace("..",".");let t=n.split(".");t!=null&&t[t.length-1]==""&&(t[t.length-1]=".");let i=e;for(let r of t)if(i=i[r],i==null)return null;return i}var re=Cn(so());var lo="[Obsidian Linter]",ml=new Map,mr=!1;var co=[];function uo(e,n){let t=`${lo} ${e}:
`;t+=`${n.name} ${n.message}`,n.stack&&(t+=`
`+n.stack),re.default.error(t),mr&&po(t.substring(t.indexOf("]")+2),re.default.levels.TRACE)}function vt(e){re.default.info(`${lo} ${e}`),mr&&po(e,re.default.levels.INFO)}function nt(e){re.default.debug(`${lo} ${e}`),mr&&po(e,re.default.levels.DEBUG)}function pt(e){re.default.warn(`${lo} ${e}`),mr&&po(e,re.default.levels.WARN)}function In(e){re.default.getLevel()>re.default.levels.DEBUG||ml.set(e,performance.now())}function rn(e){if(re.default.getLevel()>re.default.levels.DEBUG)return;ml.has(e)||pt(x("logs.timing-key-not-found").replace("{TIMING_KEY}",e));let n=performance.now()-ml.get(e);nt(`${e}: ${n} `+x("logs.milliseconds-abbreviation"))}function po(e,n){re.default.getLevel()<=n&&co.push(e)}function Xu(){co=[]}function fl(e){mr=e}function mo(e){switch(e){case"INFO":{re.default.setLevel("info");break}case"TRACE":{re.default.setLevel("trace");break}case"DEBUG":{re.default.setLevel("debug");break}case"SILENT":{re.default.setLevel("silent");break}case"ERROR":{re.default.setLevel("error");break}case"WARN":{re.default.setLevel("warn");break}}}function ed(e){switch(e){case re.default.levels.INFO:return"INFO";case re.default.levels.TRACE:return"TRACE";case re.default.levels.DEBUG:return"DEBUG";case re.default.levels.SILENT:return"SILENT";case re.default.levels.ERROR:return"ERROR";case re.default.levels.WARN:return"WARN"}}var td={};var nd={};var id={};var rd={commands:{"lint-file":{name:"Linten Sie die aktuelle Datei","error-message":"Lint-Datei-Fehler in der Datei"},"lint-file-unless-ignored":{name:"Linten Sie die aktuelle Datei, es sei denn, sie wird ignoriert"},"lint-all-files":{name:"Linten Sie alle Dateien im Vault","error-message":"Beim Linten aller Dateien Fehler in der Datei","success-message":"Alle Dateien gelinted","errors-message-singular":"Beim Linten aller Dateien gab es einen Fehler.","errors-message-plural":"Beim Linten aller Dateien gab es {NUM} Fehler.","start-message":"Dadurch werden alle Ihre Dateien ver\xE4ndert und es k\xF6nnen Fehler entstehen.","submit-button-text":"Linte alle","submit-button-notice-text":"Linte alle Dateien..."},"lint-all-files-in-folder":{name:"Linte alle Dateien im aktuellen Ordner","start-message":"Dadurch werden alle Ihre Dateien in {FOLDER_NAME} bearbeitet, einschlie\xDFlich der Dateien in den Unterordnern, was zu Fehlern f\xFChren kann.","submit-button-text":"Linte alle Dateien in {FOLDER_NAME}","submit-button-notice-text":"Linten aller Dateien in {FOLDER_NAME}...","error-message":"Beim Linten aller Dateien im Ordner gab es Fehler in der Datei","success-message":"Alle {NUM}-Dateien in {FOLDER_NAME} wurden gelinted.","message-singular":"Alle {NUM}-Dateien in {FOLDER_NAME} wurden gelinted und es trat ein Fehler auf.","message-plural":"Alle {FILE_COUNT}-Dateien in {FOLDER_NAME} wurden gelinted und es gab {ERROR_COUNT} Fehler."},"paste-as-plain-text":{name:"Einf\xFCgen als reiner Text und ohne \xC4nderungen"},"lint-file-pop-up-menu-text":{name:"Linte Datei"},"lint-folder-pop-up-menu-text":{name:"Linte Ordner"}},logs:{"plugin-load":"Plugin wird geladen","plugin-unload":"Plugin entladen","folder-lint":"Linting-Ordner ","linter-run":"Laufender Linter","paste-link-warning":"Abgebrochenes Einf\xFCgen des Lints, da der Inhalt der Zwischenablage ein Link ist, wodurch Konflikte mit anderen Plugins vermieden werden, die das Einf\xFCgen \xE4ndern.","see-console":"Weitere Informationen finden Sie in der Konsole.","unknown-error":"Beim Linten ist ein unbekannter Fehler aufgetreten.","moment-locale-not-found":"Beim Versuch, Moment.js locale auf {MOMENT_LOCALE} umzustellen, wurde {CURRENT_LOCALE} angezeigt","file-change-lint-message-start":"Linted","pre-rules":"Regeln vor regul\xE4ren Regeln","post-rules":"Regeln nach regul\xE4ren Regeln","rule-running":"Laufende Regeln","custom-regex":"Benutzerdefinierte Regex-Regeln","running-custom-regex":"Ausf\xFChren von benutzerdefinierten Regex","running-custom-lint-command":"Ausf\xFChren von benutzerdefinierten Lint-Befehlen","custom-lint-duplicate-warning":'Sie k\xF6nnen denselben Befehl ("{COMMAND_NAME}") nicht zweimal als benutzerdefinierte Lint-Regel
`)break;r.trim()===""||r===">"?t=r+t:t="",i--}return[t,i]}function kl(e=""){let[n]=Oi(e,e.length);return`
`+n.trim()}function Ed(e="",n=!1,t=1){let i=kl(e),r=sn(i,">");return(n||wo.test(e))&&t===r||t<r?i.substring(0,i.lastIndexOf(">")):i}function Vh(e,n){if(n===0)return e;let t=n,i=n;for(;t>=0;){let r=e.charAt(t);if(r.trim()!=="")break;r===`
`&&(i=t),t--}return t<0||i===0?e.substring(n+1):e.substring(0,i)+`
`+e.substring(n)}function jh(e,n,t,i=!1,r=!1){if(t===0)return e;let a=n.split(">").length-1,o=t,s=t,l=0,c=!1,u="";for(;o>=0;){let A=e.charAt(o);if(A.trim()!==""&&A!==">")break;if(A===">"){if(c)break;l++}else if(A===`
`)if(l===0||l===a||l+1===a)s=o,l=0,u===`
`&&(c=!0);else break;o--,u=A}if(o<0||s===0)return e.substring(t+1);let d=e.substring(s,t);if(d===`
`||d.startsWith(`
`))return e.substring(0,s)+`
`+e.substring(t);let p=e.lastIndexOf(`
`,s-1),f="";p===-1?f=e.substring(0,s):f=e.substring(p,s);let b,h=e.indexOf(`
`,t+1);h===-1?b=e.substring(t):b=e.substring(t,h);let k;return r?k=Ed(f,i,a):sn(f,">")!=0&&!wo.test(f)&&(gr.test(f)||gr.test(b))?k=e.substring(s,t).trimEnd():k=kl(f),e.substring(0,s)+k+e.substring(t)}function $h(e,n){if(n===e.length-1)return e;let t=n,i=n,r=!0;for(;t<e.length;){let a=e.charAt(t);if(a.trim()!=="")break;a===`
`&&(r?r=!1:i=t),t++}return t===e.length||i===e.length-1?e.substring(0,n):e.substring(0,n)+`
`+e.substring(i)}function Gh(e,n,t,i=!1,r=!1){if(t===e.length-1)return e;let a=n.split(">").length-1,o=t,s=t,l=!0,c=0,u=!1,d="",m=!0,p=e.charAt(o-1);for(;o<e.length;){let M=e.charAt(o);if(M.trim()!==""&&M!==">")break;if(M===">"){if(u)break;c++}else if(M===`
`)if(c===0||c===a||c+1===a)c=0,l?l=!1:s=o,d===`
`&&(u=!0);else break;if(o++,d=M,m&&M===`
`&&r&&p===`
`){s=o;break}m=!1}if(o===e.length||s===e.length-1)return e.substring(0,t);let f=e.substring(t,s);if(f===`
`||f.endsWith(`
`))return e.substring(0,t)+`
`+e.substring(s);let h=e.indexOf(`
`,s+1),k="";h===-1?k=e.substring(s):k=e.substring(s+1,h);let A,S=e.lastIndexOf(`
`,t-1);S===-1?A=e.substring(0,s):A=e.substring(S+1,t);let T;return r?T=Ed(k,i,a):gr.test(k)||gr.test(A)?T=e.substring(t,s).trimEnd():T=kl(k),e.substring(0,t)+T+e.substring(s)}function on(e,n,t,i=!1){let[r,a]=Oi(e,n);if(r.trim()!==""){let s=wo.test(e.substring(n,t)),l=sn(r,">"),c=Qh(e,t,l),u=Gh(e,r,c,s,i);return a=Zh(u,a,l),jh(u,r,a,s,i)}let o=$h(e,t);return Vh(o,a)}function Td(e,n=0){let t=3735928559^n,i=1103547991^n;for(let r=0,a;r<e.length;r++)a=e.charCodeAt(r),t=Math.imul(t^a,2654435761),i=Math.imul(i^a,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}function Cd(e){return e=e.replaceAll("\\b","\b"),e=e.replaceAll("\\f","\f"),e=e.replaceAll("\\n",`
`),e=e.replaceAll("\\r","\r"),e=e.replaceAll("\\t"," "),e=e.replaceAll("\\v","\v"),e}function hr(e,n){if(n==0)return n;let t=n;for(;t>0&&e.charAt(t-1)!==`
`;)t--;return t}function Od(e,n,t,i){return i>e.length-1?e:e.slice(0,i)+e.slice(i,e.length).replace(n,t)}function sn(e,n){let t=0;for(let i=0,r=e.length;i<r;i++){let a=e.indexOf(n,i);a>-1&&(t++,i=a)}return t}function ko(e){let n=typeof e;return n!="string"?n==="number":!isNaN(e)&&!isNaN(parseFloat(e))}function Md(e,n){let t=[],i=-1;for(;(i=n.indexOf(e,i+1))>=0;)t.push(i);return t}function Zh(e,n,t){let i=n,r=n+1,a="",o=!1,s=0;for(;r<e.length;){if(a=e.charAt(r),a.trim()!==""&&a!==">"){o=!0;break}else if(a===`
`){if(s!==t)break;s=0,i=r}else a===">"&&s++;r++}return o?i:n}function Qh(e,n,t){let i=n,r=n-1,a="",o=!1,s=0;for(;r>=0;){if(a=e.charAt(r),a.trim()!==""&&a!==">"){o=!0;break}else if(a===`
`){if(s!==t)break;s=0,i=r}else a===">"&&s++;r--}return o?i:n}function Mi(e){let n=Ii(e),t=new Map,i="",r=[],a=[];for(let o of n){i=e.substring(o.startIndex,o.endIndex),r=i.split(`
`),r.splice(0,2);for(let s of r){if(a=s.split("|"),a.length!==4){pt(x("options.custom-auto-correct.custom-row-parse-warning").replace("{ROW}",s));continue}t.set(a[1].trim().toLowerCase(),a[2].trim())}}return t}function ze(e,n,t,i){let r=e.length,a=0,o;if(n<0?n=-n>r?0:r+n:n=n>r?r:n,t=t>0?t:0,i.length<1e4)o=Array.from(i),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);a<i.length;)o=i.slice(a,a+1e4),o.unshift(n,0),e.splice(...o),a+=1e4,n+=1e4}function Ze(e,n){return e.length>0?(ze(e,e.length,0,n),e):n}var Jh=ln(/\p{P}/u),at=ln(/[A-Za-z]/),Qe=ln(/[\dA-Za-z]/),Id=ln(/[#-'*+\--9=?A-Z^-~]/);function yr(e){return e!==null&&(e<32||e===127)}var br=ln(/\d/),Fd=ln(/[\dA-Fa-f]/),wl=ln(/[!-/:-@[-`{-~]/);function F(e){return e!==null&&e<-2}function ne(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}function Rd(e){return wl(e)||Jh(e)}var Bd=ln(/\s/);function ln(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Al(e){if(e===null||ne(e)||Bd(e))return 1;if(Rd(e))return 2}function Fi(e,n,t){let i=[],r=-1;for(;++r<e.length;){let a=e[r].resolveAll;a&&!i.includes(a)&&(n=a(n,t),i.push(a))}return n}var vr={name:"attention",tokenize:ey,resolveAll:Xh};function Xh(e,n){let t=-1,i,r,a,o,s,l,c,u;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(i=t;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&n.sliceSerialize(e[i][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[i][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;l=e[i][1].end.offset-e[i][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;let d=Object.assign({},e[i][1].end),m=Object.assign({},e[t][1].start);Dd(d,-l),Dd(m,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[i][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[t][1].start),end:m},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[i][1].end),end:Object.assign({},e[t][1].start)},r={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[i][1].end=Object.assign({},o.start),e[t][1].start=Object.assign({},s.end),c=[],e[i][1].end.offset-e[i][1].start.offset&&(c=Ze(c,[["enter",e[i][1],n],["exit",e[i][1],n]])),c=Ze(c,[["enter",r,n],["enter",o,n],["exit",o,n],["enter",a,n]]),c=Ze(c,Fi(n.parser.constructs.insideSpan.null,e.slice(i+1,t),n)),c=Ze(c,[["exit",a,n],["enter",s,n],["exit",s,n],["exit",r,n]]),e[t][1].end.offset-e[t][1].start.offset?(u=2,c=Ze(c,[["enter",e[t][1],n],["exit",e[t][1],n]])):u=0,ze(e,i-1,t-i+3,c),t=i+c.length-u-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function ey(e,n){let t=this.parser.constructs.attentionMarkers.null,i=this.previous,r=Al(i),a;return o;function o(l){return a=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===a)return e.consume(l),s;let c=e.exit("attentionSequence"),u=Al(l),d=!u||u===2&&r||t.includes(l),m=!r||r===2&&u||t.includes(i);return c._open=!!(a===42?d:d&&(r||!m)),c._close=!!(a===42?m:m&&(u||!d)),n(l)}}function Dd(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}var xl={name:"autolink",tokenize:ty};function ty(e,n,t){let i=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return at(p)?(e.consume(p),o):c(p)}function o(p){return p===43||p===45||p===46||Qe(p)?(i=1,s(p)):c(p)}function s(p){return p===58?(e.consume(p),i=0,l):(p===43||p===45||p===46||Qe(p))&&i++<32?(e.consume(p),s):(i=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||yr(p)?t(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):Id(p)?(e.consume(p),c):t(p)}function u(p){return Qe(p)?d(p):t(p)}function d(p){return p===46?(e.consu
`;break}case-3:{o=`\r
`;break}case-2:{o=n?" ":" ";break}case-1:{if(!n&&r)continue;o=" ";break}default:o=String.fromCharCode(a)}r=a===-2,i.push(o)}return i.join("")}var ql={};su(ql,{attentionMarkers:()=>_b,contentInitial:()=>Bb,disable:()=>Pb,document:()=>Rb,flow:()=>Kb,flowInitial:()=>Db,insideSpan:()=>Yb,string:()=>zb,text:()=>Nb});var Rb={42:je,43:je,45:je,48:je,49:je,50:je,51:je,52:je,53:je,54:je,55:je,56:je,57:je,62:Ao},Bb={91:El},Db={[-2]:kr,[-1]:kr,32:kr},Kb={35:Cl,42:Dn,45:[Mo,Dn],60:Ml,61:Mo,95:Dn,96:So,126:So},zb={38:Lo,92:xo},Nb={[-5]:wr,[-4]:wr,[-3]:wr,33:Fl,38:Lo,42:vr,60:[xl,Il],91:Rl,92:[Tl,xo],93:Bn,95:vr,96:Ll},Yb={null:[vr,Xd]},_b={null:[42,95]},Pb={null:[]};function Ul(e){let t=Fo([ql,...(e||{}).extensions||[]]),i={defined:[],lazy:{},constructs:t,content:r(Gd),document:r(Qd),flow:r(Jd),string:r(ep),text:r(tp)};return i;function r(a){return o;function o(s){return rp(i,a,s)}}}function Wl(e){for(;!Eo(e););return e}var ap=/[\0\t\n\r]/g;function Vl(){let e=1,n="",t=!0,i;return r;function r(a,o,s){let l=[],c,u,d,m,p;for(a=n+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),d=0,n="",t&&(a.charCodeAt(0)===65279&&d++,t=void 0);d<a.length;){if(ap.lastIndex=d,c=ap.exec(a),m=c&&c.index!==void 0?c.index:a.length,p=a.charCodeAt(m),!c){n=a.slice(d);break}if(p===10&&d===m&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),d<m&&(l.push(a.slice(d,m)),e+=m-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:i=!0,e=1}d=m+1}return s&&(i&&l.push(-5),n&&l.push(n),l.push(null)),l}}var Hb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function op(e){return e.replace(Hb,qb)}function qb(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){let r=t.charCodeAt(1),a=r===120||r===88;return Ro(t.slice(a?2:1),a?16:10)}return Ri(t)||e}function Bi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sp(e.position):"start"in e||"end"in e?sp(e):"line"in e||"column"in e?jl(e):""}function jl(e){return lp(e&&e.line)+":"+lp(e&&e.column)}function sp(e){return jl(e&&e.start)+"-"+jl(e&&e.end)}function lp(e){return e&&typeof e=="number"?e:1}var up={}.hasOwnProperty;function $l(e,n,t){return typeof n!="string"&&(t=n,n=void 0),Ub(t)(Wl(Ul(t).document().write(Vl()(e,n,!0))))}function Ub(e){let n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Za),autolinkProtocol:B,autolinkEmail:B,atxHeading:a(ja),blockQuote:a(Pt),characterEscape:B,characterReference:B,codeFenced:a(dt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(dt,o),codeText:a(Mt,o),codeTextData:B,data:B,codeFlowValue:B,definition:a(en),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ai),hardBreakEscape:a($a),hardBreakTrailing:a($a),htmlFlow:a(nr,o),htmlFlowData:B,htmlText:a(nr,o),htmlTextData:B,image:a(Ga),label:o,link:a(Za),listItem:a(Ht),listItemValue:m,listOrdered:a(Qa,d),listUnordered:a(Qa),paragraph:a(xi),reference:w,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ja),strong:a(Ja),thematicBreak:a(ir)},exit:{atxHeading:l(),atxHeadingSequence:M,autolink:l(),autolinkEmail:se,autolinkProtocol:_t,blockQuote:l(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:qe,characterReferenceMarkerNumeric:qe,characterReferenceValue:Yt,codeFenced:l(h),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:z,codeIndented:l(k),codeText:l(W),codeTextData:z,data:z,definition:l(),definitionDestinationString:T,definitionLabelString:A,definitionTitleString:S,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(D),htmlFlowData:z,htmlText:l(U),htmlTextData:z,image:l(ee),label:Ie,labelText:Pe,lineEnding:V,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ae,resourceDestinationString:v,resourceTitleString:He,resource:$e,setextHeading:l(N),setextHeadingLineSequence:O,setextHeadingText:E,strong:l(),thematicBreak:l()}};dp(n,(e||{}).mdastExtensions||[]);let t={};return i;function
`&&(e=e.substring(0,o.end.offset)+e.substring(o.end.offset+1)),o.end.offset<e.length&&e[o.end.offset]===`
`&&(e=e.substring(0,o.end.offset)+e.substring(o.end.offset+1)),e=e.substring(0,o.start.offset)+e.substring(o.end.offset),a(e,s,o.start.offset)}for(let o of i){let s=o[1],l=s.referencePositions.length-s.footnotesReferencingKey.length;l=l>=0?l:0;let c=0;for(let u of s.footnotesReferencingKey){if(c+l>=s.referencePositions.length)throw new Error(x("logs.missing-footnote-error-message").replace("{FOOTNOTE}",u));r.set(u,s.referencePositions[l+c++])}}t=t.sort((o,s)=>r.get(o)-r.get(s)),t.length>0&&(e=e.trimEnd()+`
`);for(let o of t)e+=`
`+o;return e}function vp(e){let n=ge("footnoteDefinition",e),t=[],i=new Map,r=new Map,a=[],o=new Set,s=[],l=function(d,m,p){let f=m.match(/\[\^.*?\]/)[0];i.set(m,f);let b=o.has(f);if(b&&t.includes(m)){s.unshift(m);return}else if(b)throw new Error(x("logs.too-many-footnotes-error-message").replace("{FOOTNOTE_KEY}",f));let h;do h=d.lastIndexOf(f,p),h!==-1&&((h+m.length>d.length||d.substring(h,h+m.length)!==m)&&a.push({key:f,position:h}),p=h-1);while(h>0);o.add(f)};for(let d of n){let m=e.substring(d.start.offset,d.end.offset);t.unshift(m),l(e,m,d.start.offset)}let c=1,u=new Set;for(let d of t){if(u.has(d))continue;u.add(d);let m=i.get(d),p=`[^${c++}]`;r.set(m,p)}a.sort((d,m)=>m.position-d.position);for(let d of a){let m=r.get(d.key);e=Od(e,d.key,m,d.position)}for(let d of u){let m=i.get(d),p=r.get(m);e=e.replace(d,d.replace(m,p))}for(let d of s){let m=e.replace(`
${d}
`,`
`);e===m&&(m=e.replace(d,"")),e=m}return e}function Ko(e,n,t){let i=ge(t,e);if(i.length===0)return e;let r="";if(n==="underscore")r="_";else if(n==="asterisk")r="*";else{let a=i[i.length-1];r=e.substring(a.start.offset,a.start.offset+1)}t==="strong"&&(r+=r);for(let a of i){let o=r+e.substring(a.start.offset+r.length,a.end.offset-r.length)+r;e=le(e,a.start.offset,a.end.offset,o)}return e}function kp(e,n){let t=ge("paragraph",e);if(t.length===0)return e;for(let i of t){let r=e.substring(i.start.offset,i.end.offset).split(`
`),a=r.length-1;if(!(a<1)){for(let o=0;o<a;o++){let s=r[o];rv(s,n)||(r[o]=av(s,n))}e=le(e,i.start.offset,i.end.offset,r.join(`
`))}}return e}function rv(e,n){return!!(e.endsWith("<br>")&&n=="<br>"||e.endsWith("<br/>")&&n=="<br/>"||e.endsWith(" ")&&n==" "||!e.endsWith("\\\\")&&e.endsWith("\\")&&n=="\\")}function av(e,n){e=e.trimEnd();let t=0;return e.endsWith("<br>")&&(t=4),e.endsWith("<br/>")&&(t=5),!e.endsWith("\\\\")&&e.endsWith("\\")&&(t=1),t&&(e=e.substring(0,e.length-t)),e.trimEnd()+n}function wp(e){let n=e.endsWith(`
`),t=ge("paragraph",e);if(t.length===0)return e;for(let i of t){let r=i.start.offset;for(r>0&&r--;r>=0&&e.charAt(r)!=`
`;)r--;r++;let a=e.substring(r,i.end.offset).split(`
`),o=a[0].trimStart();if(o.startsWith(">")||o.match(zo)||o.match(No))continue;let s=a.length,l=[],c=!1;for(let f=0;f<s;f++){let b=a[f];if(c){let h=l.length-1;l[h]+=`
`+b}else l.push(b);c=b.endsWith("<br>")||b.endsWith("<br/>")||b.endsWith(" ")||!b.endsWith("\\\\")&&b.endsWith("\\")}for(;r>0&&e.charAt(r-1)==`
`;)r--;let u=e.length,d=i.end.offset;for(d<u&&d++;d<u&&e.charAt(d)==`
`;)d++;let m=`
`;r==0&&(m="");let p=`
`;d==u&&(p=""),e=le(e,r,d,m+l.join(`
`)+p)}return n&&!e.endsWith(`
`)&&(e+=`
`),e}function Ap(e){let n=ge("link",e);for(let t of n){if(t==null)continue;let i=e.substring(t.start.offset,t.end.offset);if(!i.match(Ir))continue;let r=i.indexOf("]"),a=i.substring(0,1)+i.substring(1,r).trim()+i.substring(r);e=le(e,t.start.offset,t.end.offset,a)}return e}function xp(e,n){let t=ge("emphasis",e);for(let i of t){let r=e.substring(i.start.offset+1,i.end.offset-1);r=n(r),e=le(e,i.start.offset+1,i.end.offset-1,r)}return e}function Lp(e,n){let t=ge("strong",e);for(let i of t){let r=e.substring(i.start.offset+2,i.end.offset-2);r=n(r),e=le(e,i.start.offset+2,i.end.offset-2,r)}return e}function Di(e,n){let t=iv(e);for(let i of t){let r=i.start.offset;for(;r>0&&e.charAt(r-1).trim()==="";)r--;(r===0||e.charAt(r-1).trim()!="")&&r++;let a=e.substring(r,i.end.offset);Yp.test(a)&&(r+=4,a=a.substring(4)),a=n(a),e=le(e,r,i.end.offset,a)}return e}function Sp(e){let n=ge("code",e);for(let t of n){let i=e.substring(t.start.offset,t.end.offset);!i.startsWith("```")&&!i.startsWith("~~~")||(e=on(e,t.start.offset,t.end.offset))}return e}function Ep(e,n){let t=ge("math",e);for(let i of t)e=on(e,i.start.offset,i.end.offset);t=ge("inlineMath",e);for(let i of t)e.substring(i.start.offset,i.end.offset).startsWith("$".repeat(n))&&(e=on(e,i.start.offset,i.end.offset));return e}function Tp(e){let n=ge("blockquote",e);for(let t of n){let i=t.end.offset;for(;i<e.length-1&&e.charAt(i)!==`
`;)i++;e=on(e,t.start.offset,i,!0)}return e}function Cp(e){let n=ge("thematicBreak",e);for(let t of n)e=on(e,t.start.offset,t.end.offset);return e}function Op(e,n,t,i){let r=ge("list",e);if(!r)return e;for(let a of r){let o=a.start.offset;for(;o>0&&e.charAt(o-1)!==`
`;)o--;let s=e.substring(o,a.end.offset),l=function(m){let p=m.lastIndexOf("> ");return p!==-1&&(m=m.substring(p+2)),m=m.replaceAll(" "," "),Math.floor((m.split(" ").length-1)/2)+1},c=new Map,u=function(m,p){let f=p;for(;f>m;)c.delete(f--)},d=-1;s=s.replace(/^(( |\t|> )*)((\d+(\.|\)))|[-*+])([^\n]*)$/gm,(m,p="",f,b,h,k,A)=>{let S=n==="preserve"||i?Number(h):1,T=l(p);if(!/^\d/.test(b)){let M=T>d?T:d;return u(T,M),m}return c.has(T)?n==="ascending"?(S=c.get(T)+1,c.set(T,S)):i&&(S=c.get(T)):c.set(T,S),d>T&&u(T,d),d=T,`${p}${S}${t}${A}`}),e=le(e,o,a.end.offset,s)}return e}function Mp(e,n){let t=ge("listItem",e);if(!t)return e;let i=/^((\d+[.)])|(- \[[ x]\]))/m,r=n;if(n=="consistent"){let a=t.length-1;for(;a>=0;){let o=e.substring(t[a].start.offset,t[a].end.offset);if(a--,!o.match(i)){r=o.charAt(0);break}}if(a==-1)return e}for(let a of t){let o=e.substring(a.start.offset,a.end.offset);o.match(i)||(o=r+o.substring(1),e=le(e,a.start.offset,a.end.offset,o))}return e}function ac(e,n){let t=ge("blockquote",e);for(let i of t){let r=i.end.offset;for(;r<e.length-1&&e.charAt(r)!==`
`;)r++;let a=e.substring(i.start.offset,r);a=n(a),e=le(e,i.start.offset,r,a)}return e}function Ip(e,n){let t=ge("math",e),i=new RegExp("^(\\${"+n+",})(\\n*)"),r=new RegExp("(\\n*)(\\${"+n+",})([^\\$]*)$");for(let a of t){let o=e.substring(a.start.offset,a.end.offset),s=ov(o,n,a.start.offset);for(let l of s)e=gp(e,l.startIndex,l.endIndex,i,r)}t=ge("inlineMath",e);for(let a of t)e.substring(a.start.offset,a.end.offset).startsWith("$".repeat(n))&&(e=gp(e,a.start.offset,a.end.offset,i,r));return e}function ov(e,n,t){let i="$".repeat(n),r=n;for(;e.charAt(r)==="$";)i+="$",r++;let a=[],o=sn(e,i);if(o<=1)return[];if(o===2)return a.unshift({startIndex:t,endIndex:t+e.length}),a;o===3&&a.unshift({startIndex:t,endIndex:t+e.indexOf(i,i.length)+i.length}),o%2===1&&o--;let s=t,l=i.length;for(;o>2;){let c=e.indexOf(i,l)+i.length;a.unshift({startIndex:s,endIndex:t+c}),s=t+c+1,l=c+1,o-=2}return a.unshift({startIndex:t+e.indexOf(i,l),endIndex:t+e.length}),a}function gp(e,n,t,i,r){let a=e.substring(hr(e,n),n)??"",[o]=Oi(a,a.length),s=e.substring(hr(e,t),t)??"",l=e.substring(n,t),c=Bp.test(a.trim()),u=!1;for(l=l.replace(i,(d,m,p="")=>{let f="";return!c&&a.trim()!=""?(f+=`
`,u=!0):c&&!ic.test(a)&&(f+=`
`+o,u=!0),f+=m+`
`,p===""&&c&&(f+=o),f}),l=l.replace(r,(d,m="",p,f)=>{let b=m==="";return b&&c&&ic.test(s.trim())?d:b&&c?`
`+o+p+f:`
`+p+f});u&&n>0;){let d=e[n-1];if(d!==" "&&d!==" ")break;n--}return le(e,n,t,l)}function Ii(e){let n=[...e.matchAll(Dp)],t=[];for(let i of n){let r=hr(e,i.index);if(r===0)continue;let a=hr(e,r-1),o=i[0],s=e.substring(r,i.index+o.length);if(sv(s,o))continue;let l=a,c=e.substring(a,r-1);if(!o.includes("|")&&!c.includes("|"))continue;c=c.replace(rc,f=>{let b=f.trim();return b===""||b==="|"||(l+=f.length-1),""});let u=o.replace(rc,"");if(c.endsWith("|")&&(c=c.slice(0,-1)),u.endsWith("|")&&(u=u.slice(0,-1)),hp(c)!==hp(u))continue;let d=i.index+i[0].length;if(d>=e.length-1){t.push({startIndex:l,endIndex:e.length});continue}let m=e.substring(d+1).split(`
`),p=0;for(;p<m.length&&Kp.test(m[p]);)d+=m[p].length+1,p++;t.push({startIndex:l,endIndex:d})}return t.reverse()}function sv(e,n){if(e.trim()===""||n.includes("||"))return!0;let t=e.replace(n,"");return/[^\s>]/.test(t)}function hp(e){let n=!1,t=0,i=0,r="";for(let a=0;a<e.length;a++)r=e[a],r==="\\"?(t++,n=t%2==1):(t=0,r==="|"&&!n&&i++,n=!1);return i}function Fp(e){let n=0,t=[],i=[...e.matchAll(zp)];if(!i||i.length===0)return t;let r=[...e.matchAll(Np)];return i.forEach(a=>{n=a.index;let o=!1,s=e.length-1;for(;r&&r.length!==0&&!o;)if(r[0].index<=n)r.shift();else{o=!0;let l=r[0];s=l.index+l[0].length}t.push({startIndex:n,endIndex:s}),!r||r.length}),t.reverse()}function Rp(e,n){let t=ge("code",e);for(let i of t){let r=e.substring(i.start.offset,i.end.offset);!r.startsWith("```")||r.substring(3,r.indexOf(`
`)).trim()!==""||(e=le(e,i.start.offset+3,i.start.offset+3,n))}return e}var pn=/^([ \t]*)(#+)([ \t]+)([^\n\r]*?)([ \t]+#+)?$/gm,_p=`^XXX\\.*?
(?:((?:.|
)*?)
)?XXX(?=\\s|$)$`,Ne=/^---\n((?:(((?!---)(?:.|\n)*?)\n)?))---(?=\n|$)/,lv=_p.replaceAll("X","`"),cv=_p.replaceAll("X","~"),uv=`^(( |( {4})).*
)+`,GT=new RegExp(`${lv}|${cv}|${uv}`,"gm"),Yo=/(!?)\[{2}([^\][\n|]+)(\|([^\][\n|]+))?(\|([^\][\n|]+))?\]{2}/g,Ir=/(!?)\[([^[]*)\](\(.*\))/g,Fr=/(\s|^)(#[\p{L}\-_\d/\p{Emoji_Presentation}]+)/gu,Pp=/^%%\n[^%]*\n%%/gm,Rr=/[,\s]+/,_o=/(\. ?){2}\./g,Br="\\s*(>\\s*)*",ic=/^(>( |\t)*)+\$*?$/m,Bp=/^\s*(>\s*)+/m,Dp=/(\|? *:?-{1,}:? *\|?)(\| *:?-{1,}:? *\|?)*( |\t)*$/gm,rc=/^(((>[ ]?)*)|([ ]{0,3}))\|/m,Kp=/[^\n]*?\|[^\n]*?(\n|$)/m,Hp=/(([a-z\-0-9]+:)\/{2,3})([^\s/?#]*[^\s")'.?!/]|[/])?(([/?#][^\s")']*[^\s")'.?!])|[/])?/gi,zn=/(?:(?:(?:[a-z]+:)?\/\/)|www\.)(?:localhost|(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?|(?:(?:[a-z0-9][-_]*)*[a-z0-9]+)(?:\.(?:[a-z0-9]-*)*[a-z0-9]+)*(?:\.(?:[a-z]{2,})))(?::\d{2,5})?(?:(?:[/?#][a-z0-9-_%/&=?$.+~!*(,#@]*[a-z0-9-%_/$+~!*(,])|[/])?/gi,ZT=new RegExp("^"+zn.source+"$","si"),qp=/<a[\s]+([^>]+)>((?:.(?!<\/a>))*.)<\/a>/g,Up=/[\p{L}\p{N}\p{Pc}\p{M}\-'`]+/gu,Wp=/&[^\s]+;$/mi,zp=Xp(!0),Np=Xp(!1),Vp=/[“”„«»]/g,jp=/[]/g,$p=/<%[^]*?%>/g,Nn="\\[.\\]",Yp=new RegExp(`^${Nn}`),Gp=new RegExp(`^${Br}- ${Nn} `),Po=new RegExp(`^\\s*- ${Nn} `),zo=new RegExp(`^\\s*(-|\\*|\\+|\\d+[.)]|- (${Nn}))`,"m"),No=/^(\[\^[^\]]*\]) ?([,.;!:?])/gm,wo=/^(>\s*)+\[![^\s]*\]/m,gr=/^\n?(>\s*)+((```)|(~~~))/m,oc=RegExp(/\p{L}/,"u");function Je(e){return e.replace(/\$/g,"$$$$")}function mn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zp(e){let n=e.match(Yo);if(n){for(let t of n)if(t.includes("|")){let i=t.indexOf("|"),r=t.substring(0,i+1)+t.substring(i+1,t.length-2).trim()+"]]";e=e.replace(t,r)}}return e}function Qp(e){let n=Ii(e);if(n.length===0)return e;for(let t of n)e=on(e,t.startIndex,t.endIndex);return e}function Ho(e){let n=e.match(/^#\s+(.*)/m);if(n&&n[1]){let t=n[1];return t=t.replaceAll(Yo,(i,r,a,o)=>o!=null?o.replace("|",""):a),t.replaceAll(Ir,"$2")}return""}function Jp(e){return[...e.matchAll(Fr)].map(n=>n[2])}function Xp(e){let n="(?:<!-{2,}|%%) *linter-{ENDING_TEXT} *(?:-{2,}>|%%)",t="";return e?t+="disable":t+="enable",new RegExp(n.replace("{ENDING_TEXT}",t),"g")}var sc="tag",Dr="tags",wt=[sc,Dr],dv="alias",lc="aliases",At=[dv,lc],cc="linter-yaml-title-alias",Ki="disabled rules";function Rt(e){return e.match(Ne)===null&&(e=`---
---
`+e),e}function zi(e){let n=e.match(Ne);return n?n[1]:null}function he(e,n){if(!e.match(Ne))return e;let t=e.match(Ne)[0],i=n(t);return e=e.replace(t,Je(i)),e}function uc(e,n=!0){return n?new RegExp(`^([\\t ]*)${e}:[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m"):new RegExp(`^${e}:[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m")}function ae(e,n,t){let i=`${n}:${t}
`,r=!1,a=e.replace(uc(n),(o,s)=>(r=!0,s+i));return r||(a=`${e}${i}`),a}function ue(e,n,t=!0){let i=e.match(uc(n,t));if(i==null)return null;let r=i[2];return t||(r=i[1]),r}function Yn(e,n,t=!0){return e.replace(uc(n,t),"")}function st(e){if(e==null)return null;let n=ul(e.replace(/\n(\t)+/g,`
`));return n??{}}function be(e,n,t,i,r=!1){if(typeof e=="string"&&(e=[e]),e==null||e.length===0)return pv(n);let a=i&&(n=="multi-line"||n=="single string to multi-line"&&e.length>1);if(r||a)for(let o=0;o<e.length;o++){let s=e[o],l=Ni(s);l&&(s=s.substring(1,s.length-1));let c=r&&ko(s);l&&c||(c||l&&a)&&(e[o]=xt(s,t,c))}switch(n){case"single string to single-line":if(e.length===1)return" "+e[0];case"single-line":return" "+em(e);case"single string to multi-line":if(e.length===1)return" "+e[0];case"multi-line":return mv(e);case"single string space delimited":return e.length===1?" "+e[0]:" "+e.join(" ");case"single string comma delimited":return e.length===1?" "+e[0]:" "+e.join(", ");case"single-line space delimited":return e.length===1?" "+e[0]:" "+em(e).replaceAll(", "," ")}}function pv(e){switch(e){case"single-line":case"single-line space delimited":case"multi-line":return" []";case"single string to single-line":case"single string to multi-line":case"single string space delimited":case"single string comma delimited":return" "}}function em(e){return e==null||e.length===0?"[]":"["+e.join(", ")+"]"}function mv(e){return e==null||e.length===0?"[]":`
- `+e.join(`
- `)}function Re(e){if(e==null||e.length===0)return null;if(e=e.trimEnd(),e.startsWith("["))return e=e.substring(1),e.endsWith("]")&&(e=e.substring(0,e.length-1)),e.length===0?null:qo(e,",").filter(t=>t!="");if(e.includes(`
`)){let n=e.split(/[ \t]*\n[ \t]*-[ \t]*/);return n.splice(0,1),n=n.filter(t=>t!=""),n==null||n.length===0?null:n}return e}function fn(e){if(e==null)return[];let n=[],t=[];Array.isArray(e)?t=e:e.includes(",")?t=qo(e,","):t=qo(e," ");for(let i of t)n.push(i.trim());return n}function gn(e){return typeof e=="string"?qo(e,","):e}function qo(e,n=","){if(e==""||e==null)return null;if(n.length>1)throw new Error(x("logs.invalid-delimiter-error-message"));let t=[],i="",r=0;for(;r<e.length;){let a=e.charAt(r);if(a===n)t.push(i.trim()),i="";else if(a==='"'||a==="'"){let o=e.indexOf(a,r+1);o!=-1?(i+=e.substring(r,o+1),r=o):i+=a}else i+=a;r++}return i.trim()!=""&&t.push(i.trim()),t}function Ni(e){return e.length>1&&(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))}function xt(e,n,t=!1,i=!1){let r=fv(e,n,t);if(i)return r;try{if(ul(r)===e)return r}catch{}let a=dl(e,{lineWidth:-1,quotingType:n,forceQuotes:t}).slice(0,-1),o=dl(e,{lineWidth:-1,quotingType:n=='"'?"'":'"',forceQuotes:t}).slice(0,-1);return o===e||o.length<a.length?o:a}function fv(e,n,t=!1){if(Ni(e))return e;let i=e.includes("'"),r=e.includes('"'),a=e.includes(": ");return!i&&!r&&!a&&!t||i&&r?e:i?`"${e}"`:r?`'${e}'`:`${n}${e}${n}`}function tm(e){let n=ue(e,Ki);if(n==null)return[];let t=n.includes(`
`)?`${Ki}:
`:`${Ki}: `;t+=n;let r=st(t)["disabled rules"];return r?(typeof r=="string"&&(r=[r]),r):[]}var Wi=require("obsidian");function Te(e){e.addClass("linter-visually-hidden")}function Ye(e){e.removeClass("linter-visually-hidden")}function it(e,n){if(e.includes("</")){let t=document.createRange();n.append(t.createContextualFragment(e))}else n.setText(e)}var Ui=require("obsidian");var nm=require("obsidian");var Uo=class{constructor(n,t,i,r,a,o,s,l,c,u){this.containerEl=n;this.name=t;this.description=i;this.warning=r;this.addInputTooltip=a;this.refreshBtnTooltip=o;this.app=s;this.saveSettings=l;this.onAddInput=c;this.onRefresh=u}display(){this.containerEl.createDiv({cls:"setting-item-name",text:this.name});let n=this.containerEl.createDiv({cls:"setting-item-description"});it(this.description,n.createEl("p",{cls:"custom-row-description"})),new nm.Setting(this.containerEl).addButton(t=>{t.setIcon("plus-with-circle").setTooltip(this.addInputTooltip).onClick(()=>this.onAddInput()),t.buttonEl.addClass("clickable-icon")}).addButton(t=>{t.setIcon("reset").setTooltip(this.refreshBtnTooltip).onClick(()=>this.onRefresh()),t.buttonEl.addClass("clickable-icon")}).setClass("linter-border-bottom").setDesc(this.warning??"").descEl.addClass("mod-warning"),this.inputElDiv=this.containerEl.createDiv(),this.showInputEls()}resetInputEls(){this.inputElDiv.empty(),this.showInputEls()}};var Lm=require("obsidian");var ye="top",Ce="bottom",Se="right",ve="left",Wo="auto",hn=[ye,Ce,Se,ve],Vt="start",_n="end",im="clippingParents",Vo="viewport",Yi="popper",rm="reference",dc=hn.reduce(function(e,n){return e.concat([n+"-"+Vt,n+"-"+_n])},[]),jo=[].concat(hn,[Wo]).reduce(function(e,n){return e.concat([n,n+"-"+Vt,n+"-"+_n])},[]),gv="beforeRead",hv="read",yv="afterRead",bv="beforeMain",vv="main",kv="afterMain",wv="beforeWrite",Av="write",xv="afterWrite",am=[gv,hv,yv,bv,vv,kv,wv,Av,xv];function Be(e){return e?(e.nodeName||"").toLowerCase():null}function de(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var n=e.ownerDocument;return n&&n.defaultView||window}return e}function ft(e){var n=de(e).Element;return e instanceof n||e instanceof Element}function Oe(e){var n=de(e).HTMLElement;return e instanceof n||e instanceof HTMLElement}function _i(e){if(typeof ShadowRoot>"u")return!1;var n=de(e).ShadowRoot;return e instanceof n||e instanceof ShadowRoot}function Lv(e){var n=e.state;Object.keys(n.elements).forEach(function(t){var i=n.styles[t]||{},r=n.attributes[t]||{},a=n.elements[t];!Oe(a)||!Be(a)||(Object.assign(a.style,i),Object.keys(r).forEach(function(o){var s=r[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function Sv(e){var n=e.state,t={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,t.popper),n.styles=t,n.elements.arrow&&Object.assign(n.elements.arrow.style,t.arrow),function(){Object.keys(n.elements).forEach(function(i){var r=n.elements[i],a=n.attributes[i]||{},o=Object.keys(n.styles.hasOwnProperty(i)?n.styles[i]:t[i]),s=o.reduce(function(l,c){return l[c]="",l},{});!Oe(r)||!Be(r)||(Object.assign(r.style,s),Object.keys(a).forEach(function(l){r.removeAttribute(l)}))})}}var om={name:"applyStyles",enabled:!0,phase:"write",fn:Lv,effect:Sv,requires:["computeStyles"]};function De(e){return e.split("-")[0]}var Lt=Math.max,Pn=Math.min,jt=Math.round;function Pi(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function Kr(){return!/^((?!chrome|android).)*safari/i.test(Pi())}function gt(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);var i=e.getBoundingClientRect(),r=1,a=1;n&&Oe(e)&&(r=e.offsetWidth>0&&jt(i.width)/e.offsetWidth||1,a=e.offsetHeight>0&&jt(i.height)/e.offsetHeight||1);var o=ft(e)?de(e):window,s=o.visualViewport,l=!Kr()&&t,c=(i.left+(l&&s?s.offsetLeft:0))/r,u=(i.top+(l&&s?s.offsetTop:0))/a,d=i.width/r,m=i.height/a;return{width:d,height:m,top:u,right:c+d,bottom:u+m,left:c,x:c,y:u}}function Hn(e){var n=gt(e),t=e.
---`)},wikiLink:{replaceAction:Yo,placeholder:"{WIKI_LINK_PLACEHOLDER}"},obsidianMultiLineComments:{replaceAction:Pp,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},footnoteAtStartOfLine:{replaceAction:No,placeholder:"{FOOTNOTE_AT_START_OF_LINE_PLACEHOLDER}"},footnoteAfterATask:{replaceAction:/- \[.] (\[\^\w+\]) ?([,.;!:?])/gm,placeholder:"{FOOTNOTE_AFTER_A_TASK_PLACEHOLDER}"},url:{replaceAction:zn,placeholder:"{URL_PLACEHOLDER}"},anchorTag:{replaceAction:qp,placeholder:"{ANCHOR_PLACEHOLDER}"},templaterCommand:{replaceAction:$p,placeholder:"{TEMPLATER_PLACEHOLDER}"},link:{replaceAction:Qv,placeholder:"{REGULAR_LINK_PLACEHOLDER}"},tag:{replaceAction:Jv,placeholder:"#tag-placeholder"},table:{replaceAction:Xv,placeholder:"{TABLE_PLACEHOLDER}"},customIgnore:{replaceAction:ek,placeholder:"{CUSTOM_IGNORE_PLACEHOLDER}"}};function ke(e,n,t){let i=[];for(let r of e){let a;if(typeof r.replaceAction=="string")a=Gv(n,r.placeholder,r.replaceAction);else if(r.replaceAction instanceof RegExp)a=Zv(n,r.placeholder,r.replaceAction);else if(typeof r.replaceAction=="function"){let o=r.replaceAction;a=o(n,r.placeholder)}n=a.newText,i.push({replacedValues:a.replacedValues,placeholder:r.placeholder})}return n=t(n),i=i.reverse(),i!=null&&i.length>0&&i.forEach(r=>{r.replacedValues.forEach(a=>{n=n.replace(new RegExp(r.placeholder,"i"),Je(a))})}),n}function Gv(e,n,t){let i=ge(t,e),r=[];for(let a of i){let o=e.substring(a.start.offset,a.end.offset);r.push(o),e=le(e,a.start.offset,a.end.offset,n)}return r.reverse(),{newText:e,replacedValues:r}}function Zv(e,n,t){let i=e.match(t),r=[];if(t.flags.includes("g")){if(e=e.replaceAll(t,n),i)for(let a of i)r.push(a)}else e=e.replace(t,n),i&&r.push(i[0]);return{newText:e,replacedValues:r}}function Qv(e,n){let t=ge("link",e),i=[];for(let r of t){if(r==null)continue;let a=e.substring(r.start.offset,r.end.offset);a.match(Ir)&&(i.push(a),e=le(e,r.start.offset,r.end.offset,n))}return i.reverse(),{newText:e,replacedValues:i}}function Jv(e,n){let t=[];return e=e.replace(Fr,(i,r,a)=>(t.push(a),r+n)),{newText:e,replacedValues:t}}function Xv(e,n){let t=Ii(e),i=new Array(t.length),r=0,a=i.length;for(let o of t)i[a-1-r++]=e.substring(o.startIndex,o.endIndex),e=le(e,o.startIndex,o.endIndex,n);return{newText:e,replacedValues:i}}function ek(e,n){let t=Fp(e),i=new Array(t.length),r=0,a=i.length;for(let o of t)i[a-1-r++]=e.substring(o.startIndex,o.endIndex),e=le(e,o.startIndex,o.endIndex,n);return{newText:e,replacedValues:i}}var K=(o=>(o.YAML="YAML",o.HEADING="Heading",o.FOOTNOTE="Footnote",o.CONTENT="Content",o.SPACING="Spacing",o.PASTE="Paste",o))(K||{}),rs=class{constructor(n,t,i,r,a,o,s=[],l=!1,c=[],u=null){this.nameKey=n;this.descriptionKey=t;this.settingsKey=i;this.alias=r;this.type=a;this.applyAfterIgnore=o;this.options=s;this.hasSpecialExecutionOrder=l;this.ignoreTypes=c;this.ruleHeading=this.getName().toLowerCase().replaceAll(" ","-"),s.unshift(new kn("enabled",this.descriptionKey,"",!1,r,(d,m)=>{if(d&&u&&u(d,m),s.length>1)for(let p=1;p<s.length;p++)d?s[p].unhide():s[p].hide()}));for(let d of s)d.ruleAlias=r}getDefaultOptions(){let n={};for(let t of this.options)n[t.configKey]=t.defaultValue;return n}getOptions(n){return n.ruleConfigs[this.settingsKey]}getName(){return x(this.nameKey)}getDescription(){return x(this.descriptionKey)}getURL(){return"https://platers.github.io/obsidian-linter/settings/"+this.type.toLowerCase()+"-rules/#"+this.ruleHeading}enabledOptionName(){return this.options[0].configKey}apply(n,t){return ke(this.ignoreTypes,n,i=>this.applyAfterIgnore(i,t))}};var Cm=Object.values(K);function as(e){let n=zi(e);if(n===null)return[[],!1];let t=tm(n);return t.includes("all")?[Bt.map(i=>i.alias),!0]:[t,!1]}var Bt=[],lt={},$n=new Map;function Om(e){Bt.push(e),lt[e.alias]=e,$n.has(e.type)?$n.get(e.type).push(e):$n.set(e.type,[e])}function Mm(){Bt.sort((e,n)=>Cm.indexOf(e.type)-Cm.indexOf(n.type)||e.settingsKey.localeCompare(n.settingsKey))}function os(e,n){let t;throw e instanceof Gu?(t=e.toString(),t=x("logs.wrapper-yaml-error").replace("{ERROR_MESSAGE}",t.substring(t.indexOf(":")+1))):t=x("logs.wrapper-unkno
[ ]{`+Math.min.apply(Math,r)+"}","g");i=i.map(function(s){return s.replace(a,`
`)})}i[0]=i[0].replace(/^\r?\n/,"");var o=i[0];return n.forEach(function(s,l){var c=o.match(/(?:^|\n)( *)$/),u=c?c[1]:"",d=s;typeof s=="string"&&s.includes(`
`)&&(d=String(s).split(`
`).map(function(m,p){return p===0?m:""+u+m}).join(`
`)),o+=d+i[l+1]}),o}var Fm=tk;var js=require("obsidian");var $i,Ur,wn,et=class et{static getRule(){if(!Y(et,$i).has(this.name)){let n=new this,t=new rs(n.nameKey,n.descriptionKey,n.settingsKey,n.alias,n.type,n.safeApply.bind(n),n.optionBuilders.map(i=>i.option),n.hasSpecialExecutionOrder,n.ignoreTypes,n.disableConflictingOptions);Y(et,$i).set(this.name,t),Y(et,Ur).set(n.alias,n)}return Y(et,$i).get(this.name)}static applyIfEnabledBase(n,t,i,r){let a=n.getOptions(i);if(a[n.enabledOptionName()]){In(n.alias);let o=Object.assign({},a,r);nt(`${x("logs.run-rule-text")} ${n.getName()}`);try{let s=n.apply(t,o);return rn(n.alias),nt(s),[s,!0]}catch(s){rn(n.alias),os(s,n.getName())}}else return[t,!1]}static getBuilderByName(n){return Y(et,Ur).get(n)}static setNoSettingControl(n,t){Y(et,wn).has(n)||Y(et,wn).set(n,[]),Y(et,wn).get(n).push(t)}static hasSettingControl(n,t){return!Y(et,wn).has(n)||!Y(et,wn).get(n).includes(t)}};$i=new WeakMap,Ur=new WeakMap,wn=new WeakMap,xe(et,$i,new Map),xe(et,Ur,new Map),xe(et,wn,new Map);var An=et,y=class extends An{constructor(n){super(),this.alias=n.nameKey.substring(6,n.nameKey.length-5),this.settingsKey=this.alias,this.nameKey=n.nameKey,this.descriptionKey=n.descriptionKey,this.type=n.type,this.hasSpecialExecutionOrder=n.hasSpecialExecutionOrder??!1,this.disableConflictingOptions=n.disableConflictingOptions??null,n.ruleIgnoreTypes?this.ignoreTypes=[g.customIgnore,...n.ruleIgnoreTypes]:this.ignoreTypes=[g.customIgnore]}static register(n){let t=n.getRule();Om(t)}safeApply(n,t){return this.apply(n,this.buildRuleOptions(t))}buildRuleOptions(n){n=n??{};let t=new this.OptionsClass,i=Object.assign(t,n);for(let r of this.optionBuilders)r.setRuleOption(i,n);return i}static applyIfEnabled(n,t,i,r){let a=this.getRule();return i.includes(a.alias)?(nt(a.alias+" "+x("logs.disabled-text")),[n,!1]):An.applyIfEnabledBase(a,n,t,r)}static getRuleOptions(n){let t=An.getRule.bind(this)(),i=new this,r=t.getOptions(n);return i.buildRuleOptions(r)}static noSettingControl(){return(n,t)=>{let i=n.constructor.name;An.setNoSettingControl(i,t)}}};var Gi,Gt=class{constructor(n){xe(this,Gi,void 0);this.OptionsClass=n.OptionsClass;let t=n.nameKey.split(".");t.length==1?this.configKey=t[0]:this.configKey=t[t.length-2],this.nameKey=n.nameKey,this.descriptionKey=n.descriptionKey,this.optionsKey=n.optionsKey}get defaultValue(){return new this.OptionsClass()[this.optionsKey]}get option(){return Y(this,Gi)||Fe(this,Gi,this.buildOption()),Y(this,Gi)}setRuleOption(n,t){let i=t[this.configKey];i!==void 0&&(n[this.optionsKey]=i)}};Gi=new WeakMap;var q=class extends Gt{constructor(n){super(n),this.onChange=n.onChange??null}buildOption(){return new kn(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,null,this.onChange)}},ss=class extends Gt{buildOption(){return new qr(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},J=class extends Gt{constructor(n){super(n),this.records=n.records.map(t=>new ts("enums."+t.value,t.description))}buildOption(){return new ns(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,this.records)}},pe=class extends Gt{constructor(n){super(n),this.separator=n.separator??`
`,this.splitter=n.splitter??/\n/}buildOption(){return new Xo(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue.join(this.separator))}setRuleOption(n,t){if(t[this.configKey]!==void 0){let i=t[this.configKey].split(this.splitter).filter(function(r){return r!=""});n[this.optionsKey]=i}}},we=class extends Gt{buildOption(){return new qr(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},ls=class extends Gt{buildOption(){return new es(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},cs=class extends Gt{buildOption(){return new is(this.configKey,this.nameKey,this.descriptionKey)}};var Ec=class{},xn=class extends y{constructor(){super({nameKey:"rules.add-blank-line-after-yaml.name",descriptionKey:"rules.add-blank-line-after-yaml.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Ec}apply(n,t){let i=n.match(Ne);if(i===null)return n;let r=i[0],a=n.indexOf(r)+r.length;return a+1>=n.length||n.trimEnd()===r.trimEnd()||n.charAt(a+1)===`
`?n:n.replace(r,r+`
`)}get optionBuilders(){return[]}};xn=L([y.register],xn);var Gn=class{constructor(){this.ignoreWords=[];this.extraAutoCorrectFiles=[];this.skipWordsWithMultipleCapitals=!1;this.misspellingToCorrection=new Map}};L([y.noSettingControl()],Gn.prototype,"misspellingToCorrection",2);var Zn=class extends y{constructor(){super({nameKey:"rules.auto-correct-common-misspellings.name",descriptionKey:"rules.auto-correct-common-misspellings.description",type:"Content",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[g.yaml,g.code,g.inlineCode,g.math,g.inlineMath,g.link,g.wikiLink,g.tag,g.image,g.url]})}get OptionsClass(){return Gn}apply(n,t){return n.replaceAll(Up,i=>this.replaceWordWithCorrectCasing(i,t))}replaceWordWithCorrectCasing(n,t){let i=n.toLowerCase();if(t.ignoreWords.includes(i)||t.skipWordsWithMultipleCapitals&&n.length>1&&i.substring(1)!==n.substring(1))return n;if(t.misspellingToCorrection.has(i))return this.determineCorrectedWord(n,t.misspellingToCorrection.get(i));if(t.extraAutoCorrectFiles){for(let r=0;r<t.extraAutoCorrectFiles.length;r++)if(t.extraAutoCorrectFiles[r].customReplacements instanceof Map&&t.extraAutoCorrectFiles[r].customReplacements?.has(i))return this.determineCorrectedWord(n,t.extraAutoCorrectFiles[r].customReplacements.get(i))}return n}determineCorrectedWord(n,t){return n.charAt(0)==n.charAt(0).toUpperCase()&&(t=t.charAt(0).toUpperCase()+t.substring(1)),t}get optionBuilders(){return[new pe({OptionsClass:Gn,nameKey:"rules.auto-correct-common-misspellings.ignore-words.name",descriptionKey:"rules.auto-correct-common-misspellings.ignore-words.description",optionsKey:"ignoreWords",splitter:Rr,separator:", "}),new q({OptionsClass:Gn,nameKey:"rules.auto-correct-common-misspellings.skip-words-with-multiple-capitals.name",descriptionKey:"rules.auto-correct-common-misspellings.skip-words-with-multiple-capitals.description",optionsKey:"skipWordsWithMultipleCapitals"}),new cs({OptionsClass:Gn,nameKey:"rules.auto-correct-common-misspellings.extra-auto-correct-files.name",descriptionKey:"rules.auto-correct-common-misspellings.extra-auto-correct-files.description",optionsKey:"extraAutoCorrectFiles"})]}};Zn=L([y.register],Zn);var us=class{constructor(){this.style="space"}},Qn=class extends y{constructor(){super({nameKey:"rules.blockquote-style.name",descriptionKey:"rules.blockquote-style.description",type:"Content",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[g.html,g.code,g.math]})}get OptionsClass(){return us}apply(n,t){return t.style==="space"?ac(n,i=>this.updateBlockquoteLines(i,this.addSpaceToIndicator)):ac(n,i=>this.updateBlockquoteLines(i,this.removeSpaceFromIndicator))}removeSpaceFromIndicator(n,t){return t?n.replace(/>[ \t]+>/g,">>"):n.replace(/>[ \t]+/g,">")}addSpaceToIndicator(n,t){let i=n.replace(/>([^ ]|$)/g,"> $1").replace(/>>/g,"> >");return t?i:i.replace(/>(?:[ \t]{2,}|\t+)/g,"> ")}updateBlockquoteLines(n,t){let i=0,r=0,a="",o="",s=0,l=n,c=!1;do{r=l.indexOf(`
`,i),r===-1&&(r=l.length-1,c=!0),[a,s]=Oi(l,r-1);let u=s+a.length+1,d=r;c&&d++;let m=l.substring(u,d);if(m.includes(g.math.placeholder)||m.includes(g.code.placeholder)){i++;continue}let p=zo.test(m);o=t(a,p),s++,l=le(l,s,s+a.length,o),i=r+1+o.length-a.length}while(!c);return l}get optionBuilders(){return[new J({OptionsClass:us,nameKey:"rules.blockquote-style.style.name",descriptionKey:"rules.blockquote-style.style.description",optionsKey:"style",records:[{value:"space",description:"> indicator is followed by a space"},{value:"no space",description:">indicator is not followed by a space"}]})]}};Qn=L([y.register],Qn);var ds=class{};L([y.noSettingControl()],ds.prototype,"lineContent",2);var Jn=class extends y{constructor(){super({nameKey:"rules.add-blockquote-indentation-on-paste.name",descriptionKey:"rules.add-blockquote-indentation-on-paste.description",type:"Paste"})}get OptionsClass(){return ds}apply(n,t){let i=/^(\s*)((> ?)+) .*/,r=t.lineContent.match(i);if(!r)return n;let a=r[1]??"",o=r[2]??"";return n.trim().replace(/\n/gm,`
${a}${o} `)}get optionBuilders(){return[]}};Jn=L([y.register],Jn);var Xn=class{constructor(){this.style="Title Case";this.ignoreWords=["macOS","iOS","iPhone","iPad","JavaScript","TypeScript","AppleScript","I"];this.lowercaseWords=["a","an","the","aboard","about","abt.","above","abreast","absent","across","after","against","along","aloft","alongside","amid","amidst","mid","midst","among","amongst","anti","apropos","around","round","as","aslant","astride","at","atop","ontop","bar","barring","before","B4","behind","below","beneath","neath","beside","besides","between","'tween","beyond","but","by","chez","circa","c.","ca.","come","concerning","contra","counting","cum","despite","spite","down","during","effective","ere","except","excepting","excluding","failing","following","for","from","in","including","inside","into","less","like","minus","modulo","mod","near","nearer","nearest","next","notwithstanding","of","o'","off","offshore","on","onto","opposite","out","outside","over","o'er","pace","past","pending","per","plus","post","pre","pro","qua","re","regarding","respecting","sans","save","saving","short","since","sub","than","through","thru","throughout","thruout","till","times","to","t'","touching","toward","towards","under","underneath","unlike","until","unto","up","upon","versus","vs.","v.","via","vice","vis-\xE0-vis","wanting","with","w/","w.","c\u0304","within","w/i","without","'thout","w/o","abroad","adrift","aft","afterward","afterwards","ahead","apart","ashore","aside","away","back","backward","backwards","beforehand","downhill","downstage","downstairs","downstream","downward","downwards","downwind","east","eastward","eastwards","forth","forward","forwards","heavenward","heavenwards","hence","henceforth","here","hereby","herein","hereof","hereto","herewith","home","homeward","homewards","indoors","inward","inwards","leftward","leftwards","north","northeast","northward","northwards","northwest","now","onward","onwards","outdoors","outward","outwards","overboard","overhead","overland","overseas","rightward","rightwards","seaward","seawards","skywards","skyward","south","southeast","southwards","southward","southwest","then","thence","thenceforth","there","thereby","therein","thereof","thereto","therewith","together","underfoot","underground","uphill","upstage","upstairs","upstream","upward","upwards","upwind","west","westward","westwards","when","whence","where","whereby","wherein","whereto","wherewith","although","because","considering","given","granted","if","lest","once","provided","providing","seeing","so","supposing","though","unless","whenever","whereas","wherever","while","whilst","ago","according to","as regards","counter to","instead of","owing to","pertaining to","at the behest of","at the expense of","at the hands of","at risk of","at the risk of","at variance with","by dint of","by means of","by virtue of","by way of","for the sake of","for sake of","for lack of","for want of","from want of","in accordance with","in addition to","in case of","in charge of","in compliance with","in conformity with","in contact with","in exchange for","in favor of","in front of","in lieu of","in light of","in the light of","in line with","in place of","in point of","in quest of","in relation to","in regard to","with regard to","in respect to","with respect to","in return for","in search of","in step with","in touch with","in terms of","in the name of","in view of","on account of","on behalf of","on grounds of","on the grounds of","on the part of","on top of","with a view to","with the exception of","\xE0 la","a la","as soon as","as well as","close to","due to","far from","in case","other than","prior to","pursuant to","regardless of","subsequent to","as long as","as much as","as far as","by the time","in as much as","inasmuch","in order to","in order that","even","provide that","if only","whether","whose","whoever","why","how","or not","whatever","what","both","and","or","not only","but also","either","neither","nor","just","rather","no sooner","such","that","yet","is","it"];this.ignoreCasedWords=!0}},ei=class extends y{const
`),i=i.replace(/\n+---/,`
---`),t.innerNewLines&&(i=i.replaceAll(/\n{2,}/g,`
`)),i))}get optionBuilders(){return[new q({OptionsClass:ps,nameKey:"rules.compact-yaml.inner-new-lines.name",descriptionKey:"rules.compact-yaml.inner-new-lines.description",optionsKey:"innerNewLines"})]}};Wr=L([y.register],Wr);var Tc=class{},ti=class extends y{constructor(){super({nameKey:"rules.consecutive-blank-lines.name",descriptionKey:"rules.consecutive-blank-lines.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag],hasSpecialExecutionOrder:!0})}get OptionsClass(){return Tc}apply(n,t){return n.replace(/(\n([\t\v\f\r \u00a0\u2000-\u200b\u2028-\u2029\u3000]+)?){2,}\n/g,`
`)}get optionBuilders(){return[]}};ti=L([y.register],ti);var Cc=class{},Vr=class extends y{constructor(){super({nameKey:"rules.convert-bullet-list-markers.name",descriptionKey:"rules.convert-bullet-list-markers.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Cc}apply(n,t){return n.replace(/^([^\S\n]*)([•§])([^\S\n]*)/gm,"$1-$3")}get optionBuilders(){return[]}};Vr=L([y.register],Vr);var ms=class{constructor(){this.tabsize=4}},jr=class extends y{constructor(){super({nameKey:"rules.convert-spaces-to-tabs.name",descriptionKey:"rules.convert-spaces-to-tabs.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return ms}apply(n,t){let i=String(t.tabsize),r=new RegExp("^( *) {"+i+"}","gm");n=this.replaceAllRegexMatches(n,r);let a=new RegExp("^((>( | *))*(>( | )) *) {"+i+"}","gm");return n=this.replaceAllRegexMatches(n,a),n}replaceAllRegexMatches(n,t){for(;n.match(t)!=null;)n=n.replace(t,"$1 ");return n}get optionBuilders(){return[new ss({OptionsClass:ms,nameKey:"rules.convert-spaces-to-tabs.tabsize.name",descriptionKey:"rules.convert-spaces-to-tabs.tabsize.description",optionsKey:"tabsize"})]}};jr=L([y.register],jr);var Tt=class{constructor(){this.aliasArrayStyle="single-line";this.dedupeAliasKey=!0;this.tagArrayStyle="single-line";this.dedupeTagKey=!0;this.dedupeArrayKeys=!0;this.ignoreDedupeArrayKeys=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};L([y.noSettingControl()],Tt.prototype,"aliasArrayStyle",2),L([y.noSettingControl()],Tt.prototype,"tagArrayStyle",2),L([y.noSettingControl()],Tt.prototype,"defaultEscapeCharacter",2),L([y.noSettingControl()],Tt.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var $r=class extends y{constructor(){super({nameKey:"rules.dedupe-yaml-array-values.name",descriptionKey:"rules.dedupe-yaml-array-values.description",type:"YAML"})}get OptionsClass(){return Tt}apply(n,t){return he(n,i=>{let r=st(i.replace(`---
`,"").replace(`
---`,""));if(!r)return i;for(let a of At)if(t.dedupeAliasKey&&Object.keys(r).includes(a)){i=ae(i,a,be(gn(this.getUniqueArray(Re(ue(i,a)))),t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let a of wt)if(t.dedupeTagKey&&Object.keys(r).includes(a)){i=ae(i,a,be(fn(this.getUniqueArray(Re(ue(i,a)))),t.tagArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(t.dedupeArrayKeys){let a=[...At,...wt,...t.ignoreDedupeArrayKeys];for(let o of Object.keys(r)){if(a.includes(o)||!Array.isArray(r[o])||r[o].length!==0&&typeof r[o][0]=="object"&&r[o][0]!==null)continue;let s=ue(i,o),l="single-line";s.includes(`
`)&&(l="multi-line");let c=this.getUniqueArray(Re(s));i=ae(i,o,be(c,l,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays))}}return i})}getUniqueArray(n){return n==null||typeof n=="string"||n.length<=1?n:[...new Set(n)]}get optionBuilders(){return[new q({OptionsClass:Tt,nameKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.description",optionsKey:"dedupeAliasKey"}),new q({OptionsClass:Tt,nameKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.description",optionsKey:"dedupeTagKey"}),new q({OptionsClass:Tt,nameKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.description",optionsKey:"dedupeArrayKeys"}),new pe({OptionsClass:Tt,nameKey:"rules.dedupe-yaml-array-values.ignore-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.ignore-keys.description",optionsKey:"ignoreDedupeArrayKeys"})]}};$r=L([y.register],$r);var fs=class{constructor(){this.defaultLanguage=""}},Gr=class extends y{constructor(){super({nameKey:"rules.default-language-for-code-fences.name",descriptionKey:"rules.default-language-for-code-fences.description",type:"Content",ruleIgnoreTypes:[g.yaml,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return fs}apply(n,t){return Rp(n,t.defaultLanguage)}get optionBuilders(){return[new we({OptionsClass:fs,nameKey:"rules.default-language-for-code-fences.default-language.name",descriptionKey:"rules.default-language-for-code-fences.default-language.description",optionsKey:"defaultLanguage"})]}};Gr=L([y.register],Gr);var gs=class{constructor(){this.style="consistent"}},Zr=class extends y{constructor(){super({nameKey:"rules.emphasis-style.name",descriptionKey:"rules.emphasis-style.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag,g.math,g.inlineMath]})}get OptionsClass(){return gs}apply(n,t){return Ko(n,t.style,"emphasis")}get optionBuilders(){return[new J({OptionsClass:gs,nameKey:"rules.emphasis-style.style.name",descriptionKey:"rules.emphasis-style.style.description",optionsKey:"style",records:[{value:"consistent",description:"Makes sure the first instance of emphasis is the style that will be used throughout the document"},{value:"asterisk",description:"Makes sure * is the emphasis indicator"},{value:"underscore",description:"Makes sure _ is the emphasis indicator"}]})]}};Zr=L([y.register],Zr);var Oc=class{},Qr=class extends y{constructor(){super({nameKey:"rules.empty-line-around-blockquotes.name",descriptionKey:"rules.empty-line-around-blockquotes.description",type:"Spacing"})}get OptionsClass(){return Oc}apply(n,t){return Tp(n)}get optionBuilders(){return[]}};Qr=L([y.register],Qr);var Mc=class{},Jr=class extends y{constructor(){super({nameKey:"rules.empty-line-around-code-fences.name",descriptionKey:"rules.empty-line-around-code-fences.description",type:"Spacing"})}get OptionsClass(){return Mc}apply(n,t){return Sp(n)}get optionBuilders(){return[]}};Jr=L([y.register],Jr);var Ic=class{},Xr=class extends y{constructor(){super({nameKey:"rules.empty-line-around-horizontal-rules.name",descriptionKey:"rules.empty-line-around-horizontal-rules.description",type:"Spacing"})}get OptionsClass(){return Ic}apply(n,t){return Cp(n)}get optionBuilders(){return[]}};Xr=L([y.register],Xr);var hs=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};L([y.noSettingControl()],hs.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var ea=class extends y{constructor(){super({nameKey:"rules.empty-line-around-math-blocks.name",descriptionKey:"rules.empty-line-around-math-blocks.description",type:"Spacing",ruleIgnoreTypes:[g.yaml,g.code]})}get OptionsClass(){return hs}apply(n,t){return Ep(n,t.minimumNumberOfDollarSignsToBeAMathBlock)}get optionBuilders(){return[]}};ea=L([y.register],ea);var Fc=class{},ta=class extends y{constructor(){super({nameKey:"rules.empty-line-around-tables.name",descriptionKey:"rules.empty-line-around-tables.descri
`),a=r.length;if(a<1)return i;for(let o=0;o<a;o++){let s=r[o].trim(),l=s.indexOf(":"),c=l<0||l+1>=s.length,u=s.startsWith("-"),d=u&&s.length<2;if(c&&d)continue;let m=1;if(!u)m+=l;else if(l!==-1&&o+1<a){let f=r[o],b=f.indexOf("-")+1;for(;b<f.length&&f.charAt(b)===" ";)b++;let h=0,k=r[o+1];for(;h<k.length&&k.charAt(h)===" ";)h++;b<=h&&(m+=l)}let p=s.substring(m).trim();if(p.startsWith("[")){if(t.tryToEscapeSingleLineArrays){if(p.length<3)continue;let f=p.substring(1,p.length-1).split(","),b=f.length;for(let h=0;h<b;h++){let k=f[h].trim();k.startsWith("[")&&(k=k.substring(1).trimStart()),k.endsWith("]")&&(k=k.substring(0,k.length-1).trimEnd()),f[h]=f[h].replace(k,xt(k,t.defaultEscapeCharacter,!1,!0))}r[o]=r[o].replace(p,"["+f.join(",")+"]")}continue}r[o]=r[o].replace(p,xt(p,t.defaultEscapeCharacter,!1,!0))}return r.join(`
`)})}get optionBuilders(){return[new q({OptionsClass:na,nameKey:"rules.escape-yaml-special-characters.try-to-escape-single-line-arrays.name",descriptionKey:"rules.escape-yaml-special-characters.try-to-escape-single-line-arrays.description",optionsKey:"tryToEscapeSingleLineArrays"})]}};ni=L([y.register],ni);var Rm=require("obsidian");var Dt=class extends Rm.Modal{constructor(n,t,i,r,a){super(n),this.modalEl.addClass("confirm-modal"),this.contentEl.createEl("h3",{text:x("warning-text"),cls:"modal-heading"});let o=this.contentEl.createEl("p");o.id="confirm-dialog",it(x("disabled-other-rule-notice").replace("{NAME_1}",x(t)).replace("{NAME_2}",x(i)),o),this.contentEl.createDiv("modal-button-container",s=>{s.createEl("button",{text:x("cancel-button-text")}).addEventListener("click",()=>{a(),this.close()});let l=s.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:x("ok")});l.addEventListener("click",()=>{this.close(),r()}),setTimeout(()=>{l.focus()},50)})}};var ys=class{};L([y.noSettingControl()],ys.prototype,"fileName",2);var ia=class extends y{constructor(){super({nameKey:"rules.file-name-heading.name",descriptionKey:"rules.file-name-heading.description",type:"Heading",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag],disableConflictingOptions(n,t){let i=lt["header-increment"],r=i.options[0],a=i.options[1];n&&r.getValue()&&new Dt(t,"rules.file-name-heading.name","rules.header-increment.start-at-h2.name",()=>{a.setValue(!1)},()=>{lt["file-name-heading"].options[0].setValue(!1)}).open()}})}get OptionsClass(){return ys}apply(n,t){if(n.match(/^#\s.*/m))return n;let r=t.fileName,a=n.indexOf(`
---`);a=a==-1||!n.startsWith(`---
`)?0:a+5;let o=`# ${r}
`;return n.length<a&&(o=`
`+o),Fn(n,a,o)}get optionBuilders(){return[]}};ia=L([y.register],ia);var Rc=class{},ra=class extends y{constructor(){super({nameKey:"rules.footnote-after-punctuation.name",descriptionKey:"rules.footnote-after-punctuation.description",type:"Footnote",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.yaml,g.link,g.wikiLink,g.tag,g.footnoteAtStartOfLine,g.footnoteAfterATask]})}get OptionsClass(){return Rc}apply(n,t){return n.replace(/(\[\^[^\]]+\]) ?([,.;!:?])/gm,"$2$1")}get optionBuilders(){return[]}};ra=L([y.register],ra);var aa=class{constructor(){this.defaultEscapeCharacter='"';this.forceYamlEscape=[]}};L([y.noSettingControl()],aa.prototype,"defaultEscapeCharacter",2);var ii=class extends y{constructor(){super({nameKey:"rules.force-yaml-escape.name",descriptionKey:"rules.force-yaml-escape.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return aa}apply(n,t){return he(n,i=>{for(let r of t.forceYamlEscape){let a=ue(i,r);if(a!=null){if(a.includes(`
`)||a.startsWith(" [")||Ni(a))continue;a=xt(a,t.defaultEscapeCharacter,!0),i=ae(i,r," "+a)}}return i})}get optionBuilders(){return[new pe({OptionsClass:aa,nameKey:"rules.force-yaml-escape.force-yaml-escape-keys.name",descriptionKey:"rules.force-yaml-escape.force-yaml-escape-keys.description",optionsKey:"forceYamlEscape"})]}};ii=L([y.register],ii);var Bc=class{},ri=class extends y{constructor(){super({nameKey:"rules.format-tags-in-yaml.name",descriptionKey:"rules.format-tags-in-yaml.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Bc}apply(n,t){return he(n,i=>i.replace(new RegExp(`^(${Dr}|${sc}):[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m"),function(r){return r.replaceAll("#","")}))}get optionBuilders(){return[]}};ri=L([y.register],ri);var ct=class{constructor(){this.aliasArrayStyle="single-line";this.formatAliasKey=!0;this.tagArrayStyle="single-line";this.formatTagKey=!0;this.defaultArrayStyle="single-line";this.formatArrayKeys=!0;this.forceSingleLineArrayStyle=[];this.forceMultiLineArrayStyle=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};L([y.noSettingControl()],ct.prototype,"aliasArrayStyle",2),L([y.noSettingControl()],ct.prototype,"tagArrayStyle",2),L([y.noSettingControl()],ct.prototype,"defaultEscapeCharacter",2),L([y.noSettingControl()],ct.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var oa=class extends y{constructor(){super({nameKey:"rules.format-yaml-array.name",descriptionKey:"rules.format-yaml-array.description",type:"YAML"})}get OptionsClass(){return ct}apply(n,t){return he(n,i=>{let r=st(i.replace(`---
`,"").replace(`
---`,""));if(!r)return i;for(let a of At)if(t.formatAliasKey&&Object.keys(r).includes(a)){i=ae(i,a,be(gn(Re(ue(i,a))),t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let a of wt)if(t.formatTagKey&&Object.keys(r).includes(a)){i=ae(i,a,be(fn(Re(ue(i,a))),t.tagArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(t.formatArrayKeys){let a=[...At,...wt,...t.forceMultiLineArrayStyle,...t.forceSingleLineArrayStyle];for(let o of Object.keys(r))a.includes(o)||!Array.isArray(r[o])||r[o].length!==0&&typeof r[o][0]=="object"&&r[o][0]!==null||(i=ae(i,o,be(Re(ue(i,o)),t.defaultArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays)))}for(let a of t.forceSingleLineArrayStyle)Object.keys(r).includes(a)&&(i=ae(i,a,be(Re(ue(i,a)),"single-line",t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays)));for(let a of t.forceMultiLineArrayStyle)Object.keys(r).includes(a)&&(i=ae(i,a,be(Re(ue(i,a)),"multi-line",t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays)));return i})}get optionBuilders(){return[new q({OptionsClass:ct,nameKey:"rules.format-yaml-array.alias-key.name",descriptionKey:"rules.format-yaml-array.alias-key.description",optionsKey:"formatAliasKey"}),new q({OptionsClass:ct,nameKey:"rules.format-yaml-array.tag-key.name",descriptionKey:"rules.format-yaml-array.tag-key.description",optionsKey:"formatTagKey"}),new J({OptionsClass:ct,nameKey:"rules.format-yaml-array.default-array-style.name",descriptionKey:"rules.format-yaml-array.default-array-style.description",optionsKey:"defaultArrayStyle",records:[{value:"multi-line",description:"```key:\\n - value```"},{value:"single-line",description:"```key: [value]```"}]}),new q({OptionsClass:ct,nameKey:"rules.format-yaml-array.default-array-keys.name",descriptionKey:"rules.format-yaml-array.default-array-keys.description",optionsKey:"formatArrayKeys"}),new pe({OptionsClass:ct,nameKey:"rules.format-yaml-array.force-single-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-single-line-array-style.description",optionsKey:"forceSingleLineArrayStyle"}),new pe({OptionsClass:ct,nameKey:"rules.format-yaml-array.force-multi-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-multi-line-array-style.description",optionsKey:"forceMultiLineArrayStyle"})]}};oa=L([y.register],oa);var bs=class{constructor(){this.startAtH2=!1}},sa=class extends y{constructor(){super({nameKey:"rules.header-increment.name",descriptionKey:"rules.header-increment.description",type:"Heading",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return bs}apply(n,t){let i=0,r=t.startAtH2?2:1,a=[],o=[0,0,0,0,0,0],s=o.length;return n.replace(pn,(l,c="",u="",d="",m="",p="")=>{let f=u.length;if(f=f<=s?f:s,o[f-1]>=0&&f<i){let b=o.length;for(;a.length!==0&&f<=a[a.length-1];)b=a.pop();a.length===0?b=0:b--;for(let h=o.length-1;h>=b;h--)o[h]=0}if(o[f-1]<=0){let b=i,h=a.length+r;h=h<=s?h:s;for(let k=b;k<f-1;k++)o[k]=h-1;a.push(f),o[f-1]=h}return i=f,c+"#".repeat(o[f-1])+d+m+p})}get optionBuilders(){return[new q({OptionsClass:bs,nameKey:"rules.header-increment.start-at-h2.name",descriptionKey:"rules.header-increment.start-at-h2.description",optionsKey:"startAtH2",onChange(n,t){let i=lt["file-name-heading"].options[0];n&&i.getValue()&&new Dt(t,"rules.header-increment.start-at-h2.name","rules.file-name-heading.name",()=>{i.setValue(!1)},()=>{lt["header-increment"].options[1].setValue(!1)}).open()}})]}};sa=L([y.register],sa);var ca=class{constructor(){this.bottom=!0;this.emptyLineAfterYaml=!0}},la=class extends y{constructor(){super({nameKey:"rules.heading-blank-lines.name",descriptionKey:"rules.heading-blank-lines.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink]})}get OptionsClass(){return ca}apply(n,t){return t.bottom?(n=n.replace(/^(#+\s.*)/gm,`
$1
`),n=n.replace(/\n+(#+\s.*)/g,`
$1`),n=n.replace(/(^#+\s.*)\n+/gm,`$1
`)):n=n.replace(/^([^#\n][^\n]+)\n+(#+\s.*)/gm,`$1
$2`),n=n.replace(/^\n+(#+\s.*)/,"$1"),n=n.replace(/(#+\s.*)\n+$/,"$1"),t.emptyLineAfterYaml||(n=n.replace(new RegExp("("+Ne.source+")\\n+(#+\\s.*)"),`$1
$5`)),n}get optionBuilders(){return[new q({OptionsClass:ca,nameKey:"rules.heading-blank-lines.bottom.name",descriptionKey:"rules.heading-blank-lines.bottom.description",optionsKey:"bottom"}),new q({OptionsClass:ca,nameKey:"rules.heading-blank-lines.empty-line-after-yaml.name",descriptionKey:"rules.heading-blank-lines.empty-line-after-yaml.description",optionsKey:"emptyLineAfterYaml"})]}};la=L([y.register],la);var Dc=class{},ua=class extends y{constructor(){super({nameKey:"rules.headings-start-line.name",descriptionKey:"rules.headings-start-line.description",type:"Heading",ruleIgnoreTypes:[g.code,g.math,g.yaml]})}get OptionsClass(){return Dc}apply(n,t){return n.replaceAll(pn,i=>i.trimStart())}get optionBuilders(){return[]}};ua=L([y.register],ua);var vs=class{constructor(){this.textToInsert=["aliases: ","tags: "]}},da=class extends y{constructor(){super({nameKey:"rules.insert-yaml-attributes.name",descriptionKey:"rules.insert-yaml-attributes.description",type:"YAML"})}get OptionsClass(){return vs}apply(n,t){return n=Rt(n),he(n,i=>{let r=t.textToInsert.reverse(),a=st(i.match(Ne)[1]);for(let o of r){let s=o.split(":")[0];Object.prototype.hasOwnProperty.call(a,s)||(i=i.replace(/^---\n/,Je(`---
${o}
`)))}return i})}get optionBuilders(){return[new pe({OptionsClass:vs,nameKey:"rules.insert-yaml-attributes.text-to-insert.name",descriptionKey:"rules.insert-yaml-attributes.text-to-insert.description",optionsKey:"textToInsert"})]}};da=L([y.register],da);var Kc=class{},pa=class extends y{constructor(){super({nameKey:"rules.line-break-at-document-end.name",descriptionKey:"rules.line-break-at-document-end.description",type:"Spacing"})}get OptionsClass(){return Kc}apply(n,t){return n.length===0||(n=n.replace(/\n+$/g,""),n+=`
`),n}get optionBuilders(){return[]}};pa=L([y.register],pa);var zc=class{},ma=class extends y{constructor(){super({nameKey:"rules.move-footnotes-to-the-bottom.name",descriptionKey:"rules.move-footnotes-to-the-bottom.description",type:"Footnote",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.yaml]})}get OptionsClass(){return zc}apply(n,t){return bp(n)}get optionBuilders(){return[]}};ma=L([y.register],ma);var ks=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};L([y.noSettingControl()],ks.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var ai=class extends y{constructor(){super({nameKey:"rules.move-math-block-indicators-to-their-own-line.name",descriptionKey:"rules.move-math-block-indicators-to-their-own-line.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.inlineCode],hasSpecialExecutionOrder:!0})}get OptionsClass(){return ks}apply(n,t){return Ip(n,t.minimumNumberOfDollarSignsToBeAMathBlock)}get optionBuilders(){return[]}};ai=L([y.register],ai);var Ln=class{constructor(){this.tagArrayStyle="single-line";this.howToHandleExistingTags="Nothing";this.tagsToIgnore=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};L([y.noSettingControl()],Ln.prototype,"tagArrayStyle",2),L([y.noSettingControl()],Ln.prototype,"defaultEscapeCharacter",2),L([y.noSettingControl()],Ln.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var fa=class extends y{constructor(){super({nameKey:"rules.move-tags-to-yaml.name",descriptionKey:"rules.move-tags-to-yaml.description",type:"YAML",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.html,g.wikiLink,g.link]})}get OptionsClass(){return Ln}apply(n,t){let i;return ke([g.yaml],n,r=>(i=Jp(r),r)),i.length===0||(n=Rt(n),n=he(n,r=>{r=r.replace(`---
`,"").replace("---","");let a=[],o=Dr;for(let c of wt){let u=ue(r,c);if(u!=null){a=fn(Re(u)),o=c;break}}let s=new Set;if(typeof a=="string")s.add(a),a=[a];else if(a!=null)for(let c of a)s.add(c);else a=[];for(let c of i){let u=c.trim().substring(1);!s.has(u)&&!t.tagsToIgnore.includes(u)&&(s.add(u),a.push(u))}return`---
${ae(r,o,be(a,t.tagArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays))}---`}),n=ke([g.yaml],n,r=>(t.howToHandleExistingTags!=="Nothing"&&(r=r.replace(Fr,a=>{let o=a.indexOf("#"),s=a.substring(o+1);return t.tagsToIgnore.includes(s)?a:t.howToHandleExistingTags==="Remove hashtag"?a.substring(0,o)+s:""})),r)),n=n.replace(/(\n---)( |\t)+/,"$1")),n}get optionBuilders(){return[new J({OptionsClass:Ln,nameKey:"rules.move-tags-to-yaml.how-to-handle-existing-tags.name",descriptionKey:"rules.move-tags-to-yaml.how-to-handle-existing-tags.description",optionsKey:"howToHandleExistingTags",records:[{value:"Nothing",description:"Leaves tags in the body of the file alone"},{value:"Remove hashtag",description:"Removes `#` from tags in content body after moving them to the YAML frontmatter"},{value:"Remove whole tag",description:"Removes the whole tag in content body after moving them to the YAML frontmatter. _Note that this removes the first space prior to the tag as well_"}]}),new pe({OptionsClass:Ln,nameKey:"rules.move-tags-to-yaml.tags-to-ignore.name",descriptionKey:"rules.move-tags-to-yaml.tags-to-ignore.description",optionsKey:"tagsToIgnore"})]}};fa=L([y.register],fa);var As=class{constructor(){this.noBareURIs=!1}},ws="'\"\u2018\u2019\u201C\u201D`[]",Bk=["http","ftp","https","smtp"],ga=class extends y{constructor(){super({nameKey:"rules.no-bare-urls.name",descriptionKey:"rules.no-bare-urls.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag,g.image,g.inlineCode,g.anchorTag,g.html]})}get OptionsClass(){return As}apply(n,t){let i=n.match(zn);if(i&&(n=this.handleMatches(n,i,!1)),t.noBareURIs){let r=n.match(Hp);r&&(n=this.handleMatches(n,r,!0))}return n}handleMatches(n,t,i){let r=0,a=t.length;for(let o=0;o<a;o++){let s=t[o],l=n.indexOf(s,r),c=l+s.length;s.charAt(0)==="<"&&(s=s.substring(1),l++),s.charAt(s.length-1)===">"&&(s=s.substring(0,s.length-1),c--);let u=l===0?void 0:n.charAt(l-1),d=c>=n.length?void 0:n.charAt(c),m=sn(s,"(");if(m!=0&&m!=sn(s,")")&&d==")"?(s+=d,c++,d=c>=n.length?void 0:n.charAt(c)):m==0&&s.endsWith(")")&&(d=")",c--,s=s.substring(0,s.length-1)),this.skipMatch(u,d,s,i)){r=l+s.length;continue}if(u!=null&&u==="<"&&d!=null&&d===">"){let p=l-1;for(;p>0&&n.charAt(p-1)==="<";)p--;let f=c;for(;f<n.length-1&&n.charAt(f+1)===">";)f++;n=le(n,p,f+1,"<"+s+">"),r=l+s.length;continue}n=le(n,l,l+s.length,"<"+s+">"),r=l+s.length+2}return n}skipMatch(n,t,i,r){let a=n!=null&&ws.includes(n)||ws.includes(i.charAt(0)),o=t!=null&&ws.includes(t)||ws.includes(i.charAt(i.length-1));return a&&o?!0:r?Bk.includes(i.substring(0,i.indexOf(":"))):!1}get optionBuilders(){return[new q({OptionsClass:As,nameKey:"rules.no-bare-urls.no-bare-uris.name",descriptionKey:"rules.no-bare-urls.no-bare-uris.description",optionsKey:"noBareURIs"})]}};ga=L([y.register],ga);var Qi=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},ha=class extends y{constructor(){super({nameKey:"rules.ordered-list-style.name",descriptionKey:"rules.ordered-list-style.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.tag]})}get OptionsClass(){return Qi}apply(n,t){return Op(n,t.numberStyle,t.listEndStyle,t.preserveStart)}get optionBuilders(){return[new J({OptionsClass:Qi,nameKey:"rules.ordered-list-style.number-style.name",descriptionKey:"rules.ordered-list-style.number-style.description",optionsKey:"numberStyle",records:[{value:"ascending",description:"Makes sure ordered list items are ascending (i.e. 1, 2, 3, etc.)"},{value:"lazy",description:"Makes sure ordered list item indicators all are the same"},{value:"preserve",description:"Preserves ordered list item indicators as they are"}]}),new J({OptionsClass:Qi,nameKey:"rules.ordered-list-style.list-end-style.name",descriptionKey:"rules.ordered-list-style.list-end-style.description",optionsKey:"listEndStyle",records:[{value:".",description:"Makes sure ordered list items indicators end in '.' (i.e `1.`)"},{value:")",description:"Makes sure ordered list item indicators end in ')' (i.e. `1)`)"}]}),new q({OptionsClass:Qi,nameKey
{2,}${i}$`,"gm"),a,o=t;do a=o.match(r),o=o.replaceAll(r,`$1
$4`);while(a);return o}}get OptionsClass(){return qc}apply(t,i){let r=`(( |\\t)*- ${Nn}( |\\t)+.+)`;t=this.replaceEmptyLinesBetweenList(t,r),t=this.replaceEmptyLinesBetweenList(t,"(( |\\t)*\\d+\\.( |\\t)+.+)"),t=this.replaceEmptyLinesBetweenList(t,"(( |\\t)*\\+( |\\t)+.+)");let s=`(( |\\t)*-(?! ${Nn})( |\\t)+.+)`;return t=this.replaceEmptyLinesBetweenList(t,s),this.replaceEmptyLinesBetweenList(t,"(( |\\t)*\\*( |\\t)+.+)")}get optionBuilders(){return[]}};La=L([y.register],La);var Uc=class{},Sa=class extends y{constructor(){super({nameKey:"rules.remove-empty-list-markers.name",descriptionKey:"rules.remove-empty-list-markers.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Uc}apply(n,t){let i=new RegExp(`^${Br}(-|\\*|\\+|\\d+[.)]|- (\\[(.)\\]))\\s*?$`,"gm");return n=n.replace(new RegExp(i.source+"\\n","gm"),""),n=n.replace(new RegExp("\\n"+i.source,"gm"),""),n.replace(i,"")}get optionBuilders(){return[]}};Sa=L([y.register],Sa);var Wc=class{},Ea=class extends y{constructor(){super({nameKey:"rules.remove-hyphenated-line-breaks.name",descriptionKey:"rules.remove-hyphenated-line-breaks.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Wc}apply(n,t){return n.replace(/\b[-] \b/g,"")}get optionBuilders(){return[]}};Ea=L([y.register],Ea);var Vc=class{},ui=class extends y{constructor(){super({nameKey:"rules.remove-hyphens-on-paste.name",descriptionKey:"rules.remove-hyphens-on-paste.description",type:"Paste"})}get OptionsClass(){return Vc}apply(n,t){return n.replace(/([^\s-])[-]\s+\n?(?=\w)/g,"$1")}get optionBuilders(){return[]}};ui=L([y.register],ui);var jc=class{},di=class extends y{constructor(){super({nameKey:"rules.remove-leading-or-trailing-whitespace-on-paste.name",descriptionKey:"rules.remove-leading-or-trailing-whitespace-on-paste.description",type:"Paste"})}get OptionsClass(){return jc}apply(n,t){return n.replace(/^[\n ]+|\s+$/g,"")}get optionBuilders(){return[]}};di=L([y.register],di);var $c=class{},pi=class extends y{constructor(){super({nameKey:"rules.remove-leftover-footnotes-from-quote-on-paste.name",descriptionKey:"rules.remove-leftover-footnotes-from-quote-on-paste.description",ruleIgnoreTypes:[g.wikiLink,g.link,g.image],type:"Paste"})}get OptionsClass(){return $c}apply(n,t){return n.replace(/(\D)[.,]\d+/g,"$1")}get optionBuilders(){return[]}};pi=L([y.register],pi);var Gc=class{},Ta=class extends y{constructor(){super({nameKey:"rules.remove-link-spacing.name",descriptionKey:"rules.remove-link-spacing.description",type:"Spacing"})}get OptionsClass(){return Gc}apply(n,t){return n=Ap(n),Zp(n)}get optionBuilders(){return[]}};Ta=L([y.register],Ta);var Zc=class{},mi=class extends y{constructor(){super({nameKey:"rules.remove-multiple-blank-lines-on-paste.name",descriptionKey:"rules.remove-multiple-blank-lines-on-paste.description",type:"Paste"})}get OptionsClass(){return Zc}apply(n,t){return n.replace(/\n{3,}/g,`
`)}get optionBuilders(){return[]}};mi=L([y.register],mi);var Qc=class{},Ca=class extends y{constructor(){super({nameKey:"rules.remove-multiple-spaces.name",descriptionKey:"rules.remove-multiple-spaces.description",type:"Content",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.inlineMath,g.yaml,g.link,g.wikiLink,g.tag,g.table]})}get OptionsClass(){return Qc}apply(n,t){return n=ke([g.list],n,i=>i.replace(/(?!^>)([^\s])( ){2,}([^\s])/gm,"$1 $3")),n=Di(n,i=>i.replace(/([^\s])( ){2,}([^\s])/gm,"$1 $3")),n}get optionBuilders(){return[]}};Ca=L([y.register],Ca);var fi=class{constructor(){this.includeFullwidthForms=!0;this.includeCJKSymbolsAndPunctuation=!0;this.includeDashes=!0;this.otherSymbols=""}},Oa=class extends y{constructor(){super({nameKey:"rules.remove-space-around-characters.name",descriptionKey:"rules.remove-space-around-characters.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return fi}apply(n,t){let i="";if(t.includeFullwidthForms&&(i+="\uFF01-\uFF5E"),t.includeCJKSymbolsAndPunctuation&&(i+="\u3000-\u303F"),t.includeDashes&&(i+="\u2013\u2014"),i+=mn(t.otherSymbols),!i)return n;let r=new RegExp(`([ ])+([${i}])`,"g"),a=new RegExp(`([${i}])([ ])+`,"g"),o=function(l){return l.replace(r,"$2").replace(a,"$1")},s=ke([g.list],n,o);return s=Di(s,o),s}get optionBuilders(){return[new q({nameKey:"rules.remove-space-around-characters.include-fullwidth-forms.name",descriptionKey:"rules.remove-space-around-characters.include-fullwidth-forms.description",OptionsClass:fi,optionsKey:"includeFullwidthForms"}),new q({nameKey:"rules.remove-space-around-characters.include-cjk-symbols-and-punctuation.name",descriptionKey:"rules.remove-space-around-characters.include-cjk-symbols-and-punctuation.description",OptionsClass:fi,optionsKey:"includeCJKSymbolsAndPunctuation"}),new q({nameKey:"rules.remove-space-around-characters.include-dashes.name",descriptionKey:"rules.remove-space-around-characters.include-dashes.description",OptionsClass:fi,optionsKey:"includeDashes"}),new we({nameKey:"rules.remove-space-around-characters.other-symbols.name",descriptionKey:"rules.remove-space-around-characters.other-symbols.description",OptionsClass:fi,optionsKey:"otherSymbols"})]}};Oa=L([y.register],Oa);var Ia=class{constructor(){this.charactersToRemoveSpacesBefore=",!?;:).\u2019\u201D]";this.charactersToRemoveSpacesAfter="\xBF\xA1\u2018\u201C(["}},Ma=class extends y{constructor(){super({nameKey:"rules.remove-space-before-or-after-characters.name",descriptionKey:"rules.remove-space-before-or-after-characters.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Ia}apply(n,t){let i=mn(t.charactersToRemoveSpacesBefore),r=mn(t.charactersToRemoveSpacesAfter);if(!i&&!r)return n;let a=new RegExp(`([ ])+([${i}])`,"g"),o=new RegExp(`([${r}])([ ])+`,"g"),s=function(c){return c.replace(a,"$2").replace(o,"$1")},l=ke([g.list,g.html],n,s);return l=Di(l,s),l}get optionBuilders(){return[new we({nameKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-before.name",descriptionKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-before.description",OptionsClass:Ia,optionsKey:"charactersToRemoveSpacesBefore"}),new we({nameKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-after.name",descriptionKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-after.description",OptionsClass:Ia,optionsKey:"charactersToRemoveSpacesAfter"})]}};Ma=L([y.register],Ma);var xs=class{constructor(){this.punctuationToRemove=".,;:!\u3002\uFF0C\uFF1B\uFF1A\uFF01"}},Fa=class extends y{constructor(){super({nameKey:"rules.remove-trailing-punctuation-in-heading.name",descriptionKey:"rules.remove-trailing-punctuation-in-heading.description",type:"Heading",ruleIgnoreTypes:[g.code,g.math,g.yaml]})}get OptionsClass(){return xs}apply(n,t){return n.replaceAll(pn,(i,r="",a="",o="",s="",l="")=>{if(s==""||s.match(Wp))return i;let c=s.trimEnd(),u=c.charAt(c.length-1);retur
`,"").replace(`
---`,""));if(!r)return i;for(let a of At)if(t.sortAliasKey&&Object.keys(r).includes(a)){i=ae(i,a,be(gn(this.sortArray(Re(ue(i,a)),t.sortOrder)),t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let a of wt)if(t.sortTagKey&&Object.keys(r).includes(a)){i=ae(i,a,be(fn(this.sortArray(Re(ue(i,a)),t.sortOrder)),t.tagArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(t.sortArrayKeys){let a=[...At,...wt,...t.ignoreSortArrayKeys];for(let o of Object.keys(r)){if(a.includes(o)||!Array.isArray(r[o])||r[o].length!==0&&typeof r[o][0]=="object"&&r[o][0]!==null)continue;let s=ue(i,o),l="single-line";s.includes(`
`)&&(l="multi-line");let c=this.sortArray(Re(s),t.sortOrder);i=ae(i,o,be(c,l,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays))}}return i})}sortArray(n,t){return n==null||typeof n=="string"||n.length<=1||(n.sort(function(i,r){let a=i.toLowerCase().localeCompare(r.toLowerCase());return a===0?i.localeCompare(r):a}),t==="Ascending Alphabetical")||n.reverse(),n}get optionBuilders(){return[new q({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.sort-alias-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-alias-key.description",optionsKey:"sortAliasKey"}),new q({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.sort-tag-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-tag-key.description",optionsKey:"sortTagKey"}),new q({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.sort-array-keys.name",descriptionKey:"rules.sort-yaml-array-values.sort-array-keys.description",optionsKey:"sortArrayKeys"}),new pe({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.ignore-keys.name",descriptionKey:"rules.sort-yaml-array-values.ignore-keys.description",optionsKey:"ignoreSortArrayKeys"}),new J({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.sort-order.name",descriptionKey:"rules.sort-yaml-array-values.sort-order.description",optionsKey:"sortOrder",records:[{value:"Ascending Alphabetical",description:"Sorts the array values from a to z"},{value:"Descending Alphabetical",description:"Sorts the array values from z to a"}]})]}};Ba=L([y.register],Ba);var Jc=class{},Da=class extends y{constructor(){super({nameKey:"rules.space-after-list-markers.name",descriptionKey:"rules.space-after-list-markers.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Jc}apply(n,t){return n=n.replace(/^(\s*\d+\.|\s*[-+*])[^\S\r\n]+/gm,"$1 "),n.replace(/^(\s*\d+\.|\s*[-+*]\s+\[[ xX]\])[^\S\r\n]+/gm,"$1 ")}get optionBuilders(){return[]}};Da=L([y.register],Da);var za=class{constructor(){this.englishNonLetterCharactersAfterCJKCharacters=`-+'"([\xA5$`;this.englishNonLetterCharactersBeforeCJKCharacters=`-+;:'"\xB0%$)]`}},Ka=class extends y{constructor(){super({nameKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.name",descriptionKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.inlineCode,g.yaml,g.image,g.link,g.wikiLink,g.tag,g.math,g.inlineMath,g.html]})}get OptionsClass(){return za}apply(n,t){let i=this.buildHeadRegex(t.englishNonLetterCharactersAfterCJKCharacters),r=this.buildTailRegex(t.englishNonLetterCharactersBeforeCJKCharacters),a=`${g.link.placeholder}|${g.inlineMath.placeholder}|${g.inlineCode.placeholder}|${g.wikiLink.placeholder}`.replaceAll("{","\\{").replaceAll("}","\\}"),o=new RegExp(`(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})( *)(${a})`,"gmu"),s=new RegExp(`(${a})( *)(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})`,"gmu"),l=function(u){return u.replace(i,"$1 $3").replace(r,"$1 $3")},c=ke([g.italics,g.bold],n,l);return c=c.replace(o,"$1 $3").replace(s,"$1 $3"),c=xp(c,l),c=Lp(c,l),c}buildHeadRegex(n){n&&n!==""&&(n=n.replaceAll(/\s/g,""));let t="";return n&&n.length!=0&&(t=`|[${mn(n)}]`),new RegExp(`(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})( *)(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${t}|\\*[^*])`,"gmu")}buildTailRegex(n){n&&n!==""&&(n=n.replaceAll(/\s/g,""));let t="";return n&&n.length!=0&&(t=`|[${mn(n)}]`),new RegExp(`(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${t}|[^*]\\*)( *)(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})`,"gmu")}get optionBuilders(){return[new we({OptionsClass:za,nameKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.english-symbols-punctuation-before.name",descriptionKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.english-symbols-punctuation-before.description",optionsKey:"englishNonLetterCharactersBeforeCJKCharacters"}),new we({OptionsClass:za,nameKey:"rules.space-between-chinese-japanese-or-
`)?r+=`${a}:${o}
`:r+=`${a}: ${o}
`,n=Yn(n,a,!1))}return{remainingYaml:n,sortedYamlKeyValues:r}}updateDateModifiedIfYamlChanged(n,t,i,r){return n==t?t:ae(t,i," "+r)}getTextWithNewYamlFrontmatter(n,t,i,r,a,o,s,l){let c=`${r}${i}`;return a&&(c=`${i}${r}`),l&&(c=this.updateDateModifiedIfYamlChanged(t,c,o,s)),n.replace(t,c)}sortAlphabeticallyAsc(n,t){return n=n.toLowerCase(),t=t.toLowerCase(),n<t?-1:t<n?1:0}sortAlphabeticallyDesc(n,t){return n=n.toLowerCase(),t=t.toLowerCase(),n>t?-1:t>n?1:0}get optionBuilders(){return[new pe({OptionsClass:Zt,nameKey:"rules.yaml-key-sort.yaml-key-priority-sort-order.name",descriptionKey:"rules.yaml-key-sort.yaml-key-priority-sort-order.description",optionsKey:"yamlKeyPrioritySortOrder"}),new q({OptionsClass:Zt,nameKey:"rules.yaml-key-sort.priority-keys-at-start-of-yaml.name",descriptionKey:"rules.yaml-key-sort.priority-keys-at-start-of-yaml.description",optionsKey:"priorityKeysAtStartOfYaml"}),new J({OptionsClass:Zt,nameKey:"rules.yaml-key-sort.yaml-sort-order-for-other-keys.name",descriptionKey:"rules.yaml-key-sort.yaml-sort-order-for-other-keys.description",optionsKey:"yamlSortOrderForOtherKeys",records:[{value:"None",description:"No sorting other than what is in the YAML Key Priority Sort Order text area"},{value:"Ascending Alphabetical",description:"Sorts the keys based on key value from a to z"},{value:"Descending Alphabetical",description:"Sorts the keys based on key value from z to a"}]})]}};hi=L([y.register],hi);var Ct=require("obsidian");var nu=Cn(qm());var Pa={ruleConfigs:{},lintOnSave:!1,recordLintOnSaveLogs:!1,displayChanged:!0,lintOnFileChange:!1,displayLintOnFileChangeNotice:!1,settingsConvertedToConfigKeyValues:!1,foldersToIgnore:[],filesToIgnore:[],linterLocale:"system-default",logLevel:"ERROR",lintCommands:[],customRegexes:[],commonStyles:{aliasArrayStyle:"single-line",tagArrayStyle:"single-line",minimumNumberOfDollarSignsToBeAMathBlock:2,escapeCharacter:'"',removeUnnecessaryEscapeCharsForMultiLineArrays:!1}};var Ke=class{constructor(){this.dateCreatedKey="date created";this.dateCreated=!0;this.dateCreatedSourceOfTruth="file system";this.dateModifiedSourceOfTruth="file system";this.format="dddd, MMMM Do YYYY, h:mm:ss a";this.dateModified=!0;this.dateModifiedKey="date modified";this.convertToUTC=!1;this.timestampUpdateOnFileContentUpdated="never";this.locale="en"}};L([y.noSettingControl()],Ke.prototype,"alreadyModified",2),L([y.noSettingControl()],Ke.prototype,"fileCreatedTime",2),L([y.noSettingControl()],Ke.prototype,"fileModifiedTime",2),L([y.noSettingControl()],Ke.prototype,"locale",2),L([y.noSettingControl()],Ke.prototype,"currentTime",2),L([y.noSettingControl()],Ke.prototype,"fileName",2);var Qt=class extends y{constructor(){super({nameKey:"rules.yaml-timestamp.name",descriptionKey:"rules.yaml-timestamp.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Ke}apply(n,t){let i=t.alreadyModified,r=Rt(n);return i=i||r!==n,t.format=t.format.trimEnd(),he(r,a=>{if(t.dateCreated){let o=!1;[a,o]=this.handleDateCreatedValue(a,t),i=i||o}return t.dateModified&&(a=this.handleDateModifiedValue(a,i,t)),a})}handleDateCreatedValue(n,t){let i=!1,r=`
${t.dateCreatedKey}: [^
]+
`,a=`
${t.dateCreatedKey}:[ ]*
`,o=new RegExp(a),s=new RegExp(r),l=(0,Ct.moment)(t.fileCreatedTime);l.locale(t.locale);let c=t.convertToUTC?l.utc().format(t.format):l.format(t.format),u=`
${t.dateCreatedKey}: ${c}`,d=s.test(n);if(!d&&o.test(n))n=n.replace(o,Je(u)+`
`),i=!0;else if(d){if(d){let m=this.getYAMLTimestampString(n,s,t.dateCreatedKey),p=(0,nu.default)(m);if(t.dateCreatedSourceOfTruth=="frontmatter"&&t.format!==p){let f=this.parseValueToCurrentFormatIfPossible(m,t.format,t.locale,t.convertToUTC);if(f==null)throw new Error(x("logs.invalid-date-format-error").replace("{DATE}",m).replace("{FILE_NAME}",t.fileName));let b=t.convertToUTC?f.utc().format(t.format):f.format(t.format);if(b!==m){let h=`
${t.dateCreatedKey}: ${b}`;n=n.replace(s,Je(h)+`
`),i=!0}}else if(t.dateCreatedSourceOfTruth!="frontmatter"){let f=(0,Ct.moment)(m,t.format,t.locale,!0);(f==null||!f.isValid())&&(n=n.replace(s,Je(u)+`
`),i=!0)}}}else{let m=n.indexOf(`
---`);n=Fn(n,m,`
${t.dateCreatedKey}: ${c}`),i=!0}return[n,i]}handleDateModifiedValue(n,t,i){let r=`
${i.dateModifiedKey}: [^
]+
`,a=`
${i.dateModifiedKey}:[ ]*
`,o=new RegExp(a),s=new RegExp(r),l=(0,Ct.moment)(i.fileModifiedTime);l.locale(i.locale);let c=i.convertToUTC?i.currentTime.utc().format(i.format):i.currentTime.format(i.format),u=`
${i.dateModifiedKey}: ${c}`,d=s.test(n);if(d){let m=(0,Ct.moment)(this.getYAMLTimestampString(n,s,i.dateModifiedKey),i.format,i.locale,!0);(t||m==null||!m.isValid()||i.dateModifiedSourceOfTruth!="user or Linter edits"&&this.getTimeDifferenceInSeconds(m,l,i)>5)&&(n=n.replace(s,Je(u)+`
`))}else if(o.test(n))n=n.replace(o,Je(u)+`
`);else if(!d){let m=n.indexOf(`
---`);n=Fn(n,m,u)}return n}parseValueToCurrentFormatIfPossible(n,t,i,r){if(n==null)return null;let a=r?Ct.moment.utc(n,t,i,!0):(0,Ct.moment)(n,t,i,!0);if(a!=null&&a.isValid())return a;let o=(0,nu.default)(n);if(o!=null){let s=r?Ct.moment.utc(n,o):(0,Ct.moment)(n,o);s.locale(i);let l=r?s.utc().format(t):s.format(t);return(0,Ct.moment)(l,t,i,!0)}return null}getYAMLTimestampString(n,t,i){return n.match(t)[0].replace(i+":","").trim()}getTimeDifferenceInSeconds(n,t,i){let r=(0,Ct.moment)(t.format(i.format),i.format,i.locale,!0);return Math.abs(n.diff(r,"seconds"))}get optionBuilders(){return[new q({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.date-created.name",descriptionKey:"rules.yaml-timestamp.date-created.description",optionsKey:"dateCreated"}),new we({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.date-created-key.name",descriptionKey:"rules.yaml-timestamp.date-created-key.description",optionsKey:"dateCreatedKey"}),new J({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.date-created-source-of-truth.name",descriptionKey:"rules.yaml-timestamp.date-created-source-of-truth.description",optionsKey:"dateCreatedSourceOfTruth",records:[{value:"file system",description:"The file system date created value is used to set the value of date created in the frontmatter"},{value:"frontmatter",description:"When a value is present in the frontmatter for date created, this value is used as the value for the date created"}]}),new q({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.date-modified.name",descriptionKey:"rules.yaml-timestamp.date-modified.description",optionsKey:"dateModified"}),new we({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.date-modified-key.name",descriptionKey:"rules.yaml-timestamp.date-modified-key.description",optionsKey:"dateModifiedKey"}),new J({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.date-modified-source-of-truth.name",descriptionKey:"rules.yaml-timestamp.date-modified-source-of-truth.description",optionsKey:"dateModifiedSourceOfTruth",records:[{value:"file system",description:"The file system date modified value is used to set the value of date modified in the frontmatter"},{value:"user or Linter edits",description:"When a value is present in the frontmatter for date modified, date modified is kept as is unless the Linter makes a change to a note or the user edits a note with the setting `{NAME}` set to something other than `{NEVER}`.".replace("{NAME}",x("rules.yaml-timestamp.update-on-file-contents-updated.name")).replace("{NEVER}",x("enums.never"))}]}),new ls({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.format.name",descriptionKey:"rules.yaml-timestamp.format.description",optionsKey:"format"}),new q({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.convert-to-utc.name",descriptionKey:"rules.yaml-timestamp.convert-to-utc.description",optionsKey:"convertToUTC"}),new J({OptionsClass:Ke,nameKey:"rules.yaml-timestamp.update-on-file-contents-updated.name",descriptionKey:"rules.yaml-timestamp.update-on-file-contents-updated.description",optionsKey:"timestampUpdateOnFileContentUpdated",records:[{value:"never",description:"never"},{value:"after 5 seconds",description:"after 5 seconds"},{value:"after 10 seconds",description:"after 10 seconds"},{value:"after 15 seconds",description:"after 15 seconds"},{value:"after 30 seconds",description:"after 30 seconds"},{value:"after 1 minute",description:"after 1 minute"}]})]}};Qt=L([y.register],Qt);var Ot=class{constructor(){this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0;this.aliasHelperKey=cc;this.aliasArrayStyle="multi-line";this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};L([y.noSettingControl()],Ot.prototype,"aliasArrayStyle",2),L([y.noSettingControl()],Ot.prototype,"fileName",2),L([y.noSettingControl()],Ot.prototype,"defaultEscapeCharacter",2),L([y.noSettingControl()],Ot.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var yi=class extends y{constructor(){super({nameKey:"rules.yaml-title-alias.name",descriptionKey:"rules.yaml-title-alia
`,"").replace(`
---`,""),c=st(o),u=t.aliasHelperKey??cc;u.endsWith(":")&&(u=u.substring(0,u.length-1)),a=c[u]??null,a!=null&&(a=a+"",a=xt(a,t.defaultEscapeCharacter,this.forceEscape(a,t.aliasArrayStyle)));let d=null,m=Object.keys(c);for(let p of At)if(m.includes(p)){d=p;break}if(d!=null){let p=ue(l,d),f="multi-line",b=p==="",h=!1;!p.includes(`
`)&&!(p==="[]"&&t.aliasArrayStyle==="multi-line")&&(p.match(/^\[.*\]/)===null?(f="single string to single-line",h=!0):f="single-line");let k=gn(Re(p)),A=this.getNewAliasValue(k,s,r,a);A===""?l=Yn(l,d):t.preserveExistingAliasesSectionStyle?!b&&(h&&r==A||!h||k==A)?l=ae(l,d,be(A,f,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):l=ae(l,d,be(A,t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):l=ae(l,d,be(A,t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0))}else s||(l=ae(l,lc,be(r,t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)));return!t.useYamlKeyToKeepTrackOfOldFilenameOrHeading||s?l=Yn(l,u):l=ae(l,u,` ${r}`),n=n.replace(`---
${o}---`,`---
${l}---`),n}getTitleInfo(n,t,i,r){let a=ke([g.code,g.math,g.yaml,g.tag],n,Ho);a=a||t;let o=xt(a,r,this.forceEscape(a,i));return[a,o]}forceEscape(n,t){return ko(n)||n.includes(",")&&(t==="single-line"||t==="single string to single-line"||t==="single string comma delimited")}getNewAliasValue(n,t,i,r){if(n==null)return t?"":i;if(typeof n=="string")t?n===i&&(n=""):r===n?n=i:n=[i,n];else if(r!==null){let a=n.indexOf(r);a===-1&&Ni(r)&&(a=n.indexOf(r.substring(1,r.length-1))),a!==-1?t?n.splice(a,1):n[a]=i:n=[i,...n]}else{let a=n.indexOf(i);a!==-1?t&&n.splice(a,1):t||(n=[i,...n])}return n===""||n.length===0?"":n}get optionBuilders(){return[new q({OptionsClass:Ot,nameKey:"rules.yaml-title-alias.preserve-existing-alias-section-style.name",descriptionKey:"rules.yaml-title-alias.preserve-existing-alias-section-style.description",optionsKey:"preserveExistingAliasesSectionStyle"}),new q({OptionsClass:Ot,nameKey:"rules.yaml-title-alias.keep-alias-that-matches-the-filename.name",descriptionKey:"rules.yaml-title-alias.keep-alias-that-matches-the-filename.description",optionsKey:"keepAliasThatMatchesTheFilename"}),new q({OptionsClass:Ot,nameKey:"rules.yaml-title-alias.use-yaml-key-to-keep-track-of-old-filename-or-heading.name",descriptionKey:"rules.yaml-title-alias.use-yaml-key-to-keep-track-of-old-filename-or-heading.description",optionsKey:"useYamlKeyToKeepTrackOfOldFilenameOrHeading"}),new we({OptionsClass:Ot,nameKey:"rules.yaml-title-alias.alias-helper-key.name",descriptionKey:"rules.yaml-title-alias.alias-helper-key.description",optionsKey:"aliasHelperKey"})]}};yi=L([y.register],yi);var bi=class{constructor(){this.defaultEscapeCharacter='"';this.titleKey="title";this.mode="first-h1-or-filename-if-h1-missing"}};L([y.noSettingControl()],bi.prototype,"fileName",2),L([y.noSettingControl()],bi.prototype,"defaultEscapeCharacter",2);var vi=class extends y{constructor(){super({nameKey:"rules.yaml-title.name",descriptionKey:"rules.yaml-title.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return bi}apply(n,t){n=Rt(n);let i="";switch(t.mode){case"filename":i=t.fileName;break;case"first-h1":i=this.getFirstH1Header(n);break;default:i=this.getFirstH1Header(n),i=i||t.fileName}return i=xt(i,t.defaultEscapeCharacter),he(n,r=>{let a=`
${t.titleKey}.*
`,o=new RegExp(a);if(o.test(r))r=r.replace(o,Je(`
${t.titleKey}: ${i}
`));else{let s=r.indexOf(`
---`);r=Fn(r,s,`
${t.titleKey}: ${i}`)}return r})}getFirstH1Header(n){return ke([g.code,g.math,g.yaml,g.tag],n,Ho)}get optionBuilders(){return[new we({OptionsClass:bi,nameKey:"rules.yaml-title.title-key.name",descriptionKey:"rules.yaml-title.title-key.description",optionsKey:"titleKey"}),new J({OptionsClass:bi,nameKey:"rules.yaml-title.mode.name",descriptionKey:"rules.yaml-title.mode.description",optionsKey:"mode",records:[{value:"first-h1-or-filename-if-h1-missing",description:"Uses the first H1 in the file or the filename of the file if there is not H1"},{value:"filename",description:"Uses the filename as the title"},{value:"first-h1",description:"Uses the first H1 in the file as the title"}]})]}};vi=L([y.register],vi);var xA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-cog">
<circle cx="6" cy="13" r="3"/>
<path d="m9.7 14.4-.9-.3"/>
<path d="m3.2 11.9-.9-.3"/>
<path d="m4.6 16.7.3-.9"/>
<path d="m7.6 16.7-.4-1"/>
<path d="m4.8 10.3-.4-1"/>
<path d="m2.3 14.6 1-.4"/>
<path d="m8.7 11.8 1-.4"/>
<path d="m7.4 9.3-.3.9"/>
<path d="M14 2v6h6"/>
<path d="M4 5.5V4a2 2 0 0 1 2-2h8.5L20 7.5V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-1.5"/>
</svg>`,LA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-cog">
<circle cx="18" cy="18" r="3"/>
<path d="M10.5 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v3.5"/>
<path d="m21.7 19.4-.9-.3"/>
<path d="m15.2 16.9-.9-.3"/>
<path d="m16.6 21.7.3-.9"/>
<path d="m19.1 15.2.3-.9"/>
<path d="m19.6 21.7-.4-1"/>
<path d="m16.8 15.3-.4-1"/>
<path d="m14.3 19.6 1-.4"/>
<path d="m20.7 16.8 1-.4"/>
</svg>`,SA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server-cog">
<circle cx="12" cy="12" r="3"/><path d="M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"/>
<path d="M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"/>
<path d="M6 6h.01"/><path d="M6 18h.01"/>
<path d="m15.7 13.4-.9-.3"/>
<path d="m9.2 10.9-.9-.3"/>
<path d="m10.6 15.7.3-.9"/>
<path d="m13.6 15.7-.4-1"/>
<path d="m10.8 9.3-.4-1"/>
<path d="m8.3 13.6 1-.4"/>
<path d="m14.7 10.8 1-.4"/>
<path d="m13.4 8.3-.3.9"/>
</svg>`,EA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pilcrow">
<path d="M13 4v16"/>
<path d="M17 4v16"/>
<path d="M19 4H9.5a4.5 4.5 0 0 0 0 9H13"/>
</svg>`,TA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-function-square">
<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/>
<path d="M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"/>
<path d="M9 11.2h5.7"/>
</svg>`,CA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-gantt-chart-square">
<rect width="18" height="18" x="3" y="3" rx="2"/>
<path d="M9 8h7"/>
<path d="M8 12h6"/>
<path d="M11 16h5"/>
</svg>`,OA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clipboard-list">
<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/>
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>
<path d="M12 11h4"/>
<path d="M12 16h4"/>
<path d="M8 11h.01"/>
<path d="M8 16h.01"/>
</svg>`,MA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-plus">
<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"/>
<path d="M9 10h6"/>
<path d="M12 7v6"/>
</svg>`,IA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-heading-1">
<path d="M4 12h8"/>
<path d="M4 18V6"/>
<path d="M12 18V6"/>
<path d="m17 12 3-2v8"/>
</svg>`,FA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript">
<path d="m4 19 8-8"/>
<path d="m12 19-8-8"/>
<path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"/>
</svg>`,RA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-code-2">
<path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4"/>
<polyline points="14 2 14 8 20 8"/>
<path d="m9 18 3-3-3-3"/>
<path d="m5 12-3 3 3 3"/>
</svg>`,BA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings">
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
<circle cx="12" cy="12" r="3"/>
</svg>`,DA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug-play">
<path d="m8 2 1.88 1.88"/>
<path d="M14.12 3.88 16 2"/>
<path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/>
<path d="M18 11a4 4 0 0 0-4-4h-4a4 4 0 0 0-4 4v3a6.1 6.1 0 0 0 2 4.5"/>
<path d="M6.53 9C4.6 8.8 3 7.1 3 5"/>
<path d="M6 13H2"/>
<path d="M3 21c0-2.1 1.7-3.9 3.8-4"/>
<path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/>
<path d="m12 12 8 5-8 5Z"/>
</svg>`,KA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clipboard">
<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/>
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>
</svg>`,zA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check">
<polyline points="20 6 9 17 4 12"/>
</svg>`,Me={folder:{id:"lint-folder",source:LA},file:{id:"lint-file",source:xA},vault:{id:"lint-vault",source:SA},whitespace:{id:"lint-whitespace",source:EA},math:{id:"lint-math",source:TA},content:{id:"lint-content",source:CA},paste:{id:"lint-paste",source:OA},custom:{id:"lint-custom",source:MA},heading:{id:"lint-heading",source:IA},footer:{id:"lint-footer",source:FA},yaml:{id:"lint-yaml",source:RA},general:{id:"lint-general",source:BA},debug:{id:"lint-debug",source:DA},clipboard:{id:"linter-clipboard",source:KA},success:{id:"linter-success",source:zA}};var Xi=require("obsidian");var Fs=class{constructor(){this.disabledRules=[]}lintText(n){this.skipFile=!1;let t=n.oldText;if([this.disabledRules,this.skipFile]=as(t),this.skipFile)return t;In(x("logs.rule-running"));let i=x("logs.pre-rules");In(i);let r=this.runBeforeRegularRules(n);rn(i);let a=!1;for(let l of n.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(l.filePath!=""){a=!0;break}let o=x("logs.disabled-text");for(let l of Bt){if(this.disabledRules.includes(l.alias)){nt(l.alias+" "+o);continue}else if(l.hasSpecialExecutionOrder||l.type==="Paste")continue;if(l.alias==="auto-correct-common-misspellings"&&a){let c=!1;for(let u of n.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(u.filePath==n.fileInfo.path){c=!0;break}if(c){nt(l.alias+" "+o);continue}}[r]=An.applyIfEnabledBase(l,r,n.settings,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,fileName:n.fileInfo.name,locale:n.momentLocale,minimumNumberOfDollarSignsToBeAMathBlock:n.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock,aliasArrayStyle:n.settings.commonStyles.aliasArrayStyle,tagArrayStyle:n.settings.commonStyles.tagArrayStyle,defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter,removeUnnecessaryEscapeCharsForMultiLineArrays:n.settings.commonStyles.removeUnnecessaryEscapeCharsForMultiLineArrays})}let s=x("logs.custom-regex");return In(s),r=this.runCustomRegexReplacement(n.settings.customRegexes,r),rn(s),n.oldText=r,this.runAfterRegularRules(t,n)}runBeforeRegularRules(n){let t=n.oldText;return[t]=ri.applyIfEnabled(t,n.settings,this.disabledRules),[t]=ni.applyIfEnabled(t,n.settings,this.disabledRules,{defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter}),[t]=ai.applyIfEnabled(t,n.settings,this.disabledRules,{minimumNumberOfDollarSignsToBeAMathBlock:n.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock}),[t]=Zn.applyIfEnabled(t,n.settings,this.disabledRules,{misspellingToCorrection:n.defaultMisspellings}),t}runAfterRegularRules(n,t){let i=t.oldText,r=x("logs.post-rules");In(r),[i]=ei.applyIfEnabled(i,t.settings,this.disabledRules),[i]=vi.applyIfEnabled(i,t.settings,this.disabledRules,{fileName:t.fileInfo.name,defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter}),[i]=yi.applyIfEnabled(i,t.settings,this.disabledRules,{fileName:t.fileInfo.name,aliasArrayStyle:t.settings.commonStyles.aliasArrayStyle,defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter,removeUnnecessaryEscapeCharsForMultiLineArrays:t.settings.commonStyles.removeUnnecessaryEscapeCharsForMultiLineArrays}),[i]=Qn.applyIfEnabled(i,t.settings,this.disabledRules),[i]=ii.applyIfEnabled(i,t.settings,this.disabledRules,{defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter}),[i]=gi.applyIfEnabled(i,t.settings,this.disabledRules),[i]=ti.applyIfEnabled(i,t.settings,this.disabledRules);let a=i.match(Ne);a!=null&&([i]=xn.applyIfEnabled(i,t.settings,this.disabledRules));let o=t.getCurrentTime(),s;[i,s]=Qt.applyIfEnabled(i,t.settings,this.disabledRules,{fileCreatedTime:t.fileInfo.createdAtFormatted,fileModifiedTime:t.fileInfo.modifiedAtFormatted,currentTime:o,alreadyModified:n!=i,locale:t.momentLocale}),a===null&&([i]=xn.applyIfEnabled(i,t.settings,this.disabledRules));let l=Qt.getRuleOptions(t.settings);return o=t.getCurrentTime(),l.convertToUTC&&(o=o.utc()),[i]=hi.applyIfEnabled(i,t.settings,this.disabledRules,{currentTimeFormatted:o.format(l.format.trimEnd()),y
`),c+=`/${o.find}/${o.flags}/${o.replace}/`,nt(c);let u=new RegExp(`${o.find}`,o.flags);r=r.replace(u,Cd(o.replace)),a!=r&&nt(r),a=r}return r})}runPasteLint(n,t,i){let r=i.oldText;return[r]=ui.applyIfEnabled(r,i.settings,[]),[r]=mi.applyIfEnabled(r,i.settings,[]),[r]=pi.applyIfEnabled(r,i.settings,[]),[r]=li.applyIfEnabled(r,i.settings,[]),[r]=di.applyIfEnabled(r,i.settings,[]),[r]=oi.applyIfEnabled(r,i.settings,[],{lineContent:n,selectedText:t}),[r]=si.applyIfEnabled(r,i.settings,[],{lineContent:n,selectedText:t}),[r]=Jn.applyIfEnabled(r,i.settings,[],{lineContent:n}),r}runYAMLTimestampByItself(n){let t=n.oldText,i=n.getCurrentTime();return[t]=Qt.applyIfEnabled(t,n.settings,this.disabledRules,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,currentTime:i,alreadyModified:!0,locale:n.momentLocale}),t}};function ki(e,n=null,t,i,r){let a=n&&n.stat.ctime!==0?(0,Xi.moment)(n.stat.ctime):(0,Xi.moment)();a.locale(t);let o=n?(0,Xi.moment)(n.stat.mtime):(0,Xi.moment)();o.locale(t);let s=o.format(),l=a.format();return{oldText:e,fileInfo:{name:n?n.basename:"",createdAtFormatted:l,modifiedAtFormatted:s,path:n?n.path:""},settings:i,momentLocale:t,getCurrentTime:()=>{let c=(0,Xi.moment)();return c.locale(t),c},defaultMisspellings:r}}var Rs=require("obsidian");var Ha=class extends Rs.Modal{constructor(n,t,i,r,a,o=!1){super(n),this.modalEl.addClass("confirm-modal"),this.contentEl.createEl("h3",{text:x("warning-text"),cls:"modal-heading"}),o&&this.contentEl.createEl("p",{text:x("custom-command-warning"),cls:"modal-warn"}),this.contentEl.createEl("p",{text:t+" "+x("file-backup-text")}).id="confirm-dialog",this.contentEl.createDiv("modal-button-container",s=>{s.createEl("button",{text:x("cancel-button-text")}).addEventListener("click",()=>this.close());let l=s.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:i});l.addEventListener("click",async c=>{new Rs.Notice(r),this.close(),await a()}),setTimeout(()=>{l.focus()},50)})}};var Va=require("obsidian");var Bs=require("obsidian");var NA={General:Me.general.id,Custom:Me.custom.id,YAML:Me.yaml.id,Heading:Me.heading.id,Footnote:Me.footer.id,Content:Me.content.id,Spacing:Me.whitespace.id,Paste:Me.paste.id,Debug:Me.debug.id},YA={General:"tabs.names.general",Custom:"tabs.names.custom",YAML:"tabs.names.yaml",Heading:"tabs.names.heading",Footnote:"tabs.names.footnote",Content:"tabs.names.content",Spacing:"tabs.names.spacing",Paste:"tabs.names.paste",Debug:"tabs.names.debug"},Kt=class{constructor(n,t,i,r,a){this.name=i;this.isMobile=r;this.plugin=a;this.searchSettingInfo=[];this.navButton=n.createDiv("linter-navigation-item");let o="linter-desktop";r&&(o="linter-mobile"),this.navButton.addClass(o),(0,Bs.setIcon)(this.navButton.createSpan({cls:"linter-navigation-item-icon"}),NA[i]);let s=x(YA[i]);this.navButton.createSpan().setText(s),this.contentEl=t.createDiv("linter-tab-settings"),this.contentEl.id=i.toLowerCase().replace(" ","-"),this.headingEl=new Bs.Setting(this.contentEl).setName(s).setHeading().nameEl,Te(this.headingEl)}addSettingSearchInfo(n,t="",i="",r=null,a=null){this.searchSettingInfo.push({containerEl:n,name:t.toLowerCase(),description:i.toLowerCase(),options:r,alias:a})}addSettingSearchInfoForGeneralSettings(n){this.searchSettingInfo.push({containerEl:n.containerEl,name:n.name.toLowerCase(),description:n.description.toLowerCase(),options:null,alias:null})}updateTabDisplayMode(n,t="the status is still the same"){switch(n?(this.navButton.addClass("linter-navigation-item-selected"),Ye(this.contentEl)):(this.navButton.removeClass("linter-navigation-item-selected"),Te(this.contentEl)),t){case"entering search mode by focusing on the search input box":Ye(this.contentEl),Ye(this.headingEl);for(let i of this.searchSettingInfo)Ye(i.containerEl);break;case"leaving search mode by selecting a tab":Te(this.headingEl);for(let i of this.searchSettingInfo)Ye(i.containerEl);break}}};var Qm=require("obsidian");var Um=require("obsidian");var Sn=class{constructor(n,t,i,r,a,o=null){this.containerEl=n;this.keyToUpdate=r;this.plugin=a;this.beforeSave=o;th
`," "));let k=this.contentEl.createDiv(),A=new zs(k,this.plugin.settings.filesToIgnore,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(k,A.name,A.description.replaceAll(`
`," "))}};var Jm=require("obsidian"),Ys=class extends Kt{constructor(t,i,r,a,o,s){super(t,i,r,o,s);this.rules=a;this.display()}display(){for(let t of this.rules){let i=this.contentEl.createDiv();i.id=t.alias,new Jm.Setting(i).setHeading().nameEl.createEl("a",{href:t.getURL(),text:t.getName()});let r=[],a=!0,o=!1;for(let s of t.options)s.display(i,this.plugin.settings,this.plugin),r.push(s.getSearchInfo()),a?(a=!1,s instanceof kn&&(o=!this.plugin.settings.ruleConfigs[s.ruleAlias][s.configKey])):o&&s.hide();this.addSettingSearchInfo(i,t.getName().toLowerCase(),t.getDescription().toLowerCase(),r,i.id)}}};var Xm=require("obsidian");var Ua=class extends bn{constructor(t,i,r=[]){super(t,i);this.app=t;this.inputEl=i;this.valuesToExclude=r}getSuggestions(t){let i=this.app.commands.listCommands();if(!i)return[];let r=i.filter(s=>{for(let l of this.valuesToExclude)if(l.id==s.id&&!(this.inputEl.hasAttribute("commandId")&&this.inputEl.getAttribute("commandId")==s.id))return!1;return!0}),a=[],o=t.toLowerCase();return r.forEach(s=>{(s.id.contains(o)||s.name.toLowerCase().contains(o))&&a.push(s)}),a}renderSuggestion(t,i){i.setText(t.name)}selectSuggestion(t){this.inputEl.value=t.name,this.inputEl.setAttribute("commandId",t.id),this.inputEl.trigger("input"),this.close()}};var _s=class extends Nt{constructor(t,i,r,a){super(t,x("options.custom-command.name"),x("options.custom-command.description"),x("options.custom-command.warning"),x("options.custom-command.add-input-button-text"),r,a,()=>{let o={id:"",name:"",enabled:!0};this.lintCommands.push(o),this.saveSettings(),this.addCommand(o,this.lintCommands.length-1,!0)});this.lintCommands=i;this.display()}showInputEls(){this.lintCommands.forEach((t,i)=>{this.addCommand(t,i)})}addCommand(t,i,r=!1){new Xm.Setting(this.inputElDiv).addSearch(a=>{new Ua(this.app,a.inputEl,this.lintCommands),a.setPlaceholder(x("options.custom-command.command-search-placeholder-text")).setValue(t.name).onChange(o=>{let s={id:a.inputEl.getAttribute("commandId"),name:o,enabled:t.enabled};s.name&&s.id?(this.lintCommands[i]=s,this.saveSettings()):!s.name&&!s.id&&(this.lintCommands[i]=s,this.saveSettings())}),a.inputEl.setAttr("tabIndex",i),a.inputEl.addClass("linter-custom-command"),r&&a.inputEl.focus()}).addExtraButton(a=>{a.setIcon("up-chevron-glyph").setTooltip(x("options.custom-command.move-up-tooltip")).onClick(()=>{this.arrayMove(i,i-1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(a=>{a.setIcon("down-chevron-glyph").setTooltip(x("options.custom-command.move-down-tooltip")).onClick(()=>{this.arrayMove(i,i+1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(a=>{a.setIcon("trash").setTooltip(x("options.custom-command.delete-tooltip")).onClick(()=>{this.lintCommands.splice(i,1),this.saveSettings(),this.resetInputEls()})}).addToggle(a=>{a.setValue(t.enabled).onChange(o=>{t.enabled=o})})}arrayMove(t,i){if(i<0||i===this.lintCommands.length)return;let r=this.lintCommands[t];this.lintCommands[t]=this.lintCommands[i],this.lintCommands[i]=r}};var iu=require("obsidian");var PA="gm",Ps=class extends Nt{constructor(t,i,r,a){super(t,x("options.custom-replace.name"),x("options.custom-replace.description"),x("options.custom-replace.warning"),x("options.custom-replace.add-input-button-text"),r,a,()=>{let o={label:"",find:"",replace:"",flags:PA,enabled:!0};this.regexes.push(o),this.saveSettings(),this.addRegex(o,this.regexes.length-1,!0)});this.regexes=i;this.display(),this.inputElDiv.addClass("linter-custom-regex-replacement-container")}showInputEls(){this.regexes.forEach((t,i)=>{this.addRegex(t,i)})}addRegex(t,i,r=!1){let a=this.inputElDiv.createDiv({cls:"linter-custom-regex-replacement"}),o=a.createDiv(),s=new iu.Setting(o).addText(u=>{u.setPlaceholder(x("options.custom-replace.label-placeholder-text")).setValue(t.label).onChange(d=>{this.regexes[i].label=d,this.saveSettings()}),u.inputEl.setAttr("inputIndex",i),u.inputEl.addClass("linter-custom-regex-replacement-label-input"),r&&u.inputEl.focus()});s.controlEl.addClass("linter-custom-regex-replacement-label"),s.descEl.remove(),s.infoEl.remove(),s.name
`," ")+i.warning.replaceAll(`
`," "));let r=this.contentEl.createDiv(),a=new Ps(r,this.plugin.settings.customRegexes,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(r,a.name,a.description.replaceAll(`
`," ")+a.warning.replaceAll(`
`," "))}};var ef=require("obsidian");var qs=class{constructor(n,t,i,r){this.containerEl=n;this.searchZeroState=t;this.tabNameToTab=i;this.onFocus=r;this.searchSettingInfo=new Map;for(let[a,o]of i)this.searchSettingInfo.set(a,o.searchSettingInfo);this.display()}display(){let n=new ef.Setting(this.containerEl);n.settingEl.addClass("linter-no-border"),n.addSearch(t=>{this.search=t}),this.search.setPlaceholder(x("tabs.default-search-bar-text")),this.search.inputEl.onfocus=()=>{this.onFocus()},this.search.onChange(t=>{this.searchSettings(t.toLowerCase())})}searchSettings(n){let t=new Set,i=function(r,a){Ye(r),t.has(a)||t.add(a)};for(let[r,a]of this.searchSettingInfo)for(let o of a)if(n.trim()===""||o.alias?.includes(n)||o.description.includes(n)||o.name.includes(n))i(o.containerEl,r);else if(o.options)for(let s of o.options){if(s.description.toLowerCase().includes(n)||s.name.toLowerCase().includes(n)){i(o.containerEl,r);break}else if(s.options){for(let l of s.options)if(l.description.toLowerCase().includes(n)||l.value.toLowerCase().includes(n)){i(o.containerEl,r);break}}Te(o.containerEl)}else Te(o.containerEl);for(let[r,a]of this.tabNameToTab)t.has(r)?Ye(a.headingEl):Te(a.headingEl);t.size===0?Ye(this.searchZeroState):Te(this.searchZeroState)}focusOnInput(){this.search.inputEl.focus()}};var tf=Cn(so());var er=require("obsidian");var Wa=class{constructor(n,t,i,r=!0){this.containerEl=n;this.name=t;this.description=i;this.disabled=r;this.display()}display(){this.settingEl=this.containerEl.createDiv();let n=this.settingEl.createDiv("setting-item-info");this.nameEl=n.createDiv("setting-item-name"),this.nameEl.setText(this.name),this.descEl=n.createDiv("setting-item-description"),this.descEl.setText(this.description),this.inputContainerEl=this.settingEl.createDiv("full-width-textbox-input-wrapper"),this.inputContainerEl.onmouseover=()=>{this.getInput().trim()!=""&&this.copyEl.removeClass("linter-visually-hidden")},this.inputContainerEl.onmouseleave=()=>{this.copyEl.addClass("linter-visually-hidden")},this.inputEl=this.inputContainerEl.createEl("textarea",{cls:"full-width"}),this.inputEl.spellcheck=!1,this.inputEl.disabled=this.disabled,this.copyEl=this.inputContainerEl.createDiv({cls:"settings-copy-button linter-visually-hidden ",attr:{"aria-label":x("copy-aria-label")}}),this.copyIconEl=this.copyEl.createSpan(),(0,er.setIcon)(this.copyIconEl,"linter-clipboard"),this.copyIconEl.onclick=()=>{this.handleCopy(this.copyIconEl)}}getInput(){return this.inputEl.value}handleCopy(n){navigator.clipboard.writeText(this.getInput()).then(()=>{(0,er.setIcon)(n,"linter-success"),setTimeout(()=>{(0,er.setIcon)(n,"linter-clipboard")},1500)},t=>{new er.Notice(`${x("notice-text.copy-to-clipboard-failed")+t}`,0)})}hide(){Te(this.settingEl)}unhide(){Ye(this.settingEl)}};var HA=Object.keys(tf.default.levels),Us=class extends Kt{constructor(n,t,i,r){super(n,t,"Debug",i,r),this.display()}display(){let n=this.contentEl.createDiv(),t={isForEnum:!0,values:HA,descriptions:[]};this.addSettingSearchInfoForGeneralSettings(new Jt(n,"tabs.debug.log-level.name","tabs.debug.log-level.description","logLevel",this.plugin,t,async()=>{mo(this.plugin.settings.logLevel)})),n=this.contentEl.createDiv();let i=x("tabs.debug.linter-config.name"),r=x("tabs.debug.linter-config.description");new Wa(n,i,r).inputEl.setText(JSON.stringify(this.plugin.settings,null,2)),this.addSettingSearchInfo(n,i,r);let o=null;n=this.contentEl.createDiv();let s=new zt(n,"tabs.debug.log-collection.name","tabs.debug.log-collection.description","recordLintOnSaveLogs",this.plugin,l=>{l?o.unhide():o.hide()});this.addSettingSearchInfoForGeneralSettings(s),n=this.contentEl.createDiv(),i=x("tabs.debug.linter-logs.name"),r=x("tabs.debug.linter-logs.description"),o=new Wa(n,i,""),o.inputEl.setText(co.join(`
`)),it(r,o.descEl),s.getBoolean()||o.hide(),this.addSettingSearchInfo(n,i,r)}};var Ws=class extends Va.PluginSettingTab{constructor(t,i){super(t,i);this.plugin=i;this.tabNameToTab=new Map;this.selectedTab="General"}display(){let{containerEl:t}=this;t.empty();let i=t.createDiv("linter-setting-title");Va.Platform.isMobile?i.addClass("linter-mobile"):i.createEl("h1").setText(x("linter-title")),this.navContainer=t.createEl("nav",{cls:"linter-setting-header"}),this.tabNavEl=this.navContainer.createDiv("linter-setting-tab-group"),this.settingsContentEl=t.createDiv("linter-setting-content"),this.addTabs(Va.Platform.isMobile),this.createSearchZeroState(),this.generateSearchBar(i),this.selectedTab==""&&this.tabSearcher.focusOnInput()}addTabs(t){this.addTab(new Ns(this.tabNavEl,this.settingsContentEl,t,this.plugin,this.app));for(let i of Object.values(K))this.addTab(new Ys(this.tabNavEl,this.settingsContentEl,i,$n.get(i),t,this.plugin));this.addTab(new Hs(this.tabNavEl,this.settingsContentEl,t,this.app,this.plugin)),this.addTab(new Us(this.tabNavEl,this.settingsContentEl,t,this.plugin))}generateSearchBar(t){this.tabSearcher=new qs(t,this.searchZeroState,this.tabNameToTab,()=>{for(let i of this.tabNameToTab.values()){i.updateTabDisplayMode(!1,"entering search mode by focusing on the search input box");let r=this.tabSearcher.search.getValue();this.selectedTab==""&&r.trim()!=""&&this.tabSearcher.searchSettings(r.toLowerCase()),this.selectedTab=""}})}createSearchZeroState(){this.searchZeroState=this.settingsContentEl.createDiv({cls:"search-zero-state"}),Te(this.searchZeroState),this.searchZeroState.createEl("p",{text:x("empty-search-results-text")})}addTab(t){t.navButton.onclick=()=>{this.onTabClick(t.name)},t.updateTabDisplayMode(this.selectedTab===t.name,"the status is still the same"),this.tabNameToTab.set(t.name,t)}onTabClick(t){if(this.selectedTab!==t){if(this.selectedTab=="")for(let[i,r]of this.tabNameToTab)r.updateTabDisplayMode(i===t,"leaving search mode by selecting a tab");else Te(this.searchZeroState),this.tabNameToTab.get(t).updateTabDisplayMode(!0),this.tabNameToTab.get(this.selectedTab).updateTabDisplayMode(!1);this.selectedTab=t}}};var rf=require("obsidian");var qA=/^---\n/gm,nf=`${Ki}:`,Vs=class extends rf.EditorSuggest{constructor(t){super(t.app);this.plugin=t;this.inline=!1;let i=x("all-rules-option");this.ruleInfo=[{displayName:i,name:i.toLowerCase(),alias:"all"}];for(let r of Bt){let a=r.getName();this.ruleInfo.push({displayName:a,name:a.toLowerCase(),alias:r.alias})}}onTrigger(t,i,r){let a=i.getLine(t.line).toLowerCase();if(a.startsWith(nf)||this.disabledRulesIsEndOfStartOfFileToCursor(i.getRange({line:0,ch:0},t))){this.inline=a.startsWith(nf);let s=i.getLine(t.line).substring(0,t.ch),l=s.match(/(\S+)$/)?.first().replaceAll("[","").replaceAll("]","");if(l)return{end:t,start:{ch:s.lastIndexOf(l),line:t.line},query:l}}return null}getSuggestions(t){let[i,r]=as(t.editor.getValue());if(r)return[];let a=t.query.toLowerCase();return this.ruleInfo.filter(s=>(s.name.contains(a)||s.alias.contains(a))&&!i.includes(s.alias))}renderSuggestion(t,i){i.addClass("mod-complex");let r=i.createDiv({cls:"suggestion-content"});r.createDiv({cls:"suggestion-title"}).setText(`${t.displayName}`),r.createDiv({cls:"suggestion-note"}).setText(`${t.alias}`)}selectSuggestion(t){if(this.context){let i=t.alias;this.inline?i=`${i},`:i=`${i}
-`,this.context.editor.replaceRange(`${i} `,this.context.start,this.context.end)}}disabledRulesIsEndOfStartOfFileToCursor(t){if(!t||!t.length||t.match(qA)?.length!=1)return!1;let i=ue(t+`
`,Ki)?.trimEnd();return i===null?!1:t.trimEnd().endsWith(i)}};var df=Cn(lf()),pf=Cn(so());var wi=require("obsidian");var au="default-misspellings.md",ru=`https://raw.githubusercontent.com/platers/obsidian-linter/refs/heads/master/src/utils/${au}`;async function cf(e,n){let t=e.app,i=e.manifest.dir??"",r=(0,wi.normalizePath)(i+"/"+au);if(await t.vault.adapter.exists(r))return;let a=new wi.Notice(x("rules.auto-correct-common-misspellings.default-install")),o;try{o=await(0,wi.requestUrl)(ru)}catch(s){uo(x("rules.auto-correct-common-misspellings.default-install-failed").replace("{URL}",ru),s)}if(!o||o.status!==200){let s=x("rules.auto-correct-common-misspellings.default-install-failed").replace("{URL}",ru)+x("logs.see-console");await n(s);return}await t.vault.adapter.exists(i)||await t.vault.adapter.mkdir(i),await t.vault.adapter.writeBinary(r,o.arrayBuffer),a.hide()}async function uf(e){let n=e.app,t=e.manifest.dir??"",i=(0,wi.normalizePath)(t+"/"+au);return await n.vault.adapter.exists(i)?await n.vault.adapter.read(i):(pt(x("rules.auto-correct-common-misspellings.defaults-missing").replace("{FILE}",i)),"")}var UA={en:"en-gb",zh:"zh-cn","zh-TW":"zh-tw",ru:"ru",ko:"ko",it:"it",id:"id",ro:"ro","pt-BR":"pt-br",cz:"cs",da:"da",de:"de",es:"es",fr:"fr",no:"nn",pl:"pl",pt:"pt",tr:"tr",hi:"hi",nl:"nl",ar:"ar",ja:"ja"},Xt=0,$s=class extends X.Plugin{constructor(){super(...arguments);this.eventRefs=[];this.isEnabled=!0;this.rulesRunner=new Fs;this.overridePaste=!1;this.hasCustomCommands=!1;this.customCommandsLock=new df.default;this.originalSaveCallback=null;this.editorLintFiles=[];this.fileLintFiles=new Set;this.customCommandsCallback=null;this.currentlyOpeningSidebar=!1;this.activeFileChangeDebouncer=new Map;this.defaultAutoCorrectMisspellings=new Map;this.hasLoadedMisspellingFiles=!1}async onload(){Mm(),go(window.localStorage.getItem("language")),vt(x("logs.plugin-load")),this.isEnabled=!0;for(let t in Me){let i=Me[t];(0,X.addIcon)(i.id,i.source)}await this.loadSettings(),this.addCommands(),this.registerEventsAndSaveCallback(),this.registerEditorSuggest(new Vs(this)),this.settingsTab=new Ws(this.app,this),this.addSettingTab(this.settingsTab)}async onunload(){vt(x("logs.plugin-unload")),this.isEnabled=!1;for(let i of this.eventRefs)this.app.workspace.offref(i);let t=this.app.commands?.commands?.["editor:save-file"];t&&t.callback&&this.originalSaveCallback&&(t.callback=this.originalSaveCallback)}async loadSettings(){let t=await this.loadData();this.settings=Object.assign({},Pa,t),typeof this.settings.logLevel=="number"&&(this.settings.logLevel=ed(this.settings.logLevel)),mo(this.settings.logLevel),await this.setOrUpdateMomentInstance(),this.updatePasteOverrideStatus(),this.updateHasCustomCommandStatus()}async saveSettings(){this.hasLoadedMisspellingFiles||await this.loadAutoCorrectFiles(!1),await this.saveData(this.settings),this.updatePasteOverrideStatus(),this.updateHasCustomCommandStatus()}addCommands(){let t=this;this.addCommand({id:"lint-file",name:x("commands.lint-file.name"),editorCheckCallback(i,r,a){if(i)return t.isMarkdownFile(a.file)&&r.cm!=null;t.runLinterEditor(r)},icon:Me.file.id}),this.addCommand({id:"lint-file-unless-ignored",name:x("commands.lint-file-unless-ignored.name"),editorCheckCallback(i,r,a){if(i)return t.isMarkdownFile(a.file);!t.shouldIgnoreFile(a.file)&&r.cm&&t.runLinterEditor(r)},icon:Me.file.id}),this.addCommand({id:"lint-all-files",name:x("commands.lint-all-files.name"),icon:Me.vault.id,callback:()=>{let i=x("commands.lint-all-files.start-message"),r=x("commands.lint-all-files.submit-button-text"),a=x("commands.lint-all-files.submit-button-notice-text");new Ha(this.app,i,r,a,()=>this.runLinterAllFiles(this.app),this.settings.lintCommands&&this.settings.lintCommands.length>0).open()}}),this.addCommand({id:"lint-all-files-in-folder",name:x("commands.lint-all-files-in-folder.name"),icon:Me.folder.id,editorCheckCallback:(i,r,a)=>{if(i)return a&&a.file&&a.file instanceof X.TFile&&a.file.parent?!a.file.parent.isRoot():!1;this.createFolderLintModal(a.file.parent)}}),this.addCommand({id:"paste-as-plain-text",
`+r),new X.Notice(r),this.settings.ruleConfigs["auto-correct-common-misspellings"].enabled=!1,await this.saveSettings()}),!!this.settings.ruleConfigs["auto-correct-common-misspellings"].enabled)){this.defaultAutoCorrectMisspellings=Mi(an(await uf(this)));for(let r of this.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(r.filePath!=""){let a=this.getFileFromPath(r.filePath);a&&(r.customReplacements=Mi(an(await this.app.vault.cachedRead(a))))}this.hasLoadedMisspellingFiles=!0}}onMenuOpenCallback(t,i,r){i instanceof X.TFile&&this.isMarkdownFile(i)?t.addItem(a=>{a.setIcon(Me.file.id).setTitle(x("commands.lint-file-pop-up-menu-text.name")).onClick(()=>{let o=this.app.workspace.getActiveFile(),s=this.getEditor();o===i&&s&&s.cm?this.runLinterEditor(s):this.runLinterFile(i)})}):i instanceof X.TFolder&&t.addItem(a=>{a.setTitle(x("commands.lint-folder-pop-up-menu-text.name")).setIcon(Me.folder.id).onClick(()=>this.createFolderLintModal(i))})}async onActiveLeafChange(){if(!this.isEnabled||this.currentlyOpeningSidebar)return;let t=this.app.workspace.getActiveFile(),i=this.lastActiveFile==null?!1:await this.app.vault.adapter.exists(this.lastActiveFile.path);if(!this.settings.lintOnFileChange||!i||this.lastActiveFile===t||!this.isMarkdownFile(this.lastActiveFile)||this.shouldIgnoreFile(this.lastActiveFile)){this.lastActiveFile=t;return}try{await this.runLinterFile(this.lastActiveFile,!0)}catch(r){this.handleLintError(this.lastActiveFile,r,x("commands.lint-file.error-message")+" '{FILE_PATH}'",!1)}finally{this.lastActiveFile=t}}shouldIgnoreFile(t){for(let i of this.settings.foldersToIgnore)if(i.length>0&&t.path.startsWith((0,X.normalizePath)(i)+"/"))return!0;for(let i of this.settings.filesToIgnore){if(!i.match)continue;if(new RegExp(`${i.match}`,i.flags).test(t.path))return!0}return!1}isMarkdownFile(t){return t&&t.extension==="md"}async runLinterFile(t,i=!1){let r=an(await this.app.vault.read(t)),a=this.rulesRunner.lintText(ki(r,t,this.momentLocale,this.settings,this.defaultAutoCorrectMisspellings));if(r!=a){if(await this.app.vault.modify(t,a),i){let o=x("logs.file-change-lint-message-start")+" "+this.lastActiveFile.path;this.settings.displayLintOnFileChangeNotice&&new X.Notice(o),vt(o)}this.fileLintFiles.add(t);return}await this.runCustomCommandsInSidebar(t)}async runLinterAllFiles(t){let i=0;if(await Promise.all(t.vault.getMarkdownFiles().map(async r=>{if(!this.shouldIgnoreFile(r))try{await this.runLinterFile(r)}catch(a){this.handleLintError(r,a,x("commands.lint-all-files.error-message")+" '{FILE_PATH}'"),i+=1}})),i===0)new X.Notice(x("commands.lint-all-files.success-message"),Xt);else{let r=i===1?x("commands.lint-all-files.errors-message-singular"):x("commands.lint-all-files.errors-message-plural").replace("{NUM}",i.toString());new X.Notice(r,Xt)}}async runLinterAllFilesInFolder(t){vt(x("logs.folder-lint")+t.name);let i=0,r=0,a=this.getAllFilesInFolder(t);if(await Promise.all(a.map(async o=>{if(!this.shouldIgnoreFile(o)){try{await this.runLinterFile(o)}catch(s){this.handleLintError(o,s,x("commands.lint-all-files-in-folder.error-message")+" '{FILE_PATH}'"),i+=1}r++}})),i===0)new X.Notice(x("commands.lint-all-files-in-folder.success-message").replace("{NUM}",r.toString()).replace("{FOLDER_NAME}",t.name),Xt);else{let o=i===1?x("commands.lint-all-files-in-folder.message-singular").replace("{NUM}",r.toString()).replace("{FOLDER_NAME}",t.name):x("commands.lint-all-files-in-folder.message-plural").replace("{FILE_COUNT}",r.toString()).replace("{FOLDER_NAME}",t.name).replace("{ERROR_COUNT}",i.toString());new X.Notice(o,Xt)}}createFolderLintModal(t){let i=x("commands.lint-all-files-in-folder.start-message").replace("{FOLDER_NAME}",t.name),r=x("commands.lint-all-files-in-folder.submit-button-text").replace("{FOLDER_NAME}",t.name),a=x("commands.lint-all-files-in-folder.submit-button-notice-text").replace("{FOLDER_NAME}",t.name);new Ha(this.app,i,r,a,()=>this.runLinterAllFilesInFolder(t),this.settings.lintCommands&&this.settings.lintCommands.length>0).open()}async runLinterEditor(t){fl(this.settings.
`+x("disabled-conflicting-rule-notice").replace("{NAME_1}",x("rules.header-increment.start-at-h2.name")).replace("{NAME_2}",x("rules.file-name-heading.name"))),this.settings.ruleConfigs["paragraph-blank-lines"]&&this.settings.ruleConfigs["paragraph-blank-lines"].enabled&&this.settings.ruleConfigs["two-spaces-between-lines-with-content"]&&this.settings.ruleConfigs["two-spaces-between-lines-with-content"].enabled&&(this.settings.ruleConfigs["paragraph-blank-lines"].enabled=!1,t=!0,r&&(i+=`
`),r=!0,i+=`
`+x("disabled-conflicting-rule-notice").replace("{NAME_1}",x("rules.paragraph-blank-lines.name")).replace("{NAME_2}",x("rules.two-spaces-between-lines-with-content.name"))),r&&new X.Notice(i,Xt);for(let a of Bt){let o=a.getDefaultOptions();if(!this.settings.ruleConfigs[a.alias]){this.settings.ruleConfigs[a.alias]=o,t=!0;continue}if(a.alias=="space-between-chinese-japanese-or-korean-and-english-or-numbers")"english-symbols-punctuation-before"in this.settings.ruleConfigs[a.alias]||(this.settings.ruleConfigs[a.alias]["english-symbols-punctuation-before"]=o["english-symbols-punctuation-before"],t=!0),"english-symbols-punctuation-after"in this.settings.ruleConfigs[a.alias]||(this.settings.ruleConfigs[a.alias]["english-symbols-punctuation-after"]=o["english-symbols-punctuation-after"],t=!0);else if(a.alias=="yaml-timestamp"){let s=a.getDefaultOptions();"force-retention-of-create-value"in this.settings.ruleConfigs[a.alias]&&("date-created-source-of-truth"in this.settings.ruleConfigs[a.alias]||(this.settings.ruleConfigs[a.alias]["force-retention-of-create-value"]?this.settings.ruleConfigs[a.alias]["date-created-source-of-truth"]="frontmatter":this.settings.ruleConfigs[a.alias]["date-created-source-of-truth"]=s["date-created-source-of-truth"]),delete this.settings.ruleConfigs[a.alias]["force-retention-of-create-value"],t=!0),"date-modified-source-of-truth"in this.settings.ruleConfigs[a.alias]||(this.settings.ruleConfigs[a.alias]["date-modified-source-of-truth"]=s["date-modified-source-of-truth"],t=!0)}for(let s of Object.keys(o))Object.hasOwn(this.settings.ruleConfigs[a.alias],s)||(this.settings.ruleConfigs[a.alias][s]=o[s],t=!0)}for(let a of this.settings.customRegexes)Object.hasOwn(a,"enabled")||(a.enabled=!0,t=!0);for(let a of this.settings.lintCommands)Object.hasOwn(a,"enabled")||(a.enabled=!0,t=!0);t&&await this.saveSettings()}createDebouncedFileUpdate(){let t=5e3;switch(this.settings.ruleConfigs["yaml-timestamp"]["update-on-file-contents-updated"]??"never"){case"after 10 seconds":t=1e4;break;case"after 15 seconds":t=15e3;break;case"after 30 seconds":t=3e4;break;case"after 1 minute":t=6e4;break}return(0,X.debounce)(async(i,r)=>{if(!this.activeFileChangeDebouncer.has(i.path)){pt(x("logs.file-change-yaml-lint-warning"));return}let a=this.activeFileChangeDebouncer.get(i.path);a.isRunning=!0;let o=r.getValue(),s=await this.app.vault.cachedRead(i),l=o===s,c="";if(l){c=o;let u=c;if(c!=a.originalText){vt(x("logs.file-change-yaml-lint-run"));try{u=this.rulesRunner.runYAMLTimestampByItself(ki(c,i,this.momentLocale,this.settings,null))}catch(d){this.handleLintError(i,d,x("commands.lint-file.error-message")+" '{FILE_PATH}'",!1);return}this.updateEditor(c,u,r)}else vt(x("logs.file-change-yaml-lint-skipped"))}else c=s,c!=a.originalText?(vt(x("logs.file-change-yaml-lint-run")),await this.app.vault.process(i,u=>{vt(x("logs.file-change-yaml-lint-run"));try{return this.rulesRunner.runYAMLTimestampByItself(ki(c,i,this.momentLocale,this.settings,null))}catch(d){return this.handleLintError(i,d,x("commands.lint-file.error-message")+" '{FILE_PATH}'",!1),u}})):vt(x("logs.file-change-yaml-lint-skipped"));this.activeFileChangeDebouncer.delete(i.path),a.isRunning=!1},t,!0)}updateEditor(t,i,r){let o=new tr.default.diff_match_patch().diff_main(t,i),s="";return o.forEach(l=>{let[c,u]=l;if(c==tr.default.DIFF_INSERT)r.cm.dispatch({changes:[{from:r.posToOffset(this.endOfDocument(s)),insert:u}],filter:!1}),s+=u;else if(c==tr.default.DIFF_DELETE){let d=this.endOfDocument(s),m=s;m+=u;let p=this.endOfDocument(m);r.cm.dispatch({changes:[{from:r.posToOffset(d),to:r.posToOffset(p),insert:""}],filter:!1})}else s+=u}),o}displayChangedMessage(t,i){if(this.settings.displayChanged){let r=Fm`
${t} ${x("notice-text.characters-added")}
${i} ${x("notice-text.characters-removed")}
`;new X.Notice(r)}}handleLintError(t,i,r,a=!0){let o=r.replace("{FILE_PATH}",t.path),s=x("logs.see-console");i instanceof Vi?a?new X.Notice(`${o} ${i.message}.
${s}`,Xt):new X.Notice(`${i.message}.
${s}`,Xt):new X.Notice(`${x("logs.unknown-error")} ${s}`,Xt),uo(o,i)}async modifyPasteEvent(t,i){if(!i)return;let r=t.clipboardData.getData("text/plain");if(!r)return;let a=r.trim();if(zn.test(a)){pt(x("logs.paste-link-warning"));return}if(t.stopPropagation(),t.preventDefault(),!t.defaultPrevented)return;let o=this.app.vault.getConfig("autoConvertHtml"),s=t.clipboardData.getData("text/html"),l=s&&o?(0,X.htmlToMarkdown)(s):r,c=i.listSelections();if(c.length===1){let u=c[0];l=this.rulesRunner.runPasteLint(this.getLineContent(i,u),i.getSelection()??"",ki(l,null,this.momentLocale,this.settings,null)),i.replaceSelection(l)}else this.handleMultiCursorPaste(i,c,l)}handleMultiCursorPaste(t,i,r){let a=this.convertContentIntoProperPasteContent(i,r),o=[];i.forEach((s,l)=>{r=this.rulesRunner.runPasteLint(this.getLineContent(t,s),t.getRange(s.anchor,s.head)??"",ki(a[l],null,this.momentLocale,this.settings,null)),o.push({text:r,from:s.anchor,to:s.head})}),t.transaction({changes:o})}convertContentIntoProperPasteContent(t,i){let r=i.split(`
`),a=[];if(r.length%t.length!==0)for(let o=0;o<t.length;o++)a.push(i);else{let o=r.length/t.length,s="";for(let l=0;l<r.length;l++)s+=r[l],(l+1===t.length||(l+1)%o===0)&&(a.push(s),s="")}return a}async pasteAsPlainText(t){let i=await navigator.clipboard.readText();if(!i){new X.Notice(x("notice-text.empty-clipboard"),Xt);return}t.replaceSelection(i)}setCustomCommandCallback(t){(0,pf.warn)(x("logs.custom-command-callback-warning")),this.customCommandsCallback=t}async runCustomCommandsInSidebar(t){if(!this.settings.lintCommands||this.settings.lintCommands.length==0||!this.hasCustomCommands)return;let i=this.app.workspace.getRightLeaf(!1),r=this.getEditor();await this.customCommandsLock.acquire("command",async()=>{this.currentlyOpeningSidebar=!0,await i.openFile(t),this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands),this.customCommandsCallback&&await this.customCommandsCallback(t)}),i.detach(),r&&r.focus(),this.currentlyOpeningSidebar=!1}async runCustomCommands(t){!this.settings.lintCommands||this.settings.lintCommands.length==0||!this.hasCustomCommands||(await this.customCommandsLock.acquire("command",async()=>{try{this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands)}catch(i){this.handleLintError(t,i,x("commands.lint-file.error-message")+" '{FILE_PATH}'",!1)}this.customCommandsCallback&&await this.customCommandsCallback(t)}),this.updateFileDebouncerText(t,an(await this.app.vault.read(t))))}getEditor(){let t=this.app.workspace.getActiveViewOfType(X.MarkdownView);return t?t.editor:null}getLineContent(t,i){return t.getLine(i.anchor.line)}async moveConfigValuesToKeyBasedFormat(){go("en");let t=!1;for(let i of Bt){let r=x("rules."+i.alias+".name"),a=this.settings.ruleConfigs[r];if(a!=null){let o=x("rules."+i.alias+".description"),s={enabled:a[o]??!1};for(let l of i.options){if(l.configKey==="enabled")continue;let c=x("rules."+i.alias+"."+l.configKey+".name");s[l.configKey]=a[c]??l.defaultValue}this.settings.ruleConfigs[i.alias]=s,delete this.settings.ruleConfigs[r],t=!0}}return this.settings.settingsConvertedToConfigKeyValues=!0,await this.saveSettings(),go(window.localStorage.getItem("language")),t}getAllFilesInFolder(t){let i=[],r=[t];for(let a of r)for(let o of a.children)o instanceof X.TFile&&this.isMarkdownFile(o)?i.push(o):o instanceof X.TFolder&&r.push(o);return i}updatePasteOverrideStatus(){for(let t of $n.get("Paste"))if(t.getOptions(this.settings)?.enabled){this.overridePaste=!0;return}this.overridePaste=!1}updateHasCustomCommandStatus(){for(let t of this.settings.lintCommands)if(t.id&&t.id.trim()!=""&&t.enabled){this.hasCustomCommands=!0;return}this.hasCustomCommands=!1}endOfDocument(t){let i=t.split(`
`);return{line:i.length-1,ch:i[i.length-1].length}}getFileFromPath(t){let i=this.app.vault.getAbstractFileByPath((0,X.normalizePath)(t));return i instanceof X.TFile?i:null}updateFileDebouncerText(t,i){this.activeFileChangeDebouncer.has(t.path)&&(this.activeFileChangeDebouncer.get(t.path).originalText=i)}};
/*! Bundled license information:
js-yaml/dist/js-yaml.mjs:
(*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
*/
/* nosourcemap */