You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
181 KiB

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var Kn=Object.create;var bt=Object.defineProperty;var Jn=Object.getOwnPropertyDescriptor;var Zn=Object.getOwnPropertyNames;var Qn=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty;var tr=(i,t,e)=>t in i?bt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var at=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),ir=(i,t)=>{for(var e in t)bt(i,e,{get:t[e],enumerable:!0})},Na=(i,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Zn(t))!er.call(i,n)&&n!==e&&bt(i,n,{get:()=>t[n],enumerable:!(a=Jn(t,n))||a.enumerable});return i};var zt=(i,t,e)=>(e=i!=null?Kn(Qn(i)):{},Na(t||!i||!i.__esModule?bt(e,"default",{value:i,enumerable:!0}):e,i)),ar=i=>Na(bt({},"__esModule",{value:!0}),i);var _=(i,t,e)=>tr(i,typeof t!="symbol"?t+"":t,e);var Ua=at(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.toSeconds=ae.end=ae.parse=ae.pattern=void 0;var rt="\\d+",Ai="".concat(rt,"(?:[\\.,]").concat(rt,")?"),rr="(".concat(rt,"Y)?(").concat(rt,"M)?(").concat(rt,"W)?(").concat(rt,"D)?"),sr="T(".concat(Ai,"H)?(").concat(Ai,"M)?(").concat(Ai,"S)?"),or="P(?:".concat(rr,"(?:").concat(sr,")?)"),lr=["years","months","weeks","days","hours","minutes","seconds"],Fa=Object.freeze({years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0});ae.pattern=new RegExp(or);var pr=function(i){var t=i.replace(/,/g,".").match(ae.pattern);if(!t)throw new RangeError("invalid duration: ".concat(i));var e=t.slice(1);if(e.filter(function(a){return a!=null}).length===0)throw new RangeError("invalid duration: ".concat(i));if(e.filter(function(a){return/\./.test(a||"")}).length>1)throw new RangeError("only the smallest unit can be fractional");return e.reduce(function(a,n,r){return a[lr[r]]=parseFloat(n||"0")||0,a},{})};ae.parse=pr;var cr=function(i,t){t===void 0&&(t=new Date);var e=Object.assign({},Fa,i),a=t.getTime(),n=new Date(a);n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+e.days);var r=e.hours*3600*1e3,s=e.minutes*60*1e3;return n.setMilliseconds(n.getMilliseconds()+e.seconds*1e3+r+s),n.setDate(n.getDate()+e.weeks*7),n};ae.end=cr;var mr=function(i,t){t===void 0&&(t=new Date);var e=Object.assign({},Fa,i),a=t.getTime(),n=new Date(a),r=(0,ae.end)(e,n),s=t.getTimezoneOffset(),p=r.getTimezoneOffset(),l=(s-p)*60,c=(r.getTime()-n.getTime())/1e3;return c+l};ae.toSeconds=mr;ae.default={end:ae.end,toSeconds:ae.toSeconds,pattern:ae.pattern,parse:ae.parse}});var Vi=at((Fi,Ui)=>{(function(i,t){typeof Fi=="object"&&typeof Ui!="undefined"?Ui.exports=t():typeof define=="function"&&define.amd?define(t):(i=typeof globalThis!="undefined"?globalThis:i||self,i.DOMPurify=t())})(Fi,function(){"use strict";function i(h){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},i(h)}function t(h,b){return t=Object.setPrototypeOf||function(C,Y){return C.__proto__=Y,C},t(h,b)}function e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(h){return!1}}function a(h,b,A){return e()?a=Reflect.construct:a=function(Y,Te,he){var Re=[null];Re.push.apply(Re,Te);var je=Function.bind.apply(Y,Re),gt=new je;return he&&t(gt,he.prototype),gt},a.apply(null,arguments)}function n(h){return r(h)||s(h)||p(h)||c()}function r(h){if(Array.isArray(h))return l(h)}function s(h){if(typeof Symbol!="undefined"&&h[Symbol.iterator]!=null||h["@@iterator"]!=null)return Array.from(h)}function p(h,b){if(h){if(typeof h=="string")return l(h,b);var A=Object.prototype.toString.call(h).slice(8,-1);if(A==="Object"&&h.constructor&&(A=h.constructor.name),A==="Map"||A==="Set")return Array.from(h);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return l(h,b)}}function l(h,b){(b==null||b>h.length)&&(b=h.length);for(var A=0,C=new Array(b);A<b;A++)C[A]=h[A];return C}function c(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u=Object.hasOwnProperty,v=Object.setPrototypeOf,k=Object.isFrozen,y=Object.getPrototypeOf,D=Object.getOwnPropertyDescriptor,N=Object.freeze,S=Object.seal,j=Object.create,U=typeof Reflect!="undefined"&&Reflect,z=U.apply,x=U.construct;z||(z=function(b,A,C){return b.apply(A,C)}),N||(N=function(b){return b}),S||(S=function(b){return b}),x||(x=function(b,A){return a(b,n(A))});var X=G(Array.prototype.forEach),E=G(Array.prototype.pop),I=G(Array.prototype.push),J=G(String.prototype.toLowerCase),ne=G(String.prototype.toString),le=G(String.prototype.match),V=G(String.prototype.replace),Ee=G(String.prototype.indexOf),Ie=G(String.prototype.trim),M=G(RegExp.prototype.test),O=Ae(TypeError);function G(h){return function(b){for(var A=arguments.length,C=new Array(A>1?A-1:0),Y=1;Y<A;Y++)C[Y-1]=arguments[Y];return z(h,b,C)}}function Ae(h){return function(){for(var b=arguments.length,A=new Array(b),C=0;C<b;C++)A[C]=arguments[C];return x(h,A)}}function w(h,b,A){var C;A=(C=A)!==null&&C!==void 0?C:J,v&&v(h,null);for(var Y=b.length;Y--;){var Te=b[Y];if(typeof Te=="string"){var he=A(Te);he!==Te&&(k(b)||(b[Y]=he),Te=he)}h[Te]=!0}return h}function re(h){var b=j(null),A;for(A in h)z(u,h,[A])===!0&&(b[A]=h[A]);return b}function L(h,b){for(;h!==null;){var A=D(h,b);if(A){if(A.get)return G(A.get);if(typeof A.value=="function")return G(A.value)}h=y(h)}function C(Y){return console.warn("fallback value for",Y),null}return C}var me=N(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fe=N(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ve=N(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ce=N(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ge=N(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),be=N(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xe=N(["#text"]),ue=N(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Se=N(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_e=N(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),$=N(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),te=S(/\{\{[\w\W]*|[\w\W]*\}\}/gm),De=S(/<%[\w\W]*|[\w\W]*%>/gm),q=S(/\${[\w\W]*}/gm),F=S(/^data-[\-\w.\u00B7-\uFFFF]/),ye=S(/^aria-[\-\w]+$/),R=S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Me=S(/^(?:\w+script|data):/i),Ve=S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=S(/^html$/i),ei=S(/^[a-z][.\w]*(-[.\w]+)+$/i),An=function(){return typeof window=="undefined"?null:window},Sn=function(b,A){if(i(b)!=="object"||typeof b.createPolicy!="function")return null;var C=null,Y="data-tt-policy-suffix";A.currentScript&&A.currentScript.hasAttribute(Y)&&(C=A.currentScript.getAttribute(Y));var Te="dompurify"+(C?"#"+C:"");try{return b.createPolicy(Te,{createHTML:function(Re){return Re},createScriptURL:function(Re){return Re}})}catch(he){return console.warn("TrustedTypes policy "+Te+" could not be created."),null}};function Zi(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:An(),b=function(o){return Zi(o)};if(b.version="2.5.6",b.removed=[],!h||!h.document||h.document.nodeType!==9)return b.isSupported=!1,b;var A=h.document,C=h.document,Y=h.DocumentFragment,Te=h.HTMLTemplateElement,he=h.Node,Re=h.Element,je=h.NodeFilter,gt=h.NamedNodeMap,Dn=gt===void 0?h.NamedNodeMap||h.MozNamedAttrMap:gt,kn=h.HTMLFormElement,Cn=h.DOMParser,Pt=h.trustedTypes,Lt=Re.prototype,Rn=L(Lt,"cloneNode"),Pn=L(Lt,"nextSibling"),Ln=L(Lt,"childNodes"),ti=L(Lt,"parentNode");if(typeof Te=="function"){var ii=C.createElement("template");ii.content&&ii.content.ownerDocument&&(C=ii.content.ownerDocument)}var ke=Sn(Pt,A),ai=ke?ke.createHTML(""):"",It=C,ni=It.implementation,In=It.createNodeIterator,Mn=It.createDocumentFragment,On=It.getElementsByTagName,Fn=A.importNode,Qi={};try{Qi=re(C).documentMode?C.documentMode:{}}catch(T){}var Pe={};b.isSupported=typeof ti=="function"&&ni&&ni.createHTMLDocument!==void 0&&Qi!==9;var ri=te,si=De,oi=q,Un=F,Vn=ye,Hn=Me,ea=Ve,zn=ei,li=R,Z=null,ta=w({},[].concat(n(me),n(fe),n(ve),n(ge),n(xe))),Q=null,ia=w({},[].concat(n(ue),n(Se),n(_e),n($))),W=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ht=null,pi=null,aa=!0,ci=!0,na=!1,ra=!0,Je=!1,mi=!0,$e=!1,ui=!1,di=!1,Ze=!1,Mt=!1,Ot=!1,sa=!0,oa=!1,Bn="user-content-",gi=!0,ft=!1,Qe={},et=null,la=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),pa=null,ca=w({},["audio","video","img","source","image","track"]),hi=null,ma=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ft="http://www.w3.org/1998/Math/MathML",Ut="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml",tt=Oe,fi=!1,vi=null,jn=w({},[Ft,Ut,Oe],ne),We,$n=["application/xhtml+xml","text/html"],Wn="text/html",ee,it=null,Gn=C.createElement("form"),ua=function(o){return o instanceof RegExp||o instanceof Function},bi=function(o){it&&it===o||((!o||i(o)!=="object")&&(o={}),o=re(o),We=$n.indexOf(o.PARSER_MEDIA_TYPE)===-1?We=Wn:We=o.PARSER_MEDIA_TYPE,ee=We==="application/xhtml+xml"?ne:J,Z="ALLOWED_TAGS"in o?w({},o.ALLOWED_TAGS,ee):ta,Q="ALLOWED_ATTR"in o?w({},o.ALLOWED_ATTR,ee):ia,vi="ALLOWED_NAMESPACES"in o?w({},o.ALLOWED_NAMESPACES,ne):jn,hi="ADD_URI_SAFE_ATTR"in o?w(re(ma),o.ADD_URI_SAFE_ATTR,ee):ma,pa="ADD_DATA_URI_TAGS"in o?w(re(ca),o.ADD_DATA_URI_TAGS,ee):ca,et="FORBID_CONTENTS"in o?w({},o.FORBID_CONTENTS,ee):la,ht="FORBID_TAGS"in o?w({},o.FORBID_TAGS,ee):{},pi="FORBID_ATTR"in o?w({},o.FORBID_ATTR,ee):{},Qe="USE_PROFILES"in o?o.USE_PROFILES:!1,aa=o.ALLOW_ARIA_ATTR!==!1,ci=o.ALLOW_DATA_ATTR!==!1,na=o.ALLOW_UNKNOWN_PROTOCOLS||!1,ra=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Je=o.SAFE_FOR_TEMPLATES||!1,mi=o.SAFE_FOR_XML!==!1,$e=o.WHOLE_DOCUMENT||!1,Ze=o.RETURN_DOM||!1,Mt=o.RETURN_DOM_FRAGMENT||!1,Ot=o.RETURN_TRUSTED_TYPE||!1,di=o.FORCE_BODY||!1,sa=o.SANITIZE_DOM!==!1,oa=o.SANITIZE_NAMED_PROPS||!1,gi=o.KEEP_CONTENT!==!1,ft=o.IN_PLACE||!1,li=o.ALLOWED_URI_REGEXP||li,tt=o.NAMESPACE||Oe,W=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&ua(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&ua(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Je&&(ci=!1),Mt&&(Ze=!0),Qe&&(Z=w({},n(xe)),Q=[],Qe.html===!0&&(w(Z,me),w(Q,ue)),Qe.svg===!0&&(w(Z,fe),w(Q,Se),w(Q,$)),Qe.svgFilters===!0&&(w(Z,ve),w(Q,Se),w(Q,$)),Qe.mathMl===!0&&(w(Z,ge),w(Q,_e),w(Q,$))),o.ADD_TAGS&&(Z===ta&&(Z=re(Z)),w(Z,o.ADD_TAGS,ee)),o.ADD_ATTR&&(Q===ia&&(Q=re(Q)),w(Q,o.ADD_ATTR,ee)),o.ADD_URI_SAFE_ATTR&&w(hi,o.ADD_URI_SAFE_ATTR,ee),o.FORBID_CONTENTS&&(et===la&&(et=re(et)),w(et,o.FORBID_CONTENTS,ee)),gi&&(Z["#text"]=!0),$e&&w(Z,["html","head","body"]),Z.table&&(w(Z,["tbody"]),delete ht.tbody),N&&N(o),it=o)},da=w({},["mi","mo","mn","ms","mtext"]),ga=w({},["foreignobject","annotation-xml"]),qn=w({},["title","style","font","a","script"]),Vt=w({},fe);w(Vt,ve),w(Vt,Ce);var xi=w({},ge);w(xi,be);var Yn=function(o){var m=ti(o);(!m||!m.tagName)&&(m={namespaceURI:tt,tagName:"template"});var g=J(o.tagName),P=J(m.tagName);return vi[o.namespaceURI]?o.namespaceURI===Ut?m.namespaceURI===Oe?g==="svg":m.namespaceURI===Ft?g==="svg"&&(P==="annotation-xml"||da[P]):!!Vt[g]:o.namespaceURI===Ft?m.namespaceURI===Oe?g==="math":m.namespaceURI===Ut?g==="math"&&ga[P]:!!xi[g]:o.namespaceURI===Oe?m.namespaceURI===Ut&&!ga[P]||m.namespaceURI===Ft&&!da[P]?!1:!xi[g]&&(qn[g]||!Vt[g]):!!(We==="application/xhtml+xml"&&vi[o.namespaceURI]):!1},we=function(o){I(b.removed,{element:o});try{o.parentNode.removeChild(o)}catch(m){try{o.outerHTML=ai}catch(g){o.remove()}}},Ht=function(o,m){try{I(b.removed,{attribute:m.getAttributeNode(o),from:m})}catch(g){I(b.removed,{attribute:null,from:m})}if(m.removeAttribute(o),o==="is"&&!Q[o])if(Ze||Mt)try{we(m)}catch(g){}else try{m.setAttribute(o,"")}catch(g){}},ha=function(o){var m,g;if(di)o="<remove></remove>"+o;else{var P=le(o,/^[\r\n\t ]+/);g=P&&P[0]}We==="application/xhtml+xml"&&tt===Oe&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");var de=ke?ke.createHTML(o):o;if(tt===Oe)try{m=new Cn().parseFromString(de,We)}catch(ie){}if(!m||!m.documentElement){m=ni.createDocument(tt,"template",null);try{m.documentElement.innerHTML=fi?ai:de}catch(ie){}}var se=m.body||m.documentElement;return o&&g&&se.insertBefore(C.createTextNode(g),se.childNodes[0]||null),tt===Oe?On.call(m,$e?"html":"body")[0]:$e?m.documentElement:se},fa=function(o){return In.call(o.ownerDocument||o,o,je.SHOW_ELEMENT|je.SHOW_COMMENT|je.SHOW_TEXT|je.SHOW_PROCESSING_INSTRUCTION|je.SHOW_CDATA_SECTION,null,!1)},va=function(o){return o instanceof kn&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof Dn)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},vt=function(o){return i(he)==="object"?o instanceof he:o&&i(o)==="object"&&typeof o.nodeType=="number"&&typeof o.nodeName=="string"},Fe=function(o,m,g){Pe[o]&&X(Pe[o],function(P){P.call(b,m,g,it)})},ba=function(o){var m;if(Fe("beforeSanitizeElements",o,null),va(o)||M(/[\u0080-\uFFFF]/,o.nodeName))return we(o),!0;var g=ee(o.nodeName);if(Fe("uponSanitizeElement",o,{tagName:g,allowedTags:Z}),o.hasChildNodes()&&!vt(o.firstElementChild)&&(!vt(o.content)||!vt(o.content.firstElementChild))&&M(/<[/\w]/g,o.innerHTML)&&M(/<[/\w]/g,o.textContent)||g==="select"&&M(/<template/i,o.innerHTML)||o.nodeType===7||mi&&o.nodeType===8&&M(/<[/\w]/g,o.data))return we(o),!0;if(!Z[g]||ht[g]){if(!ht[g]&&ya(g)&&(W.tagNameCheck instanceof RegExp&&M(W.tagNameCheck,g)||W.tagNameCheck instanceof Function&&W.tagNameCheck(g)))return!1;if(gi&&!et[g]){var P=ti(o)||o.parentNode,de=Ln(o)||o.childNodes;if(de&&P)for(var se=de.length,ie=se-1;ie>=0;--ie){var Ge=Rn(de[ie],!0);Ge.__removalCount=(o.__removalCount||0)+1,P.insertBefore(Ge,Pn(o))}}return we(o),!0}return o instanceof Re&&!Yn(o)||(g==="noscript"||g==="noembed"||g==="noframes")&&M(/<\/no(script|embed|frames)/i,o.innerHTML)?(we(o),!0):(Je&&o.nodeType===3&&(m=o.textContent,m=V(m,ri," "),m=V(m,si," "),m=V(m,oi," "),o.textContent!==m&&(I(b.removed,{element:o.cloneNode()}),o.textContent=m)),Fe("afterSanitizeElements",o,null),!1)},xa=function(o,m,g){if(sa&&(m==="id"||m==="name")&&(g in C||g in Gn))return!1;if(!(ci&&!pi[m]&&M(Un,m))){if(!(aa&&M(Vn,m))){if(!Q[m]||pi[m]){if(!(ya(o)&&(W.tagNameCheck instanceof RegExp&&M(W.tagNameCheck,o)||W.tagNameCheck instanceof Function&&W.tagNameCheck(o))&&(W.attributeNameCheck instanceof RegExp&&M(W.attributeNameCheck,m)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(m))||m==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&M(W.tagNameCheck,g)||W.tagNameCheck instanceof Function&&W.tagNameCheck(g))))return!1}else if(!hi[m]){if(!M(li,V(g,ea,""))){if(!((m==="src"||m==="xlink:href"||m==="href")&&o!=="script"&&Ee(g,"data:")===0&&pa[o])){if(!(na&&!M(Hn,V(g,ea,"")))){if(g)return!1}}}}}}return!0},ya=function(o){return o!=="annotation-xml"&&le(o,zn)},Ta=function(o){var m,g,P,de;Fe("beforeSanitizeAttributes",o,null);var se=o.attributes;if(se){var ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q};for(de=se.length;de--;){m=se[de];var Ge=m,K=Ge.name,yi=Ge.namespaceURI;if(g=K==="value"?m.value:Ie(m.value),P=ee(K),ie.attrName=P,ie.attrValue=g,ie.keepAttr=!0,ie.forceKeepAttr=void 0,Fe("uponSanitizeAttribute",o,ie),g=ie.attrValue,mi&&M(/((--!?|])>)|<\/(style|title)/i,g)){Ht(K,o);continue}if(!ie.forceKeepAttr&&(Ht(K,o),!!ie.keepAttr)){if(!ra&&M(/\/>/i,g)){Ht(K,o);continue}Je&&(g=V(g,ri," "),g=V(g,si," "),g=V(g,oi," "));var wa=ee(o.nodeName);if(xa(wa,P,g)){if(oa&&(P==="id"||P==="name")&&(Ht(K,o),g=Bn+g),ke&&i(Pt)==="object"&&typeof Pt.getAttributeType=="function"&&!yi)switch(Pt.getAttributeType(wa,P)){case"TrustedHTML":{g=ke.createHTML(g);break}case"TrustedScriptURL":{g=ke.createScriptURL(g);break}}try{yi?o.setAttributeNS(yi,K,g):o.setAttribute(K,g),va(o)?we(o):E(b.removed)}catch(ss){}}}}Fe("afterSanitizeAttributes",o,null)}},Xn=function T(o){var m,g=fa(o);for(Fe("beforeSanitizeShadowDOM",o,null);m=g.nextNode();)Fe("uponSanitizeShadowNode",m,null),!ba(m)&&(m.content instanceof Y&&T(m.content),Ta(m));Fe("afterSanitizeShadowDOM",o,null)};return b.sanitize=function(T){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m,g,P,de,se;if(fi=!T,fi&&(T="<!-->"),typeof T!="string"&&!vt(T))if(typeof T.toString=="function"){if(T=T.toString(),typeof T!="string")throw O("dirty is not a string, aborting")}else throw O("toString is not a function");if(!b.isSupported){if(i(h.toStaticHTML)==="object"||typeof h.toStaticHTML=="function"){if(typeof T=="string")return h.toStaticHTML(T);if(vt(T))return h.toStaticHTML(T.outerHTML)}return T}if(ui||bi(o),b.removed=[],typeof T=="string"&&(ft=!1),ft){if(T.nodeName){var ie=ee(T.nodeName);if(!Z[ie]||ht[ie])throw O("root node is forbidden and cannot be sanitized in-place")}}else if(T instanceof he)m=ha("<!---->"),g=m.ownerDocument.importNode(T,!0),g.nodeType===1&&g.nodeName==="BODY"||g.nodeName==="HTML"?m=g:m.appendChild(g);else{if(!Ze&&!Je&&!$e&&T.indexOf("<")===-1)return ke&&Ot?ke.createHTML(T):T;if(m=ha(T),!m)return Ze?null:Ot?ai:""}m&&di&&we(m.firstChild);for(var Ge=fa(ft?T:m);P=Ge.nextNode();)P.nodeType===3&&P===de||ba(P)||(P.content instanceof Y&&Xn(P.content),Ta(P),de=P);if(de=null,ft)return T;if(Ze){if(Mt)for(se=Mn.call(m.ownerDocument);m.firstChild;)se.appendChild(m.firstChild);else se=m;return(Q.shadowroot||Q.shadowrootmod)&&(se=Fn.call(A,se,!0)),se}var K=$e?m.outerHTML:m.innerHTML;return $e&&Z["!doctype"]&&m.ownerDocument&&m.ownerDocument.doctype&&m.ownerDocument.doctype.name&&M(Rt,m.ownerDocument.doctype.name)&&(K="<!DOCTYPE "+m.ownerDocument.doctype.name+`>
`+K),Je&&(K=V(K,ri," "),K=V(K,si," "),K=V(K,oi," ")),ke&&Ot?ke.createHTML(K):K},b.setConfig=function(T){bi(T),ui=!0},b.clearConfig=function(){it=null,ui=!1},b.isValidAttribute=function(T,o,m){it||bi({});var g=ee(T),P=ee(o);return xa(g,P,m)},b.addHook=function(T,o){typeof o=="function"&&(Pe[T]=Pe[T]||[],I(Pe[T],o))},b.removeHook=function(T){if(Pe[T])return E(Pe[T])},b.removeHooks=function(T){Pe[T]&&(Pe[T]=[])},b.removeAllHooks=function(){Pe={}},b}var _n=Zi();return _n})});var Hi=at((xo,pn)=>{pn.exports=window.DOMPurify||(window.DOMPurify=Vi().default||Vi())});var dn=at((Vo,$i)=>{function un(i,t){if(t&&t.documentElement)i=t,t=arguments[2];else if(!i||!i.documentElement)throw new Error("First argument to Readability constructor should be a document object.");if(t=t||{},this._doc=i,this._docJSDOMParser=this._doc.firstChild.__JSDOMParser__,this._articleTitle=null,this._articleByline=null,this._articleDir=null,this._articleSiteName=null,this._attempts=[],this._debug=!!t.debug,this._maxElemsToParse=t.maxElemsToParse||this.DEFAULT_MAX_ELEMS_TO_PARSE,this._nbTopCandidates=t.nbTopCandidates||this.DEFAULT_N_TOP_CANDIDATES,this._charThreshold=t.charThreshold||this.DEFAULT_CHAR_THRESHOLD,this._classesToPreserve=this.CLASSES_TO_PRESERVE.concat(t.classesToPreserve||[]),this._keepClasses=!!t.keepClasses,this._serializer=t.serializer||function(e){return e.innerHTML},this._disableJSONLD=!!t.disableJSONLD,this._allowedVideoRegex=t.allowedVideoRegex||this.REGEXPS.videos,this._flags=this.FLAG_STRIP_UNLIKELYS|this.FLAG_WEIGHT_CLASSES|this.FLAG_CLEAN_CONDITIONALLY,this._debug){let e=function(a){if(a.nodeType==a.TEXT_NODE)return`${a.nodeName} ("${a.textContent}")`;let n=Array.from(a.attributes||[],function(r){return`${r.name}="${r.value}"`}).join(" ");return`<${a.localName} ${n}>`};this.log=function(){if(typeof console!="undefined"){let n=Array.from(arguments,r=>r&&r.nodeType==this.ELEMENT_NODE?e(r):r);n.unshift("Reader: (Readability)"),console.log.apply(console,n)}else if(typeof dump!="undefined"){var a=Array.prototype.map.call(arguments,function(n){return n&&n.nodeName?e(n):n}).join(" ");dump("Reader: (Readability) "+a+`
`)}}}else this.log=function(){}}un.prototype={FLAG_STRIP_UNLIKELYS:1,FLAG_WEIGHT_CLASSES:2,FLAG_CLEAN_CONDITIONALLY:4,ELEMENT_NODE:1,TEXT_NODE:3,DEFAULT_MAX_ELEMS_TO_PARSE:0,DEFAULT_N_TOP_CANDIDATES:5,DEFAULT_TAGS_TO_SCORE:"section,h2,h3,h4,h5,h6,p,td,pre".toUpperCase().split(","),DEFAULT_CHAR_THRESHOLD:500,REGEXPS:{unlikelyCandidates:/-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,okMaybeItsACandidate:/and|article|body|column|content|main|shadow/i,positive:/article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i,negative:/-ad-|hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|gdpr|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i,extraneous:/print|archive|comment|discuss|e[\-]?mail|share|reply|all|login|sign|single|utility/i,byline:/byline|author|dateline|writtenby|p-author/i,replaceFonts:/<(\/?)font[^>]*>/gi,normalize:/\s{2,}/g,videos:/\/\/(www\.)?((dailymotion|youtube|youtube-nocookie|player\.vimeo|v\.qq)\.com|(archive|upload\.wikimedia)\.org|player\.twitch\.tv)/i,shareElements:/(\b|_)(share|sharedaddy)(\b|_)/i,nextLink:/(next|weiter|continue|>([^\|]|$)|»([^\|]|$))/i,prevLink:/(prev|earl|old|new|<|«)/i,tokenize:/\W+/g,whitespace:/^\s*$/,hasContent:/\S$/,hashUrl:/^#.+/,srcsetUrl:/(\S+)(\s+[\d.]+[xw])?(\s*(?:,|$))/g,b64DataUrl:/^data:\s*([^\s;,]+)\s*;\s*base64\s*,/i,commas:/\u002C|\u060C|\uFE50|\uFE10|\uFE11|\u2E41|\u2E34|\u2E32|\uFF0C/g,jsonLdArticleTypes:/^Article|AdvertiserContentArticle|NewsArticle|AnalysisNewsArticle|AskPublicNewsArticle|BackgroundNewsArticle|OpinionNewsArticle|ReportageNewsArticle|ReviewNewsArticle|Report|SatiricalArticle|ScholarlyArticle|MedicalScholarlyArticle|SocialMediaPosting|BlogPosting|LiveBlogPosting|DiscussionForumPosting|TechArticle|APIReference$/},UNLIKELY_ROLES:["menu","menubar","complementary","navigation","alert","alertdialog","dialog"],DIV_TO_P_ELEMS:new Set(["BLOCKQUOTE","DL","DIV","IMG","OL","P","PRE","TABLE","UL"]),ALTER_TO_DIV_EXCEPTIONS:["DIV","ARTICLE","SECTION","P"],PRESENTATIONAL_ATTRIBUTES:["align","background","bgcolor","border","cellpadding","cellspacing","frame","hspace","rules","style","valign","vspace"],DEPRECATED_SIZE_ATTRIBUTE_ELEMS:["TABLE","TH","TD","HR","PRE"],PHRASING_ELEMS:["ABBR","AUDIO","B","BDO","BR","BUTTON","CITE","CODE","DATA","DATALIST","DFN","EM","EMBED","I","IMG","INPUT","KBD","LABEL","MARK","MATH","METER","NOSCRIPT","OBJECT","OUTPUT","PROGRESS","Q","RUBY","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRONG","SUB","SUP","TEXTAREA","TIME","VAR","WBR"],CLASSES_TO_PRESERVE:["page"],HTML_ESCAPE_MAP:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"},_postProcessContent:function(i){this._fixRelativeUris(i),this._simplifyNestedElements(i),this._keepClasses||this._cleanClasses(i)},_removeNodes:function(i,t){if(this._docJSDOMParser&&i._isLiveNodeList)throw new Error("Do not pass live node lists to _removeNodes");for(var e=i.length-1;e>=0;e--){var a=i[e],n=a.parentNode;n&&(!t||t.call(this,a,e,i))&&n.removeChild(a)}},_replaceNodeTags:function(i,t){if(this._docJSDOMParser&&i._isLiveNodeList)throw new Error("Do not pass live node lists to _replaceNodeTags");for(let e of i)this._setNodeTag(e,t)},_forEachNode:function(i,t){Array.prototype.forEach.call(i,t,this)},_findNode:function(i,t){return Array.prototype.find.call(i,t,this)},_someNode:function(i,t){return Array.prototype.some.call(i,t,this)},_everyNode:function(i,t){return Array.prototype.every.call(i,t,this)},_concatNodeLists:function(){var i=Array.prototype.slice,t=i.call(arguments),e=t.map(function(a){return i.call(a)});return Array.prototype.concat.apply([],e)},_getAllNodesWithTag:function(i,t){return i.querySelectorAll?i.querySelectorAll(t.join(",")):[].concat.apply([],t.map(function(e){var a=i.getElementsByTagName(e);return Array.isArray(a)?a:Array.from(a)}))},_cleanClasses:function(i){var t=this._classesToPreserve,e=(i.getAttribute("class")||"").split(/\s+/).filter(function(a){return t.indexOf(a)!=-1}).join(" ");for(e?i.setAttribute("class",e):i.removeAttribute("class"),i=i.firstElementChild;i;i=i.nextElementSibling)this._cleanClasses(i)},_fixRelativeUris:function(i){var t=this._doc.baseURI,e=this._doc.documentURI;function a(s){if(t==e&&s.charAt(0)=="#")return s;try{return new URL(s,t).href}catch(p){}return s}var n=this._getAllNodesWithTag(i,["a"]);this._forEachNode(n,function(s){var p=s.getAttribute("href");if(p)if(p.indexOf("javascript:")===0)if(s.childNodes.length===1&&s.childNodes[0].nodeType===this.TEXT_NODE){var l=this._doc.createTextNode(s.textContent);s.parentNode.replaceChild(l,s)}else{for(var c=this._doc.createElement("span");s.firstChild;)c.appendChild(s.firstChild);s.parentNode.replaceChild(c,s)}else s.setAttribute("href",a(p))});var r=this._getAllNodesWithTag(i,["img","picture","figure","video","audio","source"]);this._forEachNode(r,function(s){var p=s.getAttribute("src"),l=s.getAttribute("poster"),c=s.getAttribute("srcset");if(p&&s.setAttribute("src",a(p)),l&&s.setAttribute("poster",a(l)),c){var u=c.replace(this.REGEXPS.srcsetUrl,function(v,k,y,D){return a(k)+(y||"")+D});s.setAttribute("srcset",u)}})},_simplifyNestedElements:function(i){for(var t=i;t;){if(t.parentNode&&["DIV","SECTION"].includes(t.tagName)&&!(t.id&&t.id.startsWith("readability"))){if(this._isElementWithoutContent(t)){t=this._removeAndGetNext(t);continue}else if(this._hasSingleTagInsideElement(t,"DIV")||this._hasSingleTagInsideElement(t,"SECTION")){for(var e=t.children[0],a=0;a<t.attributes.length;a++)e.setAttribute(t.attributes[a].name,t.attributes[a].value);t.parentNode.replaceChild(e,t),t=e;continue}}t=this._getNextNode(t)}},_getArticleTitle:function(){var i=this._doc,t="",e="";try{t=e=i.title.trim(),typeof t!="string"&&(t=e=this._getInnerText(i.getElementsByTagName("title")[0]))}catch(u){}var a=!1;function n(u){return u.split(/\s+/).length}if(/ [\|\-\\\/>»] /.test(t))a=/ [\\\/>»] /.test(t),t=e.replace(/(.*)[\|\-\\\/>»] .*/gi,"$1"),n(t)<3&&(t=e.replace(/[^\|\-\\\/>»]*[\|\-\\\/>»](.*)/gi,"$1"));else if(t.indexOf(": ")!==-1){var r=this._concatNodeLists(i.getElementsByTagName("h1"),i.getElementsByTagName("h2")),s=t.trim(),p=this._someNode(r,function(u){return u.textContent.trim()===s});p||(t=e.substring(e.lastIndexOf(":")+1),n(t)<3?t=e.substring(e.indexOf(":")+1):n(e.substr(0,e.indexOf(":")))>5&&(t=e))}else if(t.length>150||t.length<15){var l=i.getElementsByTagName("h1");l.length===1&&(t=this._getInnerText(l[0]))}t=t.trim().replace(this.REGEXPS.normalize," ");var c=n(t);return c<=4&&(!a||c!=n(e.replace(/[\|\-\\\/>»]+/g,""))-1)&&(t=e),t},_prepDocument:function(){var i=this._doc;this._removeNodes(this._getAllNodesWithTag(i,["style"])),i.body&&this._replaceBrs(i.body),this._replaceNodeTags(this._getAllNodesWithTag(i,["font"]),"SPAN")},_nextNode:function(i){for(var t=i;t&&t.nodeType!=this.ELEMENT_NODE&&this.REGEXPS.whitespace.test(t.textContent);)t=t.nextSibling;return t},_replaceBrs:function(i){this._forEachNode(this._getAllNodesWithTag(i,["br"]),function(t){for(var e=t.nextSibling,a=!1;(e=this._nextNode(e))&&e.tagName=="BR";){a=!0;var n=e.nextSibling;e.parentNode.removeChild(e),e=n}if(a){var r=this._doc.createElement("p");for(t.parentNode.replaceChild(r,t),e=r.nextSibling;e;){if(e.tagName=="BR"){var s=this._nextNode(e.nextSibling);if(s&&s.tagName=="BR")break}if(!this._isPhrasingContent(e))break;var p=e.nextSibling;r.appendChild(e),e=p}for(;r.lastChild&&this._isWhitespace(r.lastChild);)r.removeChild(r.lastChild);r.parentNode.tagName==="P"&&this._setNodeTag(r.parentNode,"DIV")}})},_setNodeTag:function(i,t){if(this.log("_setNodeTag",i,t),this._docJSDOMParser)return i.localName=t.toLowerCase(),i.tagName=t.toUpperCase(),i;for(var e=i.ownerDocument.createElement(t);i.firstChild;)e.appendChild(i.firstChild);i.parentNode.replaceChild(e,i),i.readability&&(e.readability=i.readability);for(var a=0;a<i.attributes.length;a++)try{e.setAttribute(i.attributes[a].name,i.attributes[a].value)}catch(n){}return e},_prepArticle:function(i){this._cleanStyles(i),this._markDataTables(i),this._fixLazyImages(i),this._cleanConditionally(i,"form"),this._cleanConditionally(i,"fieldset"),this._clean(i,"object"),this._clean(i,"embed"),this._clean(i,"footer"),this._clean(i,"link"),this._clean(i,"aside");var t=this.DEFAULT_CHAR_THRESHOLD;this._forEachNode(i.children,function(e){this._cleanMatchedNodes(e,function(a,n){return this.REGEXPS.shareElements.test(n)&&a.textContent.length<t})}),this._clean(i,"iframe"),this._clean(i,"input"),this._clean(i,"textarea"),this._clean(i,"select"),this._clean(i,"button"),this._cleanHeaders(i),this._cleanConditionally(i,"table"),this._cleanConditionally(i,"ul"),this._cleanConditionally(i,"div"),this._replaceNodeTags(this._getAllNodesWithTag(i,["h1"]),"h2"),this._removeNodes(this._getAllNodesWithTag(i,["p"]),function(e){var a=e.getElementsByTagName("img").length,n=e.getElementsByTagName("embed").length,r=e.getElementsByTagName("object").length,s=e.getElementsByTagName("iframe").length,p=a+n+r+s;return p===0&&!this._getInnerText(e,!1)}),this._forEachNode(this._getAllNodesWithTag(i,["br"]),function(e){var a=this._nextNode(e.nextSibling);a&&a.tagName=="P"&&e.parentNode.removeChild(e)}),this._forEachNode(this._getAllNodesWithTag(i,["table"]),function(e){var a=this._hasSingleTagInsideElement(e,"TBODY")?e.firstElementChild:e;if(this._hasSingleTagInsideElement(a,"TR")){var n=a.firstElementChild;if(this._hasSingleTagInsideElement(n,"TD")){var r=n.firstElementChild;r=this._setNodeTag(r,this._everyNode(r.childNodes,this._isPhrasingContent)?"P":"DIV"),e.parentNode.replaceChild(r,e)}}})},_initializeNode:function(i){switch(i.readability={contentScore:0},i.tagName){case"DIV":i.readability.contentScore+=5;break;case"PRE":case"TD":case"BLOCKQUOTE":i.readability.contentScore+=3;break;case"ADDRESS":case"OL":case"UL":case"DL":case"DD":case"DT":case"LI":case"FORM":i.readability.contentScore-=3;break;case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":case"TH":i.readability.contentScore-=5;break}i.readability.contentScore+=this._getClassWeight(i)},_removeAndGetNext:function(i){var t=this._getNextNode(i,!0);return i.parentNode.removeChild(i),t},_getNextNode:function(i,t){if(!t&&i.firstElementChild)return i.firstElementChild;if(i.nextElementSibling)return i.nextElementSibling;do i=i.parentNode;while(i&&!i.nextElementSibling);return i&&i.nextElementSibling},_textSimilarity:function(i,t){var e=i.toLowerCase().split(this.REGEXPS.tokenize).filter(Boolean),a=t.toLowerCase().split(this.REGEXPS.tokenize).filter(Boolean);if(!e.length||!a.length)return 0;var n=a.filter(s=>!e.includes(s)),r=n.join(" ").length/a.join(" ").length;return 1-r},_checkByline:function(i,t){if(this._articleByline)return!1;if(i.getAttribute!==void 0)var e=i.getAttribute("rel"),a=i.getAttribute("itemprop");return(e==="author"||a&&a.indexOf("author")!==-1||this.REGEXPS.byline.test(t))&&this._isValidByline(i.textContent)?(this._articleByline=i.textContent.trim(),!0):!1},_getNodeAncestors:function(i,t){t=t||0;for(var e=0,a=[];i.parentNode&&(a.push(i.parentNode),!(t&&++e===t));)i=i.parentNode;return a},_grabArticle:function(i){this.log("**** grabArticle ****");var t=this._doc,e=i!==null;if(i=i||this._doc.body,!i)return this.log("No body found in document. Abort."),null;for(var a=i.innerHTML;;){this.log("Starting grabArticle loop");var n=this._flagIsActive(this.FLAG_STRIP_UNLIKELYS),r=[],s=this._doc.documentElement;let _e=!0;for(;s;){s.tagName==="HTML"&&(this._articleLang=s.getAttribute("lang"));var p=s.className+" "+s.id;if(!this._isProbablyVisible(s)){this.log("Removing hidden node - "+p),s=this._removeAndGetNext(s);continue}if(s.getAttribute("aria-modal")=="true"&&s.getAttribute("role")=="dialog"){s=this._removeAndGetNext(s);continue}if(this._checkByline(s,p)){s=this._removeAndGetNext(s);continue}if(_e&&this._headerDuplicatesTitle(s)){this.log("Removing header: ",s.textContent.trim(),this._articleTitle.trim()),_e=!1,s=this._removeAndGetNext(s);continue}if(n){if(this.REGEXPS.unlikelyCandidates.test(p)&&!this.REGEXPS.okMaybeItsACandidate.test(p)&&!this._hasAncestorTag(s,"table")&&!this._hasAncestorTag(s,"code")&&s.tagName!=="BODY"&&s.tagName!=="A"){this.log("Removing unlikely candidate - "+p),s=this._removeAndGetNext(s);continue}if(this.UNLIKELY_ROLES.includes(s.getAttribute("role"))){this.log("Removing content with role "+s.getAttribute("role")+" - "+p),s=this._removeAndGetNext(s);continue}}if((s.tagName==="DIV"||s.tagName==="SECTION"||s.tagName==="HEADER"||s.tagName==="H1"||s.tagName==="H2"||s.tagName==="H3"||s.tagName==="H4"||s.tagName==="H5"||s.tagName==="H6")&&this._isElementWithoutContent(s)){s=this._removeAndGetNext(s);continue}if(this.DEFAULT_TAGS_TO_SCORE.indexOf(s.tagName)!==-1&&r.push(s),s.tagName==="DIV"){for(var l=null,c=s.firstChild;c;){var u=c.nextSibling;if(this._isPhrasingContent(c))l!==null?l.appendChild(c):this._isWhitespace(c)||(l=t.createElement("p"),s.replaceChild(l,c),l.appendChild(c));else if(l!==null){for(;l.lastChild&&this._isWhitespace(l.lastChild);)l.removeChild(l.lastChild);l=null}c=u}if(this._hasSingleTagInsideElement(s,"P")&&this._getLinkDensity(s)<.25){var v=s.children[0];s.parentNode.replaceChild(v,s),s=v,r.push(s)}else this._hasChildBlockElement(s)||(s=this._setNodeTag(s,"P"),r.push(s))}s=this._getNextNode(s)}var k=[];this._forEachNode(r,function($){if(!(!$.parentNode||typeof $.parentNode.tagName=="undefined")){var te=this._getInnerText($);if(!(te.length<25)){var De=this._getNodeAncestors($,5);if(De.length!==0){var q=0;q+=1,q+=te.split(this.REGEXPS.commas).length,q+=Math.min(Math.floor(te.length/100),3),this._forEachNode(De,function(F,ye){if(!(!F.tagName||!F.parentNode||typeof F.parentNode.tagName=="undefined")){if(typeof F.readability=="undefined"&&(this._initializeNode(F),k.push(F)),ye===0)var R=1;else ye===1?R=2:R=ye*3;F.readability.contentScore+=q/R}})}}}});for(var y=[],D=0,N=k.length;D<N;D+=1){var S=k[D],j=S.readability.contentScore*(1-this._getLinkDensity(S));S.readability.contentScore=j,this.log("Candidate:",S,"with score "+j);for(var U=0;U<this._nbTopCandidates;U++){var z=y[U];if(!z||j>z.readability.contentScore){y.splice(U,0,S),y.length>this._nbTopCandidates&&y.pop();break}}}var x=y[0]||null,X=!1,E;if(x===null||x.tagName==="BODY"){for(x=t.createElement("DIV"),X=!0;i.firstChild;)this.log("Moving child out:",i.firstChild),x.appendChild(i.firstChild);i.appendChild(x),this._initializeNode(x)}else if(x){for(var I=[],J=1;J<y.length;J++)y[J].readability.contentScore/x.readability.contentScore>=.75&&I.push(this._getNodeAncestors(y[J]));var ne=3;if(I.length>=ne)for(E=x.parentNode;E.tagName!=="BODY";){for(var le=0,V=0;V<I.length&&le<ne;V++)le+=Number(I[V].includes(E));if(le>=ne){x=E;break}E=E.parentNode}x.readability||this._initializeNode(x),E=x.parentNode;for(var Ee=x.readability.contentScore,Ie=Ee/3;E.tagName!=="BODY";){if(!E.readability){E=E.parentNode;continue}var M=E.readability.contentScore;if(M<Ie)break;if(M>Ee){x=E;break}Ee=E.readability.contentScore,E=E.parentNode}for(E=x.parentNode;E.tagName!="BODY"&&E.children.length==1;)x=E,E=x.parentNode;x.readability||this._initializeNode(x)}var O=t.createElement("DIV");e&&(O.id="readability-content");var G=Math.max(10,x.readability.contentScore*.2);E=x.parentNode;for(var Ae=E.children,w=0,re=Ae.length;w<re;w++){var L=Ae[w],me=!1;if(this.log("Looking at sibling node:",L,L.readability?"with score "+L.readability.contentScore:""),this.log("Sibling has score",L.readability?L.readability.contentScore:"Unknown"),L===x)me=!0;else{var fe=0;if(L.className===x.className&&x.className!==""&&(fe+=x.readability.contentScore*.2),L.readability&&L.readability.contentScore+fe>=G)me=!0;else if(L.nodeName==="P"){var ve=this._getLinkDensity(L),Ce=this._getInnerText(L),ge=Ce.length;(ge>80&&ve<.25||ge<80&&ge>0&&ve===0&&Ce.search(/\.( |$)/)!==-1)&&(me=!0)}}me&&(this.log("Appending node:",L),this.ALTER_TO_DIV_EXCEPTIONS.indexOf(L.nodeName)===-1&&(this.log("Altering sibling:",L,"to div."),L=this._setNodeTag(L,"DIV")),O.appendChild(L),Ae=E.children,w-=1,re-=1)}if(this._debug&&this.log("Article content pre-prep: "+O.innerHTML),this._prepArticle(O),this._debug&&this.log("Article content post-prep: "+O.innerHTML),X)x.id="readability-page-1",x.className="page";else{var be=t.createElement("DIV");for(be.id="readability-page-1",be.className="page";O.firstChild;)be.appendChild(O.firstChild);O.appendChild(be)}this._debug&&this.log("Article content after paging: "+O.innerHTML);var xe=!0,ue=this._getInnerText(O,!0).length;if(ue<this._charThreshold)if(xe=!1,i.innerHTML=a,this._flagIsActive(this.FLAG_STRIP_UNLIKELYS))this._removeFlag(this.FLAG_STRIP_UNLIKELYS),this._attempts.push({articleContent:O,textLength:ue});else if(this._flagIsActive(this.FLAG_WEIGHT_CLASSES))this._removeFlag(this.FLAG_WEIGHT_CLASSES),this._attempts.push({articleContent:O,textLength:ue});else if(this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY))this._removeFlag(this.FLAG_CLEAN_CONDITIONALLY),this._attempts.push({articleContent:O,textLength:ue});else{if(this._attempts.push({articleContent:O,textLength:ue}),this._attempts.sort(function($,te){return te.textLength-$.textLength}),!this._attempts[0].textLength)return null;O=this._attempts[0].articleContent,xe=!0}if(xe){var Se=[E,x].concat(this._getNodeAncestors(E));return this._someNode(Se,function($){if(!$.tagName)return!1;var te=$.getAttribute("dir");return te?(this._articleDir=te,!0):!1}),O}}},_isValidByline:function(i){return typeof i=="string"||i instanceof String?(i=i.trim(),i.length>0&&i.length<100):!1},_unescapeHtmlEntities:function(i){if(!i)return i;var t=this.HTML_ESCAPE_MAP;return i.replace(/&(quot|amp|apos|lt|gt);/g,function(e,a){return t[a]}).replace(/&#(?:x([0-9a-z]{1,4})|([0-9]{1,4}));/gi,function(e,a,n){var r=parseInt(a||n,a?16:10);return String.fromCharCode(r)})},_getJSONLD:function(i){var t=this._getAllNodesWithTag(i,["script"]),e;return this._forEachNode(t,function(a){if(!e&&a.getAttribute("type")==="application/ld+json")try{var n=a.textContent.replace(/^\s*<!\[CDATA\[|\]\]>\s*$/g,""),r=JSON.parse(n);if(!r["@context"]||!r["@context"].match(/^https?\:\/\/schema\.org$/)||(!r["@type"]&&Array.isArray(r["@graph"])&&(r=r["@graph"].find(function(c){return(c["@type"]||"").match(this.REGEXPS.jsonLdArticleTypes)})),!r||!r["@type"]||!r["@type"].match(this.REGEXPS.jsonLdArticleTypes)))return;if(e={},typeof r.name=="string"&&typeof r.headline=="string"&&r.name!==r.headline){var s=this._getArticleTitle(),p=this._textSimilarity(r.name,s)>.75,l=this._textSimilarity(r.headline,s)>.75;l&&!p?e.title=r.headline:e.title=r.name}else typeof r.name=="string"?e.title=r.name.trim():typeof r.headline=="string"&&(e.title=r.headline.trim());r.author&&(typeof r.author.name=="string"?e.byline=r.author.name.trim():Array.isArray(r.author)&&r.author[0]&&typeof r.author[0].name=="string"&&(e.byline=r.author.filter(function(c){return c&&typeof c.name=="string"}).map(function(c){return c.name.trim()}).join(", "))),typeof r.description=="string"&&(e.excerpt=r.description.trim()),r.publisher&&typeof r.publisher.name=="string"&&(e.siteName=r.publisher.name.trim()),typeof r.datePublished=="string"&&(e.datePublished=r.datePublished.trim());return}catch(c){this.log(c.message)}}),e||{}},_getArticleMetadata:function(i){var t={},e={},a=this._doc.getElementsByTagName("meta"),n=/\s*(article|dc|dcterm|og|twitter)\s*:\s*(author|creator|description|published_time|title|site_name)\s*/gi,r=/^\s*(?:(dc|dcterm|og|twitter|weibo:(article|webpage))\s*[\.:]\s*)?(author|creator|description|title|site_name)\s*$/i;return this._forEachNode(a,function(s){var p=s.getAttribute("name"),l=s.getAttribute("property"),c=s.getAttribute("content");if(c){var u=null,v=null;l&&(u=l.match(n),u&&(v=u[0].toLowerCase().replace(/\s/g,""),e[v]=c.trim())),!u&&p&&r.test(p)&&(v=p,c&&(v=v.toLowerCase().replace(/\s/g,"").replace(/\./g,":"),e[v]=c.trim()))}}),t.title=i.title||e["dc:title"]||e["dcterm:title"]||e["og:title"]||e["weibo:article:title"]||e["weibo:webpage:title"]||e.title||e["twitter:title"],t.title||(t.title=this._getArticleTitle()),t.byline=i.byline||e["dc:creator"]||e["dcterm:creator"]||e.author,t.excerpt=i.excerpt||e["dc:description"]||e["dcterm:description"]||e["og:description"]||e["weibo:article:description"]||e["weibo:webpage:description"]||e.description||e["twitter:description"],t.siteName=i.siteName||e["og:site_name"],t.publishedTime=i.datePublished||e["article:published_time"]||null,t.title=this._unescapeHtmlEntities(t.title),t.byline=this._unescapeHtmlEntities(t.byline),t.excerpt=this._unescapeHtmlEntities(t.excerpt),t.siteName=this._unescapeHtmlEntities(t.siteName),t.publishedTime=this._unescapeHtmlEntities(t.publishedTime),t},_isSingleImage:function(i){return i.tagName==="IMG"?!0:i.children.length!==1||i.textContent.trim()!==""?!1:this._isSingleImage(i.children[0])},_unwrapNoscriptImages:function(i){var t=Array.from(i.getElementsByTagName("img"));this._forEachNode(t,function(a){for(var n=0;n<a.attributes.length;n++){var r=a.attributes[n];switch(r.name){case"src":case"srcset":case"data-src":case"data-srcset":return}if(/\.(jpg|jpeg|png|webp)/i.test(r.value))return}a.parentNode.removeChild(a)});var e=Array.from(i.getElementsByTagName("noscript"));this._forEachNode(e,function(a){var n=i.createElement("div");if(n.innerHTML=a.innerHTML,!!this._isSingleImage(n)){var r=a.previousElementSibling;if(r&&this._isSingleImage(r)){var s=r;s.tagName!=="IMG"&&(s=r.getElementsByTagName("img")[0]);for(var p=n.getElementsByTagName("img")[0],l=0;l<s.attributes.length;l++){var c=s.attributes[l];if(c.value!==""&&(c.name==="src"||c.name==="srcset"||/\.(jpg|jpeg|png|webp)/i.test(c.value))){if(p.getAttribute(c.name)===c.value)continue;var u=c.name;p.hasAttribute(u)&&(u="data-old-"+u),p.setAttribute(u,c.value)}}a.parentNode.replaceChild(n.firstElementChild,r)}}})},_removeScripts:function(i){this._removeNodes(this._getAllNodesWithTag(i,["script","noscript"]))},_hasSingleTagInsideElement:function(i,t){return i.children.length!=1||i.children[0].tagName!==t?!1:!this._someNode(i.childNodes,function(e){return e.nodeType===this.TEXT_NODE&&this.REGEXPS.hasContent.test(e.textContent)})},_isElementWithoutContent:function(i){return i.nodeType===this.ELEMENT_NODE&&i.textContent.trim().length==0&&(i.children.length==0||i.children.length==i.getElementsByTagName("br").length+i.getElementsByTagName("hr").length)},_hasChildBlockElement:function(i){return this._someNode(i.childNodes,function(t){return this.DIV_TO_P_ELEMS.has(t.tagName)||this._hasChildBlockElement(t)})},_isPhrasingContent:function(i){return i.nodeType===this.TEXT_NODE||this.PHRASING_ELEMS.indexOf(i.tagName)!==-1||(i.tagName==="A"||i.tagName==="DEL"||i.tagName==="INS")&&this._everyNode(i.childNodes,this._isPhrasingContent)},_isWhitespace:function(i){return i.nodeType===this.TEXT_NODE&&i.textContent.trim().length===0||i.nodeType===this.ELEMENT_NODE&&i.tagName==="BR"},_getInnerText:function(i,t){t=typeof t=="undefined"?!0:t;var e=i.textContent.trim();return t?e.replace(this.REGEXPS.normalize," "):e},_getCharCount:function(i,t){return t=t||",",this._getInnerText(i).split(t).length-1},_cleanStyles:function(i){if(!(!i||i.tagName.toLowerCase()==="svg")){for(var t=0;t<this.PRESENTATIONAL_ATTRIBUTES.length;t++)i.removeAttribute(this.PRESENTATIONAL_ATTRIBUTES[t]);this.DEPRECATED_SIZE_ATTRIBUTE_ELEMS.indexOf(i.tagName)!==-1&&(i.removeAttribute("width"),i.removeAttribute("height"));for(var e=i.firstElementChild;e!==null;)this._cleanStyles(e),e=e.nextElementSibling}},_getLinkDensity:function(i){var t=this._getInnerText(i).length;if(t===0)return 0;var e=0;return this._forEachNode(i.getElementsByTagName("a"),function(a){var n=a.getAttribute("href"),r=n&&this.REGEXPS.hashUrl.test(n)?.3:1;e+=this._getInnerText(a).length*r}),e/t},_getClassWeight:function(i){if(!this._flagIsActive(this.FLAG_WEIGHT_CLASSES))return 0;var t=0;return typeof i.className=="string"&&i.className!==""&&(this.REGEXPS.negative.test(i.className)&&(t-=25),this.REGEXPS.positive.test(i.className)&&(t+=25)),typeof i.id=="string"&&i.id!==""&&(this.REGEXPS.negative.test(i.id)&&(t-=25),this.REGEXPS.positive.test(i.id)&&(t+=25)),t},_clean:function(i,t){var e=["object","embed","iframe"].indexOf(t)!==-1;this._removeNodes(this._getAllNodesWithTag(i,[t]),function(a){if(e){for(var n=0;n<a.attributes.length;n++)if(this._allowedVideoRegex.test(a.attributes[n].value))return!1;if(a.tagName==="object"&&this._allowedVideoRegex.test(a.innerHTML))return!1}return!0})},_hasAncestorTag:function(i,t,e,a){e=e||3,t=t.toUpperCase();for(var n=0;i.parentNode;){if(e>0&&n>e)return!1;if(i.parentNode.tagName===t&&(!a||a(i.parentNode)))return!0;i=i.parentNode,n++}return!1},_getRowAndColumnCount:function(i){for(var t=0,e=0,a=i.getElementsByTagName("tr"),n=0;n<a.length;n++){var r=a[n].getAttribute("rowspan")||0;r&&(r=parseInt(r,10)),t+=r||1;for(var s=0,p=a[n].getElementsByTagName("td"),l=0;l<p.length;l++){var c=p[l].getAttribute("colspan")||0;c&&(c=parseInt(c,10)),s+=c||1}e=Math.max(e,s)}return{rows:t,columns:e}},_markDataTables:function(i){for(var t=i.getElementsByTagName("table"),e=0;e<t.length;e++){var a=t[e],n=a.getAttribute("role");if(n=="presentation"){a._readabilityDataTable=!1;continue}var r=a.getAttribute("datatable");if(r=="0"){a._readabilityDataTable=!1;continue}var s=a.getAttribute("summary");if(s){a._readabilityDataTable=!0;continue}var p=a.getElementsByTagName("caption")[0];if(p&&p.childNodes.length>0){a._readabilityDataTable=!0;continue}var l=["col","colgroup","tfoot","thead","th"],c=function(v){return!!a.getElementsByTagName(v)[0]};if(l.some(c)){this.log("Data table because found data-y descendant"),a._readabilityDataTable=!0;continue}if(a.getElementsByTagName("table")[0]){a._readabilityDataTable=!1;continue}var u=this._getRowAndColumnCount(a);if(u.rows>=10||u.columns>4){a._readabilityDataTable=!0;continue}a._readabilityDataTable=u.rows*u.columns>10}},_fixLazyImages:function(i){this._forEachNode(this._getAllNodesWithTag(i,["img","picture","figure"]),function(t){if(t.src&&this.REGEXPS.b64DataUrl.test(t.src)){var e=this.REGEXPS.b64DataUrl.exec(t.src);if(e[1]==="image/svg+xml")return;for(var a=!1,n=0;n<t.attributes.length;n++){var r=t.attributes[n];if(r.name!=="src"&&/\.(jpg|jpeg|png|webp)/i.test(r.value)){a=!0;break}}if(a){var s=t.src.search(/base64\s*/i)+7,p=t.src.length-s;p<133&&t.removeAttribute("src")}}if(!((t.src||t.srcset&&t.srcset!="null")&&t.className.toLowerCase().indexOf("lazy")===-1)){for(var l=0;l<t.attributes.length;l++)if(r=t.attributes[l],!(r.name==="src"||r.name==="srcset"||r.name==="alt")){var c=null;if(/\.(jpg|jpeg|png|webp)\s+\d/.test(r.value)?c="srcset":/^\s*\S+\.(jpg|jpeg|png|webp)\S*\s*$/.test(r.value)&&(c="src"),c){if(t.tagName==="IMG"||t.tagName==="PICTURE")t.setAttribute(c,r.value);else if(t.tagName==="FIGURE"&&!this._getAllNodesWithTag(t,["img","picture"]).length){var u=this._doc.createElement("img");u.setAttribute(c,r.value),t.appendChild(u)}}}}})},_getTextDensity:function(i,t){var e=this._getInnerText(i,!0).length;if(e===0)return 0;var a=0,n=this._getAllNodesWithTag(i,t);return this._forEachNode(n,r=>a+=this._getInnerText(r,!0).length),a/e},_cleanConditionally:function(i,t){this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY)&&this._removeNodes(this._getAllNodesWithTag(i,[t]),function(e){var a=function(E){return E._readabilityDataTable},n=t==="ul"||t==="ol";if(!n){var r=0,s=this._getAllNodesWithTag(e,["ul","ol"]);this._forEachNode(s,E=>r+=this._getInnerText(E).length),n=r/this._getInnerText(e).length>.9}if(t==="table"&&a(e)||this._hasAncestorTag(e,"table",-1,a)||this._hasAncestorTag(e,"code"))return!1;var p=this._getClassWeight(e);this.log("Cleaning Conditionally",e);var l=0;if(p+l<0)return!0;if(this._getCharCount(e,",")<10){for(var c=e.getElementsByTagName("p").length,u=e.getElementsByTagName("img").length,v=e.getElementsByTagName("li").length-100,k=e.getElementsByTagName("input").length,y=this._getTextDensity(e,["h1","h2","h3","h4","h5","h6"]),D=0,N=this._getAllNodesWithTag(e,["object","embed","iframe"]),S=0;S<N.length;S++){for(var j=0;j<N[S].attributes.length;j++)if(this._allowedVideoRegex.test(N[S].attributes[j].value))return!1;if(N[S].tagName==="object"&&this._allowedVideoRegex.test(N[S].innerHTML))return!1;D++}var U=this._getLinkDensity(e),z=this._getInnerText(e).length,x=u>1&&c/u<.5&&!this._hasAncestorTag(e,"figure")||!n&&v>c||k>Math.floor(c/3)||!n&&y<.9&&z<25&&(u===0||u>2)&&!this._hasAncestorTag(e,"figure")||!n&&p<25&&U>.2||p>=25&&U>.5||D===1&&z<75||D>1;if(n&&x){for(var X=0;X<e.children.length;X++)if(e.children[X].children.length>1)return x;let E=e.getElementsByTagName("li").length;if(u==E)return!1}return x}return!1})},_cleanMatchedNodes:function(i,t){for(var e=this._getNextNode(i,!0),a=this._getNextNode(i);a&&a!=e;)t.call(this,a,a.className+" "+a.id)?a=this._removeAndGetNext(a):a=this._getNextNode(a)},_cleanHeaders:function(i){let t=this._getAllNodesWithTag(i,["h1","h2"]);this._removeNodes(t,function(e){let a=this._getClassWeight(e)<0;return a&&this.log("Removing header with low class weight:",e),a})},_headerDuplicatesTitle:function(i){if(i.tagName!="H1"&&i.tagName!="H2")return!1;var t=this._getInnerText(i,!1);return this.log("Evaluating similarity of header:",t,this._articleTitle),this._textSimilarity(this._articleTitle,t)>.75},_flagIsActive:function(i){return(this._flags&i)>0},_removeFlag:function(i){this._flags=this._flags&~i},_isProbablyVisible:function(i){return(!i.style||i.style.display!="none")&&(!i.style||i.style.visibility!="hidden")&&!i.hasAttribute("hidden")&&(!i.hasAttribute("aria-hidden")||i.getAttribute("aria-hidden")!="true"||i.className&&i.className.indexOf&&i.className.indexOf("fallback-image")!==-1)},parse:function(){if(this._maxElemsToParse>0){var i=this._doc.getElementsByTagName("*").length;if(i>this._maxElemsToParse)throw new Error("Aborting parsing document; "+i+" elements found")}this._unwrapNoscriptImages(this._doc);var t=this._disableJSONLD?{}:this._getJSONLD(this._doc);this._removeScripts(this._doc),this._prepDocument();var e=this._getArticleMetadata(t);this._articleTitle=e.title;var a=this._grabArticle();if(!a)return null;if(this.log("Grabbed: "+a.innerHTML),this._postProcessContent(a),!e.excerpt){var n=a.getElementsByTagName("p");n.length>0&&(e.excerpt=n[0].textContent.trim())}var r=a.textContent;return{title:this._articleTitle,byline:e.byline||this._articleByline,dir:this._articleDir,lang:this._articleLang,content:this._serializer(a),textContent:r,length:r.length,excerpt:e.excerpt,siteName:e.siteName||this._articleSiteName,publishedTime:e.publishedTime}}};typeof $i=="object"&&($i.exports=un)});var hn=at((Ho,Wi)=>{var gn={unlikelyCandidates:/-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,okMaybeItsACandidate:/and|article|body|column|content|main|shadow/i};function Qr(i){return(!i.style||i.style.display!="none")&&!i.hasAttribute("hidden")&&(!i.hasAttribute("aria-hidden")||i.getAttribute("aria-hidden")!="true"||i.className&&i.className.indexOf&&i.className.indexOf("fallback-image")!==-1)}function es(i,t={}){typeof t=="function"&&(t={visibilityChecker:t});var e={minScore:20,minContentLength:140,visibilityChecker:Qr};t=Object.assign(e,t);var a=i.querySelectorAll("p, pre, article"),n=i.querySelectorAll("div > br");if(n.length){var r=new Set(a);[].forEach.call(n,function(p){r.add(p.parentNode)}),a=Array.from(r)}var s=0;return[].some.call(a,function(p){if(!t.visibilityChecker(p))return!1;var l=p.className+" "+p.id;if(gn.unlikelyCandidates.test(l)&&!gn.okMaybeItsACandidate.test(l)||p.matches("li p"))return!1;var c=p.textContent.trim().length;return c<t.minContentLength?!1:(s+=Math.sqrt(c-t.minContentLength),s>t.minScore)})}typeof Wi=="object"&&(Wi.exports=es)});var vn=at((zo,fn)=>{var ts=dn(),is=hn();fn.exports={Readability:ts,isProbablyReaderable:is}});var rs={};ir(rs,{default:()=>Qt});module.exports=ar(rs);var dt=require("obsidian");function Ea(){return[{label:"New Line",option:"newLine"},{label:"Comma",option:"comma"},{label:"Period",option:"period"},{label:"Semicolon",option:"semicolon"}]}function Aa(i){switch(i){case"newLine":return`
`;case"comma":return",";case"period":return".";case"semicolon":return";"}}function Sa(){return[{label:"Ask",option:"ask"},{label:"Nothing",option:"nothing"},{label:"Append to the existing note",option:"appendToExisting"}]}var d={inboxDir:"ReadItLater Inbox",assetsDir:"ReadItLater Inbox/assets",openNewNote:!1,batchProcess:!1,batchProcessDelimiter:"newLine",openNewNoteInNewTab:!1,youtubeContentTypeSlug:"youtube",youtubeNoteTitle:"Youtube - {{ title }}",youtubeNote:`[[ReadItLater]] [[Youtube]]
# [{{ videoTitle }}]({{ videoURL }})
{{ videoPlayer }}`,youtubeEmbedWidth:"560",youtubeEmbedHeight:"315",youtubeUsePrivacyEnhancedEmbed:!0,vimeoContentTypeSlug:"vimeo",vimeoNoteTitle:"Vimeo - {{ title }}",vimeoNote:`[[ReadItLater]] [[Vimeo]]
# [{{ videoTitle }}]({{ videoURL }})
{{ videoPlayer }}
{{ videoChapters }}`,vimeoEmbedWidth:"560",vimeoEmbedHeight:"315",bilibiliContentTypeSlug:"bilibili",bilibiliNoteTitle:"Bilibili - {{ title }}",bilibiliNote:`[[ReadItLater]] [[Bilibili]]
# [{{ videoTitle }}]({{ videoURL }})
{{ videoPlayer }}`,bilibiliEmbedWidth:"560",bilibiliEmbedHeight:"315",twitterContentTypeSlug:"xcom",twitterNoteTitle:"Tweet from {{ tweetAuthorName }} ({{ date }})",twitterNote:`[[ReadItLater]] [[Tweet]]
# [{{ tweetAuthorName }}]({{ tweetURL }})
{{ tweetContent }}`,parseableArticleContentType:"article",parseableArticleNoteTitle:"{{ title }}",parsableArticleNote:`[[ReadItLater]] [[Article]]
# [{{ articleTitle }}]({{ articleURL }})
{{ articleContent }}`,notParseableArticleContentType:"article",notParseableArticleNoteTitle:"Article {{ date }}",notParsableArticleNote:`[[ReadItLater]] [[Article]]
[{{ articleURL }}]({{ articleURL }})`,textSnippetContentType:"textsnippet",textSnippetNoteTitle:"Note {{ date }}",textSnippetNote:`[[ReadItLater]] [[Textsnippet]]
{{ content }}`,mastodonContentTypeSlug:"mastodon",mastodonNoteTitle:"Toot from {{ tootAuthorName }} ({{ date }})",mastodonNote:`[[ReadItLater]] [[Toot]]
# [{{ tootAuthorName }}]({{ tootURL }})
> {{ tootContent }}`,downloadImages:!0,downloadImagesInArticleDir:!1,dateTitleFmt:"YYYY-MM-DD HH-mm-ss",dateContentFmt:"YYYY-MM-DD",downloadMastodonMediaAttachments:!0,downloadMastodonMediaAttachmentsInDir:!1,saveMastodonReplies:!1,mastodonReply:`[{{ tootAuthorName }}]({{ tootURL }})
> {{ tootContent }}`,stackExchangeContentType:"stackexchange",stackExchangeNoteTitle:"{{ title }}",stackExchangeNote:`[[ReadItLater]] [[StackExchange]]
# [{{ questionTitle }}]({{ questionURL }})
Author: [{{ authorName }}]({{ authorProfileURL }})
{{ questionContent }}
***
{{ topAnswer }}
{{ answers }}`,stackExchangeAnswer:`Answered by: [{{ authorName }}]({{ authorProfileURL }})
{{ answerContent }}`,downloadStackExchangeAssets:!0,downloadStackExchangeAssetsInDir:!1,youtubeApiKey:"",tikTokContentTypeSlug:"tiktok",tikTokNoteTitle:"TikTok from {{ authorName }} ({{ date }})",tikTokNote:`[[ReadItLater]] [[TikTok]]
{{ videoDescription }}
[{{ videoURL }}]({{ videoURL }})
{{ videoPlayer }}`,tikTokEmbedWidth:"325",tikTokEmbedHeight:"760",extendShareMenu:!0,filesystemLimitPath:null,filesystemLimitFileName:null,youtubeChannelContentTypeSlug:"youtube-channel",youtubeChannelNoteTitle:"{{ title }}",youtubeChannelNote:`[[ReadItLater]] [[YoutubeChannel]]
# [{{ channelTitle }}]({{ channelURL }})
![{{ channelTitle }}|300]({{ channelAvatar }})
[Videos]({{ channelVideosURL }})
{{ channelSubscribersCount|numberLexify }} subscribers`,fileExistsStrategy:"ask"};var f=require("obsidian");var La=require("obsidian");var Da={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(Da);var ka=Da;var Ca={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(Ca);var Ra=Ca;var Ne=function(i,t,e,a){if(e==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?i!==t||!a:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?a:e==="a"?a.call(i):a?a.value:t.get(i)},nt,xt,qe,Ti=class{constructor(...t){nt.set(this,new Map),xt.set(this,new Map),qe.set(this,new Map);for(let e of t)this.define(e)}define(t,e=!1){for(let[a,n]of Object.entries(t)){a=a.toLowerCase(),n=n.map(p=>p.toLowerCase()),Ne(this,qe,"f").has(a)||Ne(this,qe,"f").set(a,new Set);let r=Ne(this,qe,"f").get(a),s=!0;for(let p of n){let l=p.startsWith("*");if(p=l?p.slice(1):p,r==null||r.add(p),s&&Ne(this,xt,"f").set(a,p),s=!1,l)continue;let c=Ne(this,nt,"f").get(p);if(c&&c!=a&&!e)throw new Error(`"${a} -> ${p}" conflicts with "${c} -> ${p}". Pass \`force=true\` to override this definition.`);Ne(this,nt,"f").set(p,a)}}return this}getType(t){var s;if(typeof t!="string")return null;let e=t.replace(/^.*[/\\]/,"").toLowerCase(),a=e.replace(/^.*\./,"").toLowerCase(),n=e.length<t.length;return!(a.length<e.length-1)&&n?null:(s=Ne(this,nt,"f").get(a))!=null?s:null}getExtension(t){var e,a;return typeof t!="string"?null:(t=(e=t==null?void 0:t.split)==null?void 0:e.call(t,";")[0],(a=t&&Ne(this,xt,"f").get(t.trim().toLowerCase()))!=null?a:null)}getAllExtensions(t){var e;return typeof t!="string"?null:(e=Ne(this,qe,"f").get(t.toLowerCase()))!=null?e:null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(let t of Ne(this,qe,"f").values())Object.freeze(t);return this}_getTestState(){return{types:Ne(this,nt,"f"),extensions:Ne(this,xt,"f")}}};nt=new WeakMap,xt=new WeakMap,qe=new WeakMap;var wi=Ti;var Pa=new wi(Ra,ka)._freeze();function Le(i,t=[]){let e;try{e=new URL(i)}catch(a){return!1}return t.length===0?!0:t.includes(e.protocol)}function Ia(i,t){return new URL(i,t).href}function pe(i){return i.replace(/[:#/\\|?*<>"]/g,"")}function yt(i,t,e,a){let n=`.${nr(t)}`,r=t;r.length>a.fileName&&(r=r.substring(0,a.fileName-n.length)+`${n}`);let s=(0,La.normalizePath)(`${i}/${r}`),p=e.getFullPath(s);return p.length>a.path&&(s=s.substring(0,s.length-(p.length-a.path)-n.length)+`${n}`),s}function Ma(i,t){var a,n;let e=Ei(i);return{path:(a=t.filesystemLimitPath)!=null?a:e.path,fileName:(n=t.filesystemLimitFileName)!=null?n:e.fileName}}function Ei(i){return i.isLinux?Ni(4096,255):i.isMacOS||i.isIosApp||i.isAndroidApp||i.isMobile?Ni(1024,255):Ni(256,256)}function nr(i){return i.includes(".")?i.split(".").pop():""}function Oa(i){var t;return(t=Pa.getExtension(i))!=null?t:""}function Ni(i,t){return{path:i,fileName:t}}function Bt(i){return createFragment(t=>t.createDiv().innerHTML=i)}var jt=class extends f.PluginSettingTab{constructor(e,a){super(e,a);_(this,"plugin");this.plugin=a}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:"General"}),new f.Setting(e).setName("Inbox directory").setDesc("Enter valid directory name. For nested directory use this format: Directory A/Directory B. If no directory is entered, new note will be created in vault root.").addText(n=>n.setPlaceholder("Defaults to vault root directory").setValue(typeof this.plugin.settings.inboxDir=="undefined"?d.inboxDir:this.plugin.settings.inboxDir).onChange(async r=>{this.plugin.settings.inboxDir=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Assets directory").setDesc("Enter valid directory name. For nested directory use this format: Directory A/Directory B. If no directory is entered, new note will be created in Vault root.").addText(n=>n.setPlaceholder("Defaults to vault root directory").setValue(typeof this.plugin.settings.assetsDir=="undefined"?d.inboxDir+"/assets":this.plugin.settings.assetsDir).onChange(async r=>{this.plugin.settings.assetsDir=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Open new note in current workspace").setDesc("If enabled, new note will open in current workspace").addToggle(n=>n.setValue(this.plugin.settings.openNewNote||d.openNewNote).onChange(async r=>{this.plugin.settings.openNewNote=r,r===!0&&(this.plugin.settings.openNewNoteInNewTab=!1),await this.plugin.saveSettings(),this.display()})),new f.Setting(e).setName("Open new note in new tab").setDesc("If enabled, new note will open in new tab").addToggle(n=>n.setValue(this.plugin.settings.openNewNoteInNewTab||d.openNewNoteInNewTab).onChange(async r=>{this.plugin.settings.openNewNoteInNewTab=r,r===!0&&(this.plugin.settings.openNewNote=!1),await this.plugin.saveSettings(),this.display()})),new f.Setting(e).setName("Duplicate note filename behavior").setDesc("Applied when note with the same filename already exists").addDropdown(n=>{Sa().forEach(r=>n.addOption(r.option,r.label)),n.setValue(this.plugin.settings.fileExistsStrategy||d.fileExistsStrategy),n.onChange(async r=>{this.plugin.settings.fileExistsStrategy=r,await this.plugin.saveSettings()})}),new f.Setting(e).setName("Batch note creation delimiter").setDesc("Delimiter for batch list of notes").addDropdown(n=>{Ea().forEach(r=>n.addOption(r.option,r.label)),n.setValue(this.plugin.settings.batchProcessDelimiter||d.batchProcessDelimiter),n.onChange(async r=>{this.plugin.settings.batchProcessDelimiter=r,await this.plugin.saveSettings()})}),new f.Setting(e).setName("Date format string").setDesc("Format of the %date% variable. NOTE: do not use symbols forbidden in file names.").addText(n=>n.setPlaceholder(`Defaults to ${d.dateTitleFmt}`).setValue(typeof this.plugin.settings.dateTitleFmt=="undefined"?d.dateTitleFmt:this.plugin.settings.dateTitleFmt).onChange(async r=>{this.plugin.settings.dateTitleFmt=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Date format string in content").setDesc("Format of the %date% variable for content").addText(n=>n.setPlaceholder(`Defaults to ${d.dateContentFmt}`).setValue(typeof this.plugin.settings.dateContentFmt=="undefined"?d.dateContentFmt:this.plugin.settings.dateContentFmt).onChange(async r=>{this.plugin.settings.dateContentFmt=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Extend share menu").setDesc("If enabled, share menu will be extended with shortcut to create note directly from it. Requires plugin reload or Obsidian restart to apply change.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"extendShareMenu")?this.plugin.settings.extendShareMenu:d.extendShareMenu).onChange(async r=>{this.plugin.settings.extendShareMenu=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Youtube Data API v3 key").setDesc("If entered, Youtube related content types will use Youtube API to fetc the data.").addText(n=>n.setPlaceholder("").setValue(this.plugin.settings.youtubeApiKey||d.youtubeApiKey).onChange(async r=>{this.plugin.settings.youtubeApiKey=r,await this.plugin.saveSettings()})),e.createEl("h1",{text:"Content Types"}),e.createEl("h2",{text:"YouTube"}),new f.Setting(e).setName("Youtube content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.youtubeContentTypeSlug}`).setValue(typeof this.plugin.settings.youtubeContentTypeSlug=="undefined"?d.youtubeContentTypeSlug:this.plugin.settings.youtubeContentTypeSlug).onChange(async r=>{this.plugin.settings.youtubeContentTypeSlug=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Youtube note template title").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.youtubeNoteTitle}`).setValue(this.plugin.settings.youtubeNoteTitle||d.youtubeNoteTitle).onChange(async r=>{this.plugin.settings.youtubeNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Youtube note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.youtubeNote||d.youtubeNote).onChange(async r=>{this.plugin.settings.youtubeNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),new f.Setting(e).setName("Youtube embed player width").addText(n=>n.setPlaceholder(d.youtubeEmbedWidth).setValue(this.plugin.settings.youtubeEmbedWidth||d.youtubeEmbedWidth).onChange(async r=>{this.plugin.settings.youtubeEmbedWidth=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Youtube embed player height").addText(n=>n.setPlaceholder(d.youtubeEmbedHeight).setValue(this.plugin.settings.youtubeEmbedHeight||d.youtubeEmbedHeight).onChange(async r=>{this.plugin.settings.youtubeEmbedHeight=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Embed in privacy enhanced mode").setDesc("If enabled, content will be embeded in privacy enhanced mode, which prevents the use of views of it from influencing the viewer\u2019s browsing experience on YouTube.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"youtubeUsePrivacyEnhancedEmbed")?this.plugin.settings.youtubeUsePrivacyEnhancedEmbed:d.youtubeUsePrivacyEnhancedEmbed).onChange(async r=>{this.plugin.settings.youtubeUsePrivacyEnhancedEmbed=r,await this.plugin.saveSettings()})),e.createEl("h2",{text:"YouTube Channel"}),new f.Setting(e).setName("Youtube channel content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.youtubeChannelContentTypeSlug}`).setValue(typeof this.plugin.settings.youtubeChannelContentTypeSlug=="undefined"?d.youtubeChannelContentTypeSlug:this.plugin.settings.youtubeChannelContentTypeSlug).onChange(async r=>{this.plugin.settings.youtubeChannelContentTypeSlug=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Youtube channel note template title").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.youtubeChannelNoteTitle}`).setValue(this.plugin.settings.youtubeChannelNoteTitle||d.youtubeChannelNoteTitle).onChange(async r=>{this.plugin.settings.youtubeChannelNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Youtube channel note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.youtubeChannelNote||d.youtubeChannelNote).onChange(async r=>{this.plugin.settings.youtubeChannelNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),e.createEl("h2",{text:"Vimeo"}),new f.Setting(e).setName("Vimeo content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.vimeoContentTypeSlug}`).setValue(typeof this.plugin.settings.vimeoContentTypeSlug=="undefined"?d.vimeoContentTypeSlug:this.plugin.settings.vimeoContentTypeSlug).onChange(async r=>{this.plugin.settings.vimeoContentTypeSlug=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Vimeo note title template").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder("Defaults to %title%").setValue(this.plugin.settings.vimeoNoteTitle||d.vimeoNoteTitle).onChange(async r=>{this.plugin.settings.vimeoNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Vimeo note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.vimeoNote||d.vimeoNote).onChange(async r=>{this.plugin.settings.vimeoNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),new f.Setting(e).setName("Vimeo embed player width").addText(n=>n.setPlaceholder(d.vimeoEmbedWidth).setValue(this.plugin.settings.vimeoEmbedWidth||d.vimeoEmbedWidth).onChange(async r=>{this.plugin.settings.vimeoEmbedWidth=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Vimeo embed player height").addText(n=>n.setPlaceholder(d.vimeoEmbedHeight).setValue(this.plugin.settings.vimeoEmbedHeight||d.vimeoEmbedHeight).onChange(async r=>{this.plugin.settings.vimeoEmbedHeight=r,await this.plugin.saveSettings()})),e.createEl("h2",{text:"Bilibili"}),new f.Setting(e).setName("Bilibili content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.bilibiliContentTypeSlug}`).setValue(typeof this.plugin.settings.bilibiliContentTypeSlug=="undefined"?d.bilibiliContentTypeSlug:this.plugin.settings.bilibiliContentTypeSlug).onChange(async r=>{this.plugin.settings.bilibiliContentTypeSlug=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Bilibili note template title").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder("Defaults to %title%").setValue(this.plugin.settings.bilibiliNoteTitle||d.bilibiliNoteTitle).onChange(async r=>{this.plugin.settings.bilibiliNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Bilibili note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.bilibiliNote||d.bilibiliNote).onChange(async r=>{this.plugin.settings.bilibiliNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),new f.Setting(e).setName("Bilibili embed player width").addText(n=>n.setPlaceholder(d.bilibiliEmbedWidth).setValue(this.plugin.settings.bilibiliEmbedWidth||d.bilibiliEmbedWidth).onChange(async r=>{this.plugin.settings.bilibiliEmbedWidth=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Bilibili embed player height").addText(n=>n.setPlaceholder(d.bilibiliEmbedHeight).setValue(this.plugin.settings.bilibiliEmbedHeight||d.bilibiliEmbedHeight).onChange(async r=>{this.plugin.settings.bilibiliEmbedHeight=r,await this.plugin.saveSettings()})),e.createEl("h2",{text:"Twitter"}),new f.Setting(e).setName("Twitter content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.twitterContentTypeSlug}`).setValue(typeof this.plugin.settings.twitterContentTypeSlug=="undefined"?d.twitterContentTypeSlug:this.plugin.settings.twitterContentTypeSlug).onChange(async r=>{this.plugin.settings.twitterContentTypeSlug=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Twitter note template title").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder("Defaults to %tweetAuthorName%").setValue(this.plugin.settings.twitterNoteTitle||d.twitterNoteTitle).onChange(async r=>{this.plugin.settings.twitterNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Twitter note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.twitterNote||d.twitterNote).onChange(async r=>{this.plugin.settings.twitterNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),e.createEl("h2",{text:"Stack Exchange"}),new f.Setting(e).setName("Stack Exchange content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.stackExchangeContentType}`).setValue(typeof this.plugin.settings.stackExchangeContentType=="undefined"?d.stackExchangeContentType:this.plugin.settings.stackExchangeContentType).onChange(async r=>{this.plugin.settings.stackExchangeContentType=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Stack Exchange note title template").addText(n=>n.setPlaceholder("Defaults to %title%").setValue(this.plugin.settings.stackExchangeNoteTitle||d.stackExchangeNoteTitle).onChange(async r=>{this.plugin.settings.stackExchangeNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Stack Exchange question note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.stackExchangeNote||d.stackExchangeNote).onChange(async r=>{this.plugin.settings.stackExchangeNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),new f.Setting(e).setName("Stack Exchange answer template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.stackExchangeAnswer||d.stackExchangeAnswer).onChange(async r=>{this.plugin.settings.stackExchangeAnswer=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),new f.Setting(e).setName("Download media attachments").setDesc("Media attachments will be downloaded to the assets directory (Desktop App feature only). To dynamically change destination directory you can use variables. Check variables reference to learn more.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"downloadStackExchangeAssets")?this.plugin.settings.downloadStackExchangeAssets:d.downloadStackExchangeAssets).onChange(async r=>{this.plugin.settings.downloadStackExchangeAssets=r,r===!1&&(this.plugin.settings.downloadStackExchangeAssetsInDir=!1),await this.plugin.saveSettings(),this.display()})),new f.Setting(e).setName("Download media attachments to note directory").setDesc("Media attachments will be downloaded to the dedicated note assets directory (Desktop App feature only). Overrides assets directory template.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"downloadStackExchangeAssetsInDir")?this.plugin.settings.downloadStackExchangeAssetsInDir:d.downloadStackExchangeAssetsInDir).onChange(async r=>{this.plugin.settings.downloadStackExchangeAssetsInDir=r,r===!0&&(this.plugin.settings.downloadStackExchangeAssets=!0),await this.plugin.saveSettings(),this.display()})),e.createEl("h2",{text:"Mastodon"}),new f.Setting(e).setName("Mastodon content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.mastodonContentTypeSlug}`).setValue(typeof this.plugin.settings.mastodonContentTypeSlug=="undefined"?d.mastodonContentTypeSlug:this.plugin.settings.mastodonContentTypeSlug).onChange(async r=>{this.plugin.settings.mastodonContentTypeSlug=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Mastodon note template title").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder("Defaults to %tootAuthorName%").setValue(this.plugin.settings.mastodonNoteTitle||d.mastodonNoteTitle).onChange(async r=>{this.plugin.settings.mastodonNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Mastodon note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.mastodonNote||d.mastodonNote).onChange(async r=>{this.plugin.settings.mastodonNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),new f.Setting(e).setName("Download media attachments").setDesc("Media attachments will be downloaded to the assets directory (Desktop App feature only). To dynamically change destination directory you can use variables. Check variables reference to learn more.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"downloadMastodonMediaAttachments")?this.plugin.settings.downloadMastodonMediaAttachments:d.downloadMastodonMediaAttachments).onChange(async r=>{this.plugin.settings.downloadMastodonMediaAttachments=r,r===!1&&(this.plugin.settings.downloadMastodonMediaAttachmentsInDir=!1),await this.plugin.saveSettings(),this.display()})),new f.Setting(e).setName("Download media attachments to note directory").setDesc("Media attachments will be downloaded to the dedicated note assets directory (Desktop App feature only). Overrides assets directory template.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"downloadMastodonMediaAttachmentsInDir")?this.plugin.settings.downloadMastodonMediaAttachmentsInDir:d.downloadMastodonMediaAttachmentsInDir).onChange(async r=>{this.plugin.settings.downloadMastodonMediaAttachmentsInDir=r,r===!0&&(this.plugin.settings.downloadMastodonMediaAttachments=!0),await this.plugin.saveSettings(),this.display()})),new f.Setting(e).setName("Save replies").setDesc("If enabled, replies of toot will be saved.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"saveMastodonReplies")?this.plugin.settings.saveMastodonReplies:d.saveMastodonReplies).onChange(async r=>{this.plugin.settings.saveMastodonReplies=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Mastodon reply template").addTextArea(n=>{n.setValue(this.plugin.settings.mastodonReply||d.mastodonReply).onChange(async r=>{this.plugin.settings.mastodonReply=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),e.createEl("h2",{text:"TikTok"}),new f.Setting(e).setName("TikTok content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.tikTokContentTypeSlug}`).setValue(typeof this.plugin.settings.tikTokContentTypeSlug=="undefined"?d.tikTokContentTypeSlug:this.plugin.settings.tikTokContentTypeSlug).onChange(async r=>{this.plugin.settings.tikTokContentTypeSlug=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("TikTok note title template").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder("TikTok from %authorName% (%date%)").setValue(this.plugin.settings.tikTokNoteTitle||d.tikTokNoteTitle).onChange(async r=>{this.plugin.settings.tikTokNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("TikTok note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.tikTokNote||d.tikTokNote).onChange(async r=>{this.plugin.settings.tikTokNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),new f.Setting(e).setName("TikTok embed player width").addText(n=>n.setPlaceholder(d.tikTokEmbedWidth).setValue(this.plugin.settings.tikTokEmbedWidth||d.tikTokEmbedWidth).onChange(async r=>{this.plugin.settings.tikTokEmbedWidth=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("TikTok embed player height").addText(n=>n.setPlaceholder(d.tikTokEmbedHeight).setValue(this.plugin.settings.tikTokEmbedHeight||d.tikTokEmbedHeight).onChange(async r=>{this.plugin.settings.tikTokEmbedHeight=r,await this.plugin.saveSettings()})),e.createEl("h2",{text:"Readable Article"}),new f.Setting(e).setName("Readable content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.parseableArticleContentType}`).setValue(typeof this.plugin.settings.parseableArticleContentType=="undefined"?d.parseableArticleContentType:this.plugin.settings.parseableArticleContentType).onChange(async r=>{this.plugin.settings.parseableArticleContentType=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Readable article note template title").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder("Defaults to %title%").setValue(this.plugin.settings.parseableArticleNoteTitle||d.parseableArticleNoteTitle).onChange(async r=>{this.plugin.settings.parseableArticleNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Readable article note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.parsableArticleNote||d.parsableArticleNote).onChange(async r=>{this.plugin.settings.parsableArticleNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),new f.Setting(e).setName("Download images").setDesc("Images from article will be downloaded to the assets directory (Desktop App feature only). To dynamically change destination directory you can use variables. Check variables reference to learn more.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"downloadImages")?this.plugin.settings.downloadImages:d.downloadImages).onChange(async r=>{this.plugin.settings.downloadImages=r,r===!1&&(this.plugin.settings.downloadImagesInArticleDir=!1),await this.plugin.saveSettings(),this.display()})),new f.Setting(e).setName("Download images to note directory").setDesc("Images from article will be downloaded to the dedicated note assets directory (Desktop App feature only). Overrides assets directory template.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"downloadImagesInArticleDir")?this.plugin.settings.downloadImagesInArticleDir:d.downloadImagesInArticleDir).onChange(async r=>{this.plugin.settings.downloadImagesInArticleDir=r,r===!0&&(this.plugin.settings.downloadImages=!0),await this.plugin.saveSettings(),this.display()})),e.createEl("h2",{text:"Nonreadable Article"}),new f.Setting(e).setName("Nonreadable content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.notParseableArticleContentType}`).setValue(typeof this.plugin.settings.notParseableArticleContentType=="undefined"?d.notParseableArticleContentType:this.plugin.settings.notParseableArticleContentType).onChange(async r=>{this.plugin.settings.notParseableArticleContentType=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Nonreadable article note template title").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder("Defaults to 'Article %date%'").setValue(this.plugin.settings.notParseableArticleNoteTitle||d.notParseableArticleNoteTitle).onChange(async r=>{this.plugin.settings.notParseableArticleNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Nonreadable article note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.notParsableArticleNote||d.notParsableArticleNote).onChange(async r=>{this.plugin.settings.notParsableArticleNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),e.createEl("h2",{text:"Text Snippet"}),new f.Setting(e).setName("Text Snippet content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder(`Defaults to ${d.textSnippetContentType}`).setValue(typeof this.plugin.settings.textSnippetContentType=="undefined"?d.textSnippetContentType:this.plugin.settings.textSnippetContentType).onChange(async r=>{this.plugin.settings.textSnippetContentType=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Text snippet note template title").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.setPlaceholder("Defaults to 'Note %date%'").setValue(this.plugin.settings.textSnippetNoteTitle||d.textSnippetNoteTitle).onChange(async r=>{this.plugin.settings.textSnippetNoteTitle=r,await this.plugin.saveSettings()})),new f.Setting(e).setName("Text snippet note template").setDesc(this.createTemplateVariableReferenceDiv()).addTextArea(n=>{n.setValue(this.plugin.settings.textSnippetNote||d.textSnippetNote).onChange(async r=>{this.plugin.settings.textSnippetNote=r,await this.plugin.saveSettings()}),n.inputEl.rows=10,n.inputEl.cols=25}),e.createEl("h2",{text:"Advanced"});let a=Ei(f.Platform);new f.Setting(e).setName("Maximum file path length").setDesc(`Defaults to ${a.path} characters on your current platform.`).addText(n=>n.setPlaceholder(String(a.path)).onChange(async r=>{let s=r.trim();if(s!==""&&Number.isNaN(Number(s))){new f.Notice("Maximum file path length must be a number.");return}s===""?this.plugin.settings.filesystemLimitPath=null:this.plugin.settings.filesystemLimitPath=Number(s),await this.plugin.saveSettings()})),new f.Setting(e).setName("Maximum file name length").setDesc(`Defaults to ${a.fileName} characters on your current platform.`).addText(n=>n.setPlaceholder(String(a.fileName)).onChange(async r=>{let s=r.trim();if(s!==""&&Number.isNaN(Number(s))){new f.Notice("Maximum file name length must be a number.");return}s===""?this.plugin.settings.filesystemLimitFileName=null:this.plugin.settings.filesystemLimitFileName=Number(s),await this.plugin.saveSettings()}))}createTemplateVariableReferenceDiv(e=""){return Bt(`<p>${e} See the <a href="https://github.com/DominikPieper/obsidian-ReadItLater?tab=readme-ov-file#template-engine">template variables reference</a></p>`)}};var He=require("obsidian"),Wt=zt(Ua());var Va=require("obsidian");function st(i){throw new Va.Notice("Error occured. Please check console output for detailed information."),i}var ur=/(const|let|var)\s+(\w+)\s*=\s*(.+?)\s*(?=(?:^|\s+)(const|let|var)\s+|$)/g;function $t(i,t){return dr(t).find(e=>e.name===i)}function dr(i){let t=[],e;return i.forEach(a=>{for(;(e=ur.exec(a.textContent))!==null;)t.push({type:e[1].trim(),name:e[2].trim(),value:e[3].trim().replace(/;+\s*$/,"")})}),t}var H=class{constructor(t,e,a,n,r){this.fileName=t;this.fileExtension=e;this.content=a;this.contentType=n;this.createdAt=r;_(this,"_filePath",null);this.fileName=pe(this.fileName)}getFullFilename(){return`${this.fileName}.${this.fileExtension}`}get filePath(){return this._filePath}set filePath(t){this._filePath=t}};var Ha=require("obsidian");function Tt(i,t){return(0,Ha.moment)(i).format(t)}var B=class{constructor(t,e,a){_(this,"app");_(this,"plugin");_(this,"templateEngine");this.app=t,this.plugin=e,this.templateEngine=a}isValidUrl(t){return Le(t)}getFormattedDateForFilename(t){return Tt(t,this.plugin.settings.dateTitleFmt)}getFormattedDateForContent(t){return Tt(t,this.plugin.settings.dateContentFmt)}};var Si=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]+)(?:\?([^&\s]+(?:&[^&\s]+)*))?$/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=this.plugin.settings.youtubeApiKey===""?await this.parseSchema(e,a):await this.parseApiResponse(e,a),r=this.templateEngine.render(this.plugin.settings.youtubeNote,n),s=this.templateEngine.render(this.plugin.settings.youtubeNoteTitle,{title:n.videoTitle,date:this.getFormattedDateForFilename(a)});return new H(s,"md",r,this.plugin.settings.youtubeContentTypeSlug,a)}async parseApiResponse(e,a){var r,s,p,l,c,u,v,k,y,D,N,S,j;let n=this.PATTERN.exec(e)[1];try{let U=await(0,He.request)({method:"GET",url:`https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,statistics,status,topicDetails&id=${n}&key=${this.plugin.settings.youtubeApiKey}`,headers:{Accept:"application/json"}}),z=JSON.parse(U);if(z.items.length===0)throw new Error(`Video (${e}) cannot be fetched from API`);let x=z.items[0],X=await(0,He.request)({method:"GET",url:`https://www.googleapis.com/youtube/v3/channels?part=snippet,contentDetails,statistics&id=${x.snippet.channelId}&key=${this.plugin.settings.youtubeApiKey}`,headers:{Accept:"application/json"}}),E=JSON.parse(X);if(E.items.length===0)throw new Error(`Channel (${x.snippet.channelId}) cannot be fetched from API`);let I=E.items[0],J=(0,Wt.parse)(x.contentDetails.duration),ne=(p=(s=(r=x.snippet)==null?void 0:r.tags)==null?void 0:s.map(V=>V.replace(/[\s:\-_.]/g,"").replace(/^/,"#")))!=null?p:[],le=this.getVideoChapters(x.snippet.description);return{date:this.getFormattedDateForContent(a),videoId:x.id,videoURL:e,videoTitle:x.snippet.title,videoDescription:x.snippet.description,videoThumbnail:(S=(N=(k=(c=(l=x.snippet.thumbnails)==null?void 0:l.maxres)==null?void 0:c.url)!=null?k:(v=(u=x.snippet.thumbnails)==null?void 0:u.medium)==null?void 0:v.url)!=null?N:(D=(y=x.snippet.thumbnails)==null?void 0:y.default)==null?void 0:D.url)!=null?S:"",videoPlayer:this.getEmbedPlayer(x.id),videoDuration:(0,Wt.toSeconds)(J),videoDurationFormatted:this.formatDuration(J),videoPublishDate:(0,He.moment)(x.snippet.publishedAt).format(this.plugin.settings.dateContentFmt),videoViewsCount:x.statistics.viewCount,videoTags:ne.join(" "),videoChapters:this.formatVideoChapters(x.id,le),channelId:I.id,channelURL:`https://www.youtube.com/channel/${I.id}`,channelName:(j=I.snippet.title)!=null?j:"",extra:{thumbnails:x.snippet.thumbnails,publishedAt:(0,He.moment)(x.snippet.publishedAt).toDate(),tags:ne,channel:{thumbnails:I.snippet.thumbnails},chapters:le}}}catch(U){st(U)}}async parseSchema(e,a){var n,r,s,p,l,c,u,v,k,y,D,N,S,j,U,z,x,X,E,I,J,ne,le,V,Ee,Ie,M,O,G,Ae,w,re,L,me,fe,ve,Ce,ge,be,xe,ue,Se,_e;try{let $=await(0,He.request)({method:"GET",url:e,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}}),te=new DOMParser().parseFromString($,"text/html"),De=$t("ytInitialDataa",te.querySelectorAll("script")),q=typeof De!="undefined"?JSON.parse(De.value):{},F=te.querySelector('[itemtype*="http://schema.org/VideoObject"]');if(F===null)throw new Error("Unable to find Schema.org element in HTML.");let ye=(r=(n=F==null?void 0:F.querySelector('[itemprop="identifier"]'))==null?void 0:n.getAttribute("content"))!=null?r:"",R=F.querySelector('[itemtype="http://schema.org/Person"]'),Me=(S=(N=(y=(k=(v=(u=(c=(l=(p=(s=q==null?void 0:q.contents)==null?void 0:s.twoColumnWatchNextResults)==null?void 0:p.results)==null?void 0:l.results)==null?void 0:c.contents)==null?void 0:u[1])==null?void 0:v.videoSecondaryInfoRenderer)==null?void 0:k.attributedDescription)==null?void 0:y.content)!=null?N:(D=F==null?void 0:F.querySelector('[itemprop="description"]'))==null?void 0:D.getAttribute("content"))!=null?S:"",Ve=this.getVideoChapters(Me),Rt=(le=(ne=(J=(I=(E=(X=(x=(z=(U=(j=q==null?void 0:q.engagementPanels)==null?void 0:j[5])==null?void 0:U.engagementPanelSectionListRenderer)==null?void 0:z.content)==null?void 0:x.structuredDescriptionContentRenderer)==null?void 0:X.items)==null?void 0:E[0])==null?void 0:I.videoDescriptionHeaderRenderer)==null?void 0:J.publishDate)==null?void 0:ne.simpleText)!=null?le:"",ei=(L=(re=(w=(Ae=(G=(O=(M=(Ie=(Ee=(V=q==null?void 0:q.contents)==null?void 0:V.twoColumnWatchNextResults)==null?void 0:Ee.results)==null?void 0:Ie.results)==null?void 0:M.contents)==null?void 0:O[0])==null?void 0:G.videoPrimaryInfoRenderer)==null?void 0:Ae.viewCount)==null?void 0:w.videoViewCountRenderer)==null?void 0:re.originalViewCount)!=null?L:0;return{date:this.getFormattedDateForContent(a),videoId:ye,videoURL:e,videoTitle:(fe=(me=F==null?void 0:F.querySelector('[itemprop="name"]'))==null?void 0:me.getAttribute("content"))!=null?fe:"",videoDescription:Me,videoThumbnail:(Ce=(ve=te.querySelector('meta[property="og:image"]'))==null?void 0:ve.getAttribute("content"))!=null?Ce:"",videoPlayer:this.getEmbedPlayer(ye),videoDuration:0,videoDurationFormatted:"",videoPublishDate:Rt!==""?(0,He.moment)(Rt).format(this.plugin.settings.dateContentFmt):"",videoViewsCount:ei,videoTags:"",videoChapters:this.formatVideoChapters(ye,Ve),channelId:(be=(ge=F==null?void 0:F.querySelector('[itemprop="channelId"'))==null?void 0:ge.getAttribute("content"))!=null?be:"",channelURL:(ue=(xe=R==null?void 0:R.querySelector('[itemprop="url"]'))==null?void 0:xe.getAttribute("href"))!=null?ue:"",channelName:(_e=(Se=R==null?void 0:R.querySelector('[itemprop="name"]'))==null?void 0:Se.getAttribute("content"))!=null?_e:"",extra:null}}catch($){st($)}}formatDuration(e){let a="";return e.years>0&&(a=a.concat(" ",`${e.years}y`)),e.months>0&&(a=a.concat(" ",`${e.months}m`)),e.weeks>0&&(a=a.concat(" ",`${e.weeks}w`)),e.days>0&&(a=a.concat(" ",`${e.days}d`)),e.hours>0&&(a=a.concat(" ",`${e.hours}h`)),e.minutes>0&&(a=a.concat(" ",`${e.minutes}m`)),e.seconds>0&&(a=a.concat(" ",`${e.seconds}s`)),a.trim()}formatVideoChapters(e,a){return a.map(n=>`- [${n.timestamp}](https://www.youtube.com/watch?v=${e}&t=${n.seconds}) ${n.title}`).join(`
`)}getVideoChapters(e){let a=/^((?:\d{1,2}:)?(?:\d{1,2}):(?:\d{1,2}))\s+(.+)$/gm,n=[],r;for(;(r=a.exec(e))!==null;){let s=r[1].trim(),p=r[2].trim(),l=s.split(":"),c=0,u,v;l.length===3?[c,u,v]=l.map(Number):[u,v]=l.map(Number);let k=c*3600+u*60+v;n.push({timestamp:s,title:p,seconds:k})}return n}getEmbedPlayer(e){let a=this.plugin.settings.youtubeUsePrivacyEnhancedEmbed?"youtube-nocookie.com":"youtube.com";return`<iframe width="${this.plugin.settings.youtubeEmbedWidth}" height="${this.plugin.settings.youtubeEmbedHeight}" src="https://www.${a}/embed/${e}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`}},za=Si;var Ba=require("obsidian");var _i=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(vimeo.com)\/(\d+)?/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=await this.parseSchema(e,a),r=this.templateEngine.render(this.plugin.settings.vimeoNote,n),s=this.templateEngine.render(this.plugin.settings.vimeoNoteTitle,{title:n.videoTitle,date:this.getFormattedDateForFilename(a)});return new H(s,"md",r,this.plugin.settings.vimeoContentTypeSlug,a)}async parseSchema(e,a){var u,v,k,y,D,N;let n=await(0,Ba.request)({method:"GET",url:e,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"}}),s=new DOMParser().parseFromString(n,"text/html").querySelector('script[type="application/ld+json"]'),l=JSON.parse(s.textContent)[0],c=this.PATTERN.exec(e);return{date:this.getFormattedDateForContent(a),videoId:c.length===3?c[2]:"",videoURL:(u=l==null?void 0:l.url)!=null?u:"",videoTitle:(v=l==null?void 0:l.name)!=null?v:"",videoPlayer:`<iframe width="${this.plugin.settings.vimeoEmbedWidth}" height="${this.plugin.settings.vimeoEmbedHeight}" src="${l==null?void 0:l.embedUrl}" title="Vimeo video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`,channelName:(y=(k=l==null?void 0:l.author)==null?void 0:k.name)!=null?y:"",channelURL:(N=(D=l==null?void 0:l.author)==null?void 0:D.url)!=null?N:""}}},ja=_i;var $a=require("obsidian");var Di=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(bilibili.com)\/(video)?\/([a-z0-9]+)?/i)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=await this.getNoteData(e,a),r=this.templateEngine.render(this.plugin.settings.bilibiliNote,n),s=this.templateEngine.render(this.plugin.settings.bilibiliNoteTitle,{title:n.videoTitle,date:this.getFormattedDateForFilename(a)});return new H(s,"md",r,this.plugin.settings.bilibiliContentTypeSlug,a)}async getNoteData(e,a){var p,l;let n=await(0,$a.request)({method:"GET",url:e,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"}}),r=new DOMParser().parseFromString(n,"text/html"),s=(p=this.PATTERN.exec(e)[3])!=null?p:"";return{date:this.getFormattedDateForContent(a),videoId:s,videoTitle:(l=r.querySelector("[property~='og:title']").getAttribute("content"))!=null?l:"",videoURL:e,videoPlayer:`<iframe width="${this.plugin.settings.bilibiliEmbedWidth}" height="${this.plugin.settings.bilibiliEmbedHeight}" src="https://player.bilibili.com/player.html?autoplay=0&bvid=${s}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`}}},Wa=Di;var Yt=require("obsidian");function gr(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var a in e)e.hasOwnProperty(a)&&(i[a]=e[a])}return i}function Pi(i,t){return Array(t+1).join(i)}function hr(i){return i.replace(/^\n*/,"")}function fr(i){for(var t=i.length;t>0&&i[t-1]===`
`;)t--;return i.substring(0,t)}var vr=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Li(i){return Ii(i,vr)}var Ya=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Xa(i){return Ii(i,Ya)}function br(i){return Ja(i,Ya)}var Ka=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function xr(i){return Ii(i,Ka)}function yr(i){return Ja(i,Ka)}function Ii(i,t){return t.indexOf(i.nodeName)>=0}function Ja(i,t){return i.getElementsByTagName&&t.some(function(e){return i.getElementsByTagName(e).length})}var oe={};oe.paragraph={filter:"p",replacement:function(i){return`
`+i+`
`}};oe.lineBreak={filter:"br",replacement:function(i,t,e){return e.br+`
`}};oe.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(i,t,e){var a=Number(t.nodeName.charAt(1));if(e.headingStyle==="setext"&&a<3){var n=Pi(a===1?"=":"-",i.length);return`
`+i+`
`+n+`
`}else return`
`+Pi("#",a)+" "+i+`
`}};oe.blockquote={filter:"blockquote",replacement:function(i){return i=i.replace(/^\n+|\n+$/g,""),i=i.replace(/^/gm,"> "),`
`+i+`
`}};oe.list={filter:["ul","ol"],replacement:function(i,t){var e=t.parentNode;return e.nodeName==="LI"&&e.lastElementChild===t?`
`+i:`
`+i+`
`}};oe.listItem={filter:"li",replacement:function(i,t,e){i=i.replace(/^\n+/,"").replace(/\n+$/,`
`).replace(/\n/gm,`
`);var a=e.bulletListMarker+" ",n=t.parentNode;if(n.nodeName==="OL"){var r=n.getAttribute("start"),s=Array.prototype.indexOf.call(n.children,t);a=(r?Number(r)+s:s+1)+". "}return a+i+(t.nextSibling&&!/\n$/.test(i)?`
`:"")}};oe.indentedCodeBlock={filter:function(i,t){return t.codeBlockStyle==="indented"&&i.nodeName==="PRE"&&i.firstChild&&i.firstChild.nodeName==="CODE"},replacement:function(i,t,e){return`
`+t.firstChild.textContent.replace(/\n/g,`
`)+`
`}};oe.fencedCodeBlock={filter:function(i,t){return t.codeBlockStyle==="fenced"&&i.nodeName==="PRE"&&i.firstChild&&i.firstChild.nodeName==="CODE"},replacement:function(i,t,e){for(var a=t.firstChild.getAttribute("class")||"",n=(a.match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,s=e.fence.charAt(0),p=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(r);)c[0].length>=p&&(p=c[0].length+1);var u=Pi(s,p);return`
`+u+n+`
`+r.replace(/\n$/,"")+`
`+u+`
`}};oe.horizontalRule={filter:"hr",replacement:function(i,t,e){return`
`+e.hr+`
`}};oe.inlineLink={filter:function(i,t){return t.linkStyle==="inlined"&&i.nodeName==="A"&&i.getAttribute("href")},replacement:function(i,t){var e=t.getAttribute("href");e&&(e=e.replace(/([()])/g,"\\$1"));var a=Gt(t.getAttribute("title"));return a&&(a=' "'+a.replace(/"/g,'\\"')+'"'),"["+i+"]("+e+a+")"}};oe.referenceLink={filter:function(i,t){return t.linkStyle==="referenced"&&i.nodeName==="A"&&i.getAttribute("href")},replacement:function(i,t,e){var a=t.getAttribute("href"),n=Gt(t.getAttribute("title"));n&&(n=' "'+n+'"');var r,s;switch(e.linkReferenceStyle){case"collapsed":r="["+i+"][]",s="["+i+"]: "+a+n;break;case"shortcut":r="["+i+"]",s="["+i+"]: "+a+n;break;default:var p=this.references.length+1;r="["+i+"]["+p+"]",s="["+p+"]: "+a+n}return this.references.push(s),r},references:[],append:function(i){var t="";return this.references.length&&(t=`
`+this.references.join(`
`)+`
`,this.references=[]),t}};oe.emphasis={filter:["em","i"],replacement:function(i,t,e){return i.trim()?e.emDelimiter+i+e.emDelimiter:""}};oe.strong={filter:["strong","b"],replacement:function(i,t,e){return i.trim()?e.strongDelimiter+i+e.strongDelimiter:""}};oe.code={filter:function(i){var t=i.previousSibling||i.nextSibling,e=i.parentNode.nodeName==="PRE"&&!t;return i.nodeName==="CODE"&&!e},replacement:function(i){if(!i)return"";i=i.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(i)?" ":"",e="`",a=i.match(/`+/gm)||[];a.indexOf(e)!==-1;)e=e+"`";return e+t+i+t+e}};oe.image={filter:"img",replacement:function(i,t){var e=Gt(t.getAttribute("alt")),a=t.getAttribute("src")||"",n=Gt(t.getAttribute("title")),r=n?' "'+n+'"':"";return a?"!["+e+"]("+a+r+")":""}};function Gt(i){return i?i.replace(/(\n+\s*)+/g,`
`):""}function Za(i){this.options=i,this._keep=[],this._remove=[],this.blankRule={replacement:i.blankReplacement},this.keepReplacement=i.keepReplacement,this.defaultRule={replacement:i.defaultReplacement},this.array=[];for(var t in i.rules)this.array.push(i.rules[t])}Za.prototype={add:function(i,t){this.array.unshift(t)},keep:function(i){this._keep.unshift({filter:i,replacement:this.keepReplacement})},remove:function(i){this._remove.unshift({filter:i,replacement:function(){return""}})},forNode:function(i){if(i.isBlank)return this.blankRule;var t;return(t=ki(this.array,i,this.options))||(t=ki(this._keep,i,this.options))||(t=ki(this._remove,i,this.options))?t:this.defaultRule},forEach:function(i){for(var t=0;t<this.array.length;t++)i(this.array[t],t)}};function ki(i,t,e){for(var a=0;a<i.length;a++){var n=i[a];if(Tr(n,t,e))return n}}function Tr(i,t,e){var a=i.filter;if(typeof a=="string"){if(a===t.nodeName.toLowerCase())return!0}else if(Array.isArray(a)){if(a.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if(typeof a=="function"){if(a.call(i,t,e))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function wr(i){var t=i.element,e=i.isBlock,a=i.isVoid,n=i.isPre||function(v){return v.nodeName==="PRE"};if(!(!t.firstChild||n(t))){for(var r=null,s=!1,p=null,l=Ga(p,t,n);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!r||/ $/.test(r.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=Ci(l);continue}l.data=c,r=l}else if(l.nodeType===1)e(l)||l.nodeName==="BR"?(r&&(r.data=r.data.replace(/ $/,"")),r=null,s=!1):a(l)||n(l)?(r=null,s=!0):r&&(s=!1);else{l=Ci(l);continue}var u=Ga(p,l,n);p=l,l=u}r&&(r.data=r.data.replace(/ $/,""),r.data||Ci(r))}}function Ci(i){var t=i.nextSibling||i.parentNode;return i.parentNode.removeChild(i),t}function Ga(i,t,e){return i&&i.parentNode===t||e(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var Mi=typeof window!="undefined"?window:{};function Nr(){var i=Mi.DOMParser,t=!1;try{new i().parseFromString("","text/html")&&(t=!0)}catch(e){}return t}function Er(){var i=function(){};return Ar()?i.prototype.parseFromString=function(t){var e=new window.ActiveXObject("htmlfile");return e.designMode="on",e.open(),e.write(t),e.close(),e}:i.prototype.parseFromString=function(t){var e=document.implementation.createHTMLDocument("");return e.open(),e.write(t),e.close(),e},i}function Ar(){var i=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){Mi.ActiveXObject&&(i=!0)}return i}var Sr=Nr()?Mi.DOMParser:Er();function _r(i,t){var e;if(typeof i=="string"){var a=Dr().parseFromString('<x-turndown id="turndown-root">'+i+"</x-turndown>","text/html");e=a.getElementById("turndown-root")}else e=i.cloneNode(!0);return wr({element:e,isBlock:Li,isVoid:Xa,isPre:t.preformattedCode?kr:null}),e}var Ri;function Dr(){return Ri=Ri||new Sr,Ri}function kr(i){return i.nodeName==="PRE"||i.nodeName==="CODE"}function Cr(i,t){return i.isBlock=Li(i),i.isCode=i.nodeName==="CODE"||i.parentNode.isCode,i.isBlank=Rr(i),i.flankingWhitespace=Pr(i,t),i}function Rr(i){return!Xa(i)&&!xr(i)&&/^\s*$/i.test(i.textContent)&&!br(i)&&!yr(i)}function Pr(i,t){if(i.isBlock||t.preformattedCode&&i.isCode)return{leading:"",trailing:""};var e=Lr(i.textContent);return e.leadingAscii&&qa("left",i,t)&&(e.leading=e.leadingNonAscii),e.trailingAscii&&qa("right",i,t)&&(e.trailing=e.trailingNonAscii),{leading:e.leading,trailing:e.trailing}}function Lr(i){var t=i.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function qa(i,t,e){var a,n,r;return i==="left"?(a=t.previousSibling,n=/ $/):(a=t.nextSibling,n=/^ /),a&&(a.nodeType===3?r=n.test(a.nodeValue):e.preformattedCode&&a.nodeName==="CODE"?r=!1:a.nodeType===1&&!Li(a)&&(r=n.test(a.textContent))),r}var Ir=Array.prototype.reduce,Mr=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function qt(i){if(!(this instanceof qt))return new qt(i);var t={rules:oe,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,a){return a.isBlock?`
`:""},keepReplacement:function(e,a){return a.isBlock?`
`+a.outerHTML+`
`:a.outerHTML},defaultReplacement:function(e,a){return a.isBlock?`
`+e+`
`:e}};this.options=gr({},t,i),this.rules=new Za(this.options)}qt.prototype={turndown:function(i){if(!Ur(i))throw new TypeError(i+" is not a string, or an element/document/fragment node.");if(i==="")return"";var t=Qa.call(this,new _r(i,this.options));return Or.call(this,t)},use:function(i){if(Array.isArray(i))for(var t=0;t<i.length;t++)this.use(i[t]);else if(typeof i=="function")i(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(i,t){return this.rules.add(i,t),this},keep:function(i){return this.rules.keep(i),this},remove:function(i){return this.rules.remove(i),this},escape:function(i){return Mr.reduce(function(t,e){return t.replace(e[0],e[1])},i)}};function Qa(i){var t=this;return Ir.call(i.childNodes,function(e,a){a=new Cr(a,t.options);var n="";return a.nodeType===3?n=a.isCode?a.nodeValue:t.escape(a.nodeValue):a.nodeType===1&&(n=Fr.call(t,a)),en(e,n)},"")}function Or(i){var t=this;return this.rules.forEach(function(e){typeof e.append=="function"&&(i=en(i,e.append(t.options)))}),i.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Fr(i){var t=this.rules.forNode(i),e=Qa.call(this,i),a=i.flankingWhitespace;return(a.leading||a.trailing)&&(e=e.trim()),a.leading+t.replacement(e,i,this.options)+a.trailing}function en(i,t){var e=fr(i),a=hr(t),n=Math.max(i.length-e.length,t.length-a.length),r=`
`.substring(0,n);return e+r+a}function Ur(i){return i!=null&&(typeof i=="string"||i.nodeType&&(i.nodeType===1||i.nodeType===9||i.nodeType===11))}var tn=qt;var an=/highlight-(?:text|source)-([a-z0-9]+)/;function Vr(i){i.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return t.nodeName==="DIV"&&an.test(t.className)&&e&&e.nodeName==="PRE"},replacement:function(t,e,a){var n=e.className||"",r=(n.match(an)||[null,""])[1];return`
`+a.fence+r+`
`+e.firstChild.textContent+`
`+a.fence+`
`}})}function Hr(i){i.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~"+t+"~"}})}var zr=Array.prototype.indexOf,Ye={};Ye.tableCell={filter:["th","td"],replacement:function(i,t){return nn(i,t)+rn(t,"")}};Ye.tableRow={filter:"tr",replacement:function(i,t){var e="",a={left:":--",right:"--:",center:":-:"};if(Br(t))for(var n=0;n<t.childNodes.length;n++){var r="---",s=(t.childNodes[n].getAttribute("align")||"").toLowerCase();s&&(r=a[s]||r),e+=nn(r,t.childNodes[n])+rn(t.childNodes[n],r)}return`
`+i+(e?`
`+e:"")}};Ye.table={filter:function(i){return i.nodeName==="TABLE"&&!sn(i)},replacement:function(i){return i=i.replace(`
`,`
`),`
`+i+`
`}};Ye.tableSection={filter:["thead","tbody","tfoot"],replacement:function(i){return i}};Ye.captionSection={filter:"caption",replacement:function(i,t){return t.parentNode.nodeName==="TABLE"&&t.parentNode.childNodes[0]===t?i:""}};function Br(i){var t=i.parentNode,e=t;return(t.nodeName==="THEAD"||t.nodeName==="TFOOT"||t.nodeName==="TBODY")&&(e=t.parentNode),e.nodeName==="TABLE"&&e.rows[0]===i}function nn(i,t){var e=zr.call(t.parentNode.childNodes,t),a=" ";return e===0&&(a="| "),i=i.replace(/\r\n/g,`
`).replace(/\n/g," "),i=i.replace(/\|/g,"\\|"),a+i+" |"}function rn(i,t){var e=i.getAttribute("colspan")||1;return e<=1?"":(" "+t+" |").repeat(e-1)}function sn(i){for(var t=i.parentNode;t;){if(t.nodeName==="TABLE")return!0;t=t.parentNode}return!1}function jr(i){i.keep(function(e){return e.nodeName==="TABLE"&&sn(e)});for(var t in Ye)i.addRule(t,Ye[t])}function $r(i){i.addRule("taskListItems",{filter:function(t){return t.type==="checkbox"&&t.parentNode.nodeName==="LI"},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function on(i){i.use([Vr,Hr,jr,$r])}async function Ue(i){let t=on,e=new tn({headingStyle:"atx",hr:"---",bulletListMarker:"-",codeBlockStyle:"fenced",emDelimiter:"*"});return e.use(t),e.addRule("torchlightCodeBlock",{filter:n=>n.nodeName==="PRE"&&n.firstChild.nodeName==="CODE"&&n.firstChild.firstChild.nodeName==="P",replacement:function(n,r,s){return r.querySelectorAll("p").forEach(p=>{p.innerHTML=p.innerHTML+`
`}),`
`+s.fence+r.firstChild.getAttribute("data-lang")+`
`+r.firstChild.textContent+`
`+s.fence+`
`}}),e.addRule("fencedCodeLangBlock",{filter:n=>n.nodeName=="PRE"&&(!n.firstChild||n.firstChild.nodeName!="CODE")&&!n.querySelector("img"),replacement:function(n,r,s){var N;r.innerHTML=r.innerHTML.replaceAll("<br-keep></br-keep>","<br>");let p=(N=r.id)==null?void 0:N.match(/code-lang-(.+)/),l=(p==null?void 0:p.length)>0?p[1]:"",c=r.textContent,u=s.fence.charAt(0),v=3,k=new RegExp("^"+u+"{3,}","gm"),y;for(;y=k.exec(c);)y[0].length>=v&&(v=y[0].length+1);let D=Array(v+1).join(u);return`
`+D+l+`
`+c.replace(/\n$/,"")+`
`+D+`
`}}),e.turndown(i)}var Oi=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(https:\/\/(twitter|x).com\/([a-zA-Z0-9_]+\/)([a-zA-Z0-9_]+\/[a-zA-Z0-9_]+))/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=new URL(e);n.hostname==="x.com"&&(n.hostname="twitter.com");let r=await this.getTweetNoteData(n,a),s=this.templateEngine.render(this.plugin.settings.twitterNote,r),p=this.templateEngine.render(this.plugin.settings.twitterNoteTitle,{tweetAuthorName:r.tweetAuthorName,date:this.getFormattedDateForFilename(a)});return new H(p,"md",s,this.plugin.settings.twitterContentTypeSlug,a)}async getTweetNoteData(e,a){let n=JSON.parse(await(0,Yt.request)({method:"GET",contentType:"application/json",url:`https://publish.twitter.com/oembed?url=${e.href}`})),r=await Ue(n.html);return{date:this.getFormattedDateForContent(a),tweetAuthorName:n.author_name,tweetURL:n.url,tweetContent:r,tweetPublishDate:this.getPublishedDateFromDOM(n.html)}}getPublishedDateFromDOM(e){let n=new DOMParser().parseFromString(e,"text/html").querySelector("blockquote > a"),r=(0,Yt.moment)(n.textContent);return r.isValid()?r.format(this.plugin.settings.dateContentFmt):""}},ln=Oi;var Xt=require("obsidian"),Bi=zt(Hi());var ze=require("obsidian");var ot="http:",lt="https:";function zi(i){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<i;a++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}function cn(i,t){let e=i.trim().split(Aa(t)).filter(n=>n.trim().length>0),a=e.reduce((n,r)=>n&&Le(r,[ot,lt]),!0);return{urls:e,everyLineIsURL:a}}var Gr=/!\[(?<anchor>.*?)\]\((?<link>.+?)\)/g,qr=5,Yr=1e3;async function Xe(i,t,e,a){return await Xr(e,Gr,Kr(i,t,a))}async function Xr(i,t,e){try{if(typeof e=="function"){let a=[];return String.prototype.replace.call(i,t,function(n,r,s){return a.push(e(n,r,s)),""}),Promise.all(a).then(function(n){return String.prototype.replace.call(i,t,function(){return n.shift()})})}else return Promise.resolve(String.prototype.replace.call(i,t,e))}catch(a){return console.error(),Promise.reject(a)}}function Kr(i,t,e){return async function(n,r,s){if(!Le(s,[ot,lt]))return n;let p=new URL(s);await i.getVaultRepository().createDirectory(e);try{let{fileContent:l,fileExtension:c}=await Zr(p),u=0;for(;u<qr;)try{let{fileName:v,needWrite:k}=await Jr(i.app.vault.adapter,i.getFileSystemLimits(),e,t,c);if(k&&v!==""){await i.app.vault.createBinary(v,l);let y=v.replace(/\s/g,"%20");return`![${r}](${y})`}else return n}catch(v){console.warn(v),u++}return n}catch(l){return console.warn(l),n}}}async function Jr(i,t,e,a,n){if(n==="")return{fileName:"",needWrite:!1};let r=!1,s="",p=0;for(;s===""&&p<Yr;){let l;i instanceof ze.CapacitorAdapter||i instanceof ze.FileSystemAdapter?l=yt(e,`${a}-${zi(10)}.${n}`,i,t):l=`${e}/${a}-${zi(10)}.${n}`,await i.exists((0,ze.normalizePath)(l),!1)||(s=l,r=!0),p++}return{fileName:s,needWrite:r}}async function Zr(i){var e;let t=await(0,ze.requestUrl)({url:i.href,method:"get"});return{fileContent:t.arrayBuffer,fileExtension:(e=Oa(t.headers["content-type"]||""))!=null?e:""}}var ji=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(https:\/\/|http:\/\/)(stackoverflow\.com|serverfault\.com|superuser\.com|askubuntu\.com|stackapps\.com|.*\.stackexchange\.com)\/(q|a|questions)\/(\d+)/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=await(0,Xt.request)({method:"GET",url:e}),r=new DOMParser().parseFromString(n,"text/html"),s=await this.parseDocument(r),p=this.templateEngine.render(this.plugin.settings.stackExchangeNoteTitle,{title:s.title,date:this.getFormattedDateForFilename(a)}),l;this.plugin.settings.downloadStackExchangeAssetsInDir?(l=this.templateEngine.render(this.plugin.settings.assetsDir,{date:"",fileName:"",contentType:""}),l=`${l}/${pe(p)}`):l=this.templateEngine.render(this.plugin.settings.assetsDir,{date:this.getFormattedDateForFilename(a),fileName:pe(p),contentType:this.plugin.settings.stackExchangeContentType});let c=this.templateEngine.render(this.plugin.settings.stackExchangeNote,this.getNoteData(s,a));return this.plugin.settings.downloadStackExchangeAssets&&Xt.Platform.isDesktop&&(c=await Xe(this.plugin,pe(p),c,l)),new H(p,"md",c,this.plugin.settings.stackExchangeContentType,a)}getNoteData(e,a){let n=e.topAnswer?this.templateEngine.render(this.plugin.settings.stackExchangeAnswer,{date:this.getFormattedDateForContent(a),answerContent:e.topAnswer.content,authorName:e.topAnswer.author.name,authorProfileURL:e.topAnswer.author.profile}):"",r="";for(let s=0;s<e.answers.length;s++)r=r.concat(`
***
`,this.templateEngine.render(this.plugin.settings.stackExchangeAnswer,{date:this.getFormattedDateForContent(a),answerContent:e.answers[s].content,authorName:e.answers[s].author.name,authorProfileURL:e.answers[s].author.profile}));return{date:this.getFormattedDateForContent(a),questionTitle:e.title,questionURL:e.url,questionContent:e.content,authorName:e.author.name,authorProfileURL:e.author.profile,topAnswer:n,answers:r.trim(),extra:{question:e}}}async parseDocument(e){var s,p,l,c,u,v,k,y,D,N,S,j,U,z,x,X;let a;try{a=new URL((l=(s=e.querySelector('link[rel="canonical"]'))==null?void 0:s.getAttribute("href"))!=null?l:(p=e.querySelector('meta[property="og:url"]'))==null?void 0:p.getAttribute("content"))}catch(E){a=null}let n=e.querySelector('#question [itemprop="author"]'),r=[];for(let E of e.querySelectorAll(".answer")){let I=E.querySelector('[itemprop="author"]');r.push({content:await Ue(Bi.sanitize((c=E.querySelector('[itemprop="text"]'))!=null?c:"")),author:{name:(v=(u=I==null?void 0:I.querySelector('[itemprop="name"]'))==null?void 0:u.textContent)!=null?v:"",profile:I instanceof Element&&a instanceof URL?String.prototype.concat(a.origin,(y=(k=I.querySelector("a"))==null?void 0:k.getAttribute("href"))!=null?y:""):""}})}return{title:(N=(D=e.querySelector('#question-header [itemprop="name"]'))==null?void 0:D.textContent)!=null?N:"",content:await Ue(Bi.sanitize((S=e.querySelector('#question [itemprop="text"]'))!=null?S:"")),url:(j=a==null?void 0:a.href)!=null?j:"",topAnswer:r.slice(0,1).shift(),answers:r.slice(1),author:{name:(z=(U=n==null?void 0:n.querySelector('[itemprop="name"]'))==null?void 0:U.textContent)!=null?z:"",profile:n instanceof Element&&a instanceof URL?String.prototype.concat(a.origin,(X=(x=n.querySelector("a"))==null?void 0:x.getAttribute("href"))!=null?X:""):""}}}},mn=ji;var Ke=require("obsidian"),Kt=zt(vn()),bn=zt(Hi());var Gi=class extends B{test(t){return this.isValidUrl(t)}async prepareNote(t){let e=new URL(t),a=await this.getDocument(e);return this.makeNote(a,e)}async makeNote(t,e){(0,Kt.isProbablyReaderable)(t)||new Ke.Notice("@mozilla/readability considers this document to unlikely be readerable.");let a=new Date,n=this.extractPreviewUrl(t),r=new Kt.Readability(t).parse();if(r===null||!Object.prototype.hasOwnProperty.call(r,"content"))return this.notParsableArticle(e.href,n,a);let s=await Ue(r.content);return this.parsableArticle({date:this.getFormattedDateForContent(a),articleTitle:r.title||"No title",articleURL:e.href,articleReadingTime:this.getEstimatedReadingTime(r),articleContent:s,siteName:r.siteName||"",author:r.byline||"",previewURL:n||"",publishedTime:r.publishedTime!==null?this.getFormattedDateForContent(r.publishedTime):"",readabilityArticle:r},a)}async getDocument(t){var l,c,u,v,k;let e=await(0,Ke.request)({method:"GET",url:t.href,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}}),a=new DOMParser().parseFromString(e,"text/html"),n=a.getElementsByTagName("base"),r=null;n.length>0&&(r=n.item(0).getAttribute("href"),Array.from(n).forEach(y=>{y.remove()}));let s=a.createElement("base");s.setAttribute("href",Ia(r!=null?r:t.href,t.origin)),a.head.append(s);let p=bn.sanitize(a.body.innerHTML);return a.body.innerHTML=p,(l=a.body.querySelectorAll("pre br"))==null||l.forEach(y=>{y.outerHTML="<br-keep></br-keep>"}),(c=a.body.querySelectorAll("h1, h2, h3, h4, h5, h6"))==null||c.forEach(y=>{y.className=""}),(u=a.body.querySelectorAll("[class*=highlight-text],[class*=highlight-source]"))==null||u.forEach(y=>{var N;let D=(N=y.className.match(/highlight-(?:text|source)-([a-z0-9]+)/))==null?void 0:N[1];y.firstElementChild.nodeName=="PRE"&&(y.removeAttribute("data-snippet-clipboard-copy-content"),y.firstElementChild.id=`code-lang-${D}`)}),(v=a.body.querySelectorAll("[class*=language-]"))==null||v.forEach(y=>{var N;let D=(N=y.className.match(/language-([a-z0-9]+)/))==null?void 0:N[1];y.id=`code-lang-${D}`}),(k=a.body.querySelectorAll(".codehilite > pre"))==null||k.forEach(y=>{y.firstChild.nodeName!=="CODE"&&!y.className.includes("language")&&(y.id="code-lang-text")}),a}async parsableArticle(t,e){let a=this.templateEngine.render(this.plugin.settings.parseableArticleNoteTitle,{title:t.articleTitle,date:this.getFormattedDateForFilename(e)}),n=this.templateEngine.render(this.plugin.settings.parsableArticleNote,t);return this.plugin.settings.downloadImages&&Ke.Platform.isDesktop&&(n=await Xe(this.plugin,pe(a),n,this.getAssetsDir(a,e))),new H(a,"md",n,this.plugin.settings.parseableArticleContentType,e)}async notParsableArticle(t,e,a){console.error("Website not parseable");let n=this.templateEngine.render(this.plugin.settings.notParsableArticleNote,{articleURL:t,previewURL:e}),r=this.templateEngine.render(this.plugin.settings.notParseableArticleNoteTitle,{date:this.getFormattedDateForFilename(a)});return this.plugin.settings.downloadImages&&Ke.Platform.isDesktop&&(n=await Xe(this.plugin,pe(r),n,this.getAssetsDir(r,a))),new H(r,"md",n,this.plugin.settings.notParseableArticleContentType,a)}extractPreviewUrl(t){let e=t.querySelector('meta[property="og:image"]');return e==null&&(e=t.querySelector('meta[name="twitter:image"]')),e==null?void 0:e.getAttribute("content")}getAssetsDir(t,e){return this.plugin.settings.downloadImagesInArticleDir?`${this.templateEngine.render(this.plugin.settings.assetsDir,{date:"",fileName:"",contentType:""})}/${pe(t)}`:this.templateEngine.render(this.plugin.settings.assetsDir,{date:this.getFormattedDateForFilename(e),fileName:pe(t),contentType:this.plugin.settings.parseableArticleContentType})}getEstimatedReadingTime(t){let e=this.getReadingSpeed(t.lang||"en"),a=t.textContent.trim().split(/\s+/).length;return Math.ceil(a/e)}getReadingSpeed(t){let e=new Map([["en",228],["ar",138],["de",179],["es",218],["fi",161],["fr",195],["he",187],["it",188],["ja",193],["nl",202],["pl",166],["pt",181],["ru",184],["sk",190],["sl",180],["sv",199],["tr",166],["zh",158]]);return e.get(t)||e.get("en")}},pt=Gi;var qi=class extends B{test(){return!0}async prepareNote(t){let e=new Date,a=this.templateEngine.render(this.plugin.settings.textSnippetNoteTitle,{date:this.getFormattedDateForFilename(e)}),n=this.templateEngine.render(this.plugin.settings.textSnippetNote,{content:t,date:this.getFormattedDateForContent(e)});return new H(a,"md",n,this.plugin.settings.textSnippetContentType,e)}},xn=qi;var ct=require("obsidian");var Yi={INSTANCE:"/api/v2/instance",OEMBED:"/api/oembed",STATUS:"/api/v1/statuses",CONTEXT:"/api/v1/statuses/%id%/context"},Xi=class extends B{async test(t){return Le(t)&&await this.testIsMastodon(t)}async prepareNote(t){let e=new Date,a=new URL(t),n=a.pathname.split("/")[2],r=await this.loadStatus(a.hostname,n),s=[];this.plugin.settings.saveMastodonReplies&&(s=await this.loadReplies(a.hostname,n));let p=this.templateEngine.render(this.plugin.settings.mastodonNoteTitle,{tootAuthorName:r.account.display_name,date:this.getFormattedDateForFilename(e)}),l;this.plugin.settings.downloadMastodonMediaAttachmentsInDir?(l=this.templateEngine.render(this.plugin.settings.assetsDir,{date:"",fileName:"",contentType:""}),l=`${l}/${pe(p)}`):l=this.templateEngine.render(this.plugin.settings.assetsDir,{date:this.getFormattedDateForFilename(e),fileName:pe(p),contentType:this.plugin.settings.mastodonContentTypeSlug});let c=await this.getNoteData(r,s,l,pe(p),e),u=this.templateEngine.render(this.plugin.settings.mastodonNote,c);return new H(p,"md",u,this.plugin.settings.mastodonContentTypeSlug,e)}async getNoteData(t,e,a,n,r){let s=await this.parseStatus(t,a,n);if(e.length>0)for(let p=0;p<e.length;p++){let l=await this.parseStatus(e[p],a,n),c=this.templateEngine.render(this.plugin.settings.mastodonReply,{tootAuthorName:e[p].account.display_name,tootURL:e[p].url,tootContent:l});s=s.concat(`
***
`,c)}return{date:this.getFormattedDateForContent(r),tootAuthorName:t.account.display_name,tootURL:t.url,tootContent:s,extra:{status:t,replies:e}}}async loadStatus(t,e){return JSON.parse(await(0,ct.request)({method:"GET",contentType:"application/json",url:`https://${t}${Yi.STATUS}/${e}`}))}async loadReplies(t,e){let a=String.prototype.concat.call("https://",t,String.prototype.replace.call(Yi.CONTEXT,"%id%",e));return JSON.parse(await(0,ct.request)({method:"GET",contentType:"application/json",url:a})).descendants}async parseStatus(t,e,a){let n=await Ue(t.content),r=this.plugin.settings.downloadMastodonMediaAttachments&&ct.Platform.isDesktop?await Xe(this.plugin,e,this.prepareMedia(t.media_attachments),a):this.prepareMedia(t.media_attachments);return n.concat(r)}prepareMedia(t){return t.reduce((e,{url:a,description:n})=>{let r=n?`
> *${n}*`:"";return`${e}
![](${a})${r}`},"")}async testIsMastodon(t){if(!t)return!1;let e=new URL(t).hostname;try{let a=JSON.parse(await(0,ct.request)({method:"GET",contentType:"application/json",url:`https://${e}${Yi.INSTANCE}`}));return(a==null?void 0:a.domain)===e}catch(a){return!1}}},yn=Xi;var Tn=require("obsidian");var Ki=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(tiktok.com)\/(\S+)\/(video)\/(\d+)/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=await this.parseHtml(e,a),r=this.templateEngine.render(this.plugin.settings.tikTokNote,n),s=this.templateEngine.render(this.plugin.settings.tikTokNoteTitle,{authorName:n.authorName,date:this.getFormattedDateForFilename(a)});return new H(s,"md",r,this.plugin.settings.tikTokContentTypeSlug,a)}async parseHtml(e,a){var p,l,c,u;let n=await(0,Tn.request)({method:"GET",url:e,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"}}),r=new DOMParser().parseFromString(n,"text/html"),s=this.PATTERN.exec(e);return{date:this.getFormattedDateForContent(a),videoId:s[4],videoURL:(l=(p=r.querySelector('meta[property="og:url"]'))==null?void 0:p.getAttribute("content"))!=null?l:e,videoDescription:(u=(c=r.querySelector('meta[property="og:description"]'))==null?void 0:c.getAttribute("content"))!=null?u:"",videoPlayer:`<iframe width="${this.plugin.settings.tikTokEmbedWidth}" height="${this.plugin.settings.tikTokEmbedHeight}" src="https://www.tiktok.com/embed/v2/${s[4]}"></iframe>`,authorName:s[2],authorURL:`https://www.tiktok.com/${s[2]}`}}},wn=Ki;var wt=class{constructor(t){_(this,"parsers");this.parsers=t}async createParser(t){for(let e of this.parsers)if(await e.test(t))return e}};var Nt=class extends pt{constructor(){super(...arguments);_(this,"PATTERN",/^https?:\/\/(?:www\.)?github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)\/?$/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new URL(e),n=await this.getDocument(a),r=n.querySelector("article.markdown-body");return r.querySelectorAll('[aria-label^="Permalink:"]').forEach(s=>s.remove()),n.querySelector("body").innerHTML=r.outerHTML,this.makeNote(n,a)}};var Et=class extends pt{constructor(){super(...arguments);_(this,"PATTERN",/^(?:https?:\/\/)?(?:[a-z]{2,3}(?:-[a-z]{2,3})?)(?:\.m)?\.wikipedia\.org\/wiki\/([^\/]+)$/i)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new URL(e),n=await this.getDocument(a);return n.querySelectorAll(".reference .cite-bracket").forEach(r=>{r.remove()}),n.querySelectorAll(".reference a").forEach(r=>{r.textContent="\xA0"+r.textContent}),n.querySelectorAll(".mw-cite-backlink").forEach(r=>{r.remove()}),n.querySelectorAll(".infobox caption").forEach(r=>{let s=n.createElement("p");s.innerHTML=r.innerHTML,r.parentElement.insertBefore(s,r),r.remove()}),n.querySelectorAll(".wikitable caption").forEach(r=>{let s=n.createElement("p");s.innerHTML=r.innerHTML,r.parentElement.insertBefore(s,r),r.remove()}),this.makeNote(n,a)}};function En(i){return i<1e3?String(i):i<1e6?`${Nn(Number(i/1e3),1)}K`:i<1e9?`${Nn(Number(i/1e6),1)}M`:String(i)}function Nn(i,t){return i.toFixed(t).replace(/\.0+$/,"")}var mt=["string","number","bigint","symbol"],as=/{{(.*?)}}/g,At=class{constructor(){_(this,"modifiers");this.modifiers={blockquote:t=>this.validateFilterValueType(t,"blockquote",mt)?t.split(`
`).map(e=>`> ${e}`).join(`
`):t,capitalize:t=>{if(!this.validateFilterValueType(t,"capitalize",mt))return t;let e=String(t);return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},join:(t,e=",")=>this.validateFilterValueType(t,"join",["array"])?t.join(e):t,numberLexify:t=>En(t),lower:t=>{if(!this.validateFilterValueType(t,"lower",mt))return t;String(t).toLowerCase()},map:(t,e)=>{if(!this.validateFilterValueType(t,"map",["array"]))return t;try{return t.map(e)}catch(a){return console.warn("Error in map modifier:",a),t}},replace:(t,e,a="")=>this.validateFilterValueType(t,"replace",mt)?t.replaceAll(e,a):t,striptags:(t,e="")=>{if(!this.validateFilterValueType(t,"striptags",mt))return t;let a=new RegExp(`<(?!/?(${e.replace(/[<>]/g,"").split(",").join("|")})s*/?)[^>]+>`,"gi");return t.replace(a,"")},upper:t=>{if(!this.validateFilterValueType(t,"upper",mt))return t;String(t).toUpperCase()}}}render(t,e){try{let a=this.processLoops(t,e);return a=this.processVariables(a,e),a=this.processSimplePattern(a,e),a}catch(a){return console.error("Error rendering template:",a),t}}processSimplePattern(t,e){let a=/%(\w+(?:\.\w+)*)%/g;return t.replace(a,(n,r)=>{try{let s=this.resolveValue(r,e);return s===void 0?(console.warn(`Unable to resolve ${r}`),n):String(s)}catch(s){return console.warn(`Error processing simple pattern "${n}":`,s),n}})}processVariables(t,e){return t.replace(as,(a,n)=>{try{let[r,...s]=n.split("|").map(v=>v.trim()),l=/(['"])((?:[^\\]|\\.)*?)\1/.exec(r),c;if(l!==null?c=l[2]:c=this.resolveValue(r,e),c===void 0)return console.warn(`Unable to resolve ${r}`),a;let u=c;for(let v of s)u=this.applyModifier(u,v);return String(u)}catch(r){return console.warn(`Error processing variable "${a}":`,r),a}})}processLoops(t,e){let a=/{%\s*for\s+(\w+)\s+in\s+(\w+(?:\.\w+)*)\s*%}([\s\S]*?){%\s*endfor\s*%}/g;return t.replace(a,(n,r,s,p)=>{try{let l=this.resolveValue(s,e);return Array.isArray(l)?l.map(c=>{let u={...e,[r]:c};return this.render(p,u)}).join(""):(console.warn(`Value at "${s}" is not an array`),"")}catch(l){return console.warn(`Error processing loop "${n}":`,l),""}})}resolveValue(t,e){let a=t.trim().split("."),n=e;for(let r of a){if(n==null)return;n=n[r]}return n}addModifier(t,e){if(typeof e!="function")throw new Error("Modifier must be a function");this.modifiers[t]=e}parseModifier(t){let e=t.match(/(\w+)(?:\((.*?)\))?/);if(!e)return{name:t,args:[]};let[,a,n]=e,r=n?this.parseArguments(n):[];return{name:a,args:r}}parseArguments(t){let e=[],a="",n=!1,r="",s=!1,p=0,l=!1,c=()=>{(a.trim()||n)&&e.push(this.evaluateArgument(a.trim())),a=""};for(let u=0;u<t.length;u++){let v=t[u];if(l){a+=v,l=!1;continue}switch(v){case"\\":l=!0;break;case'"':case"'":s||(n&&v===r?n=!1:n||(n=!0,r=v)),a+=v;break;case"(":p++,a+=v;break;case")":p--,a+=v;break;case"=":t[u+1]===">"?(s=!0,a+="=>",u++):a+=v;break;case",":!n&&!s&&p===0?c():a+=v;break;default:a+=v}}return(a||n)&&c(),e}evaluateArgument(t){try{if(t.includes("=>")){let e=Function(`return ${t}`)();return typeof e=="function"?e:t}if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if(t==="")return"";if(!isNaN(Number(t)))return Number(t);if(t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t)}catch(e){return t}return t}catch(e){return console.warn("Error evaluating argument:",t,e),t}}applyModifier(t,e){try{let{name:a,args:n}=this.parseModifier(e);return this.modifiers[a]?this.modifiers[a](t,...n):(console.warn(`Modifier "${a}" not found`),t)}catch(a){return console.warn(`Error applying modifier "${e}":`,a),t}}validateFilterValueType(t,e,a){let n=typeof t;return a.includes(n)?!0:a.includes("array")?Array.isArray(t):(console.warn(`Filter ${e} supports following types ${a.join(", ")}, but ${n} was provided.`),!1)}};var Ji=require("obsidian");var St=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/^(https?:\/\/(?:(?:www|m)\.)?youtube\.com\/(?:channel\/(UC[\w-]{22})|c\/([^\s\/]+)|@([\w-]+)))(?:\/.*)?$/u)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=this.plugin.settings.youtubeApiKey===""?await this.parseSchema(e,a):await this.parseApiResponse(e,a),r=this.templateEngine.render(this.plugin.settings.youtubeChannelNote,n),s=this.templateEngine.render(this.plugin.settings.youtubeChannelNoteTitle,{title:n.channelTitle,date:this.getFormattedDateForFilename(a)});return new H(s,"md",r,this.plugin.settings.youtubeChannelContentTypeSlug,a)}async parseSchema(e,a){var n,r,s,p,l,c,u,v,k,y,D,N,S,j,U,z,x,X,E,I,J,ne,le,V,Ee,Ie,M,O,G,Ae,w,re,L,me,fe,ve,Ce,ge,be,xe,ue,Se,_e,$,te;try{let De=await(0,Ji.request)({method:"GET",url:e,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}}),[,q]=this.PATTERN.exec(e),F=new DOMParser().parseFromString(De,"text/html"),ye=$t("ytInitialData",F.querySelectorAll("script")),R=typeof ye!="undefined"?JSON.parse(ye.value):{},Me=(y=(k=(v=(u=(c=(l=(p=(s=(r=(n=R==null?void 0:R.header)==null?void 0:n.pageHeaderRenderer)==null?void 0:r.content)==null?void 0:s.pageHeaderViewModel)==null?void 0:p.metadata)==null?void 0:l.contentMetadataViewModel)==null?void 0:c.metadataRows)==null?void 0:u[1])==null?void 0:v.metadataParts)==null?void 0:k[0])==null?void 0:y.text.content;Me===null&&console.warn("Unable to parse subscribers count.");let Ve=(I=(E=(X=(x=(z=(U=(j=(S=(N=(D=R==null?void 0:R.header)==null?void 0:D.pageHeaderRenderer)==null?void 0:N.content)==null?void 0:S.pageHeaderViewModel)==null?void 0:j.metadata)==null?void 0:U.contentMetadataViewModel)==null?void 0:z.metadataRows)==null?void 0:x[1])==null?void 0:X.metadataParts)==null?void 0:E[1])==null?void 0:I.text.content;return Ve===null&&console.warn("Unable to parse subscribers count."),{date:this.getFormattedDateForContent(a),channelId:(le=(ne=(J=R==null?void 0:R.metadata)==null?void 0:J.channelMetadataRenderer)==null?void 0:ne.externalId)!=null?le:"",channelTitle:(Ie=(Ee=(V=R==null?void 0:R.metadata)==null?void 0:V.channelMetadataRenderer)==null?void 0:Ee.title)!=null?Ie:"",channelDescription:(G=(O=(M=R==null?void 0:R.metadata)==null?void 0:M.channelMetadataRenderer)==null?void 0:O.description)!=null?G:"",channelURL:q,channelAvatar:(fe=(me=(L=(re=(w=(Ae=R==null?void 0:R.metadata)==null?void 0:Ae.channelMetadataRenderer)==null?void 0:w.avatar)==null?void 0:re.thumbnails)==null?void 0:L[0])==null?void 0:me.url)!=null?fe:"",channelBanner:(te=($=(_e=(Se=(ue=(xe=(be=(ge=(Ce=(ve=R==null?void 0:R.header)==null?void 0:ve.pageHeaderRenderer)==null?void 0:Ce.content)==null?void 0:ge.pageHeaderViewModel)==null?void 0:be.banner)==null?void 0:xe.imageBannerViewModel)==null?void 0:ue.image)==null?void 0:Se.sources)==null?void 0:_e[0])==null?void 0:$.url)!=null?te:"",channelSubscribersCount:this.parseNumberValue(Me!=null?Me:""),channelVideosCount:this.parseNumberValue(Ve!=null?Ve:""),channelVideosURL:`${q}/videos`,channelShortsURL:`${q}/shorts`}}catch(De){st(De)}}async parseApiResponse(e,a){var c,u,v,k,y;let n=new URL("https://youtube.googleapis.com/youtube/v3/channels?part=snippet,contentDetails,statistics,brandingSettings"),[,r,s,p,l]=this.PATTERN.exec(e);if(s)n.searchParams.append("id",s);else if(l)n.searchParams.append("forHandle",l);else if(p){let D=await this.parseSchema(e,a);n.searchParams.append("id",D.channelId)}else throw new Error("Unable to compose Youtube API URL");n.searchParams.append("key",this.plugin.settings.youtubeApiKey);try{let D=await(0,Ji.request)({method:"GET",url:n.toString(),headers:{Accept:"application/json"}}),N=JSON.parse(D);if(N.items.length===0)throw new Error(`Channel (${e}) cannot be fetched from API`);let S=N.items[0];return{date:this.getFormattedDateForContent(a),channelId:S.id,channelTitle:S.snippet.title,channelDescription:S.snippet.description,channelURL:r,channelAvatar:(u=(c=S.snippet.thumbnails)==null?void 0:c.high.url)!=null?u:S.snippet.thumbnails.default.url,channelBanner:(y=(k=(v=S.brandingSettings)==null?void 0:v.image)==null?void 0:k.bannerExternalUrl)!=null?y:"",channelSubscribersCount:S.statistics.subscriberCount,channelVideosCount:S.statistics.videoCount,channelVideosURL:`${r}/videos`,channelShortsURL:`${r}/shorts`}}catch(D){st(D)}}parseNumberValue(e){let a=/(\d+(?:\.\d+)?)(K|M|B)?/,n=e.match(a);if(!n)return 0;let[,r,s]=n;if(typeof s=="undefined")return Number(r);switch(s){case"K":return Number(r)*1e3;case"M":return Number(r)*1e6;case"B":return Number(r)*1e9}}};var ce=require("obsidian");var ut=class extends Error{constructor(t){super(t),this.name="FileNotFoundError"}};var Be=class extends Error{constructor(t){super(t),this.name="FileExistsError"}};var _t=class{constructor(t,e){_(this,"plugin");_(this,"templateEngine");this.plugin=t,this.templateEngine=e}async saveNote(t){let e;if(this.plugin.app.vault.adapter instanceof ce.CapacitorAdapter||this.plugin.app.vault.adapter instanceof ce.FileSystemAdapter?e=yt("/",t.getFullFilename(),this.plugin.app.vault.adapter,this.plugin.getFileSystemLimits()):e=(0,ce.normalizePath)(`/${t.getFullFilename()}`),this.plugin.settings.inboxDir){let a=this.templateEngine.render(this.plugin.settings.inboxDir,{date:Tt(t.createdAt,this.plugin.settings.dateTitleFmt),fileName:t.fileName,contentType:t.contentType});await this.createDirectory(a),this.plugin.app.vault.adapter instanceof ce.CapacitorAdapter||this.plugin.app.vault.adapter instanceof ce.FileSystemAdapter?e=yt(a,t.getFullFilename(),this.plugin.app.vault.adapter,this.plugin.getFileSystemLimits()):e=(0,ce.normalizePath)(`${a}/${t.getFullFilename()}`)}if(t.filePath=e,await this.exists(t.filePath))throw new Be(`${t.getFullFilename()} already exists!`);{let a=await this.plugin.app.vault.create(t.filePath,t.content);(this.plugin.settings.openNewNote||this.plugin.settings.openNewNoteInNewTab)&&this.plugin.app.workspace.getLeaf(this.plugin.settings.openNewNoteInNewTab?"tab":!1).openFile(a),new ce.Notice(`${t.getFullFilename()} created successfully`)}}async createDirectory(t){let e=(0,ce.normalizePath)(t),a=this.plugin.app.vault.getAbstractFileByPath(e);a&&a instanceof ce.TFolder||await this.plugin.app.vault.createFolder(e)}async exists(t){return await this.plugin.app.vault.adapter.exists(t)}getFileByPath(t){let e=this.plugin.app.vault.getFileByPath(t);if(e===null)throw new ut(`File not found: ${t}`);return e}async appendToExistingNote(t){let e;try{e=this.getFileByPath(t.filePath)}catch(a){if(a instanceof ut)new ce.Notice(`Unable to edit ${t.getFullFilename()}`);else throw a}await this.plugin.app.vault.process(e,a=>`${a}
${t.content}`)}};var Ct=require("obsidian");var Dt=require("obsidian");var kt=class extends Dt.Modal{constructor(t,e,a){super(t),this.setTitle("Duplicate notes detected");let n=e.map(s=>`<li>${s.fileName}</li>`).join("");this.setContent(Bt(`<ul>${n}</ul>`));let r=!1;new Dt.Setting(this.contentEl).setName("Do not ask again").addToggle(s=>{s.setValue(!1).onChange(()=>r=!0)}),new Dt.Setting(this.contentEl).addButton(s=>s.setButtonText("Append to existing").setCta().onClick(()=>{this.close(),a("appendToExisting",r)})).addButton(s=>s.setButtonText("Nothing").onClick(()=>{this.close(),a("nothing",r)}))}};var Jt=class{constructor(t,e,a){this.parserCreator=t;this.plugin=e;this.repository=a}async createNote(t){let e=await this.makeNote(t);try{await this.repository.saveNote(e)}catch(a){a instanceof Be&&this.handleFileExistsError([e])}}async createNotesFromBatch(t){let e=cn(t,this.plugin.settings.batchProcessDelimiter),a=[];for(let n of e.everyLineIsURL?e.urls:[t]){let r=await this.makeNote(n);try{await this.repository.saveNote(r)}catch(s){s instanceof Be&&a.push(r)}}a.length>0&&this.handleFileExistsError(a)}async insertContentAtEditorCursorPosition(t,e){let a=await this.makeNote(t);e.replaceRange(a.content,e.getCursor())}async makeNote(t){return await(await this.parserCreator.createParser(t)).prepareNote(t)}openNote(t){if(this.plugin.settings.openNewNote||this.plugin.settings.openNewNoteInNewTab)try{let e=this.repository.getFileByPath(t.filePath);this.plugin.app.workspace.getLeaf(this.plugin.settings.openNewNoteInNewTab?"tab":!1).openFile(e)}catch(e){console.error(e),new Ct.Notice(`Unable to open ${t.getFullFilename()}`)}}async handleFileExistsError(t){switch(this.plugin.settings.fileExistsStrategy){case"ask":new kt(this.plugin.app,t,(e,a)=>{this.handleFileAskModalResponse(e,a,t)}).open();break;case"nothing":this.handleFileExistsStrategyNothing(t);break;case"appendToExisting":this.handleFileExistsStrategyAppend(t);break}}async handleFileAskModalResponse(t,e,a){switch(t){case"nothing":this.handleFileExistsStrategyNothing(a);break;case"appendToExisting":this.handleFileExistsStrategyAppend(a);break}e&&this.plugin.saveSetting("fileExistsStrategy",t),a.length===1&&this.openNote(a.shift())}async handleFileExistsStrategyAppend(t){for(let e of t)try{await this.repository.appendToExistingNote(e),new Ct.Notice(`${e.getFullFilename()} was updated.`)}catch(a){console.error(a),new Ct.Notice(`${e.getFullFilename()} was not updated!`,0)}}handleFileExistsStrategyNothing(t){for(let e of t)new Ct.Notice(`${e.getFullFilename()} already exists.`)}};var Zt=class{constructor(t){this.noteService=t}async processContent(t){this.noteService.createNote(t)}async processContentBatch(t){this.noteService.createNotesFromBatch(t)}async insertContentAtEditorCursorPosition(t,e){this.noteService.insertContentAtEditorCursorPosition(t,e)}};var Qt=class extends dt.Plugin{constructor(){super(...arguments);_(this,"api");_(this,"settings");_(this,"fileSystemLimits");_(this,"noteService");_(this,"parserCreator");_(this,"templateEngine");_(this,"vaultRepository")}getFileSystemLimits(){return this.fileSystemLimits}getVaultRepository(){return this.vaultRepository}async onload(){await this.loadSettings(),this.fileSystemLimits=Ma(dt.Platform,this.settings),this.templateEngine=new At,this.parserCreator=new wt([new za(this.app,this,this.templateEngine),new St(this.app,this,this.templateEngine),new ja(this.app,this,this.templateEngine),new Wa(this.app,this,this.templateEngine),new ln(this.app,this,this.templateEngine),new mn(this.app,this,this.templateEngine),new yn(this.app,this,this.templateEngine),new wn(this.app,this,this.templateEngine),new Nt(this.app,this,this.templateEngine),new Et(this.app,this,this.templateEngine),new pt(this.app,this,this.templateEngine),new xn(this.app,this,this.templateEngine)]),this.vaultRepository=new _t(this,this.templateEngine),this.noteService=new Jt(this.parserCreator,this,this.vaultRepository),this.api=new Zt(this.noteService),(0,dt.addIcon)("read-it-later",ns),this.addRibbonIcon("read-it-later","ReadItLater: Create from clipboard",async()=>{await this.api.processContent(await this.getTextClipboardContent())}),this.addCommand({id:"save-clipboard-to-notice",name:"Create from clipboard",callback:async()=>{await this.api.processContent(await this.getTextClipboardContent())}}),this.addCommand({id:"create-from-clipboard-batch",name:"Create from batch in clipboard",callback:async()=>{await this.api.processContentBatch(await this.getTextClipboardContent())}}),this.addCommand({id:"insert-at-cursor",name:"Insert at the cursor position",editorCallback:async e=>{await this.api.insertContentAtEditorCursorPosition(await this.getTextClipboardContent(),e)}}),this.addSettingTab(new jt(this.app,this)),this.settings.extendShareMenu&&this.registerEvent(this.app.workspace.on("receive-text-menu",(e,a)=>{e.addItem(n=>{n.setTitle("ReadItLater"),n.setIcon("read-it-later"),n.onClick(()=>this.api.processContent(a))})})),this.registerEvent(this.app.workspace.on("url-menu",(e,a)=>{Le(a,[ot,lt])&&e.addItem(n=>{n.setTitle("ReadItLater"),n.setIcon("read-it-later"),n.onClick(()=>this.api.processContent(a))})}))}async loadSettings(){this.settings=Object.assign({},d,await this.loadData())}async saveSetting(e,a){this.settings[e]=a,await this.saveSettings()}async saveSettings(){await this.saveData(this.settings)}async getTextClipboardContent(){return await navigator.clipboard.readText()}},ns=`
<svg fill="currentColor" stroke="currentColor" version="1.1" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<g>
<path d="m365.9,144.9c-12.3,0-24.2,1.8-35.4,5.2v-114.7h-96.9l7.3-35.4h-150.2l6.8,35.4h-97.5v454.6h330.5v-102.1c11.2,3.4 23.1,5.2 35.4,5.2 68.8-0.1 124.1-56.4 124.1-124.1 0-67.8-55.3-124.1-124.1-124.1zm-150.1-124l-10.4,50h-79.2l-9.4-50h99zm93.8,448.2h-288.7v-412.8h80.7l6.8,35.4h113.6l7.3-35.4h80.3v102.2c-27.3,14-48.8,37.9-59.7,66.7h-200.9v20.8h195c-1.4,7.4-2.2,15.1-2.2,22.9 0,13.4 2.2,26.4 6.2,38.6h-199v20.9h208.1c12,21.8 30.3,39.7 52.5,51.1v89.6zm56.3-98c-57.3,0-103.2-46.9-103.2-103.2s46.9-103.2 103.2-103.2c57.3,0 103.2,46.9 103.2,103.2s-45.8,103.2-103.2,103.2z"/>
<polygon points="426.4,223.1 346.1,303.4 313.8,271.1 299.2,285.7 346.1,332.6 441,237.7 "/>
<rect width="233.5" x="49" y="143.9" height="20.9"/>
<rect width="233.5" x="49" y="388.9" height="20.9"/>
</g>
</svg>`;
/*! Bundled license information:
dompurify/dist/purify.js:
(*! @license DOMPurify 2.5.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.6/LICENSE *)
*/
/* nosourcemap */